Skip to content
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 oc create imagestreamtag #16224

Merged

Conversation

smarterclayton
Copy link
Contributor

Supports all spec tag options. Specify a source with --from
(imagestreamtag) or --from-image (docker)

@openshift-ci-robot openshift-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Sep 8, 2017
@openshift-merge-robot openshift-merge-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Sep 8, 2017
@smarterclayton smarterclayton added component/image sig/developer-experience and removed approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Sep 8, 2017
@openshift-merge-robot openshift-merge-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Sep 8, 2017
Copy link
Member

@soltysh soltysh left a comment

Choose a reason for hiding this comment

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

I left you some comments.

}

cmd.Flags().StringVar(&o.FromImage, "from-image", "", "Use the provided remote image with this tag.")
cmd.Flags().StringVar(&o.From, "from", "", "Use the provided image stream tag or image stream image as the source: [<namespace>/]name[:<tag>|@<id>]")
Copy link
Member

Choose a reason for hiding this comment

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

This is confusing to me and even more for users. We're currently using both for IS and docker image, see here and here not sure where else. We need to standardize on the naming and use it consistently everywhere.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, I think having source and from is worse than from and from-image and from-X. After all, that's consistent with oc create in general for oc create secrets which has from-file and from-literal.

I think in general source and from are first gen, while from and from-X are gen2

Copy link
Member

Choose a reason for hiding this comment

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

What I was hoping is that we unify this across all the places, so that user whenever see flag from or from-image or else knows what can expect. Either this can be solved as part of this PR or an issue, please.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

But we can't break backwards compatibility, so it's more of a long running thing. I'd say a card is more appropriate, but we're not going to fix it anytime soon (i.e. i don't want to change tag or import-image right now, i'd want to ask "are we going to write an improved import-image that handles it")

Copy link
Member

Choose a reason for hiding this comment

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

Card sgtm.

Copy link
Member

Choose a reason for hiding this comment

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

I agree and I am aware of backwards compatibility :/ But at the same time it hurts our UX.

}

func (o *CreateImageStreamTagOptions) Complete(cmd *cobra.Command, f *clientcmd.Factory, args []string) error {
o.DryRun = cmdutil.GetFlagBool(cmd, "dry-run")
Copy link
Member

Choose a reason for hiding this comment

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

👍 for the dry-run, we need it in more places :)

os::cmd::expect_success_and_text "oc get is/tag -o 'jsonpath={.spec.tags[?(@.name==\"7\")].referencePolicy}'" 'Local'
os::cmd::expect_success_and_text "oc get is/tag -o 'jsonpath={.spec.tags[?(@.name==\"8\")].importPolicy.insecure}'" 'true'
os::cmd::expect_success_and_text "oc get is/tag -o 'jsonpath={.spec.tags[?(@.name==\"9\")].importPolicy.scheduled}'" 'true'

Copy link
Member

Choose a reason for hiding this comment

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

I'm missing following tests:

  1. Create tag with default tag name (latest) applied automatically (iow. oc create istag mytag) since I don't see any requirement on tag name being in the form repo:tag.
  2. Create tag inside an existing IS, a oc create is + oc create istag sequence would be nice.
  3. Negative tests (cli validation faliures, creating already existing tag, etc).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We don't do implicit latest here, adding a negative test. Will test inside.

@smarterclayton smarterclayton force-pushed the createimagestreamtag branch 2 times, most recently from 03ea169 to 70967ff Compare September 15, 2017 21:10
@openshift-ci-robot openshift-ci-robot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Sep 15, 2017
@smarterclayton
Copy link
Contributor Author

Removed the old image policy tests since we are +4 versions out.

Supports all spec tag options. Specify a source with --from
(imagestreamtag) or --from-image (docker)
@soltysh
Copy link
Member

soltysh commented Sep 18, 2017

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Sep 18, 2017
@openshift-merge-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: smarterclayton, soltysh

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these OWNERS Files:

You can indicate your approval by writing /approve in a comment
You can cancel your approval by writing /approve cancel in a comment

@openshift-merge-robot
Copy link
Contributor

/test all [submit-queue is verifying that this PR is safe to merge]

@soltysh
Copy link
Member

soltysh commented Sep 18, 2017

Flake #16248
/retest

@openshift-ci-robot
Copy link

openshift-ci-robot commented Sep 18, 2017

@smarterclayton: The following test failed, say /retest to rerun them all:

Test name Commit Details Rerun command
ci/openshift-jenkins/cmd 860e49a link /test cmd

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@openshift-merge-robot
Copy link
Contributor

Automatic merge from submit-queue (batch tested with PRs 16224, 14227)

@openshift-merge-robot openshift-merge-robot merged commit f2946f6 into openshift:master Sep 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. component/image lgtm Indicates that a PR is ready to be merged. sig/developer-experience size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants