diff --git a/api/v1alpha1/sveltoscluster_type.go b/api/v1alpha1/sveltoscluster_type.go index 8241776..d069686 100644 --- a/api/v1alpha1/sveltoscluster_type.go +++ b/api/v1alpha1/sveltoscluster_type.go @@ -24,6 +24,12 @@ const ( SveltosClusterKind = "SveltosCluster" ) +type TokenRequestRenewalOption struct { + // RenewTokenRequestInterval is the interval at which to renew the TokenRequest + // +optional + RenewTokenRequestInterval *metav1.Duration `json:"renewTokenRequestInterval,omitempty"` +} + // SveltosClusterSpec defines the desired state of SveltosCluster type SveltosClusterSpec struct { // KubeconfigName allows overriding the default Sveltos convention which expected a valid kubeconfig @@ -37,6 +43,10 @@ type SveltosClusterSpec struct { // SveltosCluster and all its associated objects. // +optional Paused bool `json:"paused,omitempty"` + + // TokenRequestRenewalOption contains options describing how to renew TokenRequest + // +optional + TokenRequestRenewalOption *metav1.Duration `json:"tokenRequestRenewalOption,omitempty"` } // SveltosClusterStatus defines the status of SveltosCluster @@ -53,6 +63,11 @@ type SveltosClusterStatus struct { // misconfiguration // +optional FailureMessage *string `json:"failureMessage,omitempty"` + + // LastReconciledTokenRequestAt is the last time the TokenRequest + // was renewed. + // +optional + LastReconciledTokenRequestAt string `json:"lastReconciledTokenRequestAt,omitempty"` } //+kubebuilder:object:root=true diff --git a/api/v1alpha1/zz_generated.deepcopy.go b/api/v1alpha1/zz_generated.deepcopy.go index eb45c18..c6d7445 100644 --- a/api/v1alpha1/zz_generated.deepcopy.go +++ b/api/v1alpha1/zz_generated.deepcopy.go @@ -22,6 +22,7 @@ package v1alpha1 import ( "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" ) @@ -1841,7 +1842,7 @@ func (in *SveltosCluster) DeepCopyInto(out *SveltosCluster) { *out = *in out.TypeMeta = in.TypeMeta in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - out.Spec = in.Spec + in.Spec.DeepCopyInto(&out.Spec) in.Status.DeepCopyInto(&out.Status) } @@ -1898,6 +1899,11 @@ func (in *SveltosClusterList) DeepCopyObject() runtime.Object { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *SveltosClusterSpec) DeepCopyInto(out *SveltosClusterSpec) { *out = *in + if in.TokenRequestRenewalOption != nil { + in, out := &in.TokenRequestRenewalOption, &out.TokenRequestRenewalOption + *out = new(metav1.Duration) + **out = **in + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SveltosClusterSpec. @@ -1930,6 +1936,26 @@ func (in *SveltosClusterStatus) DeepCopy() *SveltosClusterStatus { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *TokenRequestRenewalOption) DeepCopyInto(out *TokenRequestRenewalOption) { + *out = *in + if in.RenewTokenRequestInterval != nil { + in, out := &in.RenewTokenRequestInterval, &out.RenewTokenRequestInterval + *out = new(metav1.Duration) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TokenRequestRenewalOption. +func (in *TokenRequestRenewalOption) DeepCopy() *TokenRequestRenewalOption { + if in == nil { + return nil + } + out := new(TokenRequestRenewalOption) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *UnManagedLabel) DeepCopyInto(out *UnManagedLabel) { *out = *in diff --git a/config/crd/bases/lib.projectsveltos.io_sveltosclusters.yaml b/config/crd/bases/lib.projectsveltos.io_sveltosclusters.yaml index 4aaeb74..b4cd027 100644 --- a/config/crd/bases/lib.projectsveltos.io_sveltosclusters.yaml +++ b/config/crd/bases/lib.projectsveltos.io_sveltosclusters.yaml @@ -62,6 +62,10 @@ spec: Paused can be used to prevent controllers from processing the SveltosCluster and all its associated objects. type: boolean + tokenRequestRenewalOption: + description: TokenRequestRenewalOption contains options describing + how to renew TokenRequest + type: string type: object status: description: SveltosClusterStatus defines the status of SveltosCluster @@ -71,6 +75,11 @@ spec: FailureMessage is a human consumable message explaining the misconfiguration type: string + lastReconciledTokenRequestAt: + description: |- + LastReconciledTokenRequestAt is the last time the TokenRequest + was renewed. + type: string ready: description: Ready is the state of the cluster. type: boolean diff --git a/lib/crd/sveltosclusters.go b/lib/crd/sveltosclusters.go index 26ae959..d94bc49 100644 --- a/lib/crd/sveltosclusters.go +++ b/lib/crd/sveltosclusters.go @@ -81,6 +81,10 @@ spec: Paused can be used to prevent controllers from processing the SveltosCluster and all its associated objects. type: boolean + tokenRequestRenewalOption: + description: TokenRequestRenewalOption contains options describing + how to renew TokenRequest + type: string type: object status: description: SveltosClusterStatus defines the status of SveltosCluster @@ -90,6 +94,11 @@ spec: FailureMessage is a human consumable message explaining the misconfiguration type: string + lastReconciledTokenRequestAt: + description: |- + LastReconciledTokenRequestAt is the last time the TokenRequest + was renewed. + type: string ready: description: Ready is the state of the cluster. type: boolean