Skip to content

Commit

Permalink
Kubeapp (releases/v2) (#142)
Browse files Browse the repository at this point in the history
* new app kind support

* adding node_modules

* rebuilding

Co-authored-by: Amruta Kawade <[email protected]>
  • Loading branch information
mattchenderson and AmrutaKawade authored May 24, 2021
1 parent 798e438 commit 676ed2b
Show file tree
Hide file tree
Showing 915 changed files with 34,785 additions and 178 deletions.
3 changes: 2 additions & 1 deletion lib/ActionInputValidator/Validations.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ function validateAppDetails() {
let actionParams = actionparameters_1.ActionParameters.getActionParams();
if (!!actionParams.appName || (!!actionParams.slotName && actionParams.slotName.toLowerCase() !== 'production')) {
let creds = PublishProfile_1.PublishProfile.getPublishProfile(actionParams.publishProfileContent).creds;
let splitUsername = creds.username.toUpperCase().substring(1).split("__");
//for kubeapps in publishsettings file username doesn't start with $, for all other apps it starts with $
let splitUsername = creds.username.startsWith("$") ? creds.username.toUpperCase().substring(1).split("__") : creds.username.toUpperCase().split("__");
let appNameMatch = !actionParams.appName || actionParams.appName.toUpperCase() === splitUsername[0];
let slotNameMatch = actionParams.slotName.toLowerCase() === 'production' || actionParams.slotName.toUpperCase() === splitUsername[1];
if (!appNameMatch || !slotNameMatch) {
Expand Down
25 changes: 15 additions & 10 deletions lib/ActionInputValidator/ValidatorFactory.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,21 @@ class ValidatorFactory {
// app-name is required to get resource details
Validations_1.appNameIsRequired(actionParams.appName);
yield this.getResourceDetails(actionParams);
switch (actionParams.kind) {
case actionparameters_1.WebAppKind.Linux:
return new SpnLinuxWebAppValidator_1.SpnLinuxWebAppValidator();
case actionparameters_1.WebAppKind.Windows:
return new SpnWindowsWebAppValidator_1.SpnWindowsWebAppValidator();
case actionparameters_1.WebAppKind.LinuxContainer:
if (!!actionParams.isLinux) {
if (!!actionParams.images) {
return new SpnLinuxContainerWebAppValidator_1.SpnLinuxContainerWebAppValidator();
case actionparameters_1.WebAppKind.WindowsContainer:
}
else {
return new SpnLinuxWebAppValidator_1.SpnLinuxWebAppValidator();
}
}
else {
if (!!actionParams.images) {
return new SpnWindowsContainerWebAppValidator_1.SpnWindowsContainerWebAppValidator();
default:
throw new Error(`Action does not support app service with kind ${actionParams.realKind}.`);
}
else {
return new SpnWindowsWebAppValidator_1.SpnWindowsWebAppValidator();
}
}
}
else {
Expand All @@ -65,7 +69,8 @@ class ValidatorFactory {
params.resourceGroupName = appDetails["resourceGroupName"];
params.realKind = appDetails["kind"];
params.kind = actionparameters_1.appKindMap.get(params.realKind);
params.isLinux = params.realKind.indexOf("linux") > -1;
//app kind linux and kubeapp is supported only on linux environment currently
params.isLinux = params.realKind.indexOf("linux") > -1 || params.realKind.indexOf("kubeapp") > -1;
});
}
static setResourceDetails(actionParams) {
Expand Down
15 changes: 5 additions & 10 deletions lib/DeploymentProvider/DeploymentProviderFactory.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,11 @@ class DeploymentProviderFactory {
}
}
else if (type == BaseWebAppDeploymentProvider_1.DEPLOYMENT_PROVIDER_TYPES.SPN) {
let kind = actionparameters_1.ActionParameters.getActionParams().kind;
switch (kind) {
case actionparameters_1.WebAppKind.Linux:
case actionparameters_1.WebAppKind.Windows:
return new WebAppDeploymentProvider_1.WebAppDeploymentProvider(type);
case actionparameters_1.WebAppKind.LinuxContainer:
case actionparameters_1.WebAppKind.WindowsContainer:
return new WebAppContainerDeployment_1.WebAppContainerDeploymentProvider(type);
default:
throw new Error("No deployment provider supporting app kind: " + kind);
if (!!actionparameters_1.ActionParameters.getActionParams().images) {
return new WebAppContainerDeployment_1.WebAppContainerDeploymentProvider(type);
}
else {
return new WebAppDeploymentProvider_1.WebAppDeploymentProvider(type);
}
}
else {
Expand Down
21 changes: 0 additions & 21 deletions node_modules/available-typed-arrays/LICENSE

This file was deleted.

2 changes: 1 addition & 1 deletion node_modules/es-abstract/.gitattributes

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

52 changes: 52 additions & 0 deletions node_modules/es-abstract/.github/workflows/codeql-analysis.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 20 additions & 0 deletions node_modules/es-abstract/test/tests.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions node_modules/is-callable/test/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

104 changes: 104 additions & 0 deletions node_modules/is-negative-zero/.jscs.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions node_modules/is-negative-zero/.npmignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

46 changes: 46 additions & 0 deletions node_modules/is-negative-zero/.travis.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 28 additions & 0 deletions node_modules/is-negative-zero/test.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 676ed2b

Please sign in to comment.