Skip to content

cli: Add an edit verb - #107

Merged
jmarrero merged 1 commit into
bootc-dev:mainfrom
cgwalters:edit
Jul 12, 2023
Merged

jmarrero merged 1 commit into
bootc-dev:mainfrom
cgwalters:edit

Conversation

@cgwalters

Copy link
Copy Markdown
Member

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.


@cgwalters
cgwalters marked this pull request as draft July 6, 2023 12:24
@cgwalters
cgwalters marked this pull request as ready for review July 12, 2023 13:59
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]: bootc-dev#22

Signed-off-by: Colin Walters <[email protected]>
@cgwalters

Copy link
Copy Markdown
Member 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
Copy Markdown
Contributor

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

@cgwalters

Copy link
Copy Markdown
Member 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
Copy Markdown
Contributor

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
Copy Markdown
Contributor

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 bootc-dev:main Jul 12, 2023

@jmarrero jmarrero left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

lgtm

@cgwalters

Copy link
Copy Markdown
Member 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
Copy Markdown
Member Author

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

@jmarrero

Copy link
Copy Markdown
Contributor

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.

cgwalters-bot pushed a commit to cgwalters-bot/bootc that referenced this pull request Nov 11, 2026
The regression test for bootc#2402 carried by upstream PR 2634 skips
itself when /boot is not an automount, so a general integration run
can go green without ever exercising the bug. This adds a separate,
disabled-by-default plan that runs the exact pinned test revision on
an ostree-backed Fedora 44 guest with /boot on the root filesystem,
rejects any other layout in prepare, and requires the updated
deployment to have booted in finish. The `just test-boot-automount`
recipe enables the plan by context and uses the new `--require-plan`
option of `cargo xtask run-tmt`, so a disabled or missing plan is an
error rather than an empty successful run.

The test source stays in PR 2634 (issue bootc-dev#105) and is consumed read-only
through tmt discovery; building images for the affected and fixed
ostree revisions and the CI job are not part of this change.

Part of bootc-dev#107

Verified with the xtask tests, `cargo xtask update-generated direct
--check`, `tmt plan lint` and a discover-only run against the pin; no
VM run was possible here.

Generated-by: AI
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.

2 participants