feat: watch mode, node/conditions/completion commands, perf optimizations#23
Open
PixiBixi wants to merge 9 commits into
Open
feat: watch mode, node/conditions/completion commands, perf optimizations#23PixiBixi wants to merge 9 commits into
PixiBixi wants to merge 9 commits into
Conversation
Add --watch/-w flag to all subcommands. Uses Bubble Tea for in-place terminal updates driven by Kubernetes pod watch events. Includes renderFn func() (string, error) pattern adopted by all command handlers.
…tion Shows CPU/memory requests, limits, and pod count per node as a percentage of allocatable capacity. Supports --usage (metrics-server), --compute-class, --overallocated, and --class flags.
Shows all pod conditions (PodScheduled, Initialized, ContainersReady, Ready) with status, reason, age, and message. Supports --watch and -m filtering (e.g. -m "STATUS!=True" for non-ready pods).
Generates completion scripts for zsh, bash, and fish. Supports --install to write directly to the standard system location. For kubectl plugin integration, symlink kubectl_complete-ice to kubectl-ice.
…atch flag Wire up all new subcommands (node, conditions, completion) and add the --watch/-w flag to processCommonFlags for all existing subcommands.
…ric commands - RowBuilder: add PreBuildFn and RefreshInterval for periodic rebuilds - Connector: add WatchPods, ClearPodCache, GetAllPodsAllNamespaces, GetMetricNodes - resources/restarts/status: adopt renderFn pattern with oddities support - resources: set RefreshInterval=25s and PreBuildFn to re-fetch metrics on watch
- utils: memoryGetUnitLst uses package-level map + O(1) lookup via init() - builder: matchFilter pre-parses valueInt/valueFloat once in setFilter - table: replace += string concat with strings.Builder; len([]rune) -> utf8.RuneCountInString - table: fix COLOUR_MIX to suppress column wheel on plain cells (semantic only) - utils: update setColourValue thresholds: 0-50% green, 51-75% orange, 76%+ red - k8sconnector: LeafNode O(1) child lookup, appendParents append+reverse, GetNamespace caches kubeconfig read, GetNodes uses List for multiple names
- utils_test: setColourValue thresholds, memoryGetUnitLst, memoryHumanReadable - builder_test: setFilter pre-parsing, matchShouldExclude (int/string/float/empty) - node_test: pctOf, nodeReadyStatus, nodeRoles, computeNodeAllocations - k8sconnector_test: LeafNode.getChild map lookup and deep tree traversal - table_test: Sprint rendering, hidden columns, unicode alignment
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
--watch/-w): in-place terminal refresh via Bubble Tea, driven by Kubernetes pod watch events. Metrics commands (cpu/memory/resources) use a 25s ticker since pod events don't fire on metrics changes.kubectl ice node: per-node resource allocation (CPU/memory requests, limits, % of allocatable). Flags:--usage(metrics-server),--compute-class,--overallocated,--classkubectl ice conditions: pod conditions table (PodScheduled, Initialized, ContainersReady, Ready) with status coloring and--watchsupportkubectl ice completion: shell completion generator for zsh/bash/fish with--installflagmemoryGetUnitLstO(1) lookup,matchFilterpre-parsed values,strings.Builderin table rendering,utf8.RuneCountInString,LeafNodeO(1) child map,appendParentsappend+reverse,GetNamespacekubeconfig cache,GetNodessingle Listfor multiple names
setColourValuethresholds 0–50% green / 51–75% orange / 76%+ red;COLOUR_MIXsuppresses column wheel on plain cellssetColourValue,pctOf,nodeReadyStatus,nodeRoles,computeNodeAllocations,matchShouldExclude,LeafNode.getChild,Table.SprintTest plan
go test ./pkg/...passes (33 tests)kubectl ice cpu --watchrefreshes in-place, Ctrl+C exits cleanlykubectl ice nodedisplays per-node resource allocationkubectl ice node --usageadds CPU-USED / MEM-USED columnskubectl ice node --overallocatedfilters over-allocated nodeskubectl ice conditionslists pod conditionskubectl ice conditions -m "STATUS!=True"filters non-ready podskubectl ice completion zsh --installwrites to~/.zsh/completions/