Skip to content

Commit

Permalink
Fix cloud cred annotation collection
Browse files Browse the repository at this point in the history
- this magically worked before because const y = ['a']; this.x[y] --> this.['a']
- if anything else was added to the array it would fial
  • Loading branch information
richard-cox committed Oct 11, 2024
1 parent 0b7f334 commit da2e938
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 1 addition & 3 deletions shell/config/labels-annotations.js
Original file line number Diff line number Diff line change
Expand Up @@ -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' };
2 changes: 1 addition & 1 deletion shell/models/cloudcredential.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit da2e938

Please sign in to comment.