diff --git a/api/testworkflows/v1/content_types.go b/api/testworkflows/v1/content_types.go index 13811e91..a899b1c4 100644 --- a/api/testworkflows/v1/content_types.go +++ b/api/testworkflows/v1/content_types.go @@ -19,6 +19,10 @@ type ContentGit struct { Token string `json:"token,omitempty" expr:"template"` // external token to fetch with TokenFrom *corev1.EnvVarSource `json:"tokenFrom,omitempty" expr:"force"` + // plain text SSH private key to fetch with + SshKey string `json:"sshKey,omitempty" expr:"template"` + // external SSH private key to fetch with + SshKeyFrom *corev1.EnvVarSource `json:"sshKeyFrom,omitempty" expr:"force"` // authorization type for the credentials AuthType testsv3.GitAuthType `json:"authType,omitempty" expr:"template"` // where to mount the fetched repository contents (defaults to "repo" directory in the data volume) diff --git a/api/testworkflows/v1/zz_generated.deepcopy.go b/api/testworkflows/v1/zz_generated.deepcopy.go index 8daff557..3fd71d92 100644 --- a/api/testworkflows/v1/zz_generated.deepcopy.go +++ b/api/testworkflows/v1/zz_generated.deepcopy.go @@ -183,6 +183,11 @@ func (in *ContentGit) DeepCopyInto(out *ContentGit) { *out = new(corev1.EnvVarSource) (*in).DeepCopyInto(*out) } + if in.SshKeyFrom != nil { + in, out := &in.SshKeyFrom, &out.SshKeyFrom + *out = new(corev1.EnvVarSource) + (*in).DeepCopyInto(*out) + } if in.Paths != nil { in, out := &in.Paths, &out.Paths *out = make([]string, len(*in)) diff --git a/config/crd/bases/testworkflows.testkube.io_testworkflows.yaml b/config/crd/bases/testworkflows.testkube.io_testworkflows.yaml index 12294503..5fbbfb4a 100644 --- a/config/crd/bases/testworkflows.testkube.io_testworkflows.yaml +++ b/config/crd/bases/testworkflows.testkube.io_testworkflows.yaml @@ -409,6 +409,63 @@ spec: revision: description: branch, commit or a tag name to fetch type: string + sshKey: + description: plain text SSH private key to fetch with + type: string + sshKeyFrom: + description: external SSH private key to fetch with + properties: + configMapKeyRef: + properties: + key: + type: string + name: + type: string + optional: + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic + fieldRef: + properties: + apiVersion: + type: string + fieldPath: + type: string + required: + - fieldPath + type: object + x-kubernetes-map-type: atomic + resourceFieldRef: + properties: + containerName: + type: string + divisor: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + resource: + type: string + required: + - resource + type: object + x-kubernetes-map-type: atomic + secretKeyRef: + properties: + key: + type: string + name: + type: string + optional: + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic + type: object token: description: plain text token to fetch with type: string @@ -2015,6 +2072,63 @@ spec: revision: description: branch, commit or a tag name to fetch type: string + sshKey: + description: plain text SSH private key to fetch with + type: string + sshKeyFrom: + description: external SSH private key to fetch with + properties: + configMapKeyRef: + properties: + key: + type: string + name: + type: string + optional: + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic + fieldRef: + properties: + apiVersion: + type: string + fieldPath: + type: string + required: + - fieldPath + type: object + x-kubernetes-map-type: atomic + resourceFieldRef: + properties: + containerName: + type: string + divisor: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + resource: + type: string + required: + - resource + type: object + x-kubernetes-map-type: atomic + secretKeyRef: + properties: + key: + type: string + name: + type: string + optional: + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic + type: object token: description: plain text token to fetch with type: string @@ -3255,6 +3369,63 @@ spec: revision: description: branch, commit or a tag name to fetch type: string + sshKey: + description: plain text SSH private key to fetch with + type: string + sshKeyFrom: + description: external SSH private key to fetch with + properties: + configMapKeyRef: + properties: + key: + type: string + name: + type: string + optional: + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic + fieldRef: + properties: + apiVersion: + type: string + fieldPath: + type: string + required: + - fieldPath + type: object + x-kubernetes-map-type: atomic + resourceFieldRef: + properties: + containerName: + type: string + divisor: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + resource: + type: string + required: + - resource + type: object + x-kubernetes-map-type: atomic + secretKeyRef: + properties: + key: + type: string + name: + type: string + optional: + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic + type: object token: description: plain text token to fetch with type: string @@ -3752,6 +3923,63 @@ spec: revision: description: branch, commit or a tag name to fetch type: string + sshKey: + description: plain text SSH private key to fetch with + type: string + sshKeyFrom: + description: external SSH private key to fetch with + properties: + configMapKeyRef: + properties: + key: + type: string + name: + type: string + optional: + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic + fieldRef: + properties: + apiVersion: + type: string + fieldPath: + type: string + required: + - fieldPath + type: object + x-kubernetes-map-type: atomic + resourceFieldRef: + properties: + containerName: + type: string + divisor: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + resource: + type: string + required: + - resource + type: object + x-kubernetes-map-type: atomic + secretKeyRef: + properties: + key: + type: string + name: + type: string + optional: + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic + type: object token: description: plain text token to fetch with type: string @@ -4899,6 +5127,63 @@ spec: revision: description: branch, commit or a tag name to fetch type: string + sshKey: + description: plain text SSH private key to fetch with + type: string + sshKeyFrom: + description: external SSH private key to fetch with + properties: + configMapKeyRef: + properties: + key: + type: string + name: + type: string + optional: + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic + fieldRef: + properties: + apiVersion: + type: string + fieldPath: + type: string + required: + - fieldPath + type: object + x-kubernetes-map-type: atomic + resourceFieldRef: + properties: + containerName: + type: string + divisor: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + resource: + type: string + required: + - resource + type: object + x-kubernetes-map-type: atomic + secretKeyRef: + properties: + key: + type: string + name: + type: string + optional: + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic + type: object token: description: plain text token to fetch with type: string @@ -6505,6 +6790,63 @@ spec: revision: description: branch, commit or a tag name to fetch type: string + sshKey: + description: plain text SSH private key to fetch with + type: string + sshKeyFrom: + description: external SSH private key to fetch with + properties: + configMapKeyRef: + properties: + key: + type: string + name: + type: string + optional: + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic + fieldRef: + properties: + apiVersion: + type: string + fieldPath: + type: string + required: + - fieldPath + type: object + x-kubernetes-map-type: atomic + resourceFieldRef: + properties: + containerName: + type: string + divisor: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + resource: + type: string + required: + - resource + type: object + x-kubernetes-map-type: atomic + secretKeyRef: + properties: + key: + type: string + name: + type: string + optional: + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic + type: object token: description: plain text token to fetch with type: string @@ -7707,6 +8049,63 @@ spec: revision: description: branch, commit or a tag name to fetch type: string + sshKey: + description: plain text SSH private key to fetch with + type: string + sshKeyFrom: + description: external SSH private key to fetch with + properties: + configMapKeyRef: + properties: + key: + type: string + name: + type: string + optional: + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic + fieldRef: + properties: + apiVersion: + type: string + fieldPath: + type: string + required: + - fieldPath + type: object + x-kubernetes-map-type: atomic + resourceFieldRef: + properties: + containerName: + type: string + divisor: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + resource: + type: string + required: + - resource + type: object + x-kubernetes-map-type: atomic + secretKeyRef: + properties: + key: + type: string + name: + type: string + optional: + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic + type: object token: description: plain text token to fetch with type: string @@ -9313,6 +9712,63 @@ spec: revision: description: branch, commit or a tag name to fetch type: string + sshKey: + description: plain text SSH private key to fetch with + type: string + sshKeyFrom: + description: external SSH private key to fetch with + properties: + configMapKeyRef: + properties: + key: + type: string + name: + type: string + optional: + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic + fieldRef: + properties: + apiVersion: + type: string + fieldPath: + type: string + required: + - fieldPath + type: object + x-kubernetes-map-type: atomic + resourceFieldRef: + properties: + containerName: + type: string + divisor: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + resource: + type: string + required: + - resource + type: object + x-kubernetes-map-type: atomic + secretKeyRef: + properties: + key: + type: string + name: + type: string + optional: + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic + type: object token: description: plain text token to fetch with type: string diff --git a/config/crd/bases/testworkflows.testkube.io_testworkflowtemplates.yaml b/config/crd/bases/testworkflows.testkube.io_testworkflowtemplates.yaml index 979844a3..d6051370 100644 --- a/config/crd/bases/testworkflows.testkube.io_testworkflowtemplates.yaml +++ b/config/crd/bases/testworkflows.testkube.io_testworkflowtemplates.yaml @@ -409,6 +409,63 @@ spec: revision: description: branch, commit or a tag name to fetch type: string + sshKey: + description: plain text SSH private key to fetch with + type: string + sshKeyFrom: + description: external SSH private key to fetch with + properties: + configMapKeyRef: + properties: + key: + type: string + name: + type: string + optional: + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic + fieldRef: + properties: + apiVersion: + type: string + fieldPath: + type: string + required: + - fieldPath + type: object + x-kubernetes-map-type: atomic + resourceFieldRef: + properties: + containerName: + type: string + divisor: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + resource: + type: string + required: + - resource + type: object + x-kubernetes-map-type: atomic + secretKeyRef: + properties: + key: + type: string + name: + type: string + optional: + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic + type: object token: description: plain text token to fetch with type: string @@ -1998,6 +2055,63 @@ spec: revision: description: branch, commit or a tag name to fetch type: string + sshKey: + description: plain text SSH private key to fetch with + type: string + sshKeyFrom: + description: external SSH private key to fetch with + properties: + configMapKeyRef: + properties: + key: + type: string + name: + type: string + optional: + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic + fieldRef: + properties: + apiVersion: + type: string + fieldPath: + type: string + required: + - fieldPath + type: object + x-kubernetes-map-type: atomic + resourceFieldRef: + properties: + containerName: + type: string + divisor: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + resource: + type: string + required: + - resource + type: object + x-kubernetes-map-type: atomic + secretKeyRef: + properties: + key: + type: string + name: + type: string + optional: + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic + type: object token: description: plain text token to fetch with type: string @@ -3181,6 +3295,63 @@ spec: revision: description: branch, commit or a tag name to fetch type: string + sshKey: + description: plain text SSH private key to fetch with + type: string + sshKeyFrom: + description: external SSH private key to fetch with + properties: + configMapKeyRef: + properties: + key: + type: string + name: + type: string + optional: + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic + fieldRef: + properties: + apiVersion: + type: string + fieldPath: + type: string + required: + - fieldPath + type: object + x-kubernetes-map-type: atomic + resourceFieldRef: + properties: + containerName: + type: string + divisor: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + resource: + type: string + required: + - resource + type: object + x-kubernetes-map-type: atomic + secretKeyRef: + properties: + key: + type: string + name: + type: string + optional: + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic + type: object token: description: plain text token to fetch with type: string @@ -3678,6 +3849,63 @@ spec: revision: description: branch, commit or a tag name to fetch type: string + sshKey: + description: plain text SSH private key to fetch with + type: string + sshKeyFrom: + description: external SSH private key to fetch with + properties: + configMapKeyRef: + properties: + key: + type: string + name: + type: string + optional: + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic + fieldRef: + properties: + apiVersion: + type: string + fieldPath: + type: string + required: + - fieldPath + type: object + x-kubernetes-map-type: atomic + resourceFieldRef: + properties: + containerName: + type: string + divisor: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + resource: + type: string + required: + - resource + type: object + x-kubernetes-map-type: atomic + secretKeyRef: + properties: + key: + type: string + name: + type: string + optional: + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic + type: object token: description: plain text token to fetch with type: string @@ -4805,6 +5033,63 @@ spec: revision: description: branch, commit or a tag name to fetch type: string + sshKey: + description: plain text SSH private key to fetch with + type: string + sshKeyFrom: + description: external SSH private key to fetch with + properties: + configMapKeyRef: + properties: + key: + type: string + name: + type: string + optional: + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic + fieldRef: + properties: + apiVersion: + type: string + fieldPath: + type: string + required: + - fieldPath + type: object + x-kubernetes-map-type: atomic + resourceFieldRef: + properties: + containerName: + type: string + divisor: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + resource: + type: string + required: + - resource + type: object + x-kubernetes-map-type: atomic + secretKeyRef: + properties: + key: + type: string + name: + type: string + optional: + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic + type: object token: description: plain text token to fetch with type: string @@ -6394,6 +6679,63 @@ spec: revision: description: branch, commit or a tag name to fetch type: string + sshKey: + description: plain text SSH private key to fetch with + type: string + sshKeyFrom: + description: external SSH private key to fetch with + properties: + configMapKeyRef: + properties: + key: + type: string + name: + type: string + optional: + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic + fieldRef: + properties: + apiVersion: + type: string + fieldPath: + type: string + required: + - fieldPath + type: object + x-kubernetes-map-type: atomic + resourceFieldRef: + properties: + containerName: + type: string + divisor: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + resource: + type: string + required: + - resource + type: object + x-kubernetes-map-type: atomic + secretKeyRef: + properties: + key: + type: string + name: + type: string + optional: + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic + type: object token: description: plain text token to fetch with type: string @@ -7539,6 +7881,63 @@ spec: revision: description: branch, commit or a tag name to fetch type: string + sshKey: + description: plain text SSH private key to fetch with + type: string + sshKeyFrom: + description: external SSH private key to fetch with + properties: + configMapKeyRef: + properties: + key: + type: string + name: + type: string + optional: + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic + fieldRef: + properties: + apiVersion: + type: string + fieldPath: + type: string + required: + - fieldPath + type: object + x-kubernetes-map-type: atomic + resourceFieldRef: + properties: + containerName: + type: string + divisor: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + resource: + type: string + required: + - resource + type: object + x-kubernetes-map-type: atomic + secretKeyRef: + properties: + key: + type: string + name: + type: string + optional: + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic + type: object token: description: plain text token to fetch with type: string @@ -9128,6 +9527,63 @@ spec: revision: description: branch, commit or a tag name to fetch type: string + sshKey: + description: plain text SSH private key to fetch with + type: string + sshKeyFrom: + description: external SSH private key to fetch with + properties: + configMapKeyRef: + properties: + key: + type: string + name: + type: string + optional: + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic + fieldRef: + properties: + apiVersion: + type: string + fieldPath: + type: string + required: + - fieldPath + type: object + x-kubernetes-map-type: atomic + resourceFieldRef: + properties: + containerName: + type: string + divisor: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + resource: + type: string + required: + - resource + type: object + x-kubernetes-map-type: atomic + secretKeyRef: + properties: + key: + type: string + name: + type: string + optional: + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic + type: object token: description: plain text token to fetch with type: string diff --git a/config/rbac/role.yaml b/config/rbac/role.yaml index 015f6dc1..be876a7e 100644 --- a/config/rbac/role.yaml +++ b/config/rbac/role.yaml @@ -265,7 +265,7 @@ rules: - apiGroups: - testworkflows.testkube.io resources: - - testworkflows + - testworkflowexecutions verbs: - create - delete @@ -277,13 +277,13 @@ rules: - apiGroups: - testworkflows.testkube.io resources: - - testworkflows/finalizers + - testworkflowexecutions/finalizers verbs: - update - apiGroups: - testworkflows.testkube.io resources: - - testworkflows/status + - testworkflowexecutions/status verbs: - get - patch @@ -291,7 +291,7 @@ rules: - apiGroups: - testworkflows.testkube.io resources: - - testworkflowtemplates + - testworkflows verbs: - create - delete @@ -303,32 +303,32 @@ rules: - apiGroups: - testworkflows.testkube.io resources: - - testworkflowtemplates/finalizers + - testworkflows/finalizers verbs: - update - apiGroups: - testworkflows.testkube.io resources: - - testworkflowexecutions + - testworkflows/status verbs: - - create - - delete - get - - list - patch - update - - watch - apiGroups: - testworkflows.testkube.io resources: - - testworkflowexecutions/finalizers + - testworkflowtemplates verbs: + - create + - delete + - get + - list + - patch - update + - watch - apiGroups: - testworkflows.testkube.io resources: - - testworkflowexecutions/status + - testworkflowtemplates/finalizers verbs: - - get - - patch - update