intellij-kubernetes
intellij-kubernetes copied to clipboard
Editor should keep error when it gets re-selected
Steps:
- ASSERT: have minikube with tekton
- ASSERT: make sure that you dont have the following 2 tasks:
- add-task-2
- task-print-date
- 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
- EXEC: Push it to the cluster
- ASSERT: pushing errors with the following error

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={}).
- 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)
- EXEC: Push it to the cluster (and create a new task)
- EXEC: Switch back to the editor for add-task-2
Result:
Editor is not erroring any more. It prompts to push
