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

Dashboard error when viewing dockerconfigjson secret with "auth" encoded credentials instead of "username" and "password" keys #10813

Open
km-bh opened this issue Apr 16, 2024 · 0 comments
Labels
kind/bug QA/dev-automation Issues that engineers have written automation around so QA doesn't have look at this

Comments

@km-bh
Copy link

km-bh commented Apr 16, 2024

Setup

  • Rancher version: 2.7.6
  • Rancher UI Extensions: None
  • Browser type & version: Chrome (latest) & Firefox (latest)

Describe the bug
When attempting to view a dockerconfigjson-type secret whose data contains "auths.SOME-REGISTRY: {auth:base64-encoded-string}" instead of "auths.SOME-REGISTRY: {username:USER,password:PASS}", the client experiences an error page with the last of the following javascript errors from the console:

console.js:31 Cannot read properties of null (reading 'length')
console.js:31 Cannot read properties of null (reading 'slice')
console.js:31 Cannot read properties of null (reading 'length')
console.js:31 Cannot read properties of null (reading 'slice')

To Reproduce

  • base64-encode a username:password string
echo -n 'tester:testing' | base64
dGVzdGVyOnRlc3Rpbmc=
  • Create a docker config.json with the previous auth string.
cat <<EOF > config.json
{
    "auths": {
        "testreg.example.org": {
            "auth": "dGVzdGVyOnRlc3Rpbmc="
        }
    }
}
EOF
  • Create a dockerconfigjson-type secret from this config.json file
kubectl create secret generic testreg-pull-creds --from-file=.dockerconfigjson=./config.json --type=kubernetes.io/dockerconfigjson

Result
When attempting to view the secret in the Rancher UI (by clicking the name; not viewing as YAML or anything), there is a short pause and the user gets a white screen with "Cannot read properties of null (reading 'slice')". The console shows additional "null" errors.

Expected Result
The user should be presented with a screen showing details of the secret, including values if the option to view secret data is enabled.

Screenshots
image
image

Additional context
This error does not seem to be present in 2.8.2. However, only the registry url is shown; it does not attempt to decode the "auth" block to extract the username:password string.

@km-bh km-bh added the kind/bug label Apr 16, 2024
@github-actions github-actions bot added [zube]: To Triage QA/dev-automation Issues that engineers have written automation around so QA doesn't have look at this labels Apr 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug QA/dev-automation Issues that engineers have written automation around so QA doesn't have look at this
Projects
None yet
Development

No branches or pull requests

2 participants