-
Notifications
You must be signed in to change notification settings - Fork 883
run/prepare/fetch: replace --no-store and --store-only with --pull-policy #3554
Conversation
b8704b4
to
de68eb9
Compare
Looking at the semaphore output, only the kvm run through of the tests failed, and the failing tests aren't things I would expect to be impacted by this. Anyone know if this is just flaky tests, or is there a problem with my PR? |
Except for one weird kvm output, I think most other failures are real regressions introduce in this PR. For example, looking at Jenkins output shows several fetch and render failures. |
5059a0a
to
487eb2a
Compare
Looks like things are passing now. The problem appears to have been that the default behavior has changed for |
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.
just a nit regarding the deprecation policy, else LGTM.
|
||
## General Behavior | ||
|
||
The following table describes the meaning of the `--store-only` and `--no-store` flags. | ||
The following table describes the meaning of the `--pull-poloicy` flag. |
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.
--pull-policy
This behavior can be changed by using the `--store-only` and `--no-store` flags. | ||
Their meanings are detailed in the [image fetching behavior][img-fetch] documentation. | ||
This behavior can be changed by using the `--pull-policy` flag. | ||
Usage of this flag is details in the [image fetching behavior][img-fetch] documentation. |
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.
"is detailed"?
| `--signature` | `` | A file path | Local signature file to use in validating the preceding image | | ||
| `--store-only` | `false` | `true` or `false` | Use only available images in the store (do not discover or download from remote URLs). See [image fetching behavior][img-fetch] | | ||
| `--pull-policy` | `new` | `never`, `new`, or `update` | Sets the policy for when to fetch an image over the internet. See [image fetching behavior][img-fetch] | |
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'd remove "over the internet" here and below.
@@ -54,6 +57,7 @@ func init() { | |||
cmdFetch.Flags().BoolVar(&flagStoreOnly, "store-only", false, "use only available images in the store (do not discover or download from remote URLs)") | |||
cmdFetch.Flags().BoolVar(&flagNoStore, "no-store", false, "fetch images ignoring the local store") |
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 we should mark store-only
and no-store
explicitly as deprecated here and elsewhere.
dd1bba0
to
50b88bd
Compare
Nits should be fixed now. Changed the description of |
Code looks fine, but I'll take a second pass today or tomorrow regarding behavioral changes introduced in here. |
Just to double-check: this is to retain compatibility with previous behavior, and test failure were not strictly due to changed behavior, correct? |
rkt fetch defaulting to |
This behavioral change was to address half of #2937, with the other half being the recent docker2aci changes here: appc/docker2aci#237. |
Thanks for the answers and sorry for the confusion, I was focused on the rework too much and actually forgot the initial request in the original ticket. |
@@ -51,9 +54,10 @@ func init() { | |||
cmdFetch.Flags().SetInterspersed(false) | |||
|
|||
cmdFetch.Flags().Var((*appAsc)(&rktApps), "signature", "local signature file to use in validating the preceding image") | |||
cmdFetch.Flags().BoolVar(&flagStoreOnly, "store-only", false, "use only available images in the store (do not discover or download from remote URLs)") | |||
cmdFetch.Flags().BoolVar(&flagNoStore, "no-store", false, "fetch images ignoring the local store") | |||
cmdFetch.Flags().BoolVar(&flagStoreOnly, "store-only", false, "(deprecated) alias for --pull-policy=never") |
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.
FYI you may directly mark this as deprecated via pflags MarkDeprecated.
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.
Oh that's super cool, I didn't know cobra had that. Changing it now.
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 except for a very minor UI nit.
…licy This replaces the `--no-store` and `--store-only` flags with a singular flag `--pull-policy` that can accept one of three things, `never`, `new`, and `update`. This is purely a cli change, there are no under the hood impacts. `--no-store` has been aliased to `--pull-policy=update` and `--store-only` has been aliased to `--pull-policy=never` for compatibility reasons.
I've gotten LGTMs from @s-urbaniak and @lucab, and I'm happy with this, so I'll merge when the tests are green. |
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
This replaces the
--no-store
and--store-only
flags with a singularflag
--pull-policy
that can accept one of three things,never
,new
, andupdate
. This is purely a cli change, there are no under thehood impacts.
--no-store
has been aliased to--pull-policy=update
and
--store-only
has been aliased to--pull-policy=never
forcompatibility reasons.
These changes come from a discussion in #2937.