Skip to content

Commit

Permalink
Merge pull request #152 from digitalocean/CON-7651/update-dependencies
Browse files Browse the repository at this point in the history
Upgrade kubernetes dependencies to 0.25.2
  • Loading branch information
elijahomolo committed Oct 13, 2022
2 parents 60d0609 + 97dc160 commit 8130492
Show file tree
Hide file tree
Showing 515 changed files with 24,213 additions and 7,032 deletions.
16 changes: 4 additions & 12 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,25 @@ version: 2
jobs:
license:
docker:
- image: golang:1.17
- image: golang:1.19
steps:
- checkout
- run: ./script/check-licenses.sh
vet:
docker:
- image: golang:1.17
- image: golang:1.19
steps:
- checkout
- run: go vet ./...
lint:
docker:
- image: golang:1.17
steps:
- checkout
- run: go get golang.org/x/lint/golint
- run: sh -c golint -set_exit_status $(go list ./...)
test:
docker:
- image: golang:1.17
- image: golang:1.19
steps:
- checkout
- run: go test -race -cover ./...
smoke-test:
docker:
- image: golang:1.17
- image: golang:1.19
steps:
- checkout
- run: go run ./cmd/clusterlint --version
Expand All @@ -37,6 +30,5 @@ workflows:
jobs:
- license
- vet
- lint
- test
- smoke-test
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- name: Install go
uses: actions/setup-go@0caeaed6fd66a828038c2da3c0f662a42862658f
with:
go-version: ^1.17
go-version: ^1.19
- name: Check out code into the Go module directory
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
- name: Login to dockerhub to push the image
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build the clusterlint binary
FROM golang:1.17 as builder
FROM golang:1.19 as builder
WORKDIR /workspace
# Copy the Go Modules manifests
COPY go.mod go.mod
Expand Down
4 changes: 2 additions & 2 deletions checks.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ We do not recommend having a `concurrencyPolicy` of `Allow` for CronJob resource

```yaml
# Not recommended: Having a concurrency policy of Allow
apiVersion: batch/v1beta1
apiVersion: batch/v1
kind: CronJob
metadata:
name: mycron
Expand All @@ -94,7 +94,7 @@ spec:

```yaml
# Recommended: Having a concurrency policy of Forbid or Replace
apiVersion: batch/v1beta1
apiVersion: batch/v1
kind: CronJob
metadata:
name: mycron
Expand Down
3 changes: 2 additions & 1 deletion checks/basic/cronjob_concurrency.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package basic

import (
"fmt"
batchv1 "k8s.io/api/batch/v1"

batchv1beta1 "k8s.io/api/batch/v1beta1"

Expand Down Expand Up @@ -54,7 +55,7 @@ func (c *cronJobConcurrencyCheck) Run(objects *kube.Objects) ([]checks.Diagnosti
var diagnostics []checks.Diagnostic

for _, cronjob := range objects.CronJobs.Items {
if batchv1beta1.AllowConcurrent == cronjob.Spec.ConcurrencyPolicy {
if batchv1.AllowConcurrent == cronjob.Spec.ConcurrencyPolicy {
d := checks.Diagnostic{
Severity: checks.Warning,
Message: fmt.Sprintf("CronJob has a concurrency policy of `%s`. Prefer to use `%s` or `%s`", cronjob.Spec.ConcurrencyPolicy, batchv1beta1.ForbidConcurrent, batchv1beta1.ReplaceConcurrent),
Expand Down
18 changes: 9 additions & 9 deletions checks/basic/cronjob_concurrency_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ limitations under the License.
package basic

import (
batchv1 "k8s.io/api/batch/v1"
"testing"

"github.com/stretchr/testify/assert"
batchv1beta1 "k8s.io/api/batch/v1beta1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

"github.com/digitalocean/clusterlint/checks"
Expand Down Expand Up @@ -50,17 +50,17 @@ func TestCronJobConcurrency(t *testing.T) {
}{
{
name: "cronjob with 'Forbid' policy",
objs: policy(batchv1beta1.ForbidConcurrent),
objs: policy(batchv1.ForbidConcurrent),
expected: nil,
},
{
name: "cronjob with 'Replace' policy",
objs: policy(batchv1beta1.ReplaceConcurrent),
objs: policy(batchv1.ReplaceConcurrent),
expected: nil,
},
{
name: "cronjob with 'Allow' policy",
objs: policy(batchv1beta1.AllowConcurrent),
objs: policy(batchv1.AllowConcurrent),
expected: []checks.Diagnostic{
{
Severity: checks.Warning,
Expand All @@ -82,20 +82,20 @@ func TestCronJobConcurrency(t *testing.T) {
}
}

func policy(policy batchv1beta1.ConcurrencyPolicy) *kube.Objects {
func policy(policy batchv1.ConcurrencyPolicy) *kube.Objects {
objs := initCronJob()
objs.CronJobs.Items[0].Spec = batchv1beta1.CronJobSpec{
objs.CronJobs.Items[0].Spec = batchv1.CronJobSpec{
ConcurrencyPolicy: policy,
}
return objs
}

func initCronJob() *kube.Objects {
objs := &kube.Objects{
CronJobs: &batchv1beta1.CronJobList{
Items: []batchv1beta1.CronJob{
CronJobs: &batchv1.CronJobList{
Items: []batchv1.CronJob{
{
TypeMeta: metav1.TypeMeta{Kind: "CronJob", APIVersion: "batch/v1beta1"},
TypeMeta: metav1.TypeMeta{Kind: "CronJob", APIVersion: "batch/v1"},
ObjectMeta: metav1.ObjectMeta{Name: "cronjob_foo"},
},
},
Expand Down
40 changes: 20 additions & 20 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/digitalocean/clusterlint

go 1.18
go 1.19

require (
github.com/docker/distribution v2.7.1+incompatible
Expand All @@ -9,30 +9,30 @@ require (
github.com/stretchr/testify v1.7.0
github.com/urfave/cli v1.19.1
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c
k8s.io/api v0.24.3
k8s.io/apimachinery v0.24.3
k8s.io/client-go v0.24.3
k8s.io/api v0.25.2
k8s.io/apimachinery v0.25.2
k8s.io/client-go v0.25.2
)

require (
cloud.google.com/go v0.81.0 // indirect
cloud.google.com/go v0.97.0 // indirect
github.com/Azure/go-autorest v14.2.0+incompatible // indirect
github.com/Azure/go-autorest/autorest v0.11.18 // indirect
github.com/Azure/go-autorest/autorest/adal v0.9.13 // indirect
github.com/Azure/go-autorest/autorest v0.11.27 // indirect
github.com/Azure/go-autorest/autorest/adal v0.9.20 // indirect
github.com/Azure/go-autorest/autorest/date v0.3.0 // indirect
github.com/Azure/go-autorest/logger v0.2.1 // indirect
github.com/Azure/go-autorest/tracing v0.6.0 // indirect
github.com/PuerkitoBio/purell v1.1.1 // indirect
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/emicklei/go-restful v2.9.5+incompatible // indirect
github.com/emicklei/go-restful/v3 v3.8.0 // indirect
github.com/evanphx/json-patch v4.12.0+incompatible // indirect
github.com/form3tech-oss/jwt-go v3.2.3+incompatible // indirect
github.com/go-logr/logr v1.2.0 // indirect
github.com/go-logr/logr v1.2.3 // indirect
github.com/go-openapi/jsonpointer v0.19.5 // indirect
github.com/go-openapi/jsonreference v0.19.5 // indirect
github.com/go-openapi/swag v0.19.14 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang-jwt/jwt/v4 v4.2.0 // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/google/gnostic v0.5.7-v3refs // indirect
github.com/google/gofuzz v1.1.0 // indirect
Expand All @@ -49,22 +49,22 @@ require (
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
golang.org/x/crypto v0.0.0-20220214200702-86341886e292 // indirect
golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd // indirect
golang.org/x/crypto v0.0.0-20220315160706-3147a52a75dd // indirect
golang.org/x/net v0.0.0-20220722155237-a158d28d115b // indirect
golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8 // indirect
golang.org/x/sys v0.0.0-20220209214540-3681064d5158 // indirect
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f // indirect
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect
golang.org/x/text v0.3.7 // indirect
golang.org/x/time v0.0.0-20220210224613-90d013bbcef8 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/protobuf v1.27.1 // indirect
google.golang.org/protobuf v1.28.0 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
k8s.io/klog/v2 v2.60.1 // indirect
k8s.io/kube-openapi v0.0.0-20220328201542-3ee0da9b0b42 // indirect
k8s.io/utils v0.0.0-20220210201930-3a6ce19ff2f9 // indirect
sigs.k8s.io/json v0.0.0-20211208200746-9f7c6b3444d2 // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.2.1 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/klog/v2 v2.70.1 // indirect
k8s.io/kube-openapi v0.0.0-20220803162953-67bda5d908f1 // indirect
k8s.io/utils v0.0.0-20220728103510-ee6ede2d64ed // indirect
sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2 // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect
sigs.k8s.io/yaml v1.2.0 // indirect
)
Loading

0 comments on commit 8130492

Please sign in to comment.