mirror of
https://github.com/portainer/portainer.git
synced 2025-08-01 20:05:23 +02:00
feat(kubernetes/summary): summary of k8s actions upon deploying/updating resources EE-436 (#5137)
* feat EE-440/EE-436 kubernetes-resources-summary-panel * bugfix: returning created resources after update * fixed patch based bugs - displaying accurate updates for k8s resources Co-authored-by: Simon Meng <simon.meng@portainer.io>
This commit is contained in:
parent
267968e099
commit
eae2f5c9fc
16 changed files with 539 additions and 7 deletions
23
app/kubernetes/views/summary/resources/namespaceResources.js
Normal file
23
app/kubernetes/views/summary/resources/namespaceResources.js
Normal file
|
@ -0,0 +1,23 @@
|
|||
import KubernetesResourcePoolConverter from 'Kubernetes/converters/resourcePool';
|
||||
import { KubernetesResourcePoolFormValues } from 'Kubernetes/models/resource-pool/formValues';
|
||||
import { KubernetesResourceQuotaDefaults } from 'Kubernetes/models/resource-quota/models';
|
||||
import { KubernetesResourceTypes } from 'Kubernetes/models/resource-types/models';
|
||||
import { getResourcesSummary } from 'Kubernetes/views/summary/resources/helpers';
|
||||
|
||||
export default function (newFormValues, oldFormValues) {
|
||||
const [newNamespace, newQuota, newIngresses] = KubernetesResourcePoolConverter.formValuesToResourcePool(newFormValues);
|
||||
|
||||
if (!(oldFormValues instanceof KubernetesResourcePoolFormValues)) {
|
||||
oldFormValues = new KubernetesResourcePoolFormValues(KubernetesResourceQuotaDefaults);
|
||||
}
|
||||
|
||||
const [oldNamespace, oldQuota, oldIngresses] = KubernetesResourcePoolConverter.formValuesToResourcePool(oldFormValues);
|
||||
|
||||
const resources = [
|
||||
...getResourcesSummary(newNamespace, oldNamespace, KubernetesResourceTypes.NAMESPACE),
|
||||
...getResourcesSummary(newQuota, oldQuota, KubernetesResourceTypes.RESOURCEQUOTA),
|
||||
...getResourcesSummary(newIngresses, oldIngresses, KubernetesResourceTypes.INGRESS),
|
||||
];
|
||||
|
||||
return resources;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue