Skip to content
This repository has been archived by the owner on Mar 16, 2024. It is now read-only.

add acorn run --update/-u flag to update app if exists #710

Merged
merged 4 commits into from
Nov 18, 2022

Conversation

iwilltry42
Copy link
Contributor

@iwilltry42 iwilltry42 commented Sep 24, 2022

  • triggers acorn update logic if app exists
  • does not work with --dev/-i
  • requires --name/-n to be specified

Ref #466

Notes

  • This is not 100% like kubectl apply, as that one does a 3-way patch merge, where it takes into account the last-applied-configuration annotation. This PR does not consider such annotations.

@iwilltry42 iwilltry42 self-assigned this Sep 24, 2022
@iwilltry42 iwilltry42 added this to the v.Next milestone Sep 24, 2022
Copy link
Member

@cjellick cjellick left a comment

Choose a reason for hiding this comment

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

At first blush, this looks good to me. I'm going to get @ibuildthecloud's input on it

@ibuildthecloud
Copy link
Member

ibuildthecloud commented Sep 30, 2022

I really want this, but the approach should be different. "Run -u" and "update" should be slightly different from each other. Basically "acorn run -u" should be like k8s update and "acorn update" should be like k8s patch.

update today will only change the fields you specify and not touch the other fields. Run -u should ensure all fields exactly match the arguments. So that means run -u will reset fields back to default values if the user didn't specify the flag.

@iwilltry42 iwilltry42 force-pushed the iwilltry42/issue466 branch from 4f6e10e to a28e461 Compare October 4, 2022 10:17
@cjellick
Copy link
Member

cjellick commented Oct 5, 2022

@iwilltry42 lets definitely try to get this one into v0.4.0. let me know when youve addressed @ibuildthecloud feedback. ill move the issue back to in progress

@cjellick cjellick removed this from the v.Next milestone Oct 5, 2022
@iwilltry42 iwilltry42 force-pushed the iwilltry42/issue466 branch 2 times, most recently from 9cb4391 to 5bad883 Compare November 14, 2022 20:30
- triggers acorn update logic if app exists
- does not work with --dev/-i
- requires --name/-n to be specified

Signed-off-by: Thorsten Klein <[email protected]>
@iwilltry42 iwilltry42 force-pushed the iwilltry42/issue466 branch 2 times, most recently from b2e6076 to 6a15bf1 Compare November 15, 2022 19:43
- new flags `acorn update --reset` and `acorn run --update` to trigger
  this behavior: undefined fields of an app updated with these flags
  will be reset to defaults

Signed-off-by: Thorsten Klein <[email protected]>
@iwilltry42
Copy link
Contributor Author

@ibuildthecloud does this come close to what you'd expect?

@cjellick
Copy link
Member

cjellick commented Nov 17, 2022

@ibuildthecloud mentioned the approach looks right but he wants a new command a different verb that is the equivalent of update --patch=false. We decided acorn replace should be that verb.

Can you add this @iwilltry42 ?

Moving this out to v0.4.1, which will basically be a milestone for this and one or two other issues that aren't quite ready.

edit: was just flag that needed chagned

docs/docs/100-reference/01-command-line/acorn_update.md Outdated Show resolved Hide resolved
pkg/client/app.go Outdated Show resolved Hide resolved
pkg/client/client.go Outdated Show resolved Hide resolved
@cjellick cjellick merged commit dca8d39 into acorn-io:main Nov 18, 2022
@iwilltry42 iwilltry42 deleted the iwilltry42/issue466 branch November 23, 2022 19:53
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 this pull request may close these issues.

3 participants