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

@@ -24,6 +24,7 @@ type Config struct {
DroneEvent string `envconfig:"DRONE_BUILD_EVENT"` // Drone event that invoked this plugin.
UpdateDependencies bool `split_words:"true"` // Call `helm dependency update` before the main command
AddRepos []string `split_words:"true"` // Call `helm repo add` before the main command
RepoCAFile string `envconfig:"repo_ca_file"` // CA certificate for `helm repo add`
Debug bool `` // Generate debug output and pass --debug to all helm commands
Values string `` // Argument to pass to --set in applicable helm commands
StringValues string `split_words:"true"` // Argument to pass to --set-string in applicable helm commands

View File

@@ -171,7 +171,8 @@ func addRepos(cfg Config) []Step {
steps := make([]Step, 0)
for _, repo := range cfg.AddRepos {
steps = append(steps, &run.AddRepo{
Repo: repo,
Repo: repo,
CAFile: cfg.RepoCAFile,
})
}

View File

@@ -291,6 +291,7 @@ func (suite *PlanTestSuite) TestAddRepos() {
"first=https://add.repos/one",
"second=https://add.repos/two",
},
RepoCAFile: "state_licensure.repo.cert",
}
steps := addRepos(cfg)
suite.Require().Equal(2, len(steps), "addRepos should add one step per repo")
@@ -301,6 +302,8 @@ func (suite *PlanTestSuite) TestAddRepos() {
suite.Equal(first.Repo, "first=https://add.repos/one")
suite.Equal(second.Repo, "second=https://add.repos/two")
suite.Equal(first.CAFile, "state_licensure.repo.cert")
suite.Equal(second.CAFile, "state_licensure.repo.cert")
}
func (suite *PlanTestSuite) TestLint() {