Skip to content

Commit b559b03

Browse files
committed
change: update deps
1 parent 2bf959e commit b559b03

File tree

1,632 files changed

+51346
-126890
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,632 files changed

+51346
-126890
lines changed

.golangci.yml

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,23 @@
1-
linters-settings:
2-
errcheck:
3-
check-blank: false # to keep `_ = viper.BindPFlag(...)` from throwing errors
1+
version: "2"
2+
linters:
3+
settings:
4+
errcheck:
5+
check-blank: false
6+
exclusions:
7+
generated: lax
8+
presets:
9+
- comments
10+
- common-false-positives
11+
- legacy
12+
- std-error-handling
13+
paths:
14+
- third_party$
15+
- builtin$
16+
- examples$
17+
formatters:
18+
exclusions:
19+
generated: lax
20+
paths:
21+
- third_party$
22+
- builtin$
23+
- examples$

Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ ARG DOCKER_VERSION=27.3.1
44
# -> golang image used solely for building the k3d binary #
55
# -> built executable can then be copied into other stages #
66
############################################################
7-
FROM golang:1.22.4 as builder
7+
FROM golang:1.24.4 AS builder
88
ARG GIT_TAG_OVERRIDE
99
WORKDIR /app
1010
RUN mkdir /tmp/empty
@@ -16,7 +16,7 @@ RUN make build -e GIT_TAG_OVERRIDE=${GIT_TAG_OVERRIDE} && bin/k3d version
1616
# -> k3d + some tools in a docker-in-docker container #
1717
# -> used e.g. in our CI pipelines for testing #
1818
#######################################################
19-
FROM docker:$DOCKER_VERSION-dind as dind
19+
FROM docker:$DOCKER_VERSION-dind AS dind
2020
ARG OS
2121
ARG ARCH
2222

@@ -40,7 +40,7 @@ COPY --from=builder /app/bin/k3d /bin/k3d
4040
# binary-only #
4141
# -> only the k3d binary.. nothing else #
4242
#########################################
43-
FROM scratch as binary-only
43+
FROM scratch AS binary-only
4444
# empty tmp directory to avoid errors when transforming the config file
4545
COPY --from=builder /tmp/empty /tmp
4646
COPY --from=builder /app/bin/k3d /bin/k3d

cmd/cluster/clusterCreate.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ func NewCmdClusterCreate() *cobra.Command {
144144

145145
// check if a cluster with that name exists already
146146
if _, err := k3dCluster.ClusterGet(cmd.Context(), runtimes.SelectedRuntime, &clusterConfig.Cluster); err == nil {
147-
l.Log().Fatalf("Failed to create cluster '%s' because a cluster with that name already exists", clusterConfig.Cluster.Name)
147+
l.Log().Fatalf("Failed to create cluster '%s' because a cluster with that name already exists", clusterConfig.Name)
148148
}
149149

150150
// create cluster
@@ -167,7 +167,7 @@ func NewCmdClusterCreate() *cobra.Command {
167167
}
168168
l.Log().Fatalln("Cluster creation FAILED, all changes have been rolled back!")
169169
}
170-
l.Log().Infof("Cluster '%s' created successfully!", clusterConfig.Cluster.Name)
170+
l.Log().Infof("Cluster '%s' created successfully!", clusterConfig.Name)
171171

172172
/**************
173173
* Kubeconfig *
@@ -179,7 +179,7 @@ func NewCmdClusterCreate() *cobra.Command {
179179
}
180180

181181
if clusterConfig.KubeconfigOpts.UpdateDefaultKubeconfig {
182-
l.Log().Debugf("Updating default kubeconfig with a new context for cluster %s", clusterConfig.Cluster.Name)
182+
l.Log().Debugf("Updating default kubeconfig with a new context for cluster %s", clusterConfig.Name)
183183
if _, err := k3dCluster.KubeconfigGetWrite(cmd.Context(), runtimes.SelectedRuntime, &clusterConfig.Cluster, "", &k3dCluster.WriteKubeConfigOptions{UpdateExisting: true, OverwriteExisting: false, UpdateCurrentContext: simpleCfg.Options.KubeconfigOptions.SwitchCurrentContext}); err != nil {
184184
l.Log().Warningln(err)
185185
}
@@ -192,12 +192,12 @@ func NewCmdClusterCreate() *cobra.Command {
192192
// print information on how to use the cluster with kubectl
193193
l.Log().Infoln("You can now use it like this:")
194194
if clusterConfig.KubeconfigOpts.UpdateDefaultKubeconfig && !clusterConfig.KubeconfigOpts.SwitchCurrentContext {
195-
fmt.Printf("kubectl config use-context %s\n", fmt.Sprintf("%s-%s", k3d.DefaultObjectNamePrefix, clusterConfig.Cluster.Name))
195+
fmt.Printf("kubectl config use-context %s\n", fmt.Sprintf("%s-%s", k3d.DefaultObjectNamePrefix, clusterConfig.Name))
196196
} else if !clusterConfig.KubeconfigOpts.SwitchCurrentContext {
197197
if runtime.GOOS == "windows" {
198-
fmt.Printf("$env:KUBECONFIG=(%s kubeconfig write %s)\n", os.Args[0], clusterConfig.Cluster.Name)
198+
fmt.Printf("$env:KUBECONFIG=(%s kubeconfig write %s)\n", os.Args[0], clusterConfig.Name)
199199
} else {
200-
fmt.Printf("export KUBECONFIG=$(%s kubeconfig write %s)\n", os.Args[0], clusterConfig.Cluster.Name)
200+
fmt.Printf("export KUBECONFIG=$(%s kubeconfig write %s)\n", os.Args[0], clusterConfig.Name)
201201
}
202202
}
203203
fmt.Println("kubectl cluster-info")

cmd/cluster/clusterList.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,14 +164,15 @@ func PrintClusters(clusters []*k3d.Cluster, flags clusterFlags) {
164164
}
165165
}
166166

167-
if outputFormat == "json" {
167+
switch outputFormat {
168+
case "json":
168169
b, err := json.Marshal(jsonOutputEntries)
169170
if err != nil {
170171
fmt.Println(err)
171172
return
172173
}
173174
fmt.Println(string(b))
174-
} else if outputFormat == "yaml" {
175+
case "yaml":
175176
b, err := yaml.Marshal(jsonOutputEntries)
176177
if err != nil {
177178
fmt.Println(err)

cmd/kubeconfig/kubeconfigGet.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ func NewCmdKubeconfigGet() *cobra.Command {
5656
ValidArgsFunction: util.ValidArgsAvailableClusters,
5757
Args: func(cmd *cobra.Command, args []string) error {
5858
if (len(args) < 1 && !getKubeconfigFlags.all) || (len(args) > 0 && getKubeconfigFlags.all) {
59-
return fmt.Errorf("Need to specify one or more cluster names *or* set `--all` flag")
59+
return fmt.Errorf("need to specify one or more cluster names *or* set `--all` flag")
6060
}
6161
return nil
6262
},

cmd/root.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ func NewCmdVersionLs() *cobra.Command {
283283
string(VersionLsSortOff): VersionLsSortOff,
284284
}
285285

286-
var imageRepos map[string]string = map[string]string{
286+
var imageRepos = map[string]string{
287287
"k3d": "ghcr.io/k3d-io/k3d",
288288
"k3d-tools": "ghcr.io/k3d-io/k3d-tools",
289289
"k3d-proxy": "ghcr.io/k3d-io/k3d-proxy",

cmd/util/filter.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,12 @@ func SplitFiltersFromFlag(flag string) (string, []string, error) {
6464

6565
// max number of pieces after split = 2 (only one @ allowed in flag)
6666
if len(newsplit) > 2 {
67-
return "", nil, fmt.Errorf("Invalid flag '%s': only one unescaped '@' allowed for node filter(s) (Escape literal '@' with '\\')", flag)
67+
return "", nil, fmt.Errorf("invalid flag '%s': only one unescaped '@' allowed for node filter(s) (Escape literal '@' with '\\')", flag)
6868
}
6969

7070
// trailing or leading '@'
7171
if len(newsplit) < 2 {
72-
return "", nil, fmt.Errorf("Invalid flag '%s' includes unescaped '@' but is missing a node filter (Escape literal '@' with '\\')", flag)
72+
return "", nil, fmt.Errorf("invalid flag '%s' includes unescaped '@' but is missing a node filter (Escape literal '@' with '\\')", flag)
7373
}
7474

7575
return newsplit[0], strings.Split(newsplit[1], ";"), nil

cmd/util/listings.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ func PrintNodes(nodes []*k3d.Node, outputFormat string, headers *[]string, nodeP
8282
fmt.Println(string(b))
8383
} else {
8484
for _, node := range nodes {
85-
if !(outputFormat == "json" || outputFormat == "yaml") {
85+
if outputFormat != "json" && outputFormat != "yaml" {
8686
nodePrinter.Print(tabwriter, node)
8787
}
8888
}

cmd/util/ports.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,14 @@ func ParsePortExposureSpec(exposedPortSpec, internalPort string) (*k3d.ExposureO
4141
match := apiPortRegexp.FindStringSubmatch(exposedPortSpec)
4242

4343
if len(match) == 0 {
44-
return nil, fmt.Errorf("Failed to parse Port Exposure specification '%s': Format must be [(HostIP|HostName):]HostPort", exposedPortSpec)
44+
return nil, fmt.Errorf("failed to parse Port Exposure specification '%s': Format must be [(HostIP|HostName):]HostPort", exposedPortSpec)
4545
}
4646

4747
submatches := util.MapSubexpNames(apiPortRegexp.SubexpNames(), match)
4848

4949
// no port specified (or not matched via regex)
5050
if submatches["port"] == "" {
51-
return nil, fmt.Errorf("Failed to find port in Port Exposure spec '%s'", exposedPortSpec)
51+
return nil, fmt.Errorf("failed to find port in Port Exposure spec '%s'", exposedPortSpec)
5252
}
5353

5454
api := &k3d.ExposureOpts{}
@@ -58,7 +58,7 @@ func ParsePortExposureSpec(exposedPortSpec, internalPort string) (*k3d.ExposureO
5858
l.Log().Tracef("Port Exposure: found hostname: %s", submatches["hostname"])
5959
addrs, err := net.LookupHost(submatches["hostname"])
6060
if err != nil {
61-
return nil, fmt.Errorf("Failed to lookup host '%s' specified for Port Exposure: %+v", submatches["hostname"], err)
61+
return nil, fmt.Errorf("failed to lookup host '%s' specified for Port Exposure: %+v", submatches["hostname"], err)
6262
}
6363
api.Host = submatches["hostname"]
6464
for _, addr := range addrs {
@@ -67,7 +67,7 @@ func ParsePortExposureSpec(exposedPortSpec, internalPort string) (*k3d.ExposureO
6767
}
6868
}
6969
if submatches["hostip"] == "" {
70-
return nil, fmt.Errorf("Failed to lookup IPv4 address for host '%s'", submatches["hostname"])
70+
return nil, fmt.Errorf("failed to lookup IPv4 address for host '%s'", submatches["hostname"])
7171
}
7272
}
7373

docgen/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/k3d-io/k3d/docgen
22

3-
go 1.22.4
3+
go 1.24.4
44

55
require github.com/spf13/cobra v1.8.0
66

0 commit comments

Comments
 (0)