From 0041cced46364892aa4d41f23fc2961055f00aa5 Mon Sep 17 00:00:00 2001 From: Harsh Shankar Rao Date: Wed, 19 Feb 2025 01:04:24 +0530 Subject: [PATCH 1/2] hotfix: Uptime interface for LongView API response (#11667) * fixed uptime interface to match api response * version bump * Update changelog --------- Co-authored-by: Hussain Khalil --- packages/manager/CHANGELOG.md | 7 +++ packages/manager/package.json | 2 +- .../manager/src/factories/longviewDisks.ts | 46 +++++++++---------- .../LongviewDetail/DetailTabs/IconSection.tsx | 2 +- .../LongviewLanding/LongviewClientHeader.tsx | 2 +- .../src/features/Longview/request.types.ts | 2 +- 6 files changed, 34 insertions(+), 27 deletions(-) diff --git a/packages/manager/CHANGELOG.md b/packages/manager/CHANGELOG.md index 4de5fc54ae0..b4d5193d34c 100644 --- a/packages/manager/CHANGELOG.md +++ b/packages/manager/CHANGELOG.md @@ -4,6 +4,13 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). +## [2025-02-18] - v1.136.1 + + +### Fixed: + +- Uptime not displaying in Longview ([#11667](https://github.com/linode/manager/pull/11667)) + ## [2025-02-11] - v1.136.0 diff --git a/packages/manager/package.json b/packages/manager/package.json index 1ebb1a097f9..dc8de02cd33 100644 --- a/packages/manager/package.json +++ b/packages/manager/package.json @@ -2,7 +2,7 @@ "name": "linode-manager", "author": "Linode", "description": "The Linode Manager website", - "version": "1.136.0", + "version": "1.136.1", "private": true, "type": "module", "bugs": { diff --git a/packages/manager/src/factories/longviewDisks.ts b/packages/manager/src/factories/longviewDisks.ts index ea43a79a5ac..82f21b91582 100644 --- a/packages/manager/src/factories/longviewDisks.ts +++ b/packages/manager/src/factories/longviewDisks.ts @@ -1,16 +1,16 @@ import Factory from 'src/factories/factoryProxy'; -import { - Disk, - LongviewDisk, - LongviewCPU, +import type { CPU, - LongviewSystemInfo, - LongviewNetworkInterface, + Disk, InboundOutboundNetwork, - LongviewNetwork, - LongviewMemory, + LongviewCPU, + LongviewDisk, LongviewLoad, + LongviewMemory, + LongviewNetwork, + LongviewNetworkInterface, + LongviewSystemInfo, Uptime, } from 'src/features/Longview/request.types'; @@ -38,25 +38,25 @@ export const diskFactory = Factory.Sync.makeFactory({ childof: 0, children: 0, dm: 0, - isswap: 0, - mounted: 1, - reads: [mockStats[0]], - write_bytes: [mockStats[1]], - writes: [mockStats[2]], fs: { - total: [mockStats[3]], + free: [mockStats[6]], ifree: [mockStats[4]], itotal: [mockStats[5]], path: '/', - free: [mockStats[6]], + total: [mockStats[3]], }, + isswap: 0, + mounted: 1, read_bytes: [mockStats[0]], + reads: [mockStats[0]], + write_bytes: [mockStats[1]], + writes: [mockStats[2]], }); export const cpuFactory = Factory.Sync.makeFactory({ system: [mockStats[7]], - wait: [mockStats[8]], user: [mockStats[9]], + wait: [mockStats[8]], }); export const longviewDiskFactory = Factory.Sync.makeFactory({ @@ -117,15 +117,15 @@ export const longviewNetworkFactory = Factory.Sync.makeFactory( export const LongviewMemoryFactory = Factory.Sync.makeFactory({ Memory: { - swap: { - free: [mockStats[12]], - used: [mockStats[0]], - }, real: { - used: [mockStats[13]], - free: [mockStats[14]], buffers: [mockStats[15]], cache: [mockStats[16]], + free: [mockStats[14]], + used: [mockStats[13]], + }, + swap: { + free: [mockStats[12]], + used: [mockStats[0]], }, }, }); @@ -135,5 +135,5 @@ export const LongviewLoadFactory = Factory.Sync.makeFactory({ }); export const UptimeFactory = Factory.Sync.makeFactory({ - uptime: 84516.53, + Uptime: 84516.53, }); diff --git a/packages/manager/src/features/Longview/LongviewDetail/DetailTabs/IconSection.tsx b/packages/manager/src/features/Longview/LongviewDetail/DetailTabs/IconSection.tsx index 88023c1b76a..2488bb4319f 100644 --- a/packages/manager/src/features/Longview/LongviewDetail/DetailTabs/IconSection.tsx +++ b/packages/manager/src/features/Longview/LongviewDetail/DetailTabs/IconSection.tsx @@ -48,7 +48,7 @@ export const IconSection = React.memo((props: Props) => { props.longviewClientData?.SysInfo?.cpu?.type ?? 'CPU information not available'; - const uptime = props.longviewClientData?.uptime ?? null; + const uptime = props.longviewClientData?.Uptime ?? null; const formattedUptime = uptime !== null ? `Up ${formatUptime(uptime)}` : 'Uptime not available'; diff --git a/packages/manager/src/features/Longview/LongviewLanding/LongviewClientHeader.tsx b/packages/manager/src/features/Longview/LongviewLanding/LongviewClientHeader.tsx index 1463f65ef0c..37509e5b09b 100644 --- a/packages/manager/src/features/Longview/LongviewLanding/LongviewClientHeader.tsx +++ b/packages/manager/src/features/Longview/LongviewLanding/LongviewClientHeader.tsx @@ -74,7 +74,7 @@ export const LongviewClientHeader = enhanced( const hostname = longviewClientData.SysInfo?.hostname ?? 'Hostname not available'; - const uptime = longviewClientData?.uptime ?? null; + const uptime = longviewClientData?.Uptime ?? null; const formattedUptime = uptime !== null ? `Up ${formatUptime(uptime)}` : 'Uptime not available'; const packages = longviewClientData?.Packages ?? null; diff --git a/packages/manager/src/features/Longview/request.types.ts b/packages/manager/src/features/Longview/request.types.ts index dd4dbb15de6..248b42ac2bb 100644 --- a/packages/manager/src/features/Longview/request.types.ts +++ b/packages/manager/src/features/Longview/request.types.ts @@ -118,7 +118,7 @@ export interface LastUpdated { } export interface Uptime { - uptime: number; + Uptime: number; } export interface LongviewPackage { From f610cb9e1c8766ed455fb931466e3943e8bfdd78 Mon Sep 17 00:00:00 2001 From: Mariah Jacobs <114685994+mjac0bs@users.noreply.github.com> Date: Tue, 18 Feb 2025 15:33:15 -0800 Subject: [PATCH 2/2] fix: [M3-9343] - Fix validation with LKE Node Pool Labels creation (#11682) * Add missing underscore to validation for key * Update test coverage with more complex label/taint naming * Update changelog * Update changelog * Re-add the change in 7e415e4 that vanished * Bump validation package.json, correct changelog --- packages/manager/CHANGELOG.md | 3 +-- .../e2e/core/kubernetes/lke-update.spec.ts | 16 ++++++++-------- packages/validation/CHANGELOG.md | 7 +++++++ packages/validation/package.json | 2 +- packages/validation/src/kubernetes.schema.ts | 2 +- 5 files changed, 18 insertions(+), 12 deletions(-) diff --git a/packages/manager/CHANGELOG.md b/packages/manager/CHANGELOG.md index b4d5193d34c..28ba42b7025 100644 --- a/packages/manager/CHANGELOG.md +++ b/packages/manager/CHANGELOG.md @@ -4,8 +4,7 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). -## [2025-02-18] - v1.136.1 - +## [2025-02-19] - v1.136.1 ### Fixed: diff --git a/packages/manager/cypress/e2e/core/kubernetes/lke-update.spec.ts b/packages/manager/cypress/e2e/core/kubernetes/lke-update.spec.ts index 984ca1e9083..25cac9d6111 100644 --- a/packages/manager/cypress/e2e/core/kubernetes/lke-update.spec.ts +++ b/packages/manager/cypress/e2e/core/kubernetes/lke-update.spec.ts @@ -1291,16 +1291,16 @@ describe('LKE cluster updates', () => { }); it('can add labels and taints', () => { - const mockNewSimpleLabel = 'my-label-key: my-label-value'; - const mockNewDNSLabel = 'my-label-key.io/app: my-label-value'; + const mockNewSimpleLabel = 'my_label.-key: my_label.-value'; + const mockNewDNSLabel = 'my_label-key.io/app: my_label.-value'; const mockNewTaint: Taint = { - key: 'my-taint-key', - value: 'my-taint-value', + key: 'my_taint.-key', + value: 'my_taint.-value', effect: 'NoSchedule', }; const mockNewDNSTaint: Taint = { - key: 'my-taint-key.io/app', - value: 'my-taint-value', + key: 'my_taint-key.io/app', + value: 'my_taint.-value', effect: 'NoSchedule', }; const mockNodePoolUpdated = nodePoolFactory.build({ @@ -1309,8 +1309,8 @@ describe('LKE cluster updates', () => { nodes: mockNodes, taints: [mockNewTaint, mockNewDNSTaint], labels: { - 'my-label-key': 'my-label-value', - 'my-label-key.io/app': 'my-label-value', + 'my_label-key': 'my_label.-value', + 'my_label-key.io/app': 'my_label.-value', }, }); diff --git a/packages/validation/CHANGELOG.md b/packages/validation/CHANGELOG.md index c8b77966f16..cf302593024 100644 --- a/packages/validation/CHANGELOG.md +++ b/packages/validation/CHANGELOG.md @@ -1,3 +1,10 @@ +## [2025-02-19] - v0.60.1 + +### Fixed: + +- Inability to add LKE Node Pool Labels with underscore in key ([#11682](https://github.com/linode/manager/pull/11682)) + + ## [2025-02-11] - v0.60.0 diff --git a/packages/validation/package.json b/packages/validation/package.json index 43cc0b550f2..10855a2ddd7 100644 --- a/packages/validation/package.json +++ b/packages/validation/package.json @@ -1,6 +1,6 @@ { "name": "@linode/validation", - "version": "0.60.0", + "version": "0.60.1", "description": "Yup validation schemas for use with the Linode APIv4", "type": "module", "main": "lib/index.cjs", diff --git a/packages/validation/src/kubernetes.schema.ts b/packages/validation/src/kubernetes.schema.ts index 76b3389f6d1..a37584765ab 100644 --- a/packages/validation/src/kubernetes.schema.ts +++ b/packages/validation/src/kubernetes.schema.ts @@ -93,7 +93,7 @@ export const kubernetesControlPlaneACLPayloadSchema = object().shape({ const alphaNumericValidCharactersRegex = /^[a-zA-Z0-9]([a-zA-Z0-9-._]*[a-zA-Z0-9])?$/; // DNS subdomain key (example.com/my-app) -const dnsKeyRegex = /^[a-zA-Z0-9]([a-zA-Z0-9-./]*[a-zA-Z0-9])?(\.[a-zA-Z0-9]([a-zA-Z0-9-]*[a-zA-Z0-9])?)*$/; +const dnsKeyRegex = /^[a-zA-Z0-9]([a-zA-Z0-9-._/]*[a-zA-Z0-9])?(\.[a-zA-Z0-9]([a-zA-Z0-9-]*[a-zA-Z0-9])?)*$/; const MAX_DNS_KEY_TOTAL_LENGTH = 128; const MAX_DNS_KEY_SUFFIX_LENGTH = 62;