i2gw

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2024 License: Apache-2.0 Imports: 13 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ProviderConstructorByName = map[ProviderName]ProviderConstructor{}

ProviderConstructorByName is a map of ProviderConstructor functions by a provider name. Different Provider implementations should add their construction func at startup.

Functions

func GetProviderSpecificFlagDefinitions added in v0.3.0

func GetProviderSpecificFlagDefinitions() map[ProviderName]map[string]ProviderSpecificFlag

GetProviderSpecificFlagDefinitions returns the provider specific confs registered by the providers.

func GetSupportedProviders

func GetSupportedProviders() []string

GetSupportedProviders returns the names of all providers that are supported now

func RegisterProviderSpecificFlag added in v0.3.0

func RegisterProviderSpecificFlag(provider ProviderName, flag ProviderSpecificFlag)

RegisterProviderSpecificFlag registers a provider-specific flag. Each provider-specific flag is exposed to the user as an optional command-line flag --<provider>-<flag>. If the flag is not provided, it is up to the provider to decide to use the default value or raise an error. The provider can read the values of provider-specific flags input by the user from the ProviderConf. RegisterProviderSpecificFlag is thread-safe.

Types

type CustomResourceReader

type CustomResourceReader interface {

	// ReadResourcesFromCluster reads custom resources associated with
	// the underlying Provider implementation from the kubernetes cluster.
	ReadResourcesFromCluster(ctx context.Context) error

	// ReadResourcesFromFile reads custom resources associated with
	// the underlying Provider implementation from the file.
	ReadResourcesFromFile(ctx context.Context, filename string) error
}

type FeatureParser

type FeatureParser func([]networkingv1.Ingress, *GatewayResources) field.ErrorList

FeatureParser is a function that reads the Ingresses, and applies the appropriate modifications to the GatewayResources.

Different FeatureParsers will run in undetermined order. The function must modify / create only the required fields of the gateway resources and nothing else.

type GatewayResources

GatewayResources contains all Gateway-API objects.

func MergeGatewayResources added in v0.3.0

func MergeGatewayResources(gatewayResources ...GatewayResources) (GatewayResources, field.ErrorList)

MergeGatewayResources accept multiple GatewayResources and create a unique Resource struct built as follows:

  • GatewayClasses, *Routes, and ReferenceGrants are grouped into the same maps
  • Gateways may have the same NamespaceName even if they come from different ingresses, as they have a their GatewayClass' name as name. For this reason, if there are mutiple gateways named the same, their listeners are merged into a unique Gateway.

This behavior is likely to change after https://github.com/kubernetes-sigs/gateway-api/pull/1863 takes place.

func ToGatewayAPIResources

func ToGatewayAPIResources(ctx context.Context, namespace string, inputFile string, providers []string, providerSpecificFlags map[string]map[string]string) ([]GatewayResources, map[string]string, error)

type ImplementationSpecificHTTPPathTypeMatchConverter added in v0.2.0

type ImplementationSpecificHTTPPathTypeMatchConverter func(*gatewayv1.HTTPPathMatch)

ImplementationSpecificHTTPPathTypeMatchConverter is an option to customize the ingress implementationSpecific match type conversion.

type Provider

type Provider interface {
	CustomResourceReader
	ResourceConverter
}

The Provider interface specifies the required functionality which needs to be implemented by every concrete Ingress/Gateway-API provider, in order for it to be used.

type ProviderConf

type ProviderConf struct {
	Client                client.Client
	Namespace             string
	ProviderSpecificFlags map[string]map[string]string
}

ProviderConf contains all the configuration required for every concrete Provider implementation.

type ProviderConstructor

type ProviderConstructor func(conf *ProviderConf) Provider

ProviderConstructor is a construction function that constructs concrete implementations of the Provider interface.

type ProviderImplementationSpecificOptions added in v0.2.0

type ProviderImplementationSpecificOptions struct {
	ToImplementationSpecificHTTPPathTypeMatch ImplementationSpecificHTTPPathTypeMatchConverter
}

ProviderImplementationSpecificOptions contains customized implementation-specific fields and functions. These will be used by the common package to customize the provider-specific behavior for all the implementation-specific fields of the ingress API.

type ProviderName

type ProviderName string

ProviderName is a string alias that stores the concrete Provider name.

type ProviderSpecificFlag added in v0.3.0

type ProviderSpecificFlag struct {
	Name         string
	Description  string
	DefaultValue string
}

type ResourceConverter

type ResourceConverter interface {

	// ToGatewayAPIResources converts stored API entities associated
	// with the Provider into GatewayResources.
	ToGatewayAPI() (GatewayResources, field.ErrorList)
}

The ResourceConverter interface specifies all the implemented Gateway API resource conversion functions.

Directories

Path Synopsis
providers
gce

Jump to

Keyboard shortcuts

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