Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
Camila Macedo committed Dec 16, 2020
1 parent 068862c commit 26b2ac6
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,8 @@ entries:
initialDelaySeconds: 5
periodSeconds: 10
```
- description: >
For Ansible-based operators, the `/ping` endpoint is deprecated. Use `/healthz` and `/readyz` instead of that.
kind: "deprecation"
breaking: false
15 changes: 6 additions & 9 deletions internal/cmd/ansible-operator/run/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,15 +144,6 @@ func run(cmd *cobra.Command, f *flags.Flags) {
os.Exit(1)
}

if err := mgr.AddHealthzCheck("health", healthz.Ping); err != nil {
log.Error(err, "Unable to set up health check")
os.Exit(1)
}
if err := mgr.AddReadyzCheck("check", healthz.Ping); err != nil {
log.Error(err, "Unable to set up ready check")
os.Exit(1)
}

cMap := controllermap.NewControllerMap()
watches, err := watches.Load(f.WatchesFile, f.MaxConcurrentReconciles, f.AnsibleVerbosity)
if err != nil {
Expand Down Expand Up @@ -188,6 +179,12 @@ func run(cmd *cobra.Command, f *flags.Flags) {
}, w.Blacklist)
}

// todo: remove when a upper version be bumped
err = mgr.AddHealthzCheck("ping", healthz.Ping)
if err != nil {
log.Error(err, "Failed to add Healthz check.")
}

done := make(chan error)

// start the proxy
Expand Down
10 changes: 0 additions & 10 deletions internal/cmd/helm-operator/run/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import (
"k8s.io/client-go/tools/leaderelection/resourcelock"
"sigs.k8s.io/controller-runtime/pkg/cache"
"sigs.k8s.io/controller-runtime/pkg/client/config"
"sigs.k8s.io/controller-runtime/pkg/healthz"
logf "sigs.k8s.io/controller-runtime/pkg/log"
zapf "sigs.k8s.io/controller-runtime/pkg/log/zap"
"sigs.k8s.io/controller-runtime/pkg/manager"
Expand Down Expand Up @@ -132,15 +131,6 @@ func run(cmd *cobra.Command, f *flags.Flags) {
os.Exit(1)
}

if err := mgr.AddHealthzCheck("health", healthz.Ping); err != nil {
log.Error(err, "Unable to set up health check")
os.Exit(1)
}
if err := mgr.AddReadyzCheck("check", healthz.Ping); err != nil {
log.Error(err, "Unable to set up ready check")
os.Exit(1)
}

ws, err := watches.Load(f.WatchesFile)
if err != nil {
log.Error(err, "Failed to create new manager factories.")
Expand Down

0 comments on commit 26b2ac6

Please sign in to comment.