Skip to content

Commit

Permalink
Add support for windows containers
Browse files Browse the repository at this point in the history
  • Loading branch information
marcosnils committed Aug 11, 2017
1 parent 7f17a7e commit 30d7097
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
6 changes: 4 additions & 2 deletions provisioner/windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ func (d *windows) InstanceDelete(session *types.Session, instance *types.Instanc
return nil
}

func (d *windows) InstanceResizeTerminal(instance *types.Instance, cols, rows uint) error {
func (d *windows) InstanceResizeTerminal(instance *types.Instance, rows, cols uint) error {
dockerClient, err := d.factory.GetForSession(instance.SessionId)
if err != nil {
return err
Expand Down Expand Up @@ -172,7 +172,9 @@ func (d *windows) getWindowsInstanceInfo(sessionId string) (*instanceInfo, error
availInstances := make([]string, len(instances))

for i, inst := range instances {
availInstances[i] = *inst.InstanceId
if *inst.LifecycleState == "InService" {
availInstances[i] = *inst.InstanceId
}
}

assignedInstances, err := d.storage.InstanceGetAllWindows()
Expand Down
4 changes: 3 additions & 1 deletion www/assets/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
$scope.isAlive = true;
$scope.ttl = '--:--:--';
$scope.connected = true;
$scope.type = {windows: false};
$scope.isInstanceBeingCreated = false;
$scope.newInstanceBtnText = '+ Add new instance';
$scope.deleteInstanceBtnText = 'Delete';
Expand Down Expand Up @@ -108,10 +109,11 @@

$scope.newInstance = function() {
updateNewInstanceBtnState(true);
var instanceType = $scope.type.windows ? 'windows': 'linux';
$http({
method: 'POST',
url: '/sessions/' + $scope.sessionId + '/instances',
data : { ImageName : InstanceService.getDesiredImage() }
data : { ImageName : InstanceService.getDesiredImage(), type: instanceType }
}).then(function(response) {
var i = $scope.upsertInstance(response.data);
$scope.showInstance(i);
Expand Down
7 changes: 6 additions & 1 deletion www/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,12 @@ <h1 class="md-headline">No connection to server. Reconnecting...</h1>
<div class="md-toolbar-tools">
<h1 class="md-toolbar-tools">Instances</h1>
<templates-icon></templates-icon>
<settings-icon></settings-icon>
<settings-icon></settings-icon><br/>
</div>
<div class="md-toolbar-tools">
<md-switch ng-disabled="instances.length > 0" ng-model="type.windows">
Windows containers {{windows}}
</md-switch>
</div>
</md-toolbar>
<md-content layout-padding>
Expand Down

0 comments on commit 30d7097

Please sign in to comment.