name

package
v1.23.3 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CRDStr                            = "CustomResourceDefinition"
	ClusterRoleStr                    = "ClusterRole"
	ClusterRoleBindingStr             = "ClusterRoleBinding"
	CMStr                             = "ConfigMap"
	DaemonSetStr                      = "DaemonSet"
	DeploymentStr                     = "Deployment"
	EndpointStr                       = "Endpoints"
	HPAStr                            = "HorizontalPodAutoscaler"
	IstioOperator                     = "IstioOperator"
	MutatingWebhookConfigurationStr   = "MutatingWebhookConfiguration"
	NamespaceStr                      = "Namespace"
	NetworkAttachmentDefinitionStr    = "NetworkAttachmentDefinition"
	PodStr                            = "Pod"
	PDBStr                            = "PodDisruptionBudget"
	ReplicaSetStr                     = "ReplicaSet"
	RoleStr                           = "Role"
	RoleBindingStr                    = "RoleBinding"
	SAStr                             = "ServiceAccount"
	ServiceStr                        = "Service"
	SecretStr                         = "Secret"
	StatefulSetStr                    = "StatefulSet"
	ValidatingWebhookConfigurationStr = "ValidatingWebhookConfiguration"
)

Kubernetes Kind strings.

View Source
const (
	// IstioOperatorStr is the kind name of the IstioOperator CRD.
	IstioOperatorStr = "IstioOperator"

	// OperatorAPINamespace is the API namespace for operator config.
	// TODO: move this to a base definitions file when one is created.
	OperatorAPINamespace = "operator.istio.io"

	// DefaultProfileName is the name of the default profile.
	DefaultProfileName = "default"
)

Variables

View Source
var (
	AllCoreComponentNames = []ComponentName{
		IstioBaseComponentName,
		PilotComponentName,
		CNIComponentName,
		IstiodRemoteComponentName,
		ZtunnelComponentName,
	}

	// AllComponentNames is a list of all Istio components.
	AllComponentNames = append(AllCoreComponentNames, IngressComponentName, EgressComponentName,
		IstioOperatorComponentName, IstioOperatorCustomResourceName)

	// ValuesEnablementPathMap defines a mapping between legacy values enablement paths and the corresponding enablement
	// paths in IstioOperator.
	ValuesEnablementPathMap = map[string]string{
		"spec.values.gateways.istio-ingressgateway.enabled": "spec.components.ingressGateways.[name:istio-ingressgateway].enabled",
		"spec.values.gateways.istio-egressgateway.enabled":  "spec.components.egressGateways.[name:istio-egressgateway].enabled",
	}
)
View Source
var IstioComponentIcons = map[ComponentName]string{
	IstioBaseComponentName: "⛵️",
	PilotComponentName:     "🧠",
	CNIComponentName:       "🪢",
	ZtunnelComponentName:   "🔒",
	IngressComponentName:   "🛬",
	EgressComponentName:    "🛫",
}

Functions

func MergeManifestSlices

func MergeManifestSlices(manifests []string) string

MergeManifestSlices merges a slice of manifests into a single manifest string.

func Namespace

func Namespace(componentName ComponentName, controlPlaneSpec *v1alpha1.IstioOperatorSpec) (string, error)

Namespace returns the namespace for the component. It follows these rules: 1. If DefaultNamespace is unset, log and error and return the empty string. 2. If the feature and component namespaces are unset, return DefaultNamespace. 3. If the feature namespace is set but component name is unset, return the feature namespace. 4. Otherwise return the component namespace. Namespace assumes that controlPlaneSpec has been validated. TODO: remove extra validations when comfort level is high enough.

func UserFacingComponentName

func UserFacingComponentName(name ComponentName) string

UserFacingComponentName returns the name of the given component that should be displayed to the user in high level CLIs (like progress log).

Types

type ComponentName

type ComponentName string

ComponentName is a component name string, typed to constrain allowed values.

const (
	// IstioComponent names corresponding to the IstioOperator proto component names. Must be the same, since these
	// are used for struct traversal.
	IstioBaseComponentName ComponentName = "Base"
	PilotComponentName     ComponentName = "Pilot"

	CNIComponentName     ComponentName = "Cni"
	ZtunnelComponentName ComponentName = "Ztunnel"

	// istiod remote component
	IstiodRemoteComponentName ComponentName = "IstiodRemote"

	// Gateway components
	IngressComponentName ComponentName = "IngressGateways"
	EgressComponentName  ComponentName = "EgressGateways"

	// Operator components
	IstioOperatorComponentName      ComponentName = "IstioOperator"
	IstioOperatorCustomResourceName ComponentName = "IstioOperatorCustomResource"
)

func TitleCase

func TitleCase(n ComponentName) ComponentName

TitleCase returns a capitalized version of n.

func (ComponentName) IsGateway

func (cn ComponentName) IsGateway() bool

IsGateway reports whether cn is a gateway component.

type ComponentNamesConfig

type ComponentNamesConfig struct {
	DeprecatedComponentNames []string
}

ComponentNamesConfig is used for unmarshaling legacy and addon naming data.

type Manifest

type Manifest struct {
	Name    ComponentName
	Content string
}

Manifest defines a manifest for a component.

type ManifestMap

type ManifestMap map[ComponentName][]string

ManifestMap is a map of ComponentName to its manifest string.

func (ManifestMap) Consolidated

func (mm ManifestMap) Consolidated() map[string]string

Consolidated returns a representation of mm where all manifests in the slice under a key are combined into a single manifest.

func (ManifestMap) String

func (mm ManifestMap) String() string

String implements the Stringer interface.

Jump to

Keyboard shortcuts

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