Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kapp unblocks dependent changes if the changes which are depended upon already exists #729

Open
praveenrewar opened this issue Mar 28, 2023 · 1 comment
Labels
bug This issue describes a defect or unexpected behavior carvel accepted This issue should be considered for future work and that the triage process has been completed priority/unprioritized-backlog Higher priority than priority/awaiting-more-evidence but not planned. Contributions are welcome.

Comments

@praveenrewar
Copy link
Member

What steps did you take:
jobs.yaml

apiVersion: batch/v1
kind: Job
metadata:
  name: successful-job-1
  annotations:
    kapp.k14s.io/change-rule: "upsert after upserting abc"
spec:
  template:
    metadata:
      name: successful-job-1
    spec:
      containers:
        - name: successful-job-1
          image: busybox
          command: ["/bin/sh", "-c", "sleep 10"]
      restartPolicy: Never
---
apiVersion: batch/v1
kind: Job
metadata:
  name: successful-job-2
  annotations:
    kapp.k14s.io/change-group: "abc"
spec:
  template:
    metadata:
      name: successful-job-2
    spec:
      containers:
        - name: successful-job-2
          image: busybox
          command: ["/bin/sh", "-c", "sleep 10"]
      restartPolicy: Never

Deployed these jobs and stopped in between to create only job 1 without waiting for it.

kapp deploy -a order -f order.yaml
Target cluster 'https://192.168.64.12:8443' (nodes: minikube)

Changes

Namespace  Name              Kind  Age  Op      Op st.  Wait to    Rs  Ri
default    successful-job-1  Job   -    create  -       reconcile  -   -
^          successful-job-2  Job   -    create  -       reconcile  -   -

Op:      2 create, 0 delete, 0 update, 0 noop, 0 exists
Wait to: 2 reconcile, 0 delete, 0 noop

Continue? [yN]: y

6:28:20PM: ---- applying 1 changes [0/2 done] ----
6:28:20PM: create job/successful-job-2 (batch/v1) namespace: default
6:28:20PM: ---- waiting on 1 changes [0/2 done] ----
6:28:20PM: ongoing: reconcile job/successful-job-2 (batch/v1) namespace: default
6:28:20PM:  ^ Waiting to complete (0 active, 0 failed, 0 succeeded)
6:28:20PM:  L ongoing: waiting on pod/successful-job-2-jlwbz (v1) namespace: default
6:28:20PM:     ^ Pending: ContainerCreating
^C

Deploy the jobs again

kapp deploy -a order -f order.yaml
Target cluster 'https://192.168.64.12:8443' (nodes: minikube)

Changes

Namespace  Name              Kind  Age  Op      Op st.  Wait to    Rs       Ri
default    successful-job-1  Job   -    create  -       reconcile  -        -
^          successful-job-2  Job   5s   -       -       reconcile  ongoing  Waiting to complete (1 active, 0
                                                                            failed, 0 succeeded)

Op:      1 create, 0 delete, 0 update, 1 noop, 0 exists
Wait to: 2 reconcile, 0 delete, 0 noop

Continue? [yN]: y

6:28:27PM: ---- applying 2 changes [0/2 done] ----
6:28:27PM: noop job/successful-job-2 (batch/v1) namespace: default
6:28:27PM: create job/successful-job-1 (batch/v1) namespace: default
6:28:27PM: ---- waiting on 2 changes [0/2 done] ----
6:28:27PM: ongoing: reconcile job/successful-job-2 (batch/v1) namespace: default
... snip ...
6:28:48PM:  ^ Completed
6:28:48PM: ---- applying complete [2/2 done] ----
6:28:48PM: ---- waiting complete [2/2 done] ----

Succeeded

What happened:
Even though successful-job-2 depends on successful-job-1 kapp tried to create successful-job-2 before waiting for successful-job-1 if the operation is noop for it.

What did you expect:
kapp should have waited for successful-job-1 to be created successfully before deploying successful-job-2.

Environment:

  • kapp version (use kapp --version):
  • OS (e.g. from /etc/os-release):
  • Kubernetes version (use kubectl version)

Vote on this request

This is an invitation to the community to vote on issues, to help us prioritize our backlog. Use the "smiley face" up to the right of this comment to vote.

👍 "I would like to see this addressed as soon as possible"
👎 "There are other more important things to focus on right now"

We are also happy to receive and review Pull Requests if you want to help working on this issue.

@praveenrewar praveenrewar added bug This issue describes a defect or unexpected behavior carvel triage This issue has not yet been reviewed for validity labels Mar 28, 2023
@github-actions
Copy link

github-actions bot commented May 8, 2023

This issue is being marked as stale due to a long period of inactivity and will be closed in 5 days if there is no response.

@github-actions github-actions bot added the stale This issue has had no activity for a while and will be closed soon label May 8, 2023
@praveenrewar praveenrewar removed the stale This issue has had no activity for a while and will be closed soon label May 8, 2023
@praveenrewar praveenrewar added carvel accepted This issue should be considered for future work and that the triage process has been completed priority/unprioritized-backlog Higher priority than priority/awaiting-more-evidence but not planned. Contributions are welcome. and removed carvel triage This issue has not yet been reviewed for validity labels May 17, 2023
@praveenrewar praveenrewar moved this to Unprioritized in Carvel May 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue describes a defect or unexpected behavior carvel accepted This issue should be considered for future work and that the triage process has been completed priority/unprioritized-backlog Higher priority than priority/awaiting-more-evidence but not planned. Contributions are welcome.
Projects
Status: Unprioritized
Development

No branches or pull requests

1 participant