Skip to content

Commit

Permalink
Fix cronjob version in manifest used for tests (#30733)
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrsMark authored Mar 9, 2022
1 parent 3560733 commit 644d026
Show file tree
Hide file tree
Showing 9 changed files with 11 additions and 17 deletions.
3 changes: 1 addition & 2 deletions deploy/kubernetes/elastic-agent-managed-kubernetes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,7 @@ rules:
- apiGroups: [ "batch" ]
resources:
- jobs
# Uncomment if need metadata for cronjob objects in versions >= v1.21
#- cronjobs
- cronjobs
verbs: [ "get", "list", "watch" ]
# required for apiserver
- nonResourceURLs:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@ rules:
- apiGroups: [ "batch" ]
resources:
- jobs
# Uncomment if need metadata for cronjob objects in versions >= v1.21
#- cronjobs
- cronjobs
verbs: [ "get", "list", "watch" ]
# required for apiserver
- nonResourceURLs:
Expand Down
3 changes: 1 addition & 2 deletions deploy/kubernetes/elastic-agent-standalone-kubernetes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -703,8 +703,7 @@ rules:
- apiGroups: ["batch"]
resources:
- jobs
# Uncomment if need metadata for cronjob objects in versions >= v1.21
#- cronjobs
- cronjobs
verbs: ["get", "list", "watch"]
- apiGroups:
- ""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ rules:
- apiGroups: ["batch"]
resources:
- jobs
# Uncomment if need metadata for cronjob objects in versions >= v1.21
#- cronjobs
- cronjobs
verbs: ["get", "list", "watch"]
- apiGroups:
- ""
Expand Down
3 changes: 1 addition & 2 deletions deploy/kubernetes/metricbeat-kubernetes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -298,8 +298,7 @@ rules:
- apiGroups: ["batch"]
resources:
- jobs
# Uncomment if need metadata for cronjob objects in versions >= v1.21
#- cronjobs
- cronjobs
verbs: ["get", "list", "watch"]
- apiGroups:
- ""
Expand Down
3 changes: 1 addition & 2 deletions deploy/kubernetes/metricbeat/metricbeat-role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ rules:
- apiGroups: ["batch"]
resources:
- jobs
# Uncomment if need metadata for cronjob objects in versions >= v1.21
#- cronjobs
- cronjobs
verbs: ["get", "list", "watch"]
- apiGroups:
- ""
Expand Down
2 changes: 1 addition & 1 deletion dev-tools/mage/kubernetes/kind.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func (m *KindIntegrationTestStep) Use(dir string) (bool, error) {

// Setup ensures that a kubernetes cluster is up and running.
//
// If `KUBECONFIG` is already deinfed in the env then it will do nothing.
// If `KUBECONFIG` is already defined in the env then it will do nothing.
func (m *KindIntegrationTestStep) Setup(env map[string]string) error {

envVars := []string{"KUBECONFIG", "KUBE_CONFIG"}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Cronjob that will execute each minute.
# It will print a message and sleep (reporting being active) for 5 seconds

apiVersion: batch/v1beta1
apiVersion: batch/v1
kind: CronJob
metadata:
name: mycronjob
Expand All @@ -16,7 +16,7 @@ spec:
image: alpine
imagePullPolicy: IfNotPresent
command: ['sh', '-c', 'echo elastic world ; sleep 5']

restartPolicy: OnFailure
terminationGracePeriodSeconds: 0
concurrencyPolicy: Allow
concurrencyPolicy: Allow
2 changes: 1 addition & 1 deletion metricbeat/module/kubernetes/kubernetes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ spec:
requests:
storage: 1Mi
---
apiVersion: batch/v1beta1
apiVersion: batch/v1
kind: CronJob
metadata:
name: basic-cronjob
Expand Down

0 comments on commit 644d026

Please sign in to comment.