@@ -33,7 +33,7 @@ type ClusterTokenSpec struct {
3333 // Important: Run "make" to regenerate code after modifying this file
3434
3535 // +kubebuilder:validation:Required
36- Secret clusterTokenSecretSpec `json:"secret"`
36+ Secret ClusterTokenSecretSpec `json:"secret"`
3737
3838 // +optional
3939 // +kubebuilder:example:="123456789"
@@ -63,7 +63,7 @@ type ClusterTokenSpec struct {
6363 RepositoryIDs []int64 `json:"repositoryIDs,omitempty"`
6464}
6565
66- type clusterTokenSecretSpec struct {
66+ type ClusterTokenSecretSpec struct {
6767 // +kubebuilder:validation:Required
6868 // +kubebuilder:validation:MaxLength:=253
6969 // +kubebuilder:example:="default"
@@ -75,6 +75,14 @@ type clusterTokenSecretSpec struct {
7575 // Name for the Secret managed by this ClusterToken (defaults to the name of the ClusterToken)
7676 Name string `json:"name,omitempty"`
7777
78+ // +optional
79+ // Extra labels for the Secret managed by this Token
80+ Labels map [string ]string `json:"labels,omitempty"`
81+
82+ // +optional
83+ // Extra annotations for the Secret managed by this Token
84+ Annotations map [string ]string `json:"annotations,omitempty"`
85+
7886 // +optional
7987 // Create a secret with 'username' and 'password' fields for HTTP Basic Auth rather than simply 'token'
8088 BasicAuth bool `json:"basicAuth,omitempty"`
@@ -133,6 +141,14 @@ func (t *ClusterToken) GetSecretName() string {
133141 return secretName
134142}
135143
144+ func (t * ClusterToken ) GetSecretLabels () map [string ]string {
145+ return t .Spec .Secret .Labels
146+ }
147+
148+ func (t * ClusterToken ) GetSecretAnnotations () map [string ]string {
149+ return t .Spec .Secret .Annotations
150+ }
151+
136152func (t * ClusterToken ) GetSecretBasicAuth () bool {
137153 return t .Spec .Secret .BasicAuth
138154}
0 commit comments