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

bug 1879497: oc debug: add --image-stream flag #588

Conversation

ingvagabund
Copy link
Member

@ingvagabund ingvagabund commented Sep 22, 2020

To allow to look for images in an image stream as well

With an invalid image stream:

$ ./oc -v=2 debug nodes/ip-10-0-161-245.us-west-1.compute.internal --image-stream="openshift2/tools:latest"
I0922 15:22:44.130529  254527 debug.go:922] Unable to resolve image stream 'openshift2/tools:latest': imagestreams.image.openshift.io "tools" not found
I0922 15:22:44.130723  254527 debug.go:926] Falling to 'registry.redhat.io/rhel8/support-tools' image
Creating debug namespace/openshift-debug-node-255vj ...
Starting pod/ip-10-0-161-245us-west-1computeinternal-debug ...
To use host binaries, run `chroot /host`
I0922 15:22:44.763232  254527 reflector.go:207] Starting reflector *v1.Pod (0s) from k8s.io/client-go/tools/watch/informerwatcher.go:146
I0922 15:22:47.096573  254527 reflector.go:213] Stopping reflector *v1.Pod (0s) from k8s.io/client-go/tools/watch/informerwatcher.go:146
Pod IP: 10.0.161.245
If you don't see a command prompt, try pressing enter.
sh-4.4# exit

Removing debug pod ...
Removing debug namespace/openshift-debug-node-255vj ...

$ oc get pods -n $(oc get ns | grep debug | cut -d' ' -f1) -o json | jq '.items[0].spec.containers[0].image'
"registry.redhat.io/rhel8/support-tools"

With a valid image stream:

$ ./oc -v=2 debug nodes/ip-10-0-161-245.us-west-1.compute.internal --image-stream="openshift/tools:latest"
Creating debug namespace/openshift-debug-node-4gt45 ...
Starting pod/ip-10-0-161-245us-west-1computeinternal-debug ...
To use host binaries, run `chroot /host`
I0922 15:24:25.524706  254766 reflector.go:207] Starting reflector *v1.Pod (0s) from k8s.io/client-go/tools/watch/informerwatcher.go:146
I0922 15:24:26.233169  254766 reflector.go:213] Stopping reflector *v1.Pod (0s) from k8s.io/client-go/tools/watch/informerwatcher.go:146
Pod IP: 10.0.161.245
If you don't see a command prompt, try pressing enter.
sh-4.4# exit

Removing debug pod ...
Removing debug namespace/openshift-debug-node-4gt45 ...

$ oc get pods -n $(oc get ns | grep debug | cut -d' ' -f1) -o json | jq '.items[0].spec.containers[0].image'
"registry.svc.ci.openshift.org/ocp/4.6-2020-09-20-014259@sha256:XXXX"

Without the image stream:

$ ./oc -v=2 debug nodes/ip-10-0-161-245.us-west-1.compute.internal 
Creating debug namespace/openshift-debug-node-tlnhk ...
Starting pod/ip-10-0-161-245us-west-1computeinternal-debug ...
To use host binaries, run `chroot /host`
I0922 15:25:30.644916  254834 reflector.go:207] Starting reflector *v1.Pod (0s) from k8s.io/client-go/tools/watch/informerwatcher.go:146
I0922 15:25:32.582798  254834 reflector.go:213] Stopping reflector *v1.Pod (0s) from k8s.io/client-go/tools/watch/informerwatcher.go:146
Pod IP: 10.0.161.245
If you don't see a command prompt, try pressing enter.
sh-4.4# exit

Removing debug pod ...
Removing debug namespace/openshift-debug-node-tlnhk ...

$ oc get pods -n $(oc get ns | grep debug | cut -d' ' -f1) -o json | jq '.items[0].spec.containers[0].image'
"registry.svc.ci.openshift.org/ocp/4.6-2020-09-20-014259@sha256:XXXX"

@openshift-ci-robot openshift-ci-robot added the bugzilla/severity-medium Referenced Bugzilla bug's severity is medium for the branch this PR is targeting. label Sep 22, 2020
@openshift-ci-robot
Copy link

@ingvagabund: This pull request references Bugzilla bug 1879497, which is invalid:

  • expected the bug to target the "4.6.0" release, but it targets "4.7.0" instead

Comment /bugzilla refresh to re-evaluate validity if changes to the Bugzilla bug are made, or edit the title of this pull request to link to a different bug.

In response to this:

bug 1879497: oc debug: add --image-stream flag

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.

@openshift-ci-robot openshift-ci-robot added the bugzilla/invalid-bug Indicates that a referenced Bugzilla bug is invalid for the branch this PR is targeting. label Sep 22, 2020
@openshift-ci-robot
Copy link

@ingvagabund: This pull request references Bugzilla bug 1879497, which is invalid:

  • expected the bug to target the "4.6.0" release, but it targets "4.7.0" instead

Comment /bugzilla refresh to re-evaluate validity if changes to the Bugzilla bug are made, or edit the title of this pull request to link to a different bug.

In response to this:

bug 1879497: oc debug: add --image-stream flag

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.

1 similar comment
@openshift-ci-robot
Copy link

@ingvagabund: This pull request references Bugzilla bug 1879497, which is invalid:

  • expected the bug to target the "4.6.0" release, but it targets "4.7.0" instead

Comment /bugzilla refresh to re-evaluate validity if changes to the Bugzilla bug are made, or edit the title of this pull request to link to a different bug.

In response to this:

bug 1879497: oc debug: add --image-stream flag

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.

@@ -1087,3 +1095,38 @@ func setNodeName(template *corev1.PodTemplateSpec, nodeName string, overrideWhen
}
return template
}

func (o *DebugOptions) resolveImageStreamTagString(s string) (string, error) {
namespace, name, tag := parseImageStreamTagString(s)
Copy link
Member

Choose a reason for hiding this comment

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

Use imageutil.ParseImageStreamTagName from library-go.

Copy link
Member Author

Choose a reason for hiding this comment

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

imageutil.ParseImageStreamTagName does not take namespace into account, not usable here

Copy link
Member

Choose a reason for hiding this comment

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

Good point.

@soltysh soltysh self-assigned this Sep 22, 2020
To allow to look for images in an image stream as well
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.

/lgtm
/approve

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Sep 22, 2020
@openshift-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

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

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

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Sep 22, 2020
@ingvagabund
Copy link
Member Author

/bugzilla refresh

@openshift-ci-robot openshift-ci-robot added bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. and removed bugzilla/invalid-bug Indicates that a referenced Bugzilla bug is invalid for the branch this PR is targeting. labels Sep 22, 2020
@openshift-ci-robot
Copy link

@ingvagabund: This pull request references Bugzilla bug 1879497, which is valid.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target release (4.6.0) matches configured target release for branch (4.6.0)
  • bug is in the state POST, which is one of the valid states (NEW, ASSIGNED, ON_DEV, POST, POST)

In response to this:

/bugzilla refresh

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.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-merge-robot openshift-merge-robot merged commit fd1faa8 into openshift:master Sep 22, 2020
@openshift-ci-robot
Copy link

@ingvagabund: All pull requests linked via external trackers have merged:

Bugzilla bug 1879497 has been moved to the MODIFIED state.

In response to this:

bug 1879497: oc debug: add --image-stream flag

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.

@ingvagabund ingvagabund deleted the oc-debug-add-image-stream-flag branch September 22, 2020 20:34
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. bugzilla/severity-medium Referenced Bugzilla bug's severity is medium for the branch this PR is targeting. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants