versions

package
v0.0.0-...-b4381ef Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	DiscoveryChart       = "istio-discovery"
	GatewayEgressChart   = "istio-egress"
	GatewayIngressChart  = "istio-ingress"
	GrafanaChart         = "grafana"
	KialiChart           = "kiali"
	MeshConfigChart      = "mesh-config"
	MixerPolicyChart     = "istio-policy"
	MixerTelemetryChart  = "mixer-telemetry"
	PrometheusChart      = "prometheus"
	TelemetryCommonChart = "telemetry-common"
	ThreeScaleChart      = "maistra-threescale"
	TracingChart         = "tracing"
	WASMExtensionsChart  = "wasm-extensions"
	RLSChart             = "rls"
)
View Source
const (
	// DefaultVersion to use for new resources which have no version specified.
	DefaultVersion = lastKnownVersion
)

Variables

View Source
var (
	TestedVersions = []Version{V2_3, V2_4, V2_5}
)

Functions

func GetMissingDependency

func GetMissingDependency(err error) string

func GetSupportedVersionNames

func GetSupportedVersionNames() []string

func IsDependencyMissingError

func IsDependencyMissingError(err error) bool

func IsValidationError

func IsValidationError(err error) bool

func NewDependencyMissingError

func NewDependencyMissingError(dependency string, err error) error

Types

type ConversionStrategy

type ConversionStrategy interface {
	GetExpansionPorts() []corev1.ServicePort
	GetTelemetryType(in *v1.HelmValues, mixerTelemetryEnabled, mixerTelemetryEnabledSet, remoteEnabled bool) v2.TelemetryType
	GetPolicyType(in *v1.HelmValues, mixerPolicyEnabled, mixerPolicyEnabledSet, remoteEnabled bool) v2.PolicyType
	GetTrustDomainFieldPath() string
}

ConversionStrategy is an interface used when converting between v1 and v2 of the SMCP resource.

type RenderingStrategy

type RenderingStrategy interface {
	IsClusterScoped(spec *v2.ControlPlaneSpec) (bool, error)
	GetChartInstallOrder() [][]string
	SetImageValues(ctx context.Context, cr *common.ControllerResources, smcp *v1.ControlPlaneSpec) error
	Render(ctx context.Context, cr *common.ControllerResources, cniConfig cni.Config, smcp *v2.ServiceMeshControlPlane) (map[string][]manifest.Manifest, error)
	// for testing purposes
	ApplyProfiles(ctx context.Context, cr *common.ControllerResources, smcpSpec *v1.ControlPlaneSpec, targetNamespace string) (v1.ControlPlaneSpec, error)
}

RenderingStrategy is an interface used by the reconciler to manage rendering of charts.

type ValidationError

type ValidationError interface {
	errors.Aggregate
}

func NewValidationError

func NewValidationError(errlist ...error) ValidationError

type ValidationStrategy

type ValidationStrategy interface {
	ValidateV1(ctx context.Context, cl client.Client, smcp *v1.ServiceMeshControlPlane) error
	ValidateV2(ctx context.Context, cl client.Client, meta *metav1.ObjectMeta, spec *v2.ControlPlaneSpec) error
	ValidateDowngrade(ctx context.Context, cl client.Client, smcp metav1.Object) error
	ValidateUpgrade(ctx context.Context, cl client.Client, smcp metav1.Object) error
	ValidateUpdate(ctx context.Context, cl client.Client, oldSMCP metav1.Object, newSMCP metav1.Object) error
	ValidateRequest(ctx context.Context, cl client.Client, req admission.Request, smcp metav1.Object) admission.Response
}

ValidationStrategy is an interface used by the validating webhook for validating SMCP resources.

type Ver

type Ver int
const (
	// InvalidVersion is not a valid version
	InvalidVersion Ver = iota
	// V1_1 -> v1.1
	V1_1
	// V2_0 -> v2.0
	V2_0
	// V2_1 -> v2.1
	V2_1
	// V2_2 -> v2.2
	V2_2
	// V2_3 -> v2.3
	V2_3
	// V2_4 -> v2.4
	V2_4
	// V2_5 -> v2.5
	V2_5
)

func ParseVersion

func ParseVersion(str string) (Ver, error)

ParseVersion returns a version for the specified string

func (Ver) ApplyProfiles

func (v Ver) ApplyProfiles(ctx context.Context, cr *common.ControllerResources,
	smcpSpec *v1.ControlPlaneSpec, targetNamespace string,
) (v1.ControlPlaneSpec, error)

func (Ver) AtLeast

func (v Ver) AtLeast(other Version) bool

func (Ver) Compare

func (v Ver) Compare(other Version) int

func (Ver) GetCNINetworkName

func (v Ver) GetCNINetworkName() string

func (Ver) GetChartsDir

func (v Ver) GetChartsDir() string

GetChartsDir returns the location of the Helm charts. Similar layout to istio.io/istio/install/kubernetes/helm.

func (Ver) GetDefaultTemplatesDir

func (v Ver) GetDefaultTemplatesDir() string

GetDefaultTemplatesDir returns the location of the Default Operator templates files

func (Ver) GetUserTemplatesDir

func (v Ver) GetUserTemplatesDir() string

GetTemplatesDir returns the location of the Operator templates files

func (Ver) IsSupported

func (v Ver) IsSupported() (supported bool)

func (Ver) LessThan

func (v Ver) LessThan(other Version) bool

func (Ver) Strategy

func (v Ver) Strategy() VersionStrategy

func (Ver) String

func (v Ver) String() string

func (Ver) Version

func (v Ver) Version() Ver

type Version

type Version interface {
	fmt.Stringer
	// Version returns the internal version representation
	Version() Ver
	// Compare compares this version with another version.  If other is an older
	// version, a positive value will be returned.  If other is a newer version,
	// a negative value is returned.  If other is the same version, zero is
	// returned.
	Compare(other Version) int
	// AtLeast returns true if this version is greater or equal to the specified
	// other version.
	AtLeast(other Version) bool
	// LessThan returns true if this version is less than the specified version.
	LessThan(other Version) bool
	// Strategy provides a customizations specific to this version.
	Strategy() VersionStrategy
	GetChartsDir() string
	GetUserTemplatesDir() string
	GetDefaultTemplatesDir() string
	GetCNINetworkName() string
	IsSupported() bool
}

Version represents a version of a control plane, major.minor, usually identified as something like v1.1. Version objects are guaranteed to be sequentually ordered from oldest to newest.

func GetSupportedVersions

func GetSupportedVersions() []Version

GetSupportedVersions returns a list of versions supported by this operator

type VersionStrategy

type VersionStrategy interface {
	Version
	RenderingStrategy
	ValidationStrategy
	ConversionStrategy
}

VersionStrategy provides encapsulates customization required for a particular version.

Jump to

Keyboard shortcuts

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