Read and List Plugin based Hosts (#1655)

* Add ability to read and list hosts.  Tests to follow.

* Add tests for reading and listing as well as validation checks to not modify hosts.

* Add IpAddress and DnsNames to the api resource.  Populate the plugin info.

* Adding go sdk tests for reading and listing hosts and ensuring update and deleting is disallowed.
This commit is contained in:
Todd authored and GitHub committed 2021-11-02 14:06:20 -07:00
1 parent 1312628a1e
commit 808b986834
19 files changed
+803 -107

No files matched your search

+5 -1
View File
@@ -172,7 +172,11 @@ func New(ctx context.Context, conf *Config) (*Controller, error) {
}
// TODO: the RunJobsLimit is temporary until a better fix gets in. This
// currently caps the scheduler at running 10 jobs per interval.
c.scheduler, err = scheduler.New(c.conf.RawConfig.Controller.Name, jobRepoFn, scheduler.WithRunJobsLimit(10))
schedulerOpts := []scheduler.Option{scheduler.WithRunJobsLimit(10)}
if c.conf.RawConfig.Controller.SchedulerRunJobInterval > 0 {
schedulerOpts = append(schedulerOpts, scheduler.WithRunJobsInterval(c.conf.RawConfig.Controller.SchedulerRunJobInterval))
}
c.scheduler, err = scheduler.New(c.conf.RawConfig.Controller.Name, jobRepoFn, schedulerOpts...)
if err != nil {
return nil, fmt.Errorf("error creating new scheduler: %w", err)
}