@@ -26,7 +26,7 @@ func init() {
26
26
uninstallCmd .Flags ().BoolVar (& csi , "csi" , false , "Uninstall CSI Trident (alpha, not for production clusters)." )
27
27
uninstallCmd .Flags ().StringVar (& tridentImage , "trident-image" , "" , "The Trident image to use for an in-cluster uninstall operation." )
28
28
uninstallCmd .Flags ().MarkHidden ("trident-image" )
29
- uninstallCmd .Flags ().BoolVar (& inCluster , "in-cluster" , false , "Run the installer as a job in the cluster." )
29
+ uninstallCmd .Flags ().BoolVar (& inCluster , "in-cluster" , true , "Run the installer as a job in the cluster." )
30
30
uninstallCmd .Flags ().MarkHidden ("in-cluster" )
31
31
32
32
uninstallCmd .Flags ().StringVar (& ucpBearerToken , "ucp-bearer-token" , "" , "UCP authorization token (for Docker UCP only)." )
@@ -90,9 +90,15 @@ func discoverUninstallationEnvironment() error {
90
90
useKubernetesRBAC = true
91
91
if ucpBearerToken != "" || ucpHost != "" {
92
92
useKubernetesRBAC = false
93
+
93
94
if ucpClient , err = ucpclient .NewClient (ucpHost , ucpBearerToken ); err != nil {
94
95
return err
95
96
}
97
+
98
+ if inCluster {
99
+ log .Info ("In-cluster uninstallation is not supported with Docker EE, running outside cluster." )
100
+ inCluster = false
101
+ }
96
102
}
97
103
98
104
// Infer installation namespace if not specified
@@ -449,6 +455,19 @@ func uninstallTridentInCluster() (returnError error) {
449
455
if csi {
450
456
commandArgs = append (commandArgs , "--csi" )
451
457
}
458
+ if tridentImage != "" {
459
+ commandArgs = append (commandArgs , "--trident-image" )
460
+ commandArgs = append (commandArgs , tridentImage )
461
+ }
462
+ if ucpBearerToken != "" {
463
+ commandArgs = append (commandArgs , "--ucp-bearer-token" )
464
+ commandArgs = append (commandArgs , ucpBearerToken )
465
+ }
466
+ if ucpHost != "" {
467
+ commandArgs = append (commandArgs , "--ucp-host" )
468
+ commandArgs = append (commandArgs , ucpHost )
469
+ }
470
+ commandArgs = append (commandArgs , "--in-cluster=false" )
452
471
453
472
// Create the uninstall pod
454
473
returnError = client .CreateObjectByYAML (k8sclient .GetUninstallerPodYAML (
0 commit comments