Documentation ¶
Index ¶
- type 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 WithGardenConfig ¶
func WithGardenConfig(config *rest.Config) CreateOption
WithGardenConfig sets the SeedConfig 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 WithRuntimeConfig ¶
func WithRuntimeConfig(config *rest.Config) CreateOption
WithRuntimeConfig sets the ShootConfig of a Provider.
type Provider ¶
type Provider struct {
RuntimeConfig, GardenConfig *rest.Config
// contains filtered or unexported fields
}
Provider is a Garden Cluster Provider that can be used to implement rules against a virtual garden cluster and its controlplane (residing in a runtime 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.