-
Notifications
You must be signed in to change notification settings - Fork 192
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support more types #57
Changes from all commits
bd62daa
2b6bee7
6aa9a95
4ae7bd4
9037f01
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
'use strict'; | ||
|
||
const ApiGroup = require('./api-group'); | ||
|
||
class Apps extends ApiGroup { | ||
constructor(options) { | ||
const genericTypes = [ | ||
// Deprecated name of statefulsets in kubernetes 1.4 | ||
'petsets', | ||
'statefulsets' | ||
]; | ||
options = Object.assign({}, options, { | ||
path: 'apis/apps', | ||
version: options.version || 'v1beta1', | ||
genericTypes: genericTypes | ||
}); | ||
super(options); | ||
} | ||
} | ||
|
||
module.exports = Apps; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
'use strict'; | ||
|
||
const ApiGroup = require('./api-group'); | ||
|
||
class Batch extends ApiGroup { | ||
constructor(options) { | ||
const genericTypes = [ | ||
'cronjobs', | ||
// Deprecated name for cronjobs in kubernetes 1.4 | ||
'scheduledjobs' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Similar rename issue as above -- scheduledjobs -> cronjobs 1 |
||
]; | ||
options = Object.assign({}, options, { | ||
path: 'apis/batch', | ||
version: options.version || 'v1', | ||
genericTypes: genericTypes | ||
}); | ||
super(options); | ||
} | ||
} | ||
|
||
module.exports = Batch; |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,8 +5,11 @@ module.exports.aliasResources = function (resourceObject) { | |
// http://kubernetes.io/docs/user-guide/kubectl-overview/ | ||
// and anything else we think is useful. | ||
const resourceAliases = { | ||
clusterroles: [], | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should we include petsets and scheduledjobs? |
||
clusterrolebindings: [], | ||
componentstatuses: ['cs'], | ||
configmaps: ['cm'], | ||
cronjobs: [], | ||
daemonsets: ['ds'], | ||
deployments: ['deploy'], | ||
events: ['ev'], | ||
|
@@ -19,13 +22,20 @@ module.exports.aliasResources = function (resourceObject) { | |
nodes: ['no'], | ||
persistentvolumes: ['pv'], | ||
persistentvolumeclaims: ['pvc'], | ||
// Deprecated name of statefulsets in kubernetes 1.4 | ||
petsets: [], | ||
pods: ['po'], | ||
replicationcontrollers: ['rc'], | ||
replicasets: ['rs'], | ||
resourcequotas: ['quota'], | ||
roles: [], | ||
rolebindings: [], | ||
// Deprecated name of cronjobs in kubernetes 1.4 | ||
scheduledjobs: [], | ||
secrets: [], | ||
serviceaccounts: [], | ||
services: ['svc'] | ||
services: ['svc'], | ||
statefulsets: [] | ||
}; | ||
|
||
const esPlurals = { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,7 +37,10 @@ class Namespaces extends BaseObject { | |
// Generic objects we don't implement special functionality for. | ||
// | ||
const genericTypes = [ | ||
'clusterroles', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should we include petsets and scheduledjobs? |
||
'clusterrolebindings', | ||
'configmaps', | ||
'cronjobs', | ||
'daemonsets', | ||
'deployments', | ||
'endpoints', | ||
|
@@ -47,11 +50,18 @@ class Namespaces extends BaseObject { | |
'jobs', | ||
'limitranges', | ||
'persistentvolumeclaims', | ||
// Deprecated name of statefulsets in kubernetes 1.4, | ||
'petsets', | ||
'replicasets', | ||
'resourcequotas', | ||
'roles', | ||
'rolebindings', | ||
// Deprecated name of cronjobs in kubernetes 1.4 | ||
'scheduledjobs', | ||
'secrets', | ||
'serviceaccounts', | ||
'services' | ||
'services', | ||
'statefulsets' | ||
]; | ||
for (const type of genericTypes) { | ||
this[type] = new BaseObject( | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
'use strict'; | ||
|
||
const ApiGroup = require('./api-group'); | ||
|
||
class Rbac extends ApiGroup { | ||
constructor(options) { | ||
const genericTypes = [ | ||
'clusterroles', | ||
'clusterrolebindings', | ||
'roles', | ||
'rolebindings' | ||
]; | ||
options = Object.assign({}, options, { | ||
path: 'apis/rbac.authorization.k8s.io', | ||
version: options.version || 'v1alpha1', | ||
genericTypes: genericTypes | ||
}); | ||
super(options); | ||
} | ||
} | ||
|
||
module.exports = Rbac; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How should we handle the petset -> statefulset rename 1?
The simplest thing would be to add
statefulset
to thegenericTypes
array and add a comment about the rename. Any better ideas?