Skip to content

Commit

Permalink
feat: disallow cross namespace services refs (#107)
Browse files Browse the repository at this point in the history
  • Loading branch information
pmalek authored Oct 3, 2024
1 parent dd5a5f6 commit d3282d5
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
7 changes: 5 additions & 2 deletions api/configuration/v1alpha1/service_ref.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,13 @@ type ServiceRef struct {
NamespacedRef *NamespacedServiceRef `json:"namespacedRef,omitempty"`
}

// NamespacedServiceRef is a namespaced reference to a KongService.
//
// NOTE: currently cross namespace references are not supported.
type NamespacedServiceRef struct {
// +kubebuilder:validation:Required
Name string `json:"name"`

// +kubebuilder:validation:Optional
Namespace string `json:"namespace,omitempty"`
// TODO: handle cross namespace references.
// https://github.com/Kong/kubernetes-configuration/issues/106
}
2 changes: 0 additions & 2 deletions config/crd/bases/configuration.konghq.com_kongroutes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,6 @@ spec:
properties:
name:
type: string
namespace:
type: string
required:
- name
type: object
Expand Down
4 changes: 2 additions & 2 deletions docs/api-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -1543,14 +1543,14 @@ _Appears in:_
#### NamespacedServiceRef



NamespacedServiceRef is a namespaced reference to a KongService.<br /><br />
NOTE: currently cross namespace references are not supported.



| Field | Description |
| --- | --- |
| `name` _string_ | |
| `namespace` _string_ | |


_Appears in:_
Expand Down

0 comments on commit d3282d5

Please sign in to comment.