Repository navigation
Fix NSTlsInspectionPolicy and verify against realGCP - #12449
Conversation
7155544 to
7ec1650
Compare
3838b02 to
cfc5fd0
Compare
| "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/controller/direct" | ||
| ) | ||
|
|
||
| func NetworkSecurityTLSInspectionPolicySpec_v1alpha1_FromProto(mapCtx *direct.MapContext, in *pb.TlsInspectionPolicy) *krmnetworksecurityv1alpha1.NetworkSecurityTLSInspectionPolicySpec { |
There was a problem hiding this comment.
Is there a particular reason we need a hand-crafted mapper here instead of relying on generation?
Probably worth updating the PR description
There was a problem hiding this comment.
Yes, in line52, we need to call then shared "StripCAPoolPrefix" function to convert the ref to the required format.
Updated PR description.
There was a problem hiding this comment.
Should we try updating load bearing fields instead of description?
There was a problem hiding this comment.
Added a -full test and updated all mutable fields there.
afde8e3 to
9fce577
Compare
maqiuyujoyce
left a comment
There was a problem hiding this comment.
Might worth update the delete operation response.
Otherwise LGTM.
| "response": { | ||
| "@type": "type.googleapis.com/google.protobuf.Empty" | ||
| } | ||
| } | ||
|
|
||
| --- | ||
|
|
||
| GET https://privateca.googleapis.com/v1/projects/${projectId}/locations/us-central1/caPools/capool-${uniqueId}?alt=json | ||
| Content-Type: application/json | ||
| User-Agent: kcc/${kccVersion} (+https://github.com/GoogleCloudPlatform/k8s-config-connector) kcc/controller-manager/${kccVersion} DeclarativeClientLib/0.0.1 | ||
|
|
||
| 404 Not Found | ||
| Content-Type: application/json; charset=UTF-8 | ||
| Server: ESF | ||
| Vary: Origin | ||
| Vary: X-Origin | ||
| Vary: Referer | ||
| X-Content-Type-Options: nosniff | ||
| X-Frame-Options: SAMEORIGIN | ||
| X-Xss-Protection: 0 | ||
|
|
||
| { | ||
| "error": { | ||
| "code": 404, | ||
| "message": "Resource 'projects/${projectId}/locations/us-central1/caPools/capool-${uniqueId}' was not found", | ||
| "status": "NOT_FOUND" | ||
| "@type": "type.googleapis.com/google.cloud.networksecurity.v1.TlsInspectionPolicy", | ||
| "caPool": "projects/${projectId}/locations/us-central1/caPools/capool-dep-2", | ||
| "createTime": "2024-04-01T12:34:56.123456Z", | ||
| "description": "An updated TLS Inspection Policy to decrypt traffic", | ||
| "excludePublicCaSet": true, | ||
| "minTlsVersion": "TLS_1_2", | ||
| "name": "projects/${projectId}/locations/us-central1/tlsInspectionPolicies/tlsinspection-${uniqueId}", | ||
| "tlsFeatureProfile": "PROFILE_COMPATIBLE", | ||
| "updateTime": "2024-04-01T12:34:56.123456Z" |
There was a problem hiding this comment.
The response section of a delete operation is an empty struct here in real GCP.
I think that is probably a better behavior in mock as well.
There was a problem hiding this comment.
Updated mock to match the real
There was a problem hiding this comment.
This is out of the scope.
I think the size of golden alignment test is a bit too large and contains so much normalization logic. It's hard to track which are outdated, and which will have side-effects, especially when they are mostly updated by overseer these days. We probably need to have a better solution to group these normalization logic.
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: maqiuyujoyce The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
0a3cbda
BRIEF Change description
Addresses #6787
WHY do we need this change?
Special notes for your reviewer:
Does this PR add something which needs to be 'release noted'?
Additional documentation e.g., references, usage docs, etc.:
Intended Milestone
Please indicate the intended milestone.
Tests you have done
make ready-prto ensure this PR is ready for review.