diff --git a/CHANGELOG.md b/CHANGELOG.md index f7e08a07c..ffaa14ac9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -274,7 +274,7 @@ In addition, `kubernetes create` will now, by default, block all access to the c ### Fixed - Fix commands in `server delete` usage examples. -- Tune human output so that normal output is directed to `stdout`. Progess and error messages are still outputted to `stderr`. +- Tune human output so that normal output is directed to `stdout`. Progress and error messages are still outputted to `stderr`. ## [2.1.0] - 2022-09-07 ### Added @@ -356,7 +356,7 @@ In addition, `kubernetes create` will now, by default, block all access to the c ### Fixed - Improved errors relating to argument resolver failures -- Print version info, instead of missing credentials error, when runnning `upctl version` without credentials +- Print version info, instead of missing credentials error, when running `upctl version` without credentials - Disable colors when outputting in JSON or YAML format - Display both public and private addresses in `server create` output - Render livelog messages of commands which execution takes less than render tick interval @@ -403,7 +403,7 @@ First non-beta release! Includes all previous changes and fixes. ### Fixes - fix(pre-commit): add missing golangci config file -- fix(root): use default cobra behavious when called +- fix(root): use default cobra behaviour when called ## [0.5.0] - 2021-04-14 Initial public beta release :tada: diff --git a/README.md b/README.md index 00c797530..1827ac3a3 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ Exit code communicates success or the type and number of failures. Possible exit Exit code | Description --------- | ----------- 0 | Command(s) executed successfully. -1 - 99 | Number of failed executions. For example, if stopping four servers and API returs error for one of the request, exit code will be 1. +1 - 99 | Number of failed executions. For example, if stopping four servers and API returns error for one of the request, exit code will be 1. 100 - | Other, non-execution related, errors. For example, required flag missing. ## Examples @@ -101,7 +101,7 @@ cd upcloud-cli pre-commit install ``` -Make the changes with your favorite editor. Once you're done, create a new branch and push it back to Github. +Make the changes with your favorite editor. Once you're done, create a new branch and push it back to GitHub. ```bash git checkout -b diff --git a/docs/index.md b/docs/index.md index 30c84b55e..a1ff1865a 100644 --- a/docs/index.md +++ b/docs/index.md @@ -5,7 +5,7 @@ to control your resources from the command line or any compatible interface. ## Install upctl -`upctl` can be installed from a pre-built package in the repositorys [GitHub releases](https://github.com/UpCloudLtd/upcloud-cli/releases) using a package manager or from sources with `go install`: +`upctl` can be installed from a pre-built package in the repositories [GitHub releases](https://github.com/UpCloudLtd/upcloud-cli/releases) using a package manager or from sources with `go install`: === "Linux" diff --git a/internal/commands/ipaddress/assign.go b/internal/commands/ipaddress/assign.go index 522577b64..fbdc8c8bf 100644 --- a/internal/commands/ipaddress/assign.go +++ b/internal/commands/ipaddress/assign.go @@ -51,7 +51,7 @@ func (s *assignCommand) InitCommand() { fs.StringVar(&s.family, "family", defaultFamily, "The address family of new IP address.") fs.StringVar(&s.serverUUID, "server", "", "The server the ip address is assigned to.") fs.StringVar(&s.mac, "mac", "", "MAC address of server interface to assign address to. Required for detached floating IP address if zone is not specified.") - fs.StringVar(&s.zone, "zone", "", (namedargs.ZoneDescription("IP address") + " Required when creating a detached floating IP address, i.e. when MAC address is not speficied.")) + fs.StringVar(&s.zone, "zone", "", (namedargs.ZoneDescription("IP address") + " Required when creating a detached floating IP address, i.e. when MAC address is not specified.")) config.AddToggleFlag(fs, &s.floating, "floating", false, "Whether the address to be assigned is a floating one.") s.AddFlags(fs) } diff --git a/internal/commands/kubernetes/config_test.go b/internal/commands/kubernetes/config_test.go index 52d95af0c..863da8755 100644 --- a/internal/commands/kubernetes/config_test.go +++ b/internal/commands/kubernetes/config_test.go @@ -64,7 +64,7 @@ func TestConfigCommand(t *testing.T) { args: []string{ exampleUUID(), }, - expectedOutput: string(yamlToJSON(exampleKuberenetesKubeconfig("json-output"))), + expectedOutput: string(yamlToJSON(exampleKubernetesKubeconfig("json-output"))), }, { name: "yaml-output", @@ -129,7 +129,7 @@ Flags: exampleFilename(dir, "write-to-empty-file"), }, expectedOutput: ``, - expectedFileContents: exampleKuberenetesKubeconfig("write-to-empty-file"), + expectedFileContents: exampleKubernetesKubeconfig("write-to-empty-file"), }, { name: "write-to-non-empty-file", @@ -139,9 +139,9 @@ Flags: "--write", exampleFilename(dir, "write-to-non-empty-file"), }, - existingFileContents: exampleKuberenetesKubeconfig("previous-config"), + existingFileContents: exampleKubernetesKubeconfig("previous-config"), expectedOutput: ``, - expectedFileContents: exampleKuberenetesKubeconfig("previous-config", "write-to-non-empty-file"), + expectedFileContents: exampleKubernetesKubeconfig("previous-config", "write-to-non-empty-file"), }, { name: "write-to-non-empty-file-with-override", @@ -151,9 +151,9 @@ Flags: "--write", exampleFilename(dir, "write-to-non-empty-file-with-override"), }, - existingFileContents: exampleKuberenetesKubeconfig("write-to-non-empty-file-with-override"), + existingFileContents: exampleKubernetesKubeconfig("write-to-non-empty-file-with-override"), expectedOutput: ``, - expectedFileContents: exampleKuberenetesKubeconfig("write-to-non-empty-file-with-override"), + expectedFileContents: exampleKubernetesKubeconfig("write-to-non-empty-file-with-override"), }, } { tt := tt @@ -164,7 +164,7 @@ Flags: Return([]upcloud.KubernetesCluster{exampleKubernetesCluster(tt.name)}, nil) mService.On("GetKubernetesKubeconfig", exampleGetKubernetesKubeconfigRequest()). - Return(string(exampleKuberenetesKubeconfig(tt.name)), nil) + Return(string(exampleKubernetesKubeconfig(tt.name)), nil) filename := exampleFilename(dir, tt.name) file, err := os.Create(filename) @@ -222,7 +222,7 @@ func exampleGetKubernetesKubeconfigRequest() *request.GetKubernetesKubeconfigReq return &request.GetKubernetesKubeconfigRequest{UUID: exampleUUID()} } -func exampleKuberenetesKubeconfig(names ...string) []byte { +func exampleKubernetesKubeconfig(names ...string) []byte { apiConfig := api.NewConfig() for _, v := range names { apiConfig.Clusters[v] = &api.Cluster{ diff --git a/internal/commands/kubernetes/modify.go b/internal/commands/kubernetes/modify.go index 2ee90760e..14f5779a7 100644 --- a/internal/commands/kubernetes/modify.go +++ b/internal/commands/kubernetes/modify.go @@ -20,7 +20,7 @@ func ModifyCommand() commands.Command { return &modifyCommand{ BaseCommand: commands.New( "modify", - "Modifiy an existing cluster", + "Modify an existing cluster", "upctl cluster modify 00bb4617-c592-4b32-b869-35a60b323b18 --plan 1xCPU-1GB", ), } diff --git a/internal/commands/server/create.go b/internal/commands/server/create.go index 7332a6dff..b0f2c33e7 100644 --- a/internal/commands/server/create.go +++ b/internal/commands/server/create.go @@ -406,7 +406,7 @@ func formatCreateIPAddresses(val interface{}) (text.Colors, string, error) { // Store addresses in map keys to avoid duplicate addresses addresses := make(map[string]bool) - // Get public addressses from ip_addresses list + // Get public addresses from ip_addresses list // Public and utility interfaces created by default (no --network parameters) are only listed here for _, ipa := range server.IPAddresses { addresses[ipa.Address] = true diff --git a/internal/commands/storage/modify.go b/internal/commands/storage/modify.go index 440bef982..03663bbd8 100644 --- a/internal/commands/storage/modify.go +++ b/internal/commands/storage/modify.go @@ -67,7 +67,7 @@ func (s *modifyCommand) InitCommand() { flagSet.StringVar(&s.params.backupTime, "backup-time", s.params.backupTime, "The time when to create a backup in HH:MM. Empty value means no backups.") flagSet.StringVar(&s.params.backupInterval, "backup-interval", "", "The interval of the backup.\nAvailable: daily, mon, tue, wed, thu, fri, sat, sun") flagSet.IntVar(&s.params.backupRetention, "backup-retention", 0, "How long to store the backups in days. The accepted range is 1-1095.") - config.AddEnableOrDisableFlag(flagSet, &s.autoresizePartitionFilesystem, false, "filesystem-autoresize", "automatic resize of partition and filesystem when modifying storage size. Note that before the resize attempt is made, backup of the storage will be taken. If the resize attempt fails, the backup will be used to restore the storage and then deleted. If the resize attempt succeeds, backup will be kept. Taking and keeping backups incure costs.") + config.AddEnableOrDisableFlag(flagSet, &s.autoresizePartitionFilesystem, false, "filesystem-autoresize", "automatic resize of partition and filesystem when modifying storage size. Note that before the resize attempt is made, backup of the storage will be taken. If the resize attempt fails, the backup will be used to restore the storage and then deleted. If the resize attempt succeeds, backup will be kept. Taking and keeping backups incur costs.") s.AddFlags(flagSet) } diff --git a/internal/completion/ipaddress.go b/internal/completion/ipaddress.go index c984a3c83..d5ebefbdf 100644 --- a/internal/completion/ipaddress.go +++ b/internal/completion/ipaddress.go @@ -8,7 +8,7 @@ import ( "github.com/spf13/cobra" ) -// IPAddress implements argument completion for ip addresses, by ptr record or the adddress itself +// IPAddress implements argument completion for ip addresses, by ptr record or the address itself type IPAddress struct{} // make sure IPAddress implements the interface diff --git a/internal/resolver/database_test.go b/internal/resolver/database_test.go index 066f1afcc..688bd71c3 100644 --- a/internal/resolver/database_test.go +++ b/internal/resolver/database_test.go @@ -60,7 +60,7 @@ func TestDatabaseResolution(t *testing.T) { assert.NoError(t, err) var resolved string - // Ambigous title + // Ambiguous title resolved, err = argResolver("asd") if !assert.Error(t, err) { t.FailNow() diff --git a/internal/resolver/gateway_test.go b/internal/resolver/gateway_test.go index f0d8a1833..f09c7c29e 100644 --- a/internal/resolver/gateway_test.go +++ b/internal/resolver/gateway_test.go @@ -60,7 +60,7 @@ func TestGatewayResolution(t *testing.T) { assert.NoError(t, err) var resolved string - // Ambigous Name + // Ambiguous Name resolved, err = argResolver("asd") if !assert.Error(t, err) { t.FailNow() diff --git a/internal/resolver/ipaddress_test.go b/internal/resolver/ipaddress_test.go index 53620dca4..fdf1fff41 100644 --- a/internal/resolver/ipaddress_test.go +++ b/internal/resolver/ipaddress_test.go @@ -122,7 +122,7 @@ func TestIPAddressResolution(t *testing.T) { argResolver, err := res.Get(context.TODO(), mService) assert.NoError(t, err) - // ambigous address + // ambiguous address resolved, err := argResolver(ipAddress4.Address) if !assert.Error(t, err) { t.FailNow() @@ -130,7 +130,7 @@ func TestIPAddressResolution(t *testing.T) { assert.ErrorIs(t, err, resolver.AmbiguousResolutionError(ipAddress4.Address)) assert.Equal(t, "", resolved) - // ambigous ptr record + // ambiguous ptr record resolved, err = argResolver(ipAddress4.PTRRecord) if !assert.Error(t, err) { t.FailNow() diff --git a/internal/resolver/kubernetes_test.go b/internal/resolver/kubernetes_test.go index 1715e3504..9966b1ad9 100644 --- a/internal/resolver/kubernetes_test.go +++ b/internal/resolver/kubernetes_test.go @@ -60,7 +60,7 @@ func TestKubernetesResolution(t *testing.T) { assert.NoError(t, err) var resolved string - // Ambigous Name + // Ambiguous Name resolved, err = argResolver("asd") if !assert.Error(t, err) { t.FailNow() diff --git a/internal/resolver/loadbalancer_test.go b/internal/resolver/loadbalancer_test.go index 195d82658..7a2219644 100644 --- a/internal/resolver/loadbalancer_test.go +++ b/internal/resolver/loadbalancer_test.go @@ -60,7 +60,7 @@ func TestLoadBalancerResolution(t *testing.T) { assert.NoError(t, err) var resolved string - // Ambigous Name + // Ambiguous Name resolved, err = argResolver("asd") if !assert.Error(t, err) { t.FailNow() diff --git a/internal/resolver/network_test.go b/internal/resolver/network_test.go index 0fcb6ba57..c93b29c20 100644 --- a/internal/resolver/network_test.go +++ b/internal/resolver/network_test.go @@ -83,7 +83,7 @@ func TestNetworkResolution(t *testing.T) { argResolver, err := res.Get(context.TODO(), mService) assert.NoError(t, err) - // ambigous name + // ambiguous name resolved, err := argResolver(Network1.Name) if !assert.Error(t, err) { t.FailNow() @@ -109,7 +109,7 @@ func TestCachingNetwork_GetCached(t *testing.T) { mService.On("GetNetworks").Return(networks, nil) res := resolver.CachingNetwork{} - // should fail before cahe initialized + // should fail before cache initialized cached, err := res.GetCached(Network1.UUID) assert.Error(t, err) assert.Equal(t, upcloud.Network{}, cached) diff --git a/internal/resolver/router_test.go b/internal/resolver/router_test.go index dd7262789..88de57b3f 100644 --- a/internal/resolver/router_test.go +++ b/internal/resolver/router_test.go @@ -89,7 +89,7 @@ func TestRouterResolution(t *testing.T) { argResolver, err := res.Get(context.TODO(), mService) assert.NoError(t, err) - // ambigous name + // ambiguous name resolved, err := argResolver(Router1.Name) if !assert.Error(t, err) { t.FailNow() @@ -125,7 +125,7 @@ func TestCachingRouter_GetCached(t *testing.T) { mService.On("GetRouters").Return(allRouters, nil) res := resolver.CachingRouter{} - // should fail before cahe initialized + // should fail before cache initialized cached, err := res.GetCached(Router1.UUID) assert.Error(t, err) assert.Equal(t, upcloud.Router{}, cached) diff --git a/internal/resolver/server_test.go b/internal/resolver/server_test.go index 2f1f6f42b..ff04a9255 100644 --- a/internal/resolver/server_test.go +++ b/internal/resolver/server_test.go @@ -150,7 +150,7 @@ func TestServerResolution(t *testing.T) { argResolver, err := res.Get(context.TODO(), mService) assert.NoError(t, err) - // ambigous hostname + // ambiguous hostname resolved, err := argResolver(Server4.Hostname) if !assert.Error(t, err) { t.FailNow() @@ -158,7 +158,7 @@ func TestServerResolution(t *testing.T) { assert.ErrorIs(t, err, resolver.AmbiguousResolutionError(Server4.Hostname)) assert.Equal(t, "", resolved) - // ambigous title + // ambiguous title resolved, err = argResolver(Server1.Title) if !assert.Error(t, err) { t.FailNow() diff --git a/internal/resolver/servergroup_test.go b/internal/resolver/servergroup_test.go index c0780e5ab..b59592cd5 100644 --- a/internal/resolver/servergroup_test.go +++ b/internal/resolver/servergroup_test.go @@ -90,7 +90,7 @@ func TestServerGroupResolution(t *testing.T) { argResolver, err := res.Get(context.TODO(), mService) assert.NoError(t, err) - // ambigous title + // ambiguous title resolved, err := argResolver(ServerGroup1.Title) if !assert.Error(t, err) { t.FailNow() diff --git a/internal/resolver/storage_test.go b/internal/resolver/storage_test.go index 30a437942..4e50a757e 100644 --- a/internal/resolver/storage_test.go +++ b/internal/resolver/storage_test.go @@ -66,7 +66,7 @@ func TestStorageResolution(t *testing.T) { argResolver, err := res.Get(context.TODO(), mService) assert.NoError(t, err) - // ambigous uuid + // ambiguous uuid resolved, err := argResolver(amb2.UUID) if !assert.Error(t, err) { t.FailNow() @@ -74,7 +74,7 @@ func TestStorageResolution(t *testing.T) { assert.ErrorIs(t, err, resolver.AmbiguousResolutionError(amb2.UUID)) assert.Equal(t, "", resolved) - // ambigous title + // ambiguous title resolved, err = argResolver(amb1.Title) if !assert.Error(t, err) { t.FailNow()