Skip to content

Commit

Permalink
fix(hatchery/openstack): register worker (#3355)
Browse files Browse the repository at this point in the history
Signed-off-by: Yvonnick Esnault <yvonnick.esnault@corp.ovh.com>
  • Loading branch information
yesnault authored and bnjjj committed Sep 25, 2018
1 parent 9c85855 commit 3679c52
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 8 deletions.
2 changes: 1 addition & 1 deletion engine/api/services/dao.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ func All(db gorp.SqlExecutor) ([]sdk.Service, error) {
if err == sdk.ErrNotFound {
return nil, nil
}
return nil, sdk.WrapError(err, "All> Unable to find dead services")
return nil, sdk.WrapError(err, "All> Unable to find all services")
}
return services, nil
}
Expand Down
2 changes: 1 addition & 1 deletion engine/hatchery/openstack/spawn.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ func (h *HatcheryOpenstack) SpawnWorker(ctx context.Context, spawnArgs hatchery.
}

if spawnArgs.RegisterOnly {
spawnArgs.Model.ModelVirtualMachine.Cmd = strings.Replace(spawnArgs.Model.ModelVirtualMachine.Cmd, "worker ", "worker register ", 1)
spawnArgs.Model.ModelVirtualMachine.Cmd += " register"
}

udata := spawnArgs.Model.ModelVirtualMachine.PreCmd + "\n" + spawnArgs.Model.ModelVirtualMachine.Cmd + "\n" + spawnArgs.Model.ModelVirtualMachine.PostCmd
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ <h2>{{'worker_model_pattern_add' | translate}}</h2>
</textarea>
</div>
<div class="field">
<label>{{'worker_model_cmd' | translate}}</label>
<label suiPopup [popupText]="'worker_model_cmd_tooltip' | translate" popupPlacement="top left">
{{'worker_model_cmd' | translate}} <i _ngcontent-c5="" class="fa fa-question-circle"></i>
</label>
<input class="ui input"
type="text" name="cmd" [(ngModel)]="pattern.model.cmd"
[disabled]="loading || !currentUser.admin">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ <h2>{{'worker_model_pattern_edit' | translate}}</h2>
<textarea class="ui input" name="pre_cmd" [(ngModel)]="pattern.model.pre_cmd" [disabled]="loading || !currentUser.admin"></textarea>
</div>
<div class="field">
<label>{{'worker_model_cmd' | translate}}</label>
<label suiPopup [popupText]="'worker_model_cmd_tooltip' | translate" popupPlacement="top left">
{{'worker_model_cmd' | translate}} <i _ngcontent-c5="" class="fa fa-question-circle"></i>
</label>
<input class="ui input" type="text" name="cmd" [(ngModel)]="pattern.model.cmd" [disabled]="loading || !currentUser.admin">
</div>
<div class="field" *ngIf="pattern.type && pattern.type === 'docker'">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,9 @@ <h2 *ngIf="!workerModel || !workerModel.id">{{ 'worker_model_new_title' | transl
<input class="ui input" type="text" placeholder="sh -c" name="shell" [(ngModel)]="workerModel.model_docker.shell" [disabled]="loading || (!currentUser.admin && !workerModel.restricted)">
</div>
<div class="field">
<label>{{'worker_model_cmd_docker' | translate}} *</label>
<label suiPopup [popupText]="'worker_model_cmd_tooltip' | translate" popupPlacement="top left">
{{'worker_model_cmd_docker' | translate}} * <i _ngcontent-c5="" class="fa fa-question-circle"></i>
</label>
<input class="ui input" type="text" name="cmd" [(ngModel)]="workerModel.model_docker.cmd" [disabled]="loading || (!currentUser.admin && !workerModel.restricted)">
</div>
<div class="field">
Expand Down Expand Up @@ -180,7 +182,9 @@ <h2 *ngIf="!workerModel || !workerModel.id">{{ 'worker_model_new_title' | transl
</textarea>
</div>
<div class="field">
<label>{{'worker_model_cmd' | translate}} *</label>
<label suiPopup [popupText]="'worker_model_cmd_tooltip' | translate" popupPlacement="top left">
{{'worker_model_cmd' | translate}} * <i _ngcontent-c5="" class="fa fa-question-circle"></i>
</label>
<input
class="ui input"
type="text"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,9 @@ <h2 *ngIf="workerModel && workerModel.id">{{ 'worker_model_edit_title' | transla
<input class="ui input" type="text" name="shell" placeholder="sh -c" [(ngModel)]="workerModel.model_docker.shell" [disabled]="loading || (!currentUser.admin && !workerModel.restricted)">
</div>
<div class="field">
<label>{{'worker_model_cmd_docker' | translate}} *</label>
<label suiPopup [popupText]="'worker_model_cmd_tooltip' | translate" popupPlacement="top left">
{{'worker_model_cmd_docker' | translate}} * <i _ngcontent-c5="" class="fa fa-question-circle"></i>
</label>
<input
class="ui input"
type="text"
Expand Down Expand Up @@ -223,7 +225,9 @@ <h2 *ngIf="workerModel && workerModel.id">{{ 'worker_model_edit_title' | transla
</textarea>
</div>
<div class="field">
<label>{{'worker_model_cmd' | translate}} *</label>
<label suiPopup [popupText]="'worker_model_cmd_tooltip' | translate" popupPlacement="top left">
{{'worker_model_cmd' | translate}} * <i _ngcontent-c5="" class="fa fa-question-circle"></i>
</label>
<input
class="ui input"
type="text"
Expand Down
1 change: 1 addition & 0 deletions ui/src/assets/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -852,6 +852,7 @@
"worker_model_cmd_docker": "Command",
"worker_model_shell_docker": "Shell command",
"worker_model_cmd": "Main worker command",
"worker_model_cmd_tooltip": "The command must end with ./worker",
"worker_model_post_cmd": "Post worker command",
"worker_model_shell_cmd": "Main shell command",

Expand Down
1 change: 1 addition & 0 deletions ui/src/assets/i18n/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -850,6 +850,7 @@
"worker_model_pattern_edit": "Editer un pattern de modèle de worker",
"worker_model_pre_cmd": "Commande avant exécution du worker",
"worker_model_cmd": "Commande principale du worker",
"worker_model_cmd_tooltip": "La commande doit terminer par ./worker",
"worker_model_cmd_docker": "Commande",
"worker_model_shell_docker": "Commande shell",
"worker_model_post_cmd": "Commande après exécution du worker",
Expand Down

0 comments on commit 3679c52

Please sign in to comment.