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

Add option to renew TokenRequest #286

Merged
merged 1 commit into from
Apr 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions api/v1alpha1/sveltoscluster_type.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
28 changes: 27 additions & 1 deletion api/v1alpha1/zz_generated.deepcopy.go

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

9 changes: 9 additions & 0 deletions config/crd/bases/lib.projectsveltos.io_sveltosclusters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
9 changes: 9 additions & 0 deletions lib/crd/sveltosclusters.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
Loading