config

package
v0.0.0-...-e32ee76 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 28, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Alerting

type Alerting struct {
	Disabled bool
}

Alerting is a helper type for configuring Insights alerting options

func (*Alerting) String

func (a *Alerting) String() string

type AlertingSerialized

type AlertingSerialized struct {
	Disabled string `json:"disabled,omitempty"`
}

type ClusterTransfer

type ClusterTransfer struct {
	Interval time.Duration
	Endpoint string
}

ClusterTransfer is a helper type for configuring Insights cluster transfer (ownership) feature

func (*ClusterTransfer) String

func (c *ClusterTransfer) String() string

type ClusterTransferSerialized

type ClusterTransferSerialized struct {
	Interval string `json:"interval,omitempty"`
	Endpoint string `json:"endpoint,omitempty"`
}

type Controller

type Controller struct {
	Report                      bool
	StoragePath                 string
	Interval                    time.Duration
	Endpoint                    string
	ConditionalGathererEndpoint string
	ReportEndpoint              string
	ReportEndpointTechPreview   string
	ReportPullingDelay          time.Duration
	ReportMinRetryTime          time.Duration
	ReportPullingTimeout        time.Duration
	Impersonate                 string
	// EnableGlobalObfuscation enables obfuscation of domain names and IP addresses
	// To see the detailed info about how anonymization works, go to the docs of package anonymization.
	EnableGlobalObfuscation bool

	Token string

	HTTPConfig HTTPConfig
	OCMConfig  OCMConfig

	// DisableInsightsAlerts disabled exposing of Insights recommendations as Prometheus info alerts
	DisableInsightsAlerts    bool
	ProcessingStatusEndpoint string
}

Controller defines the standard config for this operator.

func LoadConfig

func LoadConfig(controller Controller, obj map[string]interface{}, converter Converter) (Controller, error)

LoadConfig unmarshalls config from obj and loads it to this Controller struct

func ToController

func ToController(s *Serialized, cfg *Controller) (*Controller, error)

ToController creates/updates a config Controller according to the Serialized config. Makes sure that the config is correct.

func ToDisconnectedController

func ToDisconnectedController(s *Serialized, cfg *Controller) (*Controller, error)

ToDisconnectedController creates/updates a config Controller according to the Serialized config. Makes sure that the config is correct, but only checks fields necessary for disconnected operation.

func (*Controller) MergeWith

func (c *Controller) MergeWith(cfg *Controller)

func (*Controller) ToString

func (c *Controller) ToString() string

ToString returns the important fields of the config in a string form

type Converter

type Converter func(s *Serialized, cfg *Controller) (*Controller, error)

type DataReporting

type DataReporting struct {
	Enabled                     bool
	Interval                    time.Duration
	UploadEndpoint              string
	DownloadEndpoint            string
	DownloadEndpointTechPreview string
	StoragePath                 string
	ConditionalGathererEndpoint string
	ReportPullingDelay          time.Duration
	ProcessingStatusEndpoint    string
	Obfuscation                 Obfuscation
}

DataReporting is a type including all the configuration options related to Insights data gathering, upload of the data and download of the corresponding Insights analysis report.

func (*DataReporting) String

func (d *DataReporting) String() string

type DataReportingSerialized

type DataReportingSerialized struct {
	Interval                    string      `json:"interval,omitempty"`
	UploadEndpoint              string      `json:"uploadEndpoint,omitempty"`
	DownloadEndpoint            string      `json:"downloadEndpoint,omitempty"`
	DownloadEndpointTechPreview string      `json:"downloadEndpointTechPreview,omitempty"`
	StoragePath                 string      `json:"storagePath,omitempty"`
	ConditionalGathererEndpoint string      `json:"conditionalGathererEndpoint,omitempty"`
	ProcessingStatusEndpoint    string      `json:"processingStatusEndpoint,omitempty"`
	Obfuscation                 Obfuscation `json:"obfuscation,omitempty"`
}

type HTTPConfig

type HTTPConfig struct {
	HTTPProxy  string
	HTTPSProxy string
	NoProxy    string
}

HTTPConfig configures http proxy and exception settings if they come from config

type InsightsConfiguration

type InsightsConfiguration struct {
	DataReporting   DataReporting
	Alerting        Alerting
	SCA             SCA
	ClusterTransfer ClusterTransfer
	Proxy           Proxy
}

InsightsConfiguration is a type representing actual Insights Operator configuration options and is used in the code base to make the configuration available.

func (*InsightsConfiguration) String

func (i *InsightsConfiguration) String() string

type InsightsConfigurationSerialized

type InsightsConfigurationSerialized struct {
	DataReporting   DataReportingSerialized   `json:"dataReporting"`
	Alerting        AlertingSerialized        `json:"alerting,omitempty"`
	SCA             SCASerialized             `json:"sca,omitempty"`
	ClusterTransfer ClusterTransferSerialized `json:"clusterTransfer,omitempty"`
	Proxy           ProxySeriazlied           `json:"proxy,omitempty"`
}

InsightsConfigurationSerialized is a type representing Insights Operator configuration values in JSON/YAML and it is when decoding the content of the "insights-config" config map.

func (*InsightsConfigurationSerialized) ToConfig

ToConfig reads and pareses the actual serialized configuration from "InsightsConfigurationSerialized" and returns the "InsightsConfiguration".

type MockAPIConfigurator

type MockAPIConfigurator struct {
	factory.Controller
	// contains filtered or unexported fields
}

func NewMockAPIConfigurator

func NewMockAPIConfigurator(gatherConfig *v1alpha1.GatherConfig) *MockAPIConfigurator

NewMockAPIConfigurator constructs a new NewMockAPIConfigurator with provided GatherConfig values

func (*MockAPIConfigurator) GatherConfig

func (mc *MockAPIConfigurator) GatherConfig() *v1alpha1.GatherConfig

func (*MockAPIConfigurator) GatherDataPolicy

func (mc *MockAPIConfigurator) GatherDataPolicy() *v1alpha1.DataPolicy

func (*MockAPIConfigurator) GatherDisabled

func (mc *MockAPIConfigurator) GatherDisabled() bool

type MockConfigMapConfigurator

type MockConfigMapConfigurator struct {
	factory.Controller
	// contains filtered or unexported fields
}

func NewMockConfigMapConfigurator

func NewMockConfigMapConfigurator(config *InsightsConfiguration) *MockConfigMapConfigurator

func (*MockConfigMapConfigurator) Config

func (*MockConfigMapConfigurator) ConfigChanged

func (m *MockConfigMapConfigurator) ConfigChanged() (configCh <-chan struct{}, closeFn func())

func (*MockConfigMapConfigurator) Listen

type MockSecretConfigurator

type MockSecretConfigurator struct {
	Conf *Controller
}

MockSecretConfigurator returns the config from conf field

func NewMockSecretConfigurator

func NewMockSecretConfigurator(conf *Controller) *MockSecretConfigurator

NewMockSecretConfigurator constructs a new MockConfigurator with default config values

func (*MockSecretConfigurator) Config

func (mc *MockSecretConfigurator) Config() *Controller

func (*MockSecretConfigurator) ConfigChanged

func (mc *MockSecretConfigurator) ConfigChanged() (<-chan struct{}, func())

type OCMConfig

type OCMConfig struct {
	SCAInterval             time.Duration
	SCAEndpoint             string
	SCADisabled             bool
	ClusterTransferEndpoint string
	ClusterTransferInterval time.Duration
}

OCMConfig configures the interval and endpoint for retrieving the data from OCM API

type Obfuscation

type Obfuscation []ObfuscationValue

type ObfuscationValue

type ObfuscationValue string
const (
	Networking    ObfuscationValue = "networking"
	WorkloadNames ObfuscationValue = "workload_names"
)

type Proxy

type Proxy struct {
	HTTPProxy  string
	HTTPSProxy string
	NoProxy    string
}

Proxy is a helper type for configuring connection proxy

func (*Proxy) String

func (p *Proxy) String() string

type ProxySeriazlied

type ProxySeriazlied struct {
	HTTPProxy  string `json:"httpProxy,omitempty"`
	HTTPSProxy string `json:"httpsProxy,omitempty"`
	NoProxy    string `json:"noProxy,omitempty"`
}

type SCA

type SCA struct {
	Disabled bool
	Interval time.Duration
	Endpoint string
}

SCA is a helper type for configuring periodical download/check of the SimpleContentAcccess entitlements

func (*SCA) String

func (s *SCA) String() string

type SCASerialized

type SCASerialized struct {
	Disabled string `json:"disabled,omitempty"`
	Interval string `json:"interval,omitempty"`
	Endpoint string `json:"endpoint,omitempty"`
}

type Serialized

type Serialized struct {
	Report                      bool   `json:"report"`
	StoragePath                 string `json:"storagePath"`
	Interval                    string `json:"interval"`
	Endpoint                    string `json:"endpoint"`
	ConditionalGathererEndpoint string `json:"conditionalGathererEndpoint"`
	PullReport                  struct {
		Endpoint     string `json:"endpoint"`
		Delay        string `json:"delay"`
		Timeout      string `json:"timeout"`
		MinRetryTime string `json:"min_retry"`
	} `json:"pull_report"`
	Impersonate             string `json:"impersonate"`
	EnableGlobalObfuscation bool   `json:"enableGlobalObfuscation"`
	OCM                     struct {
		SCAEndpoint             string `json:"scaEndpoint"`
		SCAInterval             string `json:"scaInterval"`
		SCADisabled             bool   `json:"scaDisabled"`
		ClusterTransferEndpoint string `json:"clusterTransferEndpoint"`
		ClusterTransferInterval string `json:"clusterTransferInterval"`
	} `json:"ocm"`
	DisableInsightsAlerts     bool   `json:"disableInsightsAlerts"`
	ProcessingStatusEndpoint  string `json:"processingStatusEndpoint"`
	ReportEndpointTechPreview string `json:"reportEndpointTechPreview"`
}

Serialized defines the standard config for this operator.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL