few fixes

This commit is contained in:
Akshit Agrawal
2024-01-26 21:27:05 +05:30
parent ef2395a7b9
commit 88fd4666c8
2 changed files with 0 additions and 30 deletions
-10
View File
@@ -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")
-20
View File
@@ -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)
}
}