repositories

package
v0.0.0-...-1c213c1 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2022 License: Apache-2.0 Imports: 44 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StartedState DesiredState = "STARTED"
	StoppedState DesiredState = "STOPPED"

	Kind               string = "CFApp"
	APIVersion         string = "workloads.cloudfoundry.org/v1alpha1"
	TimestampFormat    string = time.RFC3339
	CFAppGUIDLabel     string = "workloads.cloudfoundry.org/app-guid"
	AppResourceType    string = "App"
	AppEnvResourceType string = "App Env"
)
View Source
const (
	BuildStateStaging = "STAGING"
	BuildStateStaged  = "STAGED"
	BuildStateFailed  = "FAILED"

	StagingConditionType   = "Staging"
	SucceededConditionType = "Succeeded"

	BuildResourceType = "Build"
)
View Source
const (
	OrgNameLabel   = "cloudfoundry.org/org-name"
	SpaceNameLabel = "cloudfoundry.org/space-name"

	OrgResourceType   = "Org"
	SpaceResourceType = "Space"
	OrgPrefix         = "cf-org-"
	SpacePrefix       = "cf-space-"
)
View Source
const (
	PackageStateAwaitingUpload = "AWAITING_UPLOAD"
	PackageStateReady          = "READY"

	PackageResourceType = "Package"
)
View Source
const (
	RunningState = "RUNNING"

	ProcessStatsResourceType = "Process Stats"
	PodMetricsResourceType   = "Pod Metrics"
)
View Source
const (
	RoleGuidLabel = "cloudfoundry.org/role-guid"

	RoleResourceType = "Role"
)
View Source
const (
	RouteResourceType = "Route"
	RoutePrefix       = "cf-route-"
)
View Source
const (
	LabelServiceBindingProvisionedService = "servicebinding.io/provisioned-service"
	ServiceBindingResourceType            = "Service Binding"
	ServiceBindingTypeApp                 = "app"
)
View Source
const (
	CFServiceInstanceGUIDLabel  = "services.cloudfoundry.org/service-instance-guid"
	ServiceInstanceResourceType = "Service Instance"
)
View Source
const (
	DomainResourceType = "Domain"
)
View Source
const (
	DropletResourceType = "Droplet"
)
View Source
const (
	ProcessResourceType = "Process"
)
View Source
const SourceImageResourceType = "SourceImage"

Variables

View Source
var (
	CFAppsGVR = schema.GroupVersionResource{
		Group:    "workloads.cloudfoundry.org",
		Version:  "v1alpha1",
		Resource: "cfapps",
	}

	CFBuildsGVR = schema.GroupVersionResource{
		Group:    "workloads.cloudfoundry.org",
		Version:  "v1alpha1",
		Resource: "cfbuilds",
	}

	CFDomainsGVR = schema.GroupVersionResource{
		Group:    "networking.cloudfoundry.org",
		Version:  "v1alpha1",
		Resource: "cfdomains",
	}

	CFDropletsGVR = schema.GroupVersionResource{
		Group:    "workloads.cloudfoundry.org",
		Version:  "v1alpha1",
		Resource: "cfbuilds",
	}

	CFPackagesGVR = schema.GroupVersionResource{
		Group:    "workloads.cloudfoundry.org",
		Version:  "v1alpha1",
		Resource: "cfpackages",
	}

	CFProcessesGVR = schema.GroupVersionResource{
		Group:    "workloads.cloudfoundry.org",
		Version:  "v1alpha1",
		Resource: "cfprocesses",
	}

	CFRoutesGVR = schema.GroupVersionResource{
		Group:    "networking.cloudfoundry.org",
		Version:  "v1alpha1",
		Resource: "cfroutes",
	}

	CFServiceBindingsGVR = schema.GroupVersionResource{
		Group:    "services.cloudfoundry.org",
		Version:  "v1alpha1",
		Resource: "cfservicebindings",
	}

	CFServiceInstancesGVR = schema.GroupVersionResource{
		Group:    "services.cloudfoundry.org",
		Version:  "v1alpha1",
		Resource: "cfserviceinstances",
	}

	ResourceMap = map[string]schema.GroupVersionResource{
		AppResourceType:             CFAppsGVR,
		BuildResourceType:           CFBuildsGVR,
		DropletResourceType:         CFDropletsGVR,
		DomainResourceType:          CFDomainsGVR,
		PackageResourceType:         CFPackagesGVR,
		ProcessResourceType:         CFProcessesGVR,
		RouteResourceType:           CFRoutesGVR,
		ServiceBindingResourceType:  CFServiceBindingsGVR,
		ServiceInstanceResourceType: CFServiceInstancesGVR,
	}
)

Functions

func GenerateProcessGUID

func GenerateProcessGUID() string

Types

type AddDestinationsToRouteMessage

type AddDestinationsToRouteMessage struct {
	RouteGUID            string
	SpaceGUID            string
	ExistingDestinations []DestinationRecord
	NewDestinations      []DestinationMessage
}

type AppEnvVarsRecord

type AppEnvVarsRecord struct {
	Name                 string
	AppGUID              string
	SpaceGUID            string
	EnvironmentVariables map[string]string
}

type AppRecord

type AppRecord struct {
	Name        string
	GUID        string
	EtcdUID     types.UID
	Revision    string
	SpaceGUID   string
	DropletGUID string
	Labels      map[string]string
	Annotations map[string]string
	State       DesiredState
	Lifecycle   Lifecycle
	CreatedAt   string
	UpdatedAt   string
	// contains filtered or unexported fields
}

type AppRepo

type AppRepo struct {
	// contains filtered or unexported fields
}

func NewAppRepo

func NewAppRepo(
	privilegedClient client.Client,
	namespaceRetriever NamespaceRetriever,
	userClientFactory UserK8sClientFactory,
	authPerms *authorization.NamespacePermissions,
) *AppRepo

func (*AppRepo) CreateApp

func (f *AppRepo) CreateApp(ctx context.Context, authInfo authorization.Info, appCreateMessage CreateAppMessage) (AppRecord, error)

func (*AppRepo) CreateOrPatchAppEnvVars

func (f *AppRepo) CreateOrPatchAppEnvVars(ctx context.Context, authInfo authorization.Info, envVariables CreateOrPatchAppEnvVarsMessage) (AppEnvVarsRecord, error)

func (*AppRepo) DeleteApp

func (f *AppRepo) DeleteApp(ctx context.Context, authInfo authorization.Info, message DeleteAppMessage) error

func (*AppRepo) GetApp

func (f *AppRepo) GetApp(ctx context.Context, authInfo authorization.Info, appGUID string) (AppRecord, error)

func (*AppRepo) GetAppByNameAndSpace

func (f *AppRepo) GetAppByNameAndSpace(ctx context.Context, authInfo authorization.Info, appName string, spaceGUID string) (AppRecord, error)

func (*AppRepo) GetAppEnv

func (f *AppRepo) GetAppEnv(ctx context.Context, authInfo authorization.Info, appGUID string) (map[string]string, error)

func (*AppRepo) ListApps

func (f *AppRepo) ListApps(ctx context.Context, authInfo authorization.Info, message ListAppsMessage) ([]AppRecord, error)

func (*AppRepo) PatchAppEnvVars

func (f *AppRepo) PatchAppEnvVars(ctx context.Context, authInfo authorization.Info, message PatchAppEnvVarsMessage) (AppEnvVarsRecord, error)

func (*AppRepo) SetAppDesiredState

func (f *AppRepo) SetAppDesiredState(ctx context.Context, authInfo authorization.Info, message SetAppDesiredStateMessage) (AppRecord, error)

func (*AppRepo) SetCurrentDroplet

func (f *AppRepo) SetCurrentDroplet(ctx context.Context, authInfo authorization.Info, message SetCurrentDropletMessage) (CurrentDropletRecord, error)

type AuthorizedInChecker

type AuthorizedInChecker interface {
	AuthorizedIn(ctx context.Context, identity authorization.Identity, namespace string) (bool, error)
}

type BuildRecord

type BuildRecord struct {
	GUID            string
	State           string
	CreatedAt       string
	UpdatedAt       string
	StagingErrorMsg string
	StagingMemoryMB int
	StagingDiskMB   int
	Lifecycle       Lifecycle
	PackageGUID     string
	DropletGUID     string
	AppGUID         string
	Labels          map[string]string
	Annotations     map[string]string
}

type BuildRepo

type BuildRepo struct {
	// contains filtered or unexported fields
}

func NewBuildRepo

func NewBuildRepo(namespaceRetriever NamespaceRetriever, userClientFactory UserK8sClientFactory) *BuildRepo

func (*BuildRepo) CreateBuild

func (b *BuildRepo) CreateBuild(ctx context.Context, authInfo authorization.Info, message CreateBuildMessage) (BuildRecord, error)

func (*BuildRepo) GetBuild

func (b *BuildRepo) GetBuild(ctx context.Context, authInfo authorization.Info, buildGUID string) (BuildRecord, error)

type BuildpackRecord

type BuildpackRecord struct {
	Name      string
	Position  int
	Stack     string
	Version   string
	CreatedAt string
	UpdatedAt string
}

type BuildpackRepository

type BuildpackRepository struct {
	// contains filtered or unexported fields
}

func NewBuildpackRepository

func NewBuildpackRepository(
	userClientFactory UserK8sClientFactory,
) *BuildpackRepository

func (*BuildpackRepository) GetBuildpacksForBuilder

func (r *BuildpackRepository) GetBuildpacksForBuilder(ctx context.Context, authInfo authorization.Info, builderName string) ([]BuildpackRecord, error)

type CreateAppMessage

type CreateAppMessage struct {
	Name                 string
	SpaceGUID            string
	Labels               map[string]string
	Annotations          map[string]string
	State                DesiredState
	Lifecycle            Lifecycle
	EnvironmentVariables map[string]string
}

type CreateBuildMessage

type CreateBuildMessage struct {
	AppGUID         string
	OwnerRef        metav1.OwnerReference
	PackageGUID     string
	SpaceGUID       string
	StagingMemoryMB int
	StagingDiskMB   int
	Lifecycle       Lifecycle
	Labels          map[string]string
	Annotations     map[string]string
}

type CreateOrPatchAppEnvVarsMessage

type CreateOrPatchAppEnvVarsMessage struct {
	AppGUID              string
	AppEtcdUID           types.UID
	SpaceGUID            string
	EnvironmentVariables map[string]string
}

type CreateOrgMessage

type CreateOrgMessage struct {
	Name        string
	Suspended   bool
	Labels      map[string]string
	Annotations map[string]string
}

type CreatePackageMessage

type CreatePackageMessage struct {
	Type      string
	AppGUID   string
	SpaceGUID string
	OwnerRef  metav1.OwnerReference
}

type CreateProcessMessage

type CreateProcessMessage struct {
	AppGUID          string
	SpaceGUID        string
	Type             string
	Command          string
	DiskQuotaMB      int64
	HealthCheck      HealthCheck
	DesiredInstances int
	MemoryMB         int64
}

type CreateRoleMessage

type CreateRoleMessage struct {
	GUID  string
	Type  string
	Space string
	Org   string
	User  string
	Kind  string
}

type CreateRouteMessage

type CreateRouteMessage struct {
	Host            string
	Path            string
	SpaceGUID       string
	DomainGUID      string
	DomainName      string
	DomainNamespace string
	Labels          map[string]string
	Annotations     map[string]string
}

type CreateServiceBindingMessage

type CreateServiceBindingMessage struct {
	Name                *string
	ServiceInstanceGUID string
	AppGUID             string
	SpaceGUID           string
}

type CreateServiceInstanceMessage

type CreateServiceInstanceMessage struct {
	Name        string
	SpaceGUID   string
	Credentials map[string]string
	Type        string
	Tags        []string
	Labels      map[string]string
	Annotations map[string]string
}

type CreateSpaceMessage

type CreateSpaceMessage struct {
	Name                     string
	OrganizationGUID         string
	ImageRegistryCredentials string
}

type CurrentDropletRecord

type CurrentDropletRecord struct {
	AppGUID     string
	DropletGUID string
}

type DeleteAppMessage

type DeleteAppMessage struct {
	AppGUID   string
	SpaceGUID string
}

type DeleteOrgMessage

type DeleteOrgMessage struct {
	GUID string
}

type DeleteRouteMessage

type DeleteRouteMessage struct {
	GUID      string
	SpaceGUID string
}

type DeleteServiceBindingMessage

type DeleteServiceBindingMessage struct {
	GUID string
}

type DeleteServiceInstanceMessage

type DeleteServiceInstanceMessage struct {
	GUID      string
	SpaceGUID string
}

type DeleteSpaceMessage

type DeleteSpaceMessage struct {
	GUID             string
	OrganizationGUID string
}

type DesiredState

type DesiredState string

type DestinationMessage

type DestinationMessage struct {
	AppGUID     string
	ProcessType string
	Port        int
	Protocol    string
}

type DestinationRecord

type DestinationRecord struct {
	GUID        string
	AppGUID     string
	ProcessType string
	Port        int
	Protocol    string
}

type DomainRecord

type DomainRecord struct {
	Name        string
	GUID        string
	Labels      map[string]string
	Annotations map[string]string
	Namespace   string
	CreatedAt   string
	UpdatedAt   string
}

type DomainRepo

type DomainRepo struct {
	// contains filtered or unexported fields
}

func NewDomainRepo

func NewDomainRepo(
	userClientFactory UserK8sClientFactory,
	namespaceRetriever NamespaceRetriever,
	rootNamespace string,
) *DomainRepo

func (*DomainRepo) GetDomain

func (r *DomainRepo) GetDomain(ctx context.Context, authInfo authorization.Info, domainGUID string) (DomainRecord, error)

func (*DomainRepo) GetDomainByName

func (r *DomainRepo) GetDomainByName(ctx context.Context, authInfo authorization.Info, domainName string) (DomainRecord, error)

func (*DomainRepo) ListDomains

func (r *DomainRepo) ListDomains(ctx context.Context, authInfo authorization.Info, message ListDomainsMessage) ([]DomainRecord, error)

type DropletRecord

type DropletRecord struct {
	GUID            string
	State           string
	CreatedAt       string
	UpdatedAt       string
	DropletErrorMsg string
	Lifecycle       Lifecycle
	Stack           string
	ProcessTypes    map[string]string
	AppGUID         string
	PackageGUID     string
	Labels          map[string]string
	Annotations     map[string]string
}

type DropletRepo

type DropletRepo struct {
	// contains filtered or unexported fields
}

func NewDropletRepo

func NewDropletRepo(
	userClientFactory UserK8sClientFactory,
	namespaceRetriever NamespaceRetriever,
	namespacePermissions *authorization.NamespacePermissions,
) *DropletRepo

func (*DropletRepo) GetDroplet

func (r *DropletRepo) GetDroplet(ctx context.Context, authInfo authorization.Info, dropletGUID string) (DropletRecord, error)

func (*DropletRepo) ListDroplets

func (r *DropletRepo) ListDroplets(ctx context.Context, authInfo authorization.Info, message ListDropletsMessage) ([]DropletRecord, error)

type HealthCheck

type HealthCheck struct {
	Type string
	Data HealthCheckData
}

type HealthCheckData

type HealthCheckData struct {
	HTTPEndpoint             string
	InvocationTimeoutSeconds int64
	TimeoutSeconds           int64
}

type ImageBuilder

type ImageBuilder interface {
	Build(ctx context.Context, srcReader io.Reader) (registryv1.Image, error)
}

type ImagePusher

type ImagePusher interface {
	Push(ctx context.Context, imageRef string, image registryv1.Image, credentials remote.Option) (string, error)
}

type ImageRepository

type ImageRepository struct {
	// contains filtered or unexported fields
}

func NewImageRepository

func NewImageRepository(
	privilegedK8sClient k8sclient.Interface,
	userClientFactory UserK8sClientFactory,
	rootNamespace,
	registrySecretName string,
	builder ImageBuilder,
	pusher ImagePusher,
) *ImageRepository

func (*ImageRepository) UploadSourceImage

func (r *ImageRepository) UploadSourceImage(ctx context.Context, authInfo authorization.Info, imageRef string, srcReader io.Reader, spaceGUID string) (string, error)

type Lifecycle

type Lifecycle struct {
	Type string
	Data LifecycleData
}

type LifecycleData

type LifecycleData struct {
	Buildpacks []string
	Stack      string
}

type ListAppsMessage

type ListAppsMessage struct {
	Names      []string
	Guids      []string
	SpaceGuids []string
}

type ListBuildpacksMessage

type ListBuildpacksMessage struct {
	OrderBy []string
}

type ListDomainsMessage

type ListDomainsMessage struct {
	Names []string
}

type ListDropletsMessage

type ListDropletsMessage struct {
	PackageGUIDs []string
}

type ListOrgsMessage

type ListOrgsMessage struct {
	Names []string
	GUIDs []string
}

type ListPackagesMessage

type ListPackagesMessage struct {
	AppGUIDs        []string
	SortBy          string
	DescendingOrder bool
	States          []string
}

type ListPodStatsMessage

type ListPodStatsMessage struct {
	Namespace   string
	AppGUID     string
	AppRevision string
	Instances   int
	ProcessGUID string
	ProcessType string
}

type ListProcessesMessage

type ListProcessesMessage struct {
	AppGUIDs  []string
	SpaceGUID string
}

type ListRoutesMessage

type ListRoutesMessage struct {
	AppGUIDs    []string
	SpaceGUIDs  []string
	DomainGUIDs []string
	Hosts       []string
	Paths       []string
}

type ListServiceBindingsMessage

type ListServiceBindingsMessage struct {
	AppGUIDs             []string
	ServiceInstanceGUIDs []string
}

type ListServiceInstanceMessage

type ListServiceInstanceMessage struct {
	Names           []string
	SpaceGuids      []string
	OrderBy         string
	DescendingOrder bool
}

type ListSpacesMessage

type ListSpacesMessage struct {
	Names             []string
	GUIDs             []string
	OrganizationGUIDs []string
}

type MetricsFetcherFn

type MetricsFetcherFn func(ctx context.Context, namespace, name string) (*metricsv1beta1.PodMetrics, error)

func CreateMetricsFetcher

func CreateMetricsFetcher(k8sClientConfig *rest.Config) (MetricsFetcherFn, error)

type NamespaceGetter

type NamespaceGetter interface {
	GetNamespaceForServiceInstance(ctx context.Context, guid string) (string, error)
}

type NamespaceRetriever

type NamespaceRetriever struct {
	// contains filtered or unexported fields
}

func NewNamespaceRetriver

func NewNamespaceRetriver(client dynamic.Interface) NamespaceRetriever

func (NamespaceRetriever) NamespaceFor

func (nr NamespaceRetriever) NamespaceFor(ctx context.Context, resourceGUID, resourceType string) (string, error)

type OrgRecord

type OrgRecord struct {
	Name        string
	GUID        string
	Suspended   bool
	Labels      map[string]string
	Annotations map[string]string
	CreatedAt   time.Time
	UpdatedAt   time.Time
}

type OrgRepo

type OrgRepo struct {
	// contains filtered or unexported fields
}

func NewOrgRepo

func NewOrgRepo(
	rootNamespace string,
	privilegedClient client.WithWatch,
	userClientFactory UserK8sClientFactory,
	nsPerms *authorization.NamespacePermissions,
	timeout time.Duration,
	authEnabled bool,
) *OrgRepo

func (*OrgRepo) CreateOrg

func (r *OrgRepo) CreateOrg(ctx context.Context, info authorization.Info, org CreateOrgMessage) (OrgRecord, error)

func (*OrgRepo) CreateSpace

func (r *OrgRepo) CreateSpace(ctx context.Context, info authorization.Info, message CreateSpaceMessage) (SpaceRecord, error)

func (*OrgRepo) DeleteOrg

func (r *OrgRepo) DeleteOrg(ctx context.Context, info authorization.Info, message DeleteOrgMessage) error

func (*OrgRepo) DeleteSpace

func (r *OrgRepo) DeleteSpace(ctx context.Context, info authorization.Info, message DeleteSpaceMessage) error

func (*OrgRepo) GetOrg

func (r *OrgRepo) GetOrg(ctx context.Context, info authorization.Info, orgGUID string) (OrgRecord, error)

func (*OrgRepo) GetSpace

func (r *OrgRepo) GetSpace(ctx context.Context, info authorization.Info, spaceGUID string) (SpaceRecord, error)

func (*OrgRepo) ListOrgs

func (r *OrgRepo) ListOrgs(ctx context.Context, info authorization.Info, filter ListOrgsMessage) ([]OrgRecord, error)

func (*OrgRepo) ListSpaces

func (r *OrgRepo) ListSpaces(ctx context.Context, info authorization.Info, message ListSpacesMessage) ([]SpaceRecord, error)

type PackageRecord

type PackageRecord struct {
	GUID      string
	UID       types.UID
	Type      string
	AppGUID   string
	SpaceGUID string
	State     string
	CreatedAt string // Can we also just use date objects directly here?
	UpdatedAt string
}

type PackageRepo

type PackageRepo struct {
	// contains filtered or unexported fields
}

func NewPackageRepo

func NewPackageRepo(
	userClientFactory UserK8sClientFactory,
	namespaceRetriever NamespaceRetriever,
	authPerms *authorization.NamespacePermissions,
) *PackageRepo

func (*PackageRepo) CreatePackage

func (r *PackageRepo) CreatePackage(ctx context.Context, authInfo authorization.Info, message CreatePackageMessage) (PackageRecord, error)

func (*PackageRepo) GetPackage

func (r *PackageRepo) GetPackage(ctx context.Context, authInfo authorization.Info, guid string) (PackageRecord, error)

func (*PackageRepo) ListPackages

func (r *PackageRepo) ListPackages(ctx context.Context, authInfo authorization.Info, message ListPackagesMessage) ([]PackageRecord, error)

func (*PackageRepo) UpdatePackageSource

func (r *PackageRepo) UpdatePackageSource(ctx context.Context, authInfo authorization.Info, message UpdatePackageSourceMessage) (PackageRecord, error)

type PatchAppEnvVarsMessage

type PatchAppEnvVarsMessage struct {
	AppGUID              string
	SpaceGUID            string
	EnvironmentVariables map[string]*string
}

type PatchProcessMessage

type PatchProcessMessage struct {
	SpaceGUID                           string
	ProcessGUID                         string
	Command                             *string
	DiskQuotaMB                         *int64
	HealthCheckHTTPEndpoint             *string
	HealthCheckInvocationTimeoutSeconds *int64
	HealthCheckTimeoutSeconds           *int64
	HealthCheckType                     *string
	DesiredInstances                    *int
	MemoryMB                            *int64
}

type PodRepo

type PodRepo struct {
	// contains filtered or unexported fields
}

func NewPodRepo

func NewPodRepo(
	userClientFactory UserK8sClientFactory,
	metricsFetcher MetricsFetcherFn,
) *PodRepo

func (*PodRepo) ListPodStats

func (r *PodRepo) ListPodStats(ctx context.Context, authInfo authorization.Info, message ListPodStatsMessage) ([]PodStatsRecord, error)

type PodStatsRecord

type PodStatsRecord struct {
	Type  string
	Index int
	State string `default:"DOWN"`
	Usage Usage
}

type PrivilegedClientFactory

type PrivilegedClientFactory struct {
	// contains filtered or unexported fields
}

func NewPrivilegedClientFactory

func NewPrivilegedClientFactory(config *rest.Config, mapper meta.RESTMapper) PrivilegedClientFactory

func (PrivilegedClientFactory) BuildClient

type ProcessRecord

type ProcessRecord struct {
	GUID             string
	SpaceGUID        string
	AppGUID          string
	Type             string
	Command          string
	DesiredInstances int
	MemoryMB         int64
	DiskQuotaMB      int64
	Ports            []int32
	HealthCheck      HealthCheck
	Labels           map[string]string
	Annotations      map[string]string
	CreatedAt        string
	UpdatedAt        string
}

type ProcessRepo

type ProcessRepo struct {
	// contains filtered or unexported fields
}

func NewProcessRepo

func NewProcessRepo(privilegedClient client.Client, namespaceRetriever NamespaceRetriever, userClientFactory UserK8sClientFactory, namespacePermissions *authorization.NamespacePermissions) *ProcessRepo

func (*ProcessRepo) CreateProcess

func (r *ProcessRepo) CreateProcess(ctx context.Context, authInfo authorization.Info, message CreateProcessMessage) error

func (*ProcessRepo) GetProcess

func (r *ProcessRepo) GetProcess(ctx context.Context, authInfo authorization.Info, processGUID string) (ProcessRecord, error)

func (*ProcessRepo) GetProcessByAppTypeAndSpace

func (r *ProcessRepo) GetProcessByAppTypeAndSpace(ctx context.Context, authInfo authorization.Info, appGUID, processType, spaceGUID string) (ProcessRecord, error)

func (*ProcessRepo) ListProcesses

func (r *ProcessRepo) ListProcesses(ctx context.Context, authInfo authorization.Info, message ListProcessesMessage) ([]ProcessRecord, error)

func (*ProcessRepo) PatchProcess

func (r *ProcessRepo) PatchProcess(ctx context.Context, authInfo authorization.Info, message PatchProcessMessage) (ProcessRecord, error)

func (*ProcessRepo) ScaleProcess

func (r *ProcessRepo) ScaleProcess(ctx context.Context, authInfo authorization.Info, scaleProcessMessage ScaleProcessMessage) (ProcessRecord, error)

type ProcessScaleValues

type ProcessScaleValues struct {
	Instances *int
	MemoryMB  *int64
	DiskMB    *int64
}

type RoleRecord

type RoleRecord struct {
	GUID      string
	CreatedAt time.Time
	UpdatedAt time.Time
	Type      string
	Space     string
	Org       string
	User      string
	Kind      string
}

type RoleRepo

type RoleRepo struct {
	// contains filtered or unexported fields
}

func NewRoleRepo

func NewRoleRepo(privilegedClient client.Client, userClientFactory UserK8sClientFactory, authorizedInChecker AuthorizedInChecker, rootNamespace string, roleMappings map[string]config.Role) *RoleRepo

func (*RoleRepo) CreateRole

func (r *RoleRepo) CreateRole(ctx context.Context, authInfo authorization.Info, role CreateRoleMessage) (RoleRecord, error)

type RouteRecord

type RouteRecord struct {
	GUID         string
	SpaceGUID    string
	Domain       DomainRecord
	Host         string
	Path         string
	Protocol     string
	Destinations []DestinationRecord
	Labels       map[string]string
	Annotations  map[string]string
	CreatedAt    string
	UpdatedAt    string
}

func (RouteRecord) UpdateDomainRef

func (r RouteRecord) UpdateDomainRef(d DomainRecord) RouteRecord

type RouteRepo

type RouteRepo struct {
	// contains filtered or unexported fields
}

func NewRouteRepo

func NewRouteRepo(
	privilegedClient client.Client,
	namespaceRetriever NamespaceRetriever,
	userClientFactory UserK8sClientFactory,
	authPerms *authorization.NamespacePermissions,
) *RouteRepo

func (*RouteRepo) AddDestinationsToRoute

func (f *RouteRepo) AddDestinationsToRoute(ctx context.Context, authInfo authorization.Info, message AddDestinationsToRouteMessage) (RouteRecord, error)

func (*RouteRepo) CreateRoute

func (f *RouteRepo) CreateRoute(ctx context.Context, authInfo authorization.Info, message CreateRouteMessage) (RouteRecord, error)

func (*RouteRepo) DeleteRoute

func (f *RouteRepo) DeleteRoute(ctx context.Context, authInfo authorization.Info, message DeleteRouteMessage) error

func (*RouteRepo) GetOrCreateRoute

func (f *RouteRepo) GetOrCreateRoute(ctx context.Context, authInfo authorization.Info, message CreateRouteMessage) (RouteRecord, error)

func (*RouteRepo) GetRoute

func (f *RouteRepo) GetRoute(ctx context.Context, authInfo authorization.Info, routeGUID string) (RouteRecord, error)

func (*RouteRepo) ListRoutes

func (f *RouteRepo) ListRoutes(ctx context.Context, authInfo authorization.Info, message ListRoutesMessage) ([]RouteRecord, error)

func (*RouteRepo) ListRoutesForApp

func (f *RouteRepo) ListRoutesForApp(ctx context.Context, authInfo authorization.Info, appGUID string, spaceGUID string) ([]RouteRecord, error)

type ScaleProcessMessage

type ScaleProcessMessage struct {
	GUID      string
	SpaceGUID string
	ProcessScaleValues
}

type ServiceBindingLastOperation

type ServiceBindingLastOperation struct {
	Type        string
	State       string
	Description *string
	CreatedAt   string
	UpdatedAt   string
}

type ServiceBindingRecord

type ServiceBindingRecord struct {
	GUID                string
	Type                string
	Name                *string
	AppGUID             string
	ServiceInstanceGUID string
	SpaceGUID           string
	CreatedAt           string
	UpdatedAt           string
	LastOperation       ServiceBindingLastOperation
}

type ServiceBindingRepo

type ServiceBindingRepo struct {
	// contains filtered or unexported fields
}

func NewServiceBindingRepo

func NewServiceBindingRepo(
	namespaceRetriever NamespaceRetriever,
	userClientFactory UserK8sClientFactory,
	namespacePermissions *authorization.NamespacePermissions,
) *ServiceBindingRepo

func (*ServiceBindingRepo) CreateServiceBinding

func (*ServiceBindingRepo) DeleteServiceBinding

func (r *ServiceBindingRepo) DeleteServiceBinding(ctx context.Context, authInfo authorization.Info, guid string) error

func (*ServiceBindingRepo) ListServiceBindings

func (r *ServiceBindingRepo) ListServiceBindings(ctx context.Context, authInfo authorization.Info, message ListServiceBindingsMessage) ([]ServiceBindingRecord, error)

func (*ServiceBindingRepo) ServiceBindingExists

func (r *ServiceBindingRepo) ServiceBindingExists(ctx context.Context, authInfo authorization.Info, spaceGUID, appGUID, serviceInstanceGUID string) (bool, error)

type ServiceInstanceRecord

type ServiceInstanceRecord struct {
	Name       string
	GUID       string
	SpaceGUID  string
	SecretName string
	Tags       []string
	Type       string
	CreatedAt  string
	UpdatedAt  string
}

type ServiceInstanceRepo

type ServiceInstanceRepo struct {
	// contains filtered or unexported fields
}

func NewServiceInstanceRepo

func NewServiceInstanceRepo(
	namespaceRetriever NamespaceRetriever,
	userClientFactory UserK8sClientFactory,
	namespacePermissions *authorization.NamespacePermissions,
) *ServiceInstanceRepo

func (*ServiceInstanceRepo) CreateServiceInstance

func (*ServiceInstanceRepo) DeleteServiceInstance

func (r *ServiceInstanceRepo) DeleteServiceInstance(ctx context.Context, authInfo authorization.Info, message DeleteServiceInstanceMessage) error

func (*ServiceInstanceRepo) GetServiceInstance

func (r *ServiceInstanceRepo) GetServiceInstance(ctx context.Context, authInfo authorization.Info, guid string) (ServiceInstanceRecord, error)

func (*ServiceInstanceRepo) ListServiceInstances

func (r *ServiceInstanceRepo) ListServiceInstances(ctx context.Context, authInfo authorization.Info, message ListServiceInstanceMessage) ([]ServiceInstanceRecord, error)

type SetAppDesiredStateMessage

type SetAppDesiredStateMessage struct {
	AppGUID      string
	SpaceGUID    string
	DesiredState string
}

type SetCurrentDropletMessage

type SetCurrentDropletMessage struct {
	AppGUID     string
	DropletGUID string
	SpaceGUID   string
}

type SpaceRecord

type SpaceRecord struct {
	Name             string
	GUID             string
	OrganizationGUID string
	Labels           map[string]string
	Annotations      map[string]string
	CreatedAt        time.Time
	UpdatedAt        time.Time
}

type UnprivilegedClientFactory

type UnprivilegedClientFactory struct {
	// contains filtered or unexported fields
}

func NewUnprivilegedClientFactory

func NewUnprivilegedClientFactory(config *rest.Config, mapper meta.RESTMapper) UnprivilegedClientFactory

func (UnprivilegedClientFactory) BuildClient

type UpdatePackageSourceMessage

type UpdatePackageSourceMessage struct {
	GUID               string
	SpaceGUID          string
	ImageRef           string
	RegistrySecretName string
}

type Usage

type Usage struct {
	Time *string
	CPU  *float64
	Mem  *int64
	Disk *int64
}

type UserK8sClientFactory

type UserK8sClientFactory interface {
	BuildClient(authorization.Info) (client.WithWatch, error)
}

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.
fake
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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