diff --git a/config/deploy/crd.yaml b/config/deploy/crd.yaml index eb766e05e..347481af3 100644 --- a/config/deploy/crd.yaml +++ b/config/deploy/crd.yaml @@ -1,4 +1,3 @@ ---- apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: @@ -3670,6 +3669,9 @@ spec: name: description: Name of the check type: string + namespace: + description: Namespace to insert the check into, if different to the namespace the canary is defined, e.g. + type: string password: properties: name: @@ -3687,6 +3689,16 @@ spec: required: - key type: object + helmRef: + properties: + key: + description: Key is a JSONPath expression used to fetch the key from the merged JSON. + type: string + name: + type: string + required: + - key + type: object secretKeyRef: properties: key: @@ -3696,6 +3708,9 @@ spec: required: - key type: object + serviceAccount: + description: ServiceAccount specifies the service account whose token should be fetched + type: string type: object type: object repository: @@ -3742,6 +3757,16 @@ spec: required: - key type: object + helmRef: + properties: + key: + description: Key is a JSONPath expression used to fetch the key from the merged JSON. + type: string + name: + type: string + required: + - key + type: object secretKeyRef: properties: key: @@ -3751,6 +3776,9 @@ spec: required: - key type: object + serviceAccount: + description: ServiceAccount specifies the service account whose token should be fetched + type: string type: object type: object required: diff --git a/config/deploy/manifests.yaml b/config/deploy/manifests.yaml index 25ad395b6..867af8aad 100644 --- a/config/deploy/manifests.yaml +++ b/config/deploy/manifests.yaml @@ -3669,6 +3669,9 @@ spec: name: description: Name of the check type: string + namespace: + description: Namespace to insert the check into, if different to the namespace the canary is defined, e.g. + type: string password: properties: name: @@ -3686,6 +3689,16 @@ spec: required: - key type: object + helmRef: + properties: + key: + description: Key is a JSONPath expression used to fetch the key from the merged JSON. + type: string + name: + type: string + required: + - key + type: object secretKeyRef: properties: key: @@ -3695,6 +3708,9 @@ spec: required: - key type: object + serviceAccount: + description: ServiceAccount specifies the service account whose token should be fetched + type: string type: object type: object repository: @@ -3741,6 +3757,16 @@ spec: required: - key type: object + helmRef: + properties: + key: + description: Key is a JSONPath expression used to fetch the key from the merged JSON. + type: string + name: + type: string + required: + - key + type: object secretKeyRef: properties: key: @@ -3750,6 +3776,9 @@ spec: required: - key type: object + serviceAccount: + description: ServiceAccount specifies the service account whose token should be fetched + type: string type: object type: object required: diff --git a/config/schemas/canary.schema.json b/config/schemas/canary.schema.json index 94d638078..aa1a29964 100644 --- a/config/schemas/canary.schema.json +++ b/config/schemas/canary.schema.json @@ -1755,6 +1755,9 @@ "name": { "type": "string" }, + "namespace": { + "type": "string" + }, "icon": { "type": "string" }, diff --git a/config/schemas/component.schema.json b/config/schemas/component.schema.json index fff3cc676..d15814989 100644 --- a/config/schemas/component.schema.json +++ b/config/schemas/component.schema.json @@ -1982,6 +1982,9 @@ "name": { "type": "string" }, + "namespace": { + "type": "string" + }, "icon": { "type": "string" }, diff --git a/config/schemas/health_gitProtocol.schema.json b/config/schemas/health_gitProtocol.schema.json index d7a4c728c..f019f661d 100644 --- a/config/schemas/health_gitProtocol.schema.json +++ b/config/schemas/health_gitProtocol.schema.json @@ -35,6 +35,12 @@ }, "EnvVarSource": { "properties": { + "serviceAccount": { + "type": "string" + }, + "helmRef": { + "$ref": "#/$defs/HelmRefKeySelector" + }, "configMapKeyRef": { "$ref": "#/$defs/ConfigMapKeySelector" }, @@ -53,6 +59,9 @@ "name": { "type": "string" }, + "namespace": { + "type": "string" + }, "icon": { "type": "string" }, @@ -99,6 +108,21 @@ "password" ] }, + "HelmRefKeySelector": { + "properties": { + "name": { + "type": "string" + }, + "key": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "key" + ] + }, "Labels": { "patternProperties": { ".*": { diff --git a/config/schemas/topology.schema.json b/config/schemas/topology.schema.json index 715878525..33040c5a3 100644 --- a/config/schemas/topology.schema.json +++ b/config/schemas/topology.schema.json @@ -1952,6 +1952,9 @@ "name": { "type": "string" }, + "namespace": { + "type": "string" + }, "icon": { "type": "string" }, diff --git a/fixtures/git/_setup.sh b/fixtures/git/_setup.sh index 09a994b45..9ed7c7a1b 100755 --- a/fixtures/git/_setup.sh +++ b/fixtures/git/_setup.sh @@ -13,19 +13,18 @@ if ! which mergestat > /dev/null; then fi fi +kubectl create namespace canaries || true + # creating a GITHUB_TOKEN Secret if [[ -z "${GH_TOKEN}" ]]; then printf "\nEnvironment variable for github token (GH_TOKEN) is missing!!!\n" exit 1; else printf "\nCreating secret from github token ending with '${GH_TOKEN:(-8)}'\n" + kubectl create secret generic github-token --from-literal=GITHUB_TOKEN="${GH_TOKEN}" --namespace canaries + kubectl get secret github-token -o yaml --namespace canaries fi -kubectl create namespace canaries || true - -kubectl create secret generic github-token --from-literal=GITHUB_TOKEN="${GH_TOKEN}" --namespace canaries -kubectl get secret github-token -o yaml --namespace canaries - helm repo add gitea-charts https://dl.gitea.io/charts helm repo update helm install gitea gitea-charts/gitea -f gitea.values --create-namespace --namespace gitea --wait @@ -39,5 +38,4 @@ curl -vvv -u gitea_admin:admin -H "Content-Type: application/json" http://lo kill $PID - kubectl create secret generic gitea --from-literal=username=gitea_admin --from-literal=password=admin --from-literal=url=http://gitea-http.gitea.svc:3000/gitea_admin/test_repo.git