Skip to content

Commit

Permalink
Updated CI and MCM-CLI client
Browse files Browse the repository at this point in the history
- Updated CI script to cd and build cmi-server
- Fixed issues with mcm-cli directory
  • Loading branch information
prashanth26 committed Jul 9, 2019
1 parent 72489e1 commit a404308
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 38 deletions.
16 changes: 10 additions & 6 deletions .ci/integration-tests
Original file line number Diff line number Diff line change
Expand Up @@ -94,15 +94,19 @@ function setup_environment() {
# TODO: fetch the latest release and not master of aws-provider
printf "\n Download machiine-controller-manager-provider-aws latest release"
git clone https://github.com/gardener/machine-controller-manager-provider-aws.git $PWD/../machine-controller-manager-provider-aws


printf "\...Done \n"


cd ../machine-controller-manager-provider-aws
printf "\nBuilding MCM-Provider-AWS binary\n"
if go build -i $PWD/../machine-controller-manager-provider-aws/app/aws/cmi-server.go; then
printf "Go build Successful\n"
if go build -o ../machine-controller-manager/cmi-server -i app/aws/cmi-server.go; then
printf "Go build Successful for provider AWS\n"
else
printf "Go build Failure\n"
printf "Go build Failure for provider AWS\n"
terminate_script
fi
cd ../machine-controller-manager
ls
}

# run_controller runs MCM controller in background
Expand All @@ -127,7 +131,7 @@ function run_controller() {
--leader-elect-renew-deadline=30s \
--leader-elect-retry-period=15s \
--v=2 > logs/${provider}-mcm.out 2>&1 &

printf "\nRunning MCM-Provider-AWS in background\n"
./cmi-server \
--endpoint=tcp://127.0.0.1:8080 > logs/${provider}-mcm-provider.out 2>&1 &
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ kubectl
# Binary files of MCM
./machine-controller-manager
./managevm
cmi-server

# Output of the go coverage tool, specifically when used with LiteIDE
*coverprofile.out*
38 changes: 6 additions & 32 deletions cmd/machine-controller-manager-cli/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,36 +61,10 @@ func main() {
}

switch classKind {
case "OpenStackMachineClass", "openstack":
class := v1alpha1.OpenStackMachineClass{}
case "MachineClass", "machineclass":
class := v1alpha1.MachineClass{}
machineclass = &class
classKind = "OpenStackMachineClass"

case "AWSMachineClass", "aws":
class := v1alpha1.AWSMachineClass{}
machineclass = &class
classKind = "AWSMachineClass"

case "AzureMachineClass", "azure":
class := v1alpha1.AzureMachineClass{}
machineclass = &class
classKind = "AzureMachineClass"

case "GCPMachineClass", "gcp":
class := v1alpha1.GCPMachineClass{}
machineclass = &class
classKind = "GCPMachineClass"

case "AlicloudMachineClass", "alicloud":
class := v1alpha1.AlicloudMachineClass{}
machineclass = &class
classKind = "AlicloudMachineClass"

case "PacketMachineClass", "packet":
class := v1alpha1.PacketMachineClass{}
machineclass = &class
classKind = "PacketMachineClass"

classKind = "MachineClass"
default:
log.Fatalf("Unknown class kind %s", classKind)
}
Expand All @@ -99,17 +73,17 @@ func main() {
log.Fatalf("Could not parse machine class yaml: %s", err)
}

driver := driver.NewDriver(machineID, &secret, classKind, machineclass, machineName)
driver := driver.NewCMIDriverClient(machineID, classKind, &secret, machineclass, machineName)

if machineID == "" {
id, name, err := driver.Create()
id, name, err := driver.CreateMachine()
if err != nil {
log.Fatalf("Could not create %s : %s", machineName, err)
}
fmt.Printf("Machine id: %s\n", id)
fmt.Printf("Name: %s\n", name)
} else {
err = driver.Delete()
err = driver.DeleteMachine(machineID)
if err != nil {
log.Fatalf("Could not delete %s : %s", machineID, err)
}
Expand Down

0 comments on commit a404308

Please sign in to comment.