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

Support for secret type .dockerconfigjson #38

Closed
sdileep opened this issue Mar 25, 2018 · 2 comments
Closed

Support for secret type .dockerconfigjson #38

sdileep opened this issue Mar 25, 2018 · 2 comments

Comments

@sdileep
Copy link

sdileep commented Mar 25, 2018

First push of gitkube-example on to my local cluster went through fine so I thought of pushing an update and realised that I need to setup the registry to get it working. So, I created a kube secret, with name regsecret, for docker following the instructions on the link in the README of gitkube-example and updated the registry of the example remote to be:

  registry:
    url: "docker.io/sdileep"
    credentials:
      secretKeyRef:
        name: regsecret
        key: .dockercfg

Now when I try to push to the example remote, I get the following error:

remote: WARNING: Error loading config file:/home/default-example/.dockercfg - Invalid Auth config file

So, I updated the registry to be:

  registry:
    url: "docker.io/sdileep"
    credentials:
      secretKeyRef:
        name: regsecret
        key: .dockerconfigjson

.dockerconfigjson field of the secret is the base64 representation of docker credentials - I presumed this is what goes in here.

Now when I try to push to the example remote, I get a timeout. Not sure what the correct config here should be, could you please help? Thanks.

@tirumaraiselvan
Copy link
Collaborator

I think you hit the recent change in kubectl (v1.9) of docker-secret type. This creates a secret of type .dockerconfigjson as opposed to .dockercfg. Unfortunately, these types are not compatible with each other. So replacing the key will not work. For some reason, this breaking change was actually approved kubernetes/kubernetes#53916

For gitkube, we will have to create a fix which works with both types of secret. For now, you can try using a kubectl prior to v1.9 (say 1.8.8) to create the secret. Will update this issue once we support both.

@tirumaraiselvan tirumaraiselvan changed the title Subsequent pushes to remote Support for secret type .dockerconfigjson Mar 26, 2018
@tirumaraiselvan
Copy link
Collaborator

Fixed in #45

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

No branches or pull requests

2 participants