-
Notifications
You must be signed in to change notification settings - Fork 116
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
FR: Include openapi2jsonschema.py script in docker image #79
Comments
And I was thinking about moving the script from /scripts to /openapi2jsonschema yesterday and was wondering whether people were doing that ;) I can provide a Docker image, yes, does it matter if its a different one than for kubeconform? They both have quite different requirements. Note that if you converted the CRDs once and checked those into version control, that could speed up your CI a bit, but it depends on your requirements :) |
I'd be fine with a separate Docker image :-) As for the resulting schema files: I'd use the GitHub cache action to cache the conversion result rather than commit to the repo. |
it would be nice to have an official docker image. I am using this for now FROM python:3.9.7-alpine3.14
ENV FILENAME_FORMAT='{kind}-{group}-{version}'
WORKDIR /opt
RUN wget -O /tmp/openapi2jsonschema https://raw.githubusercontent.com/yannh/kubeconform/v0.4.12/scripts/openapi2jsonschema.py \
&& chmod +x /tmp/openapi2jsonschema \
&& python3 -m pip install pyyaml
ENTRYPOINT ["/tmp/openapi2jsonschema"] docker build -t openapi2jsonschema .
docker run -v "$(pwd)/generated:/opt" openapi2jsonschema "http://...." |
@yannh I'd still love to see this happen. |
@yannh ping? |
I'd love to use the docker image to validate helm charts in our projects, but we use a lot of CRDs. Some recent issues we had with our charts could have been caught much earlier if we had validated the charts against CRD schemas.
Those CRDs do have OpenAPI yaml definitions online, converting these (and caching the result) in a GH action for use with kubeconform would be ideal; your existing
openapi2jsonschema.py
script would allow us to do so all in one place if only it was included in the docker image.Would you be able to update your Dockerfile to include it? Either as
/openapi2jsonschema
or/scripts/openapi2jsonschema.py
, I don't much care. It would require that your alpine image includes Python 3 and pyyaml, of course.My alternative right now is to use
which is rather fragile as it either requires a version pin, or risks breaking if you ever moved the script or changed the requirements.
The text was updated successfully, but these errors were encountered: