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

Component resolvable variables regression #4916

Closed
squakez opened this issue Nov 13, 2023 · 3 comments · Fixed by #4919
Closed

Component resolvable variables regression #4916

squakez opened this issue Nov 13, 2023 · 3 comments · Fixed by #4919
Assignees
Labels
kind/bug Something isn't working
Milestone

Comments

@squakez
Copy link
Contributor

squakez commented Nov 13, 2023

There is still something not quite working out. I run into the following errors for the http-secured-source with camel-k version s 1.12.10, 2.0.1 and 2.1.0. Below you will find the log for Camel K Client 2.1.0 & Camel K Operator 2.1.0, but it looked pretty much the same for all three versions

{"level":"error","ts":"2023-11-10T17:37:21Z","msg":"Reconciler error","controller":"integration-controller","controllerGroup":"camel.apache.org","controllerKind":"Integration","Integration":{"name":"http-secured-source-to-minio-sink","namespace":"test"},"namespace":"test","name":"http-secured-source-to-minio-sink","reconcileID":"6ea19c74-dfa3-43a8-aa5a-08a44932abb3","error":"error during trait customization: dependencies trait execution failed: component not found for uri \"{{url}}?authMethod=%7B%7BauthMethod%7D%7D&authPassword=%7B%7BauthPassword%7D%7D&authUsername=%7B%7BauthUsername%7D%7D&authenticationPreemptive=%7B%7BauthenticationPreemptive%7D%7D\" in camel catalog runtime version 3.2.0","stacktrace":"sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler\n\tsigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:324\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem\n\tsigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:265\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func2.2\n\tsigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:226"}

if we look at the url-decoded uri string, it seems to fit:

{{url}}?authMethod={{authMethod}}&authPassword={{authPassword}}&authUsername={{authUsername}}&authenticationPreemptive={{authenticationPreemptive}}

The Kamelet-Bindings or in this version the Pipe is rather simple:

apiVersion: camel.apache.org/v1
kind: Pipe
metadata:
  annotations:
    camel.apache.org/operator.id: camel-k
  creationTimestamp: null
  name: http-secured-source-to-minio-sink
  namespace: test
spec:
  sink:
    properties:
      accessKey: <redacted>
      autoCreateBucket: "true"
      bucketName: customer
      endpoint: http://test-hl.test.svc.cluster.local:9000
      secretKey: <redacted>
    ref:
      apiVersion: camel.apache.org/v1
      kind: Kamelet
      name: minio-sink
      namespace: test
  source:
    properties:
      authMethod: Basic
      authPassword: <redacted>
      authUsername: <redacted>
      url: http://demo.<redacted>.sslip.io
    ref:
      apiVersion: camel.apache.org/v1
      kind: Kamelet
      name: http-secured-source
      namespace: test
status: {}

One of my assumptions was that this was a problem with eager loading and the sslip.io address, which turned out to be wrong: The address resolves within the cluster and I did change it to the according IP.

Now one thing I noticed is that in the error string, the {{ and }} are url encoded for the query string, but not for the url:

"{{url}}?authMethod=%7B%7BauthMethod%7D%7D&authPassword=%7B%7BauthPassword%7D%7D&authUsername=%7B%7BauthUsername%7D%7D&authenticationPreemptive=%7B%7BauthenticationPreemptive%7D%7D"

I'd assume that the problem is somewhere located about this... incsonsistency, because sure enough, IsResolvable fails:
https://go.dev/play/p/C5kPnCliqmw


Some additional version information (redacted for brevity):

Catalog

apiVersion: camel.apache.org/v1
kind: CamelCatalog
metadata:
  annotations:
    camel.apache.org/operator.id: camel-k
  generation: 1
  labels:
    app: camel-k
    camel.apache.org/catalog.loader.version: 4.0.0
    camel.apache.org/catalog.version: 4.0.0
    camel.apache.org/runtime.version: 3.2.0
...

Knative

$ kn version
Version:      v1.9.0
Build Date:   2023-01-26 20:34:03
Git Revision: df40f5a3
Supported APIs:
* Serving
  - serving.knative.dev/v1 (knative-serving v1.9.0)
* Eventing
  - sources.knative.dev/v1 (knative-eventing v1.9.0)
  - eventing.knative.dev/v1 (knative-eventing v1.9.0)

Kubernetes

$ kubectl version -o yaml
clientVersion:
  buildDate: "2023-10-30T00:22:50Z"
  compiler: gc
  gitCommit: 07a61d861519c45ef5c89bc22dda289328f29343
  gitTreeState: archive
  gitVersion: v1.27.7
  goVersion: go1.20.10
  major: "1"
  minor: "27"
  platform: darwin/arm64
kustomizeVersion: v5.0.1
serverVersion:
  buildDate: "2023-05-17T14:13:28Z"
  compiler: gc
  gitCommit: 7f6f68fdabc4df88cfea2dcf9a19b2b830f1e647
  gitTreeState: clean
  gitVersion: v1.27.2
  goVersion: go1.20.4
  major: "1"
  minor: "27"
  platform: linux/arm64

Originally posted by @mwmahlberg in #3896 (comment)

@squakez squakez added the kind/bug Something isn't working label Nov 13, 2023
@squakez
Copy link
Contributor Author

squakez commented Nov 13, 2023

@christophd do you mind having an eye on this? The problem would be reproducible by running kamel bind http-secured-source log-sink -p source.url=http://www.google.com/.

@squakez squakez added this to the 2.2.0 milestone Nov 13, 2023
@christophd christophd self-assigned this Nov 13, 2023
@christophd
Copy link
Contributor

yep, having a look already

@squakez
Copy link
Contributor Author

squakez commented Nov 13, 2023

I had a look this morning and I got to this conclusions: #3896 (comment) if that can help

christophd added a commit to christophd/camel-k that referenced this issue Nov 15, 2023
- Support URL query parameters when resolving components by given scheme
- Do not resolve URLs that use parameter placeholder as a scheme
- Properly extract scheme from URL that has query parameters
christophd added a commit to christophd/camel-k that referenced this issue Nov 15, 2023
- Support URL query parameters when resolving components by given scheme
- Do not resolve URLs that use parameter placeholder as a scheme
- Properly extract scheme from URL that has query parameters
christophd added a commit that referenced this issue Nov 16, 2023
- Support URL query parameters when resolving components by given scheme
- Do not resolve URLs that use parameter placeholder as a scheme
- Properly extract scheme from URL that has query parameters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants