Merge pull request #7699 from yanggangtony/client-with-conn

Missed out `platform interface` when reused the conn for Client.
This commit is contained in:
Phil Estes 2022-11-21 10:52:10 -05:00 committed by GitHub
commit de73676e9b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -188,6 +188,12 @@ func NewWithConn(conn *grpc.ClientConn, opts ...ClientOpt) (*Client, error) {
runtime: fmt.Sprintf("%s.%s", plugin.RuntimePlugin, runtime.GOOS),
}
if copts.defaultPlatform != nil {
c.platform = copts.defaultPlatform
} else {
c.platform = platforms.Default()
}
// check namespace labels for default runtime
if copts.defaultRuntime == "" && c.defaultns != "" {
if label, err := c.GetLabel(context.Background(), defaults.DefaultRuntimeNSLabel); err != nil {