forked from kubernetes-sigs/kui
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Expand kubectl direct watching to support heterogeneous use cases
This PR updates the duration over which red badges flash from 6 cycles down to 3. This PR also works around an issue in globby. sindresorhus/globby#166 Fixes kubernetes-sigs#6504
- Loading branch information
Showing
15 changed files
with
340 additions
and
131 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
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
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
40 changes: 40 additions & 0 deletions
40
plugins/plugin-kubectl/src/controller/client/direct/404.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,40 @@ | ||
/* | ||
* 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 { Row, Table } from '@kui-shell/core' | ||
|
||
import { rowWith, standardStatusHeader } from './unify' | ||
import TrafficLight from '../../../lib/model/traffic-light' | ||
|
||
/** | ||
* @return a Row for the given name in `names` with an Offline status. | ||
* | ||
*/ | ||
function fabricate404Row(name: string, kind: string): Row { | ||
return rowWith(name, kind, 'Offline', TrafficLight.Red) | ||
} | ||
|
||
/** | ||
* @return a Table with one row per given name in `names`, each row | ||
* with an Offline status. | ||
* | ||
*/ | ||
export default function fabricate404Table(names: string[], kind: string): Table { | ||
return { | ||
header: standardStatusHeader, | ||
body: names.map(name => fabricate404Row(name, kind)) | ||
} | ||
} |
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
Oops, something went wrong.