Skip to content

Commit

Permalink
Merge pull request #165 from lawrencegripper/jc/mgmt-provider
Browse files Browse the repository at this point in the history
Verified provider in management server before doing anything else
  • Loading branch information
jjcollinge authored Sep 3, 2018
2 parents 5d52705 + 061bfae commit 86c1de9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
"request": "launch",
"mode": "debug",
"program": "${workspaceRoot}/cmd/management",
"envFile": "${workspaceRoot}/.vscode/management.private.env",
"envFile": "${workspaceRoot}/.vscode/private.env",
"showLog": true,
"args": [
"start",
Expand Down
16 changes: 11 additions & 5 deletions internal/app/management/servers/kubernetes.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,17 @@ func (k *Kubernetes) Create(ctx context.Context, r *module.ModuleCreateRequest)
// a unique ID for this creation
id := fmt.Sprintf("%s-%s", r.Modulename, genID())

// Validate provider
useAzureBatchProvider := false
switch strings.ToLower(r.Provider) {
case "azurebatch":
useAzureBatchProvider = true
case "kubernetes":
// noop
default:
return nil, fmt.Errorf("unrecognized provider %s", r.Provider)
}

// Create a configmap to store the configuration details
// needed by the module. These will be mounted into the
// dispatcher as a volume and then passed on when it
Expand Down Expand Up @@ -224,11 +235,6 @@ func (k *Kubernetes) Create(ctx context.Context, r *module.ModuleCreateRequest)

configMapFilePath := "/etc/config"

useAzureBatchProvider := false
if r.Provider == "azurebatch" {
useAzureBatchProvider = true
}

// Create an argument list to provide the the dispatcher binary
dispatcherArgs := []string{
"start",
Expand Down

0 comments on commit 86c1de9

Please sign in to comment.