Create GCR secret error: exactly one NAME is required, got 26

7/9/2018

I am trying to create a docker-registry secrete for GCR, but am getting a really cryptic error message. This is the kubectl cmd that I am running:

kubectl create secret docker-registry gcrsecret --docker-username=_json_key --docker-password=”$(cat wk-test-1-b3c9659d9a07.json)” --docker-server=https://gcr.io --docker-email=rynslmns@gmail.com

But it is erroring out with the following error message:

error: exactly one NAME is required, got 26

Any thoughts? I am not seeing anything obvious in the documentation.

-- Ryan Salmons
google-cloud-platform
google-container-registry
google-kubernetes-engine

4 Answers

1/13/2020

My issue was that I copied and pasted the command from a browser to a terminal. Typing the code directly into the terminal solved the issue.

-- charlchad
Source: StackOverflow

7/10/2018

It seems that you are using (Unicode RIGHT DOUBLE QUOTATION MARK) instead of " (ASCII 0x22), which is confusing your shell.

-- jonjohnson
Source: StackOverflow

5/10/2019

Future readers. Watch out for any spaces.

Bad:

kubectl create configmap special-config --from-literal=special.how=very --from-literal= special.type='charm'

error: exactly one NAME is required, got 2

Works:

kubectl create configmap special-config --from-literal=special.how=very --from-literal=special.type='charm'

configmap "special-config" created

Note the space before "special.type" in the bad example.

-- granadaCoder
Source: StackOverflow

2/10/2019

If you're on windows use ' rather than "

-- Prasanth Louis
Source: StackOverflow