add service token to auth methods block for k8

This commit is contained in:
Maidul Islam
2023-04-16 18:40:33 -07:00
parent 5585893cfe
commit df2e0e03ff
5 changed files with 67 additions and 9 deletions

View File

@@ -5,7 +5,14 @@ import (
)
type Authentication struct {
// +kubebuilder:validation:Optional
ServiceAccount ServiceAccountDetails `json:"serviceAccount"`
// +kubebuilder:validation:Optional
ServiceToken ServiceTokenDetails `json:"serviceToken"`
}
type ServiceTokenDetails struct {
ServiceTokenSecretReference KubeSecretReference `json:"serviceTokenSecretReference"`
}
type ServiceAccountDetails struct {
@@ -27,10 +34,10 @@ type KubeSecretReference struct {
// InfisicalSecretSpec defines the desired state of InfisicalSecret
type InfisicalSecretSpec struct {
// +kubebuilder:validation:Optional
TokenSecretReference KubeSecretReference `json:"tokenSecretReference,omitempty"`
TokenSecretReference KubeSecretReference `json:"tokenSecretReference"`
// +kubebuilder:validation:Optional
Authentication Authentication `json:"authentication,omitempty"`
Authentication Authentication `json:"authentication"`
// +kubebuilder:validation:Required
ManagedSecretReference KubeSecretReference `json:"managedSecretReference"`

View File

@@ -30,6 +30,7 @@ import (
func (in *Authentication) DeepCopyInto(out *Authentication) {
*out = *in
out.ServiceAccount = in.ServiceAccount
out.ServiceToken = in.ServiceToken
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Authentication.
@@ -171,3 +172,19 @@ func (in *ServiceAccountDetails) DeepCopy() *ServiceAccountDetails {
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ServiceTokenDetails) DeepCopyInto(out *ServiceTokenDetails) {
*out = *in
out.ServiceTokenSecretReference = in.ServiceTokenSecretReference
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceTokenDetails.
func (in *ServiceTokenDetails) DeepCopy() *ServiceTokenDetails {
if in == nil {
return nil
}
out := new(ServiceTokenDetails)
in.DeepCopyInto(out)
return out
}