Skip to content

update policy for pods/exec #3716

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

Merged
merged 3 commits into from
Jul 16, 2015
Merged

Conversation

deads2k
Copy link
Contributor

@deads2k deads2k commented Jul 15, 2015

Upstream pull: kubernetes/kubernetes#11333

Reacts to upstream changes for kubernetes/kubernetes#10654. Also refactors the test to make sure that project admins are able to run pods/exec by default.

@deads2k
Copy link
Contributor Author

deads2k commented Jul 15, 2015

@liggitt

oc project test
oc whoami
Copy link
Contributor

Choose a reason for hiding this comment

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

you want to check output of this, or is it just for the test log?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

you want to check output of this, or is it just for the test log?

Just for the log.

@ncdc
Copy link
Contributor

ncdc commented Jul 15, 2015

@deads2k move the port forward test up too?

@deads2k
Copy link
Contributor Author

deads2k commented Jul 15, 2015

@deads2k move the port forward test up too?

done.

# Port forwarding
echo "[INFO] Validating port-forward"
oc port-forward -p ${frontend_pod} 10080:8080 &> "${LOG_DIR}/port-forward.log" &
wait_for_url_timed "http://localhost:10080" "[INFO] Frontend says: " $((10*TIME_SEC))
Copy link
Contributor

Choose a reason for hiding this comment

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

was there something wrong with the healthz check?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

was there something wrong with the healthz check?

The /healthz check is for a registry, not a ruby frontend. Registry is in default where e2e-user doesn't have rights. e2e-user checks the ruby front-end.

Copy link
Contributor

Choose a reason for hiding this comment

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

ah, makes sense

@liggitt
Copy link
Contributor

liggitt commented Jul 15, 2015

@smarterclayton thinks we should keep our client using GET

@ncdc
Copy link
Contributor

ncdc commented Jul 15, 2015

Isn't upstream going to move to require POST for exec?

@deads2k
Copy link
Contributor Author

deads2k commented Jul 15, 2015

@smarterclayton thinks we should keep our client using GET

How would our client work against an external kube? Also, that would break our compatibility with kubectl.

@liggitt
Copy link
Contributor

liggitt commented Jul 15, 2015

apparently upstream supports both now?

@smarterclayton
Copy link
Contributor

Our clients have to work against 3.0 OpenShift servers. So we have to
support both.

On Wed, Jul 15, 2015 at 10:40 AM, David Eads [email protected]
wrote:

@smarterclayton https://github.com/smarterclayton thinks we should keep
our client using GET

How would our client work against an external kube? Also, that would break
our compatibility with kubectl.


Reply to this email directly or view it on GitHub
#3716 (comment).

Clayton Coleman | Lead Engineer, OpenShift

@ncdc
Copy link
Contributor

ncdc commented Jul 15, 2015

Yes but afaik they're going to remove GET support

@liggitt
Copy link
Contributor

liggitt commented Jul 15, 2015

ah, the new-client, old server bit

@smarterclayton
Copy link
Contributor

We need to carry the "post" first, then try "get" client patch.

@deads2k
Copy link
Contributor Author

deads2k commented Jul 15, 2015

We need to carry the "post" first, then try "get" client patch.

This doesn't make that problem better or worse, but it does allow the current origin code to work. This is necessary, but not sufficient. New issue for the command?

@smarterclayton
Copy link
Contributor

On Jul 15, 2015, at 12:58 PM, David Eads [email protected] wrote:

We need to carry the "post" first, then try "get" client patch.

This doesn't make that problem better or worse, but it does allow the
current origin code to work.

Not sure what you mean.

This is necessary, but not sufficient. New issue for the command?

For updating the default role assignments? Yes, new issue.


Reply to this email directly or view it on GitHub
#3716 (comment).

@liggitt
Copy link
Contributor

liggitt commented Jul 15, 2015

this PR allows both GET and POST for exec and portforward. new issue for the carried patch to try GET, then POST in exec and portforward (I would actually try in the reverse order... "correct" first, then fallback to legacy)

@deads2k
Copy link
Contributor Author

deads2k commented Jul 15, 2015

this PR allows both GET and POST for exec and portforward. new issue for the carried patch to try GET, then POST in exec and portforward

That was my intent, but if this upstream patch suits (easy to carry and merge as opposed to nicely factored) then I guess I'm not picky

postErr := re.Execute(req, config, args, stdin, cmdOut, cmdErr, tty)

// if we don't have an error, return. If we did get an error, try a GET because v3.0.0 shipped with exec running as a GET.
if postErr == nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

should we scope this to method not supported errors? if we get an error here when an exec times out or is terminated by the user and respond to it by opening a second request, that's not what we want.

Copy link
Contributor

Choose a reason for hiding this comment

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

I guess against a 3.0 server you'd get access denied or method not supported

Copy link
Contributor Author

Choose a reason for hiding this comment

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

should we scope this to method not supported errors?

It would have to include forbidden too since the old policy would forbid this for most users. I don't have strong feelings.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It would have to include forbidden too since the old policy would forbid this for most users.

tightened

@liggitt liggitt self-assigned this Jul 15, 2015
}

// only try the get if the error is either a forbidden or method not supported, otherwise trying with a GET probably won't help
if !apierrors.IsForbidden(postErr) && !apierrors.IsMethodNotSupported(postErr) {
Copy link
Contributor

Choose a reason for hiding this comment

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

looks good... double check that Execute parses forbidden/notsupported statuses correctly?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

looks good... double check that Execute parses forbidden/notsupported statuses correctly?

Looks to be passed straight back through: https://github.com/openshift/origin/blob/master/Godeps/_workspace/src/github.com/GoogleCloudPlatform/kubernetes/pkg/client/request.go#L662-L665

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@deads2k
Copy link
Contributor Author

deads2k commented Jul 15, 2015

@liggitt now chaining back errors correctly

@liggitt
Copy link
Contributor

liggitt commented Jul 15, 2015

LGTM

@deads2k
Copy link
Contributor Author

deads2k commented Jul 15, 2015

[merge]

@openshift-bot
Copy link
Contributor

continuous-integration/openshift-jenkins/merge SUCCESS (https://ci.openshift.redhat.com/jenkins/job/merge_pull_requests_origin/2750/) (Image: devenv-fedora_2007)

@openshift-bot
Copy link
Contributor

Evaluated for origin up to 9b94ef6

@openshift-bot
Copy link
Contributor

[Test]ing while waiting on the merge queue

@openshift-bot
Copy link
Contributor

continuous-integration/openshift-jenkins/test SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pull_requests_origin/3653/)

openshift-bot pushed a commit that referenced this pull request Jul 16, 2015
@openshift-bot openshift-bot merged commit 6ed2b36 into openshift:master Jul 16, 2015
@deads2k deads2k deleted the make-exec-work branch July 31, 2015 18:30
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.

5 participants