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

Trait owner.target-annotations is not propagated to K8S Services #3494

Closed
ruromero opened this issue Jul 27, 2022 · 4 comments
Closed

Trait owner.target-annotations is not propagated to K8S Services #3494

ruromero opened this issue Jul 27, 2022 · 4 comments
Labels
kind/question Further information is requested status/waiting-for-feedback Needs some feedback

Comments

@ruromero
Copy link

When using the Owner Trait to propagate annotations to the owned resources, such annotations are not propagated to the Kubernetes Services.

# camel-k: language=yaml
# camel-k: trait=owner.enabled=true
# camel-k: trait=owner.target-annotations=[example]

The deployment shows the annotation but the service doesn't.

Is this the expected behaviour?

@ruromero
Copy link
Author

fyi @squakez

@squakez
Copy link
Contributor

squakez commented Jul 27, 2022

It seems the Service is annotated correctly. I've just tested with an example as:

import org.apache.camel.builder.RouteBuilder;

public class PlatformHttpServer extends RouteBuilder {
  @Override
  public void configure() throws Exception {
    from("platform-http:/hello?httpMethodRestrict=GET").setBody(simple("Hello ${header.name}"));
  }
}
...
$ kamel run PlatformHttpServer.java --annotation test=my-test -t owner.target-annotations=test --dev
...
$ k get svc platform-http-server -o yaml
apiVersion: v1
kind: Service
metadata:
  annotations:
    test: my-test
  creationTimestamp: "2022-07-27T13:28:29Z"
  labels:
    camel.apache.org/generation: "1"
    camel.apache.org/integration: platform-http-server
    camel.apache.org/service.type: user
...

Can you please provide a reproducer?

@squakez squakez added kind/question Further information is requested status/waiting-for-feedback Needs some feedback labels Jul 27, 2022
@ruromero
Copy link
Author

@squakez it seems I didn't define the integration resource properly. Yes it is working, sorry for the false alarm 😅

@ruromero
Copy link
Author

Here is an example of the CRD definition, for reference

apiVersion: camel.apache.org/v1
kind: Integration
metadata:
  name: auth-hello-world
  annotations:
    test: my-test
    other: other-test
spec:
...
  traits:
    owner:
      configuration:
        enabled: true
        targetAnnotations:
        - test
        - other

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/question Further information is requested status/waiting-for-feedback Needs some feedback
Projects
None yet
Development

No branches or pull requests

2 participants