Skip to content

Commit

Permalink
merger param
Browse files Browse the repository at this point in the history
Signed-off-by: Guijie Wang <[email protected]>
  • Loading branch information
Guijie Wang committed Aug 7, 2023
1 parent d3d9eee commit aa4435f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 12 deletions.
13 changes: 3 additions & 10 deletions pkg/daemon/command/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@ type DaemonCommand struct {
LogRotationSize int `type:"param" name:"log-rotation-size"`
Supervisor string `type:"param" name:"supervisor"`
LogFile string `type:"param" name:"log-file"`
CredentialSource string `type:"param" name:"credential-source"`
SystemSock string `type:"param" name:"systemsock"`
BackendSource string `type:"param" name:"backend-source"`
}

// Build exec style command line
Expand Down Expand Up @@ -185,14 +184,8 @@ func WithUpgrade() Opt {
}
}

func WithCredentialSource(source string) Opt {
func WithBackendSource(source string) Opt {
return func(cmd *DaemonCommand) {
cmd.CredentialSource = source
}
}

func WithSystemSock(sock string) Opt {
return func(cmd *DaemonCommand) {
cmd.SystemSock = sock
cmd.BackendSource = source
}
}

Check failure on line 191 in pkg/daemon/command/command.go

View workflow job for this annotation

GitHub Actions / Build and Lint

syntax error: unexpected var after top level declaration
3 changes: 1 addition & 2 deletions pkg/manager/daemon_adaptor.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,7 @@ func (m *Manager) BuildDaemonCommand(d *daemon.Daemon, bin string, upgrade bool)
if config.IsCredentialSourceEnabled() {
configApiPath := fmt.Sprintf(endpointGetBackendConfig, d.States.ID)
cmdOpts = append(cmdOpts,
command.WithCredentialSource(configApiPath),
command.WithSystemSock(config.SystemControllerAddress()),
command.WithBackendSource(config.SystemControllerAddress() + configApiPath),
)
}
default:
Expand Down

0 comments on commit aa4435f

Please sign in to comment.