chore: add tests for handler

This commit is contained in:
2022-10-02 09:40:33 +02:00
parent c587c75c82
commit 0c5d342b00
2 changed files with 195 additions and 1 deletions
+10 -1
View File
@@ -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