mirror of
https://github.com/argoproj/argo-cd.git
synced 2026-02-20 01:28:45 +01:00
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:
@@ -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
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
@@ -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
|
||||
Reference in New Issue
Block a user