From f24662085fbf6d32bcc00d0bb7441b47205ed28c Mon Sep 17 00:00:00 2001 From: Pasquale Congiusti Date: Fri, 27 Sep 2024 07:33:55 +0200 Subject: [PATCH] feat(api): IntegrationProfile deprecation Closes #5869 --- docs/modules/ROOT/partials/apis/camel-k-crds.adoc | 1 + helm/camel-k/crds/camel-k-crds.yaml | 1 + pkg/apis/camel/v1/integrationprofile_types.go | 1 + pkg/controller/integrationprofile/initialize.go | 6 ++++++ .../crd/bases/camel.apache.org_integrationprofiles.yaml | 1 + 5 files changed, 10 insertions(+) diff --git a/docs/modules/ROOT/partials/apis/camel-k-crds.adoc b/docs/modules/ROOT/partials/apis/camel-k-crds.adoc index a9199401aa..f51ad77812 100644 --- a/docs/modules/ROOT/partials/apis/camel-k-crds.adoc +++ b/docs/modules/ROOT/partials/apis/camel-k-crds.adoc @@ -226,6 +226,7 @@ Refer to the Kubernetes API documentation for the fields of the `metadata` field IntegrationProfile is the resource used to apply user defined settings to the Camel K operator behavior. It defines the behavior of all Custom Resources (`IntegrationKit`, `Integration`, `Kamelet`) in the given namespace. +Deprecated: may be removed in future releases. Make use of IntegrationPlatform instead. [cols="2,2a",options="header"] |=== diff --git a/helm/camel-k/crds/camel-k-crds.yaml b/helm/camel-k/crds/camel-k-crds.yaml index ee85c65f6b..ebd1e148e3 100644 --- a/helm/camel-k/crds/camel-k-crds.yaml +++ b/helm/camel-k/crds/camel-k-crds.yaml @@ -7524,6 +7524,7 @@ spec: description: |- IntegrationProfile is the resource used to apply user defined settings to the Camel K operator behavior. It defines the behavior of all Custom Resources (`IntegrationKit`, `Integration`, `Kamelet`) in the given namespace. + Deprecated: may be removed in future releases. Make use of IntegrationPlatform instead. properties: apiVersion: description: |- diff --git a/pkg/apis/camel/v1/integrationprofile_types.go b/pkg/apis/camel/v1/integrationprofile_types.go index 4b85289b66..dc379d73f5 100644 --- a/pkg/apis/camel/v1/integrationprofile_types.go +++ b/pkg/apis/camel/v1/integrationprofile_types.go @@ -56,6 +56,7 @@ type IntegrationProfileStatus struct { // IntegrationProfile is the resource used to apply user defined settings to the Camel K operator behavior. // It defines the behavior of all Custom Resources (`IntegrationKit`, `Integration`, `Kamelet`) in the given namespace. +// Deprecated: may be removed in future releases. Make use of IntegrationPlatform instead. type IntegrationProfile struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` diff --git a/pkg/controller/integrationprofile/initialize.go b/pkg/controller/integrationprofile/initialize.go index 85f704310d..ccd2850b8d 100644 --- a/pkg/controller/integrationprofile/initialize.go +++ b/pkg/controller/integrationprofile/initialize.go @@ -52,6 +52,12 @@ func (action *initializeAction) Handle(ctx context.Context, profile *v1.Integrat v1.IntegrationProfileConditionCreatedReason, "integration profile created") + profile.Status.SetCondition( + "DeprecationNotice", + corev1.ConditionTrue, + "DeprecationNoticeWarning", + "Usage of IntegrationProfile is deprecated. Make use of IntegrationPlatform instead.") + profile.Status.Phase = v1.IntegrationProfilePhaseReady return profile, nil diff --git a/pkg/resources/config/crd/bases/camel.apache.org_integrationprofiles.yaml b/pkg/resources/config/crd/bases/camel.apache.org_integrationprofiles.yaml index 1e9642cb4c..3ce8ad41be 100644 --- a/pkg/resources/config/crd/bases/camel.apache.org_integrationprofiles.yaml +++ b/pkg/resources/config/crd/bases/camel.apache.org_integrationprofiles.yaml @@ -51,6 +51,7 @@ spec: description: |- IntegrationProfile is the resource used to apply user defined settings to the Camel K operator behavior. It defines the behavior of all Custom Resources (`IntegrationKit`, `Integration`, `Kamelet`) in the given namespace. + Deprecated: may be removed in future releases. Make use of IntegrationPlatform instead. properties: apiVersion: description: |-