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

Change resize channel to receive only #1595

Merged
merged 1 commit into from Aug 16, 2023

Conversation

mgjm
Copy link
Contributor

@mgjm mgjm commented Aug 15, 2023

What type of PR is this?

/kind cleanup

What this PR does / why we need it:

The Resize channel in the AttachConfig go struct was not restricted. This PR changes the channel to a receive only channel.

-	Resize chan resize.TerminalSize
+	Resize <-chan resize.TerminalSize

The channel is only used for receive operations.

Note: This is technically a breaking change as the following code would no longer work:

config := new(client.AttachConfig)
config.Resize = make(chan resize.TerminalSize, 1)
config.Resize <- size

But this is an uncommon usage pattern. The following pattern is more expected (used by CRI-O) and is unaffected by this change:

resize := make(chan resize.TerminalSize, 1)
resize <- size

config := new(client.AttachConfig)
config.Resize = resize

Which issue(s) this PR fixes:

None

Special notes for your reviewer:

Does this PR introduce a user-facing change?

None

Signed-off-by: Martin Michaelis <code@mgjm.de>
@codecov-commenter
Copy link

Codecov Report

Merging #1595 (9b25faa) into main (7d7e415) will increase coverage by 0.08%.
Report is 6 commits behind head on main.
The diff coverage is n/a.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1595      +/-   ##
==========================================
+ Coverage   33.74%   33.82%   +0.08%     
==========================================
  Files          13       13              
  Lines        1144     1144              
  Branches      392      392              
==========================================
+ Hits          386      387       +1     
  Misses        503      503              
+ Partials      255      254       -1     

Copy link
Member

@saschagrunert saschagrunert left a comment

Choose a reason for hiding this comment

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

LGTM, PTAL @haircommander @rphillips because of the breaking change

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Aug 16, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: mgjm, saschagrunert

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

@haircommander
Copy link
Collaborator

/lgtm

@openshift-ci openshift-ci bot added the lgtm label Aug 16, 2023
@openshift-merge-robot openshift-merge-robot merged commit 0923bd8 into containers:main Aug 16, 2023
31 checks passed
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.

None yet

5 participants