Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix scaleTarget name reference when resolving pods #1483

Merged
merged 2 commits into from
Jan 6, 2021

Conversation

zroubalik
Copy link
Member

@zroubalik zroubalik commented Jan 6, 2021

Signed-off-by: Zbynek Roubalik zroubali@redhat.com

In #1457 we have overlooked a small problem, Kubernetes Resource was used to reference the name of the target workload. ie. if we were scaling Deployment a string deployments was used to reference the name.

Thus scaling is not working, see the log:

keda-operator-84f7687cfc-qtkch keda-operator 2021-01-06T11:36:51.713Z	INFO	controllers.ScaledObject	Detected resource targeted for scaling	{"ScaledObject.Namespace": "default", "ScaledObject.Name": "hello-scaledobject", "resource": "apps/v1.Deployment", "name": "hello-keda"}
keda-operator-84f7687cfc-qtkch keda-operator 2021-01-06T11:36:51.713Z	INFO	controllers.ScaledObject	Creating a new HPA	{"ScaledObject.Namespace": "default", "ScaledObject.Name": "hello-scaledobject", "HPA.Namespace": "default", "HPA.Name": "keda-hpa-hello-scaledobject"}
keda-operator-84f7687cfc-qtkch keda-operator 2021-01-06T11:36:51.814Z	ERROR	scalehandler	Target deployment doesn't exist	{"resource": "apps/v1, Kind=Deployment", "name": "deployments", "error": "Deployment.apps \"deployments\" not found"}
keda-operator-84f7687cfc-qtkch keda-operator github.com/go-logr/zapr.(*zapLogger).Error
keda-operator-84f7687cfc-qtkch keda-operator 	/go/pkg/mod/github.com/go-logr/zapr@v0.1.1/zapr.go:128
keda-operator-84f7687cfc-qtkch keda-operator github.com/kedacore/keda/v2/pkg/scaling.(*scaleHandler).getPods
keda-operator-84f7687cfc-qtkch keda-operator 	/workspace/pkg/scaling/scale_handler.go:387
keda-operator-84f7687cfc-qtkch keda-operator github.com/kedacore/keda/v2/pkg/scaling.(*scaleHandler).GetScalers
keda-operator-84f7687cfc-qtkch keda-operator 	/workspace/pkg/scaling/scale_handler.go:66
keda-operator-84f7687cfc-qtkch keda-operator github.com/kedacore/keda/v2/controllers.(*ScaledObjectReconciler).getScaledObjectMetricSpecs

Signed-off-by: Zbynek Roubalik <zroubali@redhat.com>
Signed-off-by: Zbynek Roubalik <zroubali@redhat.com>
@zroubalik
Copy link
Member Author

@coderanger FYI

@zroubalik zroubalik changed the title fix object name reference when resolving pods Fix scaleTarget name reference when resolving pods Jan 6, 2021
@ahmelsayed ahmelsayed merged commit c6c2cd4 into kedacore:main Jan 6, 2021
@coderanger
Copy link
Contributor

+1, I completely misread the parsing code. Fixed in #1458 too

ycabrer pushed a commit to ycabrer/keda that referenced this pull request Mar 1, 2021
* fix object name reference when resolving pods

Signed-off-by: Zbynek Roubalik <zroubali@redhat.com>

* update changelog

Signed-off-by: Zbynek Roubalik <zroubali@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants