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

Added a fuction/method setTerminalsize in Exec.ExecBuilber #3657

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sriganeshres
Copy link

I have added a function in Exec.ExecBuilder class which helps to set the Terminal size.

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: sriganeshres
Once this PR has been reviewed and has the lgtm label, please assign brendandburns for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found 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

Copy link

linux-foundation-easycla bot commented Aug 27, 2024

CLA Signed


The committers listed above are authorized under a signed CLA.

@k8s-ci-robot
Copy link
Contributor

Welcome @sriganeshres!

It looks like this is your first PR to kubernetes-client/java 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-client/java has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot k8s-ci-robot added cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels Aug 27, 2024
@sriganeshres sriganeshres changed the title Added a fuction/method setTerminalsize in Exec.ExecBuilber Added a fuction/method setTerminalsize in Exec.ExecBuilber fixes #3641 Aug 27, 2024
@k8s-ci-robot k8s-ci-robot added the do-not-merge/invalid-commit-message Indicates that a PR should not merge because it has an invalid commit message. label Aug 27, 2024
@sriganeshres sriganeshres changed the title Added a fuction/method setTerminalsize in Exec.ExecBuilber fixes #3641 Added a fuction/method setTerminalsize in Exec.ExecBuilber Aug 27, 2024
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/invalid-commit-message Indicates that a PR should not merge because it has an invalid commit message. label Aug 27, 2024
@sriganeshres
Copy link
Author

related to #3641

@@ -368,6 +388,14 @@ private ExecutionBuilder(String namespace, String name, String[] command) {
this.stderr = true;
}

public void setTerminalSize(int widthColumns, int heightColumns) throws IOException, ApiException {
Copy link
Contributor

Choose a reason for hiding this comment

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

This isn't quite correct. What you need to do is to add a setTerminalSize(...) method to the Exec class, that method can only run once execute() has been called and the connection is established.

@@ -92,7 +92,8 @@ public void setApiClient(ApiClient apiClient) {
}

/**
* Get a {@link Consumer<Throwable>} that will be accepted if there is any unhandled exception
* Get a {@link Consumer<Throwable>} that will be accepted if there is any
Copy link
Contributor

Choose a reason for hiding this comment

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

Please revert all formatting changes here and below.

@brendandburns
Copy link
Contributor

Thanks for starting this. Two notes:
First, please don't include any unrelated formatting changes, it makes it harder to review the PR, you can use git diff HEAD~1 to visualize any differences in your commit before you send the PR.

Second, this change isn't quite correct, you need to add a utility method to the Exec class, not to the builder. The builder is what sets up an Exec instance, but the terminal resize can only happen once the exec call starts. If the method is added to the Exec class, then someone who starts a call to Exec can resize the stream once the connection is established.

@sriganeshres
Copy link
Author

Sorry @brendandburns for very very late response. But can you guide me more than just that im facing a bit of issue here while trying to maintain that it should be able to be run after execute(). Thanks for the support till now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants