mirror of
				https://github.com/siderolabs/talos.git
				synced 2025-10-31 00:11:36 +01:00 
			
		
		
		
	Implement a screen for entering/managing the config `${code}` variable.
Enable this screen only when the platform is `metal` and there is a `${code}` variable in the `talos.config` kernel cmdline URL query.
Additionally, remove the "Delete" button and its functionality from the network config screen to avoid users accidentally deleting PlatformNetworkConfig parts that are not managed by the dashboard.
Add some tests for the form data parsing on the network config screen.
Remove the unnecessary lock on the summary tab - all updates come from the same goroutine.
Closes siderolabs/talos#6993.
Signed-off-by: Utku Ozdemir <utku.ozdemir@siderolabs.com>
		
	
			
		
			
				
	
	
		
			29 lines
		
	
	
		
			626 B
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			29 lines
		
	
	
		
			626 B
		
	
	
	
		
			Go
		
	
	
	
	
	
| // This Source Code Form is subject to the terms of the Mozilla Public
 | |
| // License, v. 2.0. If a copy of the MPL was not distributed with this
 | |
| // file, You can obtain one at http://mozilla.org/MPL/2.0/.
 | |
| 
 | |
| package dashboard
 | |
| 
 | |
| import (
 | |
| 	"context"
 | |
| 
 | |
| 	"google.golang.org/grpc/metadata"
 | |
| 
 | |
| 	"github.com/siderolabs/talos/pkg/machinery/client"
 | |
| )
 | |
| 
 | |
| func nodeContext(ctx context.Context, selectedNode string) context.Context {
 | |
| 	md, mdOk := metadata.FromOutgoingContext(ctx)
 | |
| 	if mdOk {
 | |
| 		md.Delete("nodes")
 | |
| 
 | |
| 		ctx = metadata.NewOutgoingContext(ctx, md)
 | |
| 	}
 | |
| 
 | |
| 	if selectedNode != "" {
 | |
| 		ctx = client.WithNode(ctx, selectedNode)
 | |
| 	}
 | |
| 
 | |
| 	return ctx
 | |
| }
 |