-
Notifications
You must be signed in to change notification settings - Fork 239
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
Spanner instance direct controller #3137
Spanner instance direct controller #3137
Conversation
bc06e0f
to
cb1912f
Compare
cb1912f
to
3e25f08
Compare
3e25f08
to
181088a
Compare
...sions.k8s.io_v1_customresourcedefinition_spannerinstances.spanner.cnrm.cloud.google.com.yaml
Show resolved
Hide resolved
hack/record-gcp
Outdated
@@ -27,7 +27,7 @@ echo "TEST_BILLING_ACCOUNT_ID=${TEST_BILLING_ACCOUNT_ID}" | |||
export TEST_BILLING_ACCOUNT_ID | |||
|
|||
if [[ -z "${KCC_USE_DIRECT_RECONCILERS:-}" ]]; then | |||
KCC_USE_DIRECT_RECONCILERS="ComputeForwardingRule" | |||
KCC_USE_DIRECT_RECONCILERS="ComputeForwardingRule,SpannerInstance" |
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 not changing this env var. We don't run real gcp against presubmit, so this is more like a local setup.
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.
ack, I added this to run with real gcp, I can take it out here
"nodeCount": 3, | ||
"processingUnits": 2000 | ||
"name": "projects/${projectId}/instances/spannerinstance-sample-${uniqueId}", | ||
"nodeCount": 3 |
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
resourceID := direct.ValueOf(obj.Spec.ResourceID) | ||
if resourceID == "" { | ||
resourceID = obj.GetName() | ||
} | ||
if resourceID == "" { | ||
return nil, fmt.Errorf("cannot resolve resource ID") | ||
} |
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.
This should be from the NewSpannerInstanceRef
return mapCtx.Err() | ||
} | ||
|
||
updateMask := &fieldmaskpb.FieldMask{} |
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 using the common.CompareProtoMessage
here?
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.
with the weird computing fields behaviors (unset, unmanaged, swap), I would keep the check to be manual as we have been doing before.
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.
Oh I see, right... Is nodeCount and processingUnit the only two fields have defaulting values in SpannerInstance?
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.
BTW, we can improve the CompareProtoMessage to apply comparison with customized conditions.
f64c2ae
to
c0f4723
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
/approve
...sions.k8s.io_v1_customresourcedefinition_spannerinstances.spanner.cnrm.cloud.google.com.yaml
Show resolved
Hide resolved
[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 |
da53ff0
into
GoogleCloudPlatform:master
Change description
Fixes #
Tests you have done
make ready-pr
to ensure this PR is ready for review.