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

Use Go 1.22 #38

Merged
merged 1 commit into from
Apr 10, 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
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ jobs:
name: Build
runs-on: ubuntu-20.04
steps:
- name: Set up Go 1.21
- name: Set up Go 1.22
uses: actions/setup-go@v1
with:
go-version: '1.21'
go-version: '1.22'
id: go

- uses: actions/checkout@v2
Expand Down
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ OS := $(if $(GOOS),$(GOOS),$(shell go env GOOS))
ARCH := $(if $(GOARCH),$(GOARCH),$(shell go env GOARCH))

BASEIMAGE_PROD ?= gcr.io/distroless/static-debian12
BASEIMAGE_DBG ?= debian:bullseye
BASEIMAGE_DBG ?= debian:bookworm

GO_VERSION ?= 1.21
GO_VERSION ?= 1.22
BUILD_IMAGE ?= ghcr.io/appscode/golang-dev:$(GO_VERSION)

OUTBIN = bin/$(OS)_$(ARCH)/$(BIN)
Expand Down Expand Up @@ -169,7 +169,7 @@ test: $(BUILD_DIRS)
./hack/test.sh $(SRC_DIRS) \
"

ADDTL_LINTERS := goconst,gofmt,goimports,unparam
ADDTL_LINTERS := gofmt,goimports,unparam

.PHONY: lint
lint: $(BUILD_DIRS)
Expand Down
4 changes: 2 additions & 2 deletions acme/v1/challenge.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ func PatchChallengeObject(ctx context.Context, c cs.AcmeV1Interface, cur, mod *a

func TryUpdateChallenge(ctx context.Context, c cs.AcmeV1Interface, meta metav1.ObjectMeta, transform func(*api.Challenge) *api.Challenge, opts metav1.UpdateOptions) (result *api.Challenge, err error) {
attempt := 0
err = wait.PollImmediate(kutil.RetryInterval, kutil.RetryTimeout, func() (bool, error) {
err = wait.PollUntilContextTimeout(ctx, kutil.RetryInterval, kutil.RetryTimeout, true, func(ctx context.Context) (bool, error) {
attempt++
cur, e2 := c.Challenges(meta.Namespace).Get(ctx, meta.Name, metav1.GetOptions{})
if kerr.IsNotFound(e2) {
Expand Down Expand Up @@ -123,7 +123,7 @@ func UpdateChallengeStatus(
if err != nil {
return nil, err
}
err = wait.PollImmediate(kutil.RetryInterval, kutil.RetryTimeout, func() (bool, error) {
err = wait.PollUntilContextTimeout(ctx, kutil.RetryInterval, kutil.RetryTimeout, true, func(ctx context.Context) (bool, error) {
attempt++
var e2 error
result, e2 = c.Challenges(meta.Namespace).UpdateStatus(ctx, apply(cur), opts)
Expand Down
2 changes: 1 addition & 1 deletion acme/v1/order.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@

func TryUpdateOrder(ctx context.Context, c cs.AcmeV1Interface, meta metav1.ObjectMeta, transform func(*api.Order) *api.Order, opts metav1.UpdateOptions) (result *api.Order, err error) {
attempt := 0
err = wait.PollImmediate(kutil.RetryInterval, kutil.RetryTimeout, func() (bool, error) {
err = wait.PollUntilContextTimeout(ctx, kutil.RetryInterval, kutil.RetryTimeout, true, func(ctx context.Context) (bool, error) {
attempt++
cur, e2 := c.Orders(meta.Namespace).Get(ctx, meta.Name, metav1.GetOptions{})
if kerr.IsNotFound(e2) {
Expand Down Expand Up @@ -123,7 +123,7 @@
if err != nil {
return nil, err
}
err = wait.PollImmediate(kutil.RetryInterval, kutil.RetryTimeout, func() (bool, error) {

Check failure on line 126 in acme/v1/order.go

View workflow job for this annotation

GitHub Actions / Build

SA1019: wait.PollImmediate is deprecated: This method does not return errors from context, use PollUntilContextTimeout. Note that the new method will no longer return ErrWaitTimeout and instead return errors defined by the context package. Will be removed in a future release. (staticcheck)
attempt++
var e2 error
result, e2 = c.Orders(meta.Namespace).UpdateStatus(ctx, apply(cur), opts)
Expand Down
2 changes: 1 addition & 1 deletion certmanager/v1/certificate.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@

func TryUpdateCertificate(ctx context.Context, c cs.CertmanagerV1Interface, meta metav1.ObjectMeta, transform func(*api.Certificate) *api.Certificate, opts metav1.UpdateOptions) (result *api.Certificate, err error) {
attempt := 0
err = wait.PollImmediate(kutil.RetryInterval, kutil.RetryTimeout, func() (bool, error) {
err = wait.PollUntilContextTimeout(ctx, kutil.RetryInterval, kutil.RetryTimeout, true, func(ctx context.Context) (bool, error) {
attempt++
cur, e2 := c.Certificates(meta.Namespace).Get(ctx, meta.Name, metav1.GetOptions{})
if kerr.IsNotFound(e2) {
Expand Down Expand Up @@ -123,7 +123,7 @@
if err != nil {
return nil, err
}
err = wait.PollImmediate(kutil.RetryInterval, kutil.RetryTimeout, func() (bool, error) {

Check failure on line 126 in certmanager/v1/certificate.go

View workflow job for this annotation

GitHub Actions / Build

SA1019: wait.PollImmediate is deprecated: This method does not return errors from context, use PollUntilContextTimeout. Note that the new method will no longer return ErrWaitTimeout and instead return errors defined by the context package. Will be removed in a future release. (staticcheck)
attempt++
var e2 error
result, e2 = c.Certificates(meta.Namespace).UpdateStatus(ctx, apply(cur), opts)
Expand Down
2 changes: 1 addition & 1 deletion certmanager/v1/certificaterequest.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@

func TryUpdateCertificateRequest(ctx context.Context, c cs.CertmanagerV1Interface, meta metav1.ObjectMeta, transform func(*api.CertificateRequest) *api.CertificateRequest, opts metav1.UpdateOptions) (result *api.CertificateRequest, err error) {
attempt := 0
err = wait.PollImmediate(kutil.RetryInterval, kutil.RetryTimeout, func() (bool, error) {
err = wait.PollUntilContextTimeout(ctx, kutil.RetryInterval, kutil.RetryTimeout, true, func(ctx context.Context) (bool, error) {
attempt++
cur, e2 := c.CertificateRequests(meta.Namespace).Get(ctx, meta.Name, metav1.GetOptions{})
if kerr.IsNotFound(e2) {
Expand Down Expand Up @@ -123,7 +123,7 @@
if err != nil {
return nil, err
}
err = wait.PollImmediate(kutil.RetryInterval, kutil.RetryTimeout, func() (bool, error) {

Check failure on line 126 in certmanager/v1/certificaterequest.go

View workflow job for this annotation

GitHub Actions / Build

SA1019: wait.PollImmediate is deprecated: This method does not return errors from context, use PollUntilContextTimeout. Note that the new method will no longer return ErrWaitTimeout and instead return errors defined by the context package. Will be removed in a future release. (staticcheck)
attempt++
var e2 error
result, e2 = c.CertificateRequests(meta.Namespace).UpdateStatus(ctx, apply(cur), opts)
Expand Down
2 changes: 1 addition & 1 deletion certmanager/v1/clusterissuer.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ func PatchClusterIssuerObject(ctx context.Context, c cs.CertmanagerV1Interface,

func TryUpdateClusterIssuer(ctx context.Context, c cs.CertmanagerV1Interface, meta metav1.ObjectMeta, transform func(*api.ClusterIssuer) *api.ClusterIssuer, opts metav1.UpdateOptions) (result *api.ClusterIssuer, err error) {
attempt := 0
err = wait.PollImmediate(kutil.RetryInterval, kutil.RetryTimeout, func() (bool, error) {
err = wait.PollUntilContextTimeout(ctx, kutil.RetryInterval, kutil.RetryTimeout, true, func(ctx context.Context) (bool, error) {
attempt++
cur, e2 := c.ClusterIssuers().Get(ctx, meta.Name, metav1.GetOptions{})
if kerr.IsNotFound(e2) {
Expand Down
4 changes: 2 additions & 2 deletions certmanager/v1/issuer.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ func PatchIssuerObject(ctx context.Context, c cs.CertmanagerV1Interface, cur, mo

func TryUpdateIssuer(ctx context.Context, c cs.CertmanagerV1Interface, meta metav1.ObjectMeta, transform func(*api.Issuer) *api.Issuer, opts metav1.UpdateOptions) (result *api.Issuer, err error) {
attempt := 0
err = wait.PollImmediate(kutil.RetryInterval, kutil.RetryTimeout, func() (bool, error) {
err = wait.PollUntilContextTimeout(ctx, kutil.RetryInterval, kutil.RetryTimeout, true, func(ctx context.Context) (bool, error) {
attempt++
cur, e2 := c.Issuers(meta.Namespace).Get(ctx, meta.Name, metav1.GetOptions{})
if kerr.IsNotFound(e2) {
Expand Down Expand Up @@ -123,7 +123,7 @@ func UpdateIssuerStatus(
if err != nil {
return nil, err
}
err = wait.PollImmediate(kutil.RetryInterval, kutil.RetryTimeout, func() (bool, error) {
err = wait.PollUntilContextTimeout(ctx, kutil.RetryInterval, kutil.RetryTimeout, true, func(ctx context.Context) (bool, error) {
attempt++
var e2 error
result, e2 = c.Issuers(meta.Namespace).UpdateStatus(ctx, apply(cur), opts)
Expand Down
46 changes: 25 additions & 21 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,51 +1,55 @@
module kmodules.xyz/cert-manager-util

go 1.21.5
go 1.22.0

toolchain go1.22.2

require (
github.com/cert-manager/cert-manager v1.13.3
github.com/evanphx/json-patch v5.7.0+incompatible
github.com/pkg/errors v0.9.1
k8s.io/apimachinery v0.29.0
k8s.io/client-go v0.29.0
k8s.io/klog/v2 v2.110.1
kmodules.xyz/client-go v0.29.2
k8s.io/apimachinery v0.29.2
k8s.io/client-go v0.29.2
k8s.io/klog/v2 v2.120.1
kmodules.xyz/client-go v0.29.13
)

require github.com/google/pprof v0.0.0-20221118152302-e6195bd50e26 // indirect

require (
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/emicklei/go-restful/v3 v3.11.0 // indirect
github.com/go-logr/logr v1.3.0 // indirect
github.com/go-openapi/jsonpointer v0.19.6 // indirect
github.com/go-logr/logr v1.4.1 // indirect
github.com/go-openapi/jsonpointer v0.20.0 // indirect
github.com/go-openapi/jsonreference v0.20.2 // indirect
github.com/go-openapi/swag v0.22.3 // indirect
github.com/go-openapi/swag v0.22.4 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/google/gnostic-models v0.6.8 // indirect
github.com/google/go-cmp v0.6.0 // indirect
github.com/google/gofuzz v1.2.0 // indirect
github.com/google/uuid v1.3.1 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
golang.org/x/net v0.17.0 // indirect
golang.org/x/oauth2 v0.12.0 // indirect
golang.org/x/sys v0.15.0 // indirect
golang.org/x/term v0.15.0 // indirect
golang.org/x/net v0.23.0 // indirect
golang.org/x/oauth2 v0.15.0 // indirect
golang.org/x/sys v0.18.0 // indirect
golang.org/x/term v0.18.0 // indirect
golang.org/x/text v0.14.0 // indirect
golang.org/x/time v0.3.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/protobuf v1.31.0 // indirect
golang.org/x/time v0.5.0 // indirect
google.golang.org/appengine v1.6.8 // indirect
google.golang.org/protobuf v1.33.0 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/api v0.29.0 // indirect
k8s.io/apiextensions-apiserver v0.29.0 // indirect
k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00 // indirect
k8s.io/utils v0.0.0-20230726121419-3b25d923346b // indirect
k8s.io/api v0.29.2 // indirect
k8s.io/apiextensions-apiserver v0.29.2 // indirect
k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 // indirect
k8s.io/utils v0.0.0-20240102154912-e7106e64919e // indirect
sigs.k8s.io/gateway-api v0.8.0 // indirect
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect
Expand Down
Loading
Loading