gardener

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Args

type Args struct {
	ShootName      string
	ShootNamespace string
}

Args are Gardener Provider specific arguments.

type CreateOption

type CreateOption func(*Provider)

CreateOption is a function that acts on a Provider and is used to construct such objects.

func WithArgs

func WithArgs(args Args) CreateOption

WithArgs sets the arguments of a Provider.

func WithID

func WithID(id string) CreateOption

WithID sets the id 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 WithName

func WithName(name string) CreateOption

WithName sets the name 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 {
	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 New

func New(options ...CreateOption) (*Provider, error)

New creates a new Provider.

func (*Provider) AddRulesets

func (p *Provider) AddRulesets(rulesets ...ruleset.Ruleset) error

AddRulesets adds Rulesets to Provider.

func (*Provider) ID

func (p *Provider) ID() string

ID returns the id of the Provider.

func (*Provider) Logger

func (p *Provider) Logger() *slog.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) Metadata

func (p *Provider) Metadata() map[string]string

Metadata returns the metadata of the Provider.

func (*Provider) Name

func (p *Provider) Name() string

Name returns the name of the Provider.

func (*Provider) RunAll

RunAll executes all Rulesets registered with the Provider.

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.

Directories

Path Synopsis
ruleset

Jump to

Keyboard shortcuts

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