mirror of
https://github.com/kubevela/kubevela.git
synced 2026-08-27 16:17:34 +00:00
Fix: can not find the resource when the resource namespace is diffrent with application (#4517)
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
This commit is contained in:
@@ -230,7 +230,7 @@ func (o *VelaPortForwardOptions) Init(ctx context.Context, cmd *cobra.Command, a
|
||||
}
|
||||
|
||||
cf := genericclioptions.NewConfigFlags(true)
|
||||
cf.Namespace = pointer.String(o.namespace)
|
||||
cf.Namespace = pointer.String(o.targetResource.namespace)
|
||||
cf.WrapConfigFn = func(cfg *rest.Config) *rest.Config {
|
||||
cfg.Wrap(multicluster.NewClusterGatewayRoundTripperWrapperGenerator(o.targetResource.cluster))
|
||||
return cfg
|
||||
@@ -286,6 +286,7 @@ func (o *VelaPortForwardOptions) Complete() error {
|
||||
args := make([]string, len(o.Args))
|
||||
copy(args, o.Args)
|
||||
args[0] = forwardTypeName
|
||||
o.kcPortForwardOptions.Namespace = o.targetResource.namespace
|
||||
o.ioStreams.Infof("trying to connect the remote endpoint %s ..", strings.Join(args, " "))
|
||||
return o.kcPortForwardOptions.Complete(o.f, o.Cmd, args)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user