Просмотр исходного кода

Making CRD test pass by adding necessary types

Signed-off-by: Gustavo Carvalho <gustavo.carvalho@container-solutions.com>
Signed-off-by: Marcin Kubica <marcin.kubica@engineerbetter.com>
Signed-off-by: William Young <will.young@engineerbetter.com>
Dominic Meddick 4 лет назад
Родитель
Сommit
3b854797d0

+ 23 - 2
apis/externalsecrets/v1alpha1/secretsink_types.go

@@ -21,8 +21,29 @@ import (
 
 // SecretSinkSpec configures the behavior of the SecretSink.
 type SecretSinkSpec struct {
-	Selector string   `json:"selector"`
-	Data     []string `json:"data,omitempty"`
+	Selector SecretSinkSelector `json:"selector"`
+	Data     []SecretSinkData   `json:"data,omitempty"`
+}
+
+type SecretSinkSecret struct {
+	Name string `json:"name"`
+}
+
+type SecretSinkSelector struct {
+	Secret SecretSinkSecret `json:"secret"`
+}
+
+type SecretSinkRemoteRefs struct {
+	RemoteKey string `json:"remoteKey"`
+}
+
+type SecretSinkMatch struct {
+	SecretKey  string                 `json:"secretKey"`
+	RemoteRefs []SecretSinkRemoteRefs `json:"remoteRefs"`
+}
+
+type SecretSinkData struct {
+	Match SecretSinkMatch `json:"match"`
 }
 
 // SecretSinkConditionType indicates the condition of the SecretSink.

+ 87 - 2
apis/externalsecrets/v1alpha1/zz_generated.deepcopy.go

@@ -991,6 +991,22 @@ func (in *SecretSink) DeepCopyObject() runtime.Object {
 	return nil
 }
 
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *SecretSinkData) DeepCopyInto(out *SecretSinkData) {
+	*out = *in
+	in.Match.DeepCopyInto(&out.Match)
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SecretSinkData.
+func (in *SecretSinkData) DeepCopy() *SecretSinkData {
+	if in == nil {
+		return nil
+	}
+	out := new(SecretSinkData)
+	in.DeepCopyInto(out)
+	return out
+}
+
 // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
 func (in *SecretSinkList) DeepCopyInto(out *SecretSinkList) {
 	*out = *in
@@ -1023,13 +1039,82 @@ func (in *SecretSinkList) DeepCopyObject() runtime.Object {
 	return nil
 }
 
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *SecretSinkMatch) DeepCopyInto(out *SecretSinkMatch) {
+	*out = *in
+	if in.RemoteRefs != nil {
+		in, out := &in.RemoteRefs, &out.RemoteRefs
+		*out = make([]SecretSinkRemoteRefs, len(*in))
+		copy(*out, *in)
+	}
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SecretSinkMatch.
+func (in *SecretSinkMatch) DeepCopy() *SecretSinkMatch {
+	if in == nil {
+		return nil
+	}
+	out := new(SecretSinkMatch)
+	in.DeepCopyInto(out)
+	return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *SecretSinkRemoteRefs) DeepCopyInto(out *SecretSinkRemoteRefs) {
+	*out = *in
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SecretSinkRemoteRefs.
+func (in *SecretSinkRemoteRefs) DeepCopy() *SecretSinkRemoteRefs {
+	if in == nil {
+		return nil
+	}
+	out := new(SecretSinkRemoteRefs)
+	in.DeepCopyInto(out)
+	return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *SecretSinkSecret) DeepCopyInto(out *SecretSinkSecret) {
+	*out = *in
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SecretSinkSecret.
+func (in *SecretSinkSecret) DeepCopy() *SecretSinkSecret {
+	if in == nil {
+		return nil
+	}
+	out := new(SecretSinkSecret)
+	in.DeepCopyInto(out)
+	return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *SecretSinkSelector) DeepCopyInto(out *SecretSinkSelector) {
+	*out = *in
+	out.Secret = in.Secret
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SecretSinkSelector.
+func (in *SecretSinkSelector) DeepCopy() *SecretSinkSelector {
+	if in == nil {
+		return nil
+	}
+	out := new(SecretSinkSelector)
+	in.DeepCopyInto(out)
+	return out
+}
+
 // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
 func (in *SecretSinkSpec) DeepCopyInto(out *SecretSinkSpec) {
 	*out = *in
+	out.Selector = in.Selector
 	if in.Data != nil {
 		in, out := &in.Data, &out.Data
-		*out = make([]string, len(*in))
-		copy(*out, *in)
+		*out = make([]SecretSinkData, len(*in))
+		for i := range *in {
+			(*in)[i].DeepCopyInto(&(*out)[i])
+		}
 	}
 }
 

+ 32 - 2
config/crds/bases/external-secrets.io_secretsinks.yaml

@@ -37,10 +37,40 @@ spec:
             properties:
               data:
                 items:
-                  type: string
+                  properties:
+                    match:
+                      properties:
+                        remoteRefs:
+                          items:
+                            properties:
+                              remoteKey:
+                                type: string
+                            required:
+                            - remoteKey
+                            type: object
+                          type: array
+                        secretKey:
+                          type: string
+                      required:
+                      - remoteRefs
+                      - secretKey
+                      type: object
+                  required:
+                  - match
+                  type: object
                 type: array
               selector:
-                type: string
+                properties:
+                  secret:
+                    properties:
+                      name:
+                        type: string
+                    required:
+                    - name
+                    type: object
+                required:
+                - secret
+                type: object
             required:
             - selector
             type: object

+ 32 - 2
deploy/crds/bundle.yaml

@@ -3040,10 +3040,40 @@ spec:
               properties:
                 data:
                   items:
-                    type: string
+                    properties:
+                      match:
+                        properties:
+                          remoteRefs:
+                            items:
+                              properties:
+                                remoteKey:
+                                  type: string
+                              required:
+                                - remoteKey
+                              type: object
+                            type: array
+                          secretKey:
+                            type: string
+                        required:
+                          - remoteRefs
+                          - secretKey
+                        type: object
+                    required:
+                      - match
+                    type: object
                   type: array
                 selector:
-                  type: string
+                  properties:
+                    secret:
+                      properties:
+                        name:
+                          type: string
+                      required:
+                        - name
+                      type: object
+                  required:
+                    - secret
+                  type: object
               required:
                 - selector
               type: object