1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-22 23:09:41 +02:00

fix(gke): port metrics to the backend EE-5447 (#9041)

This commit is contained in:
Dakota Walsh 2023-07-24 12:16:29 +12:00 committed by GitHub
parent e996d29d52
commit 704d70c99b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 441 additions and 247 deletions

View file

@ -9,6 +9,7 @@ import { KubernetesNodeTaintEffects, KubernetesNodeAvailabilities } from 'Kubern
import KubernetesFormValidationHelper from 'Kubernetes/helpers/formValidationHelper';
import { KubernetesNodeHelper } from 'Kubernetes/node/helper';
import { confirmUpdateNode } from '@/react/kubernetes/cluster/NodeView/ConfirmUpdateNode';
import { getMetricsForNode } from '@/react/kubernetes/services/service.ts';
class KubernetesNodeController {
/* @ngInject */
@ -22,7 +23,6 @@ class KubernetesNodeController {
KubernetesPodService,
KubernetesApplicationService,
KubernetesEndpointService,
KubernetesMetricsService,
Authentication
) {
this.$async = $async;
@ -34,7 +34,6 @@ class KubernetesNodeController {
this.KubernetesPodService = KubernetesPodService;
this.KubernetesApplicationService = KubernetesApplicationService;
this.KubernetesEndpointService = KubernetesEndpointService;
this.KubernetesMetricsService = KubernetesMetricsService;
this.Authentication = Authentication;
this.onInit = this.onInit.bind(this);
@ -300,7 +299,7 @@ class KubernetesNodeController {
async getNodeUsageAsync() {
try {
const nodeName = this.$transition$.params().name;
const node = await this.KubernetesMetricsService.getNode(nodeName);
const node = await getMetricsForNode(this.$state.params.endpointId, nodeName);
this.resourceUsage = new KubernetesResourceReservation();
this.resourceUsage.CPU = KubernetesResourceReservationHelper.parseCPU(node.usage.cpu);
this.resourceUsage.Memory = KubernetesResourceReservationHelper.megaBytesValue(node.usage.memory);