ppalaga opened a new issue #356: kamel stuck when a secret has an illegal name
URL: https://github.com/apache/camel-k/issues/356
 
 
   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.
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to