@@ -45,14 +45,14 @@ func (c VmCompatibilityChecker) CheckCompatibility(
45
45
vm types.ManagedObjectReference ,
46
46
host * types.ManagedObjectReference ,
47
47
pool * types.ManagedObjectReference ,
48
- testTypes ... string ) ([]types.CheckResult , error ) {
48
+ testTypes ... types. CheckTestType ) ([]types.CheckResult , error ) {
49
49
50
50
req := types.CheckCompatibility_Task {
51
51
This : c .Reference (),
52
52
Vm : vm ,
53
53
Host : host ,
54
54
Pool : pool ,
55
- TestType : testTypes ,
55
+ TestType : checkTestTypesToStrings ( testTypes ) ,
56
56
}
57
57
58
58
res , err := methods .CheckCompatibility_Task (ctx , c .c , & req )
@@ -74,15 +74,15 @@ func (c VmCompatibilityChecker) CheckVmConfig(
74
74
vm * types.ManagedObjectReference ,
75
75
host * types.ManagedObjectReference ,
76
76
pool * types.ManagedObjectReference ,
77
- testTypes ... string ) ([]types.CheckResult , error ) {
77
+ testTypes ... types. CheckTestType ) ([]types.CheckResult , error ) {
78
78
79
79
req := types.CheckVmConfig_Task {
80
80
This : c .Reference (),
81
81
Spec : spec ,
82
82
Vm : vm ,
83
83
Host : host ,
84
84
Pool : pool ,
85
- TestType : testTypes ,
85
+ TestType : checkTestTypesToStrings ( testTypes ) ,
86
86
}
87
87
88
88
res , err := methods .CheckVmConfig_Task (ctx , c .c , & req )
@@ -97,3 +97,15 @@ func (c VmCompatibilityChecker) CheckVmConfig(
97
97
98
98
return ti .Result .(types.ArrayOfCheckResult ).CheckResult , nil
99
99
}
100
+
101
+ func checkTestTypesToStrings (testTypes []types.CheckTestType ) []string {
102
+ if len (testTypes ) == 0 {
103
+ return nil
104
+ }
105
+
106
+ s := make ([]string , len (testTypes ))
107
+ for i := range testTypes {
108
+ s [i ] = string (testTypes [i ])
109
+ }
110
+ return s
111
+ }
0 commit comments