intellij-kubernetes icon indicating copy to clipboard operation
intellij-kubernetes copied to clipboard

Editor should keep error when it gets re-selected

Open adietish opened this issue 3 years ago • 0 comments

Steps:

  1. ASSERT: have minikube with tekton
  2. ASSERT: make sure that you dont have the following 2 tasks:
  • add-task-2
  • task-print-date
  1. EXEC: open the following in an editor:
apiVersion: tekton.dev/v1beta1
kind: Task
metadata:
  name: add-task-2
spec:
  params:
    - name: first
      description: the first operand
    - name: second
      description: the second operand
  results:
    - name: sum
      description: the sum of the first and second operand
  steps:
    - name: add
    - name: sub
    - image: ok
    - image: no
  1. EXEC: Push it to the cluster
  2. ASSERT: pushing errors with the following error grafik
Failure executing: POST at: https://192.168.64.10:8443/apis/tekton.dev/v1beta1/namespaces/default/tasks. Message: admission webhook "webhook.pipeline.tekton.dev" denied the request: mutation failed: cannot decode incoming new object: json: cannot unmarshal bool into Go struct field Step.spec.steps.image of type string. Received status: Status(apiVersion=v1, code=400, details=null, kind=Status, message=admission webhook "webhook.pipeline.tekton.dev" denied the request: mutation failed: cannot decode incoming new object: json: cannot unmarshal bool into Go struct field Step.spec.steps.image of type string, metadata=ListMeta(_continue=null, remainingItemCount=null, resourceVersion=null, selfLink=null, additionalProperties={}), reason=BadRequest, status=Failure, additionalProperties={}).
  1. EXEC: open the following in an editor:
apiVersion: tekton.dev/v1beta1
kind: Task
metadata:
  name: print-date
  annotations:
    description: |
      A simple task that prints the date
spec:
  results:
    - name: current-date-unix-timestamp
      description: The current date in unix timestamp format
    - name: current-date-human-readable
      description: The current date in human readable format
  steps:
    - name: print-date-unix-timestamp
      image: bash:latest
      script: |
        #!/usr/bin/env bash
        date +%s | tee $(results.current-date-unix-timestamp.path)
    - name: print-date-human-readable
      image: bash:latest
      script: |
        #!/usr/bin/env bash
        date | tee $(results.current-date-human-readable.path)
  1. EXEC: Push it to the cluster (and create a new task)
  2. EXEC: Switch back to the editor for add-task-2 Result: Editor is not erroring any more. It prompts to push grafik

adietish avatar Jul 01 '22 21:07 adietish