mirror of
https://github.com/weaveworks/scope.git
synced 2026-03-04 02:30:45 +00:00
awsecs: Appease linter
This commit is contained in:
@@ -13,7 +13,7 @@ import (
|
||||
"github.com/bluele/gcache"
|
||||
)
|
||||
|
||||
// A wrapper around an AWS client that makes all the needed calls and just exposes the final results.
|
||||
// EcsClient is a wrapper around an AWS client that makes all the needed calls and just exposes the final results.
|
||||
// We create an interface so we can mock for testing.
|
||||
type EcsClient interface {
|
||||
// Returns a EcsInfo struct containing data needed for a report.
|
||||
@@ -28,6 +28,7 @@ type ecsClientImpl struct {
|
||||
serviceCache gcache.Cache // Keys are service names.
|
||||
}
|
||||
|
||||
// EcsTask describes the parts of ECS tasks we care about.
|
||||
// Since we're caching tasks heavily, we ensure no mistakes by casting into a structure
|
||||
// that only contains immutable attributes of the resource.
|
||||
// Exported for test.
|
||||
@@ -42,6 +43,7 @@ type EcsTask struct {
|
||||
StartedBy string // tag or deployment id
|
||||
}
|
||||
|
||||
// EcsService describes the parts of ECS services we care about.
|
||||
// Services are highly mutable and so we can only cache them on a best-effort basis.
|
||||
// We have to refresh referenced (ie. has an associated task) services each report
|
||||
// but we avoid re-listing services unless we can't find a service for a task.
|
||||
@@ -56,7 +58,7 @@ type EcsService struct {
|
||||
TaskDefinitionARN string
|
||||
}
|
||||
|
||||
// Exported for test
|
||||
// EcsInfo is exported for test
|
||||
type EcsInfo struct {
|
||||
Tasks map[string]EcsTask
|
||||
Services map[string]EcsService
|
||||
|
||||
@@ -32,13 +32,13 @@ var (
|
||||
}
|
||||
)
|
||||
|
||||
// Used in return value of GetLabelInfo. Exported for test.
|
||||
// TaskLabelInfo is used in return value of GetLabelInfo. Exported for test.
|
||||
type TaskLabelInfo struct {
|
||||
ContainerIDs []string
|
||||
Family string
|
||||
}
|
||||
|
||||
// Return map from cluster to map of task arns to task infos.
|
||||
// GetLabelInfo returns map from cluster to map of task arns to task infos.
|
||||
// Exported for test.
|
||||
func GetLabelInfo(rpt report.Report) map[string]map[string]*TaskLabelInfo {
|
||||
results := map[string]map[string]*TaskLabelInfo{}
|
||||
|
||||
Reference in New Issue
Block a user