-
Notifications
You must be signed in to change notification settings - Fork 229
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
Witout TTY docker on CI #36
Comments
Hi @albertoig could you post an example of the command you're running? I'll try and recreate. |
Hi! I am using Gitlab CI with some pipelines to deploy a project. I think is interesting to validate my YML kubernetes files with Kubeval. I execute on a pipeline this thing like this: yaml-validator: If a execute on terminal it work because the docker commmand use TTY, but gitlab CI does not. Why the kubeval have to be TTY? |
@albertoig I solved this issue by running |
@albertoig @johscheuer You can also redirect stdin from |
FTR the same thing happens when using kubeval in the context of an ansible template validation - name: setup-k8s | template image pull secret
template:
src: k8s/image-pull-secret.yml.j2
dest: "{{ deploy_dir }}/010-image-pull-secret.yml"
validate: '/usr/bin/kubeval %s'
tags: k8s-tasks TASK [setup-k8s | template image pull secret] ****************************************************************************************************************
Tuesday 06 March 2018 03:13:00 +0000 (0:00:01.031) 0:00:10.130 *********
fatal: [localhost]: FAILED! => {"changed": false, "checksum": "28a4d034ca2f8202789bb7e0ac11439c06fa0ff1", "exit_status": 1, "msg": "failed to validate", "stderr": "", "stderr_lines": [], "stdout": "***PRINTED BY CALLBACK***", "stdout_lines": "***PRINTED BY CALLBACK***"}
stdout: The document stdin appears to be empty the |
Having the same trouble here.... :/ can't find a way around so far... I am using kubeval like this:
then:
|
@garethr : Hi, we greatly appreciate your work on this. It helps us a lot when debugging helm on local with no access to a kubernetes cluster. We'd like to use it in our CI as well (gitlab-ci) (see the above post). Do you have any news on this bug ? |
Hi, I am having the same issue here, we are using TeamCity CI to spin up a linux box and I pass a list of paths to None of the workarounds above works for my case unfortunately. Might come useful to specify that I copy the app from source and I install the binary while on #40 seems to imply that it might work when building from docker? |
This is an issue with how kubeval decides to use STDIN vs reading files from arguments. You can very easily reproduce with the docker image provided
I don't know why kubeval checks stdin's mode to decide to use stdin. Every other tool I know of just uses stdin if no args are provided or have https://github.com/garethr/kubeval/blob/master/cmd/root.go#L42-L43 |
I am triying to use kubeval on docker without TTY to validate YML on CI but give me this error "The document stdin appears to be empty". How i can use it without TTY?
The text was updated successfully, but these errors were encountered: