-
Notifications
You must be signed in to change notification settings - Fork 231
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: Incorrect value of clientTLSPolicy from ComputeBackendService #3007
Merged
google-oss-prow
merged 3 commits into
GoogleCloudPlatform:master
from
gemmahou:valuetemplate
Nov 1, 2024
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,6 +30,15 @@ func init() { | |
SkipUpdate: true, | ||
} | ||
|
||
resourceContextMap["globalcomputebackendservicesecuritysettings"] = ResourceContext{ | ||
ResourceKind: "ComputeBackendService", | ||
// Underlying API changes dependency resource's project id to number after successful creation. | ||
// For now TF servicemapping does not have a way to resolve dependency DCL resources' project number. | ||
// Skip checking no change after creation(testNoChangeAfterCreate) to bypass this temporarily. | ||
// See https://buganizer.corp.google.com/issues/374166656#comment11 for details. | ||
SkipNoChange: true, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we make this field unreadable so that it'll always use the value specified in the CR as the live state for comparison? Not a blocker for this PR though. |
||
} | ||
|
||
resourceContextMap["computeexternalvpngateway"] = ResourceContext{ | ||
ResourceKind: "ComputeExternalVPNGateway", | ||
SkipUpdate: true, | ||
|
29 changes: 29 additions & 0 deletions
29
...ute/v1beta1/computebackendservice/globalcomputebackendservicesecuritysettings/create.yaml
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# Copyright 2024 Google LLC | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
apiVersion: compute.cnrm.cloud.google.com/v1beta1 | ||
kind: ComputeBackendService | ||
metadata: | ||
name: computebackendservice-${uniqueId} | ||
spec: | ||
loadBalancingScheme: INTERNAL_SELF_MANAGED | ||
# The security settings that apply to this backend service. This field is applicable to | ||
# global backend service with the load_balancing_scheme set to INTERNAL_SELF_MANAGED | ||
securitySettings: | ||
clientTLSPolicyRef: | ||
name: networksecurityclienttlspolicy-${uniqueId} | ||
subjectAltNames: | ||
- spiffe://junk.svc.id.goog/ns/test/sa/frontend | ||
timeoutSec: 10 | ||
location: global |
26 changes: 26 additions & 0 deletions
26
...beta1/computebackendservice/globalcomputebackendservicesecuritysettings/dependencies.yaml
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# Copyright 2024 Google LLC | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
apiVersion: networksecurity.cnrm.cloud.google.com/v1beta1 | ||
kind: NetworkSecurityClientTLSPolicy | ||
metadata: | ||
name: networksecurityclienttlspolicy-${uniqueId} | ||
spec: | ||
clientCertificate: | ||
certificateProviderInstance: | ||
pluginInstance: google_cloud_private_spiffe | ||
location: global | ||
serverValidationCa: | ||
- certificateProviderInstance: | ||
pluginInstance: google_cloud_private_spiffe |
29 changes: 29 additions & 0 deletions
29
...ute/v1beta1/computebackendservice/globalcomputebackendservicesecuritysettings/update.yaml
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# Copyright 2024 Google LLC | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
apiVersion: compute.cnrm.cloud.google.com/v1beta1 | ||
kind: ComputeBackendService | ||
metadata: | ||
name: computebackendservice-${uniqueId} | ||
spec: | ||
loadBalancingScheme: INTERNAL_SELF_MANAGED | ||
# The security settings that apply to this backend service. This field is applicable to | ||
# global backend service with the load_balancing_scheme set to INTERNAL_SELF_MANAGED | ||
securitySettings: | ||
clientTLSPolicyRef: | ||
name: networksecurityclienttlspolicy-${uniqueId} | ||
subjectAltNames: | ||
- spiffe://junk.svc.id.goog/ns/test/sa/frontend | ||
timeoutSec: 5 | ||
location: global |
This file contains 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
This file contains 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
Oops, something went wrong.
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.
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.
Might be good to make this sort of description more of a standard. Seems like a huge improvement. Worth noting that for this resource it seems like location always has to be "global".
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.
ClientTlsPolicy does support other locations(API doc).
If a user incorrectly configures a regional policy, the request should be sent to the API as is and let the API to handle the error. We may not want to convert the regional policy to a global policy on our side(?). In rare cases, there might be a global resource with the same name, and this could lead to confusion.