gyfora commented on code in PR #1049:
URL:
https://github.com/apache/flink-kubernetes-operator/pull/1049#discussion_r2732688800
##########
flink-kubernetes-operator/src/main/java/org/apache/flink/kubernetes/operator/controller/bluegreen/BlueGreenDeploymentService.java:
##########
@@ -605,9 +606,91 @@ public UpdateControl<FlinkBlueGreenDeployment>
finalizeBlueGreenDeployment(
context.getDeploymentStatus().setAbortTimestamp(millisToInstantStr(0));
context.getDeploymentStatus().setSavepointTriggerId(null);
+ try {
+ updateBlueGreenIngress(context, nextState);
+ } catch (Exception e) {
+ var error =
+ "Could not reconcile ingress during finalization. Details:
" + e.getMessage();
+ LOG.error(error, e);
+ return markDeploymentFailing(context, error);
+ }
return patchStatusUpdateControl(context, nextState, JobStatus.RUNNING,
null);
}
+ /**
+ * Reconciles ingress for the active deployment in ACTIVE states. This
handles ingress spec
+ * changes that occur while the deployment is stable (not transitioning).
+ *
+ * @param context the Blue/Green context
+ * @param activeDeploymentType which deployment (BLUE or GREEN) is
currently active
+ */
+ public void reconcileIngressForActiveDeployment(
+ BlueGreenContext context, BlueGreenDeploymentType
activeDeploymentType) {
+ FlinkDeployment activeDeployment =
context.getDeploymentByType(activeDeploymentType);
+ if (activeDeployment == null) {
+ return;
+ }
+
+ var flinkResourceContext =
+ context.getCtxFactory()
+ .getResourceContext(activeDeployment,
context.getJosdkContext());
+
+ if (!flinkResourceContext.getOperatorConfig().isManageIngress()) {
+ return;
+ }
+
+ try {
+ IngressUtils.reconcileBlueGreenIngress(
+ context,
+ true,
+ activeDeployment,
+
flinkResourceContext.getDeployConfig(activeDeployment.getSpec()),
+ context.getJosdkContext());
+ } catch (Exception e) {
+ LOG.error(
+ "Failed to reconcile ingress for active deployment: {}",
+ activeDeployment.getMetadata().getName(),
+ e);
+ // Don't fail the entire reconciliation just because ingress
reconciliation failed
Review Comment:
Why would this fail in a way that we don't actually want to retry?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]