-
Notifications
You must be signed in to change notification settings - Fork 1k
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
(gce) added upsert google scaling policy atomic operation #743
(gce) added upsert google scaling policy atomic operation #743
Conversation
|
||
def scalingPolicies | ||
if (isRegional) { | ||
scalingPolicies = compute.regionAutoscalers().list(project, region).execute().getItems() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should be reading these from the cache
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would have expected this to behave similarly to CopyLastGoogleServerGroupAtomicOperation
. In that operation, we fetch the server group from the cache by using GoogleClusterProvider
. Then we retrieve the Autoscaler (and all other) attributes from the server group model itself. Any reason not to do the same thing here? Should be able to reuse the same GCEUtil.queryServerGroup()
call.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, you're already making this call. Any reason to trust the other attributes of serverGroup
but not the autoscaler bits?
87fe60d
to
68717e2
Compare
@@ -36,6 +36,7 @@ import com.netflix.spinnaker.clouddriver.google.deploy.exception.GoogleOperation | |||
import com.netflix.spinnaker.clouddriver.google.deploy.exception.GoogleResourceNotFoundException | |||
import com.netflix.spinnaker.clouddriver.google.model.GoogleDisk | |||
import com.netflix.spinnaker.clouddriver.google.model.GoogleDiskType | |||
import com.netflix.spinnaker.clouddriver.google.model.GoogleAutoscalingPolicy |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sort order is off here.
@@ -574,10 +575,9 @@ class GCEUtil { | |||
} | |||
} | |||
|
|||
return new Autoscaler(name: serverGroupName, | |||
zone: migCreateOperation.zone, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The autoscaler is properly upserted even if zone (or region) is omitted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add this as a comment in the code.
Please add a comment to the PR describing how you tested this (other than the unit tests). |
LGTM after addressing comments. |
68717e2
to
24ebdde
Compare
The PR has been manually tested with the curl commands in The commands test the following: 1). An autoscaler can be created for a server group with the specified properties. |
(gce) added upsert google scaling policy atomic operation
to be followed by delete operation.
@duftler @lwander PTAL