processing

package
v0.0.0-...-36f31f2 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2025 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ModuleLabelKey       = "kyma-project.io/module"
	K8sManagedByLabelKey = "app.kubernetes.io/managed-by"
	K8sComponentLabelKey = "app.kubernetes.io/component"
	K8sPartOfLabelKey    = "app.kubernetes.io/part-of"
	ApiGatewayLabelValue = "api-gateway"
)

Variables

View Source
var (
	//LegacyOwnerLabel .
	// deprecated: use OwnerLabelName and OwnerLabelNamespace instead.
	LegacyOwnerLabel = fmt.Sprintf("%s.%s", "apirule", gatewayv1beta1.GroupVersion.String())

	// OwnerLabelName is the label key used to identify the owner name of a resource.
	OwnerLabelName = "apirule.gateway.kyma-project.io/name"
	// OwnerLabelNamespace is the label key used to identify the owner namespace of a resource.
	OwnerLabelNamespace = "apirule.gateway.kyma-project.io/namespace"
)

Functions

func FilterDuplicatePaths

func FilterDuplicatePaths(rules []gatewayv1beta1.Rule) []gatewayv1beta1.Rule

func GetLegacyOwnerLabels

func GetLegacyOwnerLabels(api *gatewayv1beta1.APIRule) map[string]string

func GetLegacyOwnerLabelsFromLabeler

func GetLegacyOwnerLabelsFromLabeler(l Labeler) map[string]string

GetLegacyOwnerLabelsFromLabeler returns the legacy owner labels for any object that implements Labeler

func GetOwnerLabelsV2alpha1

func GetOwnerLabelsV2alpha1(api *gatewayv2alpha1.APIRule) map[string]string

GetOwnerLabelsV2alpha1 returns the owner labels for the given APIRule. The owner labels are still set to the old v1beta1 APIRule version. Do not switch the owner labels to the new APIRule version unless absolutely necessary! This has been done before, and it caused a lot of confusion and bugs. If the change for some reason has to be done, please remove the version from the LegacyOwnerLabel constant. deprecated: use GetLegacyOwnerLabels instead.

func IsJwtSecured

func IsJwtSecured(rule gatewayv1beta1.Rule) bool

func IsSecuredByOathkeeper

func IsSecuredByOathkeeper(rule gatewayv1beta1.Rule) bool

IsSecuredByOathkeeper checks whether the rule contains an access strategy that should lead to the creation of an Oathkeeper rule.

func Reconcile

Reconcile executes the reconciliation of the APIRule using the given reconciliation command.

func RequiresAuthorizationPolicies

func RequiresAuthorizationPolicies(api *gatewayv1beta1.APIRule) bool

Types

type Action

type Action int

func (Action) String

func (s Action) String() string

type CorsConfig

type CorsConfig struct {
	AllowOrigins []*v1beta1.StringMatch
	AllowMethods []string
	AllowHeaders []string
}

CorsConfig is an internal representation of v1alpha3.CorsPolicy object

type Labeler

type Labeler interface {
	GetName() string
	GetNamespace() string
}

type ObjectChange

type ObjectChange struct {
	Action Action
	Obj    client.Object
}

func NewObjectCreateAction

func NewObjectCreateAction(obj client.Object) *ObjectChange

func NewObjectDeleteAction

func NewObjectDeleteAction(obj client.Object) *ObjectChange

func NewObjectUpdateAction

func NewObjectUpdateAction(obj client.Object) *ObjectChange

type OwnerLabels

type OwnerLabels struct {
	Name      string
	Namespace string
}

func GetOwnerLabels

func GetOwnerLabels(l Labeler) OwnerLabels

func (OwnerLabels) Labels

func (l OwnerLabels) Labels() map[string]string

func (OwnerLabels) Owns

func (o OwnerLabels) Owns(labels map[string]string) bool

type ReconciliationCommand

type ReconciliationCommand interface {
	// Validate performs provided APIRule validation in context of the provided client cluster
	Validate(context.Context, client.Client) ([]validation.Failure, error)

	// GetStatusBase returns ReconciliationV1beta1Status that sets unused subresources status to nil and to gatewayv1beta1.StatusCode paramter for all the others
	GetStatusBase(string) status.ReconciliationStatus

	// GetProcessors returns the processor relevant for the reconciliation of this command.
	GetProcessors() []ReconciliationProcessor
}

ReconciliationCommand provides the processors and validation required to reconcile the API rule.

type ReconciliationConfig

type ReconciliationConfig struct {
	OathkeeperSvc     string
	OathkeeperSvcPort uint32
	CorsConfig        *CorsConfig
	DefaultDomainName string
}

type ReconciliationProcessor

type ReconciliationProcessor interface {
	// EvaluateReconciliation returns the changes that needs to be applied to the cluster by comparing the desired with the actual state.
	EvaluateReconciliation(context.Context, client.Client) ([]*ObjectChange, error)
}

ReconciliationProcessor provides the evaluation of changes during the reconciliation of API Rule.

Directories

Path Synopsis
Package hashbasedstate provides types and functions to compare objects by a hash and a position in a yaml sequence.
Package hashbasedstate provides types and functions to compare objects by a hash and a position in a yaml sequence.
ory

Jump to

Keyboard shortcuts

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