diff --git a/cyclops-ctrl/pkg/cluster/k8sclient/resources.go b/cyclops-ctrl/pkg/cluster/k8sclient/resources.go index 8f22c1f2..6a5b65cf 100644 --- a/cyclops-ctrl/pkg/cluster/k8sclient/resources.go +++ b/cyclops-ctrl/pkg/cluster/k8sclient/resources.go @@ -235,6 +235,8 @@ func (k *KubernetesClient) createDynamicNamespaced( } obj.SetResourceVersion(current.GetResourceVersion()) + obj.SetAnnotations(mergeAnnotations(current.GetAnnotations(), obj.GetAnnotations())) + obj.SetFinalizers(current.GetFinalizers()) _, err = k.Dynamic.Resource(gvr).Namespace(namespace).Update( context.Background(), @@ -264,6 +266,8 @@ func (k *KubernetesClient) createDynamicNonNamespaced( } obj.SetResourceVersion(current.GetResourceVersion()) + obj.SetAnnotations(mergeAnnotations(current.GetAnnotations(), obj.GetAnnotations())) + obj.SetFinalizers(current.GetFinalizers()) _, err = k.Dynamic.Resource(gvr).Update( context.Background(), @@ -333,6 +337,20 @@ func mergePVCWithCurrent(current, obj *unstructured.Unstructured) error { return unstructured.SetNestedMap(current.Object, requests, "spec", "resources", "requests") } +func mergeAnnotations(existing, new map[string]string) map[string]string { + out := make(map[string]string) + + for k, v := range existing { + out[k] = v + } + + for k, v := range new { + out[k] = v + } + + return out +} + func (k *KubernetesClient) ListNodes() ([]apiv1.Node, error) { nodeList, err := k.clientset.CoreV1().Nodes().List(context.TODO(), metav1.ListOptions{}) return nodeList.Items, err diff --git a/cyclops-ui/src/components/k8s-resources/common/PodTable/PodLogs.tsx b/cyclops-ui/src/components/k8s-resources/common/PodTable/PodLogs.tsx index 5b0ad739..556cf241 100644 --- a/cyclops-ui/src/components/k8s-resources/common/PodTable/PodLogs.tsx +++ b/cyclops-ui/src/components/k8s-resources/common/PodTable/PodLogs.tsx @@ -261,7 +261,7 @@ const PodLogs = ({ pod }: PodLogsProps) => { onCancel={handleCancelLogs} cancelButtonProps={{ style: { display: "none" } }} style={{ zIndex: 100 }} - width={"80%"} + width={"90%"} > {error.message.length !== 0 && ( { const getStatusColor = (module: any) => { if (module.status === "unknown") { - return "gray"; + return "#d3d3d3"; } if (module.status === "healthy") {