Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
feguiguren opened this issue Mar 27, 2020 · 2 comments
Assignees
Labels
kind/bug Something isn't working p/high High priority will be done as soon as possible

Comments

@feguiguren
Copy link

feguiguren commented Mar 27, 2020

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

@feguiguren feguiguren changed the title 4.8.0: error converting YAML to JSON: yaml but it works with 4.7.0 error converting YAML to JSON: yaml works on 4.7.0 but does not work in 4.8.0 Mar 27, 2020
@FabianKramm
Copy link
Collaborator

@feguiguren thanks for reporting! The issue is kubectl v1.18 that has deprecated the flag --dry-run we are using, and devspace tries to parse the error message that kubectl spits out which results in the above error. I'll fix this for the next version!

@FabianKramm FabianKramm self-assigned this Mar 27, 2020
@FabianKramm FabianKramm added kind/bug Something isn't working p/high High priority will be done as soon as possible labels Mar 27, 2020
FabianKramm added a commit to FabianKramm/devspace that referenced this issue Mar 27, 2020
FabianKramm added a commit to FabianKramm/devspace that referenced this issue Mar 27, 2020
@FabianKramm
Copy link
Collaborator

Fixed in 4.9.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working p/high High priority will be done as soon as possible
Projects
None yet
Development

No branches or pull requests

2 participants