You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Assume you have a secret my-reg-creds which contains image registry credentials which you intend to use with the registry images collector for preflights or support bundles. If the basic authentication token is generated from a username or password containing colons (:), the collector will fail to fetch the image even if the image exists
Expected Behavior
Credentials with colons should not lead to errors
Steps To Reproduce
Create an image pull secret using the command below
apiVersion: troubleshoot.sh/v1beta2kind: Preflightspec:
analyzers:
- registryImages:
checkName: Check imagescollectorName: ""outcomes:
- fail:
when: "errors > 0"message: Failed to check if images are present in registry
- pass:
message: All images are availablecollectors:
- registryImages:
imagePullSecret:
name: my-reg-credstype: kubernetes.io/dockerconfigjsonimages:
- registry.k8s.io/kube-scheduler:v1.29.5
Run preflight --interactive=false spec.yaml and note that you get the output below
--- FAIL: Check images
--- Failed to check if images are present in registry
--- FAIL
FAILED
Additional Context
The registry image collector assumes that credentials will be of the format username:password where neither of the parts separate parts contain a colon (:). This is not always the case. gcr.io for example contains a password that is a JSON object which looks like below
Bug Description
Assume you have a secret
my-reg-creds
which contains image registry credentials which you intend to use with the registry images collector for preflights or support bundles. If the basic authentication token is generated from ausername
orpassword
containing colons (:
), the collector will fail to fetch the image even if the image existsExpected Behavior
Credentials with colons should not lead to errors
Steps To Reproduce
spec.yaml
and drop this spec in the filepreflight --interactive=false spec.yaml
and note that you get the output belowAdditional Context
username:password
where neither of the parts separate parts contain a colon (:
). This is not always the case.gcr.io
for example contains a password that is a JSON object which looks like belowklog.Error
formatting errors such as this one. Here are some lines I've noted need to be loggedtroubleshoot/pkg/collect/registry.go
Line 168 in ce15527
Include the following information.
The text was updated successfully, but these errors were encountered: