Skip to content

Commit

Permalink
Merge pull request #179 from aalves08/175-wrong-config-file-standard-…
Browse files Browse the repository at this point in the history
…user

Fix Wrong default cloud config file with standard user
  • Loading branch information
aalves08 authored May 8, 2024
2 parents 10c58a1 + 3c92d42 commit a3819be
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 10 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "elemental-ui",
"description": "Elemental UI extension",
"version": "1.3.1-rc5",
"version": "1.3.1-rc6",
"private": false,
"engines": {
"node": ">=12"
Expand Down
1 change: 1 addition & 0 deletions pkg/elemental/config/elemental-types.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export const ELEMENTAL_SCHEMA_IDS = {
MACHINE_INV_SELECTOR: 'elemental.cattle.io.machineinventoryselector',
MACHINE_INV_SELECTOR_TEMPLATES: 'elemental.cattle.io.machineinventoryselectortemplate',
SEED_IMAGE: 'elemental.cattle.io.seedimage',
METADATA: 'elemental.cattle.io.metadata',
};

export const KIND = { MACHINE_INV_SELECTOR_TEMPLATES: 'MachineInventorySelectorTemplate' };
Expand Down
2 changes: 1 addition & 1 deletion pkg/elemental/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "elemental",
"description": "OS Management extension",
"version": "1.3.1-rc5",
"version": "1.3.1-rc6",
"private": false,
"rancher": {
"annotations": {
Expand Down
1 change: 1 addition & 0 deletions pkg/elemental/types.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,5 @@ export const ELEMENTAL_SCHEMAS = {
MANAGED_OS_VERSIONS: 'elemental.cattle.io.managedosversions',
MACHINE_INV_SELECTOR: 'elemental.cattle.io.machineinventoryselectors',
MACHINE_INV_SELECTOR_TEMPLATES: 'elemental.cattle.io.machineinventoryselectortemplates',
METADATA: 'elemental.cattle.io.metadata',
};
15 changes: 7 additions & 8 deletions pkg/elemental/utils/feature-versioning.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import semver from 'semver';

import { _CREATE, _VIEW } from '@shell/config/query-params';
import { WORKLOAD_TYPES } from '@shell/config/types';
import { ELEMENTAL_SCHEMA_IDS } from '../config/elemental-types';
import { ELEMENTAL_TYPES } from '../types';

Expand All @@ -20,19 +19,19 @@ const FEATURES_GATING:FeaturesGatingConfig[] = [
{
area: ELEMENTAL_SCHEMA_IDS.MACHINE_REGISTRATIONS,
mode: [_CREATE],
minOperatorVersion: '1.6.0',
minOperatorVersion: '1.6.2',
features: [MACH_REG_CONFIG_DEFAULTS]
},
{
area: ELEMENTAL_TYPES.DASHBOARD,
mode: [_VIEW],
minOperatorVersion: '1.6.0',
minOperatorVersion: '1.6.2',
features: [BUILD_MEDIA_RAW_SUPPORT]
},
{
area: ELEMENTAL_SCHEMA_IDS.MACHINE_REGISTRATIONS,
mode: [_VIEW],
minOperatorVersion: '1.6.0',
minOperatorVersion: '1.6.2',
features: [BUILD_MEDIA_RAW_SUPPORT]
}
];
Expand All @@ -43,11 +42,11 @@ const FEATURES_GATING:FeaturesGatingConfig[] = [
* @returns Promise<string | void>
*/
export async function getOperatorVersion(store: any): Promise<string | void> {
// needed to check operator version installed (on the deployment)
if (store.getters['management/canList'](WORKLOAD_TYPES.DEPLOYMENT)) {
const elementalOperatorDeployment = await store.dispatch('management/find', { type: WORKLOAD_TYPES.DEPLOYMENT, id: 'cattle-elemental-system/elemental-operator' });
// needed to check operator version installed (on a custom CRD called metadata, which is installed/created from elemental-operator)
if (store.getters['management/canList'](ELEMENTAL_SCHEMA_IDS.METADATA)) {
const elementalOperatorMetadata = await store.dispatch('management/find', { type: ELEMENTAL_SCHEMA_IDS.METADATA, id: 'cattle-elemental-system/elemental-operator' });

return elementalOperatorDeployment?.metadata?.labels?.['app.kubernetes.io/version'] || '0.1.0';
return elementalOperatorMetadata?.spec?.appVersion || '0.1.0';
}

return '0.1.0';
Expand Down

0 comments on commit a3819be

Please sign in to comment.