Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrOrganizationLabelMissing is returned when the organization label is not found on the cluster's namespace // or if the label value is empty. ErrOrganizationLabelMissing = errors.New("cluster namespace missing organization label or label value is empty") ErrNamespaceNotFound = errors.New("namespace not found") )
Functions ¶
This section is empty.
Types ¶
type NamespaceOrganizationRepository ¶
NamespaceOrganizationRepository implements OrganizationRepository by reading the organization from the cluster's namespace labels.
func (NamespaceOrganizationRepository) Read ¶
func (r NamespaceOrganizationRepository) Read(ctx context.Context, cluster *clusterv1.Cluster) (string, error)
Read fetches the organization ID from the labels of the namespace where the given CAPI cluster resides. It returns ErrOrganizationLabelMissing if the label is not present or its value is empty.
type OrganizationRepository ¶
type OrganizationRepository interface {
Read(ctx context.Context, cluster *clusterv1.Cluster) (string, error)
}
OrganizationRepository defines an interface for reading organization information.
func NewNamespaceRepository ¶
func NewNamespaceRepository(client client.Client) OrganizationRepository
NewNamespaceRepository creates a new NamespaceOrganizationRepository.
Click to show internal directories.
Click to hide internal directories.