Skip to content

Commit

Permalink
chore: fixing lint-check version and cleaning up e2e test pods
Browse files Browse the repository at this point in the history
  • Loading branch information
abalaie committed Oct 31, 2024
1 parent 7818da1 commit 0d4f7b0
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/lint-markdown-links.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: gaurav-nelson/github-action-markdown-link-check@v1
- uses: gaurav-nelson/github-action-markdown-link-check@d53a906aa6b22b8979d33bc86170567e619495ec
with:
use-verbose-mode: 'no'
config-file: '.mlc.config.json'
Expand Down
2 changes: 1 addition & 1 deletion internal/k8s.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ func (c *k8sClient) List(ctx context.Context, kind, namespace, labelSelector str
params = append(params, "-n", namespace)
}
if labelSelector != "" {
params = append(params, "-l", "'"+labelSelector+"'")
params = append(params, "-l", labelSelector)
}
params = append(params, "-o", "json")

Expand Down
12 changes: 12 additions & 0 deletions internal/noCloudResources.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,18 @@ import (

func noCloudResources(ctx context.Context) error {
kfrCtx := KfrFromContext(ctx)

// First deleting pods that are created for E2E tests so they don't block PVC, PV and NfsVolume deletion
podsForE2ETests, err := kfrCtx.K8S.List(ctx, "pods", "-A", "context=cloud-manager-tests")
if err != nil {
return err
}
for _, pod := range podsForE2ETests {
if err := kfrCtx.K8S.Delete(ctx, "pods", pod.Name, pod.Namespace, false); err != nil {
return fmt.Errorf("error deleting pod %s/%s: %w", pod.Namespace, pod.Name, err)
}
}

kinds, err := kfrCtx.K8S.CloudResourceKinds(ctx)
if err != nil {
return err
Expand Down
3 changes: 3 additions & 0 deletions internal/resourceApplied.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ func resourceApplied(ctx context.Context, ref string, txt *godog.DocString) erro
return errors.New("zero length kind")
}

// set context label to all resources
err = unstructured.SetNestedField(val, map[string]interface{}{"context": "cloud-manager-tests"}, "metadata", "labels")

if len(ref) > 0 {
rd = kfrCtx.Get(ref)
if rd == nil {
Expand Down

0 comments on commit 0d4f7b0

Please sign in to comment.