Add a setting for chart repository CA certificates [#74]

This commit is contained in:
Erin Call
2020-01-20 09:15:35 -08:00
parent 8a9cf23ab9
commit 1f7b6bb389
6 changed files with 28 additions and 4 deletions

View File

@@ -97,6 +97,19 @@ func (suite *AddRepoTestSuite) TestPrepareWithEqualSignInURL() {
suite.Contains(suite.commandArgs, "https://github.com/arthur_claypool/samaritan?version=2.1")
}
func (suite *AddRepoTestSuite) TestRepoAddFlags() {
suite.mockCmd.EXPECT().Stdout(gomock.Any()).AnyTimes()
suite.mockCmd.EXPECT().Stderr(gomock.Any()).AnyTimes()
cfg := Config{}
a := AddRepo{
Repo: "machine=https://github.com/harold_finch/themachine",
CAFile: "./helm/reporepo.cert",
}
suite.NoError(a.Prepare(cfg))
suite.Equal([]string{"repo", "add", "--ca-file", "./helm/reporepo.cert",
"machine", "https://github.com/harold_finch/themachine"}, suite.commandArgs)
}
func (suite *AddRepoTestSuite) TestNamespaceFlag() {
suite.mockCmd.EXPECT().Stdout(gomock.Any()).AnyTimes()
suite.mockCmd.EXPECT().Stderr(gomock.Any()).AnyTimes()