Skip to content

Commit 930bb86

Browse files
committed
autopilotserver/rpc: add feature config
This commit adds a field to the autopilot server rpc that transports default configurations from autopilot to litd.
1 parent 71a57a5 commit 930bb86

File tree

4 files changed

+129
-107
lines changed

4 files changed

+129
-107
lines changed

autopilotserver/client.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -357,10 +357,11 @@ func (c *Client) ListFeatures(ctx context.Context) (map[string]*Feature,
357357
perms := unmarshalPermissions(feature.PermissionsList)
358358
rules := unmarshalRules(feature.Rules)
359359
features[i] = &Feature{
360-
Name: feature.Name,
361-
Description: feature.Description,
362-
Permissions: perms,
363-
Rules: rules,
360+
Name: feature.Name,
361+
Description: feature.Description,
362+
Permissions: perms,
363+
Rules: rules,
364+
DefaultConfig: feature.DefaultConfig,
364365
}
365366
}
366367

autopilotserver/interface.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,11 @@ type Feature struct {
6868
// Rules is a list of all the firewall that must be specified for this
6969
// feature.
7070
Rules map[string]*RuleValues
71+
72+
// DefaultConfig is a JSON-serialized configuration of the feature. It
73+
// represents the default configuration we can use if the user doesn't
74+
// specify any.
75+
DefaultConfig []byte
7176
}
7277

7378
// RuleValues holds the default value along with the sane max and min values

0 commit comments

Comments
 (0)