Skip to content

Conversation

@sheriff-rh
Copy link
Contributor

link to bug:
https://bugzilla.redhat.com/show_bug.cgi?id=1664579

@xingxingxia PTAL.
@openshift/team-documentation need review please :)

@sheriff-rh sheriff-rh added this to the Next Release milestone Feb 7, 2019
@sheriff-rh sheriff-rh self-assigned this Feb 7, 2019
@openshift-ci-robot openshift-ci-robot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Feb 7, 2019
@openshift-docs-preview-bot

The preview will be availble shortly at:

Copy link
Contributor

@kalexand-rh kalexand-rh left a comment

Choose a reason for hiding this comment

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

As long as QE agrees, LGTM!

@kalexand-rh kalexand-rh added peer-review-done Signifies that the peer review team has reviewed this PR and removed peer-review-needed Signifies that the peer review team needs to review this PR labels Feb 7, 2019
@vikram-redhat
Copy link
Contributor

@xingxingxia PTAL

cc: @xltian

@xingxingxia
Copy link
Contributor

xingxingxia commented Feb 18, 2019

Sorry for delay due to holidays and later other work.
It is better to try the command in terminal first.
Copy the PR's command text, paste in terminal and run, got:

$ image_name=sha256:86b9e4119c4fff8ca5cf4b726249d1533602b6aca83b813fe10193cfbd222580
$ oc get is -n openshift -o go-template='{{range $isi, $is := .items}}{{range
$ti, $tag := $is.status.tags}}{{range $ii, $item := $tag.items}}{{if eq
$item.image "'$image_name'"}}{{$is.metadata.name}}:{{$tag.tag}} at position
{{$ii}} out of {{len $tag.items}}\n{{end}}{{end}}{{end}}{{end}}'
error: error parsing template {{range $isi, $is := .items}}{{range
$ti, $tag := $is.status.tags}}{{range $ii, $item := $tag.items}}{{if eq
$item.image "sha256:86b9e4119c4fff8ca5cf4b726249d1533602b6aca83b813fe10193cfbd222580"}}{{$is.metadata.name}}:{{$tag.tag}} at position
{{$ii}} out of {{len $tag.items}}\n{{end}}{{end}}{{end}}{{end}}, template: output:2: unexpected unclosed action in range

@xingxingxia
Copy link
Contributor

xingxingxia commented Feb 18, 2019

In above command, {{}} pairs happen across lines. Must put each {{ and its matching }} in one line, below got:

$ oc get is -n openshift -o go-template='{{range $isi, $is := .items}}{{range $ti, $tag := $is.status.tags}}{{range $ii, $item := $tag.items}}{{if eq $item.image "'$image_name'"}}{{$is.metadata.name}}:{{$tag.tag}} at position
{{$ii}} out of {{len $tag.items}}\n{{end}}{{end}}{{end}}{{end}}'
ruby:2.5 at position
0 out of 1\nruby:latest at position
0 out of 1\n

@xingxingxia
Copy link
Contributor

xingxingxia commented Feb 18, 2019

Note \n usage does not take effect. To get new line in the place, use new line in the exact place. Below is the correct usage

$ oc get is -n openshift -o go-template='{{range $isi, $is := .items}}{{range $ti, $tag := $is.status.tags}}{{range $ii, $item := $tag.items}}{{if eq $item.image "'$image_name'"}}{{$is.metadata.name}}:{{$tag.tag}} at position {{$ii}} out of {{len $tag.items}}
{{end}}{{end}}{{end}}{{end}}' # Before this place {{end}}{{end}}{{end}}{{end}}, use new line
ruby:2.5 at position 0 out of 1
ruby:latest at position 0 out of 1

@sheriff-rh sheriff-rh merged commit 3033a8d into openshift:master Feb 20, 2019
@sheriff-rh
Copy link
Contributor Author

/cherrypick enterprise-3.11

@openshift-cherrypick-robot

@sheriff-rh: new pull request created: #13688

Details

In response to this:

/cherrypick enterprise-3.11

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.

@sheriff-rh
Copy link
Contributor Author

/cherrypick enterprise-3.10

@openshift-cherrypick-robot

@sheriff-rh: new pull request created: #13689

Details

In response to this:

/cherrypick enterprise-3.10

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.

@sheriff-rh
Copy link
Contributor Author

/cherrypick enterprise-3.9

@openshift-cherrypick-robot

@sheriff-rh: new pull request created: #13691

Details

In response to this:

/cherrypick enterprise-3.9

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.

@sheriff-rh
Copy link
Contributor Author

/cherrypick enterprise-3.7

@openshift-cherrypick-robot

@sheriff-rh: new pull request created: #13694

Details

In response to this:

/cherrypick enterprise-3.7

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.

@sheriff-rh
Copy link
Contributor Author

/cherrypick enterprise-3.6

@openshift-cherrypick-robot

@sheriff-rh: new pull request created: #13695

Details

In response to this:

/cherrypick enterprise-3.6

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.

@sheriff-rh
Copy link
Contributor Author

/cherrypick enterprise-3.5

@openshift-cherrypick-robot

@sheriff-rh: new pull request created: #13696

Details

In response to this:

/cherrypick enterprise-3.5

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.

@sheriff-rh
Copy link
Contributor Author

/cherrypick enterprise-3.4

@openshift-cherrypick-robot

@sheriff-rh: new pull request created: #13697

Details

In response to this:

/cherrypick enterprise-3.4

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.

'{{range $ii, $item := $tag.items}}{{if eq $item.image "'"${image_name}"\
$'"}}{{$is.metadata.name}}:{{$tag.tag}} at position {{$ii}} out of {{len $tag.items}}\n'\
'{{end}}{{end}}{{end}}{{end}}'
$ $ oc get is -n openshift -o go-template='{{range $isi, $is := .items}}{{range $ti, $tag := $is.status.tags}}{{range $ii, $item := $tag.items}}{{if eq $item.image "'$image_name'"}}{{$is.metadata.name}}:{{$tag.tag}} at position {{$ii}} out of {{len $tag.items}}{{end}}{{end}}{{end}}{{end}}'
Copy link
Contributor

Choose a reason for hiding this comment

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

{{end}}{{end}}{{end}}{{end}}' # Before this place {{end}}{{end}}{{end}}{{end}}, use new line

As shown in above comment, need use new line before the place {{end}}{{end}}{{end}}{{end}}, otherwise the output is in one line:
ruby:2.5 at position 0 out of 1ruby:latest at position 0 out of 1

Copy link
Contributor

Choose a reason for hiding this comment

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

$ $ oc get

Also, two $ typed here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Totally missed that. Fixing now. Thanks @xingxingxia!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants