subroutines

package
v0.52.5 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2026 License: Apache-2.0 Imports: 44 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KcpsetupSubroutineName      = "KcpsetupSubroutine"
	KcpsetupSubroutineFinalizer = "platform-mesh.core.platform-mesh.io/finalizer"
)
View Source
const (
	ProvidersecretSubroutineName      = "ProvidersecretSubroutine"
	ProvidersecretSubroutineFinalizer = "platform-mesh.core.platform-mesh.io/finalizer"
)
View Source
const DeploymentSubroutineName = "DeploymentSubroutine"
View Source
const FeatureToggleSubroutineName = "FeatureToggleSubroutine"
View Source
const (
	WaitSubroutineName = "WaitSubroutine"
)

Variables

View Source
var AccountOperatorMutatingWebhookName = "account-operator.webhooks.core.platform-mesh.io"
View Source
var AccountOperatorValidatingWebhookName = "organization-validator.webhooks.core.platform-mesh.io"
View Source
var AccountOperatorWebhookSecretName = "account-operator-webhook-server-cert"
View Source
var AccountOperatorWebhookSecretNamespace = "platform-mesh-system"
View Source
var AccountOperatorWorkspace = "root:platform-mesh-system"
View Source
var DEFAULT_VALIDATING_WEBHOOK_CONFIGURATION = corev1alpha1.WebhookConfiguration{
	SecretRef: corev1alpha1.SecretReference{
		Name:      AccountOperatorWebhookSecretName,
		Namespace: AccountOperatorWebhookSecretNamespace,
	},
	SecretData: DefaultCASecretKey,
	WebhookRef: corev1alpha1.KCPAPIVersionKindRef{
		ApiVersion: "admissionregistration.k8s.io/v1",
		Kind:       "ValidatingWebhookConfiguration",
		Name:       AccountOperatorValidatingWebhookName,
		Path:       AccountOperatorWorkspace,
	},
}
View Source
var DEFAULT_WAIT_CONFIG = corev1alpha1.WaitConfig{
	ResourceTypes: []corev1alpha1.ResourceType{
		{
			APIVersions: v1.APIVersions{
				Versions: []string{"v2"},
			},
			GroupKind: v1.GroupKind{
				Group: "helm.toolkit.fluxcd.io",
				Kind:  "HelmRelease",
			},
			Namespace: "default",
			LabelSelector: v1.LabelSelector{
				MatchExpressions: []v1.LabelSelectorRequirement{
					{
						Key:      "helm.toolkit.fluxcd.io/name",
						Operator: v1.LabelSelectorOpIn,
						Values:   []string{"platform-mesh-operator-components"},
					},
				},
			},
			ConditionStatus:  v1.ConditionTrue,
			RowConditionType: "Ready",
		},
		{
			APIVersions: v1.APIVersions{
				Versions: []string{"v2"},
			},
			GroupKind: v1.GroupKind{
				Group: "helm.toolkit.fluxcd.io",
				Kind:  "HelmRelease",
			},
			Namespace: "default",
			LabelSelector: v1.LabelSelector{
				MatchExpressions: []v1.LabelSelectorRequirement{
					{
						Key:      "helm.toolkit.fluxcd.io/name",
						Operator: v1.LabelSelectorOpIn,
						Values:   []string{"platform-mesh-operator-infra-components"},
					},
				},
			},
			ConditionStatus:  v1.ConditionTrue,
			RowConditionType: "Ready",
		},
	},
}
View Source
var DEFAULT_WEBHOOK_CONFIGURATION = corev1alpha1.WebhookConfiguration{
	SecretRef: corev1alpha1.SecretReference{
		Name:      AccountOperatorWebhookSecretName,
		Namespace: AccountOperatorWebhookSecretNamespace,
	},
	SecretData: DefaultCASecretKey,
	WebhookRef: corev1alpha1.KCPAPIVersionKindRef{
		ApiVersion: "admissionregistration.k8s.io/v1",
		Kind:       "MutatingWebhookConfiguration",
		Name:       AccountOperatorMutatingWebhookName,
		Path:       AccountOperatorWorkspace,
	},
}
View Source
var DefaultCASecretKey = "ca.crt"
View Source
var DefaultProviderConnections = []corev1alpha1.ProviderConnection{
	{
		Path:   "root:platform-mesh-system",
		Secret: "account-operator-kubeconfig",
	},
	{
		Path:   "root:platform-mesh-system",
		Secret: "rebac-authz-webhook-kubeconfig",
	},
	{
		Path:   "root:platform-mesh-system",
		Secret: "security-operator-kubeconfig",
	},
	{
		EndpointSliceName: ptr.To("core.platform-mesh.io"),
		Path:              "root:platform-mesh-system",
		Secret:            "kubernetes-grapqhl-gateway-kubeconfig",
	},
	{
		Path:   "root:platform-mesh-system",
		Secret: "extension-manager-operator-kubeconfig",
	},
	{
		Path:   "root:platform-mesh-system",
		Secret: "iam-service-kubeconfig",
	},
	{
		RawPath: ptr.To("/services/contentconfigurations"),
		Secret:  "portal-kubeconfig",
	},
	{
		Path:   "root",
		Secret: "security-initializer-kubeconfig",
	},
}

Functions

func ApplyDirStructure added in v0.14.0

func ApplyDirStructure(
	ctx context.Context,
	dir string,
	kcpPath string,
	config *rest.Config,
	templateData map[string]any,
	inst *v1alpha1.PlatformMesh,
	kcpHelper KcpHelper,
) error

func ApplyManifestFromFile added in v0.14.0

func ApplyManifestFromFile(
	ctx context.Context,
	path string, k8sClient client.Client, templateData map[string]any, wsPath string, inst *v1alpha1.PlatformMesh,
) error

func GetSecret

func GetSecret(client client.Client, name string, namespace string) (*corev1.Secret, error)

func GetWorkspaceDirs

func GetWorkspaceDirs(dir string) []string

func GetWorkspaceName

func GetWorkspaceName(dir string) (string, error)

func HasFeatureToggle added in v0.34.7

func HasFeatureToggle(inst *corev1alpha1.PlatformMesh, name string) string

func IsWorkspace

func IsWorkspace(dir string) bool

func ListFiles

func ListFiles(dir string) ([]string, error)

func MergeJSON

func MergeJSON(a, b apiextensionsv1.JSON) (apiextensionsv1.JSON, error)

func MergeValuesAndInfraValues added in v0.22.1

func MergeValuesAndInfraValues(inst *v1alpha1.PlatformMesh, templateVars apiextensionsv1.JSON) (apiextensionsv1.JSON, error)

func MergeValuesAndServices

func MergeValuesAndServices(inst *v1alpha1.PlatformMesh, templateVars apiextensionsv1.JSON) (apiextensionsv1.JSON, error)

func ReplaceTemplate

func ReplaceTemplate(templateData map[string]any, templateBytes []byte) ([]byte, error)

func WaitForWorkspace added in v0.14.0

func WaitForWorkspace(
	ctx context.Context,
	config *rest.Config, name string, log *logger.Logger,
	kcpHelper KcpHelper,
) error

Types

type DefaultHelmGetter

type DefaultHelmGetter struct{}

DefaultHelmGetter is the default implementation of HelmGetter

func (DefaultHelmGetter) GetRelease

func (g DefaultHelmGetter) GetRelease(ctx context.Context, cli client.Client, name, ns string) (*unstructured.Unstructured, error)

GetRelease implements HelmGetter interface

type DeploymentSubroutine

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

func NewDeploymentSubroutine

func NewDeploymentSubroutine(client client.Client, cfg *pmconfig.CommonServiceConfig, operatorCfg *config.OperatorConfig) *DeploymentSubroutine

func (*DeploymentSubroutine) ApplyManifestFromFileWithMergedValues

func (s *DeploymentSubroutine) ApplyManifestFromFileWithMergedValues(ctx context.Context, path string, k8sClient client.Client, templateData map[string]any) error

func (*DeploymentSubroutine) ApplyReleaseWithValues

func (s *DeploymentSubroutine) ApplyReleaseWithValues(ctx context.Context, path string, k8sClient client.Client, values apiextensionsv1.JSON) error

func (*DeploymentSubroutine) Finalize

func (*DeploymentSubroutine) Finalizers

func (r *DeploymentSubroutine) Finalizers(instance runtimeobject.RuntimeObject) []string

func (*DeploymentSubroutine) GetName

func (r *DeploymentSubroutine) GetName() string

func (*DeploymentSubroutine) Process

type FeatureToggleSubroutine added in v0.14.0

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

func NewFeatureToggleSubroutine added in v0.14.0

func NewFeatureToggleSubroutine(client client.Client, helper KcpHelper, operatorCfg *config.OperatorConfig, kcpUrl string) *FeatureToggleSubroutine

func (*FeatureToggleSubroutine) Finalize added in v0.14.0

func (*FeatureToggleSubroutine) Finalizers added in v0.14.0

func (r *FeatureToggleSubroutine) Finalizers(instance runtimeobject.RuntimeObject) []string

func (*FeatureToggleSubroutine) GetName added in v0.14.0

func (r *FeatureToggleSubroutine) GetName() string

func (*FeatureToggleSubroutine) Process added in v0.14.0

type HelmGetter

type HelmGetter interface {
	GetRelease(ctx context.Context, client client.Client, name, ns string) (*unstructured.Unstructured, error)
}

HelmGetter is an interface for getting Helm releases

type Helper

type Helper struct {
}

func (*Helper) NewKcpClient

func (h *Helper) NewKcpClient(config *rest.Config, workspacePath string) (client.Client, error)

type KcpHelper

type KcpHelper interface {
	NewKcpClient(config *rest.Config, workspacePath string) (client.Client, error)
}

type KcpsetupSubroutine

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

func NewKcpsetupSubroutine

func NewKcpsetupSubroutine(client client.Client, helper KcpHelper, cfg *config.OperatorConfig, kcpdir string, kcpUrl string) *KcpsetupSubroutine

func (*KcpsetupSubroutine) ApplyExtraWorkspaces added in v0.9.1

func (r *KcpsetupSubroutine) ApplyExtraWorkspaces(ctx context.Context, config *rest.Config, inst *corev1alpha1.PlatformMesh) error

func (*KcpsetupSubroutine) CreateKcpResources

func (r *KcpsetupSubroutine) CreateKcpResources(ctx context.Context, config *rest.Config, dir string, inst *corev1alpha1.PlatformMesh) error

func (*KcpsetupSubroutine) Finalize

func (*KcpsetupSubroutine) Finalizers

func (r *KcpsetupSubroutine) Finalizers(instance runtimeobject.RuntimeObject) []string

func (*KcpsetupSubroutine) GetAPIExportHashInventory

func (r *KcpsetupSubroutine) GetAPIExportHashInventory(ctx context.Context, config *rest.Config) (map[string]string, error)

func (*KcpsetupSubroutine) GetCABundleInventory

func (r *KcpsetupSubroutine) GetCABundleInventory(ctx context.Context) (map[string]string, error)

func (*KcpsetupSubroutine) GetCaBundle

func (r *KcpsetupSubroutine) GetCaBundle(ctx context.Context, webhookConfig *corev1alpha1.WebhookConfiguration) ([]byte, error)

func (*KcpsetupSubroutine) GetName

func (r *KcpsetupSubroutine) GetName() string

func (*KcpsetupSubroutine) Process

func (*KcpsetupSubroutine) UnstructuredFromFile

func (s *KcpsetupSubroutine) UnstructuredFromFile(path string, templateData map[string]any, log *logger.Logger) (unstructured.Unstructured, error)

type KubeconfigBuilder added in v0.14.0

type KubeconfigBuilder interface {
	Build(ctx context.Context, client client.Client, kcpUrl string) (*rest.Config, error)
}

type ProvidersecretSubroutine

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

func NewProviderSecretSubroutine

func NewProviderSecretSubroutine(
	client client.Client,
	helper KcpHelper,
	helm HelmGetter,
	kcpUrl string,
) *ProvidersecretSubroutine

func (*ProvidersecretSubroutine) Finalize

func (*ProvidersecretSubroutine) Finalizers

func (r *ProvidersecretSubroutine) Finalizers(instance runtimeobject.RuntimeObject) []string

func (*ProvidersecretSubroutine) GetName

func (r *ProvidersecretSubroutine) GetName() string

func (*ProvidersecretSubroutine) HandleInitializerConnection

func (*ProvidersecretSubroutine) HandleProviderConnection

func (*ProvidersecretSubroutine) Process

type WaitSubroutine added in v0.28.1

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

func NewWaitSubroutine added in v0.28.1

func NewWaitSubroutine(
	client client.Client,
	kcpHelper KcpHelper,
	cfg *config.OperatorConfig,
	kcpUrl string,
) *WaitSubroutine

func (*WaitSubroutine) Finalize added in v0.28.1

func (*WaitSubroutine) Finalizers added in v0.28.1

func (r *WaitSubroutine) Finalizers(instance runtimeobject.RuntimeObject) []string

func (*WaitSubroutine) GetName added in v0.28.1

func (r *WaitSubroutine) GetName() string

func (*WaitSubroutine) Process added in v0.28.1

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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