@backstage/plugin-kubernetes 0.6.4 → 0.6.5-next.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,34 @@
1
1
  # @backstage/plugin-kubernetes
2
2
 
3
+ ## 0.6.5-next.2
4
+
5
+ ### Patch Changes
6
+
7
+ - 1ef98cfe48: add Azure Identity auth provider and AKS dashboard formatter
8
+ - Updated dependencies
9
+ - @backstage/core-components@0.9.4-next.1
10
+ - @backstage/plugin-kubernetes-common@0.2.10-next.0
11
+ - @backstage/config@1.0.1-next.0
12
+ - @backstage/plugin-catalog-react@1.1.0-next.2
13
+ - @backstage/catalog-model@1.0.2-next.0
14
+ - @backstage/core-plugin-api@1.0.2-next.1
15
+
16
+ ## 0.6.5-next.1
17
+
18
+ ### Patch Changes
19
+
20
+ - Updated dependencies
21
+ - @backstage/core-components@0.9.4-next.0
22
+ - @backstage/core-plugin-api@1.0.2-next.0
23
+ - @backstage/plugin-catalog-react@1.1.0-next.1
24
+
25
+ ## 0.6.5-next.0
26
+
27
+ ### Patch Changes
28
+
29
+ - Updated dependencies
30
+ - @backstage/plugin-catalog-react@1.1.0-next.0
31
+
3
32
  ## 0.6.4
4
33
 
5
34
  ### Patch Changes
package/dist/index.esm.js CHANGED
@@ -108,6 +108,12 @@ class GoogleServiceAccountAuthProvider {
108
108
  }
109
109
  }
110
110
 
111
+ class AzureKubernetesAuthProvider {
112
+ async decorateRequestBodyForAuth(requestBody) {
113
+ return requestBody;
114
+ }
115
+ }
116
+
111
117
  class KubernetesAuthProviders {
112
118
  constructor(options) {
113
119
  this.kubernetesAuthProviderMap = /* @__PURE__ */ new Map();
@@ -115,6 +121,7 @@ class KubernetesAuthProviders {
115
121
  this.kubernetesAuthProviderMap.set("serviceAccount", new ServiceAccountKubernetesAuthProvider());
116
122
  this.kubernetesAuthProviderMap.set("googleServiceAccount", new GoogleServiceAccountAuthProvider());
117
123
  this.kubernetesAuthProviderMap.set("aws", new AwsKubernetesAuthProvider());
124
+ this.kubernetesAuthProviderMap.set("azure", new AzureKubernetesAuthProvider());
118
125
  }
119
126
  async decorateRequestBodyForAuth(authProvider, requestBody) {
120
127
  const kubernetesAuthProvider = this.kubernetesAuthProviderMap.get(authProvider);
@@ -727,8 +734,29 @@ function openshiftFormatter(options) {
727
734
  return new URL(path, basePath);
728
735
  }
729
736
 
730
- function aksFormatter(_options) {
731
- throw new Error("AKS formatter is not yet implemented. Please, contribute!");
737
+ const basePath = "https://portal.azure.com/#blade/Microsoft_Azure_ContainerService/AksK8ResourceMenuBlade/overview-Deployment/aksClusterId";
738
+ const requiredParams = ["subscriptionId", "resourceGroup", "clusterName"];
739
+ function aksFormatter(options) {
740
+ if (!options.dashboardParameters) {
741
+ throw new Error("AKS dashboard requires a dashboardParameters option");
742
+ }
743
+ const args = options.dashboardParameters;
744
+ for (const param of requiredParams) {
745
+ if (typeof args[param] !== "string") {
746
+ throw new Error(`AKS dashboard requires a "${param}" of type string in the dashboardParameters option`);
747
+ }
748
+ }
749
+ const path = `/subscriptions/${args.subscriptionId}/resourceGroups/${args.resourceGroup}/providers/Microsoft.ContainerService/managedClusters/${args.clusterName}`;
750
+ const { name, namespace, uid } = options.object.metadata;
751
+ const { selector } = options.object.spec;
752
+ const params = {
753
+ kind: options.kind,
754
+ metadata: { name, namespace, uid },
755
+ spec: {
756
+ selector
757
+ }
758
+ };
759
+ return new URL(`${basePath}/${encodeURIComponent(path)}/resource/${encodeURIComponent(JSON.stringify(params))}`);
732
760
  }
733
761
 
734
762
  function eksFormatter(_options) {