subroutines

package
v0.9.3 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2025 License: Apache-2.0 Imports: 51 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"

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_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 DefaultInitializerConnection = []corev1alpha1.InitializerConnection{
	{
		WorkspaceTypeName: "security",
		Path:              "root",
		Secret:            "security-initializer-kubeconfig",
	},
}
View Source
var DefaultProviderConnections = []corev1alpha1.ProviderConnection{
	{
		EndpointSliceName: "core.platform-mesh.io",
		Path:              "root:platform-mesh-system",
		Secret:            "account-operator-kubeconfig",
	},
	{
		EndpointSliceName: "core.platform-mesh.io",
		Path:              "root:platform-mesh-system",
		Secret:            "rebac-authz-webhook-kubeconfig",
	},
	{
		EndpointSliceName: "core.platform-mesh.io",
		Path:              "root:platform-mesh-system",
		Secret:            "security-operator-kubeconfig",
	},
	{
		EndpointSliceName: "core.platform-mesh.io",
		Path:              "root:platform-mesh-system",
		Secret:            "kubernetes-grapqhl-gateway-kubeconfig",
	},
	{
		EndpointSliceName: "core.platform-mesh.io",
		Path:              "root:platform-mesh-system",
		Secret:            "extension-manager-operator-kubeconfig",
	},
	{
		EndpointSliceName: "",
		RawPath:           "/services/contentconfigurations",
		Secret:            "portal-kubeconfig",
	},
}

Functions

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 IsWorkspace

func IsWorkspace(dir string) bool

func ListFiles

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

func MatchesCondition added in v0.4.10

func MatchesCondition(release *unstructured.Unstructured, conditionType string) bool

MatchesCondition checks the Ready Condition if it has status true

func MergeJSON

func MergeJSON(a, b 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]string, templateBytes []byte) ([]byte, 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]string) 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() []string

func (*DeploymentSubroutine) GetName

func (r *DeploymentSubroutine) GetName() string

func (*DeploymentSubroutine) Process

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, kcpdir string, kcpUrl string) *KcpsetupSubroutine

func (*KcpsetupSubroutine) ApplyDirStructure

func (r *KcpsetupSubroutine) ApplyDirStructure(
	ctx context.Context, dir string, kcpPath string, config *rest.Config, inventory map[string]string, inst *corev1alpha1.PlatformMesh,
) error

func (*KcpsetupSubroutine) ApplyExtraWorkspaces added in v0.9.1

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

func (*KcpsetupSubroutine) ApplyManifestFromFile

func (r *KcpsetupSubroutine) ApplyManifestFromFile(
	ctx context.Context,
	path string,
	k8sClient client.Client,
	templateData map[string]string, wsPath string, 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() []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]string, log *logger.Logger) (unstructured.Unstructured, error)

func (*KcpsetupSubroutine) WaitForWorkspace

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

type PatchOIDCSubroutine added in v0.8.1

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

func NewPatchOIDCSubroutine added in v0.8.1

func NewPatchOIDCSubroutine(cl client.Client, configMapName, namespace, baseDomain string) *PatchOIDCSubroutine

func (*PatchOIDCSubroutine) Finalize added in v0.8.1

Finalize implements subroutine.Subroutine.

func (*PatchOIDCSubroutine) Finalizers added in v0.8.1

func (p *PatchOIDCSubroutine) Finalizers() []string

Finalizers implements subroutine.Subroutine.

func (*PatchOIDCSubroutine) GetName added in v0.8.1

func (p *PatchOIDCSubroutine) GetName() string

GetName implements subroutine.Subroutine.

func (*PatchOIDCSubroutine) Process added in v0.8.1

Process implements subroutine.Subroutine.

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() []string

func (*ProvidersecretSubroutine) GetName

func (r *ProvidersecretSubroutine) GetName() string

func (*ProvidersecretSubroutine) HandleInitializerConnection

func (*ProvidersecretSubroutine) HandleProviderConnection

func (*ProvidersecretSubroutine) Process

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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