-
Notifications
You must be signed in to change notification settings - Fork 383
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
provider: EG should not provision if parametersRef
not found
#5081
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #5081 +/- ##
==========================================
+ Coverage 66.82% 66.93% +0.10%
==========================================
Files 210 210
Lines 32957 32945 -12
==========================================
+ Hits 22024 22052 +28
+ Misses 9601 9564 -37
+ Partials 1332 1329 -3 ☔ View full report in Codecov by Sentry. |
ec1bcd6
to
99ed84d
Compare
parametersRef
not found
tools/make/kube.mk
Outdated
@@ -138,10 +138,10 @@ kube-demo-undeploy: ## Uninstall the Kubernetes resources installed from the `ma | |||
# tools/hack/run-kube-local.sh | |||
|
|||
.PHONY: conformance | |||
conformance: create-cluster kube-install-image kube-deploy run-conformance delete-cluster ## Create a kind cluster, deploy EG into it, run Gateway API conformance, and clean up. | |||
conformance: create-cluster kube-install-image kube-deploy install-eg-addons run-conformance delete-cluster ## Create a kind cluster, deploy EG into it, run Gateway API conformance, and clean up. |
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.
GC(envoy-gateway) refernece EnvoyProxy(proxy-config), that make service monitoring/otel-collector
is 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.
is this because we are using the same GC for conformance and e2e ? should we maintain 2 different GatewayClasses to keep each test suite more lightweight ?
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.
yes, we can do that 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.
wait #5091
@@ -568,8 +568,7 @@ func (r *gatewayAPIReconciler) updateStatusForGateway(ctx context.Context, gtw * | |||
r.log.Info("failed to get Service for gateway", | |||
"namespace", gtw.Namespace, "name", gtw.Name) | |||
} | |||
// update accepted condition | |||
status.UpdateGatewayStatusAcceptedCondition(gtw, true) |
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.
curious why this was removed
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.
I think we should respect the logic in controller.go
.
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 made gateway always accepted, even the ref EnvoyProxy is not found.
7aabde8
to
68ca8eb
Compare
} | ||
// Set Gateway as accepted to passed test? | ||
status.SetGatewayAccepted(>w, true, gwapiv1.GatewayReasonAccepted, "The Gateway has not been scheduled by Envoy Gateway") |
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.
@arkodg do you think we should remove this and update the test.
because now we reply the final result in translator.
Signed-off-by: zirain <[email protected]>
Signed-off-by: zirain <[email protected]>
status: "False" | ||
type: ListenersNotValid |
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 seems not right, GatewayConditionType only allow Accepted
and Programmed
.
fmt.Sprintf("Invalid metrics backendRefs: %v", err)) | ||
return | ||
} | ||
|
||
// need explicit setting accepted status to true, as the status may have been set to false in previous loop, | ||
// e.g. when access log backendRefs created later than the Gateway or EnvoyProxy. |
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 is unnecessary, as the Gateway status is always set to nil in every translation loop. Addtionally, setting Gatway Accepted status solely based on the listener status here can be confusing and should be avoided.
gateway/internal/provider/kubernetes/controller.go
Lines 1002 to 1009 in 126d507
// Discard Status to reduce memory consumption in watchable | |
// It will be recomputed by the gateway-api layer | |
gtw.Status = gwapiv1.GatewayStatus{} | |
if !resourceMap.allAssociatedGateways.Has(gtwNamespacedName) { | |
resourceMap.allAssociatedGateways.Insert(gtwNamespacedName) | |
resourceTree.Gateways = append(resourceTree.Gateways, >w) | |
} | |
} |
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's necessary during the test.
if accepted { | ||
status = metav1.ConditionTrue | ||
} | ||
cond := newCondition(string(gwapiv1.GatewayReasonAccepted), status, string(reason), message, time.Now(), gw.Generation) |
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.
cond := newCondition(string(gwapiv1.GatewayReasonAccepted), status, string(reason), message, time.Now(), gw.Generation) | |
cond := newCondition(string(gwapiv1.GatewayConditionAccepted), status, string(reason), message, time.Now(), gw.Generation) |
@@ -940,7 +940,13 @@ func (r *gatewayAPIReconciler) processGateways(ctx context.Context, managedGC *g | |||
|
|||
if err := r.processGatewayParamsRef(ctx, >w, resourceMap, resourceTree); err != nil { | |||
r.log.Error(err, "failed to process infrastructure.parametersRef for gateway", "namespace", gtw.Namespace, "name", gtw.Name) | |||
status.SetGatewayAccepted(>w, false, gwapiv1.GatewayReasonInvalidParameters, err.Error()) | |||
r.updateGatewayStatus(>w) |
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.
r.updateGatewayStatus
is used to trigger a dummy Gateway Status update event to update the gateway IP address and can't be used for update Accepted status.
I suggest to add the Accepted status to the Gateway resource and pass it to the Gateway API translator to handle it.
fixes: #5080