Skip to content

Instantly share code, notes, and snippets.

@cari-lynn
Created November 12, 2021 00:10
Show Gist options
  • Save cari-lynn/b8c78d0ee82f7b5fc7e6208a24f5a380 to your computer and use it in GitHub Desktop.
Save cari-lynn/b8c78d0ee82f7b5fc7e6208a24f5a380 to your computer and use it in GitHub Desktop.
Overlay replace modify values with lambda
spec:
replicas: 1
resources:
limits:
cpu: 400m
memory: 600Mi
requests:
cpu: 400m
memory: 600Mi
#@ load("@ytt:overlay","overlay")
#@overlay/match by=overlay.all
---
spec:
replicas: 1
resources:
limits:
cpu: 400m
memory: 600Mi
requests:
#@overlay/replace via=lambda original, _: str(int(original[:-1]) * 0.5) + "m"
cpu: 400m
memory: 600Mi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment