Handled list secrets for no secret in namespaces

Signed-off-by: Nitishkumar Singh <nitishkumarsingh71@gmail.com>

Test case included for default and non-default

Signed-off-by: Nitishkumar Singh <nitishkumarsingh71@gmail.com>

Changed Fake Labeller Implementation

Signed-off-by: Nitishkumar Singh <nitishkumarsingh71@gmail.com>
This commit is contained in:
Nitishkumar Singh
2021-11-07 10:01:19 +05:30
committed by Alex Ellis
parent 551e6645b7
commit a2ea804d2c
12 changed files with 140 additions and 24 deletions

18
pkg/provider/labeller.go Normal file
View File

@ -0,0 +1,18 @@
package provider
import "context"
type Labeller interface {
Labels(ctx context.Context, namespace string) (map[string]string, error)
}
/*
* FakeLabeller can be used to fake labels applied on namespace to mark them valid/invalid for openfaas functions
*/
type FakeLabeller struct {
FakeLabels map[string]string
}
func (s *FakeLabeller) Labels(ctx context.Context, namespace string) (map[string]string, error) {
return s.FakeLabels, nil
}