From 88fd4666c8a4eef9996c4a2d81264928c4af7a6e Mon Sep 17 00:00:00 2001 From: Akshit Agrawal Date: Fri, 26 Jan 2024 21:27:05 +0530 Subject: [PATCH] few fixes --- plugin/plugin.go | 10 ---------- plugin/plugin_test.go | 20 -------------------- 2 files changed, 30 deletions(-) diff --git a/plugin/plugin.go b/plugin/plugin.go index a67be44..951cf59 100644 --- a/plugin/plugin.go +++ b/plugin/plugin.go @@ -123,11 +123,6 @@ func registryLogin(args *Args, opts []registry.ClientOption) error { return fmt.Errorf("failed to create registry client") } - // mock registry - if args.Username == "testUser" && args.Password == "testUser" && args.RegistryUrl == "https://test.hub.docker.com" { - return nil - } - cfg := new(action.Configuration) cfg.RegistryClient = registryClient @@ -167,11 +162,6 @@ func registryPush(args *Args, opts []registry.ClientOption, packageRun string) e remoteURL = fmt.Sprintf("oci://%s/%s", args.RegistryUrl, args.Namespace) } - // mock registry - if args.Username == "testUser" && args.Password == "testUser" && args.RegistryUrl == "https://test.hub.docker.com" { - return nil - } - _, err = client.Run(packageRun, remoteURL) if err != nil { return fmt.Errorf("failed to push chart") diff --git a/plugin/plugin_test.go b/plugin/plugin_test.go index 11114ba..975da34 100644 --- a/plugin/plugin_test.go +++ b/plugin/plugin_test.go @@ -120,16 +120,6 @@ func TestRegistryLogin(t *testing.T) { t.Error(err) } - // Test with mock registry - err = registryLogin(&Args{ - RegistryUrl: "https://test.hub.docker.com", - Username: "testUser", - Password: "testUser", - }, []registry.ClientOption{}) - - if err != nil { - t.Error(err) - } } func TestRegistryPush(t *testing.T) { @@ -144,14 +134,4 @@ func TestRegistryPush(t *testing.T) { t.Error(err) } - // Test with mock registry - err = registryPush(&Args{ - RegistryUrl: "https://test.hub.docker.com", - Username: "testUser", - Password: "testUser", - }, []registry.ClientOption{}, "test-chart/chart-pass") - - if err != nil { - t.Error(err) - } }