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

Move info into tc status #433

Merged
merged 9 commits into from
Jul 8, 2024
27 changes: 23 additions & 4 deletions api/v1alpha1/docs/apiref.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -3228,14 +3228,30 @@ ToolchainClusterSpec defines the desired state of ToolchainCluster
|===
| Field | Description | Default | Validation
| *`apiEndpoint`* __string__ | The API endpoint of the member cluster. This can be a hostname, +
hostname:port, IP or IP:port. + | |
| *`caBundle`* __string__ | CABundle contains the certificate authority information. + | |
hostname:port, IP or IP:port. +


Be aware that this field is going to be replaced with +
the Status.APIEndpoint in the future. + | |
| *`caBundle`* __string__ | CABundle contains the certificate authority information. +


Note that this is going to be deprecated and removed. It will be replaced by a field in +
the kubecondig of the connection secret + | |
| *`secretRef`* __xref:{anchor_prefix}-github-com-codeready-toolchain-api-api-v1alpha1-localsecretreference[$$LocalSecretReference$$]__ | Name of the secret containing the token required to access the +
member cluster. The secret needs to exist in the same namespace +
as the control plane and should have a "token" key. + | |
as the control plane and should have a "token" key. +


In the near future, the secret will contain the whole kubeconfig required to connect +
to the cluster. + | |
| *`disabledTLSValidations`* __xref:{anchor_prefix}-github-com-codeready-toolchain-api-api-v1alpha1-tlsvalidation[$$TLSValidation$$] array__ | DisabledTLSValidations defines a list of checks to ignore when validating +
the TLS connection to the member cluster. This can be any of *, SubjectName, or ValidityPeriod. +
If * is specified, it is expected to be the only option in list. + | |
If * is specified, it is expected to be the only option in list. +


Note that this is going to be deprecated and removed. It will be replaced by +
the kubeconfig stored in the connection secret. + | |
|===


Expand All @@ -3258,6 +3274,9 @@ cluster updated periodically by cluster controller.
[cols="20a,50a,15a,15a", options="header"]
|===
| Field | Description | Default | Validation
| *`apiEndpoint`* __string__ | APIEndpoint is the API endpoint of the remote cluster. This can be a hostname, +
hostname:port, IP or IP:port. + | |
| *`operatorNamespace`* __string__ | OperatorNamespace is the namespace in which the operator runs in the remote cluster + | |
| *`conditions`* __xref:{anchor_prefix}-github-com-codeready-toolchain-api-api-v1alpha1-condition[$$Condition$$] array__ | Conditions is an array of current cluster conditions. + | |
|===

Expand Down
20 changes: 20 additions & 0 deletions api/v1alpha1/toolchaincluster_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,20 +34,33 @@ const (
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 field is going to be replaced with
// the Status.APIEndpoint in the future.
APIEndpoint string `json:"apiEndpoint"`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

btw, you could have made this field optional as well, so you can drop populating it before you remove it from the API

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure what's better from the client's POV. A hard error from using a removed field or a soft error caused by empty values.


// CABundle contains the certificate authority information.
// +optional
//
// Note that this is going to be deprecated and removed. It will be replaced by a field in
// the kubecondig of the connection secret
CABundle string `json:"caBundle,omitempty"`

// Name of the secret containing the token required to access the
// member cluster. The secret needs to exist in the same namespace
// as the control plane and should have a "token" key.
//
// In the near future, the secret will contain the whole kubeconfig required to connect
// to the cluster.
SecretRef LocalSecretReference `json:"secretRef"`

// DisabledTLSValidations defines a list of checks to ignore when validating
// the TLS connection to the member cluster. This can be any of *, SubjectName, or ValidityPeriod.
// If * is specified, it is expected to be the only option in list.
//
// Note that this is going to be deprecated and removed. It will be replaced by
// the kubeconfig stored in the connection secret.
//
// +optional
// +listType=set
DisabledTLSValidations []TLSValidation `json:"disabledTLSValidations,omitempty"`
Expand All @@ -66,6 +79,13 @@ type LocalSecretReference struct {
// cluster updated periodically by cluster controller.
// +k8s:openapi-gen=true
type ToolchainClusterStatus struct {
// APIEndpoint is the API endpoint of the remote cluster. This can be a hostname,
// hostname:port, IP or IP:port.
APIEndpoint string `json:"apiEndpoint,omitempty"`

// OperatorNamespace is the namespace in which the operator runs in the remote cluster
OperatorNamespace string `json:"operatorNamespace,omitempty"`
metlos marked this conversation as resolved.
Show resolved Hide resolved
metlos marked this conversation as resolved.
Show resolved Hide resolved

// Conditions is an array of current cluster conditions.
// +listType=atomic
Conditions []Condition `json:"conditions"`
Expand Down
22 changes: 18 additions & 4 deletions api/v1alpha1/zz_generated.openapi.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading