Skip to content

Commit

Permalink
feat: add support for getting the replicaset name via templating (arg…
Browse files Browse the repository at this point in the history
…oproj#2396)

Signed-off-by: zachaller <[email protected]>

Signed-off-by: zachaller <[email protected]>
  • Loading branch information
zachaller authored and jandersen-plaid committed Nov 26, 2022
1 parent 3d2b2ad commit 40fb1c9
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions utils/template/template.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const (
openBracket = "{{"
closeBracket = "}}"
experimentPodTemplateHash = "templates.%s.podTemplateHash"
experimentReplicasetName = "templates.%s.replicaset.name"
experimentAvailableAt = "experiment.availableAt"
experimentEndsAt = "experiment.finishedAt"
)
Expand All @@ -41,6 +42,7 @@ func ResolveExperimentArgsValue(argTemplate string, ex *v1alpha1.Experiment, tem
for _, template := range ex.Spec.Templates {
if rs, ok := templateRSs[template.Name]; ok {
argsMap[fmt.Sprintf(experimentPodTemplateHash, template.Name)] = rs.Labels[v1alpha1.DefaultRolloutUniqueLabelKey]
argsMap[fmt.Sprintf(experimentReplicasetName, template.Name)] = rs.Name
}
}
return resolve(t, argsMap)
Expand Down

0 comments on commit 40fb1c9

Please sign in to comment.