Skip to content

Commit

Permalink
Merge pull request #984 from NERC-CEH/ED-121-yarnaudit
Browse files Browse the repository at this point in the history
fix: bump kubernetes-client and fix deprecated k8s auto-scaler API
  • Loading branch information
o2a authored Jun 24, 2024
2 parents 6d65d97 + da44e16 commit 791e0f4
Show file tree
Hide file tree
Showing 6 changed files with 78 additions and 269 deletions.
2 changes: 1 addition & 1 deletion code/workspaces/infrastructure-api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"private": true,
"dependencies": {
"@babel/runtime": "^7.16.0",
"@kubernetes/client-node": "^0.16.3",
"@kubernetes/client-node": "^0.20",
"axios": "0.28.0",
"bluebird": "3.5.5",
"body-parser": "1.20.2",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: autoscaling/v2beta2
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: {{name}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1028,7 +1028,7 @@ spec:
`;

exports[`deploymentGenerator generates createAutoScaler manifest 1`] = `
"apiVersion: autoscaling/v2beta2
"apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: auto-scaler-name
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const API_BASE = config.get('kubernetesApi');

const getAutoScalerUrl = (namespace, name) => {
const nameComponent = name ? `/${name}` : '';
return `${API_BASE}/apis/autoscaling/v2beta2/namespaces/${namespace}/horizontalpodautoscalers${nameComponent}`;
return `${API_BASE}/apis/autoscaling/v2/namespaces/${namespace}/horizontalpodautoscalers${nameComponent}`;
};

const YAML_CONTENT_HEADER = { headers: { 'Content-Type': 'application/yaml' } };
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import autoScalerApi from './autoScalerApi';
const mockAxios = new MockAdapter(axios);
const apiBase = config.get('kubernetesApi');
const namespace = 'namespace';
const hpaUrl = `${apiBase}/apis/autoscaling/v2beta2/namespaces/${namespace}/horizontalpodautoscalers`;
const hpaUrl = `${apiBase}/apis/autoscaling/v2/namespaces/${namespace}/horizontalpodautoscalers`;
const hpaName = 'hpa-name';

const hpaResource = {
Expand Down
Loading

0 comments on commit 791e0f4

Please sign in to comment.