1
0
Fork 0
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:
zees-dev 2021-06-10 10:38:23 +12:00 committed by GitHub
parent 267968e099
commit eae2f5c9fc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 539 additions and 7 deletions

View 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;
}