mirror of https://github.com/kubernetes/kops.git
Adding a test for deleting keysets
This commit is contained in:
parent
8bb078a4a8
commit
78e8d83d91
|
|
@ -73,6 +73,7 @@ go_test(
|
|||
],
|
||||
embed = [":go_default_library"],
|
||||
deps = [
|
||||
"//pkg/apis/kops:go_default_library",
|
||||
"//pkg/pki:go_default_library",
|
||||
"//util/pkg/vfs:go_default_library",
|
||||
],
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ import (
|
|||
"testing"
|
||||
"time"
|
||||
|
||||
"k8s.io/kops/pkg/apis/kops"
|
||||
"k8s.io/kops/pkg/pki"
|
||||
"k8s.io/kops/util/pkg/vfs"
|
||||
)
|
||||
|
|
@ -214,4 +215,20 @@ spec:
|
|||
}
|
||||
}
|
||||
|
||||
// Check that keyset gets deleted
|
||||
{
|
||||
keyset := &kops.Keyset{}
|
||||
keyset.Name = "ca"
|
||||
keyset.Spec.Type = kops.SecretTypeKeypair
|
||||
|
||||
s.DeleteKeysetItem(keyset, "237054359138908419352140518924933177492")
|
||||
|
||||
_, err := pathMap["memfs://tests/private/ca/237054359138908419352140518924933177492.key"].ReadFile()
|
||||
pathMap["memfs://tests/private/ca/237054359138908419352140518924933177492.key"].ReadFile()
|
||||
if err == nil {
|
||||
t.Fatalf("File memfs://tests/private/ca/237054359138908419352140518924933177492.key still exists")
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue