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

Error when running camel-k in global mode with label selection #3161

Closed
lburgazzoli opened this issue Apr 3, 2022 · 2 comments · Fixed by #3172
Closed

Error when running camel-k in global mode with label selection #3161

lburgazzoli opened this issue Apr 3, 2022 · 2 comments · Fixed by #3172
Assignees
Labels
area/managed-service Camel K as a Managed Service kind/bug Something isn't working

Comments

@lburgazzoli
Copy link
Contributor

I've installed camel-k in global mode wit the following command:

kamel install --olm=false --namespace bar --global --operator-env-vars KAMEL_OPERATOR_ID=foo

Which generates a deployment with the following env vars:

    spec:
      containers:
      - args:
        - --monitoring-port=8080
        - --health-port=8081
        command:
        - kamel
        - operator
        env:
        - name: WATCH_NAMESPACE
        - name: OPERATOR_NAME
          value: camel-k
        - name: POD_NAME
          valueFrom:
            fieldRef:
              apiVersion: v1
              fieldPath: metadata.name
        - name: NAMESPACE
          valueFrom:
            fieldRef:
              apiVersion: v1
              fieldPath: metadata.namespace
        - name: KAMEL_OPERATOR_ID
          value: foo

At this point, if I create a kamelet like

apiVersion: camel.apache.org/v1alpha1
kind: KameletBinding
metadata:
  annotations:
    camel.apache.org/operator.id: foo
    trait.camel.apache.org/container.image: acme/bz:0.1.17
  labels:
  name: c94kmpbc5fc71cmm8g6g
spec:
  sink:
    ref:
      apiVersion: camel.apache.org/v1alpha1
      kind: Kamelet
      name: og-sink
  source:
    ref:
      apiVersion: camel.apache.org/v1alpha1
      kind: Kamelet
      name: timer-source

The operator fails with:

{
    "level": "error",
    "ts": 1648975968.5594068,
    "logger": "controller.integration-controller",
    "msg": "Reconciler error",
    "reconciler group": "camel.apache.org",
    "reconciler kind": "Integration",
    "name": "mctr-c94kmpbc5fc71cmm8g6g",
    "namespace": "mctr-c947n1bc5fc71cmlhrdg",
    "error": "error during trait customization: unable to find catalog matching version requirement: runtime=, provider=quarkus",
    "errorVerbose": "unable to find catalog matching version requirement: runtime=, provider=quarkus\nerror during trait customization\ngithub.com/apache/camel-k/pkg/trait.Apply\n\tgithub.com/apache/camel-k/pkg/trait/trait.go:48\ngithub.com/apache/camel-k/pkg/controller/integration.(*platformSetupAction).Handle\n\tgithub.com/apache/camel-k/pkg/controller/integration/platform_setup.go:54\ngithub.com/apache/camel-k/pkg/controller/integration.(*reconcileIntegration).Reconcile\n\tgithub.com/apache/camel-k/pkg/controller/integration/integration_controller.go:309\ngithub.com/apache/camel-k/pkg/util/monitoring.(*instrumentedReconciler).Reconcile\n\tgithub.com/apache/camel-k/pkg/util/monitoring/controller.go:70\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler\n\tsigs.k8s.io/controller-runtime@v0.9.7/pkg/internal/controller/controller.go:298\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem\n\tsigs.k8s.io/controller-runtime@v0.9.7/pkg/internal/controller/controller.go:253\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func2.2\n\tsigs.k8s.io/controller-runtime@v0.9.7/pkg/internal/controller/controller.go:214\nruntime.goexit\n\truntime/asm_amd64.s:1371",
    "stacktrace": "sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func2.2\n\tsigs.k8s.io/controller-runtime@v0.9.7/pkg/internal/controller/controller.go:214"
}
@lburgazzoli lburgazzoli added the kind/bug Something isn't working label Apr 3, 2022
@lburgazzoli
Copy link
Contributor Author

/cc @astefanutti @squakez

@squakez
Copy link
Contributor

squakez commented Apr 4, 2022

I think the problem is because when you install the foo operator on the bar namespace, it creates an IntegrationPlatform which is not assigned to that specific ID, therefore is not reconciled. As a workaround you can edit the bar IntegrationPlatform adding:

  annotations:
    camel.apache.org/operator.id: foo

As soon as that is reconciled, the foo namespace Integration won't fail anymore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/managed-service Camel K as a Managed Service kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants