config

package
v0.4.4 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SaveToFile

func SaveToFile(config *Config, filename string) error

Types

type Config

type Config struct {
	Organization string             `yaml:"organization"`
	Teams        []TeamConfig       `yaml:"teams,omitempty"`
	Repositories []RepositoryConfig `yaml:"repositories,omitempty"`
	Robots       []RobotConfig      `yaml:"robots,omitempty"`
}

func LoadFromFile

func LoadFromFile(filename string) (*Config, error)

func (*Config) GetRepositoryConfig

func (c *Config) GetRepositoryConfig(repo string) *RepositoryConfig

func (*Config) Validate

func (c *Config) Validate(ctx context.Context, client *quay.Client) error

type RepositoryConfig

type RepositoryConfig struct {
	Name        string                         `yaml:"name"`
	Visibility  quay.RepositoryVisibility      `yaml:"visibility"`
	Description string                         `yaml:"description,omitempty"`
	Teams       map[string]quay.RepositoryRole `yaml:"teams,omitempty"`
	Users       map[string]quay.RepositoryRole `yaml:"users,omitempty"`
}

func (*RepositoryConfig) IsWildcard added in v0.2.0

func (c *RepositoryConfig) IsWildcard() bool

type RobotConfig

type RobotConfig struct {
	Name        string `yaml:"name"`
	Description string `yaml:"description,omitempty"`

	// VaultSecret is the path inside the Vault API to the
	// secret where the token should be stored, for example
	// "mykvstore/data/customer-xyz" (note the "/data/" bit).
	// Aquayman will extend the secret with a
	// "quay.io-<orgname>-token" and a "quay.io-<orgname>-secret" keys
	// and store the token / a full docker config JSON there.
	// If this is empty, no Vault interaction happens, even
	// if -enable-vault is set.
	// The value can include an optional key name to override
	// the default. Use a "#" to separate path from key, e.g.
	// "mykvstore/data/customer-xyz#keyname". Aquayman will still
	// append "-token" and "-secret" to the custom keyname.
	VaultSecret string `yaml:"vaultSecret,omitempty"`

	// Deleted can be used as a workaround for deleting tokens
	// from Vault. If a robot was just removed from the config.yaml
	// alltogether, Aquayman would have no idea where to find the
	// secret in Vault in order to delete it (because the path in
	// Vault is not just constructed based on the robot name, but
	// based on the VaultSecret property).
	// If a clean cleanup is desired, one can first set this field
	// to `true` and run Aquayman, which will remove the robot
	// from quay and also remove the token from Vault. Afterwards,
	// the robot can be removed entirely from the configuration.
	// If a robot is directly removed from the configuration,
	// an orphaned (yet invalid) token will remain in Vault. Not
	// nice, but not the end of the world.
	Deleted bool `yaml:"deleted,omitempty"`
}

type TeamConfig

type TeamConfig struct {
	Name        string        `yaml:"name"`
	Role        quay.TeamRole `yaml:"role"`
	Description string        `yaml:"description,omitempty"`
	Members     []string      `yaml:"members,omitempty"`
}

Jump to

Keyboard shortcuts

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