chore: add tests for handler
This commit is contained in:
+10
-1
@@ -36,7 +36,16 @@ func main() {
|
||||
}
|
||||
}
|
||||
|
||||
func handle(cli CLI, logger log.Interface, kubeClient *kube.Client, gitlabClient *gitlab.RestClient) error {
|
||||
type KubeClient interface {
|
||||
GetImages(ctx context.Context, logger log.Interface, namespaces []string) (map[string][]string, error)
|
||||
}
|
||||
|
||||
type GitlabClient interface {
|
||||
GetTags(image string) ([]gitlab.Tag, error)
|
||||
UpdateCleanupPolicy(project string, versions []string) error
|
||||
}
|
||||
|
||||
func handle(cli CLI, logger log.Interface, kubeClient KubeClient, gitlabClient GitlabClient) error {
|
||||
images, err := kubeClient.GetImages(context.Background(), logger, cli.Namespaces)
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
Reference in New Issue
Block a user