From c49a47f189dff69736136042704f2689dfa74ee7 Mon Sep 17 00:00:00 2001 From: Lukas Krejci Date: Tue, 8 Oct 2024 14:56:25 +0200 Subject: [PATCH] Bring back the spec.apiEndpoint but make it optional. We need this indirection because we need to make the removal in two steps so that the potentially different versions of the CRD in host and member stay compatible. --- api/v1alpha1/docs/apiref.adoc | 11 +++++++++-- api/v1alpha1/toolchaincluster_types.go | 10 ++++++++++ api/v1alpha1/zz_generated.openapi.go | 7 +++++++ 3 files changed, 26 insertions(+), 2 deletions(-) diff --git a/api/v1alpha1/docs/apiref.adoc b/api/v1alpha1/docs/apiref.adoc index 846ca747..1cd03f22 100644 --- a/api/v1alpha1/docs/apiref.adoc +++ b/api/v1alpha1/docs/apiref.adoc @@ -3063,8 +3063,6 @@ Supported condition types: ConditionReady + | | |=== - - [id="{anchor_prefix}-github-com-codeready-toolchain-api-api-v1alpha1-tiertemplate"] ==== TierTemplate @@ -3336,6 +3334,15 @@ ToolchainClusterSpec defines the desired state of ToolchainCluster [cols="20a,50a,15a,15a", options="header"] |=== | Field | Description | Default | Validation +| *`apiEndpoint`* __string__ | The API endpoint of the member cluster. This can be a hostname, + +hostname:port, IP or IP:port. + + + +Be aware that this is kept in the spec only for compatibility reasons + +and doesn't serve any purpose. Use the Status.APIEndpoint instead. + + + +Deprecated: This is not used for anything. + | | | *`secretRef`* __xref:{anchor_prefix}-github-com-codeready-toolchain-api-api-v1alpha1-localsecretreference[$$LocalSecretReference$$]__ | Name of the secret containing the kubeconfig required to connect + to the cluster. + | | |=== diff --git a/api/v1alpha1/toolchaincluster_types.go b/api/v1alpha1/toolchaincluster_types.go index 8083f693..c30ad46e 100644 --- a/api/v1alpha1/toolchaincluster_types.go +++ b/api/v1alpha1/toolchaincluster_types.go @@ -24,6 +24,16 @@ const ( // ToolchainClusterSpec defines the desired state of ToolchainCluster // +k8s:openapi-gen=true type ToolchainClusterSpec struct { + // The API endpoint of the member cluster. This can be a hostname, + // hostname:port, IP or IP:port. + // + // Be aware that this is kept in the spec only for compatibility reasons + // and doesn't serve any purpose. Use the Status.APIEndpoint instead. + // + // Deprecated: This is not used for anything. + // +optional + APIEndpoint string `json:"apiEndpoint,omitempty"` + // Name of the secret containing the kubeconfig required to connect // to the cluster. SecretRef LocalSecretReference `json:"secretRef"` diff --git a/api/v1alpha1/zz_generated.openapi.go b/api/v1alpha1/zz_generated.openapi.go index 50da023e..2e69ff82 100644 --- a/api/v1alpha1/zz_generated.openapi.go +++ b/api/v1alpha1/zz_generated.openapi.go @@ -4591,6 +4591,13 @@ func schema_codeready_toolchain_api_api_v1alpha1_ToolchainClusterSpec(ref common Description: "ToolchainClusterSpec defines the desired state of ToolchainCluster", Type: []string{"object"}, Properties: map[string]spec.Schema{ + "apiEndpoint": { + SchemaProps: spec.SchemaProps{ + Description: "The API endpoint of the member cluster. This can be a hostname, hostname:port, IP or IP:port.\n\nBe aware that this is kept in the spec only for compatibility reasons and doesn't serve any purpose. Use the Status.APIEndpoint instead.\n\nDeprecated: This is not used for anything.", + Type: []string{"string"}, + Format: "", + }, + }, "secretRef": { SchemaProps: spec.SchemaProps{ Description: "Name of the secret containing the kubeconfig required to connect to the cluster.",