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

unsupported secret type for registry authentication #1360

Closed
TeslaCN opened this issue Mar 19, 2020 · 4 comments
Closed

unsupported secret type for registry authentication #1360

TeslaCN opened this issue Mar 19, 2020 · 4 comments

Comments

@TeslaCN
Copy link
Member

TeslaCN commented Mar 19, 2020

camel-k:1.0.0-RC2

I executed kamel install as the document Configuring a DockerHub Registry says, and I checked the secret kubectl get secret camel-k-registry-secret -n camel-k -o yaml is equals to ~/.docker/config.json.

It doesn't work.

{"level":"info","ts":1584622884.595538,"logger":"camel-k.controller.integrationkit","msg":"Reconciling IntegrationKit","request-namespace":"camel-k","request-name":"kit-bppmq63f9s4nhqiike0g"}
{"level":"info","ts":1584622884.595607,"logger":"camel-k.controller.integrationkit","msg":"Invoking action build-submitted","request-namespace":"camel-k","request-name":"kit-bppmq63f9s4nhqiike0g","api-version":"camel.apache.org/v1","kind":"IntegrationKit","ns":"camel-k","name":"kit-bppmq63f9s4nhqiike0g"}
{"level":"info","ts":1584622884.5957136,"logger":"camel-k.trait","msg":"Apply trait: camel"}
{"level":"info","ts":1584622884.5961041,"logger":"camel-k.trait","msg":"Apply trait: builder"}
{"level":"error","ts":1584622884.5961564,"logger":"controller-runtime.controller","msg":"Reconciler error","controller":"integrationkit-controller","request":"camel-k/kit-bppmq63f9s4nhqiike0g","error":"error during trait customization: unsupported secret type for registry authentication","errorVerbose":"unsupported secret type for registry authentication\ngithub.com/apache/camel-k/pkg/trait.getRegistrySecretFor\n\tgithub.com/apache/camel-k@/pkg/trait/builder.go:404\ngithub.com/apache/camel-k/pkg/trait.(*builderTrait).buildahTask\n\tgithub.com/apache/camel-k@/pkg/trait/builder.go:244\ngithub.com/apache/camel-k/pkg/trait.(*builderTrait).Apply\n\tgithub.com/apache/camel-k@/pkg/trait/builder.go:83\ngithub.com/apache/camel-k/pkg/trait.(*Catalog).apply\n\tgithub.com/apache/camel-k@/pkg/trait/trait_catalog.go:115\ngithub.com/apache/camel-k/pkg/trait.Apply\n\tgithub.com/apache/camel-k@/pkg/trait/trait.go:46\ngithub.com/apache/camel-k/pkg/controller/integrationkit.(*buildAction).handleBuildSubmitted\n\tgithub.com/apache/camel-k@/pkg/controller/integrationkit/build.go:76\ngithub.com/apache/camel-k/pkg/controller/integrationkit.(*buildAction).Handle\n\tgithub.com/apache/camel-k@/pkg/controller/integrationkit/build.go:57\ngithub.com/apache/camel-k/pkg/controller/integrationkit.(*ReconcileIntegrationKit).Reconcile\n\tgithub.com/apache/camel-k@/pkg/controller/integrationkit/integrationkit_controller.go:228\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler\n\tsigs.k8s.io/controller-runtime@v0.4.0/pkg/internal/controller/controller.go:256\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem\n\tsigs.k8s.io/controller-runtime@v0.4.0/pkg/internal/controller/controller.go:232\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).worker\n\tsigs.k8s.io/controller-runtime@v0.4.0/pkg/internal/controller/controller.go:211\nk8s.io/apimachinery/pkg/util/wait.JitterUntil.func1\n\tk8s.io/apimachinery@v0.0.0/pkg/util/wait/wait.go:152\nk8s.io/apimachinery/pkg/util/wait.JitterUntil\n\tk8s.io/apimachinery@v0.0.0/pkg/util/wait/wait.go:153\nk8s.io/apimachinery/pkg/util/wait.Until\n\tk8s.io/apimachinery@v0.0.0/pkg/util/wait/wait.go:88\nruntime.goexit\n\truntime/asm_amd64.s:1357\nerror during trait customization\ngithub.com/apache/camel-k/pkg/trait.Apply\n\tgithub.com/apache/camel-k@/pkg/trait/trait.go:47\ngithub.com/apache/camel-k/pkg/controller/integrationkit.(*buildAction).handleBuildSubmitted\n\tgithub.com/apache/camel-k@/pkg/controller/integrationkit/build.go:76\ngithub.com/apache/camel-k/pkg/controller/integrationkit.(*buildAction).Handle\n\tgithub.com/apache/camel-k@/pkg/controller/integrationkit/build.go:57\ngithub.com/apache/camel-k/pkg/controller/integrationkit.(*ReconcileIntegrationKit).Reconcile\n\tgithub.com/apache/camel-k@/pkg/controller/integrationkit/integrationkit_controller.go:228\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler\n\tsigs.k8s.io/controller-runtime@v0.4.0/pkg/internal/controller/controller.go:256\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem\n\tsigs.k8s.io/controller-runtime@v0.4.0/pkg/internal/controller/controller.go:232\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).worker\n\tsigs.k8s.io/controller-runtime@v0.4.0/pkg/internal/controller/controller.go:211\nk8s.io/apimachinery/pkg/util/wait.JitterUntil.func1\n\tk8s.io/apimachinery@v0.0.0/pkg/util/wait/wait.go:152\nk8s.io/apimachinery/pkg/util/wait.JitterUntil\n\tk8s.io/apimachinery@v0.0.0/pkg/util/wait/wait.go:153\nk8s.io/apimachinery/pkg/util/wait.Until\n\tk8s.io/apimachinery@v0.0.0/pkg/util/wait/wait.go:88\nruntime.goexit\n\truntime/asm_amd64.s:1357","stacktrace":"github.com/go-logr/zapr.(*zapLogger).Error\n\tgithub.com/go-logr/zapr@v0.1.1/zapr.go:128\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler\n\tsigs.k8s.io/controller-runtime@v0.4.0/pkg/internal/controller/controller.go:258\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem\n\tsigs.k8s.io/controller-runtime@v0.4.0/pkg/internal/controller/controller.go:232\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).worker\n\tsigs.k8s.io/controller-runtime@v0.4.0/pkg/internal/controller/controller.go:211\nk8s.io/apimachinery/pkg/util/wait.JitterUntil.func1\n\tk8s.io/apimachinery@v0.0.0/pkg/util/wait/wait.go:152\nk8s.io/apimachinery/pkg/util/wait.JitterUntil\n\tk8s.io/apimachinery@v0.0.0/pkg/util/wait/wait.go:153\nk8s.io/apimachinery/pkg/util/wait.Until\n\tk8s.io/apimachinery@v0.0.0/pkg/util/wait/wait.go:88"}
@astefanutti
Copy link
Member

Thanks for the report. It seems the secret that's created by the kamel install command is not compatible with the buildah nor kaniko build strategy.

These expect a secret with a .dockercfg or .dockerconfigjson key. As a work-around, you can create the secret manually, instead of relying on the kamel CLI.

@TeslaCN
Copy link
Member Author

TeslaCN commented Mar 20, 2020

@astefanutti Thanks for you reply.
Sorry i didn't describe it clearly.

kubectl get secret camel-k-registry-secret -n camel-k -o yaml The data in camel-k-registry-secret is indeed in .dockerconfigjson: a_base64_string format. Decode the base64 string, the content is the same as the file ~/.docker/config.json.

Please guide me what should I do. Thanks!

@astefanutti
Copy link
Member

I've improved registry configuration with Buildah in #1295. It's not in 1.0.0-RC2 version, but will be in the next release. In the meantime, you could try from the master branch, if that's an option for you.

@TeslaCN
Copy link
Member Author

TeslaCN commented Mar 20, 2020

Thanks! I am looking forward to the next release.

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