@@ -117,7 +117,7 @@ func (p *Item) UnInstall() error {
117117 }
118118 } else {
119119 // #nosec
120- applycmd := qcexec .Command (os .Args [0 ], "experimental" , "kubectl" , "delete" , "-f" , fmt .Sprintf ("%s/%s" , common .GetDefaultDataDir (), p .Path ), "-n" , common .GetDefaultSystemNamespace (true ))
120+ applycmd := qcexec .Command (os .Args [0 ], "experimental" , "kubectl" , "delete" , "-f" , fmt .Sprintf ("%s/%s" , common .GetDefaultDataDir (), p .Path ), "-n" , common .GetDefaultSystemNamespace (true ), "--kubeconfig" , common . GetDefaultNewKubeConfig () )
121121 if output , err := applycmd .CombinedOutput (); err != nil {
122122 p .log .Errorf ("kubectl uninstall %s plugin %s failed: %s" , p .Type , p .Name , string (output ))
123123 return err
@@ -160,7 +160,7 @@ func (p *Item) Install() error {
160160 }
161161 } else {
162162 // #nosec
163- applycmd := qcexec .Command (os .Args [0 ], "experimental" , "kubectl" , "apply" , "-f" , fmt .Sprintf ("%s/%s" , common .GetDefaultDataDir (), p .Path ), "-n" , common .GetDefaultSystemNamespace (true ))
163+ applycmd := qcexec .Command (os .Args [0 ], "experimental" , "kubectl" , "apply" , "-f" , fmt .Sprintf ("%s/%s" , common .GetDefaultDataDir (), p .Path ), "-n" , common .GetDefaultSystemNamespace (true ), "--kubeconfig" , common . GetDefaultNewKubeConfig () )
164164 if output , err := applycmd .CombinedOutput (); err != nil {
165165 p .log .Errorf ("kubectl install %s plugin %s failed: %s" , p .Type , p .Name , string (output ))
166166 return err
@@ -209,7 +209,7 @@ func (p *Item) Upgrade() (err error) {
209209 }
210210 } else {
211211 // #nosec
212- applycmd := qcexec .Command (os .Args [0 ], "experimental" , "kubectl" , "apply" , "-f" , fmt .Sprintf ("%s/%s" , common .GetDefaultDataDir (), p .Path ), "-n" , common .GetDefaultSystemNamespace (true ))
212+ applycmd := qcexec .Command (os .Args [0 ], "experimental" , "kubectl" , "apply" , "-f" , fmt .Sprintf ("%s/%s" , common .GetDefaultDataDir (), p .Path ), "-n" , common .GetDefaultSystemNamespace (true ), "--kubeconfig" , common . GetDefaultNewKubeConfig () )
213213 if output , err := applycmd .CombinedOutput (); err != nil {
214214 p .log .Errorf ("kubectl upgrade %s plugin %s failed: %s" , p .Type , p .Name , string (output ))
215215 return err
0 commit comments