Documentation
¶
Index ¶
- Constants
- Variables
- func Adopt[T constraints.SupportedKonnectEntityType, TEnt constraints.EntityType[T]](ctx context.Context, sdk sdkops.SDKWrapper, syncPeriod time.Duration, ...) (ctrl.Result, error)
- func ClearInstanceFromError(err error) error
- func Create[T constraints.SupportedKonnectEntityType, TEnt constraints.EntityType[T]](ctx context.Context, sdk sdkops.SDKWrapper, cl client.Client, ...) (*T, error)
- func CreateGeneratedOps[T constraints.SupportedKonnectEntityType, TEnt constraints.EntityType[T]](ctx context.Context, sdk sdkops.SDKWrapper, cl client.Client, e TEnt) error
- func CreateKongDataPlaneClientCertificate(ctx context.Context, sdk sdkkonnectgo.DPCertificatesSDK, ...) error
- func Delete[T constraints.SupportedKonnectEntityType, TEnt constraints.EntityType[T]](ctx context.Context, sdk sdkops.SDKWrapper, cl client.Client, ...) error
- func DeleteGeneratedOps[T constraints.SupportedKonnectEntityType, TEnt constraints.EntityType[T]](ctx context.Context, sdk sdkops.SDKWrapper, e TEnt) error
- func DeleteKongDataPlaneClientCertificate(ctx context.Context, sdk sdkkonnectgo.DPCertificatesSDK, ...) error
- func EntityPersistsKonnectID(obj konnectIDPersister) bool
- func ErrIsNotFound(err error) bool
- func ErrorIsCreateConflict(err error) bool
- func ErrorIsForbiddenError(err error) bool
- func ErrorIsRateLimited(err error) bool
- func ErrorIsSDKBadRequestError(err error) bool
- func ErrorIsSDKError400(err error) bool
- func GenerateTagsForObject(obj ObjectWithMetadata, additionalTags ...string) []string
- func GetControlPlaneByID(ctx context.Context, sdk sdkkonnectgo.ControlPlanesSDK, id string) (*sdkkonnectcomp.ControlPlane, error)
- func GetRetryAfterFromRateLimitError(err error) (time.Duration, bool)
- func IgnoreAlreadyHandledErr(err error, logger logr.Logger) error
- func IgnoreUnrecoverableAPIErr(err error, logger logr.Logger) error
- func ListKongDataPlaneClientCertificates(ctx context.Context, sdk sdkkonnectgo.DPCertificatesSDK, cpID string) ([]sdkkonnectcomp.DataPlaneClientCertificate, error)
- func ParseSDKErrorBody(body string) (sdkErrorBody, error)
- func SDKErrorIsConflict(sdkError *sdkkonnecterrs.SDKError) bool
- func SetControlPlaneGroupMembersReferenceResolvedCondition(cpGroup *konnectv1alpha2.KonnectGatewayControlPlane)
- func SetControlPlaneGroupMembersReferenceResolvedConditionFalse(cpGroup *konnectv1alpha2.KonnectGatewayControlPlane, ...)
- func SetKonnectEntityAdoptedConditionFalse(obj entityType, reason kcfgconsts.ConditionReason, err error)
- func SetKonnectEntityAdoptedConditionTrue(obj entityType)
- func SetKonnectEntityMirroredConditionFalse(obj entityType, err error)
- func SetKonnectEntityMirroredConditionTrue(obj entityType)
- func SetKonnectEntityProgrammedConditionFalse(obj entityType, reason kcfgconsts.ConditionReason, err error)
- func SetKonnectEntityProgrammedConditionTrue(obj entityType)
- func UIDLabelForObject(obj client.Object) string
- func Update[T constraints.SupportedKonnectEntityType, TEnt constraints.EntityType[T]](ctx context.Context, sdk sdkops.SDKWrapper, syncPeriod time.Duration, ...) (ctrl.Result, error)
- func UpdateGeneratedOps[T constraints.SupportedKonnectEntityType, TEnt constraints.EntityType[T]](ctx context.Context, sdk sdkops.SDKWrapper, cl client.Client, e TEnt) error
- func WithKubernetesMetadataLabels(obj ObjectWithMetadata, userSetLabels map[string]string) map[string]string
- func WithKubernetesMetadataLabelsPtr(obj ObjectWithMetadata, userSetLabels map[string]*string) map[string]*string
- func WithResolvedConfigStoreID(ctx context.Context, id string) context.Context
- type CantPerformOperationWithoutControlPlaneIDError
- type CantPerformOperationWithoutEventGatewayIDError
- type CantPerformOperationWithoutNetworkIDError
- type CantPerformOperationWithoutParentIDError
- type ConflictOnCreateButNoConflifctHandlingImplementedError
- type ControlPlaneGroupMemberNoKonnectIDError
- type CredentialBasicAuthSDK
- type EntityWithMatchingIDNotFoundError
- type EntityWithMatchingUIDNotFoundError
- type FailedKonnectOpError
- type GetControlPlaneGroupMemberFailedError
- type KonnectEntityAdoptionFetchError
- type KonnectEntityAdoptionMissingControlPlaneIDError
- type KonnectEntityAdoptionNotMatchError
- type KonnectEntityAdoptionReferenceServiceIDMismatchError
- type KonnectEntityAdoptionRouteTypeNotSupportedError
- type KonnectEntityAdoptionUIDTagConflictError
- type KonnectEntityCreatedButRelationsFailedError
- type KonnectOperationFailedError
- type MirrorableEntity
- type MultipleEntitiesWithMatchingIDFoundError
- type ObjectWithMetadata
- type Op
- type RateLimitError
- type ReferenceError
Constants ¶
const ( // ControlPlaneGroupMembersReferenceResolvedConditionType sets the condition for control plane groups // to show whether all of its members are programmed and attached to the group. ControlPlaneGroupMembersReferenceResolvedConditionType = "MembersReferenceResolved" // ControlPlaneGroupMembersReferenceResolvedReasonResolved indicates that all members of the control plane group // are created and attached to the group in Konnect. ControlPlaneGroupMembersReferenceResolvedReasonResolved kcfgconsts.ConditionReason = "Resolved" // ControlPlaneGroupMembersReferenceResolvedReasonPartialNotResolved indicates that some members of the control plane group // are not resolved (not found or not created in Konnect). ControlPlaneGroupMembersReferenceResolvedReasonPartialNotResolved kcfgconsts.ConditionReason = "SomeMemberNotResolved" // ControlPlaneGroupMembersReferenceResolvedReasonFailedToSet indicates that error happened on setting control plane as // member of the control plane. ControlPlaneGroupMembersReferenceResolvedReasonFailedToSet kcfgconsts.ConditionReason = "SetGroupMemberFailed" )
const ( // KubernetesNamespaceLabelKey is the key for the Kubernetes namespace label. KubernetesNamespaceLabelKey = "k8s-namespace" // KubernetesNameLabelKey is the key for the Kubernetes name label. KubernetesNameLabelKey = "k8s-name" // KubernetesUIDLabelKey is the key for the Kubernetes UID label. KubernetesUIDLabelKey = "k8s-uid" // KubernetesGenerationLabelKey is the key for the Kubernetes generation label. KubernetesGenerationLabelKey = "k8s-generation" // KubernetesKindLabelKey is the key for the Kubernetes kind label. KubernetesKindLabelKey = "k8s-kind" // KubernetesGroupLabelKey is the key for the Kubernetes group label. KubernetesGroupLabelKey = "k8s-group" // KubernetesVersionLabelKey is the key for the Kubernetes version label. KubernetesVersionLabelKey = "k8s-version" // ManagedByLabelKey is the key for the label that indicates the manager of the Konnect entity. ManagedByLabelKey = "managed-by" // ManagedByKongOperatorLabelValue is the value for the label that indicates the kong operator is the manager of the Konnect entity. ManagedByKongOperatorLabelValue = "kong-operator" )
const ( // DefaultRateLimitRetryAfter is the default retry-after duration when the // Retry-After header is not present in the rate limit response. DefaultRateLimitRetryAfter = 15 * time.Second // DefaultReferenceRetryAfter is the fixed retry-after duration used when a Konnect // operation returns a 400 with only ERROR_TYPE_REFERENCE errors. This avoids // controller-runtime's exponential backoff (which can grow into minutes) for a // condition that is inherently transient (e.g. all targets recreated at once while // the upstream is not yet present in Konnect). DefaultReferenceRetryAfter = 500 * time.Millisecond )
Variables ¶
var ErrNilResponse = errors.New("nil response received")
ErrNilResponse is an error indicating that a Konnect operation returned an empty response. This can sometimes happen regardless of the err being nil.
var ErrUnexpectedIDType = errors.New("unexpected ID type from SDK response")
ErrUnexpectedIDType is returned by generated getForUID code when an SDK list/get response item exposes an ID via GetID() whose dynamic type is neither string nor *string. Surfacing this explicitly avoids silently treating the entity as "not found" and looping on create conflicts.
Functions ¶
func Adopt ¶ added in v2.1.1
func Adopt[ T constraints.SupportedKonnectEntityType, TEnt constraints.EntityType[T], ]( ctx context.Context, sdk sdkops.SDKWrapper, syncPeriod time.Duration, cl client.Client, metricRecorder metrics.Recorder, e TEnt, adoptOptions commonv1alpha1.AdoptOptions, ) (ctrl.Result, error)
Adopt adopts an exiting entity in Konnect and take over the management of the entity.
func ClearInstanceFromError ¶
ClearInstanceFromError clears the instance field from the error. This is needed because the instance field contains the trace ID which changes with each request and makes the reconciliation loop requeue the resource instead of performing the backoff.
func Create ¶
func Create[ T constraints.SupportedKonnectEntityType, TEnt constraints.EntityType[T], ]( ctx context.Context, sdk sdkops.SDKWrapper, cl client.Client, metricRecorder metrics.Recorder, e TEnt, ) (*T, error)
Create creates a Konnect entity.
func CreateGeneratedOps ¶ added in v2.2.0
func CreateGeneratedOps[ T constraints.SupportedKonnectEntityType, TEnt constraints.EntityType[T], ]( ctx context.Context, sdk sdkops.SDKWrapper, cl client.Client, e TEnt, ) error
CreateGeneratedOps dispatches create operations to per-entity generated create functions. It is a stub dispatcher intended for Konnect entities whose ops layer is fully generated; entities handled by hand-written ops remain in the Create function in ops.go.
func CreateKongDataPlaneClientCertificate ¶
func CreateKongDataPlaneClientCertificate( ctx context.Context, sdk sdkkonnectgo.DPCertificatesSDK, cert *configurationv1alpha1.KongDataPlaneClientCertificate, ) error
CreateKongDataPlaneClientCertificate creates a KongDataPlaneClientCertificate in Konnect. It sets the KonnectID in the KongDataPlaneClientCertificate status.
func Delete ¶
func Delete[ T constraints.SupportedKonnectEntityType, TEnt constraints.EntityType[T], ](ctx context.Context, sdk sdkops.SDKWrapper, cl client.Client, metricRecorder metrics.Recorder, ent TEnt) error
Delete deletes a Konnect entity. It returns an error if the entity does not have a Konnect ID or if the operation fails.
func DeleteGeneratedOps ¶ added in v2.2.0
func DeleteGeneratedOps[ T constraints.SupportedKonnectEntityType, TEnt constraints.EntityType[T], ]( ctx context.Context, sdk sdkops.SDKWrapper, e TEnt, ) error
DeleteGeneratedOps dispatches delete operations to per-entity generated delete functions. It is a stub dispatcher intended for Konnect entities whose ops layer is fully generated; entities handled by hand-written ops remain in the Delete function in ops.go.
func DeleteKongDataPlaneClientCertificate ¶
func DeleteKongDataPlaneClientCertificate( ctx context.Context, sdk sdkkonnectgo.DPCertificatesSDK, cert *configurationv1alpha1.KongDataPlaneClientCertificate, ) error
DeleteKongDataPlaneClientCertificate deletes a KongDataPlaneClientCertificate in Konnect. The KongDataPlaneClientCertificate must have a KonnectID set in its status. It returns an error if the operation fails.
func EntityPersistsKonnectID ¶ added in v2.2.0
func EntityPersistsKonnectID(obj konnectIDPersister) bool
EntityPersistsKonnectID reports whether an entity persists a Konnect ID in status. Entities that persist a Konnect ID require it to be present for update and delete operations, while non-persisting entities (e.g. singleton sub-resources) are reconciled, finalized, and deleted without one.
func ErrIsNotFound ¶ added in v2.1.1
ErrIsNotFound returns true if the provided error indicates that the entity was not found on Konnect.
func ErrorIsCreateConflict ¶
ErrorIsCreateConflict returns true if the provided error is a Konnect conflict error.
Example error body:
{
"status": 409,
"title": "Conflict",
"instance": "kong:trace:14893476519012495000",
"detail": "Key (org_id, name)=(8a6e97b1-1111-1111-1111-111111111111, test1) already exists."
}
NOTE: Konnect APIs specific for Konnect only APIs like Gateway Control Planes return 409 conflict for already existing entities and return ConflictError. APIs that are shared with Kong Admin API return 400 for conflicts and return SDKError.
func ErrorIsForbiddenError ¶
ErrorIsForbiddenError returns true if the provided error is a 403 Forbidden error. This can happen when the requested operation is not permitted. Example SDKError body (SDKError message is a separate field from body message):
{
"code": 7,
"message": "usage constraint error",
"details": [
{
"@type": "type.googleapis.com/kong.admin.model.v1.ErrorDetail",
"messages": [
"operation not permitted on KIC cluster"
]
}
]
}
func ErrorIsRateLimited ¶ added in v2.1.1
ErrorIsRateLimited returns true if the provided error is a 429 Too Many Requests error. This can happen when the Konnect API rate limit is exhausted.
func ErrorIsSDKBadRequestError ¶
ErrorIsSDKBadRequestError returns true if the provided error is a BadRequestError.
func ErrorIsSDKError400 ¶
ErrorIsSDKError400 returns true if the provided error is a 400 BadRequestError. This can happen when the requested entity fails the validation.
It returns false when the error can be parsed as SDK error and all sub errors are of type ERROR_TYPE_REFERENCE since those depend on other entities that can be independently created/deleted in Konnect.
If the provided SDK error's details are empty or cannot be parsed, it returns true.
func GenerateTagsForObject ¶
func GenerateTagsForObject(obj ObjectWithMetadata, additionalTags ...string) []string
GenerateTagsForObject generates tags for the given object based on its Kubernetes metadata and annotations. An optional set of tags can be passed to be included in the generated tags (e.g. tags from the spec). It returns a slice of unique, sorted strings for deterministic output.
func GetControlPlaneByID ¶
func GetControlPlaneByID( ctx context.Context, sdk sdkkonnectgo.ControlPlanesSDK, id string, ) (*sdkkonnectcomp.ControlPlane, error)
GetControlPlaneByID returns the Konnect ControlPlane that matches the provided ID.
func GetRetryAfterFromRateLimitError ¶ added in v2.1.1
GetRetryAfterFromRateLimitError extracts the Retry-After duration from a rate limit error. It checks for the Retry-After header in the HTTP response. If the header is not present or cannot be parsed, it returns the default retry-after duration. If the error is not a rate limit error, it returns 0 and false.
func IgnoreAlreadyHandledErr ¶ added in v2.1.1
IgnoreAlreadyHandledErr ignores errors that have already been handled by setting the appropriate conditions in the object's status. For now, it only handles cross-namespace reference errors: those should not be logged, retried or reported to controller runtime's error handling.
func IgnoreUnrecoverableAPIErr ¶
IgnoreUnrecoverableAPIErr ignores unrecoverable errors that would cause the reconciler to endlessly requeue, and wraps transient errors with a fixed retry-after duration to avoid controller-runtime's exponential backoff.
func ListKongDataPlaneClientCertificates ¶
func ListKongDataPlaneClientCertificates( ctx context.Context, sdk sdkkonnectgo.DPCertificatesSDK, cpID string, ) ([]sdkkonnectcomp.DataPlaneClientCertificate, error)
ListKongDataPlaneClientCertificates lists KongDataPlaneClientCertificates in Konnect. It returns an error if the operation fails.
func ParseSDKErrorBody ¶
ParseSDKErrorBody parses the body of an SDK error response. Exemplary body:
{
"code": 3,
"message": "data constraint error",
"details": [
{
"@type": "type.googleapis.com/kong.admin.model.v1.ErrorDetail",
"type": "ERROR_TYPE_REFERENCE",
"field": "name",
"messages": [
"name (type: unique) constraint failed"
]
}
]
}
func SDKErrorIsConflict ¶
func SDKErrorIsConflict(sdkError *sdkkonnecterrs.SDKError) bool
SDKErrorIsConflict returns true if the provided SDKError indicates a conflict. We currently handle two codes (as mapped in https://grpc.io/docs/guides/status-codes/#the-full-list-of-status-codes) from SDK error: - 3: INVALID_ARGUMENT - 6: ALREADY_EXISTS
Example error body:
{
"code": 3,
"message": "name (type: unique) constraint failed",
"details": [
{
"@type": "type.googleapis.com/kong.admin.model.v1.ErrorDetail",
"type": "ERROR_TYPE_REFERENCE",
"field": "name",
"messages": [
"name (type: unique) constraint failed"
]
}
]
}
func SetControlPlaneGroupMembersReferenceResolvedCondition ¶
func SetControlPlaneGroupMembersReferenceResolvedCondition( cpGroup *konnectv1alpha2.KonnectGatewayControlPlane, )
SetControlPlaneGroupMembersReferenceResolvedCondition sets MembersReferenceResolved condition of control plane to True.
func SetControlPlaneGroupMembersReferenceResolvedConditionFalse ¶
func SetControlPlaneGroupMembersReferenceResolvedConditionFalse( cpGroup *konnectv1alpha2.KonnectGatewayControlPlane, reason kcfgconsts.ConditionReason, msg string, )
SetControlPlaneGroupMembersReferenceResolvedConditionFalse sets MembersReferenceResolved condition of control plane to False.
func SetKonnectEntityAdoptedConditionFalse ¶ added in v2.1.1
func SetKonnectEntityAdoptedConditionFalse( obj entityType, reason kcfgconsts.ConditionReason, err error, )
SetKonnectEntityAdoptedConditionFalse sets the KonnectEntityAdopted condition to false on the provided object.
func SetKonnectEntityAdoptedConditionTrue ¶ added in v2.1.1
func SetKonnectEntityAdoptedConditionTrue( obj entityType, )
SetKonnectEntityAdoptedConditionTrue sets the KonnectEntityAdopted condition to True on the provided object.
func SetKonnectEntityMirroredConditionFalse ¶
func SetKonnectEntityMirroredConditionFalse( obj entityType, err error, )
SetKonnectEntityMirroredConditionFalse sets the KonnectEntityMirrored condition to false on the provided object.
func SetKonnectEntityMirroredConditionTrue ¶
func SetKonnectEntityMirroredConditionTrue( obj entityType, )
SetKonnectEntityMirroredConditionTrue sets the KonnectEntityMirrored condition to true on the provided object.
func SetKonnectEntityProgrammedConditionFalse ¶
func SetKonnectEntityProgrammedConditionFalse( obj entityType, reason kcfgconsts.ConditionReason, err error, )
SetKonnectEntityProgrammedConditionFalse sets the KonnectEntityProgrammed condition to false on the provided object.
func SetKonnectEntityProgrammedConditionTrue ¶
func SetKonnectEntityProgrammedConditionTrue( obj entityType, )
SetKonnectEntityProgrammedConditionTrue sets the KonnectEntityProgrammed condition to true on the provided object.
func UIDLabelForObject ¶
UIDLabelForObject returns the Kubernetes UID label and provided object's UID separated by a semicolon.
func Update ¶
func Update[ T constraints.SupportedKonnectEntityType, TEnt constraints.EntityType[T], ]( ctx context.Context, sdk sdkops.SDKWrapper, syncPeriod time.Duration, cl client.Client, metricRecorder metrics.Recorder, e TEnt, ) (ctrl.Result, error)
Update updates a Konnect entity. It returns an error if the entity does not have a Konnect ID or if the operation fails.
func UpdateGeneratedOps ¶ added in v2.2.0
func UpdateGeneratedOps[ T constraints.SupportedKonnectEntityType, TEnt constraints.EntityType[T], ]( ctx context.Context, sdk sdkops.SDKWrapper, cl client.Client, e TEnt, ) error
UpdateGeneratedOps dispatches update operations to per-entity generated update functions. It is a stub dispatcher intended for Konnect entities whose ops layer is fully generated; entities handled by hand-written ops remain in the Update function in ops.go.
func WithKubernetesMetadataLabels ¶
func WithKubernetesMetadataLabels(obj ObjectWithMetadata, userSetLabels map[string]string) map[string]string
WithKubernetesMetadataLabels returns a map of user-provided labels to be assigned to a Konnect entity with the origin Kubernetes object's metadata added. These can be assigned to a Konnect entity that supports labels (e.g. ControlPlane).
func WithKubernetesMetadataLabelsPtr ¶ added in v2.2.0
func WithKubernetesMetadataLabelsPtr(obj ObjectWithMetadata, userSetLabels map[string]*string) map[string]*string
WithKubernetesMetadataLabelsPtr is the pointer-valued counterpart of WithKubernetesMetadataLabels for Konnect APIs whose label maps use nullable string values (map[string]*string). It preserves nil user-set entries (which semantically delete a label on update) while adding the Kubernetes metadata labels as non-nil values.
Types ¶
type CantPerformOperationWithoutControlPlaneIDError ¶
type CantPerformOperationWithoutControlPlaneIDError struct {
Entity entity
Op Op
}
CantPerformOperationWithoutControlPlaneIDError is an error indicating that an operation cannot be performed without a ControlPlane ID.
func (CantPerformOperationWithoutControlPlaneIDError) Error ¶
func (e CantPerformOperationWithoutControlPlaneIDError) Error() string
Error implements the error interface.
func (CantPerformOperationWithoutControlPlaneIDError) Is ¶ added in v2.2.0
func (e CantPerformOperationWithoutControlPlaneIDError) Is(target error) bool
Is reports any error in err's tree matches target.
type CantPerformOperationWithoutEventGatewayIDError ¶ added in v2.2.0
type CantPerformOperationWithoutEventGatewayIDError struct {
Entity entity
Op Op
}
CantPerformOperationWithoutEventGatewayIDError is an error indicating that an operation cannot be performed without a Konnect Event Gateway ID.
func (CantPerformOperationWithoutEventGatewayIDError) Error ¶ added in v2.2.0
func (e CantPerformOperationWithoutEventGatewayIDError) Error() string
type CantPerformOperationWithoutNetworkIDError ¶
type CantPerformOperationWithoutNetworkIDError struct {
Entity entity
Op Op
}
CantPerformOperationWithoutNetworkIDError is an error indicating that an operation cannot be performed without a Konnect network ID.
func (CantPerformOperationWithoutNetworkIDError) Error ¶
func (e CantPerformOperationWithoutNetworkIDError) Error() string
type CantPerformOperationWithoutParentIDError ¶ added in v2.2.0
CantPerformOperationWithoutParentIDError is an error indicating that an operation cannot be performed because the parent entity's Konnect ID has not been populated on the child object's status. Used by generated ops code for non-root (scoped) entities.
func (CantPerformOperationWithoutParentIDError) Error ¶ added in v2.2.0
func (e CantPerformOperationWithoutParentIDError) Error() string
type ConflictOnCreateButNoConflifctHandlingImplementedError ¶ added in v2.2.0
ConflictOnCreateButNoConflifctHandlingImplementedError is returned when a create request conflicts with an existing Konnect entity but no conflict resolution is implemented for the entity type.
func (ConflictOnCreateButNoConflifctHandlingImplementedError) Error ¶ added in v2.2.0
func (e ConflictOnCreateButNoConflifctHandlingImplementedError) Error() string
Error implements the error interface.
type ControlPlaneGroupMemberNoKonnectIDError ¶
ControlPlaneGroupMemberNoKonnectIDError is an error type returned when member of control plane group does not have a Konnect ID.
func (ControlPlaneGroupMemberNoKonnectIDError) Error ¶
func (e ControlPlaneGroupMemberNoKonnectIDError) Error() string
Error implements the error interface.
type CredentialBasicAuthSDK ¶
type CredentialBasicAuthSDK interface {
CreateBasicAuthWithConsumer(ctx context.Context, req sdkkonnectops.CreateBasicAuthWithConsumerRequest, opts ...sdkkonnectops.Option) (*sdkkonnectops.CreateBasicAuthWithConsumerResponse, error)
DeleteBasicAuthWithConsumer(ctx context.Context, request sdkkonnectops.DeleteBasicAuthWithConsumerRequest, opts ...sdkkonnectops.Option) (*sdkkonnectops.DeleteBasicAuthWithConsumerResponse, error)
UpsertBasicAuthWithConsumer(ctx context.Context, request sdkkonnectops.UpsertBasicAuthWithConsumerRequest, opts ...sdkkonnectops.Option) (*sdkkonnectops.UpsertBasicAuthWithConsumerResponse, error)
}
CredentialBasicAuthSDK is the interface for the Konnect CredentialBasicAuthSDK.
type EntityWithMatchingIDNotFoundError ¶
type EntityWithMatchingIDNotFoundError struct {
ID string
}
EntityWithMatchingIDNotFoundError is an error indicating that an entity with the matching ID was not found on Konnect.
func (EntityWithMatchingIDNotFoundError) Error ¶
func (e EntityWithMatchingIDNotFoundError) Error() string
Error implements the error interface.
type EntityWithMatchingUIDNotFoundError ¶
type EntityWithMatchingUIDNotFoundError struct {
Entity entity
}
EntityWithMatchingUIDNotFoundError is an error indicating that an entity with a matching UID was not found on Konnect.
func (EntityWithMatchingUIDNotFoundError) Error ¶
func (e EntityWithMatchingUIDNotFoundError) Error() string
Error implements the error interface.
type FailedKonnectOpError ¶
type FailedKonnectOpError[T constraints.SupportedKonnectEntityType] struct { Op Op Err error }
FailedKonnectOpError is an error type that is returned when an operation against Konnect API fails.
func (FailedKonnectOpError[T]) Error ¶
func (e FailedKonnectOpError[T]) Error() string
Error implements the error interface.
func (FailedKonnectOpError[T]) Unwrap ¶
func (e FailedKonnectOpError[T]) Unwrap() error
Unwrap returns the underlying error.
type GetControlPlaneGroupMemberFailedError ¶
GetControlPlaneGroupMemberFailedError is an error type returned when failed to get member of control plane group.
func (GetControlPlaneGroupMemberFailedError) Error ¶
func (e GetControlPlaneGroupMemberFailedError) Error() string
Error implements the error interface.
func (GetControlPlaneGroupMemberFailedError) Unwrap ¶
func (e GetControlPlaneGroupMemberFailedError) Unwrap() error
Unwrap returns the underlying error.
type KonnectEntityAdoptionFetchError ¶ added in v2.1.1
KonnectEntityAdoptionFetchError is an error type returned when failed to fetch the entity on trying to adopt an existing entity in Konnect.
func (KonnectEntityAdoptionFetchError) Error ¶ added in v2.1.1
func (e KonnectEntityAdoptionFetchError) Error() string
Error implements the error interface.
func (KonnectEntityAdoptionFetchError) Is ¶ added in v2.2.0
func (e KonnectEntityAdoptionFetchError) Is(target error) bool
Is reports any error in err's tree matches target.
func (KonnectEntityAdoptionFetchError) Unwrap ¶ added in v2.1.1
func (e KonnectEntityAdoptionFetchError) Unwrap() error
Unwrap returns the underlying error.
type KonnectEntityAdoptionMissingControlPlaneIDError ¶ added in v2.2.0
type KonnectEntityAdoptionMissingControlPlaneIDError struct{}
KonnectEntityAdoptionMissingControlPlaneIDError is an error type returned particular ControlPlane ID does not exist.
func (KonnectEntityAdoptionMissingControlPlaneIDError) Error ¶ added in v2.2.0
func (e KonnectEntityAdoptionMissingControlPlaneIDError) Error() string
Error implements the error interface.
func (KonnectEntityAdoptionMissingControlPlaneIDError) Is ¶ added in v2.2.0
func (e KonnectEntityAdoptionMissingControlPlaneIDError) Is(target error) bool
Is reports any error in err's tree matches target.
type KonnectEntityAdoptionNotMatchError ¶ added in v2.1.1
type KonnectEntityAdoptionNotMatchError struct {
KonnectID string
}
KonnectEntityAdoptionNotMatchError is an error type returned in adopting an existing entity in "match" mode but the configuration of the existing entity does not match the spec of the object.
func (KonnectEntityAdoptionNotMatchError) Error ¶ added in v2.1.1
func (e KonnectEntityAdoptionNotMatchError) Error() string
Error implements the error interface.
func (KonnectEntityAdoptionNotMatchError) Is ¶ added in v2.2.0
func (e KonnectEntityAdoptionNotMatchError) Is(target error) bool
Is reports any error in err's tree matches target.
type KonnectEntityAdoptionReferenceServiceIDMismatchError ¶ added in v2.2.0
type KonnectEntityAdoptionReferenceServiceIDMismatchError struct{}
KonnectEntityAdoptionReferenceServiceIDMismatchError is an error type returned when adopting an existing entity but the reference service ID does not match.
func (KonnectEntityAdoptionReferenceServiceIDMismatchError) Error ¶ added in v2.2.0
func (e KonnectEntityAdoptionReferenceServiceIDMismatchError) Error() string
Error implements the error interface.
func (KonnectEntityAdoptionReferenceServiceIDMismatchError) Is ¶ added in v2.2.0
func (e KonnectEntityAdoptionReferenceServiceIDMismatchError) Is(target error) bool
Is reports any error in err's tree matches target.
type KonnectEntityAdoptionRouteTypeNotSupportedError ¶ added in v2.2.0
type KonnectEntityAdoptionRouteTypeNotSupportedError struct {
RouteType sdkkonnectcomp.RouteUnionType
}
KonnectEntityAdoptionRouteTypeNotSupportedError is an error type returned when adopting an existing entity but the route type is not supported.
func (KonnectEntityAdoptionRouteTypeNotSupportedError) Error ¶ added in v2.2.0
func (e KonnectEntityAdoptionRouteTypeNotSupportedError) Error() string
Error implements the error interface.
func (KonnectEntityAdoptionRouteTypeNotSupportedError) Is ¶ added in v2.2.0
func (e KonnectEntityAdoptionRouteTypeNotSupportedError) Is(target error) bool
Is reports any error in err's tree matches target.
type KonnectEntityAdoptionUIDTagConflictError ¶ added in v2.1.1
KonnectEntityAdoptionUIDTagConflictError is an error type returned in adopting an existing entity when the entity has a tag to note that the entity is managed by another object with a different UID.
func (KonnectEntityAdoptionUIDTagConflictError) Error ¶ added in v2.1.1
func (e KonnectEntityAdoptionUIDTagConflictError) Error() string
Error implements the error interface.
type KonnectEntityCreatedButRelationsFailedError ¶
type KonnectEntityCreatedButRelationsFailedError struct {
KonnectID string
Reason kcfgconsts.ConditionReason
Err error
}
KonnectEntityCreatedButRelationsFailedError is an error type that is returned when an entity is created successfully in Konnect (an ID is assigned) but subsequent operations to create relations to the entity fail.
func (KonnectEntityCreatedButRelationsFailedError) Error ¶
func (e KonnectEntityCreatedButRelationsFailedError) Error() string
Error implements the error interface.
func (KonnectEntityCreatedButRelationsFailedError) Is ¶ added in v2.2.0
func (e KonnectEntityCreatedButRelationsFailedError) Is(target error) bool
Is reports any error in err's tree matches target.
func (KonnectEntityCreatedButRelationsFailedError) Unwrap ¶ added in v2.3.0
func (e KonnectEntityCreatedButRelationsFailedError) Unwrap() error
Unwrap returns the underlying error.
type KonnectOperationFailedError ¶ added in v2.2.0
KonnectOperationFailedError is an error type returned when a Konnect API operation fails. It includes the operation type, entity type name, entity key, and underlying error.
func (KonnectOperationFailedError) Error ¶ added in v2.2.0
func (e KonnectOperationFailedError) Error() string
Error implements the error interface.
func (KonnectOperationFailedError) Is ¶ added in v2.2.0
func (e KonnectOperationFailedError) Is(target error) bool
Is reports any error in err's tree matches target.
func (KonnectOperationFailedError) Unwrap ¶ added in v2.2.0
func (e KonnectOperationFailedError) Unwrap() error
type MirrorableEntity ¶ added in v2.3.0
type MirrorableEntity interface {
GetSource() *commonv1alpha1.EntitySource
GetMirror() *konnectv1alpha2.MirrorSpec
}
MirrorableEntity is implemented by generated Konnect CRD types that opted into Origin/Mirror source support via the crd-from-oas source.supportsMirror config. It lets isMirrorableEntity/isMirrorEntity recognize those types generically, without a per-type switch case. Hand-written mirror types (KonnectGatewayControlPlane, MCPServer) keep their explicit switch cases and do NOT implement this interface.
type MultipleEntitiesWithMatchingIDFoundError ¶
type MultipleEntitiesWithMatchingIDFoundError struct {
ID string
}
MultipleEntitiesWithMatchingIDFoundError is an error indicating that multiple entities with the same ID were found on Konnect.
func (MultipleEntitiesWithMatchingIDFoundError) Error ¶
func (e MultipleEntitiesWithMatchingIDFoundError) Error() string
Error implements the error interface.
type ObjectWithMetadata ¶
type ObjectWithMetadata interface {
metav1.Object
GetObjectKind() schema.ObjectKind
}
ObjectWithMetadata is an interface that accepts an object with Kubernetes metadata and object Kind information.
type Op ¶
type Op string
Op is the type for the operation type of a Konnect entity.
const ( // CreateOp is the operation type for creating a Konnect entity. CreateOp Op = "create" // GetOp is the operation type for getting a Konnect entity. GetOp Op = "get" // UpdateOp is the operation type for updating a Konnect entity. UpdateOp Op = "update" // DeleteOp is the operation type for deleting a Konnect entity. DeleteOp Op = "delete" // AdoptOp is the operation type for adopting an existing Konnect entity. AdoptOp Op = "adopt" )
type RateLimitError ¶ added in v2.1.1
RateLimitError is an error type returned when a Konnect API operation fails due to rate limiting (HTTP 429 Too Many Requests). It includes the retry-after duration to indicate when the operation can be retried.
func (RateLimitError) Error ¶ added in v2.1.1
func (e RateLimitError) Error() string
Error implements the error interface.
func (RateLimitError) Unwrap ¶ added in v2.1.1
func (e RateLimitError) Unwrap() error
Unwrap returns the underlying error.
type ReferenceError ¶ added in v2.1.8
ReferenceError is an error type returned when a Konnect API operation fails with a 400 that contains only ERROR_TYPE_REFERENCE errors. These are transient conflicts with referenced entities (e.g. a referenced upstream isn't fully propagated in Konnect yet). It includes a fixed retry-after duration to avoid controller-runtime's exponential backoff, which can grow prohibitively large when many entities are recreated at once.
func (ReferenceError) Error ¶ added in v2.1.8
func (e ReferenceError) Error() string
Error implements the error interface.
func (ReferenceError) Unwrap ¶ added in v2.1.8
func (e ReferenceError) Unwrap() error
Unwrap returns the underlying error.
Source Files
¶
- conditions.go
- credentialbasicauth.go
- errors.go
- objects_metadata.go
- ops.go
- ops_adopt_helpers.go
- ops_aigatewayconsumer_consumergroups.go
- ops_aigatewaymcpserver_manual.go
- ops_aigatewaymodel_manual.go
- ops_controlplane.go
- ops_credentialacl.go
- ops_credentialapikey.go
- ops_credentialbasicauth.go
- ops_credentialhmac.go
- ops_credentialjwt.go
- ops_errors.go
- ops_kongcacertificate.go
- ops_kongcertificate.go
- ops_kongconsumer.go
- ops_kongconsumergroup.go
- ops_kongdataplaneclientcertificate.go
- ops_kongkey.go
- ops_kongkeyset.go
- ops_kongpluginbinding.go
- ops_kongroute.go
- ops_kongservice.go
- ops_kongsni.go
- ops_kongtarget.go
- ops_kongupstream.go
- ops_kongvault.go
- ops_konnectdataplanegroupconfigurations.go
- ops_konnectnetwork.go
- ops_konnecttransitgateway.go
- ops_match_helpers.go
- ops_mcpserver.go
- zz_generated_ops_aigatewayagent.go
- zz_generated_ops_aigatewayauthstrategy.go
- zz_generated_ops_aigatewayconsumer.go
- zz_generated_ops_aigatewayconsumercredential.go
- zz_generated_ops_aigatewayconsumergroup.go
- zz_generated_ops_aigatewaydataplanecertificate.go
- zz_generated_ops_aigatewaymcpserver.go
- zz_generated_ops_aigatewaymodel.go
- zz_generated_ops_aigatewaymodelprovider.go
- zz_generated_ops_aigatewaypolicy.go
- zz_generated_ops_create.go
- zz_generated_ops_delete.go
- zz_generated_ops_eventgatewaybackendcluster.go
- zz_generated_ops_eventgatewaydataplanecertificate.go
- zz_generated_ops_eventgatewaylistener.go
- zz_generated_ops_eventgatewaylistenerpolicy.go
- zz_generated_ops_eventgatewayschemaregistry.go
- zz_generated_ops_eventgatewayvirtualcluster.go
- zz_generated_ops_eventgatewayvirtualclusterconsumepolicy.go
- zz_generated_ops_eventgatewayvirtualclusterpolicy.go
- zz_generated_ops_eventgatewayvirtualclusterproducepolicy.go
- zz_generated_ops_getforuid.go
- zz_generated_ops_konnect_aigateway.go
- zz_generated_ops_konnect_configstore.go
- zz_generated_ops_konnect_eventgateway.go
- zz_generated_ops_portal.go
- zz_generated_ops_portalcustomdomain.go
- zz_generated_ops_portalcustomization.go
- zz_generated_ops_portalemailconfig.go
- zz_generated_ops_portalidentityproviderrequest.go
- zz_generated_ops_portalipallowlist.go
- zz_generated_ops_portalpage.go
- zz_generated_ops_portalteam.go
- zz_generated_ops_update.go