Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix typos #338

Merged
merged 2 commits into from
Nov 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 <branch-name>
<add your changes, "git status" helps>
Expand Down
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
2 changes: 1 addition & 1 deletion internal/commands/ipaddress/assign.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
16 changes: 8 additions & 8 deletions internal/commands/kubernetes/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand All @@ -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",
Expand All @@ -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
Expand All @@ -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)
Expand Down Expand Up @@ -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{
Expand Down
2 changes: 1 addition & 1 deletion internal/commands/kubernetes/modify.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
),
}
Expand Down
2 changes: 1 addition & 1 deletion internal/commands/server/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion internal/commands/storage/modify.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
2 changes: 1 addition & 1 deletion internal/completion/ipaddress.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion internal/resolver/database_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion internal/resolver/gateway_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
4 changes: 2 additions & 2 deletions internal/resolver/ipaddress_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,15 +122,15 @@ 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()
}
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()
Expand Down
2 changes: 1 addition & 1 deletion internal/resolver/kubernetes_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion internal/resolver/loadbalancer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
4 changes: 2 additions & 2 deletions internal/resolver/network_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions internal/resolver/router_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions internal/resolver/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,15 +150,15 @@ 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()
}
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()
Expand Down
2 changes: 1 addition & 1 deletion internal/resolver/servergroup_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
4 changes: 2 additions & 2 deletions internal/resolver/storage_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,15 @@ 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()
}
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()
Expand Down
Loading