Skip to content

Commit

Permalink
fix(vpc): add k8s view on get private-network + goconst lint (#3456)
Browse files Browse the repository at this point in the history
  • Loading branch information
yfodil authored Oct 30, 2023
1 parent 25d3093 commit 95bdee6
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
10 changes: 6 additions & 4 deletions internal/namespaces/instance/v1/custom_ssh_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ import (
"github.com/scaleway/scaleway-sdk-go/scw"
)

const configFileGeneratedMessage = "Config file was generated to"

type sshConfigServer struct {
Name string
Address string
Expand Down Expand Up @@ -116,15 +118,15 @@ Do you want the include statement to be added at the beginning of your file ?`,
} else {
logger.Warningf("Failed to check default config file, skipping include prompt\n")
return &core.SuccessResult{
Message: "Config file was generated to " + configFilePath,
Message: configFileGeneratedMessage + " " + configFilePath,
}, nil
}
}

// Generated config is already included
if included {
return &core.SuccessResult{
Message: "Config file was generated to " + configFilePath,
Message: configFileGeneratedMessage + " " + configFilePath,
}, nil
}

Expand All @@ -136,7 +138,7 @@ Do you want the include statement to be added at the beginning of your file ?`,
if err != nil {
logger.Warningf("Failed to prompt, skipping include\n")
return &core.SuccessResult{
Message: "Config file was generated to " + configFilePath,
Message: configFileGeneratedMessage + " " + configFilePath,
}, nil
}

Expand All @@ -148,7 +150,7 @@ Do you want the include statement to be added at the beginning of your file ?`,
}

return &core.SuccessResult{
Message: "Config file was generated to " + configFilePath,
Message: configFileGeneratedMessage + " " + configFilePath,
}, nil
},
Groups: []string{"workflow"},
Expand Down
3 changes: 2 additions & 1 deletion internal/namespaces/instance/v1/helpers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ func createServer(metaKey string) core.BeforeFunc {
// createServer creates a stopped ubuntu-bionic server and
// register it in the context Meta at metaKey.
func startServer(metaKey string) core.BeforeFunc {
return core.ExecStoreBeforeCmd(metaKey, "scw instance server start -w {{ ."+metaKey+".ID }}")
return core.ExecStoreBeforeCmd(metaKey, "scw instance server start -w {{ ."+metaKey+
".ID }}") //nolint: goconst
}

// deleteServer deletes a server and its attached IP and volumes
Expand Down
5 changes: 5 additions & 0 deletions internal/namespaces/vpc/v2/custom_private_network.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,11 @@ func privateNetworkGetBuilder(c *core.Command) *core.Command {
Title: "Baremetal Servers",
HideIfEmpty: true,
},
{
FieldName: "K8sClusters",
Title: "K8s Clusters",
HideIfEmpty: true,
},
{
FieldName: "LBs",
Title: "Load-Balancers",
Expand Down

0 comments on commit 95bdee6

Please sign in to comment.