Skip to content

Commit

Permalink
Add namespace field to ClusterDomainClaim
Browse files Browse the repository at this point in the history
This field has two purposes:

- It replaces the ownerReference for ensuring that only one
DomainMapping can use a ClusterDomainClaim at a time. This avoids a
cross-namespace ownerReference, which isn't supported.
- It allows Cluster Operators to delegate a particular domain name to a
namespace, allowing that namespace to create DomainMappings with a
particular name (and preventing other namespaces squatting or
intercepting the name).
  • Loading branch information
julz committed Jan 6, 2021
1 parent 99ffcf0 commit 3d2b26f
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
14 changes: 14 additions & 0 deletions pkg/apis/networking/v1alpha1/domainclaim_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ type ClusterDomainClaim struct {
// More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
metav1.ObjectMeta `json:"metadata,omitempty"`

// Spec is the desired state of the ClusterDomainClaim.
// More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
// +optional
Spec ClusterDomainClaimSpec `json:"spec,omitempty"`
}

var (
Expand All @@ -52,3 +57,12 @@ type ClusterDomainClaimList struct {
// Items is the list of ClusterDomainClaim objects.
Items []ClusterDomainClaim `json:"items"`
}

// ClusterDomainClaimSpec is the desired state of the ClusterDomainClaim.
// Its only field is `namespace`, which controls which namespace currently owns
// the ability to create a DomainMapping with the ClusterDomainClaim's name.
type ClusterDomainClaimSpec struct {
// Namespace is the namespace which is allowed to create a DomainMapping
// using this ClusterDomainClaim's name.
Namespace string `json:"namespace"`
}
17 changes: 17 additions & 0 deletions pkg/apis/networking/v1alpha1/zz_generated.deepcopy.go

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

0 comments on commit 3d2b26f

Please sign in to comment.