Skip to content

Commit

Permalink
Bump sigs.k8s.io/controller-runtime from 0.14.6 to 0.15.0
Browse files Browse the repository at this point in the history
  • Loading branch information
bakito committed May 26, 2023
1 parent 84d499b commit 5c437e8
Show file tree
Hide file tree
Showing 6 changed files with 134 additions and 171 deletions.
13 changes: 7 additions & 6 deletions api/v1/eventlogger_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
"k8s.io/apimachinery/pkg/runtime"
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/webhook"
"sigs.k8s.io/controller-runtime/pkg/webhook/admission"
)

// SetupWebhookWithManager setup with manager
Expand All @@ -34,16 +35,16 @@ func (in *EventLogger) SetupWebhookWithManager(mgr ctrl.Manager) error {
var _ webhook.Validator = &EventLogger{}

// ValidateCreate implements webhook.Validator so a webhook will be registered for the type
func (in *EventLogger) ValidateCreate() error {
return in.Spec.Validate()
func (in *EventLogger) ValidateCreate() (admission.Warnings, error) {
return nil, in.Spec.Validate()
}

// ValidateUpdate implements webhook.Validator so a webhook will be registered for the type
func (in *EventLogger) ValidateUpdate(_ runtime.Object) error {
return in.Spec.Validate()
func (in *EventLogger) ValidateUpdate(_ runtime.Object) (admission.Warnings, error) {
return nil, in.Spec.Validate()
}

// ValidateDelete implements webhook.Validator so a webhook will be registered for the type
func (in *EventLogger) ValidateDelete() error {
return nil
func (in *EventLogger) ValidateDelete() (admission.Warnings, error) {
return nil, nil
}
24 changes: 18 additions & 6 deletions api/v1/eventlogger_webhook_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,23 @@ var _ = Describe("V1", func() {
Context("Valid", func() {
Context("ValidateCreate", func() {
It("should be valid", func() {
Ω(el.ValidateCreate()).ShouldNot(HaveOccurred())
w, err := el.ValidateCreate()
Ω(w).Should(BeNil())
Ω(err).ShouldNot(HaveOccurred())
})
})
Context("ValidateUpdate", func() {
It("should be valid", func() {
Ω(el.ValidateUpdate(nil)).ShouldNot(HaveOccurred())
w, err := el.ValidateUpdate(nil)
Ω(w).Should(BeNil())
Ω(err).ShouldNot(HaveOccurred())
})
})
Context("ValidateUpdate", func() {
It("should be nil", func() {
Ω(el.ValidateDelete()).Should(BeNil())
w, err := el.ValidateDelete()
Ω(w).Should(BeNil())
Ω(err).ShouldNot(HaveOccurred())
})
})
})
Expand All @@ -36,17 +42,23 @@ var _ = Describe("V1", func() {
})
Context("ValidateCreate", func() {
It("should be invalid", func() {
Ω(el.ValidateCreate()).Should(HaveOccurred())
w, err := el.ValidateCreate()
Ω(w).Should(BeNil())
Ω(err).Should(HaveOccurred())
})
})
Context("ValidateUpdate", func() {
It("should be invalid", func() {
Ω(el.ValidateUpdate(nil)).Should(HaveOccurred())
w, err := el.ValidateUpdate(nil)
Ω(w).Should(BeNil())
Ω(err).Should(HaveOccurred())
})
})
Context("ValidateUpdate", func() {
It("should be nil", func() {
Ω(el.ValidateDelete()).Should(BeNil())
w, err := el.ValidateDelete()
Ω(w).Should(BeNil())
Ω(err).ShouldNot(HaveOccurred())
})
})
})
Expand Down
3 changes: 1 addition & 2 deletions controllers/logging/event_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ import (
"sigs.k8s.io/controller-runtime/pkg/handler"
"sigs.k8s.io/controller-runtime/pkg/predicate"
"sigs.k8s.io/controller-runtime/pkg/reconcile"
"sigs.k8s.io/controller-runtime/pkg/source"
)

var eventLog = ctrl.Log.WithName("event")
Expand Down Expand Up @@ -212,7 +211,7 @@ func (r *Reconciler) SetupWithManager(mgr ctrl.Manager, namespace string) error
}
return ctrl.NewControllerManagedBy(mgr).
For(&eventloggerv1.EventLogger{}).
Watches(&source.Kind{Type: &corev1.Event{}}, &handler.Funcs{}).
Watches(&corev1.Event{}, &handler.Funcs{}).
WithEventFilter(&loggingPredicate{Config: r.Config, lastVersion: lv}).
Complete(r)
}
46 changes: 23 additions & 23 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -15,69 +15,69 @@ require (
github.com/onsi/ginkgo/v2 v2.9.5
github.com/onsi/gomega v1.27.7
go.uber.org/zap v1.24.0
k8s.io/api v0.26.3
k8s.io/apimachinery v0.26.3
k8s.io/client-go v0.26.3
k8s.io/api v0.27.2
k8s.io/apimachinery v0.27.2
k8s.io/client-go v0.27.2
k8s.io/klog/v2 v2.100.1
k8s.io/utils v0.0.0-20221128185143-99ec85e7a448
sigs.k8s.io/controller-runtime v0.14.6
k8s.io/utils v0.0.0-20230209194617-a36077c30491
sigs.k8s.io/controller-runtime v0.15.0
)

require (
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.1.2 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/emicklei/go-restful/v3 v3.9.0 // indirect
github.com/evanphx/json-patch v4.12.0+incompatible // indirect
github.com/evanphx/json-patch/v5 v5.6.0 // indirect
github.com/fsnotify/fsnotify v1.6.0 // indirect
github.com/gabriel-vasile/mimetype v1.4.2 // indirect
github.com/go-openapi/jsonpointer v0.19.5 // indirect
github.com/go-openapi/jsonreference v0.20.0 // indirect
github.com/go-openapi/swag v0.19.14 // indirect
github.com/go-openapi/jsonpointer v0.19.6 // indirect
github.com/go-openapi/jsonreference v0.20.1 // indirect
github.com/go-openapi/swag v0.22.3 // indirect
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/google/gnostic v0.5.7-v3refs // indirect
github.com/google/go-cmp v0.5.9 // indirect
github.com/google/gofuzz v1.1.0 // indirect
github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38 // indirect
github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1 // indirect
github.com/imdario/mergo v0.3.12 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/leodido/go-urn v1.2.4 // indirect
github.com/mailru/easyjson v0.7.6 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.2 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/prometheus/client_golang v1.14.0 // indirect
github.com/prometheus/client_model v0.3.0 // indirect
github.com/prometheus/common v0.37.0 // indirect
github.com/prometheus/procfs v0.8.0 // indirect
github.com/prometheus/client_golang v1.15.1 // indirect
github.com/prometheus/client_model v0.4.0 // indirect
github.com/prometheus/common v0.42.0 // indirect
github.com/prometheus/procfs v0.9.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
go.uber.org/atomic v1.7.0 // indirect
go.uber.org/multierr v1.6.0 // indirect
golang.org/x/crypto v0.7.0 // indirect
golang.org/x/net v0.10.0 // indirect
golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b // indirect
golang.org/x/oauth2 v0.5.0 // indirect
golang.org/x/sys v0.8.0 // indirect
golang.org/x/term v0.8.0 // indirect
golang.org/x/text v0.9.0 // indirect
golang.org/x/time v0.3.0 // indirect
golang.org/x/tools v0.9.1 // indirect
gomodules.xyz/jsonpatch/v2 v2.2.0 // indirect
gomodules.xyz/jsonpatch/v2 v2.3.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/protobuf v1.28.1 // indirect
google.golang.org/protobuf v1.30.0 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/apiextensions-apiserver v0.26.1 // indirect
k8s.io/component-base v0.26.1 // indirect
k8s.io/kube-openapi v0.0.0-20221012153701-172d655c2280 // indirect
sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2 // indirect
k8s.io/apiextensions-apiserver v0.27.2 // indirect
k8s.io/component-base v0.27.2 // indirect
k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f // indirect
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect
sigs.k8s.io/yaml v1.3.0 // indirect
)

0 comments on commit 5c437e8

Please sign in to comment.