Documentation ¶
Index ¶
- Constants
- Variables
- func Diff(old, new Manifest, logger *zap.Logger, opts ...diff.Option) (*diff.Result, error)
- func FindReferencingConfigMapsInDeployment(d *appsv1.Deployment) []string
- func FindReferencingSecretsInDeployment(d *appsv1.Deployment) []string
- func HashManifests(manifests []Manifest) (string, error)
- func IsKubernetesBuiltInResource(apiVersion string) bool
- func MakeKubernetesResourceState(uid string, key ResourceKey, obj *unstructured.Unstructured, now time.Time) model.KubernetesResourceState
- type APIVersionKind
- type AppManifestsCache
- type Applier
- type DiffListChange
- type DiffListResult
- type DiffRenderOptions
- type Helm
- func (h *Helm) TemplateLocalChart(ctx context.Context, appName, appDir, namespace, chartPath string, ...) (string, error)
- func (h *Helm) TemplateRemoteChart(ctx context.Context, appName, appDir, namespace string, chart helmRemoteChart, ...) (string, error)
- func (h *Helm) TemplateRemoteGitChart(ctx context.Context, appName, appDir, namespace string, ...) (string, error)
- func (h *Helm) UpgradeLocalChart(ctx context.Context, appName, appDir, namespace, chartPath string, ...) (string, error)
- func (h *Helm) UpgradeRemoteChart(ctx context.Context, appName, appDir, namespace string, chart helmRemoteChart, ...) (string, error)
- func (h *Helm) UpgradeRemoteGitChart(ctx context.Context, appName, appDir, namespace string, ...) (string, error)
- type Kubectl
- func (c *Kubectl) Apply(ctx context.Context, kubeconfig, namespace string, manifest Manifest) (err error)
- func (c *Kubectl) Create(ctx context.Context, kubeconfig, namespace string, manifest Manifest) (err error)
- func (c *Kubectl) CreateNamespace(ctx context.Context, kubeconfig, namespace string) (err error)
- func (c *Kubectl) Delete(ctx context.Context, kubeconfig, namespace string, r ResourceKey) (err error)
- func (c *Kubectl) Get(ctx context.Context, kubeconfig, namespace string, r ResourceKey) (m Manifest, err error)
- func (c *Kubectl) Replace(ctx context.Context, kubeconfig, namespace string, manifest Manifest) (err error)
- type Kustomize
- type Loader
- type Manifest
- func LoadManifestsFromYAMLFile(path string) ([]Manifest, error)
- func LoadPlainYAMLManifests(dir string, names []string, configFileName string) ([]Manifest, error)
- func MakeManifest(key ResourceKey, u *unstructured.Unstructured) Manifest
- func ParseFromStructuredObject(s interface{}) (Manifest, error)
- func ParseManifests(data string) ([]Manifest, error)
- func (m Manifest) AddAnnotations(annotations map[string]string)
- func (m Manifest) AddStringMapValues(values map[string]string, fields ...string) error
- func (m Manifest) ConvertToStructuredObject(o interface{}) error
- func (m Manifest) Duplicate(name string) Manifest
- func (m Manifest) GetAnnotations() map[string]string
- func (m Manifest) GetNestedMap(fields ...string) (map[string]interface{}, error)
- func (m Manifest) GetNestedStringMap(fields ...string) (map[string]string, error)
- func (m Manifest) GetSpec() (interface{}, error)
- func (m Manifest) MarshalJSON() ([]byte, error)
- func (m Manifest) SetStructuredSpec(spec interface{}) error
- func (m Manifest) YamlBytes() ([]byte, error)
- type ResourceKey
- func (k ResourceKey) IsConfigMap() bool
- func (k ResourceKey) IsDeployment() bool
- func (k ResourceKey) IsEqualWithIgnoringNamespace(a ResourceKey) bool
- func (k ResourceKey) IsLess(a ResourceKey) bool
- func (k ResourceKey) IsLessWithIgnoringNamespace(a ResourceKey) bool
- func (k ResourceKey) IsReplicaSet() bool
- func (k ResourceKey) IsSecret() bool
- func (k ResourceKey) IsService() bool
- func (k ResourceKey) IsWorkload() bool
- func (k ResourceKey) IsZero() bool
- func (k ResourceKey) ReadableString() string
- func (k ResourceKey) String() string
- type TemplatingMethod
Constants ¶
View Source
const ( LabelManagedBy = "pipecd.dev/managed-by" // Always be piped. LabelPiped = "pipecd.dev/piped" // The id of piped handling this application. LabelApplication = "pipecd.dev/application" // The application this resource belongs to. LabelCommitHash = "pipecd.dev/commit-hash" // Hash value of the deployed commit. LabelResourceKey = "pipecd.dev/resource-key" // The resource key generated by apiVersion, namespace and name. e.g. apps/v1/Deployment/namespace/demo-app LabelOriginalAPIVersion = "pipecd.dev/original-api-version" // The api version defined in git configuration. e.g. apps/v1 LabelIgnoreDriftDirection = "pipecd.dev/ignore-drift-detection" // Whether the drift detection should ignore this resource. LabelSyncReplace = "pipecd.dev/sync-by-replace" // Use replace instead of apply. LabelServerSideApply = "pipecd.dev/server-side-apply" // Use server side apply instead of client side apply. AnnotationConfigHash = "pipecd.dev/config-hash" // The hash value of all mouting config resources. AnnotationOrder = "pipecd.dev/order" // The order number of resource used to sort them before using. ManagedByPiped = "piped" IgnoreDriftDetectionTrue = "true" UseReplaceEnabled = "enabled" UseServerSideApply = "true" )
View Source
const ( KindDeployment = "Deployment" KindStatefulSet = "StatefulSet" KindDaemonSet = "DaemonSet" KindReplicaSet = "ReplicaSet" KindPod = "Pod" KindJob = "Job" KindCronJob = "CronJob" KindConfigMap = "ConfigMap" KindSecret = "Secret" KindPersistentVolume = "PersistentVolume" KindPersistentVolumeClaim = "PersistentVolumeClaim" KindService = "Service" KindIngress = "Ingress" KindServiceAccount = "ServiceAccount" KindRole = "Role" KindRoleBinding = "RoleBinding" KindClusterRole = "ClusterRole" KindClusterRoleBinding = "ClusterRoleBinding" KindNameSpace = "NameSpace" KindPodDisruptionBudget = "PodDisruptionBudget" KindCustomResourceDefinition = "CustomResourceDefinition" DefaultNamespace = "default" )
Variables ¶
View Source
var (
ErrNotFound = errors.New("not found")
)
Functions ¶
func FindReferencingConfigMapsInDeployment ¶
func FindReferencingConfigMapsInDeployment(d *appsv1.Deployment) []string
func FindReferencingSecretsInDeployment ¶
func FindReferencingSecretsInDeployment(d *appsv1.Deployment) []string
func HashManifests ¶
HashManifests computes the hash of a list of manifests.
func MakeKubernetesResourceState ¶
func MakeKubernetesResourceState(uid string, key ResourceKey, obj *unstructured.Unstructured, now time.Time) model.KubernetesResourceState
Types ¶
type APIVersionKind ¶
type AppManifestsCache ¶
func (AppManifestsCache) Put ¶
func (c AppManifestsCache) Put(commit string, manifests []Manifest)
type Applier ¶
type Applier interface { // ApplyManifest does applying the given manifest. ApplyManifest(ctx context.Context, manifest Manifest) error // CreateManifest does creating resource from given manifest. CreateManifest(ctx context.Context, manifest Manifest) error // ReplaceManifest does replacing resource from given manifest. ReplaceManifest(ctx context.Context, manifest Manifest) error // Delete deletes the given resource from Kubernetes cluster. Delete(ctx context.Context, key ResourceKey) error }
func NewApplier ¶
func NewApplier(input config.KubernetesDeploymentInput, cp config.PlatformProviderKubernetesConfig, logger *zap.Logger) Applier
func NewMultiApplier ¶ added in v0.36.0
NewMultiApplier creates an applier that duplicates its operations to all the provided appliers.
type DiffListResult ¶
type DiffListResult struct { Adds []Manifest Deletes []Manifest Changes []DiffListChange }
func (*DiffListResult) NoChange ¶
func (r *DiffListResult) NoChange() bool
func (*DiffListResult) Render ¶
func (r *DiffListResult) Render(opt DiffRenderOptions) string
type DiffRenderOptions ¶
type Helm ¶
type Helm struct {
// contains filtered or unexported fields
}
func (*Helm) TemplateLocalChart ¶
func (*Helm) TemplateRemoteChart ¶
func (*Helm) TemplateRemoteGitChart ¶
func (*Helm) UpgradeLocalChart ¶ added in v0.41.4
func (*Helm) UpgradeRemoteChart ¶ added in v0.41.4
func (*Helm) UpgradeRemoteGitChart ¶ added in v0.41.4
type Kubectl ¶
type Kubectl struct {
// contains filtered or unexported fields
}
func NewKubectl ¶
func (*Kubectl) CreateNamespace ¶ added in v0.45.0
type Loader ¶
type Manifest ¶
type Manifest struct { Key ResourceKey // contains filtered or unexported fields }
func LoadPlainYAMLManifests ¶
func MakeManifest ¶
func MakeManifest(key ResourceKey, u *unstructured.Unstructured) Manifest
func ParseManifests ¶
func (Manifest) AddAnnotations ¶
func (Manifest) AddStringMapValues ¶
AddStringMapValues adds or overrides the given key-values into the string map that can be found at the specified fields.
func (Manifest) ConvertToStructuredObject ¶
func (Manifest) GetAnnotations ¶
func (Manifest) GetNestedMap ¶
func (Manifest) GetNestedStringMap ¶
func (Manifest) MarshalJSON ¶
func (Manifest) SetStructuredSpec ¶
type ResourceKey ¶
func DecodeResourceKey ¶
func DecodeResourceKey(key string) (ResourceKey, error)
func MakeResourceKey ¶
func MakeResourceKey(obj *unstructured.Unstructured) ResourceKey
func (ResourceKey) IsConfigMap ¶
func (k ResourceKey) IsConfigMap() bool
func (ResourceKey) IsDeployment ¶
func (k ResourceKey) IsDeployment() bool
func (ResourceKey) IsEqualWithIgnoringNamespace ¶
func (k ResourceKey) IsEqualWithIgnoringNamespace(a ResourceKey) bool
IsEqualWithIgnoringNamespace checks whether the key is equal to the given key, but this ignores the comparation of the namesapce.
func (ResourceKey) IsLess ¶
func (k ResourceKey) IsLess(a ResourceKey) bool
IsLess reports whether the key should sort before the given key.
func (ResourceKey) IsLessWithIgnoringNamespace ¶
func (k ResourceKey) IsLessWithIgnoringNamespace(a ResourceKey) bool
IsLessWithIgnoringNamespace reports whether the key should sort before the given key, but this ignores the comparation of the namesapce.
func (ResourceKey) IsReplicaSet ¶
func (k ResourceKey) IsReplicaSet() bool
func (ResourceKey) IsSecret ¶
func (k ResourceKey) IsSecret() bool
func (ResourceKey) IsService ¶
func (k ResourceKey) IsService() bool
func (ResourceKey) IsWorkload ¶
func (k ResourceKey) IsWorkload() bool
func (ResourceKey) IsZero ¶
func (k ResourceKey) IsZero() bool
func (ResourceKey) ReadableString ¶
func (k ResourceKey) ReadableString() string
func (ResourceKey) String ¶
func (k ResourceKey) String() string
type TemplatingMethod ¶
type TemplatingMethod string
const ( TemplatingMethodHelm TemplatingMethod = "helm" TemplatingMethodKustomize TemplatingMethod = "kustomize" TemplatingMethodNone TemplatingMethod = "none" )
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package kubernetestest is a generated GoMock package.
|
Package kubernetestest is a generated GoMock package. |
Click to show internal directories.
Click to hide internal directories.