Documentation ¶
Index ¶
- Variables
- func CompareMaps(m, n map[string]string) bool
- func DeleteActiveContextRecord(ctx context.Context, acID string) (bool, error)
- func DeleteAppContextData(key string) error
- func GetAllActiveContext(ctx context.Context) ([]string, error)
- func GetAppContextStatus(ctx context.Context, cid interface{}, key string) (string, error)
- func HandleAppContext(ctx context.Context, a interface{}, ucid interface{}, e RsyncEvent, ...) error
- func LoadMap(str string) map[string]string
- func RecordActiveContext(ctx context.Context, acID string) (bool, error)
- func RestartAppContext(ctx context.Context, a interface{}, con Connector) error
- func RestoreActiveContext(ctx context.Context) error
- func ScheduleDeleteStatusTracker(ctx context.Context, acID, app, cluster, level, namespace string, ...) *time.Timer
- func UpdateAppContextFlag(ctx context.Context, cid interface{}, key string, b bool) error
- type AppContextData
- type AppContextQueueUtils
- func (aq *AppContextQueueUtils) CreateQueue(ctx context.Context, qElement types.AppContextQueueElement) (bool, error)
- func (aq *AppContextQueueUtils) Enqueue(ctx context.Context, qElement types.AppContextQueueElement) (bool, error)
- func (aq *AppContextQueueUtils) FindFirstPending(ctx context.Context) (int, types.AppContextQueueElement)
- func (aq *AppContextQueueUtils) GetAppContextQueue(ctx context.Context) (types.AppContextQueue, error)
- func (aq *AppContextQueueUtils) GetAppContextQueueLength(ctx context.Context) (int, error)
- func (aq *AppContextQueueUtils) GetAppContextQueuePeek(ctx context.Context) (types.AppContextQueueElement, error)
- func (aq *AppContextQueueUtils) UpdateQueue(ctx context.Context, q []types.AppContextQueueElement) (bool, error)
- func (aq *AppContextQueueUtils) UpdateStatus(ctx context.Context, index int, status string) error
- type CompositeAppContext
- func (instca *CompositeAppContext) InstantiateComApp(ctx context.Context, cid interface{}) error
- func (instca *CompositeAppContext) ReadComApp(ctx context.Context, cid interface{}) error
- func (instca *CompositeAppContext) TerminateComApp(ctx context.Context, cid interface{}) error
- func (instca *CompositeAppContext) UpdateComApp(ctx context.Context, cid interface{}, ucid interface{}) error
- type Context
- func (c *Context) EnqueueToAppContext(ctx context.Context, a interface{}, ucid interface{}, e RsyncEvent) error
- func (c *Context) StopDeleteStatusCRTimer(key string)
- func (c *Context) UpdateDeleteStatusCRTimer(key string, timer *time.Timer)
- func (c *Context) UpdateQStatus(ctx context.Context, index int, status string) error
- type Match
- type MockClient
- func (m *MockClient) AddLabel(res []byte, l map[string]string) ([]byte, error)
- func (m *MockClient) Apply(ctx context.Context, name string, ref interface{}, content []byte) (interface{}, error)
- func (m *MockClient) ApplyConfig(ctx context.Context, config interface{}) error
- func (m *MockClient) ApplyStatusCR(ctx context.Context, name string, content []byte) error
- func (m *MockClient) CleanClientProvider() error
- func (m *MockClient) Commit(ctx context.Context, ref interface{}) error
- func (m *MockClient) Create(name string, ref interface{}, content []byte) (interface{}, error)
- func (m *MockClient) Delete(name string, ref interface{}, content []byte) (interface{}, error)
- func (m *MockClient) DeleteConfig(ctx context.Context, config interface{}) error
- func (m *MockClient) DeleteStatusCR(ctx context.Context, name string, content []byte) error
- func (m *MockClient) Get(ctx context.Context, name string, gvkRes []byte) ([]byte, error)
- func (m *MockClient) IsReachable() error
- func (m *MockClient) StartClusterWatcher(ctx context.Context) error
- func (m *MockClient) TagResource(res []byte, l map[string]string) ([]byte, error)
- type MockConnector
Constants ¶
This section is empty.
Variables ¶
var HelmHookRelevantKindSet map[string]bool = map[string]bool{"Job": true, "Pod": true, "Deployment": true, "DaemonSet": true, "StatefulSet": true}
Hook Kinds that require wait
Functions ¶
func CompareMaps ¶
func DeleteActiveContextRecord ¶
DeleteActiveContextRecord deletes an active contextID
func DeleteAppContextData ¶
Delete per AppContext thread data
func GetAllActiveContext ¶
GetAllActiveContext shall return all the active contextIDs
func GetAppContextStatus ¶
func HandleAppContext ¶
func HandleAppContext(ctx context.Context, a interface{}, ucid interface{}, e RsyncEvent, con Connector) error
HandleAppContext adds event to queue and starts main thread
func RecordActiveContext ¶
RecordActiveContext shall insert into contextDB a key and value like /activecontext/99999999888/->99999999888. 99999999888 is sample AppcontextID It shall take in activeContextID
func RestartAppContext ¶
RestartAppContext called in Restart scenario to handle an AppContext
func RestoreActiveContext ¶
RestoreActiveContext shall be called everytime the rsync restarts. It makes sure that the AppContexts which were in active state before rsync got cancelled, are restored and queued up again for processing.
Types ¶
type AppContextData ¶
AppContextData struct
type AppContextQueueUtils ¶
type AppContextQueueUtils struct {
// contains filtered or unexported fields
}
func (*AppContextQueueUtils) CreateQueue ¶
func (aq *AppContextQueueUtils) CreateQueue(ctx context.Context, qElement types.AppContextQueueElement) (bool, error)
func (*AppContextQueueUtils) Enqueue ¶
func (aq *AppContextQueueUtils) Enqueue(ctx context.Context, qElement types.AppContextQueueElement) (bool, error)
Enqueue shall append new Q-Elemenet in the string format
func (*AppContextQueueUtils) FindFirstPending ¶
func (aq *AppContextQueueUtils) FindFirstPending(ctx context.Context) (int, types.AppContextQueueElement)
func (*AppContextQueueUtils) GetAppContextQueue ¶
func (aq *AppContextQueueUtils) GetAppContextQueue(ctx context.Context) (types.AppContextQueue, error)
GetAppContextQueue shall return the AppContextQueue
func (*AppContextQueueUtils) GetAppContextQueueLength ¶
func (aq *AppContextQueueUtils) GetAppContextQueueLength(ctx context.Context) (int, error)
GetAppContextQueueLength shall return the length of the AppContextQueue
func (*AppContextQueueUtils) GetAppContextQueuePeek ¶
func (aq *AppContextQueueUtils) GetAppContextQueuePeek(ctx context.Context) (types.AppContextQueueElement, error)
GetAppContextQueuePeek shall return the String value at the peak of the AppContextQueue
func (*AppContextQueueUtils) UpdateQueue ¶
func (aq *AppContextQueueUtils) UpdateQueue(ctx context.Context, q []types.AppContextQueueElement) (bool, error)
func (*AppContextQueueUtils) UpdateStatus ¶
type CompositeAppContext ¶
type CompositeAppContext struct {
// contains filtered or unexported fields
}
CompositeAppContext represents composite app
func (*CompositeAppContext) InstantiateComApp ¶
func (instca *CompositeAppContext) InstantiateComApp(ctx context.Context, cid interface{}) error
InstantiateComApp Instantiatep Aps in Composite App
func (*CompositeAppContext) ReadComApp ¶
func (instca *CompositeAppContext) ReadComApp(ctx context.Context, cid interface{}) error
ReadComApp Reads resources in AppContext
func (*CompositeAppContext) TerminateComApp ¶
func (instca *CompositeAppContext) TerminateComApp(ctx context.Context, cid interface{}) error
TerminateComApp Terminates Apps in Composite App
func (*CompositeAppContext) UpdateComApp ¶
func (instca *CompositeAppContext) UpdateComApp(ctx context.Context, cid interface{}, ucid interface{}) error
UpdateComApp Updates Apps in Composite App
type Context ¶
type Context struct { Lock *sync.Mutex Running bool Channel chan RsyncEvent // contains filtered or unexported fields }
Context is Per AppContext struct
func CreateAppContextData ¶
Create per AppContext thread data
func (*Context) EnqueueToAppContext ¶
func (c *Context) EnqueueToAppContext(ctx context.Context, a interface{}, ucid interface{}, e RsyncEvent) error
EnqueueToAppContext adds the event to the appContext Queue
func (*Context) StopDeleteStatusCRTimer ¶
func (*Context) UpdateDeleteStatusCRTimer ¶
type Match ¶
type Match struct { // Collects all resources that are deleted DeleteMatchList sync.Map // Collects all resources that are applied ApplyMatchList sync.Map // Collects all resources that are currently applied on the cluster ResourceList sync.Map // Resources committed CommitList sync.Map }
Match stores information about resources applied in clusters
var MatchList Match
MatchList to collect resources
type MockClient ¶
type MockClient struct {
// contains filtered or unexported fields
}
MockClient mocks client
func (*MockClient) Apply ¶
func (m *MockClient) Apply(ctx context.Context, name string, ref interface{}, content []byte) (interface{}, error)
Apply Collects resources applied to cluster
func (*MockClient) ApplyConfig ¶
func (m *MockClient) ApplyConfig(ctx context.Context, config interface{}) error
func (*MockClient) ApplyStatusCR ¶
func (*MockClient) CleanClientProvider ¶
func (m *MockClient) CleanClientProvider() error
func (*MockClient) Create ¶
func (m *MockClient) Create(name string, ref interface{}, content []byte) (interface{}, error)
func (*MockClient) Delete ¶
func (m *MockClient) Delete(name string, ref interface{}, content []byte) (interface{}, error)
Delete Collects resources deleted from cluster
func (*MockClient) DeleteConfig ¶
func (m *MockClient) DeleteConfig(ctx context.Context, config interface{}) error
func (*MockClient) DeleteStatusCR ¶
func (*MockClient) IsReachable ¶
func (m *MockClient) IsReachable() error
func (*MockClient) StartClusterWatcher ¶
func (m *MockClient) StartClusterWatcher(ctx context.Context) error
func (*MockClient) TagResource ¶
type MockConnector ¶
type MockConnector struct { sync.Mutex Clients *sync.Map // contains filtered or unexported fields }
MockConnector mocks connector interface
func NewProvider ¶
func NewProvider(id interface{}) MockConnector
func (*MockConnector) GetClientProviders ¶
func (c *MockConnector) GetClientProviders(ctx context.Context, app, cluster, level, namespace string) (ClientProvider, error)