Documentation
¶
Index ¶
- type CountByRolloutStatusResult
- type FleetStore
- func (s *FleetStore) CountByRolloutStatus(ctx context.Context, orgId *uuid.UUID, _ *string) ([]CountByRolloutStatusResult, error)
- func (s *FleetStore) Create(ctx context.Context, orgId uuid.UUID, resource *domain.Fleet, ...) (*domain.Fleet, error)
- func (s *FleetStore) CreateOrUpdate(ctx context.Context, orgId uuid.UUID, resource *domain.Fleet, ...) (*domain.Fleet, bool, error)
- func (s *FleetStore) Delete(ctx context.Context, orgId uuid.UUID, name string, ...) error
- func (s *FleetStore) Get(ctx context.Context, orgId uuid.UUID, name string, opts ...GetOption) (*domain.Fleet, error)
- func (s *FleetStore) GetRepositoryRefs(ctx context.Context, orgId uuid.UUID, name string) (*domain.RepositoryList, error)
- func (s *FleetStore) InitialMigration(ctx context.Context) error
- func (s *FleetStore) List(ctx context.Context, orgId uuid.UUID, listParams store.ListParams, ...) (*domain.FleetList, error)
- func (s *FleetStore) ListDisruptionBudgetFleets(ctx context.Context, orgId uuid.UUID) (*domain.FleetList, error)
- func (s *FleetStore) ListFleetsByAppCatalogItemRef(ctx context.Context, orgId uuid.UUID, catalog string, item string, ...) (*domain.FleetList, error)
- func (s *FleetStore) ListFleetsByOsCatalogItemRef(ctx context.Context, orgId uuid.UUID, catalog string, item string, ...) (*domain.FleetList, error)
- func (s *FleetStore) ListFleetsByVolumeCatalogItemRef(ctx context.Context, orgId uuid.UUID, catalog string, item string, ...) (*domain.FleetList, error)
- func (s *FleetStore) ListIgnoreOrg(ctx context.Context) ([]model.Fleet, error)
- func (s *FleetStore) ListRolloutDeviceSelection(ctx context.Context, orgId uuid.UUID) (*domain.FleetList, error)
- func (s *FleetStore) MutateAnnotation(ctx context.Context, orgId uuid.UUID, name string, key string, ...) error
- func (s *FleetStore) OverwriteRepositoryRefs(ctx context.Context, orgId uuid.UUID, name string, repositoryNames ...string) error
- func (s *FleetStore) UnsetOwner(ctx context.Context, tx *gorm.DB, orgId uuid.UUID, owner string) error
- func (s *FleetStore) UnsetOwnerByKind(ctx context.Context, tx *gorm.DB, orgId uuid.UUID, resourceKind string) error
- func (s *FleetStore) Update(ctx context.Context, orgId uuid.UUID, resource *domain.Fleet, ...) (*domain.Fleet, error)
- func (s *FleetStore) UpdateAnnotations(ctx context.Context, orgId uuid.UUID, name string, ...) error
- func (s *FleetStore) UpdateConditions(ctx context.Context, orgId uuid.UUID, name string, ...) error
- func (s *FleetStore) UpdateStatus(ctx context.Context, orgId uuid.UUID, resource *domain.Fleet) (*domain.Fleet, error)
- type GetOption
- type ListOption
- type Store
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CountByRolloutStatusResult ¶
CountByRolloutStatusResult holds the result of the group by query for fleet rollout status.
type FleetStore ¶
type FleetStore struct {
// contains filtered or unexported fields
}
func (*FleetStore) CountByRolloutStatus ¶
func (s *FleetStore) CountByRolloutStatus(ctx context.Context, orgId *uuid.UUID, _ *string) ([]CountByRolloutStatusResult, error)
CountByRolloutStatus returns the count of fleets grouped by org_id and rollout status.
func (*FleetStore) CreateOrUpdate ¶
func (*FleetStore) Delete ¶
func (s *FleetStore) Delete(ctx context.Context, orgId uuid.UUID, name string, eventCallback store.EventCallback) error
func (*FleetStore) GetRepositoryRefs ¶
func (s *FleetStore) GetRepositoryRefs(ctx context.Context, orgId uuid.UUID, name string) (*domain.RepositoryList, error)
func (*FleetStore) InitialMigration ¶
func (s *FleetStore) InitialMigration(ctx context.Context) error
func (*FleetStore) List ¶
func (s *FleetStore) List(ctx context.Context, orgId uuid.UUID, listParams store.ListParams, opts ...ListOption) (*domain.FleetList, error)
func (*FleetStore) ListDisruptionBudgetFleets ¶
func (s *FleetStore) ListDisruptionBudgetFleets(ctx context.Context, orgId uuid.UUID) (*domain.FleetList, error)
ListDisruptionBudgetFleets attempts to get fleets for disruption budget. Since the disruption budget acts like a gate to device rendering, the query searches for fleets that each contains at least 1 device that has different value set between tha annotation 'device-controller/templateVersion' which is set before rollout and 'device-controller/renderedTemplateVersion' which is set after rollout.
func (*FleetStore) ListFleetsByAppCatalogItemRef ¶
func (*FleetStore) ListFleetsByOsCatalogItemRef ¶
func (*FleetStore) ListFleetsByVolumeCatalogItemRef ¶
func (*FleetStore) ListIgnoreOrg ¶
func (*FleetStore) ListRolloutDeviceSelection ¶
func (s *FleetStore) ListRolloutDeviceSelection(ctx context.Context, orgId uuid.UUID) (*domain.FleetList, error)
ListRolloutDeviceSelection attempts to get all relevant fleets for rollout device selection. A relevant fleet contains at least 1 device that at least one of the conditions below is true: - marked as selected for rollout - the template version of the fleet is not the same the template version in the annotation 'device-controller/renderedTemplateVersion' - the field 'status.config.renderedVersion' is not the same as the annotation 'device-controller/renderedVersion'
func (*FleetStore) MutateAnnotation ¶
func (*FleetStore) OverwriteRepositoryRefs ¶
func (*FleetStore) UnsetOwner ¶
func (*FleetStore) UnsetOwnerByKind ¶
func (*FleetStore) UpdateAnnotations ¶
func (*FleetStore) UpdateConditions ¶
type ListOption ¶
type ListOption func(*listOptions)
func ListWithDevicesSummary ¶
func ListWithDevicesSummary(val bool) ListOption
type Store ¶
type Store interface {
InitialMigration(ctx context.Context) error
Create(ctx context.Context, orgId uuid.UUID, fleet *domain.Fleet, eventCallback store.EventCallback) (*domain.Fleet, error)
Update(ctx context.Context, orgId uuid.UUID, fleet *domain.Fleet, fieldsToUnset []string, eventCallback store.EventCallback) (*domain.Fleet, error)
CreateOrUpdate(ctx context.Context, orgId uuid.UUID, fleet *domain.Fleet, fieldsToUnset []string, eventCallback store.EventCallback) (*domain.Fleet, bool, error)
Get(ctx context.Context, orgId uuid.UUID, name string, opts ...GetOption) (*domain.Fleet, error)
List(ctx context.Context, orgId uuid.UUID, listParams store.ListParams, opts ...ListOption) (*domain.FleetList, error)
Delete(ctx context.Context, orgId uuid.UUID, name string, eventCallback store.EventCallback) error
UpdateStatus(ctx context.Context, orgId uuid.UUID, fleet *domain.Fleet) (*domain.Fleet, error)
ListRolloutDeviceSelection(ctx context.Context, orgId uuid.UUID) (*domain.FleetList, error)
ListDisruptionBudgetFleets(ctx context.Context, orgId uuid.UUID) (*domain.FleetList, error)
UnsetOwner(ctx context.Context, tx *gorm.DB, orgId uuid.UUID, owner string) error
UnsetOwnerByKind(ctx context.Context, tx *gorm.DB, orgId uuid.UUID, resourceKind string) error
UpdateConditions(ctx context.Context, orgId uuid.UUID, name string, conditions []domain.Condition, eventCallback store.EventCallback) error
UpdateAnnotations(ctx context.Context, orgId uuid.UUID, name string, annotations map[string]string, deleteKeys []string, eventCallback store.EventCallback) error
MutateAnnotation(ctx context.Context, orgId uuid.UUID, name string, key string, mutate func(current string) (string, error)) error
OverwriteRepositoryRefs(ctx context.Context, orgId uuid.UUID, name string, repositoryNames ...string) error
GetRepositoryRefs(ctx context.Context, orgId uuid.UUID, name string) (*domain.RepositoryList, error)
// Used by catalog
ListFleetsByOsCatalogItemRef(ctx context.Context, orgId uuid.UUID, catalog string, item string, listParams store.ListParams) (*domain.FleetList, error)
ListFleetsByAppCatalogItemRef(ctx context.Context, orgId uuid.UUID, catalog string, item string, listParams store.ListParams) (*domain.FleetList, error)
ListFleetsByVolumeCatalogItemRef(ctx context.Context, orgId uuid.UUID, catalog string, item string, listParams store.ListParams) (*domain.FleetList, error)
// Used by domain metrics
CountByRolloutStatus(ctx context.Context, orgId *uuid.UUID, _ *string) ([]CountByRolloutStatusResult, error)
}
func NewFleetStore ¶
func NewFleetStore(db *gorm.DB, log logrus.FieldLogger) Store