Skip to content

Fix passing empty string container name to unit params; #12890

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 19, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Remove containerNames from init command;
  • Loading branch information
ycliuhw committed Apr 19, 2021
commit 6bf73ac3b063be74a148edd619d5e3223ba6395e
4 changes: 0 additions & 4 deletions cmd/containeragent/initialize/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (
"context"
"io"
"path"
"strings"

"github.com/juju/cmd"
"github.com/juju/errors"
Expand Down Expand Up @@ -36,8 +35,6 @@ type initCommand struct {

dataDir string
binDir string

containerNames []string
}

// ApplicationAPI provides methods for unit introduction.
Expand Down Expand Up @@ -88,7 +85,6 @@ func (c *initCommand) Init(args []string) error {
if c.binDir == "" {
return errors.NotValidf("--bin-dir")
}
c.containerNames = strings.Split(c.environment.Getenv("JUJU_CONTAINER_NAMES"), ",")
return c.CommandBase.Init(args)
}

Expand Down
1 change: 0 additions & 1 deletion cmd/containeragent/initialize/command_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ apiport: 17070`[1:])
s.fileReaderWriter.EXPECT().Writer("/charm/bin/jujuc", os.FileMode(0755)).Return(NopWriteCloser(jujucWritten), nil)

gomock.InOrder(
s.environment.EXPECT().Getenv("JUJU_CONTAINER_NAMES").Return("gitlab,proxy"),
s.applicationAPI.EXPECT().UnitIntroduction(`gitlab-0`, `gitlab-uuid`).Times(1).Return(&caasapplication.UnitConfig{
UnitTag: names.NewUnitTag("gitlab/0"),
AgentConf: data,
Expand Down