Skip to content

Commit

Permalink
chore: do not use alias as that's unsupported by crd-ref-docs
Browse files Browse the repository at this point in the history
  • Loading branch information
pmalek committed Feb 13, 2025
1 parent a409a96 commit f5c6c4f
Show file tree
Hide file tree
Showing 38 changed files with 196 additions and 190 deletions.
3 changes: 1 addition & 2 deletions api/configuration/v1/kongconsumer_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

commonv1alpha1 "github.com/kong/kubernetes-configuration/api/common/v1alpha1"
configurationv1alpha1 "github.com/kong/kubernetes-configuration/api/configuration/v1alpha1"
konnectv1alpha1 "github.com/kong/kubernetes-configuration/api/konnect/v1alpha1"
)

Expand Down Expand Up @@ -76,7 +75,7 @@ type KongConsumer struct {
type KongConsumerSpec struct {
// ControlPlaneRef is a reference to a ControlPlane this Consumer is associated with.
// +optional
ControlPlaneRef *configurationv1alpha1.ControlPlaneRef `json:"controlPlaneRef,omitempty"`
ControlPlaneRef *commonv1alpha1.ControlPlaneRef `json:"controlPlaneRef,omitempty"`

// Tags is an optional set of tags applied to the consumer.
Tags commonv1alpha1.Tags `json:"tags,omitempty"`
Expand Down
5 changes: 2 additions & 3 deletions api/configuration/v1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions api/configuration/v1/zz_generated_funcs.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion api/configuration/v1alpha1/controlplaneref_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,12 @@ import (
commonv1alpha1 "github.com/kong/kubernetes-configuration/api/common/v1alpha1"
)

// NOTE: ControlPlaneRef is not a type alias because that doesn't work with crd-ref-docs.
// 2025-02-12T11:41:26.708Z ERROR crd-ref-docs Failed to process source directory {"error": "type not loaded: github.com/kong/kubernetes-configuration/api/common/v1alpha1.ControlPlaneRef"}

// ControlPlaneRef is the schema for the ControlPlaneRef type.
// It is used to reference a Control Plane entity.
type ControlPlaneRef = commonv1alpha1.ControlPlaneRef
type ControlPlaneRef commonv1alpha1.ControlPlaneRef

// KonnectNamespacedRef is the schema for the KonnectNamespacedRef type.
type KonnectNamespacedRef = commonv1alpha1.KonnectNamespacedRef
Expand Down
2 changes: 1 addition & 1 deletion api/configuration/v1alpha1/kong_ca_certificate.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ type KongCACertificate struct {
type KongCACertificateSpec struct {
// ControlPlaneRef references the Konnect Control Plane that this KongCACertificate should be created in.
// +kubebuilder:validation:Required
ControlPlaneRef *ControlPlaneRef `json:"controlPlaneRef"`
ControlPlaneRef *commonv1alpha1.ControlPlaneRef `json:"controlPlaneRef"`

KongCACertificateAPISpec `json:",inline"`
}
Expand Down
2 changes: 1 addition & 1 deletion api/configuration/v1alpha1/kong_certificate.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ type KongCertificate struct {
type KongCertificateSpec struct {
// ControlPlaneRef references the Konnect Control Plane that this KongCertificate should be created in.
// +kubebuilder:validation:Required
ControlPlaneRef *ControlPlaneRef `json:"controlPlaneRef"`
ControlPlaneRef *commonv1alpha1.ControlPlaneRef `json:"controlPlaneRef"`

KongCertificateAPISpec `json:",inline"`
}
Expand Down
2 changes: 1 addition & 1 deletion api/configuration/v1alpha1/kong_vault_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ type KongVaultSpec struct {
Tags commonv1alpha1.Tags `json:"tags,omitempty"`
// ControlPlaneRef is a reference to a Konnect ControlPlane this KongVault is associated with.
// +optional
ControlPlaneRef *ControlPlaneRef `json:"controlPlaneRef,omitempty"`
ControlPlaneRef *commonv1alpha1.ControlPlaneRef `json:"controlPlaneRef,omitempty"`
}

// KongVaultStatus represents the current status of the KongVault resource.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ package v1alpha1
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

commonv1alpha1 "github.com/kong/kubernetes-configuration/api/common/v1alpha1"
konnectv1alpha1 "github.com/kong/kubernetes-configuration/api/konnect/v1alpha1"
)

Expand Down Expand Up @@ -53,7 +54,7 @@ type KongDataPlaneClientCertificate struct {
type KongDataPlaneClientCertificateSpec struct {
// ControlPlaneRef is a reference to a Konnect ControlPlane this KongDataPlaneClientCertificate is associated with.
// +kubebuilder:validation:Required
ControlPlaneRef *ControlPlaneRef `json:"controlPlaneRef"`
ControlPlaneRef *commonv1alpha1.ControlPlaneRef `json:"controlPlaneRef"`

// KongDataPlaneClientCertificateAPISpec are the attributes of the KongDataPlaneClientCertificate itself.
KongDataPlaneClientCertificateAPISpec `json:",inline"`
Expand Down
2 changes: 1 addition & 1 deletion api/configuration/v1alpha1/kongkey_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ type KongKey struct {
type KongKeySpec struct {
// ControlPlaneRef is a reference to a Konnect ControlPlane this KongKey is associated with.
// +optional
ControlPlaneRef *ControlPlaneRef `json:"controlPlaneRef,omitempty"`
ControlPlaneRef *commonv1alpha1.ControlPlaneRef `json:"controlPlaneRef,omitempty"`

// KeySetRef is a reference to a KongKeySet this KongKey is attached to.
// ControlPlane referenced by a KongKeySet must be the same as the ControlPlane referenced by the KongKey.
Expand Down
2 changes: 1 addition & 1 deletion api/configuration/v1alpha1/kongkeyset_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ type KongKeySet struct {
type KongKeySetSpec struct {
// ControlPlaneRef is a reference to a Konnect ControlPlane with which KongKeySet is associated.
// +kubebuilder:validation:Required
ControlPlaneRef *ControlPlaneRef `json:"controlPlaneRef"`
ControlPlaneRef *commonv1alpha1.ControlPlaneRef `json:"controlPlaneRef"`

// KongKeySetAPISpec are the attributes of the KongKeySet itself.
KongKeySetAPISpec `json:",inline"`
Expand Down
3 changes: 2 additions & 1 deletion api/configuration/v1alpha1/kongpluginbinding_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ package v1alpha1
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

commonv1alpha1 "github.com/kong/kubernetes-configuration/api/common/v1alpha1"
konnectv1alpha1 "github.com/kong/kubernetes-configuration/api/konnect/v1alpha1"
)

Expand Down Expand Up @@ -97,7 +98,7 @@ type KongPluginBindingSpec struct {

// ControlPlaneRef is a reference to a ControlPlane this KongPluginBinding is associated with.
// +kubebuilder:validation:Required
ControlPlaneRef ControlPlaneRef `json:"controlPlaneRef,omitzero"`
ControlPlaneRef commonv1alpha1.ControlPlaneRef `json:"controlPlaneRef,omitzero"`

// Scope defines the scope of the plugin binding.
// +optional
Expand Down
2 changes: 1 addition & 1 deletion api/configuration/v1alpha1/kongroute_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ type KongRouteSpec struct {
// Route can either specify a ControlPlaneRef and be 'serviceless' route or
// specify a ServiceRef and be associated with a Service.
// +optional
ControlPlaneRef *ControlPlaneRef `json:"controlPlaneRef,omitempty"`
ControlPlaneRef *commonv1alpha1.ControlPlaneRef `json:"controlPlaneRef,omitempty"`
// ServiceRef is a reference to a Service this KongRoute is associated with.
// Route can either specify a ControlPlaneRef and be 'serviceless' route or
// specify a ServiceRef and be associated with a Service.
Expand Down
2 changes: 1 addition & 1 deletion api/configuration/v1alpha1/kongservice_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ type KongService struct {
type KongServiceSpec struct {
// ControlPlaneRef is a reference to a ControlPlane this KongService is associated with.
// +kubebuilder:validation:Required
ControlPlaneRef *ControlPlaneRef `json:"controlPlaneRef"`
ControlPlaneRef *commonv1alpha1.ControlPlaneRef `json:"controlPlaneRef"`

KongServiceAPISpec `json:",inline"`
}
Expand Down
2 changes: 1 addition & 1 deletion api/configuration/v1alpha1/kongupstream_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ type KongUpstream struct {
type KongUpstreamSpec struct {
// ControlPlaneRef is a reference to a ControlPlane this KongUpstream is associated with.
// +kubebuilder:validation:Required
ControlPlaneRef *ControlPlaneRef `json:"controlPlaneRef"`
ControlPlaneRef *commonv1alpha1.ControlPlaneRef `json:"controlPlaneRef"`

KongUpstreamAPISpec `json:",inline"`
}
Expand Down
43 changes: 34 additions & 9 deletions api/configuration/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit f5c6c4f

Please sign in to comment.