Skip to content
This repository was archived by the owner on Feb 28, 2023. It is now read-only.

Commit b829b47

Browse files
authored
Merge pull request #23 from projectsyn/feat/expose-render-patch
Expose `renderPatch()` in component library
2 parents 99704ab + b1edd2b commit b829b47

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

lib/resource-locker.libjsonnet

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ local resource_locker_version =
2121
// Inject `id` for patches for resource-locker v1.x
2222
// Defaults to v1.x logic when image version cannot be determined from
2323
// parameters.
24-
local render_patch(patch) =
24+
local render_patch(patch, rl_version) =
2525
if (
26-
resource_locker_version != null &&
27-
std.startsWith(resource_locker_version, 'v0')
26+
rl_version != null &&
27+
std.startsWith(rl_version, 'v0')
2828
) then
2929
patch
3030
else
@@ -78,7 +78,8 @@ local patch(name, sa, targetobjref, patchtemplate, patchtype='application/strate
7878
targetObjectRef: targetobjref,
7979
patchTemplate: std.manifestYamlDoc(patchtemplate),
8080
patchType: patchtype,
81-
}
81+
},
82+
resource_locker_version
8283
) ],
8384
},
8485
};
@@ -214,4 +215,5 @@ local Patch(targetobj, patchtemplate, patchstrategy='application/strategic-merge
214215
apiVersion: apiVersion,
215216
Resource: Resource,
216217
Patch: Patch,
218+
renderPatch: render_patch,
217219
}

0 commit comments

Comments
 (0)