-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(ctl): Add support for stacklet credentials
subcommand
#108
Conversation
To conditionally display the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On second thought, I'm not sure list
is the right place to display this.. I think it might be more appropriate to have a "show creds for this specific stacklet" command?
} | ||
|
||
#[derive(Debug, Snafu)] | ||
pub enum StackletError { | ||
#[snafu(display("kubernetes error"))] | ||
#[snafu(display("kubernetes error"), context(false))] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really don't love this, if anything I'd like to get rid of these "oh this library failed" catch-alls entirely.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally agreed, but let's maybe tackle this in #55
Ok(credentials) => credentials, | ||
Err(err) => match err { | ||
CredentialsError::KubeError { source } => return Err(source.into()), | ||
CredentialsError::NoSecret => None, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there much value to treating this as a separate condition in get_credentials
if we just end up flattening it back into None
afterwards?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel like the get_credentials
function should report this error. The implementer (stackablectl) chooses to map it to None
, which indicates that no credentials output should be printed.
The command currently fails with an 404 error. It seems like that the k8s API is unable to find the requested object.
--show-credentials
in stacklets list commandstacklet credentials
subcommand
For the record: a52b933 fixes the 404 error, happy to explain it offline |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Command worked for me 👍
➜ stackable-cockpit git:(feat/credential-output) cargo r -p stackablectl -- stacklet credentials --product-namespace sbernauer superset simple-superset
Credentials for superset (simple-superset) in namespace 'sbernauer':
USERNAME admin
PASSWORD admin
In case i changed stacklet.data["spec"]["clusterConfig"]["credentialsSecret"]
to stacklet.data["spec"]["clusterConfig"]["credentialsSecret123"]
it showed No credentials
and did not give an error.
This is good, as we will remove that field in the future.
Tracked by #98, closes #107
This adds support for credential output when using. They are only displayed when the user explicitly want to retrieve them via a dedicated subcommand. Using a subcommand makes this an opt-in, as the output contains sensitive data. Test it with:
The implementation is not final and will change with the introduction of Discovery 2.0.
Currently blocked by #106Currently blocked by #113