Documentation ¶
Overview ¶
Package store provides a store use to manage deployment dependencies.
Index ¶
- type Store
- func (ds *Store) AddOrUpdate(kind kubernetes.ObjectKind, obj client.Object) error
- func (ds *Store) AddOrUpdateStore(kind kubernetes.ObjectKind, obj client.Object) *Store
- func (ds *Store) Apply(ctx context.Context, k8sClient client.Client) []error
- func (ds *Store) Cleanup(ctx context.Context, k8sClient client.Client) []error
- func (ds *Store) Delete(kind kubernetes.ObjectKind, namespace string, name string) bool
- func (ds *Store) DeleteAll(ctx context.Context, k8sClient client.Client) []error
- func (ds *Store) Get(kind kubernetes.ObjectKind, namespace string, name string) (client.Object, bool)
- func (ds *Store) GetOrCreate(kind kubernetes.ObjectKind, namespace, name string) (client.Object, bool)
- func (ds *Store) GetPlatformInfo() kubernetes.PlatformInfo
- func (ds *Store) Logger() logr.Logger
- type StoreClient
- type StoreOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store Kubernetes resource dependencies store this store helps to keep track of every resources that the different agent deployments depend on.
func NewStore ¶
func NewStore(owner metav1.Object, options *StoreOptions) *Store
NewStore returns a new Store instance
func (*Store) AddOrUpdate ¶
func (ds *Store) AddOrUpdate(kind kubernetes.ObjectKind, obj client.Object) error
AddOrUpdate used to add or update an object in the Store kind correspond to the object kind, and id can be `namespace/name` identifier of just `name` if we are talking about a cluster scope object like `ClusterRole`.
func (*Store) AddOrUpdateStore ¶
func (ds *Store) AddOrUpdateStore(kind kubernetes.ObjectKind, obj client.Object) *Store
AddOrUpdateStore used to add or update an object in the Store kind correspond to the object kind, and id can be `namespace/name` identifier of just `name` if we are talking about a cluster scope object like `ClusterRole`.
func (*Store) Delete ¶
func (ds *Store) Delete(kind kubernetes.ObjectKind, namespace string, name string) bool
Delete deletes an item from the store by kind, namespace and name.
func (*Store) Get ¶
func (ds *Store) Get(kind kubernetes.ObjectKind, namespace string, name string) (client.Object, bool)
Get returns the client.Object instance if it was previously added in the Store. kind correspond to the object kind, and id can be `namespace/name` identifier of just `name` if we are talking about a cluster scope object like `ClusterRole`. It also return a boolean to know if the Object was found in the Store.
func (*Store) GetOrCreate ¶
func (ds *Store) GetOrCreate(kind kubernetes.ObjectKind, namespace, name string) (client.Object, bool)
GetOrCreate returns the client.Object instance.
- if it was previously added in the Store, it returns the corresponding object
- if it wasn't previously added in the Store, it returns a new instance of the object Kind with the corresponding name and namespace.
`kind“ correspond to the object kind, and id can be `namespace/name` identifier of just `name` if we are talking about a cluster scope object like `ClusterRole`. It also return a boolean to know if the Object was found in the Store.
func (*Store) GetPlatformInfo ¶
func (ds *Store) GetPlatformInfo() kubernetes.PlatformInfo
GetPlatformInfo returns api-resources info
type StoreClient ¶
type StoreClient interface { AddOrUpdate(kind kubernetes.ObjectKind, obj client.Object) error Get(kind kubernetes.ObjectKind, namespace, name string) (client.Object, bool) GetOrCreate(kind kubernetes.ObjectKind, namespace, name string) (client.Object, bool) GetPlatformInfo() kubernetes.PlatformInfo Delete(kind kubernetes.ObjectKind, namespace string, name string) bool DeleteAll(ctx context.Context, k8sClient client.Client) []error Logger() logr.Logger }
StoreClient dependencies store client interface
type StoreOptions ¶
type StoreOptions struct { SupportCilium bool PlatformInfo kubernetes.PlatformInfo Scheme *runtime.Scheme Logger logr.Logger }
StoreOptions use to provide to NewStore() function some Store creation options.