Skip to content

Support for loading YAML files #129

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

Closed
weibeld opened this issue Oct 18, 2018 · 1 comment
Closed

Support for loading YAML files #129

weibeld opened this issue Oct 18, 2018 · 1 comment

Comments

@weibeld
Copy link

weibeld commented Oct 18, 2018

I couldn't find any facilities in this library to load Kubernetes API objects from YAML files, something like this for the Java client.

Currently, I have to do it like this with js-yaml and fs:

const yaml = require('js-yaml');
const fs = require('fs');

const deployment = yaml.safeLoad(fs.readFileSync('deployment.yml', 'utf8'));

// ...in order to use it for:
apiClient.createNamespacedDeployment('default', deployment, true);

Maybe it would be good to have a class for this, like in the Java client, or at least mention it in the README how it can be done with js-yaml.

@weibeld weibeld changed the title Load YAML files Support for loading YAML files Oct 18, 2018
@brendandburns
Copy link
Contributor

I'll add this support.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants