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

Update to Kubernetes 1.19, remove k8s.io/kubernetes dependency, unpin gnostic #292

Merged
merged 4 commits into from
Mar 9, 2021
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just noticed that this reverted go-jsonnet back to 0.15 after we released kubecfg 0.17.0 which had go-jsonnet 0.17.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/discovery@v0.17 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