Skip to content

Commit 48f1069

Browse files
committed
conifg-patch: apply review
License: MIT Signed-off-by: Łukasz Magiera <[email protected]>
1 parent 128e6ba commit 48f1069

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

core/commands/config.go

+2-3
Original file line numberDiff line numberDiff line change
@@ -326,11 +326,10 @@ Backing up the config before running this command is advised.`,
326326
cmds.StringArg("profile", true, false, "The profile to apply to the config."),
327327
},
328328
Run: func(req cmds.Request, res cmds.Response) {
329-
args := req.Arguments()
330329

331-
profile, ok := config.Profiles[args[0]]
330+
profile, ok := config.Profiles[req.Arguments()[0]]
332331
if !ok {
333-
res.SetError(fmt.Errorf("%s in not a profile", args[0]), cmds.ErrNormal)
332+
res.SetError(fmt.Errorf("%s in not a profile", req.Arguments()[0]), cmds.ErrNormal)
334333
return
335334
}
336335

repo/config/profile.go

+3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
package config
22

3+
// Transformer is a function which takes configuration and applies some filter to it
34
type Transformer func(c *Config) error
45

6+
// Profile applies some set of changes to the configuration
57
type Profile struct {
68
Apply Transformer
79
Unapply Transformer
@@ -32,6 +34,7 @@ var Profiles = map[string]*Profile{
3234
"/ip4/240.0.0.0/ipcidr/4",
3335
}
3436

37+
c.Addresses.NoAnnounce = append(c.Addresses.NoAnnounce, defaultServerFilters...)
3538
c.Swarm.AddrFilters = append(c.Swarm.AddrFilters, defaultServerFilters...)
3639
c.Discovery.MDNS.Enabled = false
3740
return nil

0 commit comments

Comments
 (0)