From da2e9386e5cd6de986cac9620d4420c308484165 Mon Sep 17 00:00:00 2001 From: Richard Cox Date: Fri, 11 Oct 2024 12:12:27 +0100 Subject: [PATCH] Fix cloud cred annotation collection - this magically worked before because const y = ['a']; this.x[y] --> this.['a'] - if anything else was added to the array it would fial --- shell/config/labels-annotations.js | 4 +--- shell/models/cloudcredential.js | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/shell/config/labels-annotations.js b/shell/config/labels-annotations.js index 12cf285d244..19209c14ad5 100644 --- a/shell/config/labels-annotations.js +++ b/shell/config/labels-annotations.js @@ -173,6 +173,4 @@ export const SYSTEM_LABELS = [ 'egress.rke2.io' ]; -export const CLOUD_CREDENTIALS = [ - 'rancher.io/expiration-timestamp', -]; +export const CLOUD_CREDENTIALS = { EXPIRATION: 'rancher.io/expiration-timestamp' }; diff --git a/shell/models/cloudcredential.js b/shell/models/cloudcredential.js index 11794e1b666..183b21cdaf8 100644 --- a/shell/models/cloudcredential.js +++ b/shell/models/cloudcredential.js @@ -247,7 +247,7 @@ export default class CloudCredential extends NormanModel { } get expires() { - const expires = this.annotations[CLOUD_CREDENTIALS]; + const expires = this.annotations[CLOUD_CREDENTIALS.EXPIRATION]; if (typeof expires === 'string') { return parseInt(expires);