v1

package
Version: v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2021 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package v1 contains API Schema definitions for the cd v1 API group +kubebuilder:object:generate=true +groupName=cd.tmax.io

Index

Constants

View Source
const (
	ApplicationConditionReady             = status.ConditionType("ready")
	ApplicationConditionWebhookRegistered = status.ConditionType("webhook-registered")
)

Condition keys for IApplication

View Source
const (
	ConfigMapNameCDConfig      = "cd-config"
	ConfigMapNamespaceCDSystem = "cd-system"
)
View Source
const (
	GithubDefaultAPIUrl = "https://api.github.com"
	GithubDefaultHost   = "https://github.com"

	GitlabDefaultAPIUrl = "https://gitlab.com"
	GitlabDefaultHost   = "https://gitlab.com"
)

Default hosts for remote git servers

View Source
const (
	GitTypeGitHub = GitType("github")
	GitTypeGitLab = GitType("gitlab")
	GitTypeFake   = GitType("fake")
)

Git Types

View Source
const (
	ApplicationConditionReasonNoGitToken = "noGitToken"
)

ApplicationConditionReasonNoGitToken is a Reason key

View Source
const (
	ApplicationKind = "Applications"
)

ApplicationKind is kind string

Variables

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

	// SchemeBuilder is used to add go types to the GroupVersionKind scheme
	SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion}

	// AddToScheme adds the types in this group-version to the given scheme.
	AddToScheme = SchemeBuilder.AddToScheme
)

Functions

This section is empty.

Types

type Application

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

	Spec   ApplicationSpec   `json:"spec,omitempty"`
	Status ApplicationStatus `json:"status,omitempty"`
}

Application is the Schema for the applications API

func (*Application) DeepCopy

func (in *Application) DeepCopy() *Application

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

func (*Application) DeepCopyInto

func (in *Application) DeepCopyInto(out *Application)

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

func (*Application) DeepCopyObject

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

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

func (*Application) GetToken added in v0.0.2

func (app *Application) GetToken(c client.Client) (string, error)

GetToken fetches git access token from IntegrationConfig

func (*Application) GetWebhookServerAddress added in v0.0.2

func (app *Application) GetWebhookServerAddress(c client.Client) string

GetWebhookServerAddress returns Server address which webhook events will be received TODO: modify to use config controller & expose controller

type ApplicationDestination

type ApplicationDestination struct {
	// Server specifies the URL of the target cluster and must be set to the Kubernetes control plane API
	Server string `json:"server,omitempty"`
	// Namespace specifies the target namespace for the application's resources.
	// The namespace will only be set for namespace-scoped resources that have not set a value for .metadata.namespace
	Namespace string `json:"namespace,omitempty"`
	// Name is an alternate way of specifying the target cluster by its symbolic name
	Name string `json:"name,omitempty"`
}

func (*ApplicationDestination) DeepCopy

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

func (*ApplicationDestination) DeepCopyInto

func (in *ApplicationDestination) DeepCopyInto(out *ApplicationDestination)

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

type ApplicationList

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

ApplicationList contains a list of Application

func (*ApplicationList) DeepCopy

func (in *ApplicationList) DeepCopy() *ApplicationList

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

func (*ApplicationList) DeepCopyInto

func (in *ApplicationList) DeepCopyInto(out *ApplicationList)

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

func (*ApplicationList) DeepCopyObject

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

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

type ApplicationSource

type ApplicationSource struct {
	// RepoURL is the URL to the repository (Git) that contains the application manifests
	RepoURL string `json:"repoURL"`
	// Path is a directory path within the Git repository, and is only valid for applications sourced from Git.
	Path string `json:"path,omitempty"`
	// TargetRevision defines the revision of the source to sync the application to.
	// In case of Git, this can be commit, tag, or branch. If omitted, will equal to HEAD.
	// In case of Helm, this is a semver tag for the Chart's version.
	TargetRevision string `json:"targetRevision,omitempty"`
	// Token is a token for accessing the remote git server. It can be empty, if you don't want to register a webhook
	// to the git server
	Token *GitToken `json:"token,omitempty"`
}

func (*ApplicationSource) DeepCopy

func (in *ApplicationSource) DeepCopy() *ApplicationSource

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

func (*ApplicationSource) DeepCopyInto

func (in *ApplicationSource) DeepCopyInto(out *ApplicationSource)

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

func (*ApplicationSource) GetAPIUrl

func (source *ApplicationSource) GetAPIUrl() string

func (*ApplicationSource) GetGitType

func (source *ApplicationSource) GetGitType() GitType

func (*ApplicationSource) GetRepository

func (source *ApplicationSource) GetRepository() string

type ApplicationSourceType

type ApplicationSourceType string

TODO ApplicationSourceType specifies the type of the application's source

const (
	ApplicationSourceTypePlainYAML ApplicationSourceType = "PlainYAML"
	ApplicationSourceTypeHelm      ApplicationSourceType = "Helm"
	ApplicationSourceTypeKustomize ApplicationSourceType = "Kustomize"
	ApplicationSourceTypeKsonnet   ApplicationSourceType = "Ksonnet"
	ApplicationSourceTypeDirectory ApplicationSourceType = "Directory"
	ApplicationSourceTypePlugin    ApplicationSourceType = "Plugin"
)

type ApplicationSpec

type ApplicationSpec struct {
	// Source is a reference to the location of the application's manifests or chart
	Source ApplicationSource `json:"source"`
	// Destination is a reference to the target Kubernetes server and namespace
	Destination ApplicationDestination `json:"destination"`
}

ApplicationSpec defines the desired state of Application

func (*ApplicationSpec) DeepCopy

func (in *ApplicationSpec) DeepCopy() *ApplicationSpec

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

func (*ApplicationSpec) DeepCopyInto

func (in *ApplicationSpec) DeepCopyInto(out *ApplicationSpec)

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

type ApplicationStatus

type ApplicationStatus struct {
	// Conditions of IntegrationConfig
	Conditions status.Conditions `json:"conditions"`
	Secrets    string            `json:"secrets,omitempty"` // TODO 왜 필요해?
}

ApplicationStatus defines the observed state of Application

func (*ApplicationStatus) DeepCopy

func (in *ApplicationStatus) DeepCopy() *ApplicationStatus

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

func (*ApplicationStatus) DeepCopyInto

func (in *ApplicationStatus) DeepCopyInto(out *ApplicationStatus)

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

type DeployResource

type DeployResource struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`
	Application       string             `json:"application"`
	Spec              DeployResourceSpec `json:"spec"`
}

DeployResource is resource created by an application +kubebuilder:resource:path=deployresources,scope=Namespaced,shortName=drs

func (*DeployResource) DeepCopy

func (in *DeployResource) DeepCopy() *DeployResource

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

func (*DeployResource) DeepCopyInto

func (in *DeployResource) DeepCopyInto(out *DeployResource)

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

func (*DeployResource) DeepCopyObject

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

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

type DeployResourceList

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

DeployResourceList contains the list of ArgoResources

func (*DeployResourceList) DeepCopy

func (in *DeployResourceList) DeepCopy() *DeployResourceList

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

func (*DeployResourceList) DeepCopyInto

func (in *DeployResourceList) DeepCopyInto(out *DeployResourceList)

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

func (*DeployResourceList) DeepCopyObject

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

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

type DeployResourceSpec

type DeployResourceSpec struct {
	//name kind namespace, status
	Name      string `json:"name"`
	Kind      string `json:"kind"`
	Namespace string `json:"namespace"`
}

DeployResourceSpec is a spec of deployed application's resource

func (*DeployResourceSpec) DeepCopy

func (in *DeployResourceSpec) DeepCopy() *DeployResourceSpec

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

func (*DeployResourceSpec) DeepCopyInto

func (in *DeployResourceSpec) DeepCopyInto(out *DeployResourceSpec)

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

type GitConfig

type GitConfig struct {
	// Type for git remote server
	// +kubebuilder:validation:Enum=github;gitlab
	Type GitType `json:"type"`

	// Repository name of git repository (in <org>/<repo> form, e.g., tmax-cloud/cicd-operator)
	// +kubebuilder:validation:Pattern=.+/.+
	Repository string `json:"repository"`

	// APIUrl for api server (e.g., https://api.github.com for github type),
	// for the case where the git repository is self-hosted (should contain specific protocol otherwise webhook server returns error)
	// Also, it should *NOT* contain repository path (e.g., tmax-cloud/cicd-operator)
	APIUrl string `json:"apiUrl,omitempty"`

	// Token is a token for accessing the remote git server. It can be empty, if you don't want to register a webhook
	// to the git server
	Token *GitToken `json:"token,omitempty"`
}

GitConfig is a git repository where the IntegrationConfig to be configured

func (*GitConfig) DeepCopy

func (in *GitConfig) DeepCopy() *GitConfig

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

func (*GitConfig) DeepCopyInto

func (in *GitConfig) DeepCopyInto(out *GitConfig)

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

func (*GitConfig) GetAPIUrl

func (config *GitConfig) GetAPIUrl() string

GetAPIUrl returns APIUrl for api server

func (*GitConfig) GetGitHost

func (config *GitConfig) GetGitHost() (string, error)

GetGitHost gets git host

type GitRef

type GitRef string

GitRef is a git reference type

func (GitRef) GetBranch

func (g GitRef) GetBranch() string

GetBranch extracts branch from ref

func (GitRef) GetTag

func (g GitRef) GetTag() string

GetTag extracts tag from ref

func (GitRef) String

func (g GitRef) String() string

type GitToken

type GitToken struct {
	// Value is un-encrypted plain string of git token, not recommended
	Value string `json:"value,omitempty"`

	// ValueFrom refers secret. Recommended
	ValueFrom *GitTokenFrom `json:"valueFrom,omitempty"`
}

GitToken is a token for accessing the remote git server

func (*GitToken) DeepCopy

func (in *GitToken) DeepCopy() *GitToken

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

func (*GitToken) DeepCopyInto

func (in *GitToken) DeepCopyInto(out *GitToken)

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

type GitTokenFrom

type GitTokenFrom struct {
	SecretKeyRef corev1.SecretKeySelector `json:"secretKeyRef"`
}

GitTokenFrom refers to the secret for the access token

func (*GitTokenFrom) DeepCopy

func (in *GitTokenFrom) DeepCopy() *GitTokenFrom

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

func (*GitTokenFrom) DeepCopyInto

func (in *GitTokenFrom) DeepCopyInto(out *GitTokenFrom)

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

type GitType

type GitType string

GitType is a type of remote git server

Jump to

Keyboard shortcuts

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