mirror of
https://github.com/projectcapsule/capsule.git
synced 2026-02-14 09:59:57 +00:00
* fix(docs): update home in chart.yaml Signed-off-by: sandert-k8s <sandert98@gmail.com> * fix: linter Signed-off-by: sandert-k8s <sandert98@gmail.com> --------- Signed-off-by: sandert-k8s <sandert98@gmail.com>
34 lines
640 B
Go
34 lines
640 B
Go
// Copyright 2020-2026 Project Capsule Authors
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
package tenant
|
|
|
|
import (
|
|
"sigs.k8s.io/controller-runtime/pkg/client"
|
|
|
|
capsulev1beta2 "github.com/projectcapsule/capsule/api/v1beta2"
|
|
)
|
|
|
|
type NamespacesReference struct {
|
|
Obj client.Object
|
|
}
|
|
|
|
func (o NamespacesReference) Object() client.Object {
|
|
return o.Obj
|
|
}
|
|
|
|
func (o NamespacesReference) Field() string {
|
|
return ".status.namespaces"
|
|
}
|
|
|
|
func (o NamespacesReference) Func() client.IndexerFunc {
|
|
return func(object client.Object) []string {
|
|
t, ok := object.(*capsulev1beta2.Tenant)
|
|
if !ok {
|
|
return nil
|
|
}
|
|
|
|
return t.Status.Namespaces
|
|
}
|
|
}
|