Skip to content

Commit

Permalink
Adjustments after review
Browse files Browse the repository at this point in the history
  • Loading branch information
joaopalet committed Jan 31, 2024
1 parent 18076ef commit 1990cbb
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 8 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ permissions:
jobs:
goreleaser:
runs-on: ubuntu-latest
env:
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_TOKEN }}
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -32,6 +34,8 @@ jobs:
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.GPG_PASSPHRASE }}
- name: Install Snapcraft
uses: samuelmeuli/action-snapcraft@v2
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v5
with:
Expand Down
16 changes: 15 additions & 1 deletion .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -78,4 +78,18 @@ brews:
# If set to auto, the release will not be uploaded to the homebrew tap repo
# if the tag has a prerelease indicator (e.g. v0.0.1-alpha1)
# Not setting it for now so we can publish prerelease tags
# skip_upload: auto
# skip_upload: auto

snapcrafts:
# IDs of the builds for which to create packages for
builds:
- linux-builds
# The name of the snap
name: stackit-cli
# The canonical title of the application, displayed in the software
# centre graphical frontends
title: STACKIT CLI
publish: true
summary: A command-line interface to manage STACKIT resources.
description: A command-line interface to manage STACKIT resources.
license: Apache-2.0
6 changes: 3 additions & 3 deletions internal/cmd/config/set/set.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const (
serviceAccountCustomEndpointFlag = "service-account-custom-endpoint"
skeCustomEndpointFlag = "ske-custom-endpoint"
resourceManagerCustomEndpointFlag = "resource-manager-custom-endpoint"
OpenSearchCustomEndpointFlag = "opensearch-custom-endpoint"
openSearchCustomEndpointFlag = "opensearch-custom-endpoint"
)

type inputModel struct {
Expand Down Expand Up @@ -87,7 +87,7 @@ func configureFlags(cmd *cobra.Command) {
cmd.Flags().String(serviceAccountCustomEndpointFlag, "", "Service Account custom endpoint")
cmd.Flags().String(skeCustomEndpointFlag, "", "SKE custom endpoint")
cmd.Flags().String(resourceManagerCustomEndpointFlag, "", "Resource manager custom endpoint")
cmd.Flags().String(OpenSearchCustomEndpointFlag, "", "OpenSearch custom endpoint")
cmd.Flags().String(openSearchCustomEndpointFlag, "", "OpenSearch custom endpoint")

err := viper.BindPFlag(config.DNSCustomEndpointKey, cmd.Flags().Lookup(dnsCustomEndpointFlag))
cobra.CheckErr(err)
Expand All @@ -101,7 +101,7 @@ func configureFlags(cmd *cobra.Command) {
cobra.CheckErr(err)
err = viper.BindPFlag(config.ResourceManagerEndpointKey, cmd.Flags().Lookup(skeCustomEndpointFlag))
cobra.CheckErr(err)
err = viper.BindPFlag(config.OpenSearchCustomEndpointKey, cmd.Flags().Lookup(OpenSearchCustomEndpointFlag))
err = viper.BindPFlag(config.OpenSearchCustomEndpointKey, cmd.Flags().Lookup(openSearchCustomEndpointFlag))
cobra.CheckErr(err)
}

Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/opensearch/instance/create/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ func NewCmd() *cobra.Command {
Example: examples.Build(
examples.NewExample(
`Create an OpenSearch instance with name "my-instance" and specify plan by name and version`,
"$ stackit opensearch instance create --name my-instance --plan-name stackit-qa-opensearch-1.2.10-replica --version 2"),
"$ stackit opensearch instance create --name my-instance --plan-name stackit-opensearch-1.2.10-replica --version 2"),
examples.NewExample(
`Create an OpenSearch instance with name "my-instance" and specify plan by ID`,
"$ stackit opensearch instance create --name my-instance --plan-id xxx"),
Expand Down
6 changes: 3 additions & 3 deletions internal/pkg/services/opensearch/utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ func ValidatePlanId(service, planId string, offerings *opensearch.ListOfferingsR

return &errors.DSAInvalidPlanError{
Service: service,
Details: fmt.Sprintf("You provided plan ID '%s', which is invalid.", planId),
Details: fmt.Sprintf("You provided plan ID %q, which is invalid.", planId),
}
}

Expand All @@ -47,13 +47,13 @@ func LoadPlanId(service, planName, version string, offerings *opensearch.ListOff
}

if !isValidVersion {
details := fmt.Sprintf("You provided version '%s', which is invalid. Available versions are: %s", version, availableVersions)
details := fmt.Sprintf("You provided version %q, which is invalid. Available versions are: %s", version, availableVersions)
return nil, &errors.DSAInvalidPlanError{
Service: service,
Details: details,
}
}
details := fmt.Sprintf("You provided plan_name '%s' for version %s, which is invalid. Available plan names for that version are: %s", planName, version, availablePlanNames)
details := fmt.Sprintf("You provided plan_name %q for version %s, which is invalid. Available plan names for that version are: %s", planName, version, availablePlanNames)
return nil, &errors.DSAInvalidPlanError{
Service: service,
Details: details,
Expand Down

0 comments on commit 1990cbb

Please sign in to comment.