Skip to content

Commit

Permalink
Merge pull request #7781 from Microsoft/users/ansheno/authTypeFixMaster
Browse files Browse the repository at this point in the history
Added proper check for authorizationType in Helm and Kubernetes Tasks
  • Loading branch information
Anumita authored Aug 21, 2018
2 parents a222502 + 9c11567 commit cb4d8cc
Show file tree
Hide file tree
Showing 9 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions Tasks/HelmDeployV0/src/clusters/generickubernetescluster.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import kubectlutility = require("utility-common/kubectlutility");

export async function getKubeConfig(): Promise<string> {
var kubernetesServiceEndpoint = tl.getInput("kubernetesServiceEndpoint", true);
var authorizationType = tl.getEndpointDataParameter(kubernetesServiceEndpoint, 'authorizationType', false);
if (authorizationType === "Kubeconfig")
var authorizationType = tl.getEndpointDataParameter(kubernetesServiceEndpoint, 'authorizationType', true);
if (!authorizationType || authorizationType === "Kubeconfig")
{
return tl.getEndpointAuthorizationParameter(kubernetesServiceEndpoint, 'kubeconfig', false);
}
Expand Down
2 changes: 1 addition & 1 deletion Tasks/HelmDeployV0/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"version": {
"Major": 0,
"Minor": 138,
"Patch": 1
"Patch": 2
},
"demands": [],
"groups": [
Expand Down
2 changes: 1 addition & 1 deletion Tasks/HelmDeployV0/task.loc.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"version": {
"Major": 0,
"Minor": 138,
"Patch": 1
"Patch": 2
},
"demands": [],
"groups": [
Expand Down
2 changes: 1 addition & 1 deletion Tasks/KubernetesV0/src/clusterconnection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export default class ClusterConnection {
return this.initialize().then(() => {
var authorizationType = tl.getEndpointDataParameter(kubernetesEndpoint, 'authorizationType', true);
var kubeconfig = null;
if (authorizationType == null || authorizationType === "Kubeconfig")
if (!authorizationType || authorizationType === "Kubeconfig")
{
if (kubernetesEndpoint) {
kubeconfig = tl.getEndpointAuthorizationParameter(kubernetesEndpoint, 'kubeconfig', false);
Expand Down
2 changes: 1 addition & 1 deletion Tasks/KubernetesV0/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"version": {
"Major": 0,
"Minor": 1,
"Patch": 27
"Patch": 28
},
"demands": [],
"preview": "false",
Expand Down
2 changes: 1 addition & 1 deletion Tasks/KubernetesV0/task.loc.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"version": {
"Major": 0,
"Minor": 1,
"Patch": 27
"Patch": 28
},
"demands": [],
"preview": "false",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import kubectlutility = require("utility-common/kubectlutility");
export async function getKubeConfig(): Promise<string> {
var kubernetesServiceEndpoint = tl.getInput("kubernetesServiceEndpoint", true);
var authorizationType = tl.getEndpointDataParameter(kubernetesServiceEndpoint, 'authorizationType', true);
if (authorizationType == null || authorizationType === "Kubeconfig")
if (!authorizationType || authorizationType === "Kubeconfig")
{
return tl.getEndpointAuthorizationParameter(kubernetesServiceEndpoint, 'kubeconfig', false);
}
Expand Down
2 changes: 1 addition & 1 deletion Tasks/KubernetesV1/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"version": {
"Major": 1,
"Minor": 1,
"Patch": 2
"Patch": 3
},
"demands": [],
"preview": "true",
Expand Down
2 changes: 1 addition & 1 deletion Tasks/KubernetesV1/task.loc.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"version": {
"Major": 1,
"Minor": 1,
"Patch": 2
"Patch": 3
},
"demands": [],
"preview": "true",
Expand Down

0 comments on commit cb4d8cc

Please sign in to comment.