Skip to content

Commit

Permalink
chore: fix kubernetes tests
Browse files Browse the repository at this point in the history
  • Loading branch information
moshloop committed Jan 10, 2024
1 parent 2ba2f31 commit 989548c
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 2 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,7 @@ tmp/
ginkgo.report
__debug*
test-results.xml
coverprofile.out
junit-report.xml
canary-checker.properties
*.code-workspace
2 changes: 1 addition & 1 deletion checks/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ func transform(ctx *context.Context, in *pkg.CheckResult) ([]*pkg.CheckResult, b
results = append(results, &r)
}
if ctx.IsTrace() {
ctx.Tracef("transformed %s into %v", in, results)
ctx.Tracef("transformed %s into %d results", in, len(results))
}
return results, hasTransformer, nil
} else if len(transformed) == 1 && t.Name == "" {
Expand Down
2 changes: 1 addition & 1 deletion fixtures/git/_setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +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
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 --namespace canaries
4 changes: 4 additions & 0 deletions fixtures/k8s/kubernetes_bundle.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ spec:
expr: |
dyn(results).map(r, {
'name': r.Object.metadata.name,
'namespace': r.Object.metadata.?namespace.orValue(null),
'labels': r.Object.metadata.labels,
'pass': k8s.isHealthy(r.Object),
'message': k8s.getHealth(r.Object).message,
Expand All @@ -20,10 +21,13 @@ spec:
- kind: Pod
ready: true
name: pod-bundle
resource:
labelSelector: app != k8s-not-ready, Expected-Fail != true, canary-checker.flanksource.com/generated != true
transform:
expr: |
dyn(results).map(r, {
'name': r.Object.metadata.name,
'namespace': r.Object.metadata.namespace,
'labels': r.Object.metadata.labels,
'pass': k8s.isHealthy(r.Object),
'message': k8s.getHealth(r.Object).message,
Expand Down

0 comments on commit 989548c

Please sign in to comment.