Skip to content
This repository has been archived by the owner on Nov 1, 2022. It is now read-only.

Verifying CronJob fails #1126

Closed
squaremo opened this issue Jun 7, 2018 · 0 comments · Fixed by #1133
Closed

Verifying CronJob fails #1126

squaremo opened this issue Jun 7, 2018 · 0 comments · Fixed by #1133

Comments

@squaremo
Copy link
Member

squaremo commented Jun 7, 2018

If I put this is my test repository:

---
apiVersion: batch/v1beta1
kind: CronJob
metadata:
  namespace: default
  name: weekly-curl-homepage
  annotations:
    weave.works.some-annotation: Just for fidelity
spec:
  # Here is a multiline comment
  # to replicate the origin YAML closely
  schedule: "5 18 * * 3"
  # Deleting jobs after they're done will clean up their 'Completed' pods,
  # thereby avoiding spurious PodNotReady alerts
  successfulJobsHistoryLimit: 0
  jobTemplate:
    spec:
      template:
        spec:
          restartPolicy: OnFailure
          containers:
          - name: weekly-curl-homepage
            image: centos:7 # Has curl installed by default
            imagePullPolicy: Always
            command:
            - /bin/curl
            args:
            - -X
            - GET
            - https://weave.works/

then I cannot update it.

First theory: it hits a corner case of ruamel (the python YAML parser in kubeyaml), which mangles it. But

./bin/kubeyaml image --namespace default --kind CronJob --name weekly-curl-homepage --container weekly-curl-homepage --image centos:foo < cronjob.yaml

outputs the result just fine.

Second theory: we're parsing or interpreting the manifest wrong in cluster/kubernetes/resource/cronjob.go -- yet to test this.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants