Rename Fleet agent resources

Signed-off-by: Francesco Torchia <francesco.torchia@suse.com>
This commit is contained in:
Francesco Torchia 2025-03-04 11:33:02 +01:00
parent be6eada459
commit a679cdf119
No known key found for this signature in database
GPG Key ID: E6D011B7415D4393
2 changed files with 32 additions and 32 deletions

View File

@ -71,7 +71,7 @@ describe('page: cluster dashboard', () => {
});
describe.each([
['local', 'fleet', true, ['fleetDeployment', 'fleetStatefulSet'], [
['local', 'fleet', true, ['fleetControllerResource', 'fleetAgentResource'], [
[STATES_ENUM.IN_PROGRESS, 'icon-spinner', false, false, false, '', 0, 0],
[STATES_ENUM.UNHEALTHY, 'icon-warning', true, false, false, [{ status: 'False' }], 0, 0],
[STATES_ENUM.UNHEALTHY, 'icon-warning', true, false, true, [{ status: 'True' }], 0, 0],
@ -80,7 +80,7 @@ describe('page: cluster dashboard', () => {
[STATES_ENUM.WARNING, 'icon-warning', true, false, false, [{ status: 'True' }], 0, 1],
[STATES_ENUM.HEALTHY, 'icon-checkmark', true, false, false, [{ status: 'True' }], 1, 0],
]],
['downstream RKE2', 'fleet', false, ['fleetStatefulSet'], [
['downstream RKE2', 'fleet', false, ['fleetAgentResource'], [
[STATES_ENUM.IN_PROGRESS, 'icon-spinner', false, false, false, '', 0, 0],
[STATES_ENUM.UNHEALTHY, 'icon-warning', true, false, false, [{ status: 'False' }], 0, 0],
[STATES_ENUM.UNHEALTHY, 'icon-warning', true, false, true, [{ status: 'True' }], 0, 0],
@ -89,7 +89,7 @@ describe('page: cluster dashboard', () => {
[STATES_ENUM.WARNING, 'icon-warning', true, false, false, [{ status: 'True' }], 0, 1],
[STATES_ENUM.HEALTHY, 'icon-checkmark', true, false, false, [{ status: 'True' }], 1, 0],
]],
['downstream RKE2', 'cattle', false, ['cattleDeployment'], [
['downstream RKE2', 'cattle', false, ['cattleAgentResource'], [
[STATES_ENUM.IN_PROGRESS, 'icon-spinner', false, false, false, '', 0, 0],
[STATES_ENUM.UNHEALTHY, 'icon-warning', true, false, false, [{ status: 'False' }], 0, 0],
[STATES_ENUM.UNHEALTHY, 'icon-warning', true, true, false, [{ status: 'True' }], 0, 0],
@ -137,7 +137,7 @@ describe('page: cluster dashboard', () => {
});
describe.each([
['local', 'fleet', true, ['fleetDeployment', 'fleetStatefulSet'], [
['local', 'fleet', true, ['fleetControllerResource', 'fleetAgentResource'], [
[STATES_ENUM.IN_PROGRESS, 'icon-spinner', false, false, false, false, '', 0, 0],
[STATES_ENUM.UNHEALTHY, 'icon-warning', true, true, false, false, [{ status: 'False' }], 0, 0],
[STATES_ENUM.UNHEALTHY, 'icon-warning', true, true, false, true, [{ status: 'True' }], 0, 0],
@ -146,7 +146,7 @@ describe('page: cluster dashboard', () => {
[STATES_ENUM.WARNING, 'icon-warning', true, true, false, false, [{ status: 'True' }], 0, 1],
[STATES_ENUM.HEALTHY, 'icon-checkmark', false, true, false, false, [{ status: 'True' }], 1, 0],
]],
['downstream RKE2', 'fleet', false, ['fleetStatefulSet'], [
['downstream RKE2', 'fleet', false, ['fleetAgentResource'], [
[STATES_ENUM.IN_PROGRESS, 'icon-spinner', false, false, false, false, '', 0, 0],
[STATES_ENUM.UNHEALTHY, 'icon-warning', true, true, false, false, [{ status: 'False' }], 0, 0],
[STATES_ENUM.UNHEALTHY, 'icon-warning', true, true, false, true, [{ status: 'True' }], 0, 0],
@ -155,7 +155,7 @@ describe('page: cluster dashboard', () => {
[STATES_ENUM.WARNING, 'icon-warning', true, true, false, false, [{ status: 'True' }], 0, 1],
[STATES_ENUM.HEALTHY, 'icon-checkmark', false, true, false, false, [{ status: 'True' }], 1, 0],
]],
['downstream RKE2', 'cattle', false, ['cattleDeployment'], [
['downstream RKE2', 'cattle', false, ['cattleAgentResource'], [
[STATES_ENUM.IN_PROGRESS, 'icon-spinner', false, false, false, false, '', 0, 0],
[STATES_ENUM.UNHEALTHY, 'icon-warning', true, true, false, false, [{ status: 'False' }], 0, 0],
[STATES_ENUM.UNHEALTHY, 'icon-warning', true, true, true, false, [{ status: 'True' }], 0, 0],
@ -228,9 +228,9 @@ describe('page: cluster dashboard', () => {
const wrapper = shallowMount(Dashboard, {
...options,
data: () => ({
cattleDeployment: 'loading',
disconnected: false,
canViewAgents: true
cattleAgentResource: 'loading',
disconnected: false,
canViewAgents: true
})
});

View File

@ -134,17 +134,17 @@ export default {
return {
nodeHeaders,
constraints: [],
cattleDeployment: 'loading',
fleetDeployment: 'loading',
fleetStatefulSet: 'loading',
disconnected: false,
events: [],
nodeMetrics: [],
showClusterMetrics: false,
showK8sMetrics: false,
showEtcdMetrics: false,
canViewMetrics: false,
constraints: [],
cattleAgentResource: 'loading',
fleetControllerResource: 'loading',
fleetAgentResource: 'loading',
disconnected: false,
events: [],
nodeMetrics: [],
showClusterMetrics: false,
showK8sMetrics: false,
showEtcdMetrics: false,
canViewMetrics: false,
CLUSTER_METRICS_DETAIL_URL,
CLUSTER_METRICS_SUMMARY_URL,
K8S_METRICS_DETAIL_URL,
@ -153,9 +153,9 @@ export default {
ETCD_METRICS_SUMMARY_URL,
STATES_ENUM,
clusterCounts,
selectedTab: 'cluster-events',
extensionCards: getApplicableExtensionEnhancements(this, ExtensionPoint.CARD, CardLocation.CLUSTER_DASHBOARD_CARD, this.$route),
canViewEvents: !!this.$store.getters['cluster/schemaFor'](EVENT),
selectedTab: 'cluster-events',
extensionCards: getApplicableExtensionEnhancements(this, ExtensionPoint.CARD, CardLocation.CLUSTER_DASHBOARD_CARD, this.$route),
canViewEvents: !!this.$store.getters['cluster/schemaFor'](EVENT),
clusterServiceIcons,
};
},
@ -327,7 +327,7 @@ export default {
},
cattleAgent() {
const resources = [this.cattleDeployment];
const resources = [this.cattleAgentResource];
return this.getAgentStatus(resources, { checkDisconnected: true });
},
@ -335,12 +335,12 @@ export default {
fleetAgent() {
const resources = this.currentCluster.isLocal ? [
/**
* 'fleetStatefulSet' could take a while to be created by rancher.
* During that startup period, only 'fleetDeployment' will be used to calculate the fleet agent status.
* 'fleetAgentResource' could take a while to be created by rancher.
* During that startup period, only 'fleetControllerResource' will be used to calculate the fleet agent status.
*/
...(this.fleetStatefulSet ? [this.fleetStatefulSet, this.fleetDeployment] : [this.fleetDeployment]),
...(this.fleetAgentResource ? [this.fleetAgentResource, this.fleetControllerResource] : [this.fleetControllerResource]),
] : [
this.fleetStatefulSet
this.fleetAgentResource
];
return this.getAgentStatus(resources);
@ -488,14 +488,14 @@ export default {
loadAgents() {
if (this.fleetAgentNamespace) {
if (this.currentCluster.isLocal) {
this.setAgentResource('fleetDeployment', 'cattle-fleet-system/fleet-controller');
this.setAgentResource('fleetStatefulSet', 'cattle-fleet-local-system/fleet-agent');
this.setAgentResource('fleetControllerResource', 'cattle-fleet-system/fleet-controller');
this.setAgentResource('fleetAgentResource', 'cattle-fleet-local-system/fleet-agent');
} else {
this.setAgentResource('fleetStatefulSet', 'cattle-fleet-system/fleet-agent');
this.setAgentResource('fleetAgentResource', 'cattle-fleet-system/fleet-agent');
}
}
if (this.cattleAgentNamespace) {
this.setAgentResource('cattleDeployment', 'cattle-system/cattle-cluster-agent');
this.setAgentResource('cattleAgentResource', 'cattle-system/cattle-cluster-agent');
this.interval = setInterval(() => {
this.disconnected = !!this.$store.getters['cluster/inError']({ type: NODE });
}, 1000);