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 ehpa controller update hpa logic #816

Merged
merged 2 commits into from
Jun 9, 2023
Merged

fix ehpa controller update hpa logic #816

merged 2 commits into from
Jun 9, 2023

Conversation

mtdtdev
Copy link
Contributor

@mtdtdev mtdtdev commented Jun 9, 2023

What type of PR is this?

fix ehpa controller update hpa logic, make sure ehpa controller updates HPA as expected or return update failed error

What this PR does / why we need it:

fix ideas: If there is a conflict error during the update, reacquire the latest HPA object A2, and then assign the expected update content in A1 to A2
bug in the current code: The operator wants to update HPA A1, if the update conflicts, it will directly obtain the latest HPA object A2 from the cluster, and then use A2 to re-initiate the update. And this A2 is not the content A1 that is expected to be updated. At the same time, if A2 update is successful, the exception of update failure will also be lost, resulting in A1 not being updated, but operator thinks that HPA A1 has been updated.

Which issue(s) this PR fixes:

Fixes #815

Special notes for your reviewer:

@github-actions
Copy link
Contributor

github-actions bot commented Jun 9, 2023

🎉 Successfully Build Images.
Now Support ARM Platforms.
Comment Post Time: 2023-06-09 15:21
Git Version: 93688b2

Docker Registry

Overview: https://hub.docker.com/u/gocrane

Image Pull Command
crane-agent:pr-816-93688b2 docker pull gocrane/crane-agent:pr-816-93688b2
dashboard:pr-816-93688b2 docker pull gocrane/dashboard:pr-816-93688b2
metric-adapter:pr-816-93688b2 docker pull gocrane/metric-adapter:pr-816-93688b2
craned:pr-816-93688b2 docker pull gocrane/craned:pr-816-93688b2

Quick Deploy - Helm

helm repo add crane https://finops-helm.pkg.coding.net/gocrane/gocrane
helm install crane -n crane-system --create-namespace \
                   --set craned.image.repository=gocrane/craned \
                   --set craned.image.tag=pr-816-93688b2 \
                   --set metricAdapter.image.repository=gocrane/metric-adapter \
                   --set metricAdapter.image.tag=pr-816-93688b2 \
                   --set craneAgent.image.repository=gocrane/crane-agent \
                   --set craneAgent.image.tag=pr-816-93688b2 \
                   --set cranedDashboard.image.repository=gocrane/dashboard \
                   --set cranedDashboard.image.tag=pr-816-93688b2 crane/crane

Coding Registry

Overview: https://finops.coding.net/public-artifacts/gocrane/crane/packages

Image Pull Command
crane-agent:pr-816-93688b2 docker pull finops-docker.pkg.coding.net/gocrane/crane/crane-agent:pr-816-93688b2
dashboard:pr-816-93688b2 docker pull finops-docker.pkg.coding.net/gocrane/crane/dashboard:pr-816-93688b2
metric-adapter:pr-816-93688b2 docker pull finops-docker.pkg.coding.net/gocrane/crane/metric-adapter:pr-816-93688b2
craned:pr-816-93688b2 docker pull finops-docker.pkg.coding.net/gocrane/crane/craned:pr-816-93688b2

Quick Deploy - Helm

helm repo add crane https://finops-helm.pkg.coding.net/gocrane/gocrane
helm install crane -n crane-system --create-namespace \
                   --set craned.image.repository=finops-docker.pkg.coding.net/gocrane/crane/craned \
                   --set craned.image.tag=pr-816-93688b2 \
                   --set metricAdapter.image.repository=finops-docker.pkg.coding.net/gocrane/crane/metric-adapter \
                   --set metricAdapter.image.tag=pr-816-93688b2 \
                   --set craneAgent.image.repository=finops-docker.pkg.coding.net/gocrane/crane/crane-agent \
                   --set craneAgent.image.tag=pr-816-93688b2 \
                   --set cranedDashboard.image.repository=finops-docker.pkg.coding.net/gocrane/crane/dashboard \
                   --set cranedDashboard.image.tag=pr-816-93688b2 crane/crane

Ghcr Registry

Overview: https://github.com/orgs/gocrane/packages?repo_name=crane

Image Pull Command
crane-agent:pr-816-93688b2 docker pull ghcr.io/gocrane/crane/crane-agent:pr-816-93688b2
dashboard:pr-816-93688b2 docker pull ghcr.io/gocrane/crane/dashboard:pr-816-93688b2
metric-adapter:pr-816-93688b2 docker pull ghcr.io/gocrane/crane/metric-adapter:pr-816-93688b2
craned:pr-816-93688b2 docker pull ghcr.io/gocrane/crane/craned:pr-816-93688b2

Quick Deploy - Helm

helm repo add crane https://finops-helm.pkg.coding.net/gocrane/gocrane
helm install crane -n crane-system --create-namespace \
                   --set craned.image.repository=ghcr.io/gocrane/crane/craned \
                   --set craned.image.tag=pr-816-93688b2 \
                   --set metricAdapter.image.repository=ghcr.io/gocrane/crane/metric-adapter \
                   --set metricAdapter.image.tag=pr-816-93688b2 \
                   --set craneAgent.image.repository=ghcr.io/gocrane/crane/crane-agent \
                   --set craneAgent.image.tag=pr-816-93688b2 \
                   --set cranedDashboard.image.repository=ghcr.io/gocrane/crane/dashboard \
                   --set cranedDashboard.image.tag=pr-816-93688b2 crane/crane

@qmhu qmhu merged commit eca3bbd into gocrane:main Jun 9, 2023
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

When updating the HPA in the EHPA Controller, if there is a conflict, the updated content will be lost
2 participants