apache / camel-k

Apache Camel K is a lightweight integration platform, born on Kubernetes, with serverless superpowers
https://camel.apache.org/camel-k
Apache License 2.0
859 stars 344 forks source link

Promote Integration/IntegrationKit kustomization patch file #5456

Open squakez opened 4 months ago

squakez commented 4 months ago

Right now, the kamel promote is returning the entire export of Integration/IntegrationKit required to port an Integration from one namespace to another such as:

$ kamel promote test --to test -o yaml
apiVersion: camel.apache.org/v1
kind: IntegrationKit
metadata:
  creationTimestamp: null
  labels:
    camel.apache.org/created.by.kind: Integration
    camel.apache.org/created.by.name: test
    camel.apache.org/created.by.namespace: default
    camel.apache.org/created.by.version: "976076"
    camel.apache.org/kit.layout: fast-jar
    camel.apache.org/kit.priority: "1000"
    camel.apache.org/kit.type: external
    camel.apache.org/runtime.provider: quarkus
    camel.apache.org/runtime.version: 3.8.1
  name: kit-cos8u5qmns6c73bp7ig0
  namespace: test
spec:
  dependencies:
  - camel:core
  - camel:timer
  - mvn:org.apache.camel.k:camel-k-runtime
  - mvn:org.apache.camel.quarkus:camel-quarkus-yaml-dsl
  image: 10.100.107.57/default/camel-k-kit-cos8u5qmns6c73bp7ig0@sha256:74b334ae0bad16f3f0b99c66311e87814c4881df4d2c2312f4f314638fb332d5
  traits: {}
status: {}
---
apiVersion: camel.apache.org/v1
kind: Integration
metadata:
  creationTimestamp: null
  name: test
  namespace: test
spec:
  flows:
  - from:
      parameters:
        period: "1000"
      steps:
      - setBody:
          simple: Hello Camel from ${routeId}
      - log: ${body}
      uri: timer:yaml
  integrationKit:
    kind: IntegrationKit
    name: kit-cos8u5qmns6c73bp7ig0
    namespace: test
  traits: {}
status: {}

We may introduce a further option (ie --patch) which would lead to the generation of a Kustomize based patch file just containing the differences between the original Integration and the patched one. This would turn very useful in the context of a gitops (as described in https://camel.apache.org/blog/2023/07/camel-k-gitops/).

github-actions[bot] commented 1 month ago

This issue has been automatically marked as stale due to 90 days of inactivity. It will be closed if no further activity occurs within 15 days. If you think that’s incorrect or the issue should never stale, please simply write any comment. Thanks for your contributions!