@@ -49,6 +49,9 @@ type Interface interface {
49
49
LoadBalancer () (LoadBalancer , bool )
50
50
// Instances returns an instances interface. Also returns true if the interface is supported, false otherwise.
51
51
Instances () (Instances , bool )
52
+ // InstancesV2 is an implementation for instances only used by cloud node-controller now.
53
+ // Also returns true if the interface is supported, false otherwise.
54
+ InstancesV2 () (InstancesV2 , bool )
52
55
// Zones returns a zones interface. Also returns true if the interface is supported, false otherwise.
53
56
Zones () (Zones , bool )
54
57
// Clusters returns a clusters interface. Also returns true if the interface is supported, false otherwise.
@@ -186,6 +189,17 @@ type Instances interface {
186
189
InstanceShutdownByProviderID (ctx context.Context , providerID string ) (bool , error )
187
190
}
188
191
192
+ // InstancesV2 is an abstract, pluggable interface for sets of instances.
193
+ // Unlike Instances, it is only used by cloud node-controller now.
194
+ type InstancesV2 interface {
195
+ // InstanceExistsByProviderID returns true if the instance for the given provider exists.
196
+ InstanceExistsByProviderID (ctx context.Context , providerID string ) (bool , error )
197
+ // InstanceShutdownByProviderID returns true if the instance is shutdown in cloudprovider.
198
+ InstanceShutdownByProviderID (ctx context.Context , providerID string ) (bool , error )
199
+ // InstanceMetadataByProviderID returns the instance's metadata.
200
+ InstanceMetadataByProviderID (ctx context.Context , providerID string ) (* InstanceMetadata , error )
201
+ }
202
+
189
203
// Route is a representation of an advanced routing rule.
190
204
type Route struct {
191
205
// Name is the name of the routing rule in the cloud-provider.
0 commit comments