mirror of https://github.com/rancher/dashboard.git
Rename Fleet agent resources
Signed-off-by: Francesco Torchia <francesco.torchia@suse.com>
This commit is contained in:
parent
be6eada459
commit
a679cdf119
|
|
@ -71,7 +71,7 @@ describe('page: cluster dashboard', () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
describe.each([
|
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.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, false, [{ status: 'False' }], 0, 0],
|
||||||
[STATES_ENUM.UNHEALTHY, 'icon-warning', true, false, true, [{ status: 'True' }], 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.WARNING, 'icon-warning', true, false, false, [{ status: 'True' }], 0, 1],
|
||||||
[STATES_ENUM.HEALTHY, 'icon-checkmark', true, false, false, [{ status: 'True' }], 1, 0],
|
[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.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, false, [{ status: 'False' }], 0, 0],
|
||||||
[STATES_ENUM.UNHEALTHY, 'icon-warning', true, false, true, [{ status: 'True' }], 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.WARNING, 'icon-warning', true, false, false, [{ status: 'True' }], 0, 1],
|
||||||
[STATES_ENUM.HEALTHY, 'icon-checkmark', true, false, false, [{ status: 'True' }], 1, 0],
|
[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.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, false, [{ status: 'False' }], 0, 0],
|
||||||
[STATES_ENUM.UNHEALTHY, 'icon-warning', true, true, false, [{ status: 'True' }], 0, 0],
|
[STATES_ENUM.UNHEALTHY, 'icon-warning', true, true, false, [{ status: 'True' }], 0, 0],
|
||||||
|
|
@ -137,7 +137,7 @@ describe('page: cluster dashboard', () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
describe.each([
|
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.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, false, [{ status: 'False' }], 0, 0],
|
||||||
[STATES_ENUM.UNHEALTHY, 'icon-warning', true, true, false, true, [{ status: 'True' }], 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.WARNING, 'icon-warning', true, true, false, false, [{ status: 'True' }], 0, 1],
|
||||||
[STATES_ENUM.HEALTHY, 'icon-checkmark', false, true, false, false, [{ status: 'True' }], 1, 0],
|
[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.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, false, [{ status: 'False' }], 0, 0],
|
||||||
[STATES_ENUM.UNHEALTHY, 'icon-warning', true, true, false, true, [{ status: 'True' }], 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.WARNING, 'icon-warning', true, true, false, false, [{ status: 'True' }], 0, 1],
|
||||||
[STATES_ENUM.HEALTHY, 'icon-checkmark', false, true, false, false, [{ status: 'True' }], 1, 0],
|
[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.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, false, [{ status: 'False' }], 0, 0],
|
||||||
[STATES_ENUM.UNHEALTHY, 'icon-warning', true, true, true, false, [{ status: 'True' }], 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, {
|
const wrapper = shallowMount(Dashboard, {
|
||||||
...options,
|
...options,
|
||||||
data: () => ({
|
data: () => ({
|
||||||
cattleDeployment: 'loading',
|
cattleAgentResource: 'loading',
|
||||||
disconnected: false,
|
disconnected: false,
|
||||||
canViewAgents: true
|
canViewAgents: true
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -134,17 +134,17 @@ export default {
|
||||||
|
|
||||||
return {
|
return {
|
||||||
nodeHeaders,
|
nodeHeaders,
|
||||||
constraints: [],
|
constraints: [],
|
||||||
cattleDeployment: 'loading',
|
cattleAgentResource: 'loading',
|
||||||
fleetDeployment: 'loading',
|
fleetControllerResource: 'loading',
|
||||||
fleetStatefulSet: 'loading',
|
fleetAgentResource: 'loading',
|
||||||
disconnected: false,
|
disconnected: false,
|
||||||
events: [],
|
events: [],
|
||||||
nodeMetrics: [],
|
nodeMetrics: [],
|
||||||
showClusterMetrics: false,
|
showClusterMetrics: false,
|
||||||
showK8sMetrics: false,
|
showK8sMetrics: false,
|
||||||
showEtcdMetrics: false,
|
showEtcdMetrics: false,
|
||||||
canViewMetrics: false,
|
canViewMetrics: false,
|
||||||
CLUSTER_METRICS_DETAIL_URL,
|
CLUSTER_METRICS_DETAIL_URL,
|
||||||
CLUSTER_METRICS_SUMMARY_URL,
|
CLUSTER_METRICS_SUMMARY_URL,
|
||||||
K8S_METRICS_DETAIL_URL,
|
K8S_METRICS_DETAIL_URL,
|
||||||
|
|
@ -153,9 +153,9 @@ export default {
|
||||||
ETCD_METRICS_SUMMARY_URL,
|
ETCD_METRICS_SUMMARY_URL,
|
||||||
STATES_ENUM,
|
STATES_ENUM,
|
||||||
clusterCounts,
|
clusterCounts,
|
||||||
selectedTab: 'cluster-events',
|
selectedTab: 'cluster-events',
|
||||||
extensionCards: getApplicableExtensionEnhancements(this, ExtensionPoint.CARD, CardLocation.CLUSTER_DASHBOARD_CARD, this.$route),
|
extensionCards: getApplicableExtensionEnhancements(this, ExtensionPoint.CARD, CardLocation.CLUSTER_DASHBOARD_CARD, this.$route),
|
||||||
canViewEvents: !!this.$store.getters['cluster/schemaFor'](EVENT),
|
canViewEvents: !!this.$store.getters['cluster/schemaFor'](EVENT),
|
||||||
clusterServiceIcons,
|
clusterServiceIcons,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
@ -327,7 +327,7 @@ export default {
|
||||||
},
|
},
|
||||||
|
|
||||||
cattleAgent() {
|
cattleAgent() {
|
||||||
const resources = [this.cattleDeployment];
|
const resources = [this.cattleAgentResource];
|
||||||
|
|
||||||
return this.getAgentStatus(resources, { checkDisconnected: true });
|
return this.getAgentStatus(resources, { checkDisconnected: true });
|
||||||
},
|
},
|
||||||
|
|
@ -335,12 +335,12 @@ export default {
|
||||||
fleetAgent() {
|
fleetAgent() {
|
||||||
const resources = this.currentCluster.isLocal ? [
|
const resources = this.currentCluster.isLocal ? [
|
||||||
/**
|
/**
|
||||||
* 'fleetStatefulSet' could take a while to be created by rancher.
|
* 'fleetAgentResource' could take a while to be created by rancher.
|
||||||
* During that startup period, only 'fleetDeployment' will be used to calculate the fleet agent status.
|
* 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);
|
return this.getAgentStatus(resources);
|
||||||
|
|
@ -488,14 +488,14 @@ export default {
|
||||||
loadAgents() {
|
loadAgents() {
|
||||||
if (this.fleetAgentNamespace) {
|
if (this.fleetAgentNamespace) {
|
||||||
if (this.currentCluster.isLocal) {
|
if (this.currentCluster.isLocal) {
|
||||||
this.setAgentResource('fleetDeployment', 'cattle-fleet-system/fleet-controller');
|
this.setAgentResource('fleetControllerResource', 'cattle-fleet-system/fleet-controller');
|
||||||
this.setAgentResource('fleetStatefulSet', 'cattle-fleet-local-system/fleet-agent');
|
this.setAgentResource('fleetAgentResource', 'cattle-fleet-local-system/fleet-agent');
|
||||||
} else {
|
} else {
|
||||||
this.setAgentResource('fleetStatefulSet', 'cattle-fleet-system/fleet-agent');
|
this.setAgentResource('fleetAgentResource', 'cattle-fleet-system/fleet-agent');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (this.cattleAgentNamespace) {
|
if (this.cattleAgentNamespace) {
|
||||||
this.setAgentResource('cattleDeployment', 'cattle-system/cattle-cluster-agent');
|
this.setAgentResource('cattleAgentResource', 'cattle-system/cattle-cluster-agent');
|
||||||
this.interval = setInterval(() => {
|
this.interval = setInterval(() => {
|
||||||
this.disconnected = !!this.$store.getters['cluster/inError']({ type: NODE });
|
this.disconnected = !!this.$store.getters['cluster/inError']({ type: NODE });
|
||||||
}, 1000);
|
}, 1000);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue