Skip to content

Commit

Permalink
Bump Go versions
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickdappollonio committed Nov 26, 2024
1 parent 6b79b86 commit e1edd14
Show file tree
Hide file tree
Showing 8 changed files with 959 additions and 1,663 deletions.
523 changes: 286 additions & 237 deletions go.mod

Large diffs are not rendered by default.

2,057 changes: 648 additions & 1,409 deletions go.sum

Large diffs are not rendered by default.

25 changes: 16 additions & 9 deletions internal/civo/objectStorage.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,16 +125,23 @@ var errNoCredsFound = errors.New("no object store credentials found")
// checkKubefirstCredentials determines whether or not object store credentials exist
func (c *Configuration) checkKubefirstCredentials(credentialName string) (*civogo.ObjectStoreCredential, error) {
log.Info().Msgf("looking for credential: %s", credentialName)
remoteCredentials, err := c.Client.ListObjectStoreCredentials()
if err != nil {
log.Error().Msg(err.Error())
return nil, fmt.Errorf("error fetching object store credentials: %w", err)
}

for i, cred := range remoteCredentials.Items {
if cred.Name == credentialName {
log.Info().Msgf("found credential: %s", credentialName)
return &remoteCredentials.Items[i], nil
for page := 1; ; page++ {
remoteCredentials, err := c.Client.ListObjectStoreCredentials(page, 100)
if err != nil {
log.Error().Msg(err.Error())
return nil, fmt.Errorf("error fetching object store credentials: %w", err)
}

if len(remoteCredentials.Items) == 0 || remoteCredentials.Pages == page {
break
}

for _, credential := range remoteCredentials.Items {
if credential.Name == credentialName {
log.Info().Msgf("found credential: %s", credentialName)
return &credential, nil
}
}
}

Expand Down
4 changes: 2 additions & 2 deletions internal/docker/docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"context"
"fmt"

"github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/container"
"github.com/docker/docker/client"
"github.com/rs/zerolog/log"
)
Expand All @@ -26,7 +26,7 @@ func NewDockerClient() *client.Client {
}

func (docker ClientWrapper) ListContainers() {
containers, err := docker.Client.ContainerList(context.Background(), types.ContainerListOptions{})
containers, err := docker.Client.ContainerList(context.Background(), container.ListOptions{})
if err != nil {
log.Error().Msg(err.Error())
}
Expand Down
2 changes: 1 addition & 1 deletion internal/gitlab/gitlab.go
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ func (gl *Wrapper) DeleteUserSSHKey(keyTitle string) error {

// GetUserSSHKeys
func (gl *Wrapper) GetUserSSHKeys() ([]*gitlab.SSHKey, error) {
keys, _, err := gl.Client.Users.ListSSHKeys()
keys, _, err := gl.Client.Users.ListSSHKeys(nil)
if err != nil {
return nil, fmt.Errorf("could not get user ssh keys: %w", err)
}
Expand Down
4 changes: 2 additions & 2 deletions internal/k3d/adjustContent.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func AdjustGitopsRepo(cloudProvider, clusterName, clusterType, gitopsRepoDir, gi

// * copy options
opt := cp.Options{
Skip: func(src string) (bool, error) {
Skip: func(_ os.FileInfo, src, _ string) (bool, error) {
if strings.HasSuffix(src, ".git") || strings.Index(src, "/.terraform") > 0 {
return true, nil
}
Expand Down Expand Up @@ -125,7 +125,7 @@ func AdjustMetaphorRepo(destinationMetaphorRepoGitURL, gitopsRepoDir, gitProvide

// * copy options
opt := cp.Options{
Skip: func(src string) (bool, error) {
Skip: func(_ os.FileInfo, src, _ string) (bool, error) {
if strings.HasSuffix(src, ".git") {
return true, nil
} else if strings.Index(src, "/.terraform") > 0 {
Expand Down
2 changes: 1 addition & 1 deletion internal/k8s/apply.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import (
memory "k8s.io/client-go/discovery/cached"
"k8s.io/client-go/dynamic"
"k8s.io/client-go/restmapper"
kbuild "sigs.k8s.io/kustomize/kustomize/v4/commands/build"
kbuild "sigs.k8s.io/kustomize/kustomize/v5/commands/build"
"sigs.k8s.io/kustomize/kyaml/filesys"
)

Expand Down
5 changes: 3 additions & 2 deletions pkg/providerConfigs/adjustDriver.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ package providerConfigs //nolint:revive,stylecheck // allowing temporarily for b

import (
"fmt"
"io/fs"
"os"
"path/filepath"
"strings"
Expand Down Expand Up @@ -50,7 +51,7 @@ func removeAllWithLogger(path string) {

func adjustGitOpsRepoForProvider(cloudProvider, gitProvider, gitopsRepoDir, clusterType, clusterName string, apexContentExists, isK3D bool) error {
opt := cp.Options{
Skip: func(src string) (bool, error) {
Skip: func(_ fs.FileInfo, src string, _ string) (bool, error) {
if strings.HasSuffix(src, ".git") {
return true, nil
} else if strings.Index(src, "/.terraform") > 0 {
Expand Down Expand Up @@ -191,7 +192,7 @@ func AdjustGitopsRepo(

func copyContents(source, destination string, createPath bool) error {
opt := cp.Options{
Skip: func(src string) (bool, error) {
Skip: func(_ fs.FileInfo, src string, _ string) (bool, error) {
if strings.HasSuffix(src, ".git") {
return true, nil
} else if strings.Index(src, "/.terraform") > 0 {
Expand Down

0 comments on commit e1edd14

Please sign in to comment.