Documentation
¶
Index ¶
- Constants
- func ApplyManifests(yamlTemplateString, overlayContent, yamlValuesContent string, ...) error
- func Contains(s []string, searchterm string) bool
- func DeleteFile(path string) error
- func DownloadFile(url string) (string, error)
- func FieldByName(name string) string
- func GenerateOperatorCRString(component, namespace string, p *pkg.OperatorParams) (string, error)
- func GetMajor(version string) (bool, string)
- func ReadFile(path string) (string, error)
- func Spaces(num int) string
- func WriteFile(path, content string) error
- type CMsFlags
- type Deployment
- func (d *Deployment) CheckIfKeyDeploymentInstalled(name string) (bool, string, string, error)
- func (d *Deployment) CheckIfKnativeEventingInstalled() (bool, string, string, error)
- func (d *Deployment) CheckIfKnativeInstalled(component string) (bool, string, string, error)
- func (d *Deployment) CheckIfKnativeServingInstalled() (bool, string, string, error)
- func (d *Deployment) CheckIfOperatorInstalled() (bool, string, string, error)
- type KeyValueFlags
- type KnativeOperatorCR
- func (ko *KnativeOperatorCR) GetCRInterface(component, namespace string) (interface{}, error)
- func (ko *KnativeOperatorCR) GetCommonSpec(component, namespace string) (*base.CommonSpec, error)
- func (ko *KnativeOperatorCR) GetConfigMaps(component, namespace string) (base.ConfigMapData, error)
- func (ko *KnativeOperatorCR) GetDeployments(component, namespace string) ([]base.WorkloadOverride, error)
- func (ko *KnativeOperatorCR) GetKnativeEventing(namespace string) (interface{}, error)
- func (ko *KnativeOperatorCR) GetKnativeEventingInCluster(namespace string) (*eventingv1beta1.KnativeEventing, error)
- func (ko *KnativeOperatorCR) GetKnativeServing(namespace string) (interface{}, error)
- func (ko *KnativeOperatorCR) GetKnativeServingInCluster(namespace string) (*servingv1beta1.KnativeServing, error)
- func (ko *KnativeOperatorCR) GetRegistry(component, namespace string) (base.Registry, error)
- func (ko *KnativeOperatorCR) GetServices(component, namespace string) ([]base.ServiceOverride, error)
- func (ko *KnativeOperatorCR) UpdateCommonSpec(component, namespace string, commonSpec *base.CommonSpec) error
- func (ko *KnativeOperatorCR) UpdateConfigMaps(component, namespace string, cmData base.ConfigMapData) error
- func (ko *KnativeOperatorCR) UpdateDeployments(component, namespace string, workloadOverrides []base.WorkloadOverride) error
- func (ko *KnativeOperatorCR) UpdateKnativeEventing(ks *eventingv1beta1.KnativeEventing) (*eventingv1beta1.KnativeEventing, error)
- func (ko *KnativeOperatorCR) UpdateKnativeServing(ks *servingv1beta1.KnativeServing) (*servingv1beta1.KnativeServing, error)
- func (ko *KnativeOperatorCR) UpdateRegistry(component, namespace string, registry base.Registry) error
- func (ko *KnativeOperatorCR) UpdateServices(component, namespace string, serviceOverrides []base.ServiceOverride) error
- type KubeResource
- type Manifest
- type Namespace
- type YamlGenarator
- type YttProcessor
Constants ¶
const ( DefaultIstioNamespace = "istio-system" DefaultKnativeServingNamespace = "knative-serving" DefaultKnativeEventingNamespace = "knative-eventing" DefaultNamespace = "default" Latest = "latest" Nightly = "nightly" ServingComponent = "serving" EventingComponent = "eventing" YttMatchingTag = "#@overlay/match missing_ok=True" YttReplaceTag = "#@overlay/replace or_add=True" Space = " " LatestVersion = "1.6" )
const ( KnativeOperatorName = "knative-operator" KnativeServingActivator = "activator" KnativeEventingController = "eventing-controller" )
const ( KnativeServingName = "knative-serving" KnativeEventingName = "knative-eventing" )
const ( CustomDataKey = "custom-manifests.yaml" VerticalDelimiter = "|" LineWrapper = "\n" Separator = "---" MountPath = "/knative-custom-manifest" CustomVolumeName = "config-manifest-volume" ConfigMapName = "config-manifest" )
Variables ¶
This section is empty.
Functions ¶
func ApplyManifests ¶
func ApplyManifests(yamlTemplateString, overlayContent, yamlValuesContent string, p *pkg.OperatorParams) error
func DownloadFile ¶
DownloadFile reads an online file into a string
func FieldByName ¶
FieldByName returns the overlay tag by a certain field. It is allowed to miss this field in the existing yaml
func GenerateOperatorCRString ¶
func GenerateOperatorCRString(component, namespace string, p *pkg.OperatorParams) (string, error)
Types ¶
type Deployment ¶
type Deployment struct {
Client kubernetes.Interface
}
Deployment is used to access the cluster to check if the deployment of the knative operator exists
func (*Deployment) CheckIfKeyDeploymentInstalled ¶ added in v0.34.0
func (*Deployment) CheckIfKnativeEventingInstalled ¶ added in v0.34.0
func (d *Deployment) CheckIfKnativeEventingInstalled() (bool, string, string, error)
func (*Deployment) CheckIfKnativeInstalled ¶ added in v0.34.0
CheckIfOperatorInstalled checks if Knative Component exists
func (*Deployment) CheckIfKnativeServingInstalled ¶ added in v0.34.0
func (d *Deployment) CheckIfKnativeServingInstalled() (bool, string, string, error)
func (*Deployment) CheckIfOperatorInstalled ¶
func (d *Deployment) CheckIfOperatorInstalled() (bool, string, string, error)
CheckIfOperatorInstalled checks if Knative Operator exists
type KeyValueFlags ¶
type KnativeOperatorCR ¶
KnativeOperatorCR is used to access the knative custom resource in the Kubernetes cluster.
func GetKnativeOperatorCR ¶
func GetKnativeOperatorCR(p *pkg.OperatorParams) (*KnativeOperatorCR, error)
func (*KnativeOperatorCR) GetCRInterface ¶
func (ko *KnativeOperatorCR) GetCRInterface(component, namespace string) (interface{}, error)
GetCRInterface gets the Knative custom resource under a certain namespace
func (*KnativeOperatorCR) GetCommonSpec ¶
func (ko *KnativeOperatorCR) GetCommonSpec(component, namespace string) (*base.CommonSpec, error)
func (*KnativeOperatorCR) GetConfigMaps ¶
func (ko *KnativeOperatorCR) GetConfigMaps(component, namespace string) (base.ConfigMapData, error)
func (*KnativeOperatorCR) GetDeployments ¶
func (ko *KnativeOperatorCR) GetDeployments(component, namespace string) ([]base.WorkloadOverride, error)
func (*KnativeOperatorCR) GetKnativeEventing ¶
func (ko *KnativeOperatorCR) GetKnativeEventing(namespace string) (interface{}, error)
GetKnativeEventing gets the Knative Eventing custom resource under a certain namespace
func (*KnativeOperatorCR) GetKnativeEventingInCluster ¶
func (ko *KnativeOperatorCR) GetKnativeEventingInCluster(namespace string) (*eventingv1beta1.KnativeEventing, error)
GetKnativeEventingInCluster gets the Knative Eventing custom resource in the cluster under a certain namespace
func (*KnativeOperatorCR) GetKnativeServing ¶
func (ko *KnativeOperatorCR) GetKnativeServing(namespace string) (interface{}, error)
GetKnativeServing gets the Knative Serving custom resource under a certain namespace
func (*KnativeOperatorCR) GetKnativeServingInCluster ¶
func (ko *KnativeOperatorCR) GetKnativeServingInCluster(namespace string) (*servingv1beta1.KnativeServing, error)
GetKnativeServingInCluster gets the Knative Serving custom resource in the cluster under a certain namespace
func (*KnativeOperatorCR) GetRegistry ¶
func (ko *KnativeOperatorCR) GetRegistry(component, namespace string) (base.Registry, error)
func (*KnativeOperatorCR) GetServices ¶
func (ko *KnativeOperatorCR) GetServices(component, namespace string) ([]base.ServiceOverride, error)
func (*KnativeOperatorCR) UpdateCommonSpec ¶
func (ko *KnativeOperatorCR) UpdateCommonSpec(component, namespace string, commonSpec *base.CommonSpec) error
func (*KnativeOperatorCR) UpdateConfigMaps ¶
func (ko *KnativeOperatorCR) UpdateConfigMaps(component, namespace string, cmData base.ConfigMapData) error
func (*KnativeOperatorCR) UpdateDeployments ¶
func (ko *KnativeOperatorCR) UpdateDeployments(component, namespace string, workloadOverrides []base.WorkloadOverride) error
func (*KnativeOperatorCR) UpdateKnativeEventing ¶
func (ko *KnativeOperatorCR) UpdateKnativeEventing(ks *eventingv1beta1.KnativeEventing) (*eventingv1beta1.KnativeEventing, error)
UpdateKnativeEventing updates the Knative Eventing custom resource in the cluster based on the provided Knative Eventing
func (*KnativeOperatorCR) UpdateKnativeServing ¶
func (ko *KnativeOperatorCR) UpdateKnativeServing(ks *servingv1beta1.KnativeServing) (*servingv1beta1.KnativeServing, error)
UpdateKnativeServing updates the Knative Serving custom resource in the cluster based on the provided Knative Serving
func (*KnativeOperatorCR) UpdateRegistry ¶
func (ko *KnativeOperatorCR) UpdateRegistry(component, namespace string, registry base.Registry) error
func (*KnativeOperatorCR) UpdateServices ¶
func (ko *KnativeOperatorCR) UpdateServices(component, namespace string, serviceOverrides []base.ServiceOverride) error
type KubeResource ¶
type KubeResource struct {
KubeClient kubernetes.Interface
}
KubeResource is used to access the Kubernetes resources in the Kubernetes cluster.
func (*KubeResource) CreateOrUpdateConfigMap ¶
func (kr *KubeResource) CreateOrUpdateConfigMap(name, namespace, data string, overwrite bool) error
CreateOrUpdateConfigMap creates or updates the ConfigMap with the data under a certain namespace
func (*KubeResource) UpdateOperatorDeployment ¶
func (kr *KubeResource) UpdateOperatorDeployment(name, namespace string) error
UpdateOperatorDeployment updates the deployment of the operator
type Manifest ¶
type Manifest struct { // YttPro is an instance of the YttProcessor to generate the output yaml YttPro *YttProcessor // RestConfig is the rest configuration to access the Kubernetes cluster RestConfig *rest.Config }
Manifest applies the content of the yaml file against a Kubernetes cluster
type Namespace ¶
type Namespace struct { Client kubernetes.Interface Component string }
Namespace is used to access the namespace resource in the Kubernetes cluster.
func (*Namespace) CreateNamespace ¶
CreateNamespace creates the namespace if it is not available in the Kubernetes cluster
type YamlGenarator ¶
type YamlGenarator struct {
// Input is a Kubernetes resource, either Knative Serving or Eventing
Input interface{}
}
YamlGenarator generates the final output yaml content for Knative Eventing or Serving custom resource.
func (*YamlGenarator) GenerateYamlOutput ¶
func (yamlg *YamlGenarator) GenerateYamlOutput() (string, error)
GenerateYamlOutput returns the yaml content for Knative Serving or Eventing CR
type YttProcessor ¶
type YttProcessor struct { // baseData is a byte array to save the content of the base yaml BaseData []byte // overlayData is a byte array to save the content of the overlay yaml OverlayData []byte // valuesData is a byte array to save the content of the values ValuesData []byte }
YttProcessor generates the final output yaml content, based on the base, overlay and values.
func (*YttProcessor) GenerateOutput ¶
func (yttp *YttProcessor) GenerateOutput() (string, error)
GenerateOutput returns the generated content and path, based on the base, overlay and values.