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

Bump golang to v1.21 (backport #684) #707

Merged
merged 2 commits into from
Apr 18, 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
9 changes: 5 additions & 4 deletions .golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,14 @@ linters:
- revive
- gosec
- prealloc
run:
skip-files:
issues:
exclude-files:
- /zz_generated_
- _generated
skip-dirs:
exclude-dirs:
- generated
deadline: 5m
run:
timeout: 5m
tests: true
build-tags:
- test
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile.dapper
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM quay.io/costoolkit/releases-teal:grub2-live-0.0.4-2 as grub2-mbr
FROM quay.io/costoolkit/releases-teal:grub2-efi-image-live-0.0.4-2 as grub2-efi
FROM registry.suse.com/bci/golang:1.20
FROM registry.suse.com/bci/golang:1.21

ARG http_proxy=$http_proxy
ARG https_proxy=$https_proxy
Expand All @@ -20,7 +20,7 @@ RUN zypper -n rm container-suseconnect && \
zypper -n install git curl docker gzip tar wget zstd squashfs xorriso awk jq mtools dosfstools unzip rsync patch
RUN curl -sfL https://github.com/mikefarah/yq/releases/download/v4.21.1/yq_linux_${ARCH} -o /usr/bin/yq && chmod +x /usr/bin/yq
RUN if [ "${ARCH}" == "amd64" ]; then \
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.55.2; \
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.57.1; \
fi

RUN zypper addrepo http://download.opensuse.org/distribution/leap/15.4/repo/oss/ oss && \
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/harvester/harvester-installer

go 1.20
go 1.21

require (
github.com/harvester/go-common v0.0.0-20230718010724-11313421a8f5
Expand Down
7 changes: 7 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ github.com/cockroachdb/datadriven v0.0.0-20200714090401-bf6692d28da5/go.mod h1:h
github.com/cockroachdb/errors v1.2.4/go.mod h1:rQD95gz6FARkaKkQXUksEje/d9a6wBJoCr5oaCLELYA=
github.com/cockroachdb/logtags v0.0.0-20190617123548-eb05cc24525f/go.mod h1:i/u985jwjWRlyHXQbwatDASoW0RMlZ/3i9yJHE2xLkI=
github.com/containerd/stargz-snapshotter/estargz v0.12.1 h1:+7nYmHJb0tEkcRaAW+MHqoKaJYZmkikupxCqVtmPuY0=
github.com/containerd/stargz-snapshotter/estargz v0.12.1/go.mod h1:12VUuCq3qPq4y8yUW+l5w3+oXV3cx2Po3KSe/SmPGqw=
github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk=
github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE=
github.com/coreos/etcd v3.3.13+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE=
Expand Down Expand Up @@ -298,11 +299,13 @@ github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/
github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/go-containerregistry v0.12.2-0.20230106184643-b063f6aeac72 h1:mjNVVKGHs3+xtaGPnTHz4ozBphZNsxsgqFR4+TNwRVM=
github.com/google/go-containerregistry v0.12.2-0.20230106184643-b063f6aeac72/go.mod h1:J9FQ+eSS4a1aC2GNZxvNpbWhgp0487v+cgiilB4FqDo=
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
github.com/google/gofuzz v1.1.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0=
github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs=
github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0=
github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0=
Expand Down Expand Up @@ -589,6 +592,7 @@ github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40T
github.com/rancher-sandbox/cloud-init v1.14.3-0.20210913085759-bf90bf5eb77e h1:1GSTIPu7CB2UCkS++2/wMygc3S+aa5O0VbTsdDrYupE=
github.com/rancher-sandbox/cloud-init v1.14.3-0.20210913085759-bf90bf5eb77e/go.mod h1:qbJr82AYxRKlEa4ZSm6qENOmXebBxPXne8BWbtll4cg=
github.com/rancher/dynamiclistener v0.3.5 h1:5TaIHvkDGmZKvc96Huur16zfTKOiLhDtK4S+WV0JA6A=
github.com/rancher/dynamiclistener v0.3.5/go.mod h1:dW/YF6/m2+uEyJ5VtEcd9THxda599HP6N9dSXk81+k0=
github.com/rancher/lasso v0.0.0-20221227210133-6ea88ca2fbcc/go.mod h1:dEfC9eFQigj95lv/JQ8K5e7+qQCacWs1aIA6nLxKzT8=
github.com/rancher/mapper v0.0.0-20190814232720-058a8b7feb99 h1:rGnt9h1Uk7Yw4qNPyGq0LWHGdPyag/+Fg/wJWSTkKx4=
github.com/rancher/mapper v0.0.0-20190814232720-058a8b7feb99/go.mod h1:zU4cm21k7ZBFVQhUu2aSH7NwouY317rLYxruOn+wdOQ=
Expand Down Expand Up @@ -684,6 +688,7 @@ github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGr
github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc=
github.com/valyala/fasttemplate v1.0.1/go.mod h1:UQGH1tvbgY+Nz5t2n7tXsz52dQxojPUpymEIMZ47gx8=
github.com/vbatts/tar-split v0.11.2 h1:Via6XqJr0hceW4wff3QRzD5gAk/tatMw/4ZA7cTlIME=
github.com/vbatts/tar-split v0.11.2/go.mod h1:vV3ZuO2yWSVsz+pfFzDG/upWH1JhjOiEaWq6kXyQ3VI=
github.com/vishvananda/netlink v0.0.0-20170808154308-f5a6f697a596/go.mod h1:+SR5DhBJrl6ZM7CoCKvpw5BKroDKQ+PJqOg65H/2ktk=
github.com/vishvananda/netlink v1.1.0 h1:1iyaYNBLmP6L0220aDnYQpo1QEV4t4hJ+xEEhhJH8j0=
github.com/vishvananda/netlink v1.1.0/go.mod h1:cTgwzPIzzgDAYoQrMm0EdrjRUBkTqKYppBueQtXaqoE=
Expand Down Expand Up @@ -1010,6 +1015,7 @@ golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuX
golang.org/x/term v0.3.0/go.mod h1:q750SLmJuPmVoN1blW3UFBPREJfb1KmY3vwxfr+nFDA=
golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
golang.org/x/term v0.13.0 h1:bb+I9cTfFazGW51MZqBVmZy7+JEJMouUHTUSKVQLBek=
golang.org/x/term v0.13.0/go.mod h1:LTmsnFJwVN6bCy1rVCoS+qHT1HhALEFxKncY3WNNh4U=
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
Expand Down Expand Up @@ -1287,6 +1293,7 @@ k8s.io/klog/v2 v2.10.0/go.mod h1:hy9LJ/NvuK+iVyP4Ehqva4HxZG/oXyIS3n3Jmire4Ec=
k8s.io/klog/v2 v2.60.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0=
k8s.io/klog/v2 v2.70.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0=
k8s.io/klog/v2 v2.80.1 h1:atnLQ121W371wYYFawwYx1aEY2eUfs4l3J72wtgAwV4=
k8s.io/klog/v2 v2.80.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0=
k8s.io/kube-aggregator v0.25.4/go.mod h1:PH65mLSQoUld53w0VkdYcsIGh7wjJGZ5DyfoARronz0=
k8s.io/kube-openapi v0.0.0-20210421082810-95288971da7e/go.mod h1:vHXdDvt9+2spS2Rx9ql3I8tycm3H9FDfdUoIuKCefvw=
k8s.io/kube-openapi v0.0.0-20220328201542-3ee0da9b0b42/go.mod h1:Z/45zLw8lUo4wdiUkI+v/ImEGAvu3WatcZl3lPMR4Rk=
Expand Down
2 changes: 1 addition & 1 deletion pkg/config/coerce.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func (t *typeConverter) ToInternal(data map[string]interface{}) error {
return t.mappers.ToInternal(data)
}

func (t *typeConverter) ModifySchema(schema *mapper.Schema, schemas *mapper.Schemas) error {
func (t *typeConverter) ModifySchema(schema *mapper.Schema, _ *mapper.Schemas) error {
for name, field := range schema.ResourceFields {
if field.Type == t.fieldType {
t.mappers = append(t.mappers, fieldConverter{
Expand Down
6 changes: 3 additions & 3 deletions pkg/config/cos_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,17 @@ func TestCalcCosPersistentPartSize(t *testing.T) {
{
diskSize: 300,
partitionSize: "153600Ki",
err: "Partition size must end with 'Mi' or 'Gi'. Decimals and negatives are not allowed.",
err: "Partition size must end with 'Mi' or 'Gi'. Decimals and negatives are not allowed",
},
{
diskSize: 2000,
partitionSize: "1.5Ti",
err: "Partition size must end with 'Mi' or 'Gi'. Decimals and negatives are not allowed.",
err: "Partition size must end with 'Mi' or 'Gi'. Decimals and negatives are not allowed",
},
{
diskSize: 500,
partitionSize: "abcd",
err: "Partition size must end with 'Mi' or 'Gi'. Decimals and negatives are not allowed.",
err: "Partition size must end with 'Mi' or 'Gi'. Decimals and negatives are not allowed",
},
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/config/rename.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func (f *FuzzyNames) addName(name, toName string) {
f.names[strings.ToLower(convert.ToYAMLKey(name))] = toName
}

func (f *FuzzyNames) ModifySchema(schema *mapper.Schema, schemas *mapper.Schemas) error {
func (f *FuzzyNames) ModifySchema(schema *mapper.Schema, _ *mapper.Schemas) error {
f.names = map[string]string{}

for name := range schema.ResourceFields {
Expand Down
2 changes: 1 addition & 1 deletion pkg/console/console.go
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,6 @@ func setGlobalKeyBindings(g *gocui.Gui) error {
return nil
}

func quit(g *gocui.Gui, v *gocui.View) error {
func quit(_ *gocui.Gui, _ *gocui.View) error {
return gocui.ErrQuit
}
6 changes: 3 additions & 3 deletions pkg/console/dashboard_panels.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ func logoPanel(g *gocui.Gui) error {
return nil
}

func toShell(g *gocui.Gui, v *gocui.View) error {
func toShell(g *gocui.Gui, _ *gocui.View) error {
g.Cursor = true
maxX, _ := g.Size()
adminPasswordFrameV := widgets.NewPanel(g, "adminPasswordFrame")
Expand All @@ -191,7 +191,7 @@ func toShell(g *gocui.Gui, v *gocui.View) error {
validatorV.Focus = false

adminPasswordV.KeyBindings = map[gocui.Key]func(*gocui.Gui, *gocui.View) error{
gocui.KeyEnter: func(g *gocui.Gui, v *gocui.View) error {
gocui.KeyEnter: func(_ *gocui.Gui, _ *gocui.View) error {
passwd, err := adminPasswordV.GetData()
if err != nil {
return err
Expand All @@ -205,7 +205,7 @@ func toShell(g *gocui.Gui, v *gocui.View) error {
validatorV.SetContent("Invalid credential or password hash algorithm not supported.")
return nil
},
gocui.KeyEsc: func(g *gocui.Gui, v *gocui.View) error {
gocui.KeyEsc: func(g *gocui.Gui, _ *gocui.View) error {
g.Cursor = false
if err := adminPasswordFrameV.Close(); err != nil {
return err
Expand Down
10 changes: 5 additions & 5 deletions pkg/console/helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ type passwordWrapper struct {
passwordConfirmV *widgets.Input
}

func (p *passwordWrapper) passwordVConfirmKeyBinding(g *gocui.Gui, v *gocui.View) error {
func (p *passwordWrapper) passwordVConfirmKeyBinding(_ *gocui.Gui, _ *gocui.View) error {
password1V, err := p.c.GetElement(passwordPanel)
if err != nil {
return err
Expand All @@ -28,7 +28,7 @@ func (p *passwordWrapper) passwordVConfirmKeyBinding(g *gocui.Gui, v *gocui.View
return showNext(p.c, passwordConfirmPanel)
}

func (p *passwordWrapper) passwordVEscapeKeyBinding(g *gocui.Gui, v *gocui.View) error {
func (p *passwordWrapper) passwordVEscapeKeyBinding(_ *gocui.Gui, _ *gocui.View) error {
p.passwordV.Close()
p.passwordConfirmV.Close()
if installModeOnly {
Expand All @@ -40,7 +40,7 @@ func (p *passwordWrapper) passwordVEscapeKeyBinding(g *gocui.Gui, v *gocui.View)
return showNext(p.c, tokenPanel)
}

func (p *passwordWrapper) passwordConfirmVArrowUpKeyBinding(g *gocui.Gui, v *gocui.View) error {
func (p *passwordWrapper) passwordConfirmVArrowUpKeyBinding(_ *gocui.Gui, _ *gocui.View) error {
var err error
userInputData.PasswordConfirm, err = p.passwordConfirmV.GetData()
if err != nil {
Expand All @@ -49,7 +49,7 @@ func (p *passwordWrapper) passwordConfirmVArrowUpKeyBinding(g *gocui.Gui, v *goc
return showNext(p.c, passwordPanel)
}

func (p *passwordWrapper) passwordConfirmVKeyEnter(g *gocui.Gui, v *gocui.View) error {
func (p *passwordWrapper) passwordConfirmVKeyEnter(_ *gocui.Gui, _ *gocui.View) error {
var err error
userInputData.PasswordConfirm, err = p.passwordConfirmV.GetData()
if err != nil {
Expand All @@ -72,7 +72,7 @@ func (p *passwordWrapper) passwordConfirmVKeyEnter(g *gocui.Gui, v *gocui.View)
return showNext(p.c, ntpServersPanel)
}

func (p *passwordWrapper) passwordConfirmVKeyEscape(g *gocui.Gui, v *gocui.View) error {
func (p *passwordWrapper) passwordConfirmVKeyEscape(_ *gocui.Gui, _ *gocui.View) error {
p.passwordV.Close()
p.passwordConfirmV.Close()
if err := p.c.setContentByName(notePanel, ""); err != nil {
Expand Down
Loading
Loading