-
Notifications
You must be signed in to change notification settings - Fork 185
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: initial odo catalog list enhancements
Fixes #4485
- Loading branch information
Showing
9 changed files
with
163 additions
and
2 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
{ | ||
"name": "@kui-shell/plugin-openshift", | ||
"version": "1.0.1", | ||
"description": "Kui OpenShift support", | ||
"license": "Apache-2.0", | ||
"keywords": [ | ||
"kubernetes", | ||
"kubectl", | ||
"openshift", | ||
"redhat", | ||
"cli", | ||
"ui", | ||
"kui", | ||
"plugin" | ||
], | ||
"author": "@starpit", | ||
"contributors": [ | ||
"Mengting Yan" | ||
], | ||
"homepage": "https://github.com/IBM/kui#readme", | ||
"bugs": { | ||
"url": "https://github.com/IBM/kui/issues/new" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/IBM/kui.git" | ||
}, | ||
"main": "dist/index.js", | ||
"module": "mdist/index.js", | ||
"types": "mdist/index.d.ts", | ||
"dependencies": { | ||
"@kui-shell/plugin-kubectl": "*" | ||
}, | ||
"krew": { | ||
"commandPrefix": "kubeui" | ||
}, | ||
"publishConfig": { | ||
"access": "public" | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
plugins/plugin-kubectl/odo/src/controller/odo/catalog/list/components.ts
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/* | ||
* Copyright 2020 IBM Corporation | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
import { Arguments } from '@kui-shell/core' | ||
|
||
import { doExecWithTable, KubeOptions } from '@kui-shell/plugin-kubectl' | ||
|
||
export default function doList(args: Arguments<KubeOptions>) { | ||
return doExecWithTable(args, undefined, 'odo', { verb: 'catalog', entityType: 'components' }) | ||
} |
23 changes: 23 additions & 0 deletions
23
plugins/plugin-kubectl/odo/src/controller/odo/catalog/list/services.ts
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/* | ||
* Copyright 2020 IBM Corporation | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
import { Arguments } from '@kui-shell/core' | ||
|
||
import { doExecWithTable, KubeOptions } from '@kui-shell/plugin-kubectl' | ||
|
||
export default function doList(args: Arguments<KubeOptions>) { | ||
return doExecWithTable(args, undefined, 'odo', { verb: 'catalog', entityType: 'services' }) | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/* | ||
* Copyright 2020 IBM Corporation | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
import { Registrar } from '@kui-shell/core' | ||
import { doNativeExec, defaultFlags, commandPrefix } from '@kui-shell/plugin-kubectl' | ||
|
||
export default async (registrar: Registrar) => { | ||
registrar.listen(`/${commandPrefix}/_odo`, doNativeExec, Object.assign({}, defaultFlags, { requiresLocal: true })) | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/* | ||
* Copyright 2019 IBM Corporation | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
import { Arguments, KResponse, Registrar } from '@kui-shell/core' | ||
|
||
import { isUsage, doHelp, commandPrefix, defaultFlags, KubeOptions } from '@kui-shell/plugin-kubectl' | ||
|
||
import raw from './controller/raw' | ||
|
||
import catalogListComponents from './controller/odo/catalog/list/components' | ||
import catalogListServices from './controller/odo/catalog/list/services' | ||
|
||
function withHelp(handler: (args: Arguments<KubeOptions>) => Promise<KResponse>) { | ||
return (args: Arguments<KubeOptions>) => { | ||
if (isUsage(args)) { | ||
// special case: get --help/-h | ||
return doHelp('odo', args) | ||
} | ||
|
||
return handler(args) | ||
} | ||
} | ||
|
||
export default (registrar: Registrar) => { | ||
raw(registrar) | ||
|
||
registrar.listen(`/${commandPrefix}/odo/catalog/list/components`, withHelp(catalogListComponents), defaultFlags) | ||
registrar.listen(`/${commandPrefix}/odo/catalog/list/services`, withHelp(catalogListServices), defaultFlags) | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"extends": "../../../node_modules/@kui-shell/builder/tsconfig-base.json", | ||
"include": ["src/**/*"], | ||
"compilerOptions": { | ||
"composite": true, | ||
"outDir": "mdist", | ||
"rootDir": "src" | ||
} | ||
} |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,6 +30,9 @@ | |
{ | ||
"path": "oc" | ||
}, | ||
{ | ||
"path": "odo" | ||
}, | ||
{ | ||
"path": "tekton" | ||
}, | ||
|