diff --git a/agent/structs/structs.go b/agent/structs/structs.go index 43a664b18..e9a293e8d 100644 --- a/agent/structs/structs.go +++ b/agent/structs/structs.go @@ -1932,22 +1932,6 @@ type ServiceCheck struct { Namespace string } -// CheckIDs returns the IDs for all checks associated with a session, regardless of type -func (s *Session) CheckIDs() []types.CheckID { - // Merge all check IDs into a single slice, since they will be handled the same way - checks := make([]types.CheckID, 0, len(s.Checks)+len(s.NodeChecks)+len(s.ServiceChecks)) - checks = append(checks, s.Checks...) - - for _, c := range s.NodeChecks { - checks = append(checks, types.CheckID(c)) - } - - for _, c := range s.ServiceChecks { - checks = append(checks, types.CheckID(c.ID)) - } - return checks -} - func (s *Session) UnmarshalJSON(data []byte) (err error) { type Alias Session aux := &struct { diff --git a/agent/structs/structs_oss.go b/agent/structs/structs_oss.go index 7bdac5f6d..71a58142b 100644 --- a/agent/structs/structs_oss.go +++ b/agent/structs/structs_oss.go @@ -6,6 +6,7 @@ import ( "hash" "github.com/hashicorp/consul/acl" + "github.com/hashicorp/consul/types" ) var emptyEnterpriseMeta = EnterpriseMeta{} @@ -91,3 +92,19 @@ func (cid *CheckID) String() string { func (_ *HealthCheck) Validate() error { return nil } + +// CheckIDs returns the IDs for all checks associated with a session, regardless of type +func (s *Session) CheckIDs() []types.CheckID { + // Merge all check IDs into a single slice, since they will be handled the same way + checks := make([]types.CheckID, 0, len(s.Checks)+len(s.NodeChecks)+len(s.ServiceChecks)) + checks = append(checks, s.Checks...) + + for _, c := range s.NodeChecks { + checks = append(checks, types.CheckID(c)) + } + + for _, c := range s.ServiceChecks { + checks = append(checks, types.CheckID(c.ID)) + } + return checks +}