Documentation
¶
Index ¶
- Constants
- Variables
- func CloneGitRepo(repo *api.Repository, revision *string, depth *int) (billy.Filesystem, string, error)
- func CloneGitRepoToIgnition(repo *api.Repository, revision string, path string) (*config_latest_types.Config, string, error)
- func ConvertFileSystemToIgnition(mfs billy.Filesystem, path string) (*config_latest_types.Config, error)
- func EmitInternalTaskFailedEvent(ctx context.Context, orgID uuid.UUID, errorMessage string, ...)
- func GetAuth(repository *api.Repository) (transport.AuthMethod, error)
- func LaunchConsumers(ctx context.Context, queuesProvider queues.Provider, ...) error
- func NeedsSyncToHash(rs *api.ResourceSync, hash string) bool
- type API
- type DeviceDisconnected
- type DeviceRenderLogic
- type EventCleanup
- type FleetRolloutsLogic
- type FleetSelectorMatchingLogic
- type FleetValidateLogic
- type FleetValidationResult
- type GenericResourceMap
- type GitRepoTester
- type HttpRepoTester
- type ProcessingStats
- type QueueMaintenanceTask
- type RenderItem
- type RepoTester
- type RepositoryUpdateLogic
- type ResourceSync
- func (r *ResourceSync) GetRepositoryAndValidateAccess(ctx context.Context, orgId uuid.UUID, rs *api.ResourceSync) (*api.Repository, error)
- func (r *ResourceSync) ParseFleetsFromResources(resources []GenericResourceMap, resourceName string) ([]*api.Fleet, error)
- func (r *ResourceSync) Poll(ctx context.Context, orgId uuid.UUID)
- func (r *ResourceSync) SyncFleets(ctx context.Context, log logrus.FieldLogger, orgId uuid.UUID, ...) error
- type TypeSpecificRepoTester
Constants ¶
const ( ItemsPerPage = 1000 EventProcessingTimeout = 10 * time.Second AckTimeout = 5 * time.Second )
const ( // DeviceDisconnectedPollingInterval is the interval at which the device liveness task runs. DeviceDisconnectedPollingInterval = 2 * time.Minute DeviceDisconnectedTaskName = "device-disconnected" )
const ( // EventCleanupPollingInterval is the interval at which the event cleanup task runs. EventCleanupPollingInterval = 10 * time.Minute EventCleanupTaskName = "event-cleanup" )
const RepoTesterTaskName = "repository-tester"
const ResourceSyncTaskName = "resourcesync"
Variables ¶
var ( ErrUnknownConfigName = errors.New("failed to find configuration item name") ErrUnknownApplicationType = errors.New("unknown application type") )
Functions ¶
func CloneGitRepo ¶
func CloneGitRepo(repo *api.Repository, revision *string, depth *int) (billy.Filesystem, string, error)
func CloneGitRepoToIgnition ¶ added in v0.4.0
func CloneGitRepoToIgnition(repo *api.Repository, revision string, path string) (*config_latest_types.Config, string, error)
func ConvertFileSystemToIgnition ¶
func ConvertFileSystemToIgnition(mfs billy.Filesystem, path string) (*config_latest_types.Config, error)
ConvertFileSystemToIgnition converts a filesystem to an ignition config The filesystem is expected to be a git repo, and the path is the root of the repo The function will recursively walk the filesystem and add all files to the ignition config In case user provides file path we will add file as "/file-name" In case user provides folder we will drop folder path add all files and subfolder with subfolder paths, like Example: ConvertFileSystemToIgnition(mfs, "/test-path) will go through all subfolder and files and build ignition paths like /etc/motd, /etc/config/file.yaml The function will return an error if the path does not exist or if there is an error reading the filesystem
func EmitInternalTaskFailedEvent ¶ added in v0.10.0
func GetAuth ¶
func GetAuth(repository *api.Repository) (transport.AuthMethod, error)
Read repository's ssh/http config and create transport.AuthMethod. If no ssh/http config is defined a nil is returned.
func LaunchConsumers ¶
func NeedsSyncToHash ¶ added in v0.6.0
func NeedsSyncToHash(rs *api.ResourceSync, hash string) bool
NeedsSyncToHash returns true if the resource needs to be synced to the given hash.
Types ¶
type DeviceDisconnected ¶
type DeviceDisconnected struct {
// contains filtered or unexported fields
}
func NewDeviceDisconnected ¶
func NewDeviceDisconnected(log logrus.FieldLogger, serviceHandler service.Service) *DeviceDisconnected
type DeviceRenderLogic ¶
type DeviceRenderLogic struct {
// contains filtered or unexported fields
}
func NewDeviceRenderLogic ¶
func (*DeviceRenderLogic) RenderDevice ¶
func (t *DeviceRenderLogic) RenderDevice(ctx context.Context) error
type EventCleanup ¶ added in v0.7.0
type EventCleanup struct {
// contains filtered or unexported fields
}
func NewEventCleanup ¶ added in v0.7.0
func NewEventCleanup(log logrus.FieldLogger, serviceHandler service.Service, retentionPeriod util.Duration) *EventCleanup
func (*EventCleanup) Poll ¶ added in v0.7.0
func (t *EventCleanup) Poll(ctx context.Context)
Poll checks deletes events older than the configured retention period
type FleetRolloutsLogic ¶
type FleetRolloutsLogic struct {
// contains filtered or unexported fields
}
func NewFleetRolloutsLogic ¶
func NewFleetRolloutsLogic(log logrus.FieldLogger, serviceHandler service.Service, orgId uuid.UUID, event api.Event) FleetRolloutsLogic
func (FleetRolloutsLogic) RolloutDevice ¶
func (f FleetRolloutsLogic) RolloutDevice(ctx context.Context) error
The device's owner was changed, roll out if necessary
func (FleetRolloutsLogic) RolloutFleet ¶
func (f FleetRolloutsLogic) RolloutFleet(ctx context.Context) error
func (*FleetRolloutsLogic) SetItemsPerPage ¶
func (f *FleetRolloutsLogic) SetItemsPerPage(items int)
type FleetSelectorMatchingLogic ¶
type FleetSelectorMatchingLogic struct {
// contains filtered or unexported fields
}
func NewFleetSelectorMatchingLogic ¶
func NewFleetSelectorMatchingLogic(log logrus.FieldLogger, serviceHandler service.Service, orgId uuid.UUID, event api.Event) FleetSelectorMatchingLogic
func (FleetSelectorMatchingLogic) DeviceLabelsUpdated ¶ added in v0.9.0
func (f FleetSelectorMatchingLogic) DeviceLabelsUpdated(ctx context.Context) error
func (FleetSelectorMatchingLogic) FleetSelectorUpdated ¶ added in v0.9.0
func (f FleetSelectorMatchingLogic) FleetSelectorUpdated(ctx context.Context) error
Iterate devices that match the fleet's selector and set owners/conditions as necessary
func (*FleetSelectorMatchingLogic) SetItemsPerPage ¶
func (f *FleetSelectorMatchingLogic) SetItemsPerPage(items int32)
type FleetValidateLogic ¶
type FleetValidateLogic struct {
// contains filtered or unexported fields
}
func NewFleetValidateLogic ¶
func (*FleetValidateLogic) CreateNewTemplateVersionIfFleetValid ¶
func (t *FleetValidateLogic) CreateNewTemplateVersionIfFleetValid(ctx context.Context) error
type FleetValidationResult ¶ added in v0.9.0
FleetValidationResult holds the result of fleet validation
type GenericResourceMap ¶ added in v0.9.0
type GenericResourceMap map[string]interface{}
func RemoveIgnoredFields ¶ added in v0.9.0
func RemoveIgnoredFields(resource GenericResourceMap, ignorePaths []string) GenericResourceMap
type GitRepoTester ¶
type GitRepoTester struct {
}
func (*GitRepoTester) TestAccess ¶
func (r *GitRepoTester) TestAccess(repository *api.Repository) error
type HttpRepoTester ¶ added in v0.3.0
type HttpRepoTester struct {
}
func (*HttpRepoTester) TestAccess ¶ added in v0.3.0
func (r *HttpRepoTester) TestAccess(repository *api.Repository) error
type ProcessingStats ¶ added in v0.9.0
ProcessingStats holds the results of fleet selector processing
type QueueMaintenanceTask ¶ added in v0.10.0
type QueueMaintenanceTask struct {
// contains filtered or unexported fields
}
QueueMaintenanceTask handles queue maintenance operations including: - Processing timed out messages - Retrying failed messages - Checkpoint advancement based on in-flight task completion tracking
func NewQueueMaintenanceTask ¶ added in v0.10.0
func NewQueueMaintenanceTask(log logrus.FieldLogger, serviceHandler service.Service, queuesProvider queues.Provider, workerMetrics *worker.WorkerCollector) *QueueMaintenanceTask
NewQueueMaintenanceTask creates a new queue maintenance task
type RenderItem ¶ added in v0.3.0
type RepoTester ¶
type RepoTester struct {
TypeSpecificRepoTester TypeSpecificRepoTester
// contains filtered or unexported fields
}
func NewRepoTester ¶
func NewRepoTester(log logrus.FieldLogger, serviceHandler service.Service) *RepoTester
func (*RepoTester) SetAccessCondition ¶
func (r *RepoTester) SetAccessCondition(ctx context.Context, orgId uuid.UUID, repository *api.Repository, err error) error
func (*RepoTester) TestRepositories ¶
func (r *RepoTester) TestRepositories(ctx context.Context, orgId uuid.UUID)
type RepositoryUpdateLogic ¶
type RepositoryUpdateLogic struct {
// contains filtered or unexported fields
}
func NewRepositoryUpdateLogic ¶
func NewRepositoryUpdateLogic(log logrus.FieldLogger, serviceHandler service.Service, orgId uuid.UUID, event api.Event) RepositoryUpdateLogic
func (*RepositoryUpdateLogic) HandleRepositoryUpdate ¶
func (t *RepositoryUpdateLogic) HandleRepositoryUpdate(ctx context.Context) error
type ResourceSync ¶
type ResourceSync struct {
// contains filtered or unexported fields
}
func NewResourceSync ¶
func NewResourceSync(serviceHandler service.Service, log logrus.FieldLogger, ignoreResourceUpdates []string) *ResourceSync
func (*ResourceSync) GetRepositoryAndValidateAccess ¶ added in v0.9.0
func (r *ResourceSync) GetRepositoryAndValidateAccess(ctx context.Context, orgId uuid.UUID, rs *api.ResourceSync) (*api.Repository, error)
GetRepositoryAndValidateAccess gets the repository and validates it's accessible
func (*ResourceSync) ParseFleetsFromResources ¶ added in v0.9.0
func (r *ResourceSync) ParseFleetsFromResources(resources []GenericResourceMap, resourceName string) ([]*api.Fleet, error)
ParseFleetsFromResources parses fleets from generic resources
func (*ResourceSync) SyncFleets ¶ added in v0.9.0
func (r *ResourceSync) SyncFleets(ctx context.Context, log logrus.FieldLogger, orgId uuid.UUID, rs *api.ResourceSync, fleets []*api.Fleet, resourceName string) error
SyncFleets syncs the fleets to the service
type TypeSpecificRepoTester ¶
type TypeSpecificRepoTester interface {
TestAccess(repository *api.Repository) error
}