Skip to content

Commit

Permalink
Lint issues + Move the creation of the github token into the if state…
Browse files Browse the repository at this point in the history
…ment
  • Loading branch information
wwwlde committed Jan 8, 2024
1 parent 7b91828 commit c291161
Show file tree
Hide file tree
Showing 7 changed files with 95 additions and 7 deletions.
30 changes: 29 additions & 1 deletion config/deploy/crd.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
Expand Down Expand Up @@ -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:
Expand All @@ -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:
Expand All @@ -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:
Expand Down Expand Up @@ -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:
Expand All @@ -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:
Expand Down
29 changes: 29 additions & 0 deletions config/deploy/manifests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand All @@ -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:
Expand Down Expand Up @@ -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:
Expand All @@ -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:
Expand Down
3 changes: 3 additions & 0 deletions config/schemas/canary.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -1755,6 +1755,9 @@
"name": {
"type": "string"
},
"namespace": {
"type": "string"
},
"icon": {
"type": "string"
},
Expand Down
3 changes: 3 additions & 0 deletions config/schemas/component.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -1982,6 +1982,9 @@
"name": {
"type": "string"
},
"namespace": {
"type": "string"
},
"icon": {
"type": "string"
},
Expand Down
24 changes: 24 additions & 0 deletions config/schemas/health_gitProtocol.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@
},
"EnvVarSource": {
"properties": {
"serviceAccount": {
"type": "string"
},
"helmRef": {
"$ref": "#/$defs/HelmRefKeySelector"
},
"configMapKeyRef": {
"$ref": "#/$defs/ConfigMapKeySelector"
},
Expand All @@ -53,6 +59,9 @@
"name": {
"type": "string"
},
"namespace": {
"type": "string"
},
"icon": {
"type": "string"
},
Expand Down Expand Up @@ -99,6 +108,21 @@
"password"
]
},
"HelmRefKeySelector": {
"properties": {
"name": {
"type": "string"
},
"key": {
"type": "string"
}
},
"additionalProperties": false,
"type": "object",
"required": [
"key"
]
},
"Labels": {
"patternProperties": {
".*": {
Expand Down
3 changes: 3 additions & 0 deletions config/schemas/topology.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -1952,6 +1952,9 @@
"name": {
"type": "string"
},
"namespace": {
"type": "string"
},
"icon": {
"type": "string"
},
Expand Down
10 changes: 4 additions & 6 deletions fixtures/git/_setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

0 comments on commit c291161

Please sign in to comment.