-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(konnect): make controlPlaneRef optional for KongService, KongCon…
…sumer and KongPluginBinding
- Loading branch information
Showing
27 changed files
with
389 additions
and
146 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 17 additions & 15 deletions
32
api/configuration/v1alpha1/konnect_controlplaneref_types.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,41 @@ | ||
package v1alpha1 | ||
|
||
const ( | ||
ControlPlaneRefKonnectID = "konnectID" | ||
// ControlPlaneRefKonnectID is the type for the KonnectID ControlPlaneRef. | ||
// It is used to reference a Konnect Control Plane entity by its ID on the Konnect platform. | ||
ControlPlaneRefKonnectID = "konnectID" | ||
// ControlPlaneRefKonnectNamespacedRef is the type for the KonnectNamespacedRef ControlPlaneRef. | ||
// It is used to reference a Konnect Control Plane entity inside the cluster | ||
// using a namespaced reference. | ||
ControlPlaneRefKonnectNamespacedRef = "konnectNamespacedRef" | ||
ControlPlaneRefKIC = "kic" | ||
) | ||
|
||
// ControlPlaneRef is the schema for the ControlPlaneRef type. | ||
// It is used to reference a Control Plane entity. | ||
// +kubebuilder:validation:XValidation:rule="self.type == 'konnectNamespacedRef' ? has(self.konnectNamespacedRef) : true", message="when type is konnectNamespacedRef, konnectNamespacedRef must be set" | ||
type ControlPlaneRef struct { | ||
// Type can be one of: | ||
// - konnectID | ||
// - konnectNamespacedRef | ||
// - kic | ||
// +kubebuilder:validation:Enum=konnectID;konnectNamespacedRef | ||
Type string `json:"type,omitempty"` | ||
|
||
// TODO(pmalek) | ||
// KonnectID is the schema for the KonnectID type. | ||
// This field is required when the Type is konnectID. | ||
KonnectID *string `json:"konnectID,omitempty"` | ||
|
||
// KonnectNamespacedRef is a reference to a Konnect Control Plane entity inside the cluster. | ||
// It contains the name of the Konnect Control Plane and the namespace in which it exists. | ||
// If the namespace is not provided, it is assumed that the Konnect Control Plane | ||
// is in the same namespace as the resource that references it. | ||
// It contains the name of the Konnect Control Plane. | ||
// This field is required when the Type is konnectNamespacedRef. | ||
KonnectNamespacedRef *KonnectNamespacedRef `json:"konnectNamespacedRef,omitempty"` | ||
|
||
// TODO(pmalek) | ||
KIC *KIC `json:"kic,omitempty"` | ||
} | ||
|
||
// KonnectNamespacedRef is the schema for the KonnectNamespacedRef type. | ||
type KonnectNamespacedRef struct { | ||
// Name is the name of the Konnect Control Plane. | ||
// +kubebuilder:validation:Required | ||
Name string `json:"name"` | ||
|
||
// +kubebuilder:validation:Optional | ||
Namespace string `json:"namespace,omitempty"` | ||
// TODO: Implement cross namespace references: | ||
// https://github.com/Kong/kubernetes-configuration/issues/36 | ||
} | ||
|
||
// TODO(pmalek) | ||
type KIC struct{} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.