common

package
v0.15.2 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2020 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Overview

Copyright 2019 The Knative Authors

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

View Source
const (
	KoEnvKey = "KO_DATA_PATH"
)

Variables

This section is empty.

Functions

func CheckDeployments

func CheckDeployments(kube kubernetes.Interface, manifest *mf.Manifest, status v1alpha1.KComponentStatus) error

CheckDeployments checks all deployments in the given manifest and updates the given status with the status of the deployments.

func ClusterScopedResource

func ClusterScopedResource(apiVersion, kind, name string) *unstructured.Unstructured

ClusterScopedResource is an unstructured resource with the given apiVersion, kind and name.

func ConfigMapTransform

func ConfigMapTransform(config v1alpha1.ConfigMapData, log *zap.SugaredLogger) mf.Transformer

ConfigMapTransform updates the ConfigMap with the values specified in operator CR

func FinalizerRemovalPatch

func FinalizerRemovalPatch(obj v1alpha1.KComponent, toRemove string) ([]byte, error)

FinalizerRemovalPatch generates a patch for removing the given finalizer.

func GetLatestRelease

func GetLatestRelease(kcomponent string) string

GetLatestRelease returns the latest release tag available under kodata directory for Knative component.

func ImageTransform

func ImageTransform(registry *v1alpha1.Registry, log *zap.SugaredLogger) mf.Transformer

ImageTransform updates image with a new registry and tag

func Install

func Install(manifest *mf.Manifest, version string, status v1alpha1.KComponentStatus) error

Install applies the manifest resources for the given version and updates the given status accordingly.

func ListReleases

func ListReleases(kComponent string) ([]string, error)

ListReleases returns the all the available release versions available under kodata directory for Knative component.

func NamespacedResource

func NamespacedResource(apiVersion, kind, ns, name string) *unstructured.Unstructured

NamespacedResource is an unstructured resource with the given apiVersion, kind, ns and name.

func ResourceRequirementsTransform

func ResourceRequirementsTransform(resources []v1alpha1.ResourceRequirementsOverride, log *zap.SugaredLogger) mf.Transformer

ResourceRequirementsTransform configures the resource requests for all containers within all deployments in the manifest

func RetrieveManifestPath

func RetrieveManifestPath(version, kcomponent string) string

RetrieveManifestPath returns the manifest path for Knative based a provided version and component

func Transformers

func Transformers(ctx context.Context, obj v1alpha1.KComponent) []mf.Transformer

Transformers returns transformers that are common to all components.

func Uninstall

func Uninstall(manifest *mf.Manifest) error

Uninstall removes all resources except CRDs, which are never deleted automatically.

func UpdateConfigMap

func UpdateConfigMap(cm *unstructured.Unstructured, data map[string]string, log *zap.SugaredLogger) error

UpdateConfigMap set some data in a configmap, only overwriting common keys if they differ

func WithPlatforms

func WithPlatforms(ctx context.Context, pf Platforms) context.Context

WithPlatforms attaches the given Platforms to the provided context.

Types

type Platforms

type Platforms []func(kubernetes.Interface, *zap.SugaredLogger) (mf.Transformer, error)

func GetPlatforms

func GetPlatforms(ctx context.Context) Platforms

GetPlatforms extracts the Platforms from the context.

func (Platforms) Transformers

func (platforms Platforms) Transformers(kubeClientSet kubernetes.Interface, slog *zap.SugaredLogger) ([]mf.Transformer, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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