Comments (6)
Another example of the sort of thing you run into at deployment container run-time. The error is clear and straightforward, it's just easier to catch earlier in the cycle.
May 9, 2018, 10:27:55 AM | config_helper.InvalidSchema: Property authEnabled has a default value of invalid type
-- | --
deployer | May 9, 2018, 10:27:55 AM | format(name))
deployer | May 9, 2018, 10:27:55 AM | File "/bin/config_helper.py", line 116, in __init__
deployer | May 9, 2018, 10:27:55 AM | for k, v in dictionary.get('properties', {}).iteritems()
deployer | May 9, 2018, 10:27:55 AM | File "/bin/config_helper.py", line 79, in <dictcomp>
deployer | May 9, 2018, 10:27:55 AM | for k, v in dictionary.get('properties', {}).iteritems()
deployer | May 9, 2018, 10:27:55 AM | File "/bin/config_helper.py", line 79, in __init__
deployer | May 9, 2018, 10:27:55 AM | return Schema(d)
deployer | May 9, 2018, 10:27:55 AM | File "/bin/config_helper.py", line 69, in load_yaml_file
deployer | May 9, 2018, 10:27:55 AM | args.schema_file_encoding)
deployer | May 9, 2018, 10:27:55 AM | File "/bin/expand_config.py", line 60, in main
deployer | May 9, 2018, 10:27:55 AM | main()
deployer | May 9, 2018, 10:27:55 AM | File "/bin/expand_config.py", line 123, in <module>
deployer | May 9, 2018, 10:27:55 AM | Traceback (most recent call last):
deployer | May 9, 2018, 10:27:55 AM | + /bin/expand_config.py
from marketplace-k8s-app-tools.
We actually wanted to do this, and thought about using ONBUILD
. Unfortunately ONBUILD
commands run right at FROM
time.
Do you know of a way to have commands that run at the end of the inherited Dockerfile commands?
from marketplace-k8s-app-tools.
My thoughts were more basic. In the example, you have a Makefile
that is dependent on all of these resources and that builds the Docker image. Seems the validation step happens in the Makefile maybe, reusing existing scripts you'd provide in tools, and the docker image doesn't get built at all (and the build fails) if schema validation doesn't happen.
I happen to use the Makefile, but even if someone else chose a different build setup, at least they'd see a validation example of how it's done, which they could adapt to whatever setup.
from marketplace-k8s-app-tools.
If we don't have a way to do it directly in the Dockerfile, totally agree that your proposal is the next best option.
We will look into adding that to the make
targets. Thanks!
from marketplace-k8s-app-tools.
A way to do this in dockerfile would be possibly:
COPY schema.yaml /tmp
RUN validate.py schema.yaml > validated_schema.yaml
RUN cp validated_schema.yaml /data/schema.yaml
If validation fails, the copy fails, and I get a message saying I'm missing a validated schema. Then you just need the guarantee that "validate.py" behaves to parse and re-dump the same content on validity. Or something like that.
from marketplace-k8s-app-tools.
That makes sense too. The only caveat is that it the creator of the inheriting Dockerfile has to add these commands. The nice thing about something like ONBUILD is that they would automatically inherit this (except it doesn't work as we wanted ;) ).
I think we will add this to both Makefile and Dockerfile. Useful for the user to pick whatever suitable for them.
from marketplace-k8s-app-tools.
Related Issues (20)
- options for managing dependencies
- Support CRD and CR ordering HOT 1
- `mpdev doctor` says `kubectl` isn't installed HOT 1
- RBAC Role rules for namespaces outside of the app itself
- The test runner "bashTest" does not show stderr and stdout on failure HOT 1
- The update from v1beta1 to v1 broke our old deployer images
- Integrating cert-manager with Google PrivateCA
- Add support for Helm v3 test hook HOT 2
- The application uid should no be displayed in the Marketplace UI
- Creating KSA with annotation
- arm64 builds - gcr.io/cloud-marketplace-tools/k8s/dev & gcr.io/cloud-marketplace-tools/k8s/deployer_helm
- `mpdev doctor` command says `kubectl is not installed` when it is HOT 1
- exception: Set of resources includes multiple Applications even though there is only 1 application HOT 1
- KUBECONFIG should be used instead of KUBE_CONFIG
- Unknown field "spec.selector.matchLabels.app.kubernetes.io/name" on GKE 1.25 HOT 2
- Helm template Capabilities.ApiVersions.Has behavior different than helm install
- FB.com
- How to use RWX storage class in schema.yaml
- Support for multiple charts for helm deployer
- Fail at build time with chart directory not seen as a directory HOT 1
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 marketplace-k8s-app-tools.