v1alpha1

package
v0.9.2-alpha Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2017 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Overview

+k8s:deepcopy-gen=package,register +groupName=platform.koli.io

Index

Constants

View Source
const (
	// SystemSecretName it's a secret resource created and updated dynamically by a controller.
	// It should be used for communicating between systems
	SystemSecretName   = "koli-system-token"
	DefaultClusterRole = "koli:mutator:default"
)
View Source
const (
	KoliPrefixValue    = "kolihub.io"
	ReleaseExpireAfter = 20
)

KoliPrefixValue is used for creating annotations and labels

View Source
const (
	// BrokerSystemNamespace is the portion name of a system namespace of the broker.
	// E.g.: system-[customer]-[org]
	BrokerSystemNamespace = "system"

	// BrokerSystemCustomer is the portion name of a system namespace of the broker.
	// E.g.: [namespace]-org-[org]
	BrokerSystemCustomer = "org"
	// GitRepositoryPathPrefix is used to construct the URL path of the repositories
	GitRepositoryPathPrefix = "repos"
	// GitReleasesPathPrefix is used to construct the URL path of the releases
	GitReleasesPathPrefix = "releases"
)
View Source
const (
	GroupName = "platform.koli.io"

	PlanResourceKind   = "Plan"
	PlanResourcePlural = "plans"

	ReleaseResourceKind   = "Release"
	ReleaseResourcePlural = "releases"

	// SystemNamespace it's where the global resources are persisted
	SystemNamespace = "koli-system"
)
View Source
const (
	// AnnotationNamespaceOwner is a string representing the owner of a namespace
	AnnotationNamespaceOwner = "kolihub.io/owner"
	// AnnotationBuild it's a boolean indicating to start a build, after it start the value
	// must be updated to "false"
	AnnotationBuild = "kolihub.io/build"
	// AnnotationBuildRevision is a integer indicating the revision for each new builds, MUST be incremented on
	// each new build
	AnnotationBuildRevision = "kolihub.io/buildrevision"
	// AnnotationAutoDeploy boolean indicating to deploy a new app after the build
	AnnotationAutoDeploy = "kolihub.io/autodeploy" // DEPRECATED
	// AnnotationGitRepository it's a string holding information about the name of the repository, e.g.: owner/repository
	AnnotationGitRepository = "kolihub.io/gitrepository"
	// AnnotationGitRemote it's a string containing information about the remote git repository, e.g.: https://github.com/kolihub/koli
	AnnotationGitRemote = "kolihub.io/gitremote"
	// AnnotationGitRevision it's a string SHA refering to a commit
	AnnotationGitRevision = "kolihub.io/gitrevision"
	// AnnotationGitBranch is the name of the branch to accept webhook requests
	AnnotationGitBranch = "kolihub.io/gitbranch"
	// DEPRECATED, the authToken for each release is populated by a secret
	// the lifecycle of the token is managed by a controller
	// AnnotationAuthToken it's a string credential to communication with the release server
	AnnotationAuthToken = "kolihub.io/authtoken"
	// AnnotationBuildSource it's the source of the request which triggered the build: github (webhook), local, gitstep, etc
	AnnotationBuildSource = "kolihub.io/source"

	AnnotationGitAuthorAvatar  = "kolihub.io/git-author-avatar"
	AnnotationGitAuthorName    = "kolihub.io/git-author-name"
	AnnotationGitCommitMessage = "kolihub.io/git-commit-message"
	AnnotationGitCommitID      = "kolihub.io/git-commit-id"
	AnnotationGitCommitURL     = "kolihub.io/git-commit-url"

	// AnnotationGitCompare information comparing the last commit with the current one
	// https://help.github.com/articles/comparing-commits-across-time/
	AnnotationGitCompare = "kolihub.io/gitcompare"
	// AnnotationGitHubSecretHook contains the webhook secret for validating requests
	AnnotationGitHubSecretHook = "kolihub.io/hook-secret"
	// AnnotationGitHubUser refers to the user who connected the repository
	// the access token of this user will be used to query the GitHub api
	AnnotationGitHubUser = "kolihub.io/gituser"
	// AnnotationSetupStorage it's a boolean indicating to setup the storage onto resources (deploy, statefulset),
	// after the setup finished the value must be turned to "false"
	AnnotationSetupStorage = "kolihub.io/setup-storage"
	// AnnotationApp is used to identify the deployment from a parent resource
	AnnotationApp = "kolihub.io/app"

	// AnnotationSecretLastUpdated informs when a system token was last updated at
	AnnotationSecretLastUpdated = "secret.kolihub.io/updated-at"
)
View Source
const (
	// LabelAllowKongTraffic is a key which accepts a boolean string to enable/disable network traffic
	// flow between the kong namespace and all namespaces that has this annotation.
	LabelAllowKongTraffic = "kolihub.io/allow-kong-traffic"
	// LabelCustomer it's a string representing the name of the customer in the platform
	LabelCustomer = "kolihub.io/customer"
	// LabelOrganization it's a string representing the name of the organization in the platform
	LabelOrganization = "kolihub.io/org"
	// LabelClusterPlan refers to the specified plan of the resource (statefulset, deployment)
	LabelClusterPlan = "kolihub.io/clusterplan"
	// LabelStoragePlan refers to the specified storage plan of the resource (statefulset, deployment)
	LabelStoragePlan = "kolihub.io/storage-plan"
	// LabelDefault indicates a resource as default (boolean)
	LabelDefault = "kolihub.io/default"

	// LabelSecretController identifies resources created by the secret controller
	LabelSecretController = "secret.kolihub.io"
)
View Source
const (

	// ResourceNamespace , number
	ResourceNamespace v1.ResourceName = "namespaces"
)

Variables

View Source
var (
	// SchemeGroupVersion is group version used to register these objects
	SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1"}

	PlanResourceName    = PlanResourcePlural + "." + GroupName
	ReleaseResourceName = ReleaseResourcePlural + "." + GroupName
)
View Source
var (
	// SchemeBuilder collects functions that add things to a scheme. It's to allow
	// code to compile without explicitly referencing generated types. You should
	// declare one in each package that will have generated deep copy or conversion
	// functions.
	SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes)
	// AddToScheme applies all the stored functions to the scheme. A non-nil error
	// indicates that one function failed and the attempt was abandoned.
	AddToScheme = SchemeBuilder.AddToScheme
)
View Source
var PlatformRegisteredRoles []PlatformRole

PlatformRegisteredRoles contains all the cluster roles provisioned on the platform

Functions

func DeploymentDeepCopy

func DeploymentDeepCopy(d *v1beta1.Deployment) (*v1beta1.Deployment, error)

DeploymentDeepCopy creates a deep-copy from the specified resource

func Kind

func Kind(kind string) schema.GroupKind

Kind takes an unqualified kind and returns a Group qualified GroupKind

func NamespaceDeepCopy

func NamespaceDeepCopy(ns *v1.Namespace) (*v1.Namespace, error)

NamespaceDeepCopy creates a deep-copy from a Namespace

func RegisterDeepCopies deprecated

func RegisterDeepCopies(scheme *runtime.Scheme) error

RegisterDeepCopies adds deep-copy functions to the given scheme. Public to allow building arbitrary schemes.

Deprecated: deepcopy registration will go away when static deepcopy is fully implemented.

func Resource

func Resource(resource string) schema.GroupResource

Resource takes an unqualified resource and returns a Group qualified GroupResource

func StatefulSetDeepCopy

func StatefulSetDeepCopy(petset *v1beta1.StatefulSet) (*v1beta1.StatefulSet, error)

StatefulSetDeepCopy creates a deep-copy from a StatefulSet https://github.com/kubernetes/kubernetes/blob/master/docs/devel/controllers.md

Types

type Addon

type Addon struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`
	Spec              AddonSpec `json:"spec"`
}

Addon defines integration with external resources

func (*Addon) DeepCopy

func (in *Addon) DeepCopy() *Addon

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Addon.

func (*Addon) DeepCopyInto

func (in *Addon) DeepCopyInto(out *Addon)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*Addon) GetImage

func (a *Addon) GetImage() string

GetImage gets the BaseImage + Version

func (*Addon) GetReplicas

func (a *Addon) GetReplicas() *int32

GetReplicas returns the size of replicas, if is less than 1 sets a default value

type AddonList

type AddonList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`

	Items []Addon `json:"items"`
}

AddonList is a list of Addons.

func (*AddonList) DeepCopy

func (in *AddonList) DeepCopy() *AddonList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AddonList.

func (*AddonList) DeepCopyInto

func (in *AddonList) DeepCopyInto(out *AddonList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type AddonSpec

type AddonSpec struct {
	Type      string      `json:"type"`
	BaseImage string      `json:"baseImage"`
	Version   string      `json:"version"`
	Replicas  int32       `json:"replicas"`
	Port      int32       `json:"port"`
	Env       []v1.EnvVar `json:"env"`
	// More info: http://releases.k8s.io/HEAD/docs/user-guide/containers.md#containers-and-commands
	Args []string `json:"args,omitempty"`
}

AddonSpec holds specification parameters of an addon

func (*AddonSpec) DeepCopy

func (in *AddonSpec) DeepCopy() *AddonSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AddonSpec.

func (*AddonSpec) DeepCopyInto

func (in *AddonSpec) DeepCopyInto(out *AddonSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Domain

type Domain struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec   DomainSpec   `json:"spec,omitempty"`
	Status DomainStatus `json:"status,omitempty"`
}

Domain are a way for users to "claim" a domain and be able to create ingresses

func (*Domain) DeepCopy

func (in *Domain) DeepCopy() *Domain

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Domain.

func (*Domain) DeepCopyInto

func (in *Domain) DeepCopyInto(out *Domain)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*Domain) DeepCopyObject

func (in *Domain) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

func (*Domain) GetDomain

func (d *Domain) GetDomain() string

func (*Domain) GetDomainType

func (d *Domain) GetDomainType() string

GetDomainType returns the type of the resource: 'primary' or 'shared'

func (*Domain) GetPrimaryDomain

func (d *Domain) GetPrimaryDomain() string

GetPrimaryDomain returns the primary domain of the resource

func (*Domain) HasDelegate

func (d *Domain) HasDelegate(namespace string) bool

HasDelegate verifies if the the resource has the target namespace in the delegates attribute

func (*Domain) HasFinalizer

func (d *Domain) HasFinalizer(finalizer string) bool

func (*Domain) IsOK

func (d *Domain) IsOK() bool

IsOK verifies if the resource is in the OK state

func (*Domain) IsPrimary

func (d *Domain) IsPrimary() bool

IsPrimary validates if it's a primary domain

func (*Domain) IsValidDomain

func (d *Domain) IsValidDomain() bool

func (*Domain) IsValidSharedDomain

func (d *Domain) IsValidSharedDomain() bool

IsValidSharedDomain verifies if the shared domain it's a subdomain from the primary

type DomainList

type DomainList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`

	Items []Domain `json:"items"`
}

DomainList is a List of Domain

func (*DomainList) DeepCopy

func (in *DomainList) DeepCopy() *DomainList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DomainList.

func (*DomainList) DeepCopyInto

func (in *DomainList) DeepCopyInto(out *DomainList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*DomainList) DeepCopyObject

func (in *DomainList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type DomainPhase

type DomainPhase string

DomainPhase is a label for the condition of a domain at the current time.

const (
	// DomainStatusNew means it's a new resource and the phase it's not set
	DomainStatusNew DomainPhase = ""
	// DomainStatusOK means the domain doesn't have no pending operations or prohibitions,
	// and new ingresses could be created using the target domain.
	DomainStatusOK DomainPhase = "OK"
	// DomainStatusPending indicates that a request to create a new domain
	// has been received and is being processed.
	DomainStatusPending DomainPhase = "Pending"
	// DomainStatusFailed means the resource has failed on claiming the domain
	DomainStatusFailed DomainPhase = "Failed"
)

type DomainSpec

type DomainSpec struct {
	// PrimaryDomain is the name of the primary domain, to set the resource as primary,
	// 'name' and 'primary' must have the same value.
	// +required
	PrimaryDomain string `json:"primary,omitempty"`
	// Sub is the label of the Primary Domain to form a subdomain
	// +optional
	Sub string `json:"sub,omitempty"`
	// Delegates contains a list of namespaces that are allowed to use this domain.
	// New domain resources could be referenced to primary ones using the 'parent' key.
	// A wildcard ("*") allows delegate access to all namespaces in the cluster.
	// +optional
	Delegates []string `json:"delegates,omitempty"`
	// Parent refers to the namespace where the primary domain is in.
	// It only makes sense when the type of the domain is set to 'shared',
	// +optional
	Parent string `json:"parent,omitempty"`
}

DomainSpec represents information about a domain claim

func (*DomainSpec) DeepCopy

func (in *DomainSpec) DeepCopy() *DomainSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DomainSpec.

func (*DomainSpec) DeepCopyInto

func (in *DomainSpec) DeepCopyInto(out *DomainSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type DomainStatus

type DomainStatus struct {
	// The state of the domain, an empty state means it's a new resource
	// +optional
	Phase DomainPhase `json:"phase,omitempty"`
	// A human readable message indicating details about why the domain claim is in this state.
	// +optional
	Message string `json:"message,omitempty"`
	// A brief CamelCase message indicating details about why the domain claim is in this state. e.g. 'AlreadyClaimed'
	// +optional
	Reason string `json:"reason,omitempty"`
	// The last time the resource was updated
	LastUpdateTime *metav1.Time `json:"lastUpdateTime,omitempty"`
	// DeletionTimestamp it's a temporary field to work around the issue:
	// https://github.com/kubernetes/kubernetes/issues/40715, once it's solved,
	// remove this field and use the DeletionTimestamp from metav1.ObjectMeta
	DeletionTimestamp *metav1.Time `json:"deletionTimestamp,omitempty"`
}

DomainStatus represents information about the status of a domain.

func (*DomainStatus) DeepCopy

func (in *DomainStatus) DeepCopy() *DomainStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DomainStatus.

func (*DomainStatus) DeepCopyInto

func (in *DomainStatus) DeepCopyInto(out *DomainStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ErrInvalidGitSha

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

ErrInvalidGitSha is returned by NewSha if the given raw sha is invalid for any reason.

func (ErrInvalidGitSha) Error

func (e ErrInvalidGitSha) Error() string

Error is the error interface implementation.

type GitInfo

type GitInfo struct {
	Name          string           `json:"name"`
	Namespace     string           `json:"namespace"`
	KubeRef       string           `json:"kubeRef"`
	Lang          string           `json:"lang"`
	GitBranch     string           `json:"gitBranch"`
	SourceType    string           `json:"source"`
	CreatedAt     time.Time        `json:"createdAt"`
	FinishedAt    time.Time        `json:"finishedAt"`
	HeadCommit    HeadCommit       `json:"headCommit"`
	Files         map[string]int64 `json:"files"`
	BuildDuration time.Duration    `json:"buildDuration"`
	Status        v1.PodPhase      `json:"status"`
}

func (*GitInfo) AddFile

func (i *GitInfo) AddFile(filename string, size int64)

AddFile add filename with size in the map

func (*GitInfo) GetCommitSha

func (i *GitInfo) GetCommitSha() *SHA

GetCommitSha returns a SHA struct, nil if the commit is invalid

type GitInfoList

type GitInfoList struct {
	Total int       `json:"total"`
	Items []GitInfo `json:"items"`
}

type HeadCommit

type HeadCommit struct {
	ID        string `json:"id"`
	Author    string `json:"author"`
	AvatarURL string `json:"avatar-url"`
	Compare   string `json:"compare"`
	Message   string `json:"message"`
	URL       string `json:"url"`
}

HeadCommit holds information about a particular commit

type Namespace

type Namespace struct {
	Namespace    string
	Customer     string
	Organization string
}

Namespace represents the existent metadata of the platform namespace containing the name of the namespace, organization and the name of the customer in the form: [namespace]-[customer]-[organization]

func NewNamespace

func NewNamespace(namespace string) (*Namespace, error)

NewNamespace extract the organization, customer and the name of the namespace

func (*Namespace) DeepCopy

func (in *Namespace) DeepCopy() *Namespace

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Namespace.

func (*Namespace) DeepCopyInto

func (in *Namespace) DeepCopyInto(out *Namespace)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*Namespace) GetNamespace

func (n *Namespace) GetNamespace() string

GetNamespace retrieves the original namespace

func (*Namespace) GetSystemNamespace

func (n *Namespace) GetSystemNamespace() string

GetSystemNamespace returns the system broker namespace

func (*Namespace) IsSystem

func (n *Namespace) IsSystem() bool

IsSystem returns true if it's a system broker namespace.

type Plan

type Plan struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec PlanSpec `json:"spec"`
}

Plan defines how resources could be managed and distributed

func ServicePlanDeepCopy

func ServicePlanDeepCopy(sp *Plan) (*Plan, error)

ServicePlanDeepCopy creates a deep-copy from the specified resource

func (*Plan) CPU

func (p *Plan) CPU() (*resource.Quantity, *resource.Quantity)

CPU return the CPU from limits and requests respectively

func (*Plan) DeepCopy

func (in *Plan) DeepCopy() *Plan

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Plan.

func (*Plan) DeepCopyInto

func (in *Plan) DeepCopyInto(out *Plan)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*Plan) DeepCopyObject

func (in *Plan) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

func (*Plan) IsDefaultType

func (p *Plan) IsDefaultType() bool

IsDefaultType validate if the plan is PlanTypeDefault

func (*Plan) IsStorageType

func (p *Plan) IsStorageType() bool

IsStorageType validate if the plan is PlanTypeStorage

func (*Plan) Memory

func (p *Plan) Memory() (*resource.Quantity, *resource.Quantity)

Memory returns the memory from limits and requests respectively

func (*Plan) Storage

func (p *Plan) Storage() *resource.Quantity

Storage returns the storage ammount from the spec

type PlanList

type PlanList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`

	Items []Plan `json:"items"`
}

PlanList is a list of ServicePlans

func (*PlanList) DeepCopy

func (in *PlanList) DeepCopy() *PlanList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PlanList.

func (*PlanList) DeepCopyInto

func (in *PlanList) DeepCopyInto(out *PlanList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*PlanList) DeepCopyObject

func (in *PlanList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type PlanSpec

type PlanSpec struct {
	// Type determine how resources are provisioned by the controller,
	// defaults to Compute and Kubernetes Object resources. Valid options are: "" and Storage.
	// "" means the spec will provision memory and CPU from the 'resources' attribute,
	// 'hard' could be used to limit the usage of Kubernetes resources
	Type PlanType `json:"type,omitempty"`
	// Compute Resources required by containers.
	Resources v1.ResourceRequirements `json:"resources,omitempty"`
	// Hard is the set of desired hard limits for Kubernetes objects resources.
	Hard ResourceList `json:"hard,omitempty"`
	// Storage is the ammount of storage requested
	Storage resource.Quantity `json:"storage,omitempty"`
	// DefaultClusterRole is the reference cluster role name
	// to create a rolebinding for each user on the platform
	DefaultClusterRole string `json:"defaultClusterRole,omitempty"`
}

PlanSpec holds specification parameters of an Plan

func (*PlanSpec) DeepCopy

func (in *PlanSpec) DeepCopy() *PlanSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PlanSpec.

func (*PlanSpec) DeepCopyInto

func (in *PlanSpec) DeepCopyInto(out *PlanSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type PlanType

type PlanType string

PlanType describes the rules how resources are going to be provisioned

const (
	// PlanTypeDefault means a plan will consider only compute (memory, CPU) and
	// Kubernetes resources (pods, services, etc)
	PlanTypeDefault PlanType = ""
	// PlanTypeStorage means a plan will consider only storage resources
	PlanTypeStorage PlanType = "Storage"
)

type PlatformRole

type PlatformRole string

PlatformRole is the name identifying various roles in a PlatformRoleList.

const (
	// RoleExecAllow cluster role name
	RoleExecAllow PlatformRole = "exec-allow"
	// RolePortForwardAllow cluster role name
	RolePortForwardAllow PlatformRole = "portforward-allow"
	// RoleAutoScaleAllow cluster role name
	RoleAutoScaleAllow PlatformRole = "autoscale-allow"
	// RoleAttachAllow cluster role name
	RoleAttachAllow PlatformRole = "attach-allow"
	// RoleAddonManagement cluster role name
	RoleAddonManagement PlatformRole = "addon-management"
)

func NewPlatformRoles

func NewPlatformRoles(roles string) []PlatformRole

NewPlatformRoles converts a string of comma separated roles to registered []PlatformRoles

func (PlatformRole) Exists

func (r PlatformRole) Exists(roles []PlatformRole) bool

Exists verifies if the slice contains the role

func (PlatformRole) GetRoleBinding

func (r PlatformRole) GetRoleBinding(subjects []rbac.Subject) *rbac.RoleBinding

GetRoleBinding retrieves a role binding for this role

func (PlatformRole) IsRegisteredRole

func (r PlatformRole) IsRegisteredRole() bool

IsRegisteredRole check if the role matches with the registered roles.

type Release

type Release struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`
	Spec              ReleaseSpec `json:"spec"`
}

Release refers to compiled slug file versions

func ReleaseDeepCopy

func ReleaseDeepCopy(r *Release) (*Release, error)

ReleaseDeepCopy creates a deep-copy from the specified resource

func (*Release) BuildRevision

func (r *Release) BuildRevision() int

BuildRevision returns the revision as int, if the conversion fails returns 0

func (*Release) DeepCopy

func (in *Release) DeepCopy() *Release

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Release.

func (*Release) DeepCopyInto

func (in *Release) DeepCopyInto(out *Release)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*Release) DeepCopyObject

func (in *Release) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

func (*Release) Expired

func (r *Release) Expired() bool

Expired verifies if the creation time of the resource is expired.

func (*Release) GitCloneURL

func (r *Release) GitCloneURL() (string, error)

GitCloneURL constructs the remote clone URL for the given release

func (*Release) GitReleaseURL

func (r *Release) GitReleaseURL(host string) string

GitReleaseURL constructs the URL where the release must be stored

func (*Release) IsGitHubSource

func (r *Release) IsGitHubSource() bool

IsGitHubSource check if the source of the build is from github

type ReleaseList

type ReleaseList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []Release `json:"items"`
}

ReleaseList is a list of Release

func (*ReleaseList) DeepCopy

func (in *ReleaseList) DeepCopy() *ReleaseList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ReleaseList.

func (*ReleaseList) DeepCopyInto

func (in *ReleaseList) DeepCopyInto(out *ReleaseList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ReleaseList) DeepCopyObject

func (in *ReleaseList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type ReleaseSpec

type ReleaseSpec struct {
	// The URL of the git remote server to download the git revision tarball
	GitRemote string `json:"gitRemote"`
	// DEPRECATED, in flavor of .commitInfo.ID
	GitRevision   string     `json:"gitRevision"`
	GitRepository string     `json:"gitRepository"`
	GitBranch     string     `json:"gitBranch"`
	BuildRevision string     `json:"buildRevision"`
	AutoDeploy    bool       `json:"autoDeploy"`
	ExpireAfter   int32      `json:"expireAfter"`
	DeployName    string     `json:"deployName"`
	Build         bool       `json:"build"`
	HeadCommit    HeadCommit `json:"headCommit"`
	// DEPRECATED, the authToken for each release is populated by a secret
	// the lifecycle of the token is managed by a controller
	AuthToken string     `json:"authToken"` // expirable token
	Source    SourceType `json:"sourceType"`
}

ReleaseSpec holds specification parameters of a release

func (*ReleaseSpec) DeepCopy

func (in *ReleaseSpec) DeepCopy() *ReleaseSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ReleaseSpec.

func (*ReleaseSpec) DeepCopyInto

func (in *ReleaseSpec) DeepCopyInto(out *ReleaseSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ResourceList

type ResourceList v1.ResourceList

ResourceList is a set of (resource name, quantity) pairs.

var PlatformRegisteredResources *ResourceList

PlatformRegisteredResources contains all the resources allowed for a user to configure in resource quotas: http://kubernetes.io/docs/admin/resourcequota/#Object-Count-Quota

func (*ResourceList) RemoveUnregisteredResources

func (r *ResourceList) RemoveUnregisteredResources()

RemoveUnregisteredResources removes resources which are not registered on the platform

type SHA

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

SHA is the representaton of a git sha

func NewSha

func NewSha(rawSha string) (*SHA, error)

NewSha creates a raw string to a SHA. Returns ErrInvalidGitSha if the sha was invalid.

func (SHA) Full

func (s SHA) Full() string

Full returns the full git sha.

func (SHA) Short

func (s SHA) Short() string

Short returns the first 8 characters of the sha.

type ServicePlanPhase

type ServicePlanPhase string

ServicePlanPhase is the current lifecycle phase of the Service Plan.

const (
	// ServicePlanActive means the ServicePlan is available for use in the system
	ServicePlanActive ServicePlanPhase = "Active"
	// ServicePlanPending means the ServicePlan isn't associate with any global ServicePlan
	ServicePlanPending ServicePlanPhase = "Pending"
	// ServicePlanNotFound means the reference plan wasn't found
	ServicePlanNotFound ServicePlanPhase = "NotFound"
	// ServicePlanDisabled means the ServicePlan is disabled and cannot be associated with resources
	ServicePlanDisabled ServicePlanPhase = "Disabled"
)

type SourceType

type SourceType string

SourceType refers to the source of the build

const (
	// GitHubSource means the build came from a webhook
	GitHubSource SourceType = "github"
	// GitLocalSource means the build came from the git local server
	GitLocalSource SourceType = "local"
)

type TokenType

type TokenType string

TokenType refers to a jwt token claim to specify the type of the token some types have restricted access and scope in the platform

const (
	// AdminTokenType has unsrestricted access to all endpoints
	AdminTokenType TokenType = "admin"
	// SystemTokenType allows interaction only between machine with l
	// imited access scope to endpoints
	SystemTokenType  TokenType = "system"
	RegularTokenType TokenType = "regular"
)

type User

type User struct {
	Username     string    `json:"username"`
	Email        string    `json:"email"`
	Customer     string    `json:"customer"`
	Organization string    `json:"org"`
	Sub          string    `json:"sub"`
	Groups       []string  `json:"groups"`
	Type         TokenType `json:"kolihub.io/type"` // Origin refers to the type of the token (system or regular)
	jwt.StandardClaims
}

User identifies an user on the platform

func (*User) DeepCopy

func (in *User) DeepCopy() *User

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new User.

func (*User) DeepCopyInto

func (in *User) DeepCopyInto(out *User)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (User) IsValid

func (u User) IsValid() bool

IsValid validates if the user is valid verifying the email, customer and organization

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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