Skip to content

Commit

Permalink
Upgrade reconciler-test to 1.15 (#882)
Browse files Browse the repository at this point in the history
Signed-off-by: Pierangelo Di Pilato <[email protected]>
  • Loading branch information
pierDipi authored Sep 24, 2024
1 parent bb5f2c6 commit ff9d92d
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ require (
knative.dev/hack v0.0.0-20240704013904-b9799599afcf
knative.dev/hack/schema v0.0.0-20240704013904-b9799599afcf
knative.dev/pkg v0.0.0-20240716082220-4355f0c73608
knative.dev/reconciler-test v0.0.0-20240716134925-00d94f40c470
knative.dev/reconciler-test v0.0.0-20240924090532-7ce3eca90b55
sigs.k8s.io/yaml v1.4.0
)

Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -844,8 +844,8 @@ knative.dev/hack/schema v0.0.0-20240704013904-b9799599afcf h1:AUfdS2IxgjNLc7jplP
knative.dev/hack/schema v0.0.0-20240704013904-b9799599afcf/go.mod h1:3pWwBLnTZSM9psSgCAvhKOHIPTzqfEMlWRpDu6IYhK0=
knative.dev/pkg v0.0.0-20240716082220-4355f0c73608 h1:BOiRzcnRS9Z5ruxlCiS/K1/Hb5bUN0X4W3xCegdcYQE=
knative.dev/pkg v0.0.0-20240716082220-4355f0c73608/go.mod h1:M67lDZ4KbltYSon0Ox4/6qjlZNOIXW4Ldequ81yofbw=
knative.dev/reconciler-test v0.0.0-20240716134925-00d94f40c470 h1:cdAPZPUszOYpgJY2LNRzz6lFZgD++U89y56jECV/6eU=
knative.dev/reconciler-test v0.0.0-20240716134925-00d94f40c470/go.mod h1:SxsgIk8gq6brVnQfKqCKOTtgmjXinZe2dqnsx3XeAvo=
knative.dev/reconciler-test v0.0.0-20240924090532-7ce3eca90b55 h1:5oNAuT0m6g092con5K6SB2r1cAjrMjvLwN0ntTH25JE=
knative.dev/reconciler-test v0.0.0-20240924090532-7ce3eca90b55/go.mod h1:SxsgIk8gq6brVnQfKqCKOTtgmjXinZe2dqnsx3XeAvo=
rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8=
rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0=
rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA=
Expand Down
7 changes: 5 additions & 2 deletions vendor/knative.dev/reconciler-test/pkg/manifest/manifest.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,18 +86,21 @@ func (f *YamlManifest) Apply(spec *unstructured.Unstructured) error {
if err != nil {
return err
}
gvr, _ := meta.UnsafeGuessKindToResource(spec.GroupVersionKind())
if current == nil {
f.log.Info("Creating type ", spec.GroupVersionKind(), " name ", spec.GetName())
gvr, _ := meta.UnsafeGuessKindToResource(spec.GroupVersionKind())
if _, err := f.client.Resource(gvr).Namespace(spec.GetNamespace()).Create(context.Background(), spec, v1.CreateOptions{}); err != nil {
// We might be applying the same resource in parallel, in that case, update the resource.
if errors.IsAlreadyExists(err) {
return f.Apply(spec)
}
return fmt.Errorf("failed to create resource %v - Resource:\n%s", err, toYaml(spec))
}
} else {
// Update existing one
if UpdateChanged(spec.UnstructuredContent(), current.UnstructuredContent()) {
f.log.Info("Updating type ", spec.GroupVersionKind(), " name ", spec.GetName())

gvr, _ := meta.UnsafeGuessKindToResource(spec.GroupVersionKind())
if _, err = f.client.Resource(gvr).Namespace(current.GetNamespace()).Update(context.Background(), current, v1.UpdateOptions{}); err != nil {
return fmt.Errorf("failed to update resource %v - Resource:\n%s", err, toYaml(spec))
}
Expand Down
2 changes: 1 addition & 1 deletion vendor/modules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1205,7 +1205,7 @@ knative.dev/pkg/webhook/resourcesemantics
knative.dev/pkg/webhook/resourcesemantics/conversion
knative.dev/pkg/webhook/resourcesemantics/defaulting
knative.dev/pkg/webhook/resourcesemantics/validation
# knative.dev/reconciler-test v0.0.0-20240716134925-00d94f40c470
# knative.dev/reconciler-test v0.0.0-20240924090532-7ce3eca90b55
## explicit; go 1.22
knative.dev/reconciler-test/cmd/eventshub
knative.dev/reconciler-test/pkg/environment
Expand Down

0 comments on commit ff9d92d

Please sign in to comment.