Skip to content

Commit

Permalink
update only when spec is changed
Browse files Browse the repository at this point in the history
  • Loading branch information
yaron2 committed May 2, 2019
1 parent 396f966 commit f640458
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/controller/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
clientset "github.com/kedacore/keda/pkg/client/clientset/versioned"
kedainformer_v1alpha1 "github.com/kedacore/keda/pkg/client/informers/externalversions/keda/v1alpha1"
"github.com/kedacore/keda/pkg/handler"
"k8s.io/apimachinery/pkg/api/equality"
meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/client-go/kubernetes"
"k8s.io/client-go/tools/cache"
Expand Down Expand Up @@ -51,6 +52,10 @@ func NewController(kedaClient clientset.Interface, kubeClient kubernetes.Interfa
if new.ResourceVersion == old.ResourceVersion {
return
}
if equality.Semantic.DeepEqual(old.Spec, new.Spec) {
return
}

c.syncScaledObject(newObj, true)
},
DeleteFunc: c.syncDeletedScaledObject,
Expand Down

0 comments on commit f640458

Please sign in to comment.