redhat-developer / intellij-kubernetes

IntelliJ Kubernetes plugin
https://plugins.jetbrains.com/plugin/15921-kubernetes-by-red-hat
Eclipse Public License 2.0
20 stars 20 forks source link

feat: allow to disable editor notifications (#763) #790

Closed adietish closed 1 month ago

adietish commented 2 months ago

fixes #763

adietish commented 1 month ago

@sbouchet:

How to test this: https://github.com/redhat-developer/intellij-kubernetes/issues/763#issuecomment-2391607391 is describing what's provided in this enhancement/feature.

My first question is: is the label for the checkbox explaining what happens if you check/uncheck it?

The most basic is test could look like this:

Steps:

  1. ASSERT: make sure that editor sync is enabled in the settings
  2. EXEC: create a new yaml file and copy & paste the following into it:
    apiVersion: v1
    kind: ConfigMap
    metadata:
    name: base64encoded
    data:
    foo: text value that noone ca
    binaryData:
    bar: jmjKxUGNs/WqDQ==
  3. ASSERT: editor displays a notification telling you that you can push the editor to the cluster
  4. EXEC: go to settings and uncheck "Sync editor with cluster", then Apply/OK
  5. ASSERT: notification disappears
  6. EXEC: hit the push icon in the toolbar

Result: The config map in the editor was created on the cluster. You are told by a notification. In the resource tree you now have a new config map named "base64encoded"

Further tests could be done with a multi-resource file and minikube. Multi-resource editors are not notified of the success of the push.

---
apiVersion: apps/v1
kind: Deployment
metadata:
  annotations:
    app.quarkus.io/commit-id: 874731470682e3f213506357d2f9887bab63be83
    app.quarkus.io/build-timestamp: 2023-04-25 - 09:17:12 +0000
  labels:
    app.kubernetes.io/name: code-with-quarkus
    app.kubernetes.io/version: 1.0.0-SNAPSHOT
  name: code-with-quarkus
spec:
  replicas: 1
  selector:
    matchLabels:
      app.kubernetes.io/name: code-with-quarkus
      app.kubernetes.io/version: 1.0.0-SNAPSHOT
  template:
    metadata:
      annotations:
        app.quarkus.io/commit-id: 874731470682e3f213506357d2f9887bab63be83
        app.quarkus.io/build-timestamp: 2023-04-25 - 09:17:12 +0000
      labels:
        app.kubernetes.io/name: code-with-quarkus
        app.kubernetes.io/version: 1.0.0-SNAPSHOT
    spec:
      containers:
        - env:
            - name: KUBERNETES_NAMESPACE
              valueFrom:
                fieldRef:
                  fieldPath: metadata.namespace
          image: minikube/andredietisheim/code-with-quarkus:1.0.0-SNAPSHOT
          imagePullPolicy: IfNotPresent
          name: code-with-quarkus
          ports:
            - containerPort: 8080
              name: http
              protocol: TCP
---
apiVersion: v1
kind: Service
metadata:
  annotations:
    app.quarkus.io/commit-id: 874731470682e3f213506357d2f9887bab63be83
    app.quarkus.io/build-timestamp: 2023-04-25 - 09:17:12 +0000
  labels:
    app.kubernetes.io/name: code-with-quarkus
    app.kubernetes.io/version: 1.0.0-SNAPSHOT
  name: code-with-quarkus
spec:
  ports:
    - name: http
      nodePort: 31995
      port: 80
      protocol: TCP
      targetPort: 8080
  selector:
    app.kubernetes.io/name: code-with-quarkus
    app.kubernetes.io/version: 1.0.0-SNAPSHOT
  type: NodePort
sonarcloud[bot] commented 1 month ago

Quality Gate Passed Quality Gate passed

Issues
1 New issue
0 Accepted issues

Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud