-
Notifications
You must be signed in to change notification settings - Fork 17
feat: support cluster external name #3174
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
Conversation
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.
Pull request overview
This PR adds support for cluster external names, allowing clusters to be referenced by an alternative name different from their internal cluster name. This feature is useful when clusters need to be accessed via a different identifier in external contexts.
Key changes:
- Added
cluster_external_namefield to cluster settings API type and parsing logic - Extended cluster data structures to store and propagate the external name
- Modified cluster path calculation to use external name when both
clusterDomainandclusterExternalNameare present
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
src/types/api/meta.ts |
Added optional cluster_external_name field to MetaClusterSettings interface |
src/store/reducers/clusters/types.ts |
Added optional clusterExternalName field to PreparedCluster interface |
src/store/reducers/clusters/utils.ts |
Extracts and stores clusterExternalName from parsed settings during cluster data preparation |
src/store/reducers/cluster/parseFields.ts |
Added cluster_external_name to the Zod schema for settings validation |
src/containers/Clusters/utils.ts |
Modified cluster path calculation to conditionally use external name instead of cluster name |
| {backend, clusterName}, | ||
| { | ||
| backend, | ||
| clusterName: clusterDomain && clusterExternalName ? clusterExternalName : clusterName, |
Copilot
AI
Dec 4, 2025
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.
The conditional logic clusterDomain && clusterExternalName ? clusterExternalName : clusterName may not reflect the intended behavior. This condition only uses clusterExternalName when both clusterDomain and clusterExternalName are truthy.
If the intent is to use clusterExternalName whenever it's available (regardless of clusterDomain), the condition should be simplified to:
clusterName: clusterExternalName || clusterName,If clusterExternalName should only be used when clusterDomain is also set, consider adding a comment explaining this relationship, as it's not immediately obvious why both conditions are required.
| clusterName: clusterDomain && clusterExternalName ? clusterExternalName : clusterName, | |
| clusterName: clusterExternalName || clusterName, |
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.
5 files reviewed, no comments
Greptile Overview
Greptile Summary
This PR adds support for an optional
cluster_external_namesetting that allows clusters to specify an alternative name for URL generation during cross-domain navigation.cluster_external_nameto theMetaClusterSettingstype and Zod validation schemaclusterExternalNametoPreparedClusterinterface and extraction logiccalculateClusterPathto use the external name when bothclusterDomainandclusterExternalNameare presentThe implementation is clean and follows existing patterns. The external name is only used when cross-domain navigation is active (i.e., when
clusterDomainis set), ensuring backward compatibility for standard single-domain deployments.Confidence Score: 5/5
Important Files Changed
File Analysis
cluster_external_nameoptional property toMetaClusterSettingsinterface. Simple, type-safe addition.cluster_external_nameto Zod validation schema as optional string. Consistent with existing pattern for settings validation.clusterExternalNameoptional property toPreparedClusterinterface. Follows existing naming convention (camelCase for prepared data).cluster_external_namefrom parsed settings and maps toclusterExternalNamein prepared cluster object.clusterDomainandclusterExternalNameare present. Logic correctly gates external name usage on domain presence.Sequence Diagram
sequenceDiagram participant API as Meta API participant Parser as parseSettingsField participant Prepare as prepareClustersData participant Utils as calculateClusterPath participant Router as createHref API->>Parser: settings (with cluster_external_name) Parser->>Parser: Validate with Zod schema Parser->>Prepare: parsedSettings Prepare->>Prepare: Extract clusterExternalName Prepare->>Utils: PreparedCluster (with clusterExternalName) Utils->>Utils: Check clusterDomain && clusterExternalName alt Both domain and external name present Utils->>Router: clusterName = clusterExternalName else Otherwise Utils->>Router: clusterName = name end Router->>Router: Generate URL with clusterName query paramCI Results
Test Status:⚠️ FLAKY
📊 Full Report
Test Changes Summary ⏭️2
⏭️ Skipped Tests (2)
Bundle Size: ✅
Current: 62.34 MB | Main: 62.34 MB
Diff: +0.50 KB (0.00%)
✅ Bundle size unchanged.
ℹ️ CI Information