1
0
mirror of synced 2026-02-13 13:06:56 +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:
Michael Bridgen
2020-12-08 18:17:36 +00:00
parent 3b9b2cbe9f
commit 0e35c209d9
23 changed files with 138 additions and 202 deletions

View File

@@ -29,7 +29,7 @@ import (
// imagev1.ImageRepository
var imageRepositoryNames = names{
var imageRepositoryType = apiType{
kind: imagev1.ImageRepositoryKind,
humanKind: "image repository",
}
@@ -58,7 +58,7 @@ func (a imageRepositoryListAdapter) len() int {
// imagev1.ImagePolicy
var imagePolicyNames = names{
var imagePolicyType = apiType{
kind: imagev1.ImagePolicyKind,
humanKind: "image policy",
}
@@ -87,7 +87,7 @@ func (a imagePolicyListAdapter) len() int {
// autov1.ImageUpdateAutomation
var imageUpdateAutomationNames = names{
var imageUpdateAutomationType = apiType{
kind: autov1.ImageUpdateAutomationKind,
humanKind: "image update automation",
}