Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: fixing lint-check version and cleaning up e2e test pods #62

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading