-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Add phase 1 of podman farm subcommands #19358
Conversation
@rhatdan @vrothberg @mheon @nalind PTAL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we remove or comment-out those flags that are currently NOPs? Many flags being added have no test. If we add the functionality later on, it's easy to loose track of what's implemented and what not making reviews hard.
Please break future PRs into smaller commits. It's quite hard to review so much functionality at once. I'm mostly afraid to oversee things during review. Once released, it's hard to correct after the fact.
test/e2e/buildfarm_test.go
Outdated
Expect(session.Out.Contents()).Should(ContainSubstring("Farm \"farm3\" updated")) | ||
|
||
// update farm2 to be the default farm | ||
cmd = []string{"buildfarm", "update", "--default", "farm2"} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if farm1
is already default and I do a buildfarm update --default=false farm1
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good question - if that is the case we set DefaultFarm to "" so that none of the existing farms are set as the default.
Added a test case for this.
vendor/github.com/containers/common/pkg/config/config.go
Outdated
Show resolved
Hide resolved
@vrothberg I broke the PR into as small commits as possible to help make reviews easier. |
Thanks! |
660f34e
to
c31cd12
Compare
a6f4fae
to
2f4921c
Compare
Nvm, I found a way to ignore it as it is a hidden command. |
cmd/podman/buildfarm/create.go
Outdated
} | ||
|
||
if _, ok := cfg.Farms.List[farmName]; ok { | ||
// if farm exists return an error |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we add a --replace option?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we could, but we already have buildfarm update
that let's you add or remove connections from a farm and buildfarm rm
can be used to remove a farm completely to create a new one.
I don't mind adding it, just think there are already other ways of doing a replace.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest to go ahead and implement the core functionality. We can always improve UX at a later point. At the moment, the core functionality of actually using buildfarm is missing and I think we need to make progress there first.
cmd/podman/buildfarm/remove.go
Outdated
} | ||
|
||
for _, k := range deletedFarms { | ||
fmt.Printf("Farm %q deleted\n", k) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we do this when we remove containers from pods? Or does it just silently exit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We print the container ID when it is successfully removed
|
||
## EXAMPLE | ||
``` | ||
$ podman buildfarm update --add f35,f38 farm1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we have podman buildfarm add
and podman buildfarm remove
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think buildfarm update
is a better option. I feel like add and create are very similar and can be confusing (I think they are basically the same thing for system connection). And buildfarm remove is already used for removing farms.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed
Very nice work. |
We agreed at the meeting today to sed 's/buildfarm/farm/g' |
Vendor latest c/common with changes to add a new Farms table to containers.conf and update system connection to add a connection to a farm when --farm is set. Signed-off-by: Urvashi Mohnani <[email protected]>
Signed-off-by: Urvashi Mohnani <[email protected]>
Moved from |
Signed-off-by: Urvashi Mohnani <[email protected]>
The podman farm create command allows users to create farms from the avaiable podman system connections. Signed-off-by: Urvashi Mohnani <[email protected]>
The podman farm list command allows users to list the existing farms. Signed-off-by: Urvashi Mohnani <[email protected]>
Podman farm remove allows users to remove one or more existing farms. Signed-off-by: Urvashi Mohnani <[email protected]>
Podman farm update allows users to update a farm by addig connections, removing connections, or changing the default farm. Signed-off-by: Urvashi Mohnani <[email protected]>
Add tests for podman farm create, remove, and update. Signed-off-by: Urvashi Mohnani <[email protected]>
Add new --farm flag to podman system connection add so that a user can add a new connection to a farm immediately. Update system connection remove such that when a connection is removed, the connection is also removed from any farms that have it. Add docs and tests for these changes. Signed-off-by: Urvashi Mohnani <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: rhatdan, umohnani8, vrothberg The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/lgtm |
This PR is phase 1 of adding the new
podman farm
subcommands.Add farm create, list, remove, an update subcommands - complete with docs and tests.
Update the podman system connection add & remove commands to add and remove connections to and from farms - complete with docs and tests.
The
podman farm
command is currently hidden till it is fully ready, which will be in a follow up PR once this gets in.Does this PR introduce a user-facing change?