Documentation ¶
Index ¶
- func ContainsString(list []string, target string) bool
- func ConvertRefConfigsV1ToV2(refConfig *dpv1alpha1.RefConfig) *dpv1alpha2.RefConfig
- func FilterByNamespaces(namespaces []string) func(object k8client.Object) bool
- func GetBackendJWT(ctx context.Context, client k8client.Client, ...) *dpv1alpha1.BackendJWT
- func GetDefaultHostNameForBackend(backend gwapiv1b1.HTTPBackendRef, defaultNamespace string) string
- func GetInterceptorService(ctx context.Context, client k8client.Client, namespace string, ...) *dpv1alpha1.InterceptorService
- func GetNamespace(namespace *gwapiv1b1.Namespace, defaultNamespace string) string
- func GetOperatorPodNamespace() string
- func GetPtrSlice[T any](inputSlice []T) []*T
- func GetResolvedBackend(ctx context.Context, client k8client.Client, ...) *dpv1alpha1.ResolvedBackend
- func GetResolvedMutualSSL(ctx context.Context, client k8client.Client, ...) error
- func GroupPtr(name string) *gwapiv1b1.Group
- func KindPtr(name string) *gwapiv1b1.Kind
- func NamespacedName(obj k8client.Object) types.NamespacedName
- func PathMatchTypePtr(pType gwapiv1b1.PathMatchType) *gwapiv1b1.PathMatchType
- func ResolveAllmTLSCertificates(ctx context.Context, mutualSSL *dpv1alpha2.MutualSSLConfig, ...) ([]string, error)
- func ResolveAndAddBackendToMapping(ctx context.Context, client k8client.Client, ...)
- func ResolveCertificate(ctx context.Context, client k8client.Client, namespace string, ...) (string, error)
- func ResolveRef(ctx context.Context, client k8client.Client, api *dpv1alpha2.API, ...) error
- func RetrieveAPIList(k8sclient k8client.Client) ([]dpv1alpha2.API, error)
- func RetrieveNamespaceListOptions(namespaces []string) k8client.ListOptions
- func SelectPolicy[T any](policyUpOverride, policyUpDefault, policyDownOverride, policyDownDefault **T) *T
- func StringPtr(val string) *string
- func TieBreaker[T metav1.Object](k8sObjects []T) *T
- func UpdateCR(ctx context.Context, client k8client.Client, child metav1.Object) error
- func ValidateAndRetrieveNamespace(namespace *gwapiv1.Namespace, defaultNamespace string) (string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ContainsString ¶
ContainsString checks whether a list contains a specific string. It returns true if the string is found in the list, otherwise false.
func ConvertRefConfigsV1ToV2 ¶
func ConvertRefConfigsV1ToV2(refConfig *dpv1alpha1.RefConfig) *dpv1alpha2.RefConfig
ConvertRefConfigsV1ToV2 converts RefConfig v2 to v1
func FilterByNamespaces ¶
FilterByNamespaces takes a list of namespaces and returns a filter function which return true if the input object is in the given namespaces list, and returns false otherwise
func GetBackendJWT ¶
func GetBackendJWT(ctx context.Context, client k8client.Client, namespace, backendJWTReference string, api *dpv1alpha2.API) *dpv1alpha1.BackendJWT
GetBackendJWT reads BackendJWT when backendJWTReference is given
func GetDefaultHostNameForBackend ¶
func GetDefaultHostNameForBackend(backend gwapiv1b1.HTTPBackendRef, defaultNamespace string) string
GetDefaultHostNameForBackend returns the host in <backend.name>.<namespace> format
func GetInterceptorService ¶
func GetInterceptorService(ctx context.Context, client k8client.Client, namespace string, interceptorReference *dpv1alpha2.InterceptorReference, api *dpv1alpha2.API) *dpv1alpha1.InterceptorService
GetInterceptorService reads InterceptorService when interceptorReference is given
func GetNamespace ¶
GetNamespace reads namespace with a default value
func GetOperatorPodNamespace ¶
func GetOperatorPodNamespace() string
GetOperatorPodNamespace returns the namesapce of the operator pod
func GetPtrSlice ¶
func GetPtrSlice[T any](inputSlice []T) []*T
GetPtrSlice returns a slice which is also a slice containing pointers to the elements in the input slice.
func GetResolvedBackend ¶
func GetResolvedBackend(ctx context.Context, client k8client.Client, backendNamespacedName types.NamespacedName, api *dpv1alpha2.API) *dpv1alpha1.ResolvedBackend
GetResolvedBackend resolves backend TLS configurations.
func GetResolvedMutualSSL ¶
func GetResolvedMutualSSL(ctx context.Context, client k8client.Client, authentication dpv1alpha2.Authentication, resolvedMutualSSL *dpv1alpha2.MutualSSL) error
GetResolvedMutualSSL resolves mTLS related security configurations.
func NamespacedName ¶
func NamespacedName(obj k8client.Object) types.NamespacedName
NamespacedName generates namespaced name for Kubernetes objects
func PathMatchTypePtr ¶
func PathMatchTypePtr(pType gwapiv1b1.PathMatchType) *gwapiv1b1.PathMatchType
PathMatchTypePtr returns a pointer to created v1beta1.PathMatchType object
func ResolveAllmTLSCertificates ¶
func ResolveAllmTLSCertificates(ctx context.Context, mutualSSL *dpv1alpha2.MutualSSLConfig, client k8client.Client, namespace string) ([]string, error)
ResolveAllmTLSCertificates resolves all mTLS certificates
func ResolveAndAddBackendToMapping ¶
func ResolveAndAddBackendToMapping(ctx context.Context, client k8client.Client, backendMapping map[string]*dpv1alpha1.ResolvedBackend, backendRef dpv1alpha1.BackendReference, interceptorServiceNamespace string, api *dpv1alpha2.API)
ResolveAndAddBackendToMapping resolves backend from reference and adds it to the backendMapping.
func ResolveCertificate ¶
func ResolveCertificate(ctx context.Context, client k8client.Client, namespace string, certificateInline *string, configMapRef *dpv1alpha2.RefConfig, secretRef *dpv1alpha2.RefConfig) (string, error)
ResolveCertificate reads the certificate from TLSConfig, first checks the certificateInline field, if no value then load the certificate from secretRef using util function called getSecretValue
func ResolveRef ¶
func ResolveRef(ctx context.Context, client k8client.Client, api *dpv1alpha2.API, namespacedName types.NamespacedName, isReplace bool, obj k8client.Object, opts ...k8client.GetOption) error
ResolveRef this function will return k8client object and update owner
func RetrieveAPIList ¶
func RetrieveAPIList(k8sclient k8client.Client) ([]dpv1alpha2.API, error)
RetrieveAPIList retrieves API list from the given kubernetes client
func RetrieveNamespaceListOptions ¶
func RetrieveNamespaceListOptions(namespaces []string) k8client.ListOptions
RetrieveNamespaceListOptions retrieve namespace list options for the given namespaces
func SelectPolicy ¶
func SelectPolicy[T any](policyUpOverride, policyUpDefault, policyDownOverride, policyDownDefault **T) *T
SelectPolicy selects the policy based on the policy override and default values
func TieBreaker ¶
TieBreaker breaks ties when multiple objects are present in a case only single object is expected. tie breaking logic is explained in https://gateway-api.sigs.k8s.io/geps/gep-713/?h=multiple+targetrefs#conflict-resolution
Types ¶
This section is empty.