Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting DNS name label as optional #54

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ inputs:
default: 1
dns-name-label:
description: 'The DNS Name Label for Container with Public IP'
required: true
required: false
environment-variables:
description: 'List of environment variables for the container. Space-seperated in "key=value" format'
required: false
Expand Down Expand Up @@ -88,6 +88,9 @@ inputs:
name:
description: 'Name of the Container Group Instance'
required: true
network-profile-id:
description: 'ID of the network profile. Required only when ip-address is set Private.'
required: false
os-type:
description: 'The OS type of the Containers. Accepted Values are { Linux, Windows }'
required: false
Expand Down
3 changes: 3 additions & 0 deletions lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ function main() {
"type": taskParams.ipAddress,
"dnsNameLabel": taskParams.dnsNameLabel
},
"networkProfile": {
"id": taskParams.networkProfileId
},
"diagnostics": taskParams.diagnostics,
"volumes": taskParams.volumes,
"osType": taskParams.osType,
Expand Down
10 changes: 7 additions & 3 deletions lib/taskparameters.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class TaskParameters {
});
}
this._cpu = parseFloat(core.getInput('cpu'));
this._dnsNameLabel = core.getInput('dns-name-label', { required: true });
this._dnsNameLabel = core.getInput('dns-name-label');
this._diagnostics = {};
let logType = core.getInput('log-type');
let logAnalyticsWorkspace = core.getInput('log-analytics-workspace');
Expand Down Expand Up @@ -51,6 +51,7 @@ class TaskParameters {
else {
this._ipAddress = (ipAddress == 'Public') ? 'Public' : 'Private';
}
this._networkProfileId = core.getInput('network-profile-id');
this._location = core.getInput('location', { required: true });
this._memory = parseFloat(core.getInput('memory'));
this._containerName = core.getInput('name', { required: true });
Expand Down Expand Up @@ -135,7 +136,7 @@ class TaskParameters {
let pairList = pair.split(/=(?:"(.+)"|(.+))/);
let obj = {
"name": pairList[0],
"value": pairList[1] || pairList[2]
"secureValue": pairList[1] || pairList[2]
};
this._environmentVariables.push(obj);
});
Expand Down Expand Up @@ -276,5 +277,8 @@ class TaskParameters {
get subscriptionId() {
return this._subscriptionId;
}
get networkProfileId() {
return this._networkProfileId;
}
}
exports.TaskParameters = TaskParameters;
exports.TaskParameters = TaskParameters;
3 changes: 3 additions & 0 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ async function main() {
"type": taskParams.ipAddress,
"dnsNameLabel": taskParams.dnsNameLabel
},
"networkProfile": {
"id": taskParams.networkProfileId
},
"diagnostics": taskParams.diagnostics,
"volumes": taskParams.volumes,
"osType": taskParams.osType,
Expand Down
8 changes: 7 additions & 1 deletion src/taskparameters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export class TaskParameters {
private _gpuSKU: ContainerInstanceManagementModels.GpuSku;
private _image:string;
private _ipAddress:ContainerInstanceManagementModels.ContainerGroupIpAddressType;
private _networkProfileId:string;
private _location:string;
private _memory: number;
private _containerName: string;
Expand Down Expand Up @@ -45,7 +46,7 @@ export class TaskParameters {
});
}
this._cpu = parseFloat(core.getInput('cpu'));
this._dnsNameLabel = core.getInput('dns-name-label', { required: true });
this._dnsNameLabel = core.getInput('dns-name-label');
this._diagnostics = {}
let logType = core.getInput('log-type');
let logAnalyticsWorkspace = core.getInput('log-analytics-workspace');
Expand Down Expand Up @@ -73,6 +74,7 @@ export class TaskParameters {
} else {
this._ipAddress = (ipAddress == 'Public') ? 'Public' : 'Private';
}
this._networkProfileId = core.getInput('network-profile-id');
this._location = core.getInput('location', { required: true });
this._memory = parseFloat(core.getInput('memory'));
this._containerName = core.getInput('name', { required: true });
Expand Down Expand Up @@ -323,4 +325,8 @@ export class TaskParameters {
return this._subscriptionId;
}

public get networkProfileId() {
return this._networkProfileId;
}

}