mygithub.libinneed.workers.dev/stackitcloud/stackit-cli
Advanced tools
@@ -16,5 +16,5 @@ name: Renovate | ||
| - name: Self-hosted Renovate | ||
| uses: renovatebot/github-action@v42.0.2 | ||
| uses: renovatebot/github-action@v42.0.4 | ||
| with: | ||
| configurationFile: .github/renovate.json | ||
| token: ${{ secrets.RENOVATE_TOKEN }} |
@@ -28,3 +28,3 @@ ## stackit dns record-set create | ||
| --ttl int Time to live, if not provided defaults to the zone's default TTL | ||
| --type string Record type, one of ["A" "AAAA" "SOA" "CNAME" "NS" "MX" "TXT" "SRV" "PTR" "ALIAS" "DNAME" "CAA"] (default "A") | ||
| --type string Record type, one of ["A" "AAAA" "SOA" "CNAME" "NS" "MX" "TXT" "SRV" "PTR" "ALIAS" "DNAME" "CAA" "DNSKEY" "DS" "LOC" "NAPTR" "SSHFP" "TLSA" "URI" "CERT" "SVCB"] (default "A") | ||
| --zone-id string Zone ID | ||
@@ -31,0 +31,0 @@ ``` |
@@ -39,3 +39,3 @@ ## stackit dns zone create | ||
| --retry-time int Retry time | ||
| --type string Zone type | ||
| --type string Zone type, one of: ["primary" "secondary"] | ||
| ``` | ||
@@ -42,0 +42,0 @@ |
+27
-27
@@ -7,3 +7,3 @@ module github.com/stackitcloud/stackit-cli | ||
| github.com/fatih/color v1.18.0 | ||
| github.com/goccy/go-yaml v1.17.1 | ||
| github.com/goccy/go-yaml v1.18.0 | ||
| github.com/golang-jwt/jwt/v5 v5.2.2 | ||
@@ -14,3 +14,3 @@ github.com/google/go-cmp v0.7.0 | ||
| github.com/jedib0t/go-pretty/v6 v6.6.7 | ||
| github.com/lmittmann/tint v1.0.7 | ||
| github.com/lmittmann/tint v1.1.1 | ||
| github.com/mattn/go-colorable v0.1.14 | ||
@@ -20,20 +20,20 @@ github.com/spf13/cobra v1.9.1 | ||
| github.com/spf13/viper v1.20.1 | ||
| github.com/stackitcloud/stackit-sdk-go/core v0.17.1 | ||
| github.com/stackitcloud/stackit-sdk-go/services/alb v0.2.3 | ||
| github.com/stackitcloud/stackit-sdk-go/services/authorization v0.6.3 | ||
| github.com/stackitcloud/stackit-sdk-go/services/dns v0.13.3 | ||
| github.com/stackitcloud/stackit-sdk-go/services/git v0.3.3 | ||
| github.com/stackitcloud/stackit-sdk-go/services/iaas v0.22.2 | ||
| github.com/stackitcloud/stackit-sdk-go/services/mongodbflex v1.0.1 | ||
| github.com/stackitcloud/stackit-sdk-go/services/opensearch v0.21.2 | ||
| github.com/stackitcloud/stackit-sdk-go/services/postgresflex v1.0.4 | ||
| github.com/stackitcloud/stackit-sdk-go/services/resourcemanager v0.13.3 | ||
| github.com/stackitcloud/stackit-sdk-go/services/runcommand v1.0.2 | ||
| github.com/stackitcloud/stackit-sdk-go/services/secretsmanager v0.11.4 | ||
| github.com/stackitcloud/stackit-sdk-go/services/serverbackup v1.0.3 | ||
| github.com/stackitcloud/stackit-sdk-go/services/serverupdate v1.0.3 | ||
| github.com/stackitcloud/stackit-sdk-go/services/serviceaccount v0.6.3 | ||
| github.com/stackitcloud/stackit-sdk-go/services/serviceenablement v1.0.3 | ||
| github.com/stackitcloud/stackit-sdk-go/services/ske v0.22.3 | ||
| github.com/stackitcloud/stackit-sdk-go/services/sqlserverflex v1.0.3 | ||
| github.com/stackitcloud/stackit-sdk-go/core v0.17.2 | ||
| github.com/stackitcloud/stackit-sdk-go/services/alb v0.4.0 | ||
| github.com/stackitcloud/stackit-sdk-go/services/authorization v0.7.0 | ||
| github.com/stackitcloud/stackit-sdk-go/services/dns v0.15.0 | ||
| github.com/stackitcloud/stackit-sdk-go/services/git v0.5.0 | ||
| github.com/stackitcloud/stackit-sdk-go/services/iaas v0.23.0 | ||
| github.com/stackitcloud/stackit-sdk-go/services/mongodbflex v1.2.0 | ||
| github.com/stackitcloud/stackit-sdk-go/services/opensearch v0.23.0 | ||
| github.com/stackitcloud/stackit-sdk-go/services/postgresflex v1.1.0 | ||
| github.com/stackitcloud/stackit-sdk-go/services/resourcemanager v0.15.0 | ||
| github.com/stackitcloud/stackit-sdk-go/services/runcommand v1.2.0 | ||
| github.com/stackitcloud/stackit-sdk-go/services/secretsmanager v0.12.0 | ||
| github.com/stackitcloud/stackit-sdk-go/services/serverbackup v1.2.0 | ||
| github.com/stackitcloud/stackit-sdk-go/services/serverupdate v1.1.0 | ||
| github.com/stackitcloud/stackit-sdk-go/services/serviceaccount v0.8.0 | ||
| github.com/stackitcloud/stackit-sdk-go/services/serviceenablement v1.2.0 | ||
| github.com/stackitcloud/stackit-sdk-go/services/ske v0.24.0 | ||
| github.com/stackitcloud/stackit-sdk-go/services/sqlserverflex v1.2.0 | ||
| github.com/zalando/go-keyring v0.2.6 | ||
@@ -242,9 +242,9 @@ golang.org/x/mod v0.24.0 | ||
| github.com/spf13/cast v1.7.1 // indirect | ||
| github.com/stackitcloud/stackit-sdk-go/services/loadbalancer v1.0.3 | ||
| github.com/stackitcloud/stackit-sdk-go/services/logme v0.22.2 | ||
| github.com/stackitcloud/stackit-sdk-go/services/mariadb v0.22.2 | ||
| github.com/stackitcloud/stackit-sdk-go/services/objectstorage v1.1.3 | ||
| github.com/stackitcloud/stackit-sdk-go/services/observability v0.5.2 | ||
| github.com/stackitcloud/stackit-sdk-go/services/rabbitmq v0.22.2 | ||
| github.com/stackitcloud/stackit-sdk-go/services/redis v0.22.2 | ||
| github.com/stackitcloud/stackit-sdk-go/services/loadbalancer v1.2.0 | ||
| github.com/stackitcloud/stackit-sdk-go/services/logme v0.24.0 | ||
| github.com/stackitcloud/stackit-sdk-go/services/mariadb v0.24.0 | ||
| github.com/stackitcloud/stackit-sdk-go/services/objectstorage v1.2.0 | ||
| github.com/stackitcloud/stackit-sdk-go/services/observability v0.7.0 | ||
| github.com/stackitcloud/stackit-sdk-go/services/rabbitmq v0.24.0 | ||
| github.com/stackitcloud/stackit-sdk-go/services/redis v0.24.0 | ||
| github.com/subosito/gotenv v1.6.0 // indirect | ||
@@ -251,0 +251,0 @@ go.uber.org/multierr v1.11.0 // indirect |
@@ -8,2 +8,3 @@ package list | ||
| "github.com/google/go-cmp/cmp/cmpopts" | ||
| "github.com/stackitcloud/stackit-cli/internal/cmd/params" | ||
@@ -14,3 +15,2 @@ "github.com/stackitcloud/stackit-cli/internal/pkg/globalflags" | ||
| "github.com/google/go-cmp/cmp" | ||
| "github.com/google/go-cmp/cmp/cmpopts" | ||
| "github.com/google/uuid" | ||
@@ -54,3 +54,3 @@ "github.com/stackitcloud/stackit-sdk-go/services/alb" | ||
| func fixtureRequest(mods ...func(request *alb.ApiListLoadBalancersRequest)) alb.ApiListLoadBalancersRequest { | ||
| request := testClient.ListLoadBalancers(context.Background(), testProjectId, testRegion) | ||
| request := testClient.ListLoadBalancers(testCtx, testProjectId, testRegion) | ||
| for _, mod := range mods { | ||
@@ -166,3 +166,2 @@ mod(&request) | ||
| cmpopts.EquateComparable(testCtx), | ||
| cmpopts.IgnoreFields(alb.ApiListLoadBalancersRequest{}, "ctx"), | ||
| ) | ||
@@ -169,0 +168,0 @@ if diff != "" { |
@@ -159,3 +159,2 @@ package plans | ||
| cmpopts.EquateComparable(testCtx), | ||
| cmpopts.IgnoreFields(alb.ApiListLoadBalancersRequest{}, "ctx"), | ||
| ) | ||
@@ -162,0 +161,0 @@ if diff != "" { |
@@ -159,3 +159,2 @@ package quotas | ||
| cmpopts.EquateComparable(testCtx), | ||
| cmpopts.IgnoreFields(alb.ApiListLoadBalancersRequest{}, "ctx"), | ||
| ) | ||
@@ -162,0 +161,0 @@ if diff != "" { |
@@ -78,3 +78,3 @@ package create | ||
| Ttl: utils.Ptr(int64(3600)), | ||
| Type: utils.Ptr("SOA"), | ||
| Type: dns.CREATERECORDSETPAYLOADTYPE_SOA.Ptr(), | ||
| }) | ||
@@ -251,3 +251,3 @@ for _, mod := range mods { | ||
| flagValues: fixtureFlagValues(func(flagValues map[string]string) { | ||
| flagValues[typeFlag] = txtType | ||
| flagValues[typeFlag] = string(txtType) | ||
| flagValues[recordFlag] = strings.Join(recordTxtOver255Char, "") | ||
@@ -254,0 +254,0 @@ }), |
@@ -33,4 +33,4 @@ package create | ||
| defaultType = "A" | ||
| txtType = "TXT" | ||
| defaultType = dns.CREATERECORDSETPAYLOADTYPE_A | ||
| txtType = dns.CREATERECORDSETPAYLOADTYPE_TXT | ||
| ) | ||
@@ -45,3 +45,3 @@ | ||
| TTL *int64 | ||
| Type string | ||
| Type dns.CreateRecordSetPayloadTypes | ||
| } | ||
@@ -114,3 +114,6 @@ | ||
| func configureFlags(cmd *cobra.Command) { | ||
| typeFlagOptions := []string{"A", "AAAA", "SOA", "CNAME", "NS", "MX", "TXT", "SRV", "PTR", "ALIAS", "DNAME", "CAA"} | ||
| var typeFlagOptions []string | ||
| for _, val := range dns.AllowedCreateRecordSetPayloadTypesEnumValues { | ||
| typeFlagOptions = append(typeFlagOptions, string(val)) | ||
| } | ||
@@ -122,3 +125,3 @@ cmd.Flags().Var(flags.UUIDFlag(), zoneIdFlag, "Zone ID") | ||
| cmd.Flags().StringSlice(recordFlag, []string{}, "Records belonging to the record set") | ||
| cmd.Flags().Var(flags.EnumFlag(false, defaultType, typeFlagOptions...), typeFlag, fmt.Sprintf("Record type, one of %q", typeFlagOptions)) | ||
| cmd.Flags().Var(flags.EnumFlag(false, string(defaultType), typeFlagOptions...), typeFlag, fmt.Sprintf("Record type, one of %q", typeFlagOptions)) | ||
@@ -135,2 +138,4 @@ err := flags.MarkFlagsRequired(cmd, zoneIdFlag, nameFlag, recordFlag) | ||
| recordType := flags.FlagWithDefaultToStringValue(p, cmd, typeFlag) | ||
| model := inputModel{ | ||
@@ -143,3 +148,3 @@ GlobalFlagModel: globalFlags, | ||
| TTL: flags.FlagToInt64Pointer(p, cmd, ttlFlag), | ||
| Type: flags.FlagWithDefaultToStringValue(p, cmd, typeFlag), | ||
| Type: dns.CreateRecordSetPayloadTypes(recordType), | ||
| } | ||
@@ -146,0 +151,0 @@ |
@@ -32,3 +32,3 @@ package create | ||
| aclFlag: "0.0.0.0/0", | ||
| typeFlag: "master", | ||
| typeFlag: string(dns.CREATEZONEPAYLOADTYPE_PRIMARY), | ||
| primaryFlag: "1.1.1.1", | ||
@@ -60,3 +60,3 @@ retryTimeFlag: "600", | ||
| Acl: utils.Ptr("0.0.0.0/0"), | ||
| Type: utils.Ptr("master"), | ||
| Type: dns.CREATEZONEPAYLOADTYPE_PRIMARY.Ptr(), | ||
| RetryTime: utils.Ptr(int64(600)), | ||
@@ -84,3 +84,3 @@ RefreshTime: utils.Ptr(int64(3600)), | ||
| Acl: utils.Ptr("0.0.0.0/0"), | ||
| Type: utils.Ptr("master"), | ||
| Type: dns.CREATEZONEPAYLOADTYPE_PRIMARY.Ptr(), | ||
| RetryTime: utils.Ptr(int64(600)), | ||
@@ -145,3 +145,2 @@ RefreshTime: utils.Ptr(int64(3600)), | ||
| typeFlag: "", | ||
| primaryFlag: "", | ||
| retryTimeFlag: "0", | ||
@@ -164,5 +163,5 @@ refreshTimeFlag: "0", | ||
| DefaultTTL: utils.Ptr(int64(0)), | ||
| Primaries: utils.Ptr([]string{}), | ||
| Primaries: nil, | ||
| Acl: utils.Ptr(""), | ||
| Type: utils.Ptr(""), | ||
| Type: nil, | ||
| RetryTime: utils.Ptr(int64(0)), | ||
@@ -169,0 +168,0 @@ RefreshTime: utils.Ptr(int64(0)), |
@@ -49,3 +49,3 @@ package create | ||
| Acl *string | ||
| Type *string | ||
| Type *dns.CreateZonePayloadTypes | ||
| RetryTime *int64 | ||
@@ -128,2 +128,7 @@ RefreshTime *int64 | ||
| func configureFlags(cmd *cobra.Command) { | ||
| var typeFlagOptions []string | ||
| for _, val := range dns.AllowedCreateZonePayloadTypesEnumValues { | ||
| typeFlagOptions = append(typeFlagOptions, string(val)) | ||
| } | ||
| cmd.Flags().String(nameFlag, "", "User given name of the zone") | ||
@@ -134,3 +139,3 @@ cmd.Flags().String(dnsNameFlag, "", "Fully qualified domain name of the DNS zone") | ||
| cmd.Flags().String(aclFlag, "", "Access control list") | ||
| cmd.Flags().String(typeFlag, "", "Zone type") | ||
| cmd.Flags().Var(flags.EnumFlag(false, "", append(typeFlagOptions, "")...), typeFlag, fmt.Sprintf("Zone type, one of: %q", typeFlagOptions)) | ||
| cmd.Flags().Int64(retryTimeFlag, 0, "Retry time") | ||
@@ -154,2 +159,7 @@ cmd.Flags().Int64(refreshTimeFlag, 0, "Refresh time") | ||
| var zoneType *dns.CreateZonePayloadTypes | ||
| if zoneTypeString := flags.FlagToStringPointer(p, cmd, typeFlag); zoneTypeString != nil && *zoneTypeString != "" { | ||
| zoneType = dns.CreateZonePayloadTypes(*zoneTypeString).Ptr() | ||
| } | ||
| model := inputModel{ | ||
@@ -162,3 +172,3 @@ GlobalFlagModel: globalFlags, | ||
| Acl: flags.FlagToStringPointer(p, cmd, aclFlag), | ||
| Type: flags.FlagToStringPointer(p, cmd, typeFlag), | ||
| Type: zoneType, | ||
| RetryTime: flags.FlagToInt64Pointer(p, cmd, retryTimeFlag), | ||
@@ -165,0 +175,0 @@ RefreshTime: flags.FlagToInt64Pointer(p, cmd, refreshTimeFlag), |
@@ -187,3 +187,3 @@ package create | ||
| expectedRequest: fixtureRequest(func(request *git.ApiCreateInstanceRequest) { | ||
| *request = request.CreateInstancePayload(fixtureCreatePayload(func(payload *git.CreateInstancePayload) { | ||
| *request = (*request).CreateInstancePayload(fixtureCreatePayload(func(payload *git.CreateInstancePayload) { | ||
| payload.Name = utils.Ptr("new-name") | ||
@@ -190,0 +190,0 @@ })) |
@@ -342,3 +342,3 @@ package create | ||
| expectedRequest: fixtureRequest(func(request *iaas.ApiCreateImageRequest) { | ||
| *request = request.CreateImagePayload(fixtureCreatePayload(func(payload *iaas.CreateImagePayload) { | ||
| *request = (*request).CreateImagePayload(fixtureCreatePayload(func(payload *iaas.CreateImagePayload) { | ||
| payload.Labels = nil | ||
@@ -354,3 +354,3 @@ })) | ||
| expectedRequest: fixtureRequest(func(request *iaas.ApiCreateImageRequest) { | ||
| *request = request.CreateImagePayload(fixtureCreatePayload(func(payload *iaas.CreateImagePayload) { | ||
| *request = (*request).CreateImagePayload(fixtureCreatePayload(func(payload *iaas.CreateImagePayload) { | ||
| payload.Config.CdromBus = iaas.NewNullableString(utils.Ptr("foobar")) | ||
@@ -366,3 +366,3 @@ })) | ||
| expectedRequest: fixtureRequest(func(request *iaas.ApiCreateImageRequest) { | ||
| *request = request.CreateImagePayload(fixtureCreatePayload(func(payload *iaas.CreateImagePayload) { | ||
| *request = (*request).CreateImagePayload(fixtureCreatePayload(func(payload *iaas.CreateImagePayload) { | ||
| payload.Config.Uefi = utils.Ptr(false) | ||
@@ -369,0 +369,0 @@ })) |
@@ -187,3 +187,3 @@ package list | ||
| expectedRequest: fixtureRequest(func(request *iaas.ApiListImagesRequest) { | ||
| *request = request.LabelSelector("") | ||
| *request = (*request).LabelSelector("") | ||
| }), | ||
@@ -197,3 +197,3 @@ }, | ||
| expectedRequest: fixtureRequest(func(request *iaas.ApiListImagesRequest) { | ||
| *request = request.LabelSelector("foo=bar") | ||
| *request = (*request).LabelSelector("foo=bar") | ||
| }), | ||
@@ -200,0 +200,0 @@ }, |
@@ -376,3 +376,3 @@ package update | ||
| expectedRequest: fixtureRequest(func(request *iaas.ApiUpdateImageRequest) { | ||
| *request = request.UpdateImagePayload(fixtureCreatePayload(func(payload *iaas.UpdateImagePayload) { | ||
| *request = (*request).UpdateImagePayload(fixtureCreatePayload(func(payload *iaas.UpdateImagePayload) { | ||
| payload.Labels = nil | ||
@@ -388,3 +388,3 @@ })) | ||
| expectedRequest: fixtureRequest(func(request *iaas.ApiUpdateImageRequest) { | ||
| *request = request.UpdateImagePayload(fixtureCreatePayload(func(payload *iaas.UpdateImagePayload) { | ||
| *request = (*request).UpdateImagePayload(fixtureCreatePayload(func(payload *iaas.UpdateImagePayload) { | ||
| payload.Name = utils.Ptr("something else") | ||
@@ -400,3 +400,3 @@ })) | ||
| expectedRequest: fixtureRequest(func(request *iaas.ApiUpdateImageRequest) { | ||
| *request = request.UpdateImagePayload(fixtureCreatePayload(func(payload *iaas.UpdateImagePayload) { | ||
| *request = (*request).UpdateImagePayload(fixtureCreatePayload(func(payload *iaas.UpdateImagePayload) { | ||
| payload.Config.CdromBus.Set(utils.Ptr("something else")) | ||
@@ -403,0 +403,0 @@ })) |
@@ -39,3 +39,3 @@ package create | ||
| Port: utils.Ptr(int64(0)), | ||
| Protocol: utils.Ptr(""), | ||
| Protocol: loadbalancer.ListenerProtocol("").Ptr(), | ||
| ServerNameIndicators: &[]loadbalancer.ServerNameIndicator{ | ||
@@ -59,3 +59,3 @@ { | ||
| NetworkId: utils.Ptr(""), | ||
| Role: utils.Ptr(""), | ||
| Role: loadbalancer.NetworkRole("").Ptr(), | ||
| }, | ||
@@ -62,0 +62,0 @@ }, |
@@ -229,3 +229,3 @@ package generatepayload | ||
| Port: utils.Ptr(int64(0)), | ||
| Protocol: utils.Ptr(""), | ||
| Protocol: loadbalancer.ListenerProtocol("").Ptr(), | ||
| Name: utils.Ptr(""), | ||
@@ -248,3 +248,3 @@ ServerNameIndicators: &[]loadbalancer.ServerNameIndicator{ | ||
| Port: utils.Ptr(int64(0)), | ||
| Protocol: utils.Ptr(""), | ||
| Protocol: loadbalancer.ListenerProtocol("").Ptr(), | ||
| Name: utils.Ptr(""), | ||
@@ -270,3 +270,3 @@ ServerNameIndicators: &[]loadbalancer.ServerNameIndicator{ | ||
| Port: utils.Ptr(int64(0)), | ||
| Protocol: utils.Ptr(""), | ||
| Protocol: loadbalancer.ListenerProtocol("").Ptr(), | ||
| Name: nil, | ||
@@ -289,3 +289,3 @@ ServerNameIndicators: &[]loadbalancer.ServerNameIndicator{ | ||
| Port: utils.Ptr(int64(0)), | ||
| Protocol: utils.Ptr(""), | ||
| Protocol: loadbalancer.ListenerProtocol("").Ptr(), | ||
| Name: nil, | ||
@@ -292,0 +292,0 @@ ServerNameIndicators: &[]loadbalancer.ServerNameIndicator{ |
@@ -38,3 +38,3 @@ package generatepayload | ||
| Port: utils.Ptr(int64(0)), | ||
| Protocol: utils.Ptr(""), | ||
| Protocol: loadbalancer.ListenerProtocol("").Ptr(), | ||
| ServerNameIndicators: &[]loadbalancer.ServerNameIndicator{ | ||
@@ -56,3 +56,3 @@ { | ||
| NetworkId: utils.Ptr(""), | ||
| Role: utils.Ptr(""), | ||
| Role: loadbalancer.NetworkRole("").Ptr(), | ||
| } | ||
@@ -59,0 +59,0 @@ |
@@ -192,3 +192,3 @@ package add | ||
| cmpopts.EquateComparable(testCtx), | ||
| cmpopts.IgnoreFields(loadbalancer.ApiCreateCredentialsRequest{}, "xRequestID"), | ||
| cmpopts.IgnoreFields(loadbalancer.CreateCredentialsRequest{}, "xRequestID"), | ||
| ) | ||
@@ -195,0 +195,0 @@ if diff != "" { |
@@ -341,3 +341,3 @@ package addtarget | ||
| }) | ||
| *request = request.UpdateTargetPoolPayload(*payload) | ||
| *request = (*request).UpdateTargetPoolPayload(*payload) | ||
| }), | ||
@@ -361,3 +361,3 @@ }, | ||
| }) | ||
| *request = request.UpdateTargetPoolPayload(*payload) | ||
| *request = (*request).UpdateTargetPoolPayload(*payload) | ||
| }), | ||
@@ -381,3 +381,3 @@ }, | ||
| }) | ||
| *request = request.UpdateTargetPoolPayload(*payload) | ||
| *request = (*request).UpdateTargetPoolPayload(*payload) | ||
| }), | ||
@@ -384,0 +384,0 @@ }, |
@@ -323,3 +323,3 @@ package removetarget | ||
| }) | ||
| *request = request.UpdateTargetPoolPayload(*payload) | ||
| *request = (*request).UpdateTargetPoolPayload(*payload) | ||
| }), | ||
@@ -326,0 +326,0 @@ }, |
@@ -36,3 +36,3 @@ package update | ||
| Port: utils.Ptr(int64(0)), | ||
| Protocol: utils.Ptr(""), | ||
| Protocol: loadbalancer.ListenerProtocol("").Ptr(), | ||
| ServerNameIndicators: &[]loadbalancer.ServerNameIndicator{ | ||
@@ -56,3 +56,3 @@ { | ||
| NetworkId: utils.Ptr(""), | ||
| Role: utils.Ptr(""), | ||
| Role: loadbalancer.NetworkRole("").Ptr(), | ||
| }, | ||
@@ -59,0 +59,0 @@ }, |
@@ -244,3 +244,3 @@ package create | ||
| expectedRequest: fixtureRequest(func(request *iaas.ApiCreateNetworkAreaRouteRequest) { | ||
| *request = request.CreateNetworkAreaRoutePayload(fixturePayload(func(payload *iaas.CreateNetworkAreaRoutePayload) { | ||
| *request = (*request).CreateNetworkAreaRoutePayload(fixturePayload(func(payload *iaas.CreateNetworkAreaRoutePayload) { | ||
| (*payload.Ipv4)[0].Labels = utils.Ptr(map[string]interface{}{"key": "value"}) | ||
@@ -247,0 +247,0 @@ })) |
@@ -265,3 +265,3 @@ package disable | ||
| expectedRequest: fixtureRequest(func(request *observability.ApiUpdateGrafanaConfigsRequest) { | ||
| *request = request.UpdateGrafanaConfigsPayload(*fixturePayload(func(payload *observability.UpdateGrafanaConfigsPayload) { | ||
| *request = (*request).UpdateGrafanaConfigsPayload(*fixturePayload(func(payload *observability.UpdateGrafanaConfigsPayload) { | ||
| payload.GenericOauth = nil | ||
@@ -268,0 +268,0 @@ })) |
@@ -265,3 +265,3 @@ package enable | ||
| expectedRequest: fixtureRequest(func(request *observability.ApiUpdateGrafanaConfigsRequest) { | ||
| *request = request.UpdateGrafanaConfigsPayload(*fixturePayload(func(payload *observability.UpdateGrafanaConfigsPayload) { | ||
| *request = (*request).UpdateGrafanaConfigsPayload(*fixturePayload(func(payload *observability.UpdateGrafanaConfigsPayload) { | ||
| payload.GenericOauth = nil | ||
@@ -268,0 +268,0 @@ })) |
@@ -265,3 +265,3 @@ package disable | ||
| expectedRequest: fixtureRequest(func(request *observability.ApiUpdateGrafanaConfigsRequest) { | ||
| *request = request.UpdateGrafanaConfigsPayload(*fixturePayload(func(payload *observability.UpdateGrafanaConfigsPayload) { | ||
| *request = (*request).UpdateGrafanaConfigsPayload(*fixturePayload(func(payload *observability.UpdateGrafanaConfigsPayload) { | ||
| payload.GenericOauth = nil | ||
@@ -268,0 +268,0 @@ })) |
@@ -265,3 +265,3 @@ package enable | ||
| expectedRequest: fixtureRequest(func(request *observability.ApiUpdateGrafanaConfigsRequest) { | ||
| *request = request.UpdateGrafanaConfigsPayload(*fixturePayload(func(payload *observability.UpdateGrafanaConfigsPayload) { | ||
| *request = (*request).UpdateGrafanaConfigsPayload(*fixturePayload(func(payload *observability.UpdateGrafanaConfigsPayload) { | ||
| payload.GenericOauth = nil | ||
@@ -268,0 +268,0 @@ })) |
@@ -5,2 +5,3 @@ package create | ||
| "context" | ||
| "fmt" | ||
| "testing" | ||
@@ -38,3 +39,3 @@ | ||
| { | ||
| Action: utils.Ptr("replace"), | ||
| Action: observability.CREATESCRAPECONFIGPAYLOADMETRICSRELABELCONFIGSINNERACTION_REPLACE.Ptr(), | ||
| Modulus: utils.Ptr(1.0), | ||
@@ -53,3 +54,3 @@ Regex: utils.Ptr("regex"), | ||
| SampleLimit: utils.Ptr(1.0), | ||
| Scheme: utils.Ptr("scheme"), | ||
| Scheme: observability.CREATESCRAPECONFIGPAYLOADSCHEME_HTTPS.Ptr(), | ||
| ScrapeInterval: utils.Ptr("interval"), | ||
@@ -75,3 +76,3 @@ ScrapeTimeout: utils.Ptr("timeout"), | ||
| instanceIdFlag: testInstanceId, | ||
| payloadFlag: `{ | ||
| payloadFlag: fmt.Sprintf(`{ | ||
| "jobName": "default-name", | ||
@@ -102,3 +103,3 @@ "basicAuth": { | ||
| "sampleLimit": 1.0, | ||
| "scheme": "scheme", | ||
| "scheme": "%s", | ||
| "scrapeInterval": "interval", | ||
@@ -118,3 +119,3 @@ "scrapeTimeout": "timeout", | ||
| } | ||
| }`, | ||
| }`, observability.CREATESCRAPECONFIGPAYLOADSCHEME_HTTPS), | ||
| } | ||
@@ -121,0 +122,0 @@ for _, mod := range mods { |
@@ -37,3 +37,3 @@ package update | ||
| { | ||
| Action: utils.Ptr("replace"), | ||
| Action: observability.CREATESCRAPECONFIGPAYLOADMETRICSRELABELCONFIGSINNERACTION_REPLACE.Ptr(), | ||
| Modulus: utils.Ptr(1.0), | ||
@@ -40,0 +40,0 @@ Regex: utils.Ptr("regex"), |
@@ -9,2 +9,3 @@ package options | ||
| "github.com/google/go-cmp/cmp" | ||
| "github.com/google/uuid" | ||
| "github.com/stackitcloud/stackit-cli/internal/cmd/params" | ||
@@ -20,2 +21,3 @@ "github.com/stackitcloud/stackit-cli/internal/pkg/globalflags" | ||
| var testCtx = context.WithValue(context.Background(), testCtxKey{}, "foo") | ||
| var testProjectId = uuid.NewString() | ||
@@ -68,6 +70,7 @@ type postgresFlexClientMocked struct { | ||
| flagValues := map[string]string{ | ||
| flavorsFlag: "true", | ||
| versionsFlag: "true", | ||
| storagesFlag: "true", | ||
| flavorIdFlag: "2.4", | ||
| globalflags.ProjectIdFlag: testProjectId, | ||
| flavorsFlag: "true", | ||
| versionsFlag: "true", | ||
| storagesFlag: "true", | ||
| flavorIdFlag: "2.4", | ||
| } | ||
@@ -82,6 +85,9 @@ for _, mod := range mods { | ||
| model := &inputModel{ | ||
| GlobalFlagModel: &globalflags.GlobalFlagModel{Verbosity: globalflags.VerbosityDefault}, | ||
| Flavors: false, | ||
| Versions: false, | ||
| Storages: false, | ||
| GlobalFlagModel: &globalflags.GlobalFlagModel{ | ||
| ProjectId: testProjectId, | ||
| Verbosity: globalflags.VerbosityDefault, | ||
| }, | ||
| Flavors: false, | ||
| Versions: false, | ||
| Storages: false, | ||
| } | ||
@@ -96,7 +102,10 @@ for _, mod := range mods { | ||
| model := &inputModel{ | ||
| GlobalFlagModel: &globalflags.GlobalFlagModel{Verbosity: globalflags.VerbosityDefault}, | ||
| Flavors: true, | ||
| Versions: true, | ||
| Storages: true, | ||
| FlavorId: utils.Ptr("2.4"), | ||
| GlobalFlagModel: &globalflags.GlobalFlagModel{ | ||
| ProjectId: testProjectId, | ||
| Verbosity: globalflags.VerbosityDefault, | ||
| }, | ||
| Flavors: true, | ||
| Versions: true, | ||
| Storages: true, | ||
| FlavorId: utils.Ptr("2.4"), | ||
| } | ||
@@ -103,0 +112,0 @@ for _, mod := range mods { |
@@ -13,2 +13,3 @@ package options | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/args" | ||
| cliErr "github.com/stackitcloud/stackit-cli/internal/pkg/errors" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/examples" | ||
@@ -103,2 +104,5 @@ "github.com/stackitcloud/stackit-cli/internal/pkg/flags" | ||
| globalFlags := globalflags.Parse(p, cmd) | ||
| if globalFlags.ProjectId == "" { | ||
| return nil, &cliErr.ProjectIdError{} | ||
| } | ||
| flavors := flags.FlagToBoolValue(p, cmd, flavorsFlag) | ||
@@ -105,0 +109,0 @@ versions := flags.FlagToBoolValue(p, cmd, versionsFlag) |
@@ -70,3 +70,3 @@ package list | ||
| if err != nil { | ||
| return resourcemanager.ApiListProjectsRequest{} | ||
| return resourcemanager.ListProjectsRequest{} | ||
| } | ||
@@ -73,0 +73,0 @@ request = request.CreationTimeStart(testCreationTimeAfter) |
@@ -230,3 +230,3 @@ package create | ||
| expectedRequest: fixtureRequest(func(request *iaas.ApiCreateSecurityGroupRequest) { | ||
| *request = request.CreateSecurityGroupPayload(iaas.CreateSecurityGroupPayload{ | ||
| *request = (*request).CreateSecurityGroupPayload(iaas.CreateSecurityGroupPayload{ | ||
| Description: &testDescription, | ||
@@ -245,3 +245,3 @@ Labels: nil, | ||
| expectedRequest: fixtureRequest(func(request *iaas.ApiCreateSecurityGroupRequest) { | ||
| *request = request.CreateSecurityGroupPayload(iaas.CreateSecurityGroupPayload{ | ||
| *request = (*request).CreateSecurityGroupPayload(iaas.CreateSecurityGroupPayload{ | ||
| Description: &testDescription, | ||
@@ -248,0 +248,0 @@ Labels: utils.Ptr(toStringAnyMapPtr(testLabels)), |
@@ -181,3 +181,3 @@ package list | ||
| expectedRequest: fixtureRequest(func(request *iaas.ApiListSecurityGroupsRequest) { | ||
| *request = request.LabelSelector("") | ||
| *request = (*request).LabelSelector("") | ||
| }), | ||
@@ -191,3 +191,3 @@ }, | ||
| expectedRequest: fixtureRequest(func(request *iaas.ApiListSecurityGroupsRequest) { | ||
| *request = request.LabelSelector("foo=bar") | ||
| *request = (*request).LabelSelector("foo=bar") | ||
| }), | ||
@@ -194,0 +194,0 @@ }, |
@@ -271,3 +271,3 @@ package update | ||
| expectedRequest: fixtureRequest(func(request *iaas.ApiUpdateSecurityGroupRequest) { | ||
| *request = request.UpdateSecurityGroupPayload(iaas.UpdateSecurityGroupPayload{ | ||
| *request = (*request).UpdateSecurityGroupPayload(iaas.UpdateSecurityGroupPayload{ | ||
| Description: &testDescription, | ||
@@ -274,0 +274,0 @@ Labels: nil, |
@@ -202,3 +202,3 @@ package reboot | ||
| expectedRequest: fixtureRequest(func(request *iaas.ApiRebootServerRequest) { | ||
| *request = request.Action("hard") | ||
| *request = (*request).Action("hard") | ||
| }), | ||
@@ -205,0 +205,0 @@ }, |
@@ -5,2 +5,3 @@ package create | ||
| "context" | ||
| "fmt" | ||
| "testing" | ||
@@ -51,3 +52,3 @@ "time" | ||
| AvailabilityZones: &[]string{"eu01-3"}, | ||
| Cri: &ske.CRI{Name: utils.Ptr("cri")}, | ||
| Cri: &ske.CRI{Name: ske.CRINAME_DOCKER.Ptr()}, | ||
| }, | ||
@@ -86,3 +87,3 @@ }, | ||
| projectIdFlag: testProjectId, | ||
| payloadFlag: `{ | ||
| payloadFlag: fmt.Sprintf(`{ | ||
| "name": "cli-jp", | ||
@@ -106,3 +107,3 @@ "kubernetes": { | ||
| "volume": { "type": "storage_premium_perf0", "size": 40 }, | ||
| "cri": { "name": "cri" }, | ||
| "cri": { "name": "%s" }, | ||
| "availabilityZones": ["eu01-3"] | ||
@@ -122,3 +123,3 @@ } | ||
| } | ||
| }`, | ||
| }`, ske.CRINAME_DOCKER), | ||
| } | ||
@@ -125,0 +126,0 @@ for _, mod := range mods { |
@@ -5,2 +5,3 @@ package update | ||
| "context" | ||
| "fmt" | ||
| "testing" | ||
@@ -51,3 +52,3 @@ "time" | ||
| AvailabilityZones: &[]string{"eu01-3"}, | ||
| Cri: &ske.CRI{Name: utils.Ptr("cri")}, | ||
| Cri: &ske.CRI{Name: ske.CRINAME_DOCKER.Ptr()}, | ||
| }, | ||
@@ -86,3 +87,3 @@ }, | ||
| projectIdFlag: testProjectId, | ||
| payloadFlag: `{ | ||
| payloadFlag: fmt.Sprintf(`{ | ||
| "name": "cli-jp", | ||
@@ -106,3 +107,3 @@ "kubernetes": { | ||
| "volume": { "type": "storage_premium_perf0", "size": 40 }, | ||
| "cri": { "name": "cri" }, | ||
| "cri": { "name": "%s" }, | ||
| "availabilityZones": ["eu01-3"] | ||
@@ -122,3 +123,3 @@ } | ||
| } | ||
| }`, | ||
| }`, ske.CRINAME_DOCKER), | ||
| } | ||
@@ -125,0 +126,0 @@ for _, mod := range mods { |
@@ -278,3 +278,3 @@ package options | ||
| cri := (*version.Cri)[i] | ||
| criNames = append(criNames, *cri.Name) | ||
| criNames = append(criNames, string(*cri.Name)) | ||
| } | ||
@@ -281,0 +281,0 @@ criNamesString := strings.Join(criNames, ", ") |
@@ -38,3 +38,3 @@ package utils | ||
| } | ||
| return resp.Rrset.Type, nil | ||
| return (*string)(resp.Rrset.Type), nil | ||
| } | ||
@@ -41,0 +41,0 @@ |
@@ -59,3 +59,3 @@ package utils | ||
| func (m *loadBalancerClientMocked) UpdateTargetPool(_ context.Context, _, _, _, _ string) loadbalancer.ApiUpdateTargetPoolRequest { | ||
| return loadbalancer.ApiUpdateTargetPoolRequest{} | ||
| return loadbalancer.UpdateTargetPoolRequest{} | ||
| } | ||
@@ -62,0 +62,0 @@ |
@@ -51,3 +51,3 @@ package utils | ||
| { | ||
| Action: utils.Ptr("replace"), | ||
| Action: observability.METRICSRELABELCONFIGACTION_REPLACE.Ptr(), | ||
| Modulus: &number, | ||
@@ -66,3 +66,3 @@ Regex: utils.Ptr("regex"), | ||
| SampleLimit: &number, | ||
| Scheme: utils.Ptr("scheme"), | ||
| Scheme: observability.JOBSCHEME_HTTP.Ptr(), | ||
| ScrapeInterval: utils.Ptr("interval"), | ||
@@ -104,3 +104,3 @@ ScrapeTimeout: utils.Ptr("timeout"), | ||
| { | ||
| Action: utils.Ptr("replace"), | ||
| Action: utils.Ptr(observability.CreateScrapeConfigPayloadMetricsRelabelConfigsInnerAction("replace")), | ||
| Modulus: utils.Ptr(1.0), | ||
@@ -119,3 +119,3 @@ Regex: utils.Ptr("regex"), | ||
| SampleLimit: utils.Ptr(1.0), | ||
| Scheme: utils.Ptr("scheme"), | ||
| Scheme: observability.UPDATESCRAPECONFIGPAYLOADSCHEME_HTTP.Ptr(), | ||
| ScrapeInterval: utils.Ptr("interval"), | ||
@@ -439,3 +439,3 @@ ScrapeTimeout: utils.Ptr("timeout"), | ||
| { | ||
| Action: utils.Ptr("replace"), | ||
| Action: observability.METRICSRELABELCONFIGACTION_REPLACE.Ptr(), | ||
| Modulus: utils.Int64Ptr(1), | ||
@@ -451,3 +451,3 @@ Regex: utils.Ptr("regex"), | ||
| { | ||
| Action: utils.Ptr("replace"), | ||
| Action: observability.CREATESCRAPECONFIGPAYLOADMETRICSRELABELCONFIGSINNERACTION_REPLACE.Ptr(), | ||
| Modulus: utils.Float64Ptr(1.0), | ||
@@ -454,0 +454,0 @@ Regex: utils.Ptr("regex"), |
@@ -34,3 +34,3 @@ package utils | ||
| MetricsPath: utils.Ptr("/metrics"), | ||
| Scheme: utils.Ptr("https"), | ||
| Scheme: observability.CREATESCRAPECONFIGPAYLOADSCHEME_HTTPS.Ptr(), | ||
| ScrapeInterval: utils.Ptr("5m"), | ||
@@ -110,3 +110,3 @@ ScrapeTimeout: utils.Ptr("2m"), | ||
| SampleLimit: utils.ConvertInt64PToFloat64P(data.SampleLimit), | ||
| Scheme: data.Scheme, | ||
| Scheme: observability.UpdateScrapeConfigPayloadGetSchemeAttributeType(data.Scheme), | ||
| ScrapeInterval: data.ScrapeInterval, | ||
@@ -132,3 +132,3 @@ ScrapeTimeout: data.ScrapeTimeout, | ||
| mappedConfig := observability.CreateScrapeConfigPayloadMetricsRelabelConfigsInner{ | ||
| Action: config.Action, | ||
| Action: observability.CreateScrapeConfigPayloadMetricsRelabelConfigsInnerGetActionAttributeType(config.Action), | ||
| Modulus: utils.ConvertInt64PToFloat64P(config.Modulus), | ||
@@ -135,0 +135,0 @@ Regex: config.Regex, |
@@ -91,3 +91,3 @@ package utils | ||
| Size: utils.Ptr(int64(5)), | ||
| Status: utils.Ptr("test status"), | ||
| Status: serverbackup.BACKUPSTATUS_BACKING_UP.Ptr(), | ||
| VolumeBackups: nil, | ||
@@ -94,0 +94,0 @@ }, |
@@ -8,8 +8,5 @@ package utils | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/utils" | ||
| "github.com/google/uuid" | ||
| "github.com/stackitcloud/stackit-sdk-go/core/oapierror" | ||
| "github.com/stackitcloud/stackit-sdk-go/services/serviceenablement" | ||
| "github.com/stackitcloud/stackit-sdk-go/services/serviceenablement/wait" | ||
| ) | ||
@@ -49,3 +46,3 @@ | ||
| description: "project enabled", | ||
| getProjectResp: &serviceenablement.ServiceStatus{State: utils.Ptr(wait.ServiceStateEnabled)}, | ||
| getProjectResp: &serviceenablement.ServiceStatus{State: serviceenablement.SERVICESTATUSSTATE_ENABLED.Ptr()}, | ||
| isValid: true, | ||
@@ -62,3 +59,3 @@ expectedOutput: true, | ||
| description: "project disabled 1", | ||
| getProjectResp: &serviceenablement.ServiceStatus{State: utils.Ptr(wait.ServiceStateEnabling)}, | ||
| getProjectResp: &serviceenablement.ServiceStatus{State: serviceenablement.SERVICESTATUSSTATE_ENABLING.Ptr()}, | ||
| isValid: true, | ||
@@ -69,3 +66,3 @@ expectedOutput: false, | ||
| description: "project disabled 2", | ||
| getProjectResp: &serviceenablement.ServiceStatus{State: utils.Ptr(wait.ServiceStateDisabled)}, | ||
| getProjectResp: &serviceenablement.ServiceStatus{State: serviceenablement.SERVICESTATUSSTATE_DISABLING.Ptr()}, | ||
| isValid: true, | ||
@@ -76,3 +73,3 @@ expectedOutput: false, | ||
| description: "project disabled 3", | ||
| getProjectResp: &serviceenablement.ServiceStatus{State: utils.Ptr(wait.ServiceStateDisabling)}, | ||
| getProjectResp: &serviceenablement.ServiceStatus{State: serviceenablement.SERVICESTATUSSTATE_DISABLING.Ptr()}, | ||
| isValid: true, | ||
@@ -79,0 +76,0 @@ expectedOutput: false, |
@@ -9,3 +9,2 @@ package utils | ||
| "github.com/stackitcloud/stackit-sdk-go/services/serviceenablement" | ||
| "github.com/stackitcloud/stackit-sdk-go/services/serviceenablement/wait" | ||
| ) | ||
@@ -33,3 +32,3 @@ | ||
| } | ||
| return *project.State == wait.ServiceStateEnabled, nil | ||
| return *project.State == serviceenablement.SERVICESTATUSSTATE_ENABLED, nil | ||
| } |
@@ -170,6 +170,6 @@ package utils | ||
| { | ||
| Name: utils.Ptr("not-containerd"), | ||
| Name: ske.CRINAME_DOCKER.Ptr(), | ||
| }, | ||
| { | ||
| Name: utils.Ptr("containerd"), | ||
| Name: ske.CRINAME_CONTAINERD.Ptr(), | ||
| }, | ||
@@ -183,6 +183,6 @@ }, | ||
| { | ||
| Name: utils.Ptr("not-containerd"), | ||
| Name: ske.CRINAME_DOCKER.Ptr(), | ||
| }, | ||
| { | ||
| Name: utils.Ptr("containerd"), | ||
| Name: ske.CRINAME_CONTAINERD.Ptr(), | ||
| }, | ||
@@ -201,3 +201,3 @@ }, | ||
| { | ||
| Name: utils.Ptr("containerd"), | ||
| Name: ske.CRINAME_CONTAINERD.Ptr(), | ||
| }, | ||
@@ -225,3 +225,3 @@ }, | ||
| { | ||
| Name: utils.Ptr("containerd"), | ||
| Name: ske.CRINAME_CONTAINERD.Ptr(), | ||
| }, | ||
@@ -240,3 +240,3 @@ }, | ||
| { | ||
| Name: utils.Ptr("not-containerd"), | ||
| Name: ske.CRINAME_DOCKER.Ptr(), | ||
| }, | ||
@@ -272,3 +272,3 @@ }, | ||
| Cri: &ske.CRI{ | ||
| Name: utils.Ptr("containerd"), | ||
| Name: ske.CRINAME_CONTAINERD.Ptr(), | ||
| }, | ||
@@ -275,0 +275,0 @@ Machine: &ske.Machine{ |
@@ -20,3 +20,3 @@ package utils | ||
| defaultNodepoolAvailabilityZone = "eu01-3" | ||
| defaultNodepoolCRI = "containerd" | ||
| defaultNodepoolCRI = ske.CRINAME_CONTAINERD | ||
| defaultNodepoolMachineType = "b1.2" | ||
@@ -23,0 +23,0 @@ defaultNodepoolMachineImageName = "flatcar" |
Sorry, the diff of this file is too big to display