Skip to content

Commit

Permalink
fix: move conversion webhooks to hub version API (v1alpha3) (#992)
Browse files Browse the repository at this point in the history
Signed-off-by: odubajDT <[email protected]>
  • Loading branch information
odubajDT authored Mar 8, 2023
1 parent 419663a commit b2bb268
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 34 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package v1alpha2
package v1alpha3

import (
ctrl "sigs.k8s.io/controller-runtime"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package v1alpha2
package v1alpha3

import (
ctrl "sigs.k8s.io/controller-runtime"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package v1alpha3

import (
ctrl "sigs.k8s.io/controller-runtime"
)

func (r *KeptnEvaluationProvider) SetupWebhookWithManager(mgr ctrl.Manager) error {
return ctrl.NewWebhookManagedBy(mgr).
For(r).
Complete()
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package v1alpha2
package v1alpha3

import (
ctrl "sigs.k8s.io/controller-runtime"
Expand Down
8 changes: 4 additions & 4 deletions operator/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -268,19 +268,19 @@ func main() {
os.Exit(1)
}

if err = (&lifecyclev1alpha2.KeptnApp{}).SetupWebhookWithManager(mgr); err != nil {
if err = (&lifecyclev1alpha3.KeptnApp{}).SetupWebhookWithManager(mgr); err != nil {
setupLog.Error(err, "unable to create webhook", "webhook", "KeptnApp")
os.Exit(1)
}
if err = (&lifecyclev1alpha2.KeptnEvaluationProvider{}).SetupWebhookWithManager(mgr); err != nil {
if err = (&lifecyclev1alpha3.KeptnEvaluationProvider{}).SetupWebhookWithManager(mgr); err != nil {
setupLog.Error(err, "unable to create webhook", "webhook", "KeptnEvaluationProvider")
os.Exit(1)
}
if err = (&lifecyclev1alpha2.KeptnAppVersion{}).SetupWebhookWithManager(mgr); err != nil {
if err = (&lifecyclev1alpha3.KeptnAppVersion{}).SetupWebhookWithManager(mgr); err != nil {
setupLog.Error(err, "unable to create webhook", "webhook", "KeptnAppVersion")
os.Exit(1)
}
if err = (&lifecyclev1alpha2.KeptnWorkloadInstance{}).SetupWebhookWithManager(mgr); err != nil {
if err = (&lifecyclev1alpha3.KeptnWorkloadInstance{}).SetupWebhookWithManager(mgr); err != nil {
setupLog.Error(err, "unable to create webhook", "webhook", "KeptnWorkloadInstance")
os.Exit(1)
}
Expand Down

0 comments on commit b2bb268

Please sign in to comment.