Skip to content

Commit

Permalink
Remove networkTier for global forwarding rule
Browse files Browse the repository at this point in the history
  • Loading branch information
gemmahou committed Sep 18, 2024
1 parent 6afeab4 commit 9e831e6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 5 additions & 0 deletions pkg/controller/direct/compute/forwardingrule_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,11 @@ func (a *forwardingRuleAdapter) Create(ctx context.Context, createOp *directbase
var err error
op := &gcp.Operation{}
if a.id.location == "global" {
// todo(yuhou): TF does not support networkTier field for global forwarding rule
// It will always use GCP's default value, which is "PREMIUM." Any value set by the user will be ignored and not sent to GCP.
// To align with the TF controller, I remove this field.
// Ideally, direct controller should support this field and validate that the value.
forwardingRule.NetworkTier = nil
req := &computepb.InsertGlobalForwardingRuleRequest{
ForwardingRuleResource: forwardingRule,
Project: a.id.project,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -770,7 +770,6 @@ x-goog-request-params: project=${projectId}
],
"name": "computeglobalforwardingrule-${uniqueId}",
"network": "projects/${projectId}/global/networks/${networkID}",
"networkTier": "PREMIUM",
"portRange": "80",
"target": "https://www.googleapis.com/compute/v1/projects/${projectId}/global/targetHttpProxies/computetargethttpproxy-${uniqueId}"
}
Expand Down

0 comments on commit 9e831e6

Please sign in to comment.