mirror of
https://github.com/projectcapsule/capsule.git
synced 2026-08-25 16:07:24 +00:00
feat(tenant): support gateway/class (#1463)
* feat(tenant): support gateway/class Signed-off-by: Hristo Hristov <me@hhristov.info> * feat(tenant): support gateway/class Signed-off-by: Hristo Hristov <me@hhristov.info> * feat(tenant): support gateway/class Signed-off-by: Hristo Hristov <me@hhristov.info> * feat(tenant): support gateway/class Signed-off-by: Hristo Hristov <me@hhristov.info> * feat(tenant): support gateway/class Signed-off-by: Hristo Hristov <me@hhristov.info> * feat(tenant): support gateway/class Signed-off-by: Hristo Hristov <me@hhristov.info> * feat(tenant): support gateway/class Signed-off-by: Hristo Hristov <me@hhristov.info> * feat(tenant): support gateway/class Signed-off-by: Hristo Hristov <me@hhristov.info> * feat(tenant): support gateway/class Signed-off-by: Hristo Hristov <me@hhristov.info> * feat(tenant): support gateway/class Signed-off-by: Hristo Hristov <me@hhristov.info> * feat(tenant): support gateway/class Signed-off-by: Hristo Hristov <me@hhristov.info> * feat(tenant): support gateway/class Signed-off-by: Hristo Hristov <me@hhristov.info> * feat(tenant): support gateway/class Signed-off-by: Hristo Hristov <me@hhristov.info> * feat(tenant): support gateway/class Signed-off-by: Hristo Hristov <me@hhristov.info> * feat(tenant): support gateway/class Signed-off-by: Hristo Hristov <me@hhristov.info> * feat(tenant): support gateway/class Signed-off-by: Hristo Hristov <me@hhristov.info> * feat(tenant): support gateway/class feat(tenant): support gateway/class Signed-off-by: Hristo Hristov <me@hhristov.info> Co-authored-by: Oliver Bähler <oliverbaehler@hotmail.com> * feat(tenant): support gateway/class Signed-off-by: Hristo Hristov <me@hhristov.info> * feat(tenant): support gateway/class Signed-off-by: Hristo Hristov <me@hhristov.info> * feat(tenant): support gateway/class Signed-off-by: Hristo Hristov <me@hhristov.info> * feat(tenant): support gateway/class Signed-off-by: Hristo Hristov <me@hhristov.info> * feat(tenant): support gateway/class Signed-off-by: Hristo Hristov <me@hhristov.info> --------- Signed-off-by: Hristo Hristov <me@hhristov.info> Co-authored-by: Oliver Bähler <oliverbaehler@hotmail.com>
This commit is contained in:
co-authored by
Oliver Bähler
parent
7d0a4c58fd
commit
a60ebfac5e
@@ -88,3 +88,32 @@ func (in *AllowedListSpec) RegexMatch(value string) (ok bool) {
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// +kubebuilder:object:generate=true
|
||||
type SelectionListWithDefaultSpec struct {
|
||||
SelectionListWithSpec `json:",inline"`
|
||||
Default string `json:"default,omitempty"`
|
||||
}
|
||||
|
||||
func (in *SelectionListWithDefaultSpec) MatchDefault(value string) bool {
|
||||
return in.Default == value
|
||||
}
|
||||
|
||||
// +kubebuilder:object:generate=true
|
||||
|
||||
type SelectionListWithSpec struct {
|
||||
metav1.LabelSelector `json:",inline"`
|
||||
}
|
||||
|
||||
func (in *SelectionListWithSpec) SelectorMatch(obj client.Object) bool {
|
||||
if obj != nil {
|
||||
selector, err := metav1.LabelSelectorAsSelector(&in.LabelSelector)
|
||||
if err != nil {
|
||||
return false
|
||||
}
|
||||
|
||||
return selector.Matches(labels.Set(obj.GetLabels()))
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
@@ -289,6 +289,38 @@ func (in *ResourceQuotaSpec) DeepCopy() *ResourceQuotaSpec {
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *SelectionListWithDefaultSpec) DeepCopyInto(out *SelectionListWithDefaultSpec) {
|
||||
*out = *in
|
||||
in.SelectionListWithSpec.DeepCopyInto(&out.SelectionListWithSpec)
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SelectionListWithDefaultSpec.
|
||||
func (in *SelectionListWithDefaultSpec) DeepCopy() *SelectionListWithDefaultSpec {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(SelectionListWithDefaultSpec)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *SelectionListWithSpec) DeepCopyInto(out *SelectionListWithSpec) {
|
||||
*out = *in
|
||||
in.LabelSelector.DeepCopyInto(&out.LabelSelector)
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SelectionListWithSpec.
|
||||
func (in *SelectionListWithSpec) DeepCopy() *SelectionListWithSpec {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(SelectionListWithSpec)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *SelectorAllowedListSpec) DeepCopyInto(out *SelectorAllowedListSpec) {
|
||||
*out = *in
|
||||
|
||||
Reference in New Issue
Block a user