File tree 3 files changed +26
-2
lines changed
frontend/src/components/App
3 files changed +26
-2
lines changed Original file line number Diff line number Diff line change @@ -1178,6 +1178,13 @@ func (c *HeadlampConfig) getClusters() []Cluster {
1178
1178
"source" : context .SourceStr (),
1179
1179
"namespace" : context .KubeContext .Namespace ,
1180
1180
"extensions" : context .KubeContext .Extensions ,
1181
+ "origin" : map [string ]interface {}{
1182
+ "kubeconfig" : func () string {
1183
+ path , _ := c .getKubeConfigPath (context .SourceStr ())
1184
+ return path
1185
+ }(),
1186
+ },
1187
+ "originalName" : context .Name ,
1181
1188
},
1182
1189
})
1183
1190
}
Original file line number Diff line number Diff line change @@ -246,7 +246,8 @@ function HomeComponent(props: HomeComponentProps) {
246
246
*/
247
247
function getOrigin ( cluster : Cluster ) : string {
248
248
if ( cluster . meta_data ?. source === 'kubeconfig' ) {
249
- const kubeconfigPath = process . env . KUBECONFIG ?? '~/.kube/config' ;
249
+ const sourcePath = cluster . meta_data ?. origin ?. kubeconfig ;
250
+ const kubeconfigPath = process . env . KUBECONFIG ?? sourcePath ;
250
251
return `Kubeconfig: ${ kubeconfigPath } ` ;
251
252
} else if ( cluster . meta_data ?. source === 'dynamic_cluster' ) {
252
253
return t ( 'translation|Plugin' ) ;
Original file line number Diff line number Diff line change @@ -314,6 +314,22 @@ export default function SettingsCluster() {
314
314
) ;
315
315
}
316
316
317
+ function ClusterName ( ) {
318
+ console . log ( 'this cluster info: ' , clusterInfo ) ;
319
+ const originalName = clusterInfo ?. meta_data ?. originalName ;
320
+
321
+ return (
322
+ < >
323
+ t('translation|Name')
324
+ { originalName && (
325
+ < Typography variant = "body2" color = "textSecondary" >
326
+ Original name of cluster: { originalName }
327
+ </ Typography >
328
+ ) }
329
+ </ >
330
+ ) ;
331
+ }
332
+
317
333
return (
318
334
< >
319
335
< SectionBox
@@ -336,7 +352,7 @@ export default function SettingsCluster() {
336
352
< NameValueTable
337
353
rows = { [
338
354
{
339
- name : t ( 'translation|Name' ) ,
355
+ name : < ClusterName /> ,
340
356
value : (
341
357
< TextField
342
358
onChange = { event => {
You can’t perform that action at this time.
0 commit comments