Skip to content

Commit

Permalink
chore(pods.log): remove the deprarecated pods.log function. (#196)
Browse files Browse the repository at this point in the history
BREAKING CHANGE: `pods.log` doesn't follow the kubernetes-client API
conventions. Replace uses of `pods.log('foo')` with `pods('foo').log.get()`.
  • Loading branch information
silasbw committed Feb 13, 2018
1 parent 6a21bd7 commit 29a7935
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 34 deletions.
20 changes: 0 additions & 20 deletions lib/pods.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
'use strict';

const util = require('util');

const BaseObject = require('./base');
const ContainerBaseObject = require('./container-base-object');

Expand Down Expand Up @@ -39,24 +37,6 @@ class Pods extends BaseObject {
}),
name: options.name || 'pods'
}));

this.log = util.deprecate(
this.log.bind(this),
'pods.log is deprecated and will be removed in 4.0.0. ' +
'Use pods(name).log.get instead.');
}

/**
* @deprecated Will be removed in 4.0.0. Use pods(name).log.get instead.
* @param {RequestOptions|string} options - GET options, or resource name
* @param {callback} cb - The callback that handles the response
* @returns {Stream} If cb is falsy, return a Stream
*/
log(options, cb) {
if (typeof options === 'string') options = { name: options };
return this.get(
Object.assign({}, options, { name: `${ options.name }/log` }),
cb);
}
}

Expand Down
14 changes: 0 additions & 14 deletions test/pods.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -173,13 +173,6 @@ describe('lib.pods', () => {
done();
});
});
only('unit', 'returns the Pod via the legacy method', done => {
common.api.ns(common.currentName).pods.get('test-pod', (err, pod) => {
assume(err).is.falsy();
assume(pod.kind).is.equal('Pod');
done();
});
});
});

describe('.delete', () => {
Expand Down Expand Up @@ -216,13 +209,6 @@ describe('lib.pods', () => {
done();
});
});
only('unit', 'returns log contents via legacy method', done => {
common.api.ns(common.currentName).pods.log('test-pod', (err, contents) => {
assume(err).is.falsy();
assume(contents).is.equal('some log contents');
done();
});
});
});

common.afterTesting('int', common.cleanupName);
Expand Down

0 comments on commit 29a7935

Please sign in to comment.