Documentation
¶
Overview ¶
SPDX-FileCopyrightText: (C) 2025 Intel Corporation SPDX-License-Identifier: Apache-2.0
Index ¶
- Variables
- func JsonStringToMap(jsonString string) (map[string]string, error)
- func NewNoopInventoryClient() *noopInventoryClient
- type HostCreated
- type HostDeleted
- type HostEventBase
- type HostUpdated
- type InventoryClient
- func (c *InventoryClient) CloseEvents()
- func (c *InventoryClient) GetHostTrustedCompute(ctx context.Context, tenantId, hostUuid string) (bool, error)
- func (c *InventoryClient) InjectEvent(event *client.WatchEvents)
- func (c *InventoryClient) IsImmutable(ctx context.Context, tenantId, hostUuid string) (bool, error)
- func (c *InventoryClient) WatchHosts(hostEvents chan<- events.Event)
- type Options
- type OptionsBuilder
Constants ¶
This section is empty.
Variables ¶
var ( ErrEmptyHostID = errors.New("host id is empty") ErrEmptyProjectID = errors.New("project id is empty") ErrNilK8sClient = errors.New("k8s client is nil") ErrNilLabels = errors.New("labels are nil") )
var (
GetInventoryClientFunc = client.NewTenantAwareInventoryClient
)
Functions ¶
func NewNoopInventoryClient ¶
func NewNoopInventoryClient() *noopInventoryClient
NewNoopInventoryClient returns a new no-op InventoryClient
Types ¶
type HostCreated ¶
type HostCreated struct {
HostEventBase
}
HostCreated is an event triggered when a host is created in the Inventory
type HostDeleted ¶
type HostDeleted struct {
HostEventBase
}
HostDeleted is an event triggered when a host is deleted in the Inventory
type HostEventBase ¶
HostEventBase contains common fields for all host events
type HostUpdated ¶
type HostUpdated struct {
HostEventBase
Labels map[string]string
K8scli k8s.K8sWrapperClient
}
HostUpdated is an event triggered when a host is updated in the Inventory
type InventoryClient ¶
type InventoryClient struct {
// contains filtered or unexported fields
}
InventoryClient is a tenant-aware grpc client for the inventory service
func NewInventoryClientWithOptions ¶
func NewInventoryClientWithOptions(opt Options) (*InventoryClient, error)
NewInventoryClientWithOptions gets or creates a singleton inventory client with the given options
func NewTestInventoryClient ¶
func NewTestInventoryClient(k8sClient k8s.K8sWrapperClient, tenantClient client.TenantAwareInventoryClient) *InventoryClient
NewTestInventoryClient creates an inventory client for testing with injectable dependencies
func (*InventoryClient) CloseEvents ¶
func (c *InventoryClient) CloseEvents()
CloseEvents closes the events channel to stop watching
func (*InventoryClient) GetHostTrustedCompute ¶
func (c *InventoryClient) GetHostTrustedCompute(ctx context.Context, tenantId, hostUuid string) (bool, error)
GetHostTrustedCompute returns true if the host has secure boot and full disk encryption enabled
func (*InventoryClient) InjectEvent ¶
func (c *InventoryClient) InjectEvent(event *client.WatchEvents)
InjectEvent injects a test event into the inventory client's events channel
func (*InventoryClient) IsImmutable ¶
EnableAirGapInstall returns true if the host OS type is immutable (e.g. EMT with pre-installed K8s packages)
func (*InventoryClient) WatchHosts ¶
func (c *InventoryClient) WatchHosts(hostEvents chan<- events.Event)
WatchHosts watches for host resource events and sends them to the given channel
type Options ¶
type Options struct {
// contains filtered or unexported fields
}
func (*Options) InventoryAddress ¶
func (*Options) MetricsEnabled ¶
func (*Options) TracingEnabled ¶
type OptionsBuilder ¶
type OptionsBuilder interface {
WithWaitGroup(wg *sync.WaitGroup) OptionsBuilder
WithInventoryAddress(address string) OptionsBuilder
WithTracing(enableTracing bool) OptionsBuilder
WithMetrics(enableMetrics bool) OptionsBuilder
WithK8sClient(client k8s.K8sWrapperClient) OptionsBuilder
Build() Options
}
func NewOptionsBuilder ¶
func NewOptionsBuilder() OptionsBuilder