Skip to content

Commit

Permalink
rename defaultNamespace
Browse files Browse the repository at this point in the history
Signed-off-by: David Wertenteil <[email protected]>
  • Loading branch information
David Wertenteil committed Oct 25, 2023
1 parent a2e3a2c commit c2a8a91
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions pkg/storage/v1/storage_nocache.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ type StorageNoCache struct {

var _ storage.StorageClient = (*StorageNoCache)(nil)

func CreateStorageNoCache(defaultNamespace string) (*StorageNoCache, error) {
func CreateStorageNoCache(namespace string) (*StorageNoCache, error) {
var config *rest.Config
kubeconfig := os.Getenv(KubeConfig)
// use the current context in kubeconfig
Expand All @@ -47,14 +47,14 @@ func CreateStorageNoCache(defaultNamespace string) (*StorageNoCache, error) {

return &StorageNoCache{
StorageClient: clientset.SpdxV1beta1(),
namespace: defaultNamespace,
namespace: namespace,
}, nil
}

func CreateFakeStorageNoCache(defaultNamespace string) (*StorageNoCache, error) {
func CreateFakeStorageNoCache(namespace string) (*StorageNoCache, error) {
return &StorageNoCache{
StorageClient: fake.NewSimpleClientset().SpdxV1beta1(),
namespace: defaultNamespace,
namespace: namespace,
}, nil
}

Expand Down
4 changes: 2 additions & 2 deletions pkg/storage/v1/storage_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func TestStorageNoCache_CreateFilteredSBOM(t *testing.T) {
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
sc, _ := CreateFakeStorageNoCache()
sc, _ := CreateFakeStorageNoCache("kubescape")
if err := sc.CreateFilteredSBOM(tt.args.SBOM); (err != nil) != tt.wantErr {
t.Errorf("CreateFilteredSBOM() error = %v, wantErr %v", err, tt.wantErr)
}
Expand Down Expand Up @@ -114,7 +114,7 @@ func TestStorageNoCache_PatchFilteredSBOM(t *testing.T) {
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
sc, _ := CreateFakeStorageNoCache()
sc, _ := CreateFakeStorageNoCache("kubescape")
filteredSBOM := &v1beta1.SBOMSPDXv2p3Filtered{
ObjectMeta: v1.ObjectMeta{
Name: tt.args.name,
Expand Down

0 comments on commit c2a8a91

Please sign in to comment.