Skip to content

Commit

Permalink
feat: existing Linux VRFs (#1768)
Browse files Browse the repository at this point in the history
  • Loading branch information
Milan Lenčo authored Dec 15, 2020
1 parent e5edff9 commit f57938d
Show file tree
Hide file tree
Showing 19 changed files with 1,139 additions and 527 deletions.
1 change: 1 addition & 0 deletions cmd/agentctl/api/types/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ type SchedulerDumpOptions struct {

type SchedulerValuesOptions struct {
KeyPrefix string
Key string
}

type SchedulerResyncOptions struct {
Expand Down
9 changes: 8 additions & 1 deletion cmd/agentctl/client/scheduler.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,20 @@ func (c *Client) SchedulerDump(ctx context.Context, opts types.SchedulerDumpOpti
func (c *Client) SchedulerValues(ctx context.Context, opts types.SchedulerValuesOptions) ([]*kvscheduler.BaseValueStatus, error) {
query := url.Values{}
query.Set("key-prefix", opts.KeyPrefix)
query.Set("key", opts.Key)

resp, err := c.get(ctx, "/scheduler/status", query, nil)
if err != nil {
return nil, err
}
var status []*kvscheduler.BaseValueStatus
if err := json.NewDecoder(resp.body).Decode(&status); err != nil {
if opts.Key != "" {
status = []*kvscheduler.BaseValueStatus{{}}
err = json.NewDecoder(resp.body).Decode(status[0])
} else {
err = json.NewDecoder(resp.body).Decode(&status)
}
if err != nil {
return nil, fmt.Errorf("decoding reply failed: %v", err)
}

Expand Down
233 changes: 233 additions & 0 deletions plugins/linux/ifplugin/descriptor/adapter/interfaceaddress.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit f57938d

Please sign in to comment.