Skip to content

Commit

Permalink
chore: delete services by name
Browse files Browse the repository at this point in the history
  • Loading branch information
adityathebe committed Apr 25, 2024
1 parent 392d4c8 commit c67419d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ jobs:
- run: make bin
- name: Test
env:
KUBERNETES_VERSION: v1.29.2
KUBERNETES_VERSION: v1.20.7
GH_TOKEN: ${{ secrets.CHECKRUNS_TOKEN }}
run: ./test/e2e.sh fixtures/${{matrix.suite.name}}
- name: Publish Unit Test Results
Expand Down
9 changes: 8 additions & 1 deletion checks/kubernetes_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,14 @@ func DeleteResources(ctx *context.Context, check v1.KubernetesResourceCheck, del
}

switch resource.GetKind() {
case "Namespace": // namespace cannot be deleted with `.DeleteCollection()`
case "Namespace", "Service":
// NOTE: namespace cannot be deleted with `.DeleteCollection()`
//
// Even though Service can be deleted with `.DeleteCollection()`
// it failed on the CI. It's probably due to an older kubernetes
// version we're using on the CI (v1.20.7).
// Delete it by name for now while we wait upgrade the kubernetes version
// on our CI.
if err := rc.Delete(ctx, resource.GetName(), deleteOpt); err != nil {
var statusErr *apiErrors.StatusError
if errors.As(err, &statusErr) {
Expand Down
2 changes: 1 addition & 1 deletion test/karina.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ ingressCA:
privateKey: ../.certs/ingress-ca.key
password: foobar
kubernetes:
version: v1.29.2
version: v1.20.7
kubeletExtraArgs:
node-labels: "ingress-ready=true"
authorization-mode: "AlwaysAllow"
Expand Down

0 comments on commit c67419d

Please sign in to comment.