From 49a0c0b617b85ffeac5f5ca14fa044cf59537db3 Mon Sep 17 00:00:00 2001 From: Tamal Saha Date: Sat, 6 Jan 2024 03:09:59 -0800 Subject: [PATCH] Update deps (#77) Signed-off-by: Tamal Saha --- go.mod | 4 ++-- go.sum | 8 ++++---- .../client-go/apiextensions/kubernetes.go | 20 +++++++++++++++++++ vendor/modules.txt | 4 ++-- 4 files changed, 28 insertions(+), 8 deletions(-) diff --git a/go.mod b/go.mod index 4e68ae559..f3d3a98b3 100644 --- a/go.mod +++ b/go.mod @@ -17,8 +17,8 @@ require ( go.mongodb.org/mongo-driver v1.10.2 k8s.io/api v0.29.0 k8s.io/klog/v2 v2.110.1 - kmodules.xyz/client-go v0.29.5 - kubedb.dev/apimachinery v0.40.1-0.20240104031132-a1d475ceb73e + kmodules.xyz/client-go v0.29.6-0.20240106073345-92f92b4d6985 + kubedb.dev/apimachinery v0.40.1-0.20240106103518-87c402a1ae51 sigs.k8s.io/controller-runtime v0.16.3 xorm.io/xorm v1.3.2 ) diff --git a/go.sum b/go.sum index 0a45fa8ee..ffd60aad9 100644 --- a/go.sum +++ b/go.sum @@ -782,16 +782,16 @@ k8s.io/utils v0.0.0-20231127182322-b307cd553661 h1:FepOBzJ0GXm8t0su67ln2wAZjbQ6R k8s.io/utils v0.0.0-20231127182322-b307cd553661/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= kmodules.xyz/apiversion v0.2.0 h1:vAQYqZFm4xu4pbB1cAdHbFEPES6EQkcR4wc06xdTOWk= kmodules.xyz/apiversion v0.2.0/go.mod h1:oPX8g8LvlPdPX3Yc5YvCzJHQnw3YF/X4/jdW0b1am80= -kmodules.xyz/client-go v0.29.5 h1:iRl4MoV+96TM1csInOCWjn5xSOXzuYlil6CO40vXLHU= -kmodules.xyz/client-go v0.29.5/go.mod h1:pHuzpwzEcDUIGjVVvwz9N8lY+6A7HXwvs2d7NtK7Hho= +kmodules.xyz/client-go v0.29.6-0.20240106073345-92f92b4d6985 h1:TrYD40aWXVm+8KkFoQ+FSw5rr6DN2EwjYX9MCzy5y3c= +kmodules.xyz/client-go v0.29.6-0.20240106073345-92f92b4d6985/go.mod h1:pHuzpwzEcDUIGjVVvwz9N8lY+6A7HXwvs2d7NtK7Hho= kmodules.xyz/custom-resources v0.29.0 h1:RaDM2+wSVXiwIvLqmkTVYpwoH83AC8wruXe2p2rOZNY= kmodules.xyz/custom-resources v0.29.0/go.mod h1:MzZyXtxdg1PDxGk3RTTO1Xv3KiVqZnIonSwmxVbagOY= kmodules.xyz/monitoring-agent-api v0.29.0 h1:gpFl6OZrlMLb/ySMHdREI9EwGtnJ91oZBn9H1UFRwB4= kmodules.xyz/monitoring-agent-api v0.29.0/go.mod h1:iNbvaMTgVFOI5q2LJtGK91j4Dmjv4ZRiRdasGmWLKQI= kmodules.xyz/offshoot-api v0.29.0 h1:GHLhxxT9jU1N8+FvOCCeJNyU5g0duYS46UGrs6AHNLY= kmodules.xyz/offshoot-api v0.29.0/go.mod h1:5NxhBblXoDHWStx9HCDJR2KFTwYjEZ7i1Id3jelIunw= -kubedb.dev/apimachinery v0.40.1-0.20240104031132-a1d475ceb73e h1:W4P/V/i6PkCL6ODaG7M2669AhhnRv8PYhvOFHTrVeWg= -kubedb.dev/apimachinery v0.40.1-0.20240104031132-a1d475ceb73e/go.mod h1:pa3rY23DEC7j4c0H2uIe6uG7YUbNnT1qA3p7UBr3pwQ= +kubedb.dev/apimachinery v0.40.1-0.20240106103518-87c402a1ae51 h1:6RgHui7DPEXOSGIAWY9N3gytdbQHH1Yry2hwKSQdDsc= +kubedb.dev/apimachinery v0.40.1-0.20240106103518-87c402a1ae51/go.mod h1:pa3rY23DEC7j4c0H2uIe6uG7YUbNnT1qA3p7UBr3pwQ= lukechampine.com/uint128 v1.1.1/go.mod h1:c4eWIwlEGaxC/+H1VguhU4PHXNWDCDMUlWdIWl2j1gk= lukechampine.com/uint128 v1.2.0 h1:mBi/5l91vocEN8otkC5bDLhi2KdCticRiwbdB0O+rjI= lukechampine.com/uint128 v1.2.0/go.mod h1:c4eWIwlEGaxC/+H1VguhU4PHXNWDCDMUlWdIWl2j1gk= diff --git a/vendor/kmodules.xyz/client-go/apiextensions/kubernetes.go b/vendor/kmodules.xyz/client-go/apiextensions/kubernetes.go index cab174972..63052359d 100644 --- a/vendor/kmodules.xyz/client-go/apiextensions/kubernetes.go +++ b/vendor/kmodules.xyz/client-go/apiextensions/kubernetes.go @@ -109,3 +109,23 @@ func WaitForCRDReady(client crd_cs.Interface, crds []*CustomResourceDefinition) }) return errors.Wrap(err, "timed out waiting for CRD") } + +func RemoveCRDs(client crd_cs.Interface, crds []*CustomResourceDefinition) error { + for _, crd := range crds { + // Use crd v1 for k8s >= 1.16, if available + // ref: https://github.com/kubernetes/kubernetes/issues/91395 + if crd.V1 == nil { + gvr := schema.GroupVersionResource{ + Group: crd.V1beta1.Spec.Group, + Version: crd.V1beta1.Spec.Versions[0].Name, + Resource: crd.V1beta1.Spec.Names.Plural, + } + return fmt.Errorf("missing V1 definition for %s", gvr) + } + err := client.ApiextensionsV1().CustomResourceDefinitions().Delete(context.TODO(), crd.V1.Name, metav1.DeleteOptions{}) + if err != nil && !kerr.IsNotFound(err) { + return err + } + } + return nil +} diff --git a/vendor/modules.txt b/vendor/modules.txt index 1a1e20936..7dd68ed07 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -1294,7 +1294,7 @@ k8s.io/utils/trace # kmodules.xyz/apiversion v0.2.0 ## explicit; go 1.14 kmodules.xyz/apiversion -# kmodules.xyz/client-go v0.29.5 +# kmodules.xyz/client-go v0.29.6-0.20240106073345-92f92b4d6985 ## explicit; go 1.21.5 kmodules.xyz/client-go kmodules.xyz/client-go/api/v1 @@ -1317,7 +1317,7 @@ kmodules.xyz/monitoring-agent-api/api/v1 # kmodules.xyz/offshoot-api v0.29.0 ## explicit; go 1.21.5 kmodules.xyz/offshoot-api/api/v1 -# kubedb.dev/apimachinery v0.40.1-0.20240104031132-a1d475ceb73e +# kubedb.dev/apimachinery v0.40.1-0.20240106103518-87c402a1ae51 ## explicit; go 1.21.5 kubedb.dev/apimachinery/apis kubedb.dev/apimachinery/apis/catalog