Skip to content

Commit

Permalink
buildx: error editing nodes with driver opts/config file
Browse files Browse the repository at this point in the history
Currently, editing nodes to contain a new set of driver options or
config files is unsupported, so we want to explicitly mark it as so,
instead of silently failing to set those options.

In the future, we might support overriding these options, however, for
now, we should give the user visability of the supported options.

Signed-off-by: Justin Chadwell <[email protected]>
  • Loading branch information
jedevc committed Jul 27, 2022
1 parent 832d90c commit 50cf979
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions commands/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,9 @@ func createCmd(dockerCli command.Cli) *cobra.Command {
}

func csvToMap(in []string) (map[string]string, error) {
if len(in) == 0 {
return nil, nil
}
m := make(map[string]string, len(in))
for _, s := range in {
csvReader := csv.NewReader(strings.NewReader(s))
Expand Down
6 changes: 6 additions & 0 deletions store/nodegroup.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,12 @@ func (ng *NodeGroup) Update(name, endpoint string, platforms []string, endpoints
if flags != nil {
n.Flags = flags
}
if do != nil {
return errors.Errorf("cannot update node with new driver options")
}
if configFile != "" {
return errors.Errorf("cannot update node with new config file")
}
ng.Nodes[i] = n
if err := ng.validateDuplicates(endpoint, i); err != nil {
return err
Expand Down

0 comments on commit 50cf979

Please sign in to comment.