From b532fd478aa9626fba33697981463cdaa82d91d7 Mon Sep 17 00:00:00 2001 From: Michael Anstis Date: Thu, 2 Mar 2023 20:31:26 +0000 Subject: [PATCH 1/3] Issue-1330: Deprecating parameters. --- helm/camel-k/crds/crd-kamelet.yaml | 3 +++ pkg/apis/camel/v1alpha1/jsonschema_types.go | 1 + 2 files changed, 4 insertions(+) diff --git a/helm/camel-k/crds/crd-kamelet.yaml b/helm/camel-k/crds/crd-kamelet.yaml index 7a6f89f13a..2a9a35c5e2 100644 --- a/helm/camel-k/crds/crd-kamelet.yaml +++ b/helm/camel-k/crds/crd-kamelet.yaml @@ -94,6 +94,9 @@ spec: description: default is a default value for undefined object fields. x-kubernetes-preserve-unknown-fields: true + deprecated: + type: boolean + default: false description: type: string enum: diff --git a/pkg/apis/camel/v1alpha1/jsonschema_types.go b/pkg/apis/camel/v1alpha1/jsonschema_types.go index 620128a16e..c9cdc4362e 100644 --- a/pkg/apis/camel/v1alpha1/jsonschema_types.go +++ b/pkg/apis/camel/v1alpha1/jsonschema_types.go @@ -26,6 +26,7 @@ import ( type JSONSchemaProp struct { ID string `json:"id,omitempty"` + Deprecated bool `json:"deprecated,omitempty"` Description string `json:"description,omitempty"` Type string `json:"type,omitempty"` // format is an OpenAPI v3 format string. Unknown formats are ignored. The following formats are validated: From f67d36aaa647c803a12dc9df112fd1f2f2f28472 Mon Sep 17 00:00:00 2001 From: Michael Anstis Date: Fri, 3 Mar 2023 10:48:49 +0000 Subject: [PATCH 2/3] Run 'make generate' with controller-gen@v0.6.1 --- .../duck/client/internalclientset/fake/register.go | 14 +++++++------- .../client/internalclientset/scheme/register.go | 14 +++++++------- .../bases/camel.apache.org_kameletbindings.yaml | 6 ++++++ config/crd/bases/camel.apache.org_kamelets.yaml | 4 ++++ docs/modules/ROOT/partials/apis/kamelets-crds.adoc | 7 +++++++ helm/camel-k/crds/crd-kamelet-binding.yaml | 6 ++++++ helm/camel-k/crds/crd-kamelet.yaml | 3 ++- .../camel/v1alpha1/jsonschemaprop.go | 9 +++++++++ 8 files changed, 48 insertions(+), 15 deletions(-) diff --git a/addons/strimzi/duck/client/internalclientset/fake/register.go b/addons/strimzi/duck/client/internalclientset/fake/register.go index b03a9f8056..04aa548214 100644 --- a/addons/strimzi/duck/client/internalclientset/fake/register.go +++ b/addons/strimzi/duck/client/internalclientset/fake/register.go @@ -38,14 +38,14 @@ var localSchemeBuilder = runtime.SchemeBuilder{ // AddToScheme adds all types of this clientset into the given scheme. This allows composition // of clientsets, like in: // -// import ( -// "k8s.io/client-go/kubernetes" -// clientsetscheme "k8s.io/client-go/kubernetes/scheme" -// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" -// ) +// import ( +// "k8s.io/client-go/kubernetes" +// clientsetscheme "k8s.io/client-go/kubernetes/scheme" +// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" +// ) // -// kclientset, _ := kubernetes.NewForConfig(c) -// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) +// kclientset, _ := kubernetes.NewForConfig(c) +// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) // // After this, RawExtensions in Kubernetes types will serialize kube-aggregator types // correctly. diff --git a/addons/strimzi/duck/client/internalclientset/scheme/register.go b/addons/strimzi/duck/client/internalclientset/scheme/register.go index bb376affd8..7c58dd36c4 100644 --- a/addons/strimzi/duck/client/internalclientset/scheme/register.go +++ b/addons/strimzi/duck/client/internalclientset/scheme/register.go @@ -38,14 +38,14 @@ var localSchemeBuilder = runtime.SchemeBuilder{ // AddToScheme adds all types of this clientset into the given scheme. This allows composition // of clientsets, like in: // -// import ( -// "k8s.io/client-go/kubernetes" -// clientsetscheme "k8s.io/client-go/kubernetes/scheme" -// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" -// ) +// import ( +// "k8s.io/client-go/kubernetes" +// clientsetscheme "k8s.io/client-go/kubernetes/scheme" +// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" +// ) // -// kclientset, _ := kubernetes.NewForConfig(c) -// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) +// kclientset, _ := kubernetes.NewForConfig(c) +// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) // // After this, RawExtensions in Kubernetes types will serialize kube-aggregator types // correctly. diff --git a/config/crd/bases/camel.apache.org_kameletbindings.yaml b/config/crd/bases/camel.apache.org_kameletbindings.yaml index e8f8ae8c5c..b84e5b9ae6 100644 --- a/config/crd/bases/camel.apache.org_kameletbindings.yaml +++ b/config/crd/bases/camel.apache.org_kameletbindings.yaml @@ -7749,6 +7749,8 @@ spec: description: default is a default value for undefined object fields. x-kubernetes-preserve-unknown-fields: true + deprecated: + type: boolean description: type: string enum: @@ -7966,6 +7968,8 @@ spec: description: default is a default value for undefined object fields. x-kubernetes-preserve-unknown-fields: true + deprecated: + type: boolean description: type: string enum: @@ -8188,6 +8192,8 @@ spec: description: default is a default value for undefined object fields. x-kubernetes-preserve-unknown-fields: true + deprecated: + type: boolean description: type: string enum: diff --git a/config/crd/bases/camel.apache.org_kamelets.yaml b/config/crd/bases/camel.apache.org_kamelets.yaml index 7a6f89f13a..20b9230b4e 100644 --- a/config/crd/bases/camel.apache.org_kamelets.yaml +++ b/config/crd/bases/camel.apache.org_kamelets.yaml @@ -94,6 +94,8 @@ spec: description: default is a default value for undefined object fields. x-kubernetes-preserve-unknown-fields: true + deprecated: + type: boolean description: type: string enum: @@ -311,6 +313,8 @@ spec: description: default is a default value for undefined object fields. x-kubernetes-preserve-unknown-fields: true + deprecated: + type: boolean description: type: string enum: diff --git a/docs/modules/ROOT/partials/apis/kamelets-crds.adoc b/docs/modules/ROOT/partials/apis/kamelets-crds.adoc index 557e5f6ed2..c9daa48e7d 100644 --- a/docs/modules/ROOT/partials/apis/kamelets-crds.adoc +++ b/docs/modules/ROOT/partials/apis/kamelets-crds.adoc @@ -438,6 +438,13 @@ string +|`deprecated` + +bool +| + + + + |`description` + string | diff --git a/helm/camel-k/crds/crd-kamelet-binding.yaml b/helm/camel-k/crds/crd-kamelet-binding.yaml index e8f8ae8c5c..b84e5b9ae6 100644 --- a/helm/camel-k/crds/crd-kamelet-binding.yaml +++ b/helm/camel-k/crds/crd-kamelet-binding.yaml @@ -7749,6 +7749,8 @@ spec: description: default is a default value for undefined object fields. x-kubernetes-preserve-unknown-fields: true + deprecated: + type: boolean description: type: string enum: @@ -7966,6 +7968,8 @@ spec: description: default is a default value for undefined object fields. x-kubernetes-preserve-unknown-fields: true + deprecated: + type: boolean description: type: string enum: @@ -8188,6 +8192,8 @@ spec: description: default is a default value for undefined object fields. x-kubernetes-preserve-unknown-fields: true + deprecated: + type: boolean description: type: string enum: diff --git a/helm/camel-k/crds/crd-kamelet.yaml b/helm/camel-k/crds/crd-kamelet.yaml index 2a9a35c5e2..20b9230b4e 100644 --- a/helm/camel-k/crds/crd-kamelet.yaml +++ b/helm/camel-k/crds/crd-kamelet.yaml @@ -96,7 +96,6 @@ spec: x-kubernetes-preserve-unknown-fields: true deprecated: type: boolean - default: false description: type: string enum: @@ -314,6 +313,8 @@ spec: description: default is a default value for undefined object fields. x-kubernetes-preserve-unknown-fields: true + deprecated: + type: boolean description: type: string enum: diff --git a/pkg/client/camel/applyconfiguration/camel/v1alpha1/jsonschemaprop.go b/pkg/client/camel/applyconfiguration/camel/v1alpha1/jsonschemaprop.go index baf451cb5c..68aee96a46 100644 --- a/pkg/client/camel/applyconfiguration/camel/v1alpha1/jsonschemaprop.go +++ b/pkg/client/camel/applyconfiguration/camel/v1alpha1/jsonschemaprop.go @@ -27,6 +27,7 @@ import ( // with apply. type JSONSchemaPropApplyConfiguration struct { ID *string `json:"id,omitempty"` + Deprecated *bool `json:"deprecated,omitempty"` Description *string `json:"description,omitempty"` Type *string `json:"type,omitempty"` Format *string `json:"format,omitempty"` @@ -65,6 +66,14 @@ func (b *JSONSchemaPropApplyConfiguration) WithID(value string) *JSONSchemaPropA return b } +// WithDeprecated sets the Deprecated field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Deprecated field is set to the value of the last call. +func (b *JSONSchemaPropApplyConfiguration) WithDeprecated(value bool) *JSONSchemaPropApplyConfiguration { + b.Deprecated = &value + return b +} + // WithDescription sets the Description field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Description field is set to the value of the last call. From 148a8b234403c6fb54e5e8305776063e97200eff Mon Sep 17 00:00:00 2001 From: Michael Anstis Date: Fri, 3 Mar 2023 10:53:19 +0000 Subject: [PATCH 3/3] Revert formatting changes to avoid churn. --- .../duck/client/internalclientset/fake/register.go | 14 +++++++------- .../client/internalclientset/scheme/register.go | 14 +++++++------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/addons/strimzi/duck/client/internalclientset/fake/register.go b/addons/strimzi/duck/client/internalclientset/fake/register.go index 04aa548214..b03a9f8056 100644 --- a/addons/strimzi/duck/client/internalclientset/fake/register.go +++ b/addons/strimzi/duck/client/internalclientset/fake/register.go @@ -38,14 +38,14 @@ var localSchemeBuilder = runtime.SchemeBuilder{ // AddToScheme adds all types of this clientset into the given scheme. This allows composition // of clientsets, like in: // -// import ( -// "k8s.io/client-go/kubernetes" -// clientsetscheme "k8s.io/client-go/kubernetes/scheme" -// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" -// ) +// import ( +// "k8s.io/client-go/kubernetes" +// clientsetscheme "k8s.io/client-go/kubernetes/scheme" +// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" +// ) // -// kclientset, _ := kubernetes.NewForConfig(c) -// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) +// kclientset, _ := kubernetes.NewForConfig(c) +// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) // // After this, RawExtensions in Kubernetes types will serialize kube-aggregator types // correctly. diff --git a/addons/strimzi/duck/client/internalclientset/scheme/register.go b/addons/strimzi/duck/client/internalclientset/scheme/register.go index 7c58dd36c4..bb376affd8 100644 --- a/addons/strimzi/duck/client/internalclientset/scheme/register.go +++ b/addons/strimzi/duck/client/internalclientset/scheme/register.go @@ -38,14 +38,14 @@ var localSchemeBuilder = runtime.SchemeBuilder{ // AddToScheme adds all types of this clientset into the given scheme. This allows composition // of clientsets, like in: // -// import ( -// "k8s.io/client-go/kubernetes" -// clientsetscheme "k8s.io/client-go/kubernetes/scheme" -// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" -// ) +// import ( +// "k8s.io/client-go/kubernetes" +// clientsetscheme "k8s.io/client-go/kubernetes/scheme" +// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" +// ) // -// kclientset, _ := kubernetes.NewForConfig(c) -// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) +// kclientset, _ := kubernetes.NewForConfig(c) +// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) // // After this, RawExtensions in Kubernetes types will serialize kube-aggregator types // correctly.