-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add SelectItem and extend Go Template engine with Sprig Functions (#50)
* Extend value with Sprig; Add .SelectedItem to template * Prepare for release of v0.11.0 * Clarify SelectedItem example [skip ci]
- Loading branch information
Showing
17 changed files
with
327 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,4 +5,4 @@ kind: Kustomization | |
images: | ||
- name: controller | ||
newName: kubemod/kubemod | ||
newTag: v0.10.0 | ||
newTag: v0.11.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
[{replace /spec/containers/0/image my-repo/nginx:1.14.2} {replace /spec/containers/2/image my-repo/nginx:1.15.2}] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
[{replace /spec/containers/0/image my-repo/nginx:1.14.2} {replace /spec/containers/2/image my-repo/nginx:1.15.2}] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
apiVersion: api.kubemod.io/v1beta1 | ||
kind: ModRule | ||
metadata: | ||
name: modrule-1 | ||
spec: | ||
type: Patch | ||
|
||
match: | ||
- select: '$.kind' | ||
matchValue: 'Pod' | ||
|
||
patch: | ||
- op: replace | ||
select: '$.spec.containers[? @.image =~ "repo1/.+"]' | ||
path: /spec/containers/#0/image | ||
value: '{{ regexReplaceAll "(.+)/(.*)" (index .SelectedItem "image") "my-repo/${2}" }}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
apiVersion: api.kubemod.io/v1beta1 | ||
kind: ModRule | ||
metadata: | ||
name: modrule-1 | ||
spec: | ||
type: Patch | ||
|
||
match: | ||
- select: '$.kind' | ||
matchValue: 'Pod' | ||
|
||
patch: | ||
- op: replace | ||
select: '$.spec.containers[? @.image =~ "repo1/.+"].image' | ||
path: /spec/containers/#0/image | ||
value: '{{ regexReplaceAll "(.+)/(.*)" .SelectedItem "my-repo/${2}" }}' |
Oops, something went wrong.