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

cli: Add an edit verb #107

Merged
merged 1 commit into from
Jul 12, 2023
Merged

cli: Add an edit verb #107

merged 1 commit into from
Jul 12, 2023

Conversation

cgwalters
Copy link
Collaborator

Depends #106


cli: Add an edit verb

This interactively replaces the specified state, in a similar way
as kubectl edit.

As of right now, the only supported state to change is the desired
image.

But this will help unblock configmap support.


This interactively replaces the specified state, in a similar way
as `kubectl edit`.

As of right now, the only supported state to change is the desired
image.

But this will help unblock [configmap support].

[configmap support]: containers#22

Signed-off-by: Colin Walters <walters@verbum.org>
@cgwalters
Copy link
Collaborator Author

One thing that probably needs to happen here is we need to implement more of an "api server" in having at least a resourceVersion equivalent to detect conflicts.

Also a random thought: we probably still do want to run as a systemd unit when changes are being made. But we could just always serialize our state into /run/bootc/status.json perhaps, and let clients monitor it for changes via inotify?

@jmarrero
Copy link
Member

wdyt of adding an apply option for passing the crd yaml and use edit to do live edits?

@cgwalters
Copy link
Collaborator Author

That's how it works right? You can bootc status > status.yaml then edit or change as desired, then bootc edit status.yaml again. To do things interactively you need to bootc edit - where - means stdin.

@jmarrero
Copy link
Member

yeah that is how it works, I was just wondering if it made sense to use the word 'apply' instead for that. As that is how kubectl and oc do it, which would be a more familiar interface I guess.

@jmarrero
Copy link
Member

In any case this lgtm. Just wanted to point out the "word" used as it might be more familiar to use bootc apply my.yml

@jmarrero jmarrero merged commit a100269 into containers:main Jul 12, 2023
10 checks passed
Copy link
Member

@jmarrero jmarrero left a comment

Choose a reason for hiding this comment

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

lgtm

@cgwalters
Copy link
Collaborator Author

It's a good point! I'm not sure... we could make bootc apply an alias? Or we could always call it apply?

@cgwalters
Copy link
Collaborator Author

To be clear I'm happy to change to apply, the more I think about the more I agree.

@jmarrero
Copy link
Member

Well I think we need both if we want the "familiar interface". IIRC apply is just for when we are passing the yaml file. https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands#apply

Edit is more manual, expects the user to modify it with an editor:
https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands#edit

But Idk, I see that edit also has a -f filename option which I am not sure if it just does the same thing as apply... If it does, then I guess we can ignore apply for now.

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

Successfully merging this pull request may close these issues.

None yet

2 participants