-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Add support for custom public key file in kube updater #51815
base: master
Are you sure you want to change the base?
Conversation
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.
Do we have public key for the stage env?
If we do, we could hard code that key instead of allowing a custom one.
file, err := os.Open(publicKeyFile) | ||
if err != nil { | ||
ctrl.Log.Error(err, "Failed to open public key file.", "file", publicKeyFile) | ||
os.Exit(1) | ||
} | ||
defer file.Close() | ||
key, err := io.ReadAll(file) | ||
if err != nil { | ||
ctrl.Log.Error(err, "Failed to read public key file.", "file", publicKeyFile) | ||
os.Exit(1) | ||
} |
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.
We could use os.ReadFile instead
file, err := os.Open(publicKeyFile) | |
if err != nil { | |
ctrl.Log.Error(err, "Failed to open public key file.", "file", publicKeyFile) | |
os.Exit(1) | |
} | |
defer file.Close() | |
key, err := io.ReadAll(file) | |
if err != nil { | |
ctrl.Log.Error(err, "Failed to read public key file.", "file", publicKeyFile) | |
os.Exit(1) | |
} | |
key, err := os.ReadFile(publicKeyFile) | |
if err != nil { | |
ctrl.Log.Error(err, "Failed to read public key file.", "file", publicKeyFile) | |
os.Exit(1) | |
} |
Yeah, I agree with Marco. We should hardcore both keys even if stg is not enabled by default |
Since we moved the dev releases out of the prod registry I cannot test the updater anymore agianst dev releases.
This PR adds a flag to pass a file that will contain the staging public key.