fix(instances): propagate instance update (image/version/enabled) to …#78
Merged
fix(instances): propagate instance update (image/version/enabled) to …#78
Conversation
…kubernetes Call sync_instance after PUT so cluster deployments reflect new image, version and enabled; remove TODO and trigger sync when any of these fields change
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Instance updates via
PUT /organizations/{uuid}/instances/{uuid}were only persisted in the database and not reflected in the Kubernetes cluster. This PR fixes that by callingsync_instanceafter a successful instance update whenimage,version, orenabledchange, so cluster deployments stay in sync with the instance. The previous TODO for handling Kubernetes sync on instance update is removed and replaced by this behaviour.Related Issue
Closes #
Type of Change
Component Affected
Checklist
General
Testing
Documentation
Screenshots (if applicable)
N/A
Test Plan
imageorversion) and confirm the deployment in the cluster is updated (e.g. new image/version in the workload).enabledand confirm the cluster state matches (e.g. workload scaled or removed as expected).image,version, orenabledand confirm behaviour is unchanged and no unnecessary sync runs if that's how the code is designed.Additional Notes
Sync runs only when at least one of
image,version, orenabledis sent in the request body. If sync fails (e.g. cluster unreachable), the exception propagates and the API may return 5xx; the instance update is already committed in the DB before sync is called.