-
Notifications
You must be signed in to change notification settings - Fork 235
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
feat: Add Workstation controller and mockgcp #3276
feat: Add Workstation controller and mockgcp #3276
Conversation
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.
/lgtm
/approve
|
||
// +genclient | ||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object | ||
// TODO(user): make sure the pluralizaiton below is correct |
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.
nit: cleanup
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.
Fixed.
ea2ede5
to
cb02af3
Compare
/hold cancel |
cb02af3
to
d78b49e
Compare
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.
Suggest dropping the autogenerated code changes under ./pkg/clients/generated. We no longer update this lib since 1.125.
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.
Same as #3341 (comment), is it ok to update these (for consistency, for these older resources)? For any future resources, I will skip updating the pkg/clients/generated
.
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.
Based on discussion in other PR, I reverted these changes also.
|
||
// Find retrieves the GCP resource. | ||
// Return true means the object is found. This triggers Adapter `Update` call. | ||
// Return true means the object is not found. This triggers Adapter `Create` 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.
typo: "Return false".
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.
Fixed, also updated the template.
if mapCtx.Err() != nil { | ||
return mapCtx.Err() | ||
} | ||
return updateOp.UpdateStatus(ctx, status, nil) |
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.
awesome. Thank you. Could you update the scifi template as well?
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.
Done in #3377
|
||
req := &workstationspb.DeleteWorkstationRequest{Name: a.id.String()} | ||
op, err := a.gcpClient.DeleteWorkstation(ctx, req) | ||
if err != nil { |
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.
Does the GCP service returns any code if the resource does not exist (like 404)? If so, we may want to exclude NotFound from the error. If this case is already considered and covered in this PR, would you mind adding a comment?
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.
Nice catch. Fixed. Also noticed that WorkstationConfig and WorkstationCluster have this same issue, so I fixed those as well.
spec: | ||
parentRef: | ||
name: workstationconfig-${uniqueId} | ||
displayName: workstation-${uniqueId} |
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.
nit: make displayName a different value between create.yaml and update.yaml
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.
wait, is this an immutable field?
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.
Fixed. The displayName field is not immutable.
spec: | ||
parentRef: | ||
name: workstationconfig-${uniqueId} | ||
displayName: workstation-${uniqueId} |
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.
Is displayName required?
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.
Fixed, displayName is not required. Removed from minimal test.
/approve A few nits. non blocker |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: yuwenma The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
d78b49e
to
b5041fd
Compare
Skip sending GCP API delete request if resource does not exist.
Return true if object is found, false if object is not found.
Also, it is not a required field. So, remove from minimal suite.
b5041fd
to
b61af08
Compare
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.
/lgtm
Thank you! Great job!
546d074
into
GoogleCloudPlatform:master
No description provided.