Last active
February 17, 2021 13:32
-
-
Save AshishThakur/6785a8fcc24c47f5393eeffd48934287 to your computer and use it in GitHub Desktop.
kpack
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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