Skip to content

Commit

Permalink
fix(configmap): command fixed to grant permissions to the parent fold…
Browse files Browse the repository at this point in the history
…ers (#313)

* fix(configmap): command fixed to grant permissions to the parent folders

Signed-off-by: Jose Ramon Mañes <[email protected]>

* fix(command): init command fixed

Signed-off-by: Jose Ramon Mañes <[email protected]>

* fix(command): utils added

Signed-off-by: Jose Ramon Mañes <[email protected]>

* feat(example): example tests added

Signed-off-by: Jose Ramon Mañes <[email protected]>

* fix(comments): update comments + use assert

Signed-off-by: Jose Ramon Mañes <[email protected]>

* fix(command): crash in case of multiple volumes

Signed-off-by: Jose Ramon Mañes <[email protected]>

* fix(command): add eof

Signed-off-by: Jose Ramon Mañes <[email protected]>

* fix(command): tmp feat

Signed-off-by: Jose Ramon Mañes <[email protected]>

* fix(command): fix

Signed-off-by: Jose Ramon Mañes <[email protected]>

* fix(command): undo fix

Signed-off-by: Jose Ramon Mañes <[email protected]>

* fix(comments): fix assert comments

Signed-off-by: Jose Ramon Mañes <[email protected]>

* fix(comments): fix assert comments

Signed-off-by: Jose Ramon Mañes <[email protected]>

* fix(comments): fix assert comments

Signed-off-by: Jose Ramon Mañes <[email protected]>

---------

Signed-off-by: Jose Ramon Mañes <[email protected]>
  • Loading branch information
tty47 authored May 7, 2024
1 parent 0bb8566 commit 7147da7
Show file tree
Hide file tree
Showing 12 changed files with 549 additions and 42 deletions.
52 changes: 52 additions & 0 deletions e2e/basic/assert_cleanups.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
package basic

import (
"os"
"testing"

"github.com/celestiaorg/knuu/pkg/knuu"
)

// assertCleanupInstance is a helper function that cleans up a single instance.
func assertCleanupInstance(t *testing.T, instance *knuu.Instance) error {
if instance != nil {
err := instance.Destroy()
if err != nil {
t.Fatalf("Error destroying instance: %v", err)
}
}
return nil
}

// assertCleanupInstances is a helper function that cleans up a list of instances.
func assertCleanupInstances(t *testing.T, executor *knuu.Executor, instances []*knuu.Instance) error {
if os.Getenv("KNUU_SKIP_CLEANUP") != "true" {
err := executor.Destroy()
if err != nil {
t.Fatalf("Error destroying executor: %v", err)
}

for _, instance := range instances {
if instance != nil {
err := instance.Destroy()
if err != nil {
t.Fatalf("Error destroying instance: %v", err)
}
}
}
}
return nil
}

// BatchDestroy destroys a list of instances.
func BatchDestroy(instances ...*knuu.Instance) error {
for _, instance := range instances {
if instance != nil {
err := instance.Destroy()
if err != nil {
return err
}
}
}
return nil
}
17 changes: 3 additions & 14 deletions e2e/basic/file_test_image_cached_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,20 +63,9 @@ func TestFileCached(t *testing.T) {

t.Cleanup(func() {
// Cleanup
if os.Getenv("KNUU_SKIP_CLEANUP") != "true" {
err := executor.Destroy()
if err != nil {
t.Fatalf("Error destroying executor: %v", err)
}

for _, instance := range instances {
if instance != nil {
err := instance.Destroy()
if err != nil {
t.Fatalf("Error destroying instance: %v", err)
}
}
}
err := assertCleanupInstances(t, executor, instances)
if err != nil {
t.Fatalf("Error cleaning up: %v", err)
}
})

Expand Down
Loading

0 comments on commit 7147da7

Please sign in to comment.