Skip to content

Instantly share code, notes, and snippets.

@timmyers
Last active April 5, 2019 22:42
Show Gist options
  • Save timmyers/374d10424de427ea9fd664ef97f4614d to your computer and use it in GitHub Desktop.
Save timmyers/374d10424de427ea9fd664ef97f4614d to your computer and use it in GitHub Desktop.
const entrypointString = fs.readFileSync(path.relative(process.cwd(), `${__dirname}/entrypoint.sh`)).toString();
const configMap = new k8s.core.v1.ConfigMap(name, {
metadata: {
name,
namespace,
},
data: {
'entrypoint.sh': entrypointString,
},
}, defaultOpts);
configMap.data.apply(data => {
// const entrypoint = data['entrypoint.sh']; // Does not compile, thinks it is Output<string>
const entrypoint = data['entrypoint.sh'] as unknown as string; // At runtime, it appears to just be a string
console.log(sha1hash(entrypoint));
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment