Skip to content

Commit 20c7064

Browse files
authored
Merge pull request openshift#13 from Bowenislandsong/merging_factory_and_interface
[wni] Merging factory and interface
2 parents 5eee8b8 + 0e2b7f5 commit 20c7064

File tree

2 files changed

+18
-19
lines changed

2 files changed

+18
-19
lines changed

tools/windows-node-installer/pkg/cloudprovider/factory.go

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,24 @@ import (
66
"github.com/openshift/windows-machine-config-operator/tools/windows-node-installer/pkg/client"
77
)
88

9+
// Cloud is the interface that needs to be implemented per provider to allow support for creating Windows nodes on
10+
// that provider.
11+
type Cloud interface {
12+
// CreateWindowsVM creates a Windows VM based on available image id, instance type, and ssh key name.
13+
// TODO: CreateWindowsVM should return a provider object for further interaction with the created instance.
14+
CreateWindowsVM(imageId, instanceType, sshKey string) error
15+
// DestroyWindowsVM uses 'windows-node-installer.json' file that contains IDs of created instance and
16+
// security group and deletes them.
17+
// Example 'windows-node-installer.json' file:
18+
// {
19+
// "InstanceIDs": ["<example-instance-ID>"],
20+
// "SecurityGroupIDs": ["<example-security-group-ID>"]
21+
// {
22+
// It deletes the security group only if the group is not associated with any instance.
23+
// The association between the instance and security group are available from individual cloud provider.
24+
DestroyWindowsVM() error
25+
}
26+
927
// CloudProviderFactory returns cloud specific interface for performing necessary functions related to creating or
1028
// destroying an instance.
1129
// The factory takes in kubeconfig of an existing OpenShift cluster and a cloud vendor specific credential file.

tools/windows-node-installer/pkg/cloudprovider/interface.go

Lines changed: 0 additions & 19 deletions
This file was deleted.

0 commit comments

Comments
 (0)