mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-21 10:51:29 +00:00
Merge pull request #67615 from rphillips/fixes/attach_func_initializer
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. attach: Move the AttachFunc default function to the initializer Fixes a partially constructed AttachOptions **What this PR does / why we need it**: NewAttachOptions partially constructs an AttachOptions structure. The defaultAttachFunc should be set automatically, so the caller can potentially override the default behavior. **Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*: Fixes # **Special notes for your reviewer**: **Release note**: ```release-note NONE ``` /cc @kubernetes/sig-cli-api-reviews
This commit is contained in:
commit
5fb32e703b
@ -89,7 +89,8 @@ func NewAttachOptions(streams genericclioptions.IOStreams) *AttachOptions {
|
||||
StreamOptions: StreamOptions{
|
||||
IOStreams: streams,
|
||||
},
|
||||
Attach: &DefaultRemoteAttach{},
|
||||
Attach: &DefaultRemoteAttach{},
|
||||
AttachFunc: defaultAttachFunc,
|
||||
}
|
||||
}
|
||||
|
||||
@ -193,8 +194,6 @@ func (o *AttachOptions) Complete(f cmdutil.Factory, cmd *cobra.Command, args []s
|
||||
}
|
||||
o.Config = config
|
||||
|
||||
o.AttachFunc = defaultAttachFunc
|
||||
|
||||
if o.CommandName == "" {
|
||||
o.CommandName = cmd.CommandPath()
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user