fix: set correct path to metadata for numa rollout pause actions (#24280)

Signed-off-by: Dillen Padhiar <dillen_padhiar@intuit.com>
This commit is contained in:
Dillen Padhiar
2025-08-27 11:59:59 -07:00
committed by GitHub
parent 68e5a4a12c
commit 8c3b78ef88
12 changed files with 42 additions and 42 deletions

View File

@@ -20,12 +20,12 @@ if obj.spec.monoVertex.spec.lifecycle ~= nil and obj.spec.monoVertex.spec.lifecy
paused = true
end
if paused then
if obj.spec.monoVertex.spec.metadata ~= nil and obj.spec.monoVertex.spec.metadata.annotations ~= nil and obj.spec.monoVertex.spec.metadata.annotations["numaflow.numaproj.io/allowed-resume-strategies"] ~= nil then
if obj.spec.monoVertex.metadata ~= nil and obj.spec.monoVertex.metadata.annotations ~= nil and obj.spec.monoVertex.metadata.annotations["numaflow.numaproj.io/allowed-resume-strategies"] ~= nil then
-- determine which unpausing strategies will be enabled
-- if annotation not found, default will be resume slow
if obj.spec.monoVertex.spec.metadata.annotations["numaflow.numaproj.io/allowed-resume-strategies"] == "fast" then
if obj.spec.monoVertex.metadata.annotations["numaflow.numaproj.io/allowed-resume-strategies"] == "fast" then
actions["unpause-fast"]["disabled"] = false
elseif obj.spec.monoVertex.spec.metadata.annotations["numaflow.numaproj.io/allowed-resume-strategies"] == "slow, fast" then
elseif obj.spec.monoVertex.metadata.annotations["numaflow.numaproj.io/allowed-resume-strategies"] == "slow, fast" then
actions["unpause-gradual"]["disabled"] = false
actions["unpause-fast"]["disabled"] = false
else

View File

@@ -16,10 +16,10 @@ metadata:
uid: a63f377e-1500-437e-9267-579f4a790518
spec:
monoVertex:
metadata:
annotations:
numaflow.numaproj.io/allowed-resume-strategies: "slow, fast"
spec:
metadata:
annotations:
numaflow.numaproj.io/allowed-resume-strategies: "slow, fast"
lifecycle:
desiredPhase: Paused
sink:

View File

@@ -16,10 +16,10 @@ metadata:
uid: a63f377e-1500-437e-9267-579f4a790518
spec:
monoVertex:
metadata:
annotations:
numaflow.numaproj.io/allowed-resume-strategies: "slow, fast"
spec:
metadata:
annotations:
numaflow.numaproj.io/allowed-resume-strategies: "slow, fast"
lifecycle:
desiredPhase: Running
sink:

View File

@@ -16,10 +16,10 @@ metadata:
uid: a63f377e-1500-437e-9267-579f4a790518
spec:
monoVertex:
metadata:
annotations:
numaflow.numaproj.io/allowed-resume-strategies: "slow, fast"
spec:
metadata:
annotations:
numaflow.numaproj.io/allowed-resume-strategies: "slow, fast"
replicas: null
lifecycle:
desiredPhase: Running

View File

@@ -16,10 +16,10 @@ metadata:
uid: a63f377e-1500-437e-9267-579f4a790518
spec:
monoVertex:
metadata:
annotations:
numaflow.numaproj.io/allowed-resume-strategies: "slow, fast"
spec:
metadata:
annotations:
numaflow.numaproj.io/allowed-resume-strategies: "slow, fast"
sink:
udsink:
container:

View File

@@ -30,12 +30,12 @@ if obj.spec.pipeline.spec.lifecycle ~= nil and obj.spec.pipeline.spec.lifecycle.
paused = true
end
if paused then
if obj.spec.pipeline.spec.metadata ~= nil and obj.spec.pipeline.spec.metadata.annotations ~= nil and obj.spec.pipeline.spec.metadata.annotations["numaflow.numaproj.io/allowed-resume-strategies"] ~= nil then
if obj.spec.pipeline.metadata ~= nil and obj.spec.pipeline.metadata.annotations ~= nil and obj.spec.pipeline.metadata.annotations["numaflow.numaproj.io/allowed-resume-strategies"] ~= nil then
-- determine which unpausing strategies will be enabled
-- if annotation not found, default will be resume slow
if obj.spec.pipeline.spec.metadata.annotations["numaflow.numaproj.io/allowed-resume-strategies"] == "fast" then
if obj.spec.pipeline.metadata.annotations["numaflow.numaproj.io/allowed-resume-strategies"] == "fast" then
actions["unpause-fast"]["disabled"] = false
elseif obj.spec.pipeline.spec.metadata.annotations["numaflow.numaproj.io/allowed-resume-strategies"] == "slow, fast" then
elseif obj.spec.pipeline.metadata.annotations["numaflow.numaproj.io/allowed-resume-strategies"] == "slow, fast" then
actions["unpause-gradual"]["disabled"] = false
actions["unpause-fast"]["disabled"] = false
else

View File

@@ -14,10 +14,10 @@ metadata:
uid: ab9286a1-f453-433e-846e-48900ab2068a
spec:
pipeline:
metadata:
annotations:
numaflow.numaproj.io/allowed-resume-strategies: "slow, fast"
spec:
metadata:
annotations:
numaflow.numaproj.io/allowed-resume-strategies: "slow, fast"
lifecycle:
desiredPhase: Paused
edges:

View File

@@ -14,11 +14,11 @@ metadata:
uid: ab9286a1-f453-433e-846e-48900ab2068a
spec:
pipeline:
metadata:
annotations:
numaflow.numaproj.io/resume-strategy: "fast"
numaflow.numaproj.io/allowed-resume-strategies: "slow, fast"
spec:
metadata:
annotations:
numaflow.numaproj.io/resume-strategy: "fast"
numaflow.numaproj.io/allowed-resume-strategies: "slow, fast"
lifecycle:
desiredPhase: Running
edges:

View File

@@ -14,11 +14,11 @@ metadata:
uid: ab9286a1-f453-433e-846e-48900ab2068a
spec:
pipeline:
metadata:
annotations:
numaflow.numaproj.io/resume-strategy: "slow"
numaflow.numaproj.io/allowed-resume-strategies: "slow, fast"
spec:
metadata:
annotations:
numaflow.numaproj.io/resume-strategy: "slow"
numaflow.numaproj.io/allowed-resume-strategies: "slow, fast"
lifecycle:
desiredPhase: Running
edges:

View File

@@ -14,10 +14,10 @@ metadata:
uid: ab9286a1-f453-433e-846e-48900ab2068a
spec:
pipeline:
metadata:
annotations:
numaflow.numaproj.io/allowed-resume-strategies: "slow, fast"
spec:
metadata:
annotations:
numaflow.numaproj.io/allowed-resume-strategies: "slow, fast"
edges:
- from: in
to: cat

View File

@@ -1,9 +1,9 @@
obj.spec.pipeline.spec.lifecycle.desiredPhase = "Running"
if obj.spec.pipeline.spec.metadata == nil then
obj.spec.pipeline.spec.metadata = {}
if obj.spec.pipeline.metadata == nil then
obj.spec.pipeline.metadata = {}
end
if obj.spec.pipeline.spec.metadata.annotations == nil then
obj.spec.pipeline.spec.metadata.annotations = {}
if obj.spec.pipeline.metadata.annotations == nil then
obj.spec.pipeline.metadata.annotations = {}
end
obj.spec.pipeline.spec.metadata.annotations["numaflow.numaproj.io/resume-strategy"] = "fast"
obj.spec.pipeline.metadata.annotations["numaflow.numaproj.io/resume-strategy"] = "fast"
return obj

View File

@@ -1,9 +1,9 @@
obj.spec.pipeline.spec.lifecycle.desiredPhase = "Running"
if obj.spec.pipeline.spec.metadata == nil then
obj.spec.pipeline.spec.metadata = {}
if obj.spec.pipeline.metadata == nil then
obj.spec.pipeline.metadata = {}
end
if obj.spec.pipeline.spec.metadata.annotations == nil then
obj.spec.pipeline.spec.metadata.annotations = {}
if obj.spec.pipeline.metadata.annotations == nil then
obj.spec.pipeline.metadata.annotations = {}
end
obj.spec.pipeline.spec.metadata.annotations["numaflow.numaproj.io/resume-strategy"] = "slow"
obj.spec.pipeline.metadata.annotations["numaflow.numaproj.io/resume-strategy"] = "slow"
return obj