organization

package
v0.12.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 2, 2023 License: Apache-2.0 Imports: 6 Imported by: 6

Documentation

Overview

package organization implements types to handle creation and deletion of Organization resources.

Example

org := organization.NewRandomOrg()
orgNamespace := org.GetNamespace()
orgCR, err := org.Build

Using new Org for test cluster

cluster := application.NewClusterApp(utils.GenerateRandomName("t"), application.ProviderGCP).
		WithOrg(organization.NewRandomOrg())

The namespace for an Organization will always be the name of the org prefix with `org-`. For example, an Organization named `test-org` will have the namespace `org-test-org`. The creation and deletion of this namespace is handled by the organization-operator running on the Management Cluster so is not configurable here.

Index

Constants

View Source
const (
	// DeleteAnnotation is added to Organizations created during testing.
	// This is to ensure only those with this annotation can be deleted to avoid accidentally deleting a shared Org.
	DeleteAnnotation = "e2e-test-cleanup"
)

Variables

This section is empty.

Functions

func SafeToDelete

func SafeToDelete(orgCR orgv1alpha1.Organization) bool

SafeToDelete checks if the Org CR contains an annotation specific to E2E testing

Types

type Org

type Org struct {
	Name string
	// contains filtered or unexported fields
}

Org contains details about an Organization

func New

func New(name string) *Org

New returns a new Org with the provided name

func NewFromNamespace added in v0.3.0

func NewFromNamespace(namespace string) *Org

NewFromNamespace returns a new Org, taking the name from the passed namespace.

func NewRandomOrg

func NewRandomOrg() *Org

NewRandomOrg returns an Org with a randomly generated name

func (*Org) Build

func (o *Org) Build() (*orgv1alpha1.Organization, error)

Build generates the Organization CR for applying to the cluster

func (*Org) GetNamespace

func (o *Org) GetNamespace() string

GetNamespace returns the associated namespace for the Organization

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL