Support for azure acr helm repositories (#1526)

Adds a basic support for Helm repositories hosted on Azure Container Registry (not OCI but classic ones). Add a new field to RepositorySpec to state that is externally managed and runs the `az-cli` command instead of the helm one to manage the repository.
This commit is contained in:
Javier Palacios
2020-10-15 08:45:45 +09:00
committed by GitHub
parent 563fce4adf
commit 8f8669778c
8 changed files with 88 additions and 37 deletions
+15 -4
View File
@@ -857,7 +857,18 @@ func TestHelmState_SyncRepos(t *testing.T) {
},
},
helm: &exectest.Helm{},
want: []string{"name", "http://example.com/", "", "", "", "", ""},
want: []string{"name", "http://example.com/", "", "", "", "", "", ""},
},
{
name: "ACR hosted repository",
repos: []RepositorySpec{
{
Name: "name",
Managed: "acr",
},
},
helm: &exectest.Helm{},
want: []string{"name", "", "", "", "", "", "", "acr"},
},
{
name: "repository with cert and key",
@@ -872,7 +883,7 @@ func TestHelmState_SyncRepos(t *testing.T) {
},
},
helm: &exectest.Helm{},
want: []string{"name", "http://example.com/", "", "certfile", "keyfile", "", ""},
want: []string{"name", "http://example.com/", "", "certfile", "keyfile", "", "", ""},
},
{
name: "repository with ca file",
@@ -886,7 +897,7 @@ func TestHelmState_SyncRepos(t *testing.T) {
},
},
helm: &exectest.Helm{},
want: []string{"name", "http://example.com/", "cafile", "", "", "", ""},
want: []string{"name", "http://example.com/", "cafile", "", "", "", "", ""},
},
{
name: "repository with username and password",
@@ -901,7 +912,7 @@ func TestHelmState_SyncRepos(t *testing.T) {
},
},
helm: &exectest.Helm{},
want: []string{"name", "http://example.com/", "", "", "", "example_user", "example_password"},
want: []string{"name", "http://example.com/", "", "", "", "example_user", "example_password", ""},
},
}
for i := range tests {