Skip to content

Commit

Permalink
chore: upgrade kubernetes packages to 0.26.0 (#8)
Browse files Browse the repository at this point in the history
* chore: upgrade kubernetes packages to 0.26.0

* add e2e test

* add e2e test

* update e2e test

* serialize the ci jobs
  • Loading branch information
shipengqi authored Feb 7, 2023
1 parent 8d4ff51 commit 47b37fd
Show file tree
Hide file tree
Showing 4 changed files with 127 additions and 237 deletions.
43 changes: 35 additions & 8 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ on:
branches: [ main ]

jobs:

build:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
Expand Down Expand Up @@ -41,9 +40,37 @@ jobs:
# Optional: if set to true then the action don't cache or restore ~/.cache/go-build.
# skip-build-cache: true

- name: codecov
uses: codecov/codecov-action@v2
with:
flags: unittests
fail_ci_if_error: true
files: coverage.out
# Run E2E test against all kubernetes versions on kind
e2e-test:
runs-on: ubuntu-latest
needs: lint
strategy:
matrix:
k8s:
- 1.24.0
- 1.25.0
- 1.26.0
fail-fast: false
steps:
- name: Check out the code
uses: actions/checkout@v3
- name: Create k8s Kind Cluster
uses: helm/[email protected]
- name: Run E2E test
run: |
go test -v -coverprofile=coverage.out .
codecov:
runs-on: ubuntu-latest
needs: e2e-test
steps:
- uses: actions/checkout@v2
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.17
- name: codecov
uses: codecov/codecov-action@v2
with:
flags: unittests
fail_ci_if_error: true
files: coverage.out
12 changes: 5 additions & 7 deletions client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,10 @@ func TestMain(m *testing.M) {
flag.StringVar(&namespace, "namespace", "default", "namespace for exec")
flag.Parse()

if len(kubeconfig) > 0 {
flags := genericclioptions.NewConfigFlags(false)
flags.KubeConfig = &kubeconfig
cfg := NewConfig(flags)
mockcli = New(cfg)
flags := genericclioptions.NewConfigFlags(false)
flags.KubeConfig = &kubeconfig
cfg := NewConfig(flags)
mockcli = New(cfg)

os.Exit(m.Run())
}
os.Exit(m.Run())
}
43 changes: 21 additions & 22 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,35 +3,34 @@ module github.com/shipengqi/kube
go 1.17

require (
github.com/stretchr/testify v1.8.0
k8s.io/api v0.25.0
k8s.io/apimachinery v0.25.0
k8s.io/cli-runtime v0.25.0
k8s.io/client-go v0.25.0
k8s.io/metrics v0.25.0
github.com/stretchr/testify v1.8.1
k8s.io/api v0.26.0
k8s.io/apimachinery v0.26.0
k8s.io/cli-runtime v0.26.0
k8s.io/client-go v0.26.0
k8s.io/metrics v0.26.0
)

require (
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/v3 v3.8.0 // indirect
github.com/emicklei/go-restful/v3 v3.9.0 // indirect
github.com/evanphx/json-patch v4.12.0+incompatible // indirect
github.com/go-errors/errors v1.0.1 // 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/jsonreference v0.20.0 // indirect
github.com/go-openapi/swag v0.19.14 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/google/btree v1.0.1 // indirect
github.com/google/gnostic v0.5.7-v3refs // indirect
github.com/google/go-cmp v0.5.9 // indirect
github.com/google/gofuzz v1.1.0 // indirect
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect
github.com/google/uuid v1.1.2 // indirect
github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7 // indirect
github.com/imdario/mergo v0.3.6 // indirect
github.com/inconshreveable/mousetrap v1.0.0 // indirect
github.com/inconshreveable/mousetrap v1.0.1 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de // indirect
Expand All @@ -44,27 +43,27 @@ require (
github.com/peterbourgon/diskv v2.0.1+incompatible // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/spf13/cobra v1.4.0 // indirect
github.com/spf13/cobra v1.6.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/xlab/treeprint v1.1.0 // indirect
go.starlark.net v0.0.0-20200306205701-8dd3e2ee1dd5 // 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-20220722155257-8c9f86f7a55f // indirect
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect
golang.org/x/text v0.3.7 // indirect
golang.org/x/net v0.3.1-0.20221206200815-1e63c2f08a10 // indirect
golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b // indirect
golang.org/x/sys v0.3.0 // indirect
golang.org/x/term v0.3.0 // indirect
golang.org/x/text v0.5.0 // indirect
golang.org/x/time v0.0.0-20220210224613-90d013bbcef8 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/protobuf v1.28.0 // indirect
google.golang.org/protobuf v1.28.1 // 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/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
k8s.io/klog/v2 v2.80.1 // indirect
k8s.io/kube-openapi v0.0.0-20221012153701-172d655c2280 // indirect
k8s.io/utils v0.0.0-20221107191617-1a15be271d1d // indirect
sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2 // indirect
sigs.k8s.io/kustomize/api v0.12.1 // indirect
sigs.k8s.io/kustomize/kyaml v0.13.9 // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect
sigs.k8s.io/yaml v1.2.0 // indirect
sigs.k8s.io/yaml v1.3.0 // indirect
)
Loading

0 comments on commit 47b37fd

Please sign in to comment.