server

package
v0.29.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2023 License: MPL-2.0 Imports: 63 Imported by: 1

Documentation

Index

Constants

View Source
const (
	DefaultCluster = "Default"
)
View Source
const DefaultValidationType = "Admission"
View Source
const (
	FluxNamespacePartOf = "flux"
)

Variables

View Source
var (
	KustomizeNameKey      = fmt.Sprintf("%s/name", kustomizev1.GroupVersion.Group)
	KustomizeNamespaceKey = fmt.Sprintf("%s/namespace", kustomizev1.GroupVersion.Group)
	HelmNameKey           = fmt.Sprintf("%s/name", helmv2.GroupVersion.Group)
	HelmNamespaceKey      = fmt.Sprintf("%s/namespace", helmv2.GroupVersion.Group)

	// ErrFluxNamespaceNotFound no flux namespace found
	ErrFluxNamespaceNotFound = errors.New("could not find flux namespace in cluster")
	// ErrListingDeployments no deployments found
	ErrListingDeployments = errors.New("could not list deployments in namespace")

	DefaultFluxNamespace = lookupEnv("WEAVE_GITOPS_FALLBACK_NAMESPACE", "flux-system")
)
View Source
var (
	Version   = "v0.0.0"
	GitCommit = ""
	Branch    = ""
	Buildtime = ""
)

Variables that we'll set @ build time

Functions

func ExtractStringValueFromMap added in v0.25.0

func ExtractStringValueFromMap(mapName map[string]string, key string) string

ExtractValueFromMap gets string value from map or empty string if the value is empty

func GetTenant added in v0.9.4

func GetTenant(namespace, clusterName string, clusterUserNamespaces map[string][]v1.Namespace) string

func Hydrate

func Hydrate(ctx context.Context, mux *runtime.ServeMux, cfg CoreServerConfig) error

func NewCoreServer

func NewCoreServer(cfg CoreServerConfig) (pb.CoreServer, error)

Types

type CoreServerConfig

type CoreServerConfig struct {
	RestCfg *rest.Config

	NSAccess        nsaccess.Checker
	ClustersManager clustersmngr.ClustersManager
	PrimaryKinds    *PrimaryKinds
	CRDService      crd.Fetcher
	HealthChecker   health.HealthChecker
	// contains filtered or unexported fields
}

func NewCoreConfig

func NewCoreConfig(log logr.Logger, cfg *rest.Config, clusterName string, clustersManager clustersmngr.ClustersManager, healthChecker health.HealthChecker) (CoreServerConfig, error)

type KnownTypes added in v0.29.0

type KnownTypes interface {
	AllKnownTypes() map[schema.GroupVersionKind]reflect.Type
}

type PodLog added in v0.17.0

type PodLog struct {
	Date       time.Time `json:"date"`
	Time       time.Time `json:"time"`
	Log        string    `json:"log"`
	Msg        string    `json:"msg"`
	Level      string    `json:"level"`
	Kubernetes struct {
		PodName        string            `json:"pod_name"`
		NamespaceName  string            `json:"namespace_name"`
		PodID          string            `json:"pod_id"`
		Labels         map[string]string `json:"labels"`
		Annotations    map[string]string `json:"annotations"`
		Host           string            `json:"host"`
		ContainerName  string            `json:"container_name"`
		DockerID       string            `json:"docker_id"`
		ContainerHash  string            `json:"container_hash"`
		ContainerImage string            `json:"container_image"`
	} `json:"kubernetes"`
}

type PrimaryKinds added in v0.9.1

type PrimaryKinds struct {
	// contains filtered or unexported fields
}

func DefaultPrimaryKinds added in v0.9.1

func DefaultPrimaryKinds() (*PrimaryKinds, error)

DefaultPrimaryKinds generates a new PrimaryKinds object which contains the highest version of each kind of known types from a Kubernetes scheme. It returns the PrimaryKinds object and any error that occurred.

func New added in v0.9.1

func New() *PrimaryKinds

func (*PrimaryKinds) Add added in v0.9.1

func (pk *PrimaryKinds) Add(kind string, gvk schema.GroupVersionKind) error

Add sets another kind name and gvk to resolve an object. This function returns an error if the kind is already set, as this likely indicates 2 different uses for the same kind string.

func (*PrimaryKinds) Lookup added in v0.9.1

func (pk *PrimaryKinds) Lookup(kind string) (*schema.GroupVersionKind, error)

Lookup ensures that a kind name is known, white-listed, and returns the full GVK for that kind

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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