Skip to content

Commit 95bdee6

Browse files
authored
fix(vpc): add k8s view on get private-network + goconst lint (#3456)
1 parent 25d3093 commit 95bdee6

File tree

3 files changed

+13
-5
lines changed

3 files changed

+13
-5
lines changed

internal/namespaces/instance/v1/custom_ssh_config.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ import (
1818
"github.com/scaleway/scaleway-sdk-go/scw"
1919
)
2020

21+
const configFileGeneratedMessage = "Config file was generated to"
22+
2123
type sshConfigServer struct {
2224
Name string
2325
Address string
@@ -116,15 +118,15 @@ Do you want the include statement to be added at the beginning of your file ?`,
116118
} else {
117119
logger.Warningf("Failed to check default config file, skipping include prompt\n")
118120
return &core.SuccessResult{
119-
Message: "Config file was generated to " + configFilePath,
121+
Message: configFileGeneratedMessage + " " + configFilePath,
120122
}, nil
121123
}
122124
}
123125

124126
// Generated config is already included
125127
if included {
126128
return &core.SuccessResult{
127-
Message: "Config file was generated to " + configFilePath,
129+
Message: configFileGeneratedMessage + " " + configFilePath,
128130
}, nil
129131
}
130132

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

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

150152
return &core.SuccessResult{
151-
Message: "Config file was generated to " + configFilePath,
153+
Message: configFileGeneratedMessage + " " + configFilePath,
152154
}, nil
153155
},
154156
Groups: []string{"workflow"},

internal/namespaces/instance/v1/helpers_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ func createServer(metaKey string) core.BeforeFunc {
2727
// createServer creates a stopped ubuntu-bionic server and
2828
// register it in the context Meta at metaKey.
2929
func startServer(metaKey string) core.BeforeFunc {
30-
return core.ExecStoreBeforeCmd(metaKey, "scw instance server start -w {{ ."+metaKey+".ID }}")
30+
return core.ExecStoreBeforeCmd(metaKey, "scw instance server start -w {{ ."+metaKey+
31+
".ID }}") //nolint: goconst
3132
}
3233

3334
// deleteServer deletes a server and its attached IP and volumes

internal/namespaces/vpc/v2/custom_private_network.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,11 @@ func privateNetworkGetBuilder(c *core.Command) *core.Command {
100100
Title: "Baremetal Servers",
101101
HideIfEmpty: true,
102102
},
103+
{
104+
FieldName: "K8sClusters",
105+
Title: "K8s Clusters",
106+
HideIfEmpty: true,
107+
},
103108
{
104109
FieldName: "LBs",
105110
Title: "Load-Balancers",

0 commit comments

Comments
 (0)