mirror of
https://github.com/fluxcd/flux2.git
synced 2026-05-06 01:54:43 +00:00
Factor out upsert and upsertAndWait
It's a common pattern in the create commands to construct a value, then (if not exporting it) upsert it and wait for it to reconcile. This commit factors `upsert`, which does the update/insert bit, and `upsertAndWait`, which does the whole thing. Since these output messages, they are methods of `apiType` (previously `names`), so that they have access to the name of the kind they are operating on. Signed-off-by: Michael Bridgen <michael@weave.works>
This commit is contained in:
parent
3b9b2cbe9f
commit
0e35c209d9
23 changed files with 138 additions and 202 deletions
|
|
@ -37,8 +37,8 @@ var getImageRepositoryCmd = &cobra.Command{
|
|||
flux get image repository --all-namespaces
|
||||
`,
|
||||
RunE: getCommand{
|
||||
names: imageRepositoryNames,
|
||||
list: imageRepositoryListAdapter{&imagev1.ImageRepositoryList{}},
|
||||
apiType: imageRepositoryType,
|
||||
list: imageRepositoryListAdapter{&imagev1.ImageRepositoryList{}},
|
||||
}.run,
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue