runtime icon indicating copy to clipboard operation
runtime copied to clipboard

Feature request: Implement "acorn apply" like behavior

Open hikhvar opened this issue 1 year ago • 4 comments

To install an app and than update it, one must do a acorn run --name foo and than on any follow up changes must run acorn update foo. It would be really cool to have something like acorn apply --name foo or similar to helm an acorn update --install foo. This would allow easy docs in new projects. We just have to document the single command to run and update the app if already present.

Moreover, this will ease the setup of CD steps in pipelines, since we must not distinguish in the pipeline between first install and later updates.

hikhvar avatar Aug 05 '22 07:08 hikhvar

We plan to add a feature like this. If you are not aware you can do acorn run -o yaml ... which will give you the YAML output of the run command. So what your are asking for is basically the opposite where we take in that yaml. (dumb hack right now is to actually do acorn run -o yaml .... and then edit the yaml and apply with kubectl apply. We want a acorn native way to do that, but it is technically possible because acorn API is just a custom k8s api).

ibuildthecloud avatar Aug 07 '22 02:08 ibuildthecloud

I basically want to have a "acorn make it so" mode. In that mode I give acorn a acorn image or Acornfile and an application name. And than acorn will figure out if the current application have to be updated or created. Because I actually don't care if it's the first time the application is created (acorn run), or the application have to be updated ( acorn update).

This is something I really hate with docker-compose for example. There is no quick way for "make it so".

hikhvar avatar Aug 08 '22 09:08 hikhvar

Ah cool, I totally misunderstood your issue. I too would like this feature. There are three approaches I can think of to address this.

  1. If your run command has a --name parameter then we will create or update always.
  2. Add a --update to run to enable the --update behavior. This will implicitly require --name to be set
  3. Add a --create to update to create if not found.

I personally like option 2. Option 1 is nice but does remove a guardrail of when a user accidentally uses the same name twice and they really wanted two different apps.

ibuildthecloud avatar Aug 08 '22 18:08 ibuildthecloud

I think, acorn run --update --name foo will be a good solution. One can easily write this into the CI scripts, or a developer can easily define a shell alias alias acornapply=acorn run --update --name and than run acornapply foo.

hikhvar avatar Aug 08 '22 19:08 hikhvar

coming in 0.4. updated title to reflect the current plan

cjellick avatar Oct 05 '22 18:10 cjellick

Almost there, one more tweak that won't make it in time for v0.4.0. We will release v0.4.1 when this is in

cjellick avatar Nov 17 '22 17:11 cjellick

back in! 😎

cjellick avatar Nov 18 '22 00:11 cjellick

working as expected. 👍

cjellick avatar Nov 18 '22 16:11 cjellick