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

pullsecret: global pullsecrets (PROJQUAY-1603) #70

Merged
merged 2 commits into from
Jul 21, 2022
Merged

pullsecret: global pullsecrets (PROJQUAY-1603) #70

merged 2 commits into from
Jul 21, 2022

Conversation

ricardomaraschini
Copy link
Contributor

Add support for OpenShift global pull secret. This secret exists in the
"openshift-config" namespace and is called "pull-secret". We attempt to
use it if we can't find credentials in the pod's namespace.

image/image.go Outdated
secretData := secret.Data[strings.ReplaceAll(string(secret.Type), "kubernetes.io/", ".")]

var config *DockerConfigJson
if err = json.Unmarshal(secretData, &config); err != nil {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

kubernetes.io/dockerconfigjson and kubernetes.io/dockercfg have different structure. One of them looks like {"auths":{"example.com":...}}, another one like {"example.com":...}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That came through my mind. I have chosen not to change this to avoid breaking other stuff. In other words: the code you are referring to here is the very same code that was already there prior to my change. The other format was never supported.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have added support for the SecretTypeDockercfg type as well. PTAL.
/cc @kleesc would you mind checking it once more ?

Add support for OpenShift global pull secret. This secret exists in the
"openshift-config" namespace and is called "pull-secret". We attempt to
use it if we can't find credentials in the pod's namespace.
Added support for kubernetes secrets of type SecretTypeDockercfg.
@ricardomaraschini ricardomaraschini merged commit dc67fbc into quay:master Jul 21, 2022
@HammerMeetNail
Copy link
Contributor

/cherry-pick redhat-3.7

@openshift-cherrypick-robot

@HammerMeetNail: #70 failed to apply on top of branch "redhat-3.7":

Applying: pullsecret: global pullsecrets (PROJQUAY-1603)
Using index info to reconstruct a base tree...
M	image/image.go
M	labeller/labeller.go
Falling back to patching base and 3-way merge...
Auto-merging labeller/labeller.go
Auto-merging image/image.go
CONFLICT (content): Merge conflict in image/image.go
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0001 pullsecret: global pullsecrets (PROJQUAY-1603)
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

In response to this:

/cherry-pick redhat-3.7

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@ricardomaraschini
Copy link
Contributor Author

/cherry-pick redhat-3.7

@openshift-cherrypick-robot

@ricardomaraschini: new pull request created: #76

In response to this:

/cherry-pick redhat-3.7

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

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

Successfully merging this pull request may close these issues.

5 participants