Skip to content

Commit

Permalink
Bug 2222573: [BUG]: HelmDeploy and Kubernetes task on version 246 is …
Browse files Browse the repository at this point in the history
…having authorization issue on fetching credential of AKS cluster (#20547)
  • Loading branch information
PhilipsonJoseph authored Oct 15, 2024
1 parent 79e48e7 commit fde1edd
Show file tree
Hide file tree
Showing 54 changed files with 431 additions and 445 deletions.
2 changes: 1 addition & 1 deletion Tasks/AzureFunctionOnKubernetesV1/Tests/package-lock.json

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

311 changes: 152 additions & 159 deletions Tasks/AzureFunctionOnKubernetesV1/package-lock.json

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import tl = require('azure-pipelines-task-lib/task');
import { AzureAksService } from 'azure-pipelines-tasks-azure-arm-rest/azure-arm-aks-service';
import { AzureRMEndpoint } from 'azure-pipelines-tasks-azure-arm-rest/azure-arm-endpoint';
import { AzureEndpoint, AKSClusterAccessProfile, AKSCredentialResult} from 'azure-pipelines-tasks-azure-arm-rest/azureModels';
import { AzureEndpoint, AKSClusterAccessProfile} from 'azure-pipelines-tasks-azure-arm-rest/azureModels';

// get kubeconfig file content
async function getKubeConfigFromAKS(azureSubscriptionEndpoint: string, resourceGroup: string, clusterName: string, useClusterAdmin?: boolean) : Promise<string> {
Expand All @@ -12,8 +12,8 @@ async function getKubeConfigFromAKS(azureSubscriptionEndpoint: string, resourceG

tl.debug(tl.loc("KubernetesClusterResourceGroup", clusterName, resourceGroup));

var clusterInfo : AKSCredentialResult = await aks.getClusterCredential(resourceGroup, clusterName, useClusterAdmin);
var base64Kubeconfig = Buffer.from(clusterInfo.value, 'base64');
var clusterInfo : AKSClusterAccessProfile = await aks.getAccessProfile(resourceGroup, clusterName, useClusterAdmin);
var base64Kubeconfig = Buffer.from(clusterInfo.properties.kubeConfig, 'base64');
return base64Kubeconfig.toString();
}

Expand Down
2 changes: 1 addition & 1 deletion Tasks/AzureFunctionOnKubernetesV1/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"version": {
"Major": 1,
"Minor": 247,
"Patch": 0
"Patch": 2
},
"demands": [],
"groups": [
Expand Down
2 changes: 1 addition & 1 deletion Tasks/AzureFunctionOnKubernetesV1/task.loc.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"version": {
"Major": 1,
"Minor": 247,
"Patch": 0
"Patch": 2
},
"demands": [],
"groups": [
Expand Down
6 changes: 3 additions & 3 deletions Tasks/HelmDeployV0/src/clusters/armkubernetescluster.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import tl = require('azure-pipelines-task-lib/task');
import { AzureAksService } from 'azure-pipelines-tasks-azure-arm-rest/azure-arm-aks-service';
import { AzureRMEndpoint } from 'azure-pipelines-tasks-azure-arm-rest/azure-arm-endpoint';
import { AzureEndpoint, AKSCluster, AKSClusterAccessProfile, AKSCredentialResult} from 'azure-pipelines-tasks-azure-arm-rest/azureModels';
import { AzureEndpoint, AKSClusterAccessProfile} from 'azure-pipelines-tasks-azure-arm-rest/azureModels';

// get kubeconfig file content
async function getKubeConfigFromAKS(azureSubscriptionEndpoint: string, resourceGroup: string, clusterName: string, useClusterAdmin?: boolean) : Promise<string> {
Expand All @@ -12,8 +12,8 @@ async function getKubeConfigFromAKS(azureSubscriptionEndpoint: string, resourceG

tl.debug(tl.loc("KubernetesClusterResourceGroup", clusterName, resourceGroup));

var clusterInfo : AKSCredentialResult = await aks.getClusterCredential(resourceGroup, clusterName, useClusterAdmin);
var base64Kubeconfig = Buffer.from(clusterInfo.value, 'base64');
var clusterInfo : AKSClusterAccessProfile = await aks.getAccessProfile(resourceGroup, clusterName, useClusterAdmin);
var base64Kubeconfig = Buffer.from(clusterInfo.properties.kubeConfig, 'base64');
return base64Kubeconfig.toString();
}

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 @@
"author": "Microsoft Corporation",
"version": {
"Major": 0,
"Minor": 246,
"Minor": 247,
"Patch": 0
},
"demands": [],
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 @@
"author": "Microsoft Corporation",
"version": {
"Major": 0,
"Minor": 246,
"Minor": 247,
"Patch": 0
},
"demands": [],
Expand Down
6 changes: 3 additions & 3 deletions Tasks/HelmDeployV1/src/clusters/armkubernetescluster.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import tl = require('azure-pipelines-task-lib/task');
import { AzureAksService } from 'azure-pipelines-tasks-azure-arm-rest/azure-arm-aks-service';
import { AzureRMEndpoint } from 'azure-pipelines-tasks-azure-arm-rest/azure-arm-endpoint';
import { AzureEndpoint, AKSCluster, AKSClusterAccessProfile, AKSCredentialResult} from 'azure-pipelines-tasks-azure-arm-rest/azureModels';
import { AzureEndpoint, AKSClusterAccessProfile} from 'azure-pipelines-tasks-azure-arm-rest/azureModels';

// get kubeconfig file content
async function getKubeConfigFromAKS(azureSubscriptionEndpoint: string, resourceGroup: string, clusterName: string, useClusterAdmin?: boolean) : Promise<string> {
Expand All @@ -12,8 +12,8 @@ async function getKubeConfigFromAKS(azureSubscriptionEndpoint: string, resourceG

tl.debug(tl.loc("KubernetesClusterResourceGroup", clusterName, resourceGroup));

var clusterInfo : AKSCredentialResult = await aks.getClusterCredential(resourceGroup, clusterName, useClusterAdmin);
var base64Kubeconfig = Buffer.from(clusterInfo.value, 'base64');
var clusterInfo : AKSClusterAccessProfile = await aks.getAccessProfile(resourceGroup, clusterName, useClusterAdmin);
var base64Kubeconfig = Buffer.from(clusterInfo.properties.kubeConfig, 'base64');
return base64Kubeconfig.toString();
}

Expand Down
2 changes: 1 addition & 1 deletion Tasks/HelmDeployV1/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"author": "Microsoft Corporation",
"version": {
"Major": 1,
"Minor": 246,
"Minor": 247,
"Patch": 0
},
"demands": [],
Expand Down
2 changes: 1 addition & 1 deletion Tasks/HelmDeployV1/task.loc.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"author": "Microsoft Corporation",
"version": {
"Major": 1,
"Minor": 246,
"Minor": 247,
"Patch": 0
},
"demands": [],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import tl = require('azure-pipelines-task-lib/task');
import { AzureAksService } from 'azure-pipelines-tasks-azure-arm-rest/azure-arm-aks-service';
import { AzureRMEndpoint } from 'azure-pipelines-tasks-azure-arm-rest/azure-arm-endpoint';
import { AzureEndpoint, AKSClusterAccessProfile, AKSCredentialResult} from 'azure-pipelines-tasks-azure-arm-rest/azureModels';
import { AzureEndpoint, AKSClusterAccessProfile} from 'azure-pipelines-tasks-azure-arm-rest/azureModels';

// get kubeconfig file content
async function getKubeConfigFromAKS(azureSubscriptionEndpoint: string, resourceGroup: string, clusterName: string, useClusterAdmin?: boolean) : Promise<string> {
Expand All @@ -12,8 +12,8 @@ async function getKubeConfigFromAKS(azureSubscriptionEndpoint: string, resourceG

tl.debug(tl.loc("KubernetesClusterResourceGroup", clusterName, resourceGroup));

var clusterInfo : AKSCredentialResult = await aks.getClusterCredential(resourceGroup, clusterName, useClusterAdmin);
var base64Kubeconfig = Buffer.from(clusterInfo.value, 'base64');
var clusterInfo : AKSClusterAccessProfile = await aks.getAccessProfile(resourceGroup, clusterName, useClusterAdmin);
var base64Kubeconfig = Buffer.from(clusterInfo.properties.kubeConfig, 'base64');
return base64Kubeconfig.toString();
}

Expand Down
2 changes: 1 addition & 1 deletion Tasks/KubernetesManifestV1/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"author": "Microsoft Corporation",
"version": {
"Major": 1,
"Minor": 246,
"Minor": 247,
"Patch": 0
},
"demands": [],
Expand Down
2 changes: 1 addition & 1 deletion Tasks/KubernetesManifestV1/task.loc.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"author": "Microsoft Corporation",
"version": {
"Major": 1,
"Minor": 246,
"Minor": 247,
"Patch": 0
},
"demands": [],
Expand Down
6 changes: 3 additions & 3 deletions Tasks/KubernetesV1/src/clusters/armkubernetescluster.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import tl = require('azure-pipelines-task-lib/task');
import { AzureAksService } from 'azure-pipelines-tasks-azure-arm-rest/azure-arm-aks-service';
import { AzureRMEndpoint } from 'azure-pipelines-tasks-azure-arm-rest/azure-arm-endpoint';
import { AzureEndpoint, AKSCluster, AKSClusterAccessProfile, AKSCredentialResult} from 'azure-pipelines-tasks-azure-arm-rest/azureModels';
import { AzureEndpoint, AKSCluster, AKSClusterAccessProfile} from 'azure-pipelines-tasks-azure-arm-rest/azureModels';

// get kubeconfig file content
async function getKubeConfigFromAKS(azureSubscriptionEndpoint: string, resourceGroup: string, clusterName: string, useClusterAdmin?: boolean) : Promise<string> {
Expand All @@ -12,8 +12,8 @@ async function getKubeConfigFromAKS(azureSubscriptionEndpoint: string, resourceG

tl.debug(tl.loc("KubernetesClusterResourceGroup", clusterName, resourceGroup));

var clusterInfo : AKSCredentialResult = await aks.getClusterCredential(resourceGroup, clusterName, useClusterAdmin);
var base64Kubeconfig = Buffer.from(clusterInfo.value, 'base64');
var clusterInfo : AKSClusterAccessProfile = await aks.getAccessProfile(resourceGroup, clusterName, useClusterAdmin);
var base64Kubeconfig = Buffer.from(clusterInfo.properties.kubeConfig, 'base64');
return base64Kubeconfig.toString();
}

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 @@
"author": "Microsoft Corporation",
"version": {
"Major": 1,
"Minor": 246,
"Minor": 247,
"Patch": 0
},
"demands": [],
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 @@
"author": "Microsoft Corporation",
"version": {
"Major": 1,
"Minor": 246,
"Minor": 247,
"Patch": 0
},
"demands": [],
Expand Down
4 changes: 2 additions & 2 deletions _generated/AzureFunctionOnKubernetesV1.versionmap.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
Default|1.247.0
Node20_229_2|1.247.1
Default|1.247.2
Node20_229_2|1.247.3

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

Loading

0 comments on commit fde1edd

Please sign in to comment.