Missed out platform interface when reused the conn for Client.

Signed-off-by: yanggang <gang.yang@daocloud.io>
This commit is contained in:
yanggang 2022-11-19 11:01:19 +08:00
parent 58180661eb
commit 70b65062c7
No known key found for this signature in database
GPG Key ID: 7F6E0CAD1556A240

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 {