Skip to content

error converting YAML to JSON: yaml works on 4.7.0 but does not work in 4.8.0 #1034

@feguiguren

Description

@feguiguren

What happened?
Kubernetes manifests that works with 4.7.0. don't work with 4.8.0 anymore
Error
Applying manifests with kubectl Error deploying mysql: failed to unmarshal manifest: error converting YAML to JSON: yaml: line 2: mapping values are not allowed in this context Please make sure kubectl applydoes work locally with manifestmysql-service.yaml``

kubectl apply works with the given manifests without problems.
Using devspace 4.7.0 also works

What did you expect to happen instead?
Manifest should be applied

How can we reproduce the bug? (as minimally and precisely as possible)
devspace yaml

version: v1beta7
deployments:
  - name: mysql
    kubectl:
      manifests:
        -mysql-service.yaml
dev: {}

mysql-service.yaml

apiVersion: v1
kind: Service
metadata:
  name: mysql
spec:
  ports:
  - port: 3306
  selector:
    app: mysql
  clusterIP: None
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: mysql
spec:
  selector:
    matchLabels:
      app: mysql
  strategy:
    type: Recreate
  template:
    metadata:
      labels:
        app: mysql
    spec:
      containers:
      - image: mysql:5.7
        name: mysql
        readinessProbe:
          exec:
            command: ["mysql", "-h", "127.0.0.1", "-u","user","-ppassword", "-e", "SELECT 1"]
          initialDelaySeconds: 5
          periodSeconds: 2
          timeoutSeconds: 1
        env:
        - name: MYSQL_USER
          value: "user"
        - name: MYSQL_ROOT_PASSWORD
          value: "password"
        - name: MYSQL_ALLOW_EMPTY_PASSWORD
          value: "true"
        ports:
        - containerPort: 3306
          name: mysql
        volumeMounts:
        - name: mysql-storage
          mountPath: /var/lib/mysql
        - name: config-volume
          mountPath: /etc/mysql/conf.d
      volumes:
      - name: mysql-storage
        emptyDir: {}
       # hostPath:
       #   path: /var/lib/mysql
      - name: config-volume
        configMap:
          name: mysql

---
apiVersion: v1
kind: ConfigMap
metadata:
  name: mysql
  labels:
    app: mysql
data:
  config.cnf: |
    [mysqld]
    sql_mode = ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION

Local Environment:

  • DevSpace Version: 4.8.0
  • Operating System: mac
  • Deployment method: kubectl apply

Kubernetes Cluster:

  • Cloud Provider: aws
  • Kubernetes Version:
    Client Version: version.Info{Major:"1", Minor:"18", GitVersion:"v1.18.0", GitCommit:"9e991415386e4cf155a24b1da15becaa390438d8", GitTreeState:"clean", BuildDate:"2020-03-26T06:16:15Z", GoVersion:"go1.14", Compiler:"gc", Platform:"darwin/amd64"}
    Server Version: version.Info{Major:"1", Minor:"15+", GitVersion:"v1.15.10-eks-bac369", GitCommit:"bac3690554985327ae4d13e42169e8b1c2f37226", GitTreeState:"clean", BuildDate:"2020-02-26T01:12:54Z", GoVersion:"go1.12.12", Compiler:"gc", Platform:"linux/amd64"}

Anything else we need to know?

/kind bug

Metadata

Metadata

Assignees

Labels

kind/bugSomething isn't workingp/highHigh priority will be done as soon as possible

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions