Skip to content

Commit

Permalink
add UserAgent = kruise-rollout (openkruise#64)
Browse files Browse the repository at this point in the history
Signed-off-by: mingzhou.swx <[email protected]>

Co-authored-by: mingzhou.swx <[email protected]>
Signed-off-by: yike21 <[email protected]>
  • Loading branch information
2 people authored and yike21 committed Aug 29, 2022
1 parent 2f8e01b commit fa4ea01
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
7 changes: 5 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,17 @@ func main() {
flag.Parse()
ctrl.SetLogger(klogr.New())

cfg := ctrl.GetConfigOrDie()
cfg.UserAgent = "kruise-rollout"

setupLog.Info("new clientset registry")
err := utilclient.NewRegistry(ctrl.GetConfigOrDie())
err := utilclient.NewRegistry(cfg)
if err != nil {
setupLog.Error(err, "unable to init clientset and informer")
os.Exit(1)
}

mgr, err := ctrl.NewManager(ctrl.GetConfigOrDie(), ctrl.Options{
mgr, err := ctrl.NewManager(cfg, ctrl.Options{
Scheme: scheme,
MetricsBindAddress: metricsAddr,
Port: 9443,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,11 +191,11 @@ func isGetWorkloadInfoError(err error) bool {
}

func isWorkloadLocated(err error, release *v1alpha1.BatchRelease) bool {
return err == nil && release.Status.Phase == v1alpha1.RolloutPhaseInitial
return err == nil && (release.Status.Phase == v1alpha1.RolloutPhaseInitial || release.Status.Phase == "")
}

func isWorkloadGone(event workloads.WorkloadEventType, release *v1alpha1.BatchRelease) bool {
return event == workloads.WorkloadHasGone && release.Status.Phase != v1alpha1.RolloutPhaseInitial
return event == workloads.WorkloadHasGone && release.Status.Phase != v1alpha1.RolloutPhaseInitial && release.Status.Phase != ""
}

func isWorkloadScaling(event workloads.WorkloadEventType, release *v1alpha1.BatchRelease) bool {
Expand Down

0 comments on commit fa4ea01

Please sign in to comment.