mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-12 01:14:22 +00:00
Merge pull request #137 from babiel/add-cronjob-to-refvars
Add CronJob to refvars transformer
This commit is contained in:
@@ -41,6 +41,31 @@ diff -u -N /tmp/noop/apps_v1beta1_StatefulSet_cockroachdb.yaml /tmp/transformed/
|
|||||||
terminationGracePeriodSeconds: 60
|
terminationGracePeriodSeconds: 60
|
||||||
volumes:
|
volumes:
|
||||||
- name: datadir
|
- name: datadir
|
||||||
|
diff -u -N /tmp/noop/batch_v1beta1_CronJob_cronjob-example.yaml /tmp/transformed/batch_v1beta1_CronJob_cronjob-example.yaml
|
||||||
|
--- /tmp/noop/batch_v1beta1_CronJob_cronjob-example.yaml YYYY-MM-DD HH:MM:SS
|
||||||
|
+++ /tmp/transformed/batch_v1beta1_CronJob_cronjob-example.yaml YYYY-MM-DD HH:MM:SS
|
||||||
|
@@ -1,7 +1,7 @@
|
||||||
|
apiVersion: batch/v1beta1
|
||||||
|
kind: CronJob
|
||||||
|
metadata:
|
||||||
|
- name: base-cronjob-example
|
||||||
|
+ name: dev-base-cronjob-example
|
||||||
|
spec:
|
||||||
|
concurrencyPolicy: Forbid
|
||||||
|
jobTemplate:
|
||||||
|
@@ -11,10 +11,10 @@
|
||||||
|
containers:
|
||||||
|
- command:
|
||||||
|
- echo
|
||||||
|
- - base-cockroachdb
|
||||||
|
+ - dev-base-cockroachdb
|
||||||
|
env:
|
||||||
|
- name: CDB_PUBLIC_SVC
|
||||||
|
- value: base-cockroachdb-public
|
||||||
|
+ value: dev-base-cockroachdb-public
|
||||||
|
image: cockroachdb/cockroach:v1.1.5
|
||||||
|
name: cronjob-example
|
||||||
|
schedule: '*/1 * * * *'
|
||||||
diff -u -N /tmp/noop/policy_v1beta1_PodDisruptionBudget_cockroachdb-budget.yaml /tmp/transformed/policy_v1beta1_PodDisruptionBudget_cockroachdb-budget.yaml
|
diff -u -N /tmp/noop/policy_v1beta1_PodDisruptionBudget_cockroachdb-budget.yaml /tmp/transformed/policy_v1beta1_PodDisruptionBudget_cockroachdb-budget.yaml
|
||||||
--- /tmp/noop/policy_v1beta1_PodDisruptionBudget_cockroachdb-budget.yaml YYYY-MM-DD HH:MM:SS
|
--- /tmp/noop/policy_v1beta1_PodDisruptionBudget_cockroachdb-budget.yaml YYYY-MM-DD HH:MM:SS
|
||||||
+++ /tmp/transformed/policy_v1beta1_PodDisruptionBudget_cockroachdb-budget.yaml YYYY-MM-DD HH:MM:SS
|
+++ /tmp/transformed/policy_v1beta1_PodDisruptionBudget_cockroachdb-budget.yaml YYYY-MM-DD HH:MM:SS
|
||||||
|
|||||||
@@ -192,6 +192,27 @@ spec:
|
|||||||
requests:
|
requests:
|
||||||
storage: 1Gi
|
storage: 1Gi
|
||||||
---
|
---
|
||||||
|
apiVersion: batch/v1beta1
|
||||||
|
kind: CronJob
|
||||||
|
metadata:
|
||||||
|
name: dev-base-cronjob-example
|
||||||
|
spec:
|
||||||
|
concurrencyPolicy: Forbid
|
||||||
|
jobTemplate:
|
||||||
|
spec:
|
||||||
|
template:
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- command:
|
||||||
|
- echo
|
||||||
|
- dev-base-cockroachdb
|
||||||
|
env:
|
||||||
|
- name: CDB_PUBLIC_SVC
|
||||||
|
value: dev-base-cockroachdb-public
|
||||||
|
image: cockroachdb/cockroach:v1.1.5
|
||||||
|
name: cronjob-example
|
||||||
|
schedule: '*/1 * * * *'
|
||||||
|
---
|
||||||
apiVersion: policy/v1beta1
|
apiVersion: policy/v1beta1
|
||||||
kind: PodDisruptionBudget
|
kind: PodDisruptionBudget
|
||||||
metadata:
|
metadata:
|
||||||
|
|||||||
20
pkg/commands/testdata/testcase-variable-ref/in/package/cronjob.yaml
vendored
Normal file
20
pkg/commands/testdata/testcase-variable-ref/in/package/cronjob.yaml
vendored
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
apiVersion: batch/v1beta1
|
||||||
|
kind: CronJob
|
||||||
|
metadata:
|
||||||
|
name: cronjob-example
|
||||||
|
spec:
|
||||||
|
schedule: "*/1 * * * *"
|
||||||
|
concurrencyPolicy: Forbid
|
||||||
|
jobTemplate:
|
||||||
|
spec:
|
||||||
|
template:
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: cronjob-example
|
||||||
|
image: cockroachdb/cockroach:v1.1.5
|
||||||
|
command:
|
||||||
|
- echo
|
||||||
|
- "$(CDB_STATEFULSET_NAME)"
|
||||||
|
env:
|
||||||
|
- name: CDB_PUBLIC_SVC
|
||||||
|
value: "$(CDB_PUBLIC_SVC)"
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
namePrefix: base-
|
namePrefix: base-
|
||||||
resources:
|
resources:
|
||||||
- cockroachdb-statefulset-secure.yaml
|
- cockroachdb-statefulset-secure.yaml
|
||||||
|
- cronjob.yaml
|
||||||
vars:
|
vars:
|
||||||
- name: CDB_PUBLIC_SVC
|
- name: CDB_PUBLIC_SVC
|
||||||
objref:
|
objref:
|
||||||
|
|||||||
@@ -38,6 +38,10 @@ func NewRefVarTransformer(vars map[string]string) (Transformer, error) {
|
|||||||
GroupVersionKind: &schema.GroupVersionKind{Kind: "Job"},
|
GroupVersionKind: &schema.GroupVersionKind{Kind: "Job"},
|
||||||
Path: []string{"spec", "template", "spec", "containers", "command"},
|
Path: []string{"spec", "template", "spec", "containers", "command"},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
GroupVersionKind: &schema.GroupVersionKind{Kind: "CronJob"},
|
||||||
|
Path: []string{"spec", "jobTemplate", "spec", "template", "spec", "containers", "command"},
|
||||||
|
},
|
||||||
{
|
{
|
||||||
GroupVersionKind: &schema.GroupVersionKind{Kind: "StatefulSet"},
|
GroupVersionKind: &schema.GroupVersionKind{Kind: "StatefulSet"},
|
||||||
Path: []string{"spec", "template", "spec", "initContainers", "args"},
|
Path: []string{"spec", "template", "spec", "initContainers", "args"},
|
||||||
@@ -58,6 +62,10 @@ func NewRefVarTransformer(vars map[string]string) (Transformer, error) {
|
|||||||
GroupVersionKind: &schema.GroupVersionKind{Kind: "Job"},
|
GroupVersionKind: &schema.GroupVersionKind{Kind: "Job"},
|
||||||
Path: []string{"spec", "template", "spec", "containers", "args"},
|
Path: []string{"spec", "template", "spec", "containers", "args"},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
GroupVersionKind: &schema.GroupVersionKind{Kind: "CronJob"},
|
||||||
|
Path: []string{"spec", "jobTemplate", "spec", "template", "spec", "containers", "args"},
|
||||||
|
},
|
||||||
{
|
{
|
||||||
GroupVersionKind: &schema.GroupVersionKind{Kind: "StatefulSet"},
|
GroupVersionKind: &schema.GroupVersionKind{Kind: "StatefulSet"},
|
||||||
Path: []string{"spec", "template", "spec", "initContainers", "env", "value"},
|
Path: []string{"spec", "template", "spec", "initContainers", "env", "value"},
|
||||||
@@ -78,6 +86,10 @@ func NewRefVarTransformer(vars map[string]string) (Transformer, error) {
|
|||||||
GroupVersionKind: &schema.GroupVersionKind{Kind: "Job"},
|
GroupVersionKind: &schema.GroupVersionKind{Kind: "Job"},
|
||||||
Path: []string{"spec", "template", "spec", "containers", "env", "value"},
|
Path: []string{"spec", "template", "spec", "containers", "env", "value"},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
GroupVersionKind: &schema.GroupVersionKind{Kind: "CronJob"},
|
||||||
|
Path: []string{"spec", "jobTemplate", "spec", "template", "spec", "containers", "env", "value"},
|
||||||
|
},
|
||||||
{
|
{
|
||||||
GroupVersionKind: &schema.GroupVersionKind{Kind: "Pod"},
|
GroupVersionKind: &schema.GroupVersionKind{Kind: "Pod"},
|
||||||
Path: []string{"spec", "containers", "command"},
|
Path: []string{"spec", "containers", "command"},
|
||||||
|
|||||||
Reference in New Issue
Block a user