@skyhook-io/k8s-ui 1.8.9 → 1.8.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/components/applications/ApplicationsList.tsx +4 -1
- package/src/components/applications/ApplicationsView.tsx +40 -9
- package/src/components/checks/ChecksView.tsx +80 -49
- package/src/components/checks/severity.ts +29 -39
- package/src/components/gitops/GitOpsTableView.tsx +11 -56
- package/src/components/issues/IssuesView.tsx +186 -123
- package/src/components/issues/ResourceIssuesSection.test.tsx +39 -0
- package/src/components/issues/ResourceIssuesSection.tsx +21 -3
- package/src/components/issues/index.ts +0 -2
- package/src/components/issues/issues.test.ts +45 -4
- package/src/components/issues/severity.ts +27 -32
- package/src/components/resources/ResourcesSidebar.test.tsx +36 -0
- package/src/components/resources/ResourcesSidebar.tsx +24 -6
- package/src/components/resources/ResourcesView.tsx +10 -2
- package/src/components/resources/renderers/MetricsUnavailableNotice.tsx +47 -0
- package/src/components/resources/renderers/NodeRenderer.test.tsx +103 -0
- package/src/components/resources/renderers/NodeRenderer.tsx +20 -12
- package/src/components/resources/renderers/PVCRenderer.test.tsx +23 -0
- package/src/components/resources/renderers/PVCRenderer.tsx +2 -2
- package/src/components/resources/renderers/PodRenderer.test.tsx +101 -0
- package/src/components/resources/renderers/PodRenderer.tsx +81 -70
- package/src/components/ui/BoardSkeleton.tsx +47 -0
- package/src/components/ui/CardSection.tsx +117 -0
- package/src/components/ui/Toast.tsx +1 -1
- package/src/components/ui/index.ts +2 -0
- package/src/components/ui/severity-tone.ts +56 -0
- package/src/theme/variables.css +14 -0
- package/src/utils/api-resources.test.ts +54 -0
- package/src/utils/api-resources.ts +68 -1
- package/tsconfig.json +2 -2
|
@@ -13,6 +13,7 @@ const CONFIG_KINDS = ['ConfigMap', 'Secret', 'HorizontalPodAutoscaler', 'PodDisr
|
|
|
13
13
|
const STORAGE_KINDS = ['PersistentVolumeClaim', 'PersistentVolume', 'StorageClass', 'VolumeAttachment']
|
|
14
14
|
const ACCESS_CONTROL_KINDS = ['ServiceAccount', 'Role', 'ClusterRole', 'RoleBinding', 'ClusterRoleBinding']
|
|
15
15
|
const CLUSTER_KINDS = ['Node', 'Namespace', 'Event']
|
|
16
|
+
const CORE_CATEGORY_NAMES = new Set(['Workloads', 'Networking', 'Configuration', 'Storage', 'Access Control', 'Cluster'])
|
|
16
17
|
|
|
17
18
|
// Core resources that must always be present (fallback if API discovery misses them)
|
|
18
19
|
export const CORE_RESOURCES: APIResource[] = [
|
|
@@ -112,6 +113,7 @@ export function categorizeResources(resources: APIResource[]): ResourceCategory[
|
|
|
112
113
|
export function formatGroupName(group: string): string {
|
|
113
114
|
const knownGroups: Record<string, string> = {
|
|
114
115
|
'argoproj.io': 'Argo',
|
|
116
|
+
'apiregistration.k8s.io': 'API Registration',
|
|
115
117
|
'cert-manager.io': 'Cert Manager',
|
|
116
118
|
'acme.cert-manager.io': 'Cert Manager',
|
|
117
119
|
'istio.io': 'Istio',
|
|
@@ -119,10 +121,12 @@ export function formatGroupName(group: string): string {
|
|
|
119
121
|
'security.istio.io': 'Istio',
|
|
120
122
|
'telemetry.istio.io': 'Istio',
|
|
121
123
|
'monitoring.coreos.com': 'Prometheus',
|
|
124
|
+
'monitoring.googleapis.com': 'Google Cloud Monitoring',
|
|
122
125
|
'velero.io': 'Velero',
|
|
123
126
|
'external-secrets.io': 'External Secrets',
|
|
124
127
|
'keda.sh': 'KEDA',
|
|
125
128
|
'gateway.networking.k8s.io': 'Gateway API',
|
|
129
|
+
'gateway.envoyproxy.io': 'Envoy Gateway',
|
|
126
130
|
'traefik.io': 'Traefik',
|
|
127
131
|
'traefik.containo.us': 'Traefik',
|
|
128
132
|
'crossplane.io': 'Crossplane',
|
|
@@ -166,7 +170,11 @@ export function formatGroupName(group: string): string {
|
|
|
166
170
|
'infrastructure.cluster.x-k8s.io': 'Cluster API',
|
|
167
171
|
'ceph.rook.io': 'Rook',
|
|
168
172
|
'kyverno.io': 'Kyverno',
|
|
173
|
+
'policies.kyverno.io': 'Kyverno',
|
|
169
174
|
'k8s.nginx.org': 'NGINX',
|
|
175
|
+
'networking.gke.io': 'GKE Networking',
|
|
176
|
+
'warden.gke.io': 'GKE Warden',
|
|
177
|
+
'cloud.google.com': 'Google Cloud',
|
|
170
178
|
'sparkoperator.k8s.io': 'Spark',
|
|
171
179
|
'kubeflow.org': 'Kubeflow',
|
|
172
180
|
'snapshot.storage.k8s.io': 'Snapshots',
|
|
@@ -177,6 +185,12 @@ export function formatGroupName(group: string): string {
|
|
|
177
185
|
'resource.k8s.io': 'Dynamic Resource Allocation',
|
|
178
186
|
'kueue.x-k8s.io': 'Kueue',
|
|
179
187
|
'autoscaling.x-k8s.io': 'Cluster Autoscaler',
|
|
188
|
+
'crd.k8s.amazonaws.com': 'AWS VPC CNI',
|
|
189
|
+
'vpcresources.k8s.aws': 'AWS VPC CNI',
|
|
190
|
+
'elbv2.k8s.aws': 'AWS Load Balancer',
|
|
191
|
+
'eks.amazonaws.com': 'EKS',
|
|
192
|
+
'networking.k8s.aws': 'AWS Networking',
|
|
193
|
+
'acid.zalan.do': 'Zalando Postgres',
|
|
180
194
|
'serving.kserve.io': 'KServe',
|
|
181
195
|
'ray.io': 'KubeRay',
|
|
182
196
|
'leaderworkerset.x-k8s.io': 'LeaderWorkerSet',
|
|
@@ -197,7 +211,10 @@ export function formatGroupName(group: string): string {
|
|
|
197
211
|
// their own per-service groups like s3.aws.upbound.io, compute.gcp.upbound.io).
|
|
198
212
|
if (group.endsWith('.upbound.io')) return 'Crossplane'
|
|
199
213
|
if (group.endsWith('.crossplane.io')) return 'Crossplane'
|
|
200
|
-
return
|
|
214
|
+
if (group === 'cluster.x-k8s.io' || group.endsWith('.cluster.x-k8s.io')) return 'Cluster API'
|
|
215
|
+
if (group.endsWith('.cnrm.cloud.google.com')) return 'Config Connector'
|
|
216
|
+
if (group.endsWith('.openshift.io')) return 'OpenShift'
|
|
217
|
+
return formatUnmappedGroupName(group)
|
|
201
218
|
}
|
|
202
219
|
|
|
203
220
|
export function shortenGroupName(group: string): string {
|
|
@@ -206,6 +223,56 @@ export function shortenGroupName(group: string): string {
|
|
|
206
223
|
.replace(/\.k8s$/, '')
|
|
207
224
|
}
|
|
208
225
|
|
|
226
|
+
const GROUP_SUFFIX_LABELS = new Set([
|
|
227
|
+
'io', 'com', 'org', 'dev', 'sh', 'net', 'do', 'ai', 'cloud', 'co', 'app',
|
|
228
|
+
'k8s', 'x-k8s', 'k8s-sigs', 'sigs',
|
|
229
|
+
])
|
|
230
|
+
const GROUP_ACRONYMS: Record<string, string> = {
|
|
231
|
+
api: 'API',
|
|
232
|
+
aws: 'AWS',
|
|
233
|
+
amazonaws: 'AWS',
|
|
234
|
+
cnrm: 'CNRM',
|
|
235
|
+
crd: 'CRD',
|
|
236
|
+
csi: 'CSI',
|
|
237
|
+
dns: 'DNS',
|
|
238
|
+
gcp: 'GCP',
|
|
239
|
+
gke: 'GKE',
|
|
240
|
+
gpu: 'GPU',
|
|
241
|
+
hpa: 'HPA',
|
|
242
|
+
ipam: 'IPAM',
|
|
243
|
+
k8s: 'K8s',
|
|
244
|
+
nfd: 'NFD',
|
|
245
|
+
tcp: 'TCP',
|
|
246
|
+
tls: 'TLS',
|
|
247
|
+
udp: 'UDP',
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
function formatUnmappedGroupName(group: string): string {
|
|
251
|
+
const labels = group
|
|
252
|
+
.split('.')
|
|
253
|
+
.map(label => label.trim().toLowerCase())
|
|
254
|
+
.filter(label => label && !GROUP_SUFFIX_LABELS.has(label))
|
|
255
|
+
|
|
256
|
+
if (labels.length === 0) return group
|
|
257
|
+
if (labels.length === 1) return avoidCoreCategoryCollision(formatGroupToken(labels[0]))
|
|
258
|
+
|
|
259
|
+
const owner = labels[labels.length - 1]
|
|
260
|
+
const descriptors = labels.slice(0, -1)
|
|
261
|
+
return avoidCoreCategoryCollision([owner, ...descriptors].map(formatGroupToken).join(' '))
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
function avoidCoreCategoryCollision(label: string): string {
|
|
265
|
+
return CORE_CATEGORY_NAMES.has(label) ? `${label} APIs` : label
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
function formatGroupToken(token: string): string {
|
|
269
|
+
return token
|
|
270
|
+
.split(/[-_]/)
|
|
271
|
+
.filter(Boolean)
|
|
272
|
+
.map(part => GROUP_ACRONYMS[part] ?? part.charAt(0).toUpperCase() + part.slice(1))
|
|
273
|
+
.join(' ')
|
|
274
|
+
}
|
|
275
|
+
|
|
209
276
|
function sortResources(resources: APIResource[]): APIResource[] {
|
|
210
277
|
return [...resources].sort((a, b) => a.kind.localeCompare(b.kind))
|
|
211
278
|
}
|
package/tsconfig.json
CHANGED