Skip to content

Commit

Permalink
Merge pull request #286 from gianlucam76/sveltoscluster
Browse files Browse the repository at this point in the history
Add option to renew TokenRequest
  • Loading branch information
gianlucam76 authored Apr 11, 2024
2 parents a66328c + c577acc commit 614be6c
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 1 deletion.
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

0 comments on commit 614be6c

Please sign in to comment.