Documentation ¶
Index ¶
- type Args
- type CreateOption
- func WithAdditionalOpsPodLabels(labels map[string]string) CreateOption
- func WithArgs(args Args) CreateOption
- func WithID(id string) CreateOption
- func WithLogger(logger *slog.Logger) CreateOption
- func WithMetadata(metadata map[string]string) CreateOption
- func WithName(name string) CreateOption
- func WithSeedConfig(config *rest.Config) CreateOption
- func WithShootConfig(config *rest.Config) CreateOption
- type Provider
- func (p *Provider) AddRulesets(rulesets ...ruleset.Ruleset) error
- func (p *Provider) ID() string
- func (p *Provider) Logger() *slog.Logger
- func (p *Provider) Metadata() map[string]string
- func (p *Provider) Name() string
- func (p *Provider) RunAll(ctx context.Context) (provider.ProviderResult, error)
- func (p *Provider) RunRule(ctx context.Context, rulesetID, rulesetVersion, ruleID string) (rule.RuleResult, error)
- func (p *Provider) RunRuleset(ctx context.Context, rulesetID, rulesetVersion string) (ruleset.RulesetResult, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CreateOption ¶
type CreateOption func(*Provider)
CreateOption is a function that acts on a Provider and is used to construct such objects.
func WithAdditionalOpsPodLabels ¶ added in v0.8.0
func WithAdditionalOpsPodLabels(labels map[string]string) CreateOption
WithAdditionalOpsPodLabels sets the AdditionalOpsPodLabels of a Provider.
func WithLogger ¶
func WithLogger(logger *slog.Logger) CreateOption
WithLogger sets the logger of a Provider.
func WithMetadata ¶
func WithMetadata(metadata map[string]string) CreateOption
WithMetadata sets the metadata of a Provider.
func WithSeedConfig ¶
func WithSeedConfig(config *rest.Config) CreateOption
WithSeedConfig sets the SeedConfig of a Provider.
func WithShootConfig ¶
func WithShootConfig(config *rest.Config) CreateOption
WithShootConfig sets the ShootConfig of a Provider.
type Provider ¶
type Provider struct { AdditionalOpsPodLabels map[string]string ShootConfig, SeedConfig *rest.Config Args Args // contains filtered or unexported fields }
Provider is a Gardener Provider that can be used to implement rules against a shoot cluster and its controlplane (residing in a seed cluster).
func FromGenericConfig ¶
func FromGenericConfig(providerConf config.ProviderConfig) (*Provider, error)
FromGenericConfig creates a Provider from ProviderConfig.
func (*Provider) AddRulesets ¶
AddRulesets adds Rulesets to Provider.
func (*Provider) Logger ¶
Logger returns the Provider's logger. If not set it set it to slog.Default().With("provider", p.ID()) then return it.
func (*Provider) RunRule ¶
func (p *Provider) RunRule(ctx context.Context, rulesetID, rulesetVersion, ruleID string) (rule.RuleResult, error)
RunRule executes specific Rule of a known Ruleset.
func (*Provider) RunRuleset ¶
func (p *Provider) RunRuleset(ctx context.Context, rulesetID, rulesetVersion string) (ruleset.RulesetResult, error)
RunRuleset executes all Rules of a known Ruleset.