From e1e120a7b83ad611a6913e84e4025fbb4ccaddb2 Mon Sep 17 00:00:00 2001 From: Scott Andrews Date: Wed, 27 Mar 2024 10:48:18 -0400 Subject: [PATCH] Migrate to reconciler.io/dies This is only a package rename, there are no other changes. Signed-off-by: Scott Andrews --- README.md | 4 ++-- go.mod | 4 +--- go.sum | 4 ++-- hack/go.mod | 4 +--- hack/go.sum | 4 ++-- hack/tools.go | 2 +- hack/update-codegen.sh | 2 +- internal/resources/dies/dies.go | 4 ++-- internal/resources/dies/zz_generated.die.go | 2 +- internal/resources/dies/zz_generated.die_test.go | 2 +- reconcilers/aggregate_test.go | 4 ++-- reconcilers/cast_test.go | 4 ++-- reconcilers/child_test.go | 4 ++-- reconcilers/childset_test.go | 4 ++-- reconcilers/config_test.go | 4 ++-- reconcilers/finalizer_test.go | 2 +- reconcilers/flow_test.go | 2 +- reconcilers/resource_test.go | 2 +- reconcilers/sequence_test.go | 2 +- reconcilers/sync_test.go | 2 +- reconcilers/webhook_test.go | 4 ++-- testing/config_test.go | 2 +- 22 files changed, 32 insertions(+), 36 deletions(-) diff --git a/README.md b/README.md index 5d0a04a..2ae62e3 100644 --- a/README.md +++ b/README.md @@ -680,7 +680,7 @@ While `controller-runtime` focuses its testing efforts on integration testing by The table test pattern is used to declare each test case in a test suite with the resource being reconciled, other given resources in the cluster, and all expected resource mutations (create, update, delete). -The tests make extensive use of given and mutated resources. It is recommended to use a library like [dies](https://dies.dev) to reduce boilerplate code and to highlight the delta unique to each test. +The tests make extensive use of given and mutated resources. It is recommended to use a library like [dies](https://reconciler.io/dies) to reduce boilerplate code and to highlight the delta unique to each test. There are three test suites: for [testing reconcilers](#reconcilertests), an optimized harness for [testing sub reconcilers](#subreconcilertests), and for [testing admission webhooks](#admissionwebhooktests). @@ -721,7 +721,7 @@ rts := rtesting.ReconcilerTests{ gatewayCreate, }, ExpectStatusUpdates: []client.Object{ - // example using an https://dies.dev style die to mutate the resource + // example using an https://reconciler.io/dies style die to mutate the resource inMemoryGateway. StatusDie(func(d *diestreamingv1alpha1.InMemoryGatewayStatusDie) { d.ObservedGeneration(1) diff --git a/go.mod b/go.mod index 4544c1f..a9e1521 100644 --- a/go.mod +++ b/go.mod @@ -2,10 +2,7 @@ module reconciler.io/runtime go 1.21 -toolchain go1.21.6 - require ( - dies.dev v0.10.1 github.com/evanphx/json-patch/v5 v5.9.0 github.com/fatih/color v1.16.0 github.com/go-logr/logr v1.4.1 @@ -17,6 +14,7 @@ require ( k8s.io/apimachinery v0.29.3 k8s.io/client-go v0.29.3 k8s.io/utils v0.0.0-20240102154912-e7106e64919e + reconciler.io/dies v0.11.0 sigs.k8s.io/controller-runtime v0.17.2 sigs.k8s.io/yaml v1.4.0 ) diff --git a/go.sum b/go.sum index 205926c..f9ab6b9 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,3 @@ -dies.dev v0.10.1 h1:UKgYIrPRKPlvCA0PTBNjvQv1UxHwgzD22QKC5ByoBds= -dies.dev v0.10.1/go.mod h1:7gwWOuo9E63wlQ8xso6uLX0jcqgQQVp6X0AYe+UhAl8= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= @@ -207,6 +205,8 @@ k8s.io/kube-openapi v0.0.0-20240126223410-2919ad4fcfec h1:iGTel2aR8vCZdxJDgmbeY0 k8s.io/kube-openapi v0.0.0-20240126223410-2919ad4fcfec/go.mod h1:Pa1PvrP7ACSkuX6I7KYomY6cmMA0Tx86waBhDUgoKPw= k8s.io/utils v0.0.0-20240102154912-e7106e64919e h1:eQ/4ljkx21sObifjzXwlPKpdGLrCfRziVtos3ofG/sQ= k8s.io/utils v0.0.0-20240102154912-e7106e64919e/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= +reconciler.io/dies v0.11.0 h1:gfhOPxB/+V1Pqwr94krtAcQTksnYl8G4YAwDtElSzz4= +reconciler.io/dies v0.11.0/go.mod h1:jL6xrLwWP/BZm17LIH5WPnYq+//ZD/7srVBnPVHqM4Q= sigs.k8s.io/controller-runtime v0.17.2 h1:FwHwD1CTUemg0pW2otk7/U5/i5m2ymzvOXdbeGOUvw0= sigs.k8s.io/controller-runtime v0.17.2/go.mod h1:+MngTvIQQQhfXtwfdGw/UOQ/aIaqsYywfCINOtwMO/s= sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo= diff --git a/hack/go.mod b/hack/go.mod index 87ab494..66233c7 100644 --- a/hack/go.mod +++ b/hack/go.mod @@ -2,10 +2,8 @@ module reconciler.io/runtime/hack go 1.21 -toolchain go1.21.6 - require ( - dies.dev/diegen v0.10.1 + reconciler.io/dies/diegen v0.11.0 sigs.k8s.io/controller-tools v0.14.0 ) diff --git a/hack/go.sum b/hack/go.sum index 3eda5d6..2b70ab3 100644 --- a/hack/go.sum +++ b/hack/go.sum @@ -1,5 +1,3 @@ -dies.dev/diegen v0.10.1 h1:bUjO7L3ALdyT6nRuntcCAfy4Vx4ny4cC8kemT/GY240= -dies.dev/diegen v0.10.1/go.mod h1:08auIh8JtE32P7wVv7IC1EmAxSRoziWLwbOiMfk8cNI= github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= @@ -128,6 +126,8 @@ k8s.io/klog/v2 v2.120.1 h1:QXU6cPEOIslTGvZaXvFWiP9VKyeet3sawzTOvdXb4Vw= k8s.io/klog/v2 v2.120.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= k8s.io/utils v0.0.0-20240102154912-e7106e64919e h1:eQ/4ljkx21sObifjzXwlPKpdGLrCfRziVtos3ofG/sQ= k8s.io/utils v0.0.0-20240102154912-e7106e64919e/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= +reconciler.io/dies/diegen v0.11.0 h1:mB9Z7lVqrG5Ld+9sqgpRtGEnvL86BLWxfdvcioDAFWQ= +reconciler.io/dies/diegen v0.11.0/go.mod h1:K2Y514FWyBp3R7VQk7zq8zFA6fGK2QsOBRnaShMAj4Q= sigs.k8s.io/controller-tools v0.14.0 h1:rnNoCC5wSXlrNoBKKzL70LNJKIQKEzT6lloG6/LF73A= sigs.k8s.io/controller-tools v0.14.0/go.mod h1:TV7uOtNNnnR72SpzhStvPkoS/U5ir0nMudrkrC4M9Sc= sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo= diff --git a/hack/tools.go b/hack/tools.go index d718a47..72f313e 100644 --- a/hack/tools.go +++ b/hack/tools.go @@ -5,6 +5,6 @@ package tools import ( - _ "dies.dev/diegen" + _ "reconciler.io/dies/diegen" _ "sigs.k8s.io/controller-tools/cmd/controller-gen" ) diff --git a/hack/update-codegen.sh b/hack/update-codegen.sh index 9f15fa6..3ce173f 100755 --- a/hack/update-codegen.sh +++ b/hack/update-codegen.sh @@ -6,7 +6,7 @@ set -o pipefail SCRIPT_ROOT=$(cd $(dirname "${BASH_SOURCE[0]}")/.. && pwd) CONTROLLER_GEN="go run -modfile=${SCRIPT_ROOT}/hack/go.mod sigs.k8s.io/controller-tools/cmd/controller-gen" -DIEGEN="go run -modfile=${SCRIPT_ROOT}/hack/go.mod dies.dev/diegen" +DIEGEN="go run -modfile=${SCRIPT_ROOT}/hack/go.mod reconciler.io/dies/diegen" ( cd $SCRIPT_ROOT ; $CONTROLLER_GEN object:headerFile="./hack/boilerplate.go.txt" paths="./..." ) ( cd $SCRIPT_ROOT ; $DIEGEN die:headerFile="./hack/boilerplate.go.txt" paths="./..." ) diff --git a/internal/resources/dies/dies.go b/internal/resources/dies/dies.go index ad12149..927391e 100644 --- a/internal/resources/dies/dies.go +++ b/internal/resources/dies/dies.go @@ -17,9 +17,9 @@ limitations under the License. package dies import ( - diecorev1 "dies.dev/apis/core/v1" - diemetav1 "dies.dev/apis/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + diecorev1 "reconciler.io/dies/apis/core/v1" + diemetav1 "reconciler.io/dies/apis/meta/v1" "reconciler.io/runtime/internal/resources" ) diff --git a/internal/resources/dies/zz_generated.die.go b/internal/resources/dies/zz_generated.die.go index d18a165..d5c4a61 100644 --- a/internal/resources/dies/zz_generated.die.go +++ b/internal/resources/dies/zz_generated.die.go @@ -22,7 +22,6 @@ limitations under the License. package dies import ( - "dies.dev/apis/meta/v1" json "encoding/json" fmtx "fmt" corev1 "k8s.io/api/core/v1" @@ -31,6 +30,7 @@ import ( schema "k8s.io/apimachinery/pkg/runtime/schema" jsonpath "k8s.io/client-go/util/jsonpath" osx "os" + "reconciler.io/dies/apis/meta/v1" apis "reconciler.io/runtime/apis" "reconciler.io/runtime/internal/resources" reflectx "reflect" diff --git a/internal/resources/dies/zz_generated.die_test.go b/internal/resources/dies/zz_generated.die_test.go index ba3b4d8..a9472d3 100644 --- a/internal/resources/dies/zz_generated.die_test.go +++ b/internal/resources/dies/zz_generated.die_test.go @@ -22,7 +22,7 @@ limitations under the License. package dies import ( - testing "dies.dev/testing" + testing "reconciler.io/dies/testing" testingx "testing" ) diff --git a/reconcilers/aggregate_test.go b/reconcilers/aggregate_test.go index 39efebc..f962cf6 100644 --- a/reconcilers/aggregate_test.go +++ b/reconcilers/aggregate_test.go @@ -22,13 +22,13 @@ import ( "testing" "time" - diecorev1 "dies.dev/apis/core/v1" - diemetav1 "dies.dev/apis/meta/v1" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/types" clientgoscheme "k8s.io/client-go/kubernetes/scheme" + diecorev1 "reconciler.io/dies/apis/core/v1" + diemetav1 "reconciler.io/dies/apis/meta/v1" "reconciler.io/runtime/internal/resources" "reconciler.io/runtime/reconcilers" rtesting "reconciler.io/runtime/testing" diff --git a/reconcilers/cast_test.go b/reconcilers/cast_test.go index 7dc97d9..bdb0733 100644 --- a/reconcilers/cast_test.go +++ b/reconcilers/cast_test.go @@ -21,13 +21,13 @@ import ( "fmt" "testing" - diecorev1 "dies.dev/apis/core/v1" - diemetav1 "dies.dev/apis/meta/v1" appsv1 "k8s.io/api/apps/v1" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" clientgoscheme "k8s.io/client-go/kubernetes/scheme" + diecorev1 "reconciler.io/dies/apis/core/v1" + diemetav1 "reconciler.io/dies/apis/meta/v1" "reconciler.io/runtime/apis" "reconciler.io/runtime/internal/resources" "reconciler.io/runtime/internal/resources/dies" diff --git a/reconcilers/child_test.go b/reconcilers/child_test.go index 7543443..455f65b 100644 --- a/reconcilers/child_test.go +++ b/reconcilers/child_test.go @@ -22,8 +22,6 @@ import ( "testing" "time" - diecorev1 "dies.dev/apis/core/v1" - diemetav1 "dies.dev/apis/meta/v1" corev1 "k8s.io/api/core/v1" apierrs "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -34,6 +32,8 @@ import ( "k8s.io/apimachinery/pkg/util/validation/field" clientgoscheme "k8s.io/client-go/kubernetes/scheme" "k8s.io/utils/pointer" + diecorev1 "reconciler.io/dies/apis/core/v1" + diemetav1 "reconciler.io/dies/apis/meta/v1" "reconciler.io/runtime/apis" "reconciler.io/runtime/internal/resources" "reconciler.io/runtime/internal/resources/dies" diff --git a/reconcilers/childset_test.go b/reconcilers/childset_test.go index a2aefd6..d175879 100644 --- a/reconcilers/childset_test.go +++ b/reconcilers/childset_test.go @@ -23,14 +23,14 @@ import ( "testing" "time" - diecorev1 "dies.dev/apis/core/v1" - diemetav1 "dies.dev/apis/meta/v1" corev1 "k8s.io/api/core/v1" apierrs "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/types" clientgoscheme "k8s.io/client-go/kubernetes/scheme" + diecorev1 "reconciler.io/dies/apis/core/v1" + diemetav1 "reconciler.io/dies/apis/meta/v1" "reconciler.io/runtime/apis" "reconciler.io/runtime/internal/resources" "reconciler.io/runtime/internal/resources/dies" diff --git a/reconcilers/config_test.go b/reconcilers/config_test.go index abe69c0..53ec846 100644 --- a/reconcilers/config_test.go +++ b/reconcilers/config_test.go @@ -21,14 +21,14 @@ import ( "fmt" "testing" - diecorev1 "dies.dev/apis/core/v1" - diemetav1 "dies.dev/apis/meta/v1" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/labels" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/types" clientgoscheme "k8s.io/client-go/kubernetes/scheme" + diecorev1 "reconciler.io/dies/apis/core/v1" + diemetav1 "reconciler.io/dies/apis/meta/v1" "reconciler.io/runtime/internal/resources" "reconciler.io/runtime/internal/resources/dies" "reconciler.io/runtime/reconcilers" diff --git a/reconcilers/finalizer_test.go b/reconcilers/finalizer_test.go index 2748d37..d996443 100644 --- a/reconcilers/finalizer_test.go +++ b/reconcilers/finalizer_test.go @@ -22,11 +22,11 @@ import ( "testing" "time" - diemetav1 "dies.dev/apis/meta/v1" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/types" + diemetav1 "reconciler.io/dies/apis/meta/v1" "reconciler.io/runtime/internal/resources" "reconciler.io/runtime/internal/resources/dies" "reconciler.io/runtime/reconcilers" diff --git a/reconcilers/flow_test.go b/reconcilers/flow_test.go index f53b0b6..c5a1dc1 100644 --- a/reconcilers/flow_test.go +++ b/reconcilers/flow_test.go @@ -22,9 +22,9 @@ import ( "testing" "time" - diemetav1 "dies.dev/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/utils/pointer" + diemetav1 "reconciler.io/dies/apis/meta/v1" "reconciler.io/runtime/internal/resources" "reconciler.io/runtime/internal/resources/dies" "reconciler.io/runtime/reconcilers" diff --git a/reconcilers/resource_test.go b/reconcilers/resource_test.go index a062bcf..137b3d9 100644 --- a/reconcilers/resource_test.go +++ b/reconcilers/resource_test.go @@ -22,13 +22,13 @@ import ( "testing" "time" - diemetav1 "dies.dev/apis/meta/v1" "github.com/google/go-cmp/cmp" corev1 "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" "k8s.io/apimachinery/pkg/types" + diemetav1 "reconciler.io/dies/apis/meta/v1" "reconciler.io/runtime/apis" "reconciler.io/runtime/internal/resources" "reconciler.io/runtime/internal/resources/dies" diff --git a/reconcilers/sequence_test.go b/reconcilers/sequence_test.go index 601dc8c..c461971 100644 --- a/reconcilers/sequence_test.go +++ b/reconcilers/sequence_test.go @@ -22,9 +22,9 @@ import ( "testing" "time" - diemetav1 "dies.dev/apis/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" + diemetav1 "reconciler.io/dies/apis/meta/v1" "reconciler.io/runtime/apis" "reconciler.io/runtime/internal/resources" "reconciler.io/runtime/internal/resources/dies" diff --git a/reconcilers/sync_test.go b/reconcilers/sync_test.go index b6e95e3..a3bcfa6 100644 --- a/reconcilers/sync_test.go +++ b/reconcilers/sync_test.go @@ -22,9 +22,9 @@ import ( "testing" "time" - diemetav1 "dies.dev/apis/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" + diemetav1 "reconciler.io/dies/apis/meta/v1" "reconciler.io/runtime/apis" "reconciler.io/runtime/internal/resources" "reconciler.io/runtime/internal/resources/dies" diff --git a/reconcilers/webhook_test.go b/reconcilers/webhook_test.go index 34f15c6..2fafcc2 100644 --- a/reconcilers/webhook_test.go +++ b/reconcilers/webhook_test.go @@ -23,8 +23,6 @@ import ( "net/url" "testing" - dieadmissionv1 "dies.dev/apis/admission/v1" - diemetav1 "dies.dev/apis/meta/v1" "github.com/google/go-cmp/cmp" jsonpatch "gomodules.xyz/jsonpatch/v2" admissionv1 "k8s.io/api/admission/v1" @@ -34,6 +32,8 @@ import ( "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/types" clientgoscheme "k8s.io/client-go/kubernetes/scheme" + dieadmissionv1 "reconciler.io/dies/apis/admission/v1" + diemetav1 "reconciler.io/dies/apis/meta/v1" "reconciler.io/runtime/apis" "reconciler.io/runtime/internal/resources" "reconciler.io/runtime/internal/resources/dies" diff --git a/testing/config_test.go b/testing/config_test.go index 5d0650a..ba25667 100644 --- a/testing/config_test.go +++ b/testing/config_test.go @@ -22,7 +22,6 @@ import ( "testing" "time" - diemetav1 "dies.dev/apis/meta/v1" "github.com/google/go-cmp/cmp" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -32,6 +31,7 @@ import ( "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/types" clientgoscheme "k8s.io/client-go/kubernetes/scheme" + diemetav1 "reconciler.io/dies/apis/meta/v1" "reconciler.io/runtime/internal/resources" "reconciler.io/runtime/internal/resources/dies" "reconciler.io/runtime/reconcilers"