config

package
v0.6.0-alpha2 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ManagerConfigName        = "fleet-controller"
	AgentConfigName          = "fleet-agent"
	AgentBootstrapConfigName = "fleet-agent-bootstrap"
	Key                      = "config"

	// DefaultNamespace is the default for the system namespace, which
	// contains the manager and agent
	DefaultNamespace = "cattle-fleet-system"
)

Variables

View Source
var (
	DefaultManagerImage        = "rancher/fleet" + ":" + version.Version
	DefaultAgentImage          = "rancher/fleet-agent" + ":" + version.Version
	DefaultAgentSimulatorImage = "rancher/fleet-agent-simulator" + ":" + version.Version
)

Functions

func Exists

func Exists(_ context.Context, namespace, name string, configMaps corev1.ConfigMapClient) (bool, error)

func OnChange

func OnChange(ctx context.Context, f func(*Config) error)

func Set

func Set(cfg *Config) error

func ToConfigMap

func ToConfigMap(namespace, name string, cfg *Config) (*v1.ConfigMap, error)

Types

type Bootstrap added in v0.3.0

type Bootstrap struct {
	Namespace      string `json:"namespace,omitempty"`
	AgentNamespace string `json:"agentNamespace,omitempty"`
	Repo           string `json:"repo,omitempty"`
	Secret         string `json:"secret,omitempty"` // gitrepo.ClientSecretName for agent from repo
	Paths          string `json:"paths,omitempty"`
	Branch         string `json:"branch,omitempty"`
}

type Config

type Config struct {
	AgentImage                      string            `json:"agentImage,omitempty"`
	AgentImagePullPolicy            string            `json:"agentImagePullPolicy,omitempty"`
	SystemDefaultRegistry           string            `json:"systemDefaultRegistry,omitempty"`
	AgentCheckinInterval            metav1.Duration   `json:"agentCheckinInterval,omitempty"`
	ManageAgent                     *bool             `json:"manageAgent,omitempty"`
	Labels                          map[string]string `json:"labels,omitempty"`
	ClientID                        string            `json:"clientID,omitempty"`
	APIServerURL                    string            `json:"apiServerURL,omitempty"`
	APIServerCA                     []byte            `json:"apiServerCA,omitempty"`
	Bootstrap                       Bootstrap         `json:"bootstrap,omitempty"`
	IgnoreClusterRegistrationLabels bool              `json:"ignoreClusterRegistrationLabels,omitempty"`
}

func DefaultConfig

func DefaultConfig() *Config

func Get

func Get() *Config

func Lookup

func Lookup(_ context.Context, namespace, name string, configMaps corev1.ConfigMapClient) (*Config, error)

func ReadConfig

func ReadConfig(cm *v1.ConfigMap) (*Config, error)

Jump to

Keyboard shortcuts

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