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

Implement flux create secret oci #2910

Closed
stefanprodan opened this issue Jul 15, 2022 · 4 comments
Closed

Implement flux create secret oci #2910

stefanprodan opened this issue Jul 15, 2022 · 4 comments
Assignees
Labels
area/oci OCI related issues and pull requests

Comments

@stefanprodan
Copy link
Member

Add a new command for generating image pull secrets of type kubernetes.io/dockerconfigjson:

flux create secret oci ghcr \
 --username=<github-username> \
 --password=<github-token> \
 --url=<ghcr-URL>

The implementation PR should be made agains the oci branch, ref: #2856

@stefanprodan stefanprodan added the area/oci OCI related issues and pull requests label Jul 15, 2022
@somtochiama
Copy link
Member

/assign

@stefanprodan
Copy link
Member Author

Implemented in #2920

@aabmets
Copy link

aabmets commented Sep 25, 2023

@stefanprodan
Why does flux create secret oci produce a secret in which the .data.dockerconfigjson value is not base64-encoded?

In your documentation, and I quote: "The secret is expected to be in the same format as the docker config secrets, usually created by kubectl create secret docker-registry". The kubectl command produces a base64-encoded .data.dockerconfigjson value.

If you state that Flux expects the secret to be in the format produced by the kubectl command, then how is the flux create secret oci command supposed to produce a valid docker-registry secret, if it does not produce a base64-encoded .data.dockerconfigjson value?

This is confusing and undocumented behavior. Either the documentation should be improved to explain this deviation from the behavior of the kubectl command, or the flux command should be fixed to conform to the output of the kubectl command.

EDIT: The .data.dockerconfigjson value created by the flux create secret oci command is not base64-encoded, when the command is invoked with the --export > repo-auth.yaml option. When invoked without the option, the command creates a secret in the cluster which conforms to the kubectl command and has the field base64-encoded. It would still be beneficial to document this behavior adequately.

@stefanprodan
Copy link
Member Author

We use stringData, so secret scanners and humans would see that you are committing unencrypted sensitive information to Git.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/oci OCI related issues and pull requests
Projects
None yet
Development

No branches or pull requests

3 participants