New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

kube-tools

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

kube-tools - npm Package Compare versions

Comparing version 0.0.4 to 0.1.0

5

lib/log.js

@@ -13,2 +13,3 @@ 'use strict';

const podname = opts.p || opts.pod;
const subname = opts.s || opts.sub || opts.subname || '';
const args = ['logs'].concat(opts.args);

@@ -18,4 +19,4 @@

_.forEach(list, item => {
console.log(`[${item.name}]`);
const logger = spawn('kubectl', args.concat(item.name))
console.log(`[${item.name}] ${subname ? subname : ''}`);
const logger = spawn('kubectl', args.concat(item.name, subname))
.on('error', err => console.error(err))

@@ -22,0 +23,0 @@ .on('close', err => console.log('close', err));

12

lib/pod.js
'use strict';
const _ = require('lodash');
const Aigle = require('aigle');
const inquirer = require('inquirer');
const Promise = require('bluebird');
const exec = Promise.promisify(require('child_process').exec);
const exec = Aigle.promisify(require('child_process').exec);
const prompt = inquirer.createPromptModule();

@@ -41,3 +41,3 @@

if (_.isEmpty(pods)) {
return Promise.reject(new Error('Pod not found'));
return Aigle.reject(new Error('Pod not found'));
}

@@ -54,3 +54,3 @@ console.log('pod list:');

if (!confirm) {
return Promise.reject(new Error('Confirmation failed'));
return Aigle.reject(new Error('Confirmation failed'));
}

@@ -68,7 +68,7 @@ if (podname) {

if (!confirm) {
return Promise.reject(new Error('Confirmation failed'));
return Aigle.reject(new Error('Confirmation failed'));
}
return Promise.map(pods, pod => exec(`kubectl delete pod ${pod.name}`));
return Aigle.map(pods, pod => exec(`kubectl delete pod ${pod.name}`));
})
.then(() => console.log('deleted'));
};
'use strict';
const Promise = require('bluebird');
const exec = Promise.promisify(require('child_process').exec);
const Aigle = require('aigle');
const exec = Aigle.promisify(require('child_process').exec);
exports.set = function({ project, zone, name }) {
if (!project) {
return Promise.reject(new Error('Project not found'));
}
if (!zone) {
return Promise.reject(new Error('Zone not found'));
}
if (!name) {
return Promise.reject(new Error('Name not found'));
}
console.info(`project: ${project}, name: ${name}, zone: ${zone}`);
return exec(`gcloud container clusters get-credentials ${name} --zone ${zone} --project ${project}`);
if (!project) {
return Aigle.reject(new Error('Project not found'));
}
if (!zone) {
return Aigle.reject(new Error('Zone not found'));
}
if (!name) {
return Aigle.reject(new Error('Name not found'));
}
console.info(`project: ${project}, name: ${name}, zone: ${zone}`);
return exec(`gcloud container clusters get-credentials ${name} --zone ${zone} --project ${project}`);
};
{
"name": "kube-tools",
"version": "0.0.4",
"version": "0.1.0",
"description": "",

@@ -15,3 +15,3 @@ "main": "index.js",

"dependencies": {
"bluebird": "^3.4.6",
"aigle": "^0.6.0",
"inquirer": "^1.2.1",

@@ -18,0 +18,0 @@ "lodash": "^4.16.2"

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc