Skip to content

Commit

Permalink
Address feedback and improve crane messaging
Browse files Browse the repository at this point in the history
  • Loading branch information
Racer159 committed Oct 4, 2023
1 parent 349d0f2 commit 4727098
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/cmd/tools/crane.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ func zarfCraneCatalog(cranePlatformOptions *[]crane.Option) *cobra.Command {
}

if tunnel != nil {
message.Notef(lang.CmdToolsRegistryTunnel, registryEndpoint, zarfState.RegistryInfo.Address)
defer tunnel.Close()
}

Expand Down Expand Up @@ -186,6 +187,8 @@ func zarfCraneInternalWrapper(commandToWrap func(*[]crane.Option) *cobra.Command
}

if tunnel != nil {
message.Notef(lang.CmdToolsRegistryTunnel, tunnel.Endpoint(), zarfState.RegistryInfo.Address)

defer tunnel.Close()

givenAddress := fmt.Sprintf("%s/", zarfState.RegistryInfo.Address)
Expand Down Expand Up @@ -229,6 +232,7 @@ func pruneImages(_ *cobra.Command, _ []string) error {
}

if tunnel != nil {
message.Notef(lang.CmdToolsRegistryTunnel, registryEndpoint, zarfState.RegistryInfo.Address)
defer tunnel.Close()
}

Expand Down
1 change: 1 addition & 0 deletions src/config/lang/english.go
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,7 @@ const (

CmdToolsRegistryShort = "Tools for working with container registries using go-containertools"
CmdToolsRegistryZarfState = "Retrieving registry information from Zarf state"
CmdToolsRegistryTunnel = "Opening a tunnel from %s locally to %s in the cluster"

CmdToolsRegistryCatalogExample = `
# list the repos internal to Zarf
Expand Down
4 changes: 3 additions & 1 deletion src/pkg/utils/io.go
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,9 @@ func GetFinalExecutableCommand() (string, error) {
return zarfCommand, err
}

zarfCommand = fmt.Sprintf("%s %s", zarfCommand, config.ActionsCommandZarfPrefix)
if config.ActionsCommandZarfPrefix != "" {
zarfCommand = fmt.Sprintf("%s %s", zarfCommand, config.ActionsCommandZarfPrefix)
}

// If a library user has chosen to override config to use system Zarf instead, reset the binary path.
if config.ActionsUseSystemZarf {
Expand Down

0 comments on commit 4727098

Please sign in to comment.