Skip to content

Instantly share code, notes, and snippets.

@AshishThakur
Last active February 17, 2021 13:32
Show Gist options
  • Save AshishThakur/6785a8fcc24c47f5393eeffd48934287 to your computer and use it in GitHub Desktop.
Save AshishThakur/6785a8fcc24c47f5393eeffd48934287 to your computer and use it in GitHub Desktop.
kpack
const k8s = require('@kubernetes/client-node');
const request = require('request');
const kc = new k8s.KubeConfig();
kc.loadFromDefault();
const opts = {};
kc.applyToRequest(opts);
request.get(`${kc.getCurrentCluster().server}/apis/kpack.io/v1alpha1/images`, opts,
(error, response, body) => {
if (error) {
console.log(`error: ${error}`);
}
if (response) {
console.log(`statusCode: ${response.statusCode}`);
}
console.log(`body: ${body}`);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment