#5357·spinnaker

Kubernetes Manifest Text lost after save if invalid yaml is given

Author: linjmeyerCreated Jan 27, 2020Updated Jun 4, 2024
Labelsbeginner friendlyprovider/kubernetes-v2sig/kubernetes

Issue Summary:

If invalid yaml is passed into the Manifest Source field of a Deploy Manifest stage the text is deleted after saving.

Cloud Provider(s):

Kubernetes

Environment:

This is a new GKE cluster with a fresh Spinnaker install using Spinnaker for GCP

Feature Area:

Pipelines

Description:

Invalid yaml seems to be deleted from the Manifest Source field. After saving you will get the usual "In Sync with server" message and you will still see the contents of the text field. However if you refresh the page or run a pipeline the field is empty.

Steps to Reproduce:

  1. Create a new application and pipeline with k8s provider
  2. Add Deploy Manifest Step
  3. Add invalid yaml into Manifest Source field
  4. Save the pipeline
  5. Refresh the page or start the pipeline manually

This works as expected:

yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app: nginx
  name: lin-test-new-cluster
  namespace: dogfood
spec:
  replicas: 3
  selector:
    matchLabels:
      app: nginx
  template:
    metadata:
      labels:
        app: nginx
    spec:
      containers:
        - image: 'nginx:1.7.9'
          name: nginx
          ports:
            - containerPort: 80

While this fails because it's invalid and the entire text is lost:

yaml
!!!

apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app: nginx
  name: lin-test-new-cluster
  namespace: dogfood
spec:
  replicas: 3
  selector:
    matchLabels:
      app: nginx
  template:
    metadata:
      labels:
        app: nginx
    spec:
      containers:
        - image: 'nginx:1.7.9'
          name: nginx
          ports:
            - containerPort: 80

Additional Details: