Skip to content
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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

hugoShaka
Copy link
Contributor

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.

Copy link
Contributor

@marcoandredinis marcoandredinis left a 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.

Comment on lines +149 to +159
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)
}
Copy link
Contributor

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

Suggested change
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)
}

@tigrato
Copy link
Contributor

tigrato commented Feb 4, 2025

Do we have public key for the stage env? If we do, we could hard code that key instead of allowing a custom one.

Yeah, I agree with Marco. We should hardcore both keys even if stg is not enabled by default

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants