Skip to content

Commit

Permalink
update the starlark configmap example to work with latest kpt
Browse files Browse the repository at this point in the history
  • Loading branch information
Mengqi Yu committed Mar 22, 2022
1 parent 7668d55 commit af8ff6a
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,7 @@ def setReplicas(resources, replicas):
if r["apiVersion"] == "apps/v1" and r["kind"] == "Deployment":
r["spec"]["replicas"] = replicas

replicas = ctx.resource_list["functionConfig"]["data"]["replicas"]
# The functionConfig is a ConfigMap, so the replicas we got from field
# functionConfig.data.replicas is a string. We nned to convert it to a int.
replicas = int(ctx.resource_list["functionConfig"]["data"]["replicas"])
setReplicas(ctx.resource_list["items"], replicas)

0 comments on commit af8ff6a

Please sign in to comment.