Skip to content

Commit

Permalink
chore: generate_certificated flag becomes required (#206)
Browse files Browse the repository at this point in the history
  • Loading branch information
pggb25 authored Oct 5, 2023
1 parent 9ed7694 commit e29ddae
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 22 deletions.
4 changes: 2 additions & 2 deletions cmd/application_domain_create.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ var applicationDomainCreateCmd = &cobra.Command{
generateCertificate := !doNotGenerateCertificate
req := qovery.CustomDomainRequest{
Domain: applicationCustomDomain,
GenerateCertificate: &generateCertificate,
GenerateCertificate: generateCertificate,
}

createdDomain, _, err := client.CustomDomainApi.CreateApplicationCustomDomain(context.Background(), application.Id).CustomDomainRequest(req).Execute()
Expand All @@ -82,7 +82,7 @@ var applicationDomainCreateCmd = &cobra.Command{
panic("unreachable") // staticcheck false positive: https://staticcheck.io/docs/checks#SA5011
}

utils.Println(fmt.Sprintf("Custom domain %s has been created (generate certificate: %s)", pterm.FgBlue.Sprintf(createdDomain.Domain), pterm.FgBlue.Sprintf(strconv.FormatBool(*createdDomain.GenerateCertificate))))
utils.Println(fmt.Sprintf("Custom domain %s has been created (generate certificate: %s)", pterm.FgBlue.Sprintf(createdDomain.Domain), pterm.FgBlue.Sprintf(strconv.FormatBool(createdDomain.GenerateCertificate))))
},
}

Expand Down
4 changes: 2 additions & 2 deletions cmd/application_domain_edit.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ var applicationDomainEditCmd = &cobra.Command{
generateCertificate := !doNotGenerateCertificate
req := qovery.CustomDomainRequest{
Domain: applicationCustomDomain,
GenerateCertificate: &generateCertificate,
GenerateCertificate: generateCertificate,
}

editedDomain, _, err := client.CustomDomainApi.EditCustomDomain(context.Background(), application.Id, customDomain.Id).CustomDomainRequest(req).Execute()
Expand All @@ -80,7 +80,7 @@ var applicationDomainEditCmd = &cobra.Command{
panic("unreachable") // staticcheck false positive: https://staticcheck.io/docs/checks#SA5011
}

utils.Println(fmt.Sprintf("Custom domain %s has been edited (generate certificate: %s)", pterm.FgBlue.Sprintf(editedDomain.Domain), pterm.FgBlue.Sprintf(strconv.FormatBool(*editedDomain.GenerateCertificate))))
utils.Println(fmt.Sprintf("Custom domain %s has been edited (generate certificate: %s)", pterm.FgBlue.Sprintf(editedDomain.Domain), pterm.FgBlue.Sprintf(strconv.FormatBool(editedDomain.GenerateCertificate))))
},
}

Expand Down
7 changes: 1 addition & 6 deletions cmd/application_domain_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,17 +80,12 @@ var applicationDomainListCmd = &cobra.Command{
for _, customDomain := range customDomains.GetResults() {
customDomainsSet[customDomain.Domain] = true

generateCertificate := "N/A"
if customDomain.GenerateCertificate != nil {
generateCertificate = strconv.FormatBool(*customDomain.GenerateCertificate)
}

data = append(data, []string{
customDomain.Id,
"CUSTOM_DOMAIN",
customDomain.Domain,
*customDomain.ValidationDomain,
generateCertificate,
strconv.FormatBool(customDomain.GenerateCertificate),
})
}

Expand Down
4 changes: 2 additions & 2 deletions cmd/container_domain_create.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ var containerDomainCreateCmd = &cobra.Command{
generateCertificate := !doNotGenerateCertificate
req := qovery.CustomDomainRequest{
Domain: containerCustomDomain,
GenerateCertificate: &generateCertificate,
GenerateCertificate: generateCertificate,
}

createdDomain, _, err := client.ContainerCustomDomainApi.CreateContainerCustomDomain(context.Background(), container.Id).CustomDomainRequest(req).Execute()
Expand All @@ -82,7 +82,7 @@ var containerDomainCreateCmd = &cobra.Command{
panic("unreachable") // staticcheck false positive: https://staticcheck.io/docs/checks#SA5011
}

utils.Println(fmt.Sprintf("Custom domain %s has been created (generate certificate: %s)", pterm.FgBlue.Sprintf(createdDomain.Domain), pterm.FgBlue.Sprintf(strconv.FormatBool(*createdDomain.GenerateCertificate))))
utils.Println(fmt.Sprintf("Custom domain %s has been created (generate certificate: %s)", pterm.FgBlue.Sprintf(createdDomain.Domain), pterm.FgBlue.Sprintf(strconv.FormatBool(createdDomain.GenerateCertificate))))
},
}

Expand Down
4 changes: 2 additions & 2 deletions cmd/container_domain_edit.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ var containerDomainEditCmd = &cobra.Command{
generateCertificate := !doNotGenerateCertificate
req := qovery.CustomDomainRequest{
Domain: containerCustomDomain,
GenerateCertificate: &generateCertificate,
GenerateCertificate: generateCertificate,
}

editedDomain, _, err := client.ContainerCustomDomainApi.EditContainerCustomDomain(context.Background(), container.Id, customDomain.Id).CustomDomainRequest(req).Execute()
Expand All @@ -80,7 +80,7 @@ var containerDomainEditCmd = &cobra.Command{
panic("unreachable") // staticcheck false positive: https://staticcheck.io/docs/checks#SA5011
}

utils.Println(fmt.Sprintf("Custom domain %s has been edited (generate certificate: %s)", pterm.FgBlue.Sprintf(editedDomain.Domain), pterm.FgBlue.Sprintf(strconv.FormatBool(*editedDomain.GenerateCertificate))))
utils.Println(fmt.Sprintf("Custom domain %s has been edited (generate certificate: %s)", pterm.FgBlue.Sprintf(editedDomain.Domain), pterm.FgBlue.Sprintf(strconv.FormatBool(editedDomain.GenerateCertificate))))
},
}

Expand Down
7 changes: 1 addition & 6 deletions cmd/container_domain_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,17 +67,12 @@ var containerDomainListCmd = &cobra.Command{
for _, customDomain := range customDomains.GetResults() {
customDomainsSet[customDomain.Domain] = true

generateCertificate := "N/A"
if customDomain.GenerateCertificate != nil {
generateCertificate = strconv.FormatBool(*customDomain.GenerateCertificate)
}

data = append(data, []string{
customDomain.Id,
"CUSTOM_DOMAIN",
customDomain.Domain,
*customDomain.ValidationDomain,
generateCertificate,
strconv.FormatBool(customDomain.GenerateCertificate),
})
}

Expand Down
2 changes: 1 addition & 1 deletion cmd/container_update.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ var containerUpdateCmd = &cobra.Command{
Ports: ports,
Name: container.Name,
Description: container.Description,
RegistryId: *container.Registry.Id,
RegistryId: container.Registry.Id,
ImageName: imageName,
Tag: tag,
Arguments: container.Arguments,
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ require (
github.com/pkg/errors v0.9.1
github.com/posthog/posthog-go v0.0.0-20221221115252-24dfed35d71a
github.com/pterm/pterm v0.12.55
github.com/qovery/qovery-client-go v0.0.0-20231003154456-09b5ae9eae15
github.com/qovery/qovery-client-go v0.0.0-20231005085710-02b1085fcf27
github.com/sirupsen/logrus v1.9.0
github.com/spf13/cobra v1.6.1
github.com/spf13/pflag v1.0.5
Expand Down
4 changes: 4 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,10 @@ github.com/qovery/qovery-client-go v0.0.0-20231003144739-772ce5bcc19e h1:o0TQ5QH
github.com/qovery/qovery-client-go v0.0.0-20231003144739-772ce5bcc19e/go.mod h1:7su0Zq+YniKNRSXNJsdrbR2/dGn7UHz3QJ2WpcxyP8k=
github.com/qovery/qovery-client-go v0.0.0-20231003154456-09b5ae9eae15 h1:pwdYIUSwOMXjYtuVErvuWN3IQYY1RhjYvGFKOt+y9CQ=
github.com/qovery/qovery-client-go v0.0.0-20231003154456-09b5ae9eae15/go.mod h1:7su0Zq+YniKNRSXNJsdrbR2/dGn7UHz3QJ2WpcxyP8k=
github.com/qovery/qovery-client-go v0.0.0-20231004152120-c3f72c7ff7aa h1:gym7RXHFht0nCflEiWC87hm1JNosaqOGM/dZhZPb5ZU=
github.com/qovery/qovery-client-go v0.0.0-20231004152120-c3f72c7ff7aa/go.mod h1:7su0Zq+YniKNRSXNJsdrbR2/dGn7UHz3QJ2WpcxyP8k=
github.com/qovery/qovery-client-go v0.0.0-20231005085710-02b1085fcf27 h1:biZ8BWw9tzYSMHz+ohs6B6DTEoQQBaXdZyU7BRA0taA=
github.com/qovery/qovery-client-go v0.0.0-20231005085710-02b1085fcf27/go.mod h1:7su0Zq+YniKNRSXNJsdrbR2/dGn7UHz3QJ2WpcxyP8k=
github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
github.com/rivo/uniseg v0.4.4 h1:8TfxU8dW6PdqD27gjM8MVNuicgxIjxpm4K7x4jp8sis=
github.com/rivo/uniseg v0.4.4/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
Expand Down

0 comments on commit e29ddae

Please sign in to comment.