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

Stopped creating kapp app configmap during --diff-run #454

Merged
merged 10 commits into from
May 16, 2022

Conversation

sethiyash
Copy link
Contributor

  • kapp should not create kapp app configmap while doing any operation with --diff-run flag

@sethiyash sethiyash marked this pull request as draft March 8, 2022 17:23
@sethiyash sethiyash marked this pull request as ready for review March 11, 2022 05:49
@sethiyash sethiyash requested a review from a team March 11, 2022 05:49
@cppforlife
Copy link
Contributor

would recommend blocking merge of this issue on #450

@100mik
Copy link
Contributor

100mik commented Apr 27, 2022

I think we can rebase this on develop now.

pkg/kapp/app/recorded_app.go Outdated Show resolved Hide resolved
test/e2e/diff_test.go Outdated Show resolved Hide resolved
@praveenrewar
Copy link
Member

I am thinking if the effects of --diff-run should just be limited to creation of ConfigMap or should they also extend to updates as well. For example, if we use --labels x=y, along with --diff-run while updating an app, should these labels be added to the ConfigMap?

@neil-hickey
Copy link
Contributor

I am thinking if the effects of --diff-run should just be limited to creation of ConfigMap or should they also extend to updates as well. For example, if we use --labels x=y, along with --diff-run while updating an app, should these labels be added to the ConfigMap?

I would expect nothing to change on the cluster if I use --diff-run. No configmaps created, no labels added, no changes. So in my mind, the answer to should the labels be added is no.

@kumaritanushree
Copy link
Contributor

LGTM

@sethiyash
Copy link
Contributor Author

sethiyash commented May 10, 2022

Hi @praveenrewar,
As @neil-hickey correctly pointed out in the case of --diff-run ideally nothing should change on the cluster but currently when there is an update operation and the user do - kapp deploy -a test -f test.yaml --labels x=y --diff-run we are actually updating the configmap with labels even if it's a diff-run.

Please let me know your thoughts on changing this behaviour to not updating the configmap as part of this PR.

@neil-hickey
Copy link
Contributor

Please let me know your thoughts on changing this behaviour to not updating the configmap as part of this PR.

I'd vote for a separate issue / PR. This one should probably remain scoped to just the creation of the configmap.

Copy link
Contributor

@neil-hickey neil-hickey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@sethiyash
Copy link
Contributor Author

After discussion with the team, we have decided to address the update flow as part of this PR only.

Copy link
Contributor

@100mik 100mik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No super strong feelings about this one, just a thought

test/e2e/diff_test.go Show resolved Hide resolved
Copy link
Member

@praveenrewar praveenrewar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple of thoughts I had while taking a look.

  • If we are making sure that diff-run doesn't result in any change in the cluster, then we might have to make changes to the UsedGVs and UsedGKs because they will also be updating the ConfigMap.
  • Since we will have to make changes in so many places, it might make sense to have the isDiffRun in the RecordedApp itself so that we don't have to pass it along in so many places and use it just when required.
  • Another thing that might be worth exploring is if it's possible to have the dry run set for the whole client itself (but I guess that's not possible for the core client).

(I am totally okay with creating a separate PR for the updates)

pkg/kapp/app/recorded_app.go Outdated Show resolved Hide resolved
pkg/kapp/app/recorded_app.go Outdated Show resolved Hide resolved
@sethiyash sethiyash force-pushed the 432-diff-run branch 2 times, most recently from 7482fae to 92f6e72 Compare May 15, 2022 13:17
Copy link
Member

@praveenrewar praveenrewar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@praveenrewar praveenrewar merged commit 77ce86d into develop May 16, 2022
@praveenrewar praveenrewar deleted the 432-diff-run branch March 28, 2024 10:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

kapp creates state configmap on --diff-run
8 participants