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

kamel stuck when a secret has an illegal name #356

Closed
ppalaga opened this issue Jan 22, 2019 · 2 comments
Closed

kamel stuck when a secret has an illegal name #356

ppalaga opened this issue Jan 22, 2019 · 2 comments
Assignees

Comments

@ppalaga
Copy link

ppalaga commented Jan 22, 2019

Steps to reproduce:

# take a properties file
$ cat application.properties
prop1 = val1
prop2 = val2

# create a secret from it having a name containing period
$ oc create secret generic forwarder.props --from-file=application.properties

$ kamel run MyCamelRouter.java --dev --secret forwarder.props
integration "my-camel-router" created
integration "my-camel-router" in phase Building Context
integration "my-camel-router" in phase Deploying

EXPECTED: kamel either succeeds or fails
ACTUAL: kamel stuck in "phase Deploying" forever

There is the following entry in camel-k-operator log:

{"level":"error","ts":1548163869.639509,"logger":"kubebuilder.controller","msg":"Reconciler error","controller":"integration-controller","request":"camel-k/my-camel-router","error":"could not create or replace resource my-camel-router: Deployment.apps \"my-camel-router\" is invalid: [spec.template.spec.volumes[2].name: Invalid value: \"integration-secret-forwarder.props\": a DNS-1123 label must consist of lower case alphanumeric characters or '-', and must start and end with an alphanumeric character (e.g. 'my-name',  or '123-abc', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?'), spec.template.spec.containers[0].volumeMounts[2].name: Not found: \"integration-secret-forwarder.props\"]","errorVerbose":"Deployment.apps \"my-camel-router\" is invalid: [spec.template.spec.volumes[2].name: Invalid value: \"integration-secret-forwarder.props\": a DNS-1123 label must consist of lower case alphanumeric characters or '-', and must start and end with an alphanumeric character (e.g. 'my-name',  or '123-abc', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?'), spec.template.spec.containers[0].volumeMounts[2].name: Not found: \"integration-secret-forwarder.props\"]\ncould not create or replace resource my-camel-router\ngithub.com/apache/camel-k/pkg/util/kubernetes.ReplaceResource\n\t/home/nferraro/gopaths/camel-k/src/github.com/apache/camel-k/pkg/util/kubernetes/replace.go:66\ngithub.com/apache/camel-k/pkg/util/kubernetes.ReplaceResources\n\t/home/nferraro/gopaths/camel-k/src/github.com/apache/camel-k/pkg/util/kubernetes/replace.go:37\ngithub.com/apache/camel-k/pkg/controller/integration.(*deployAction).Handle\n\t/home/nferraro/gopaths/camel-k/src/github.com/apache/camel-k/pkg/controller/integration/deploy.go:69\ngithub.com/apache/camel-k/pkg/controller/integration.(*ReconcileIntegration).Reconcile\n\t/home/nferraro/gopaths/camel-k/src/github.com/apache/camel-k/pkg/controller/integration/integration_controller.go:117\ngithub.com/apache/camel-k/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem\n\t/home/nferraro/gopaths/camel-k/src/github.com/apache/camel-k/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:213\ngithub.com/apache/camel-k/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func1\n\t/home/nferraro/gopaths/camel-k/src/github.com/apache/camel-k/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:158\ngithub.com/apache/camel-k/vendor/k8s.io/apimachinery/pkg/util/wait.JitterUntil.func1\n\t/home/nferraro/gopaths/camel-k/src/github.com/apache/camel-k/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:133\ngithub.com/apache/camel-k/vendor/k8s.io/apimachinery/pkg/util/wait.JitterUntil\n\t/home/nferraro/gopaths/camel-k/src/github.com/apache/camel-k/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:134\ngithub.com/apache/camel-k/vendor/k8s.io/apimachinery/pkg/util/wait.Until\n\t/home/nferraro/gopaths/camel-k/src/github.com/apache/camel-k/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:88\nruntime.goexit\n\t/usr/local/go/src/runtime/asm_amd64.s:2361","stacktrace":"github.com/apache/camel-k/vendor/github.com/go-logr/zapr.(*zapLogger).Error\n\t/home/nferraro/gopaths/camel-k/src/github.com/apache/camel-k/vendor/github.com/go-logr/zapr/zapr.go:128\ngithub.com/apache/camel-k/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem\n\t/home/nferraro/gopaths/camel-k/src/github.com/apache/camel-k/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:215\ngithub.com/apache/camel-k/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func1\n\t/home/nferraro/gopaths/camel-k/src/github.com/apache/camel-k/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:158\ngithub.com/apache/camel-k/vendor/k8s.io/apimachinery/pkg/util/wait.JitterUntil.func1\n\t/home/nferraro/gopaths/camel-k/src/github.com/apache/camel-k/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:133\ngithub.com/apache/camel-k/vendor/k8s.io/apimachinery/pkg/util/wait.JitterUntil\n\t/home/nferraro/gopaths/camel-k/src/github.com/apache/camel-k/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:134\ngithub.com/apache/camel-k/vendor/k8s.io/apimachinery/pkg/util/wait.Until\n\t/home/nferraro/gopaths/camel-k/src/github.com/apache/camel-k/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:88"}

I guess the period in forwarder.props is the root cause of this situation (and I can rename it), but anyway, the operator should fail fast rather than stay stuck.

@ppalaga
Copy link
Author

ppalaga commented Jan 22, 2019

Yes, I can confirm that renaming the secret from forwarder.props to forwarder-props makes it work.

@lburgazzoli lburgazzoli self-assigned this Jan 22, 2019
@lburgazzoli
Copy link
Contributor

Will work on it

lburgazzoli added a commit to lburgazzoli/apache-camel-k that referenced this issue Jan 22, 2019
lburgazzoli added a commit to lburgazzoli/apache-camel-k that referenced this issue Jan 22, 2019
lburgazzoli added a commit to lburgazzoli/apache-camel-k that referenced this issue Jan 23, 2019
lburgazzoli added a commit to lburgazzoli/apache-camel-k that referenced this issue Jan 23, 2019
ipolyzos pushed a commit to ipolyzos/camel-k that referenced this issue Jul 31, 2019
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