Skip to content
This repository has been archived by the owner on Nov 17, 2021. It is now read-only.

Commit

Permalink
Merge pull request #292 from q3k/q3k/update-kube-1.19
Browse files Browse the repository at this point in the history
Update to Kubernetes 1.19, remove k8s.io/kubernetes dependency, unpin gnostic
  • Loading branch information
mkmik authored Mar 9, 2021
2 parents 1c66c52 + 6a687a1 commit 53f6639
Show file tree
Hide file tree
Showing 816 changed files with 128,769 additions and 79,544 deletions.
2 changes: 1 addition & 1 deletion cmd/delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,6 @@ var deleteCmd = &cobra.Command{
return err
}

return c.Run(objs)
return c.Run(cmd.Context(), objs)
},
}
2 changes: 1 addition & 1 deletion cmd/diff.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,6 @@ var diffCmd = &cobra.Command{
return err
}

return c.Run(objs, cmd.OutOrStdout())
return c.Run(cmd.Context(), objs, cmd.OutOrStdout())
},
}
2 changes: 1 addition & 1 deletion cmd/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,6 @@ var updateCmd = &cobra.Command{
}
}

return c.Run(objs)
return c.Run(cmd.Context(), objs)
},
}
51 changes: 15 additions & 36 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,56 +3,35 @@ module github.com/bitnami/kubecfg
require (
github.com/Azure/go-autorest/autorest v0.10.0 // indirect
github.com/elazarl/go-bindata-assetfs v1.0.1-0.20180223160309-38087fe4dafb
github.com/evanphx/json-patch v4.5.0+incompatible
github.com/evanphx/json-patch v4.9.0+incompatible
github.com/genuinetools/reg v0.16.1
github.com/ghodss/yaml v1.0.0
github.com/go-openapi/spec v0.19.7 // indirect
github.com/go-openapi/swag v0.19.8 // indirect
github.com/gogo/protobuf v1.3.1 // indirect
github.com/golang/protobuf v1.3.5
github.com/google/go-cmp v0.4.0 // indirect
github.com/google/go-jsonnet v0.17.0
github.com/google/gofuzz v1.1.0 // indirect
github.com/googleapis/gnostic v0.4.0
github.com/golang/protobuf v1.4.3
github.com/google/go-jsonnet v0.15.0
github.com/googleapis/gnostic v0.5.3
github.com/imdario/mergo v0.3.9 // indirect
github.com/json-iterator/go v1.1.9 // indirect
github.com/konsorten/go-windows-terminal-sequences v1.0.2 // indirect
github.com/kr/pretty v0.2.0 // indirect
github.com/mailru/easyjson v0.7.1 // indirect
github.com/mattn/go-isatty v0.0.11
github.com/onsi/ginkgo v1.11.0
github.com/onsi/gomega v1.7.0
github.com/pkg/errors v0.9.1 // indirect
github.com/sergi/go-diff v1.1.0
github.com/sirupsen/logrus v1.4.2
github.com/spf13/cobra v0.0.7
github.com/sergi/go-diff v1.0.0
github.com/sirupsen/logrus v1.6.0
github.com/spf13/cobra v1.0.0
github.com/spf13/pflag v1.0.5
github.com/stretchr/testify v1.4.0
golang.org/x/crypto v0.0.0-20200406173513-056763e48d71
golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e // indirect
github.com/stretchr/testify v1.5.1
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9
golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d // indirect
golang.org/x/sys v0.0.0-20200409092240-59c9f1ba88fa // indirect
golang.org/x/time v0.0.0-20191024005414-555d28b269f0 // indirect
google.golang.org/appengine v1.6.5 // indirect
google.golang.org/genproto v0.0.0-20200409111301-baae70f3302d // indirect
google.golang.org/grpc v1.28.1 // indirect
gopkg.in/yaml.v2 v2.2.8
k8s.io/api v0.17.4
k8s.io/apiextensions-apiserver v0.17.4
k8s.io/apimachinery v0.17.4
k8s.io/client-go v0.17.4
k8s.io/api v0.19.3
k8s.io/apiextensions-apiserver v0.19.3
k8s.io/apimachinery v0.19.3
k8s.io/client-go v0.19.3
k8s.io/klog v1.0.0
k8s.io/kube-openapi v0.0.0-20191107075043-30be4d16710a
k8s.io/kubernetes v1.13.4
k8s.io/utils v0.0.0-20200327001022-6496210b90e8 // indirect
sigs.k8s.io/yaml v1.2.0 // indirect
k8s.io/kube-openapi v0.0.0-20200923155610-8b5066479488
k8s.io/kubectl v0.19.3
)

// NB: pinning gnostic to v0.4.0 as v0.4.1 renamed s/OpenAPIv2/openapiv2/ at
// https://github.com/googleapis/gnostic/pull/155,
// while k8s.io/client-go/[email protected] still uses OpenAPIv2,
// even as of 2020/04/09 there's no released k8s.io/client-go/discovery version
// (latest 0.18.1) fixed to use openapiv2
replace github.com/googleapis/gnostic => github.com/googleapis/gnostic v0.4.0

go 1.13
363 changes: 208 additions & 155 deletions go.sum

Large diffs are not rendered by default.

10 changes: 6 additions & 4 deletions integration/delete_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
package integration

import (
"k8s.io/api/core/v1"
"context"

v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
corev1 "k8s.io/client-go/kubernetes/typed/core/v1"
Expand Down Expand Up @@ -50,7 +52,7 @@ var _ = Describe("delete", func() {

Context("With no existing state", func() {
It("should succeed", func() {
Expect(c.ConfigMaps(ns).List(metav1.ListOptions{})).
Expect(c.ConfigMaps(ns).List(context.Background(), metav1.ListOptions{})).
To(WithTransform(objNames, BeEmpty()))
})
})
Expand All @@ -68,14 +70,14 @@ var _ = Describe("delete", func() {
toCreate = append(toCreate, baz)

for _, cm := range toCreate {
_, err := c.ConfigMaps(ns).Create(cm)
_, err := c.ConfigMaps(ns).Create(context.Background(), cm, metav1.CreateOptions{})
Expect(err).To(Not(HaveOccurred()))
}
})

It("should delete mentioned objects", func() {
Eventually(func() (*v1.ConfigMapList, error) {
return c.ConfigMaps(ns).List(metav1.ListOptions{})
return c.ConfigMaps(ns).List(context.Background(), metav1.ListOptions{})
}).Should(WithTransform(objNames, ConsistOf("baz")))
})
})
Expand Down
9 changes: 6 additions & 3 deletions integration/integration_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
package integration

import (
"context"
"flag"
"fmt"
"io"
Expand All @@ -12,7 +13,7 @@ import (
"path/filepath"
"testing"

"k8s.io/api/core/v1"
v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"k8s.io/apimachinery/pkg/runtime"
Expand Down Expand Up @@ -49,11 +50,13 @@ func clusterConfigOrDie() *rest.Config {

func createNsOrDie(c corev1.CoreV1Interface, ns string) string {
result, err := c.Namespaces().Create(
context.Background(),
&v1.Namespace{
ObjectMeta: metav1.ObjectMeta{
GenerateName: ns,
},
})
},
metav1.CreateOptions{})
if err != nil {
panic(err.Error())
}
Expand All @@ -63,7 +66,7 @@ func createNsOrDie(c corev1.CoreV1Interface, ns string) string {
}

func deleteNsOrDie(c corev1.CoreV1Interface, ns string) {
err := c.Namespaces().Delete(ns, &metav1.DeleteOptions{})
err := c.Namespaces().Delete(context.Background(), ns, metav1.DeleteOptions{})
if err != nil {
panic(err.Error())
}
Expand Down
7 changes: 4 additions & 3 deletions integration/kubeflags_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@
package integration

import (
"context"
"io/ioutil"
"os"
"os/exec"

"k8s.io/api/core/v1"
v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
corev1 "k8s.io/client-go/kubernetes/typed/core/v1"
Expand Down Expand Up @@ -93,7 +94,7 @@ var _ = Describe("flags", func() {

It("should update correct namespace", func() {
Expect(kubecfgExit).NotTo(HaveOccurred())
Expect(c.ConfigMaps(ns).Get(testName, metav1.GetOptions{})).
Expect(c.ConfigMaps(ns).Get(context.Background(), testName, metav1.GetOptions{})).
NotTo(BeNil())
})
})
Expand All @@ -108,7 +109,7 @@ var _ = Describe("flags", func() {

It("should update correct namespace", func() {
Expect(kubecfgExit).NotTo(HaveOccurred())
Expect(c.ConfigMaps(ns).Get(testName, metav1.GetOptions{})).
Expect(c.ConfigMaps(ns).Get(context.Background(), testName, metav1.GetOptions{})).
NotTo(BeNil())
})
})
Expand Down
Loading

0 comments on commit 53f6639

Please sign in to comment.