Comments (9)
@albertoig @johscheuer You can also redirect stdin from /dev/null
: kubeval *.yaml < /dev/null
from kubeval.
@albertoig I solved this issue by running kubeval
with script e.g.script -q -e -c "kubeval -v 1.8.1 ./deploy/*"
from kubeval.
Hi @albertoig could you post an example of the command you're running? I'll try and recreate.
from kubeval.
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:
stage: doctor
image: garethr/kubeval
tags:
- linux
- docker
script:
- kubeval -v 1.8.1 ./deploy/*
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?
from kubeval.
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 script -q -e -c
workaround seems to work only for some cases where the < /dev/null
doesn't work in any scenario
from kubeval.
Having the same trouble here.... :/ can't find a way around so far...
I am using kubeval like this:
unalias kubeval 2> /dev/null > /dev/null || true
kubeval() {
docker run \
--rm \
-v "${CURRENT_DIR}/.fixtures:/temp_kubeval/.fixtures" \
-w "/temp_kubeval" \
garethr/kubeval $*
}
export -f kubeval
then:
kubeval "./.fixtures/${PROJECT_NAME}/*" --strict
from kubeval.
@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 ?
from kubeval.
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 kubeval
:
kubeval -v $K8S_VERSION -f $FILES_LIST_DEV
it works locally on my machine but on the build agent I get:
The document 01_deploy.yml appears to be empty
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?
from kubeval.
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
docker run --rm=true --entrypoint=/bin/sh -v `pwd`/fixtures:/fixtures garethr/kubeval:0.7.1 -c 'find /fixtures | xargs /kubeval'
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 -
mean stdin.
https://github.com/garethr/kubeval/blob/master/cmd/root.go#L42-L43
from kubeval.
Related Issues (20)
- kubeval release download not in gzip format? HOT 1
- Calling bottle :unneeded is deprecated warning with brew HOT 2
- SARIF output management ?
- Failed initializing schema v1beta3
- Validation of Kustomization files HOT 1
- Validation error: Additional property seccompProfile is not allowed HOT 4
- error when attempting to lint poddisruption budget HOT 1
- Error 404 on schema json file when validate HOT 1
- Errors ignore output string type HOT 1
- ingressclass-networking-v1.json: Could not read schema from HTTP, response status is 404 Not Found HOT 7
- Valid resource failed validation with 404 schema not found
- Kubernetes OpenAPI v3 HOT 5
- kubeval of "helm create test-helm" fails HOT 1
- Latter half of domain is cut off resource group
- [BUG] ConfigMap Validation should be ERROR but is WARN HOT 3
- Connection reset by peer HOT 1
- Missing 'kind' key && getting Failed to decode YAML Errors HOT 1
- Maintenance information HOT 3
- Kubeval config file to reuse custom settings
- Add Support for .kubevalignore file HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kubeval.