Skip to content

Commit

Permalink
chore: update packages (#312)
Browse files Browse the repository at this point in the history
  • Loading branch information
shreddedbacon committed Jan 3, 2024
1 parent 0a46a26 commit 8cb41ab
Show file tree
Hide file tree
Showing 129 changed files with 330 additions and 531 deletions.
7 changes: 3 additions & 4 deletions cmd/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (
"encoding/json"
"fmt"
"io"
"io/ioutil"
"os"
"path/filepath"
"sort"
Expand All @@ -17,7 +16,7 @@ import (
"github.com/uselagoon/lagoon-cli/internal/lagoon"
"github.com/uselagoon/lagoon-cli/internal/lagoon/client"
"github.com/uselagoon/lagoon-cli/pkg/output"
"gopkg.in/yaml.v2"
"gopkg.in/yaml.v3"
)

// LagoonConfigFlags .
Expand Down Expand Up @@ -327,7 +326,7 @@ func init() {

// readLagoonConfig reads the lagoon config from specified file.
func readLagoonConfig(lc *lagoon.Config, file string) error {
data, err := ioutil.ReadFile(file)
data, err := os.ReadFile(file)
if err != nil {
// if there is no file found in the specified location, prompt the user to create it with the default
// configuration to point to the amazeeio lagoon instance
Expand Down Expand Up @@ -388,7 +387,7 @@ func writeLagoonConfig(lc *lagoon.Config, file string) error {
if err != nil {
return fmt.Errorf("unable to marshal config into valid yaml: %v", err)
}
err = ioutil.WriteFile(file, d, 0777)
err = os.WriteFile(file, d, 0777)
if err != nil {
return err
}
Expand Down
3 changes: 1 addition & 2 deletions cmd/login.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package cmd

import (
"fmt"
"io/ioutil"
"net"
"os"
"path/filepath"
Expand Down Expand Up @@ -41,7 +40,7 @@ func publicKey(path string, skipAgent bool) (ssh.AuthMethod, func() error) {
}
}

key, err := ioutil.ReadFile(path)
key, err := os.ReadFile(path)
handleError(err)

// Try to look for an unencrypted private key
Expand Down
3 changes: 1 addition & 2 deletions cmd/tasks.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (
"encoding/json"
"errors"
"fmt"
"io/ioutil"
"os"
"strings"

Expand Down Expand Up @@ -250,7 +249,7 @@ Path:
} else {
// otherwise we can read from a file
if taskCommandFile != "" {
taskCommandBytes, err := ioutil.ReadFile(taskCommandFile) // just pass the file name
taskCommandBytes, err := os.ReadFile(taskCommandFile) // just pass the file name
handleError(err)
taskCommand = string(taskCommandBytes)
}
Expand Down
10 changes: 5 additions & 5 deletions cmd/users.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ import (
"encoding/json"
"errors"
"fmt"
l "github.com/uselagoon/machinery/api/lagoon"
lclient "github.com/uselagoon/machinery/api/lagoon/client"
s "github.com/uselagoon/machinery/api/schema"
"io/ioutil"
"os"
"strconv"
"strings"

l "github.com/uselagoon/machinery/api/lagoon"
lclient "github.com/uselagoon/machinery/api/lagoon/client"
s "github.com/uselagoon/machinery/api/schema"

"github.com/spf13/cobra"
"github.com/spf13/pflag"
"github.com/uselagoon/lagoon-cli/pkg/api"
Expand All @@ -37,7 +37,7 @@ func parseUser(flags pflag.FlagSet) api.User {
func parseSSHKeyFile(sshPubKey string, keyName string, keyValue string, userEmail string) (api.SSHKey, error) {
// if we haven't got a keyvalue
if keyValue == "" {
b, err := ioutil.ReadFile(sshPubKey) // just pass the file name
b, err := os.ReadFile(sshPubKey) // just pass the file name
handleError(err)
keyValue = string(b)
}
Expand Down
1 change: 1 addition & 0 deletions docs/commands/lagoon.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ lagoon [flags]
### SEE ALSO

* [lagoon add](lagoon_add.md) - Add a project, or add notifications and variables to projects or environments
* [lagoon completion](lagoon_completion.md) - Generate the autocompletion script for the specified shell
* [lagoon config](lagoon_config.md) - Configure Lagoon CLI
* [lagoon delete](lagoon_delete.md) - Delete a project, or delete notifications and variables from projects or environments
* [lagoon deploy](lagoon_deploy.md) - Actions for deploying or promoting branches or environments in lagoon
Expand Down
4 changes: 0 additions & 4 deletions docs/commands/lagoon_add.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@

Add a project, or add notifications and variables to projects or environments

### Synopsis

Add a project, or add notifications and variables to projects or environments

### Options

```
Expand Down
4 changes: 0 additions & 4 deletions docs/commands/lagoon_add_deploytarget-config.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@

Add deploytarget config to a project

### Synopsis

Add deploytarget config to a project

```
lagoon add deploytarget-config [flags]
```
Expand Down
4 changes: 0 additions & 4 deletions docs/commands/lagoon_add_group.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@

Add a group to lagoon

### Synopsis

Add a group to lagoon

```
lagoon add group [flags]
```
Expand Down
4 changes: 0 additions & 4 deletions docs/commands/lagoon_add_notification.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@

Add notifications or add notifications to projects

### Synopsis

Add notifications or add notifications to projects

### Options

```
Expand Down
4 changes: 0 additions & 4 deletions docs/commands/lagoon_add_organization.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@

Add an organization, or add a group/project to an organization

### Synopsis

Add an organization, or add a group/project to an organization

### Options

```
Expand Down
4 changes: 0 additions & 4 deletions docs/commands/lagoon_add_organization_deploytarget.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@

Add a deploy target to an Organization

### Synopsis

Add a deploy target to an Organization

```
lagoon add organization deploytarget [flags]
```
Expand Down
4 changes: 0 additions & 4 deletions docs/commands/lagoon_add_organization_group.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@

Add a group to an Organization

### Synopsis

Add a group to an Organization

```
lagoon add organization group [flags]
```
Expand Down
4 changes: 0 additions & 4 deletions docs/commands/lagoon_add_organization_organization.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@

Add a new organization to Lagoon

### Synopsis

Add a new organization to Lagoon

```
lagoon add organization organization [flags]
```
Expand Down
4 changes: 0 additions & 4 deletions docs/commands/lagoon_add_organization_project.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@

Add a project to an Organization

### Synopsis

Add a project to an Organization

```
lagoon add organization project [flags]
```
Expand Down
4 changes: 0 additions & 4 deletions docs/commands/lagoon_add_organization_user.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@

Add a user to an Organization

### Synopsis

Add a user to an Organization

```
lagoon add organization user [flags]
```
Expand Down
4 changes: 0 additions & 4 deletions docs/commands/lagoon_add_project-group.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@

Add a project to a group in lagoon

### Synopsis

Add a project to a group in lagoon

```
lagoon add project-group [flags]
```
Expand Down
4 changes: 0 additions & 4 deletions docs/commands/lagoon_add_project.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@

Add a new project to Lagoon

### Synopsis

Add a new project to Lagoon

```
lagoon add project [flags]
```
Expand Down
4 changes: 0 additions & 4 deletions docs/commands/lagoon_add_user-group.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@

Add a user to a group in lagoon

### Synopsis

Add a user to a group in lagoon

```
lagoon add user-group [flags]
```
Expand Down
4 changes: 0 additions & 4 deletions docs/commands/lagoon_add_user.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@

Add a user to lagoon

### Synopsis

Add a user to lagoon

```
lagoon add user [flags]
```
Expand Down
41 changes: 41 additions & 0 deletions docs/commands/lagoon_completion.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
## lagoon completion

Generate the autocompletion script for the specified shell

### Synopsis

Generate the autocompletion script for lagoon for the specified shell.
See each sub-command's help for details on how to use the generated script.


### Options

```
-h, --help help for completion
```

### Options inherited from parent commands

```
--config-file string Path to the config file to use (must be *.yml or *.yaml)
--debug Enable debugging output (if supported)
-e, --environment string Specify an environment to use
--force Force yes on prompts (if supported)
-l, --lagoon string The Lagoon instance to interact with
--no-header No header on table (if supported)
--output-csv Output as CSV (if supported)
--output-json Output as JSON (if supported)
--pretty Make JSON pretty (if supported)
-p, --project string Specify a project to use
--skip-update-check Skip checking for updates
-i, --ssh-key string Specify path to a specific SSH key to use for lagoon authentication
```

### SEE ALSO

* [lagoon](lagoon.md) - Command line integration for Lagoon
* [lagoon completion bash](lagoon_completion_bash.md) - Generate the autocompletion script for bash
* [lagoon completion fish](lagoon_completion_fish.md) - Generate the autocompletion script for fish
* [lagoon completion powershell](lagoon_completion_powershell.md) - Generate the autocompletion script for powershell
* [lagoon completion zsh](lagoon_completion_zsh.md) - Generate the autocompletion script for zsh

60 changes: 60 additions & 0 deletions docs/commands/lagoon_completion_bash.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
## lagoon completion bash

Generate the autocompletion script for bash

### Synopsis

Generate the autocompletion script for the bash shell.

This script depends on the 'bash-completion' package.
If it is not installed already, you can install it via your OS's package manager.

To load completions in your current shell session:

source <(lagoon completion bash)

To load completions for every new session, execute once:

#### Linux:

lagoon completion bash > /etc/bash_completion.d/lagoon

#### macOS:

lagoon completion bash > $(brew --prefix)/etc/bash_completion.d/lagoon

You will need to start a new shell for this setup to take effect.


```
lagoon completion bash
```

### Options

```
-h, --help help for bash
--no-descriptions disable completion descriptions
```

### Options inherited from parent commands

```
--config-file string Path to the config file to use (must be *.yml or *.yaml)
--debug Enable debugging output (if supported)
-e, --environment string Specify an environment to use
--force Force yes on prompts (if supported)
-l, --lagoon string The Lagoon instance to interact with
--no-header No header on table (if supported)
--output-csv Output as CSV (if supported)
--output-json Output as JSON (if supported)
--pretty Make JSON pretty (if supported)
-p, --project string Specify a project to use
--skip-update-check Skip checking for updates
-i, --ssh-key string Specify path to a specific SSH key to use for lagoon authentication
```

### SEE ALSO

* [lagoon completion](lagoon_completion.md) - Generate the autocompletion script for the specified shell

Loading

0 comments on commit 8cb41ab

Please sign in to comment.