Skip to content

Commit e7c33e6

Browse files
author
Alexandre Catalan
committed
refactor(config): rename registry custom endpoint to containerregistry
Align the custom endpoint config with the new command name. - Config key: registry_custom_endpoint -> containerregistry_custom_endpoint - Flag in `config set` / `config unset`: --registry-custom-endpoint -> --containerregistry-custom-endpoint - Update profile import template and regenerate docs
1 parent 23728a2 commit e7c33e6

8 files changed

Lines changed: 84 additions & 84 deletions

File tree

‎docs/stackit_config_set.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ stackit config set [flags]
3434
--authorization-custom-endpoint string Authorization API base URL, used in calls to this API
3535
--automation-custom-endpoint string Automation API base URL, used in calls to this API
3636
--cdn-custom-endpoint string CDN API base URL, used in calls to this API
37+
--containerregistry-custom-endpoint string Container Registry API base URL, used in calls to this API
3738
--dns-custom-endpoint string DNS API base URL, used in calls to this API
3839
--edge-custom-endpoint string Edge API base URL, used in calls to this API
3940
-h, --help Help for "stackit config set"
@@ -54,7 +55,6 @@ stackit config set [flags]
5455
--postgresflex-custom-endpoint string PostgreSQL Flex API base URL, used in calls to this API
5556
--rabbitmq-custom-endpoint string RabbitMQ API base URL, used in calls to this API
5657
--redis-custom-endpoint string Redis API base URL, used in calls to this API
57-
--registry-custom-endpoint string Registry API base URL, used in calls to this API
5858
--resource-manager-custom-endpoint string Resource Manager API base URL, used in calls to this API
5959
--runcommand-custom-endpoint string Run Command API base URL, used in calls to this API
6060
--scf-custom-endpoint string STACKIT Cloud Foundry API base URL, used in calls to this API

‎docs/stackit_config_unset.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ stackit config unset [flags]
3333
--authorization-custom-endpoint Authorization API base URL. If unset, uses the default base URL
3434
--automation-custom-endpoint Automation API base URL. If unset, uses the default base URL
3535
--cdn-custom-endpoint Custom CDN endpoint URL. If unset, uses the default base URL
36+
--containerregistry-custom-endpoint Container Registry API base URL. If unset, uses the default base URL
3637
--dns-custom-endpoint DNS API base URL. If unset, uses the default base URL
3738
--edge-custom-endpoint Edge API base URL. If unset, uses the default base URL
3839
-h, --help Help for "stackit config unset"
@@ -56,7 +57,6 @@ stackit config unset [flags]
5657
--rabbitmq-custom-endpoint RabbitMQ API base URL. If unset, uses the default base URL
5758
--redis-custom-endpoint Redis API base URL. If unset, uses the default base URL
5859
--region Region
59-
--registry-custom-endpoint Registry API base URL. If unset, uses the default base URL
6060
--resource-manager-custom-endpoint Resource Manager API base URL. If unset, uses the default base URL
6161
--runcommand-custom-endpoint Server Command base URL. If unset, uses the default base URL
6262
--scf-custom-endpoint STACKIT Cloud Foundry API base URL. If unset, uses the default base URL

‎internal/cmd/config/profile/import/template/profile.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"project_name": "",
2121
"rabbitmq_custom_endpoint": "",
2222
"redis_custom_endpoint": "",
23-
"registry_custom_endpoint": "",
23+
"containerregistry_custom_endpoint": "",
2424
"resource_manager_custom_endpoint": "",
2525
"runcommand_custom_endpoint": "",
2626
"secrets_manager_custom_endpoint": "",

‎internal/cmd/config/set/set.go‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ const (
5858
scfCustomEndpointFlag = "scf-custom-endpoint"
5959
cdnCustomEndpointFlag = "cdn-custom-endpoint"
6060
vpnCustomEndpointFlag = "vpn-custom-endpoint"
61-
registryCustomEndpointFlag = "registry-custom-endpoint"
61+
containerRegistryCustomEndpointFlag = "containerregistry-custom-endpoint"
6262
)
6363

6464
type inputModel struct {
@@ -183,7 +183,7 @@ func configureFlags(cmd *cobra.Command) {
183183
cmd.Flags().String(scfCustomEndpointFlag, "", "STACKIT Cloud Foundry API base URL, used in calls to this API")
184184
cmd.Flags().String(cdnCustomEndpointFlag, "", "CDN API base URL, used in calls to this API")
185185
cmd.Flags().String(vpnCustomEndpointFlag, "", "VPN API base URL, used in calls to this API")
186-
cmd.Flags().String(registryCustomEndpointFlag, "", "Registry API base URL, used in calls to this API")
186+
cmd.Flags().String(containerRegistryCustomEndpointFlag, "", "Container Registry API base URL, used in calls to this API")
187187

188188
err := viper.BindPFlag(config.SessionTimeLimitKey, cmd.Flags().Lookup(sessionTimeLimitFlag))
189189
cobra.CheckErr(err)
@@ -262,7 +262,7 @@ func configureFlags(cmd *cobra.Command) {
262262
cobra.CheckErr(err)
263263
err = viper.BindPFlag(config.VPNCustomEndpointKey, cmd.Flags().Lookup(vpnCustomEndpointFlag))
264264
cobra.CheckErr(err)
265-
err = viper.BindPFlag(config.RegistryCustomEndpointKey, cmd.Flags().Lookup(registryCustomEndpointFlag))
265+
err = viper.BindPFlag(config.ContainerRegistryCustomEndpointKey, cmd.Flags().Lookup(containerRegistryCustomEndpointFlag))
266266
cobra.CheckErr(err)
267267
}
268268

‎internal/cmd/config/unset/unset.go‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ const (
6161
logsCustomEndpointFlag = "logs-custom-endpoint"
6262
cdnCustomEndpointFlag = "cdn-custom-endpoint"
6363
vpnCustomEndpointFlag = "vpn-custom-endpoint"
64-
registryCustomEndpointFlag = "registry-custom-endpoint"
64+
containerRegistryCustomEndpointFlag = "containerregistry-custom-endpoint"
6565
)
6666

6767
var (
@@ -116,7 +116,7 @@ type inputModel struct {
116116
LogsCustomEndpoint bool
117117
CDNCustomEndpoint bool
118118
VpnCustomEndpoint bool
119-
RegistryCustomEndpoint bool
119+
ContainerRegistryCustomEndpoint bool
120120
}
121121

122122
func NewCmd(params *types.CmdParams) *cobra.Command {
@@ -273,8 +273,8 @@ func NewCmd(params *types.CmdParams) *cobra.Command {
273273
if model.VpnCustomEndpoint {
274274
viper.Set(config.VPNCustomEndpointKey, "")
275275
}
276-
if model.RegistryCustomEndpoint {
277-
viper.Set(config.RegistryCustomEndpointKey, "")
276+
if model.ContainerRegistryCustomEndpoint {
277+
viper.Set(config.ContainerRegistryCustomEndpointKey, "")
278278
}
279279

280280
err := config.Write()
@@ -335,7 +335,7 @@ func configureFlags(cmd *cobra.Command) {
335335
cmd.Flags().Bool(sfsCustomEndpointFlag, false, "SFS API base URL. If unset, uses the default base URL")
336336
cmd.Flags().Bool(cdnCustomEndpointFlag, false, "Custom CDN endpoint URL. If unset, uses the default base URL")
337337
cmd.Flags().Bool(vpnCustomEndpointFlag, false, "VPN API base URL. If unset, uses the default base URL")
338-
cmd.Flags().Bool(registryCustomEndpointFlag, false, "Registry API base URL. If unset, uses the default base URL")
338+
cmd.Flags().Bool(containerRegistryCustomEndpointFlag, false, "Container Registry API base URL. If unset, uses the default base URL")
339339
}
340340

341341
func parseInput(p *print.Printer, cmd *cobra.Command) *inputModel {
@@ -386,7 +386,7 @@ func parseInput(p *print.Printer, cmd *cobra.Command) *inputModel {
386386
LogsCustomEndpoint: flags.FlagToBoolValue(p, cmd, logsCustomEndpointFlag),
387387
CDNCustomEndpoint: flags.FlagToBoolValue(p, cmd, cdnCustomEndpointFlag),
388388
VpnCustomEndpoint: flags.FlagToBoolValue(p, cmd, vpnCustomEndpointFlag),
389-
RegistryCustomEndpoint: flags.FlagToBoolValue(p, cmd, registryCustomEndpointFlag),
389+
ContainerRegistryCustomEndpoint: flags.FlagToBoolValue(p, cmd, containerRegistryCustomEndpointFlag),
390390
}
391391

392392
p.DebugInputModel(model)

‎internal/cmd/config/unset/unset_test.go‎

Lines changed: 68 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -22,38 +22,38 @@ func fixtureFlagValues(mods ...func(flagValues map[string]bool)) map[string]bool
2222
identityProviderCustomClientIdFlag: true,
2323
allowedUrlDomainFlag: true,
2424

25-
authorizationCustomEndpointFlag: true,
26-
automationCustomEndpointFlag: true,
27-
albWafCustomEndpointFlag: true,
28-
dnsCustomEndpointFlag: true,
29-
edgeCustomEndpointFlag: true,
30-
loadBalancerCustomEndpointFlag: true,
31-
logMeCustomEndpointFlag: true,
32-
mariaDBCustomEndpointFlag: true,
33-
objectStorageCustomEndpointFlag: true,
34-
observabilityCustomEndpointFlag: true,
35-
openSearchCustomEndpointFlag: true,
36-
rabbitMQCustomEndpointFlag: true,
37-
redisCustomEndpointFlag: true,
38-
resourceManagerCustomEndpointFlag: true,
39-
secretsManagerCustomEndpointFlag: true,
40-
kmsCustomEndpointFlag: true,
41-
serviceAccountCustomEndpointFlag: true,
42-
serverBackupCustomEndpointFlag: true,
43-
serverOsUpdateCustomEndpointFlag: true,
44-
runCommandCustomEndpointFlag: true,
45-
scfCustomEndpointFlag: true,
46-
sfsCustomEndpointFlag: true,
47-
skeCustomEndpointFlag: true,
48-
sqlServerFlexCustomEndpointFlag: true,
49-
iaasAlphaCustomEndpointFlag: true,
50-
iaasCustomEndpointFlag: true,
51-
tokenCustomEndpointFlag: true,
52-
intakeCustomEndpointFlag: true,
53-
logsCustomEndpointFlag: true,
54-
cdnCustomEndpointFlag: true,
55-
vpnCustomEndpointFlag: true,
56-
registryCustomEndpointFlag: true,
25+
authorizationCustomEndpointFlag: true,
26+
automationCustomEndpointFlag: true,
27+
albWafCustomEndpointFlag: true,
28+
dnsCustomEndpointFlag: true,
29+
edgeCustomEndpointFlag: true,
30+
loadBalancerCustomEndpointFlag: true,
31+
logMeCustomEndpointFlag: true,
32+
mariaDBCustomEndpointFlag: true,
33+
objectStorageCustomEndpointFlag: true,
34+
observabilityCustomEndpointFlag: true,
35+
openSearchCustomEndpointFlag: true,
36+
rabbitMQCustomEndpointFlag: true,
37+
redisCustomEndpointFlag: true,
38+
resourceManagerCustomEndpointFlag: true,
39+
secretsManagerCustomEndpointFlag: true,
40+
kmsCustomEndpointFlag: true,
41+
serviceAccountCustomEndpointFlag: true,
42+
serverBackupCustomEndpointFlag: true,
43+
serverOsUpdateCustomEndpointFlag: true,
44+
runCommandCustomEndpointFlag: true,
45+
scfCustomEndpointFlag: true,
46+
sfsCustomEndpointFlag: true,
47+
skeCustomEndpointFlag: true,
48+
sqlServerFlexCustomEndpointFlag: true,
49+
iaasAlphaCustomEndpointFlag: true,
50+
iaasCustomEndpointFlag: true,
51+
tokenCustomEndpointFlag: true,
52+
intakeCustomEndpointFlag: true,
53+
logsCustomEndpointFlag: true,
54+
cdnCustomEndpointFlag: true,
55+
vpnCustomEndpointFlag: true,
56+
containerRegistryCustomEndpointFlag: true,
5757
}
5858
for _, mod := range mods {
5959
mod(flagValues)
@@ -74,38 +74,38 @@ func fixtureInputModel(mods ...func(model *inputModel)) *inputModel {
7474
IdentityProviderCustomClientID: true,
7575
AllowedUrlDomain: true,
7676

77-
AuthorizationCustomEndpoint: true,
78-
AutomationCustomEndpoint: true,
79-
AlbWafCustomEndpoint: true,
80-
DNSCustomEndpoint: true,
81-
EdgeCustomEndpoint: true,
82-
LoadBalancerCustomEndpoint: true,
83-
LogMeCustomEndpoint: true,
84-
MariaDBCustomEndpoint: true,
85-
ObjectStorageCustomEndpoint: true,
86-
ObservabilityCustomEndpoint: true,
87-
OpenSearchCustomEndpoint: true,
88-
RabbitMQCustomEndpoint: true,
89-
RedisCustomEndpoint: true,
90-
ResourceManagerCustomEndpoint: true,
91-
SecretsManagerCustomEndpoint: true,
92-
KMSCustomEndpoint: true,
93-
ServiceAccountCustomEndpoint: true,
94-
ServerBackupCustomEndpoint: true,
95-
ServerOsUpdateCustomEndpoint: true,
96-
RunCommandCustomEndpoint: true,
97-
ScfCustomEndpoint: true,
98-
SfsCustomEndpoint: true,
99-
SKECustomEndpoint: true,
100-
SQLServerFlexCustomEndpoint: true,
101-
IaaSAlphaCustomEndpoint: true,
102-
IaaSCustomEndpoint: true,
103-
TokenCustomEndpoint: true,
104-
IntakeCustomEndpoint: true,
105-
LogsCustomEndpoint: true,
106-
CDNCustomEndpoint: true,
107-
VpnCustomEndpoint: true,
108-
RegistryCustomEndpoint: true,
77+
AuthorizationCustomEndpoint: true,
78+
AutomationCustomEndpoint: true,
79+
AlbWafCustomEndpoint: true,
80+
DNSCustomEndpoint: true,
81+
EdgeCustomEndpoint: true,
82+
LoadBalancerCustomEndpoint: true,
83+
LogMeCustomEndpoint: true,
84+
MariaDBCustomEndpoint: true,
85+
ObjectStorageCustomEndpoint: true,
86+
ObservabilityCustomEndpoint: true,
87+
OpenSearchCustomEndpoint: true,
88+
RabbitMQCustomEndpoint: true,
89+
RedisCustomEndpoint: true,
90+
ResourceManagerCustomEndpoint: true,
91+
SecretsManagerCustomEndpoint: true,
92+
KMSCustomEndpoint: true,
93+
ServiceAccountCustomEndpoint: true,
94+
ServerBackupCustomEndpoint: true,
95+
ServerOsUpdateCustomEndpoint: true,
96+
RunCommandCustomEndpoint: true,
97+
ScfCustomEndpoint: true,
98+
SfsCustomEndpoint: true,
99+
SKECustomEndpoint: true,
100+
SQLServerFlexCustomEndpoint: true,
101+
IaaSAlphaCustomEndpoint: true,
102+
IaaSCustomEndpoint: true,
103+
TokenCustomEndpoint: true,
104+
IntakeCustomEndpoint: true,
105+
LogsCustomEndpoint: true,
106+
CDNCustomEndpoint: true,
107+
VpnCustomEndpoint: true,
108+
ContainerRegistryCustomEndpoint: true,
109109
}
110110
for _, mod := range mods {
111111
mod(model)
@@ -173,7 +173,7 @@ func TestParseInput(t *testing.T) {
173173
model.LogsCustomEndpoint = false
174174
model.CDNCustomEndpoint = false
175175
model.VpnCustomEndpoint = false
176-
model.RegistryCustomEndpoint = false
176+
model.ContainerRegistryCustomEndpoint = false
177177
}),
178178
},
179179
{
@@ -297,13 +297,13 @@ func TestParseInput(t *testing.T) {
297297
}),
298298
},
299299
{
300-
description: "registry custom endpoint empty",
300+
description: "container registry custom endpoint empty",
301301
flagValues: fixtureFlagValues(func(flagValues map[string]bool) {
302-
flagValues[registryCustomEndpointFlag] = false
302+
flagValues[containerRegistryCustomEndpointFlag] = false
303303
}),
304304
isValid: true,
305305
expectedModel: fixtureInputModel(func(model *inputModel) {
306-
model.RegistryCustomEndpoint = false
306+
model.ContainerRegistryCustomEndpoint = false
307307
}),
308308
},
309309
{

‎internal/pkg/config/config.go‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ const (
6060
IntakeCustomEndpointKey = "intake_custom_endpoint"
6161
LogsCustomEndpointKey = "logs_custom_endpoint"
6262
ValkeyCustomEndpointKey = "valkey_custom_endpoint"
63-
RegistryCustomEndpointKey = "registry_custom_endpoint"
63+
ContainerRegistryCustomEndpointKey = "containerregistry_custom_endpoint"
6464
VPNCustomEndpointKey = "vpn_custom_endpoint"
6565

6666
ProjectNameKey = "project_name"
@@ -134,7 +134,7 @@ var ConfigKeys = []string{
134134
SfsCustomEndpointKey,
135135
TokenCustomEndpointKey,
136136
ValkeyCustomEndpointKey,
137-
RegistryCustomEndpointKey,
137+
ContainerRegistryCustomEndpointKey,
138138
VPNCustomEndpointKey,
139139
}
140140

@@ -232,7 +232,7 @@ func setConfigDefaults() {
232232
viper.SetDefault(LogsCustomEndpointKey, "")
233233
viper.SetDefault(CDNCustomEndpointKey, "")
234234
viper.SetDefault(ValkeyCustomEndpointKey, "")
235-
viper.SetDefault(RegistryCustomEndpointKey, "")
235+
viper.SetDefault(ContainerRegistryCustomEndpointKey, "")
236236
viper.SetDefault(VPNCustomEndpointKey, "")
237237
}
238238

‎internal/pkg/services/containerregistry/client/client.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@ import (
1010
)
1111

1212
func ConfigureClient(p *print.Printer, cliVersion string) (*registry.APIClient, error) {
13-
return genericclient.ConfigureClientGeneric(p, cliVersion, viper.GetString(config.RegistryCustomEndpointKey), false, genericclient.CreateApiClient[*registry.APIClient](registry.NewAPIClient))
13+
return genericclient.ConfigureClientGeneric(p, cliVersion, viper.GetString(config.ContainerRegistryCustomEndpointKey), false, genericclient.CreateApiClient[*registry.APIClient](registry.NewAPIClient))
1414
}

0 commit comments

Comments
 (0)