Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecodeYAMLManifestToObject ¶
DecodeYAMLManifestToObject is a helper function that takes the path to a manifest file, e.g. the deployment YAML file, and opens that file using os.Open, which returns an io.Reader object that can be passed to the YAML/JSON decoder to build up the @resource parameter for usage in the clientsets.
Types ¶
type CRD ¶
type CRD struct { Name string Path string CRD *apiextv1.CustomResourceDefinition }
CRD is a structure that holds the information needed to install these resources, like the name of the CRD, the path to the CRD in the manifests directory, and a pointer to the apiextensions CRD type.
func InitMeteringCRDSlice ¶
InitMeteringCRDSlice initializes a slice of CRD structures, where each structure contains information about an individual CRD that metering manages and returns this slice of CRD structures.
type Config ¶
type Config struct { SkipMeteringDeployment bool RunMeteringOperatorLocal bool DeleteCRDs bool DeleteCRBs bool DeleteNamespace bool DeletePVCs bool DeleteAll bool Namespace string Platform string Repo string Tag string Channel string PackageName string CatalogSourceName string CatalogSourceNamespace string SubscriptionName string ExtraNamespaceLabels map[string]string OperatorResources *OperatorResources MeteringConfig *metering.MeteringConfig }
Config contains all the information needed to handle different metering deployment configurations and internal states, e.g. what platform to deploy on, whether or not to delete the metering CRDs, or namespace during an install, the location to the manifests dir, etc.
type Deployer ¶
type Deployer struct { Config Config Logger logrus.FieldLogger Client kubernetes.Interface APIExtClient apiextclientv1.CustomResourceDefinitionsGetter MeteringClient meteringclient.MeteringV1Interface OLMV1Client olmclientv1.OperatorsV1Interface OLMV1Alpha1Client olmclientv1alpha1.OperatorsV1alpha1Interface }
Deployer holds all the information needed to handle the deployment process of the metering stack. This includes the clientsets needed to provision and remove all the metering resources, and a customized deployment configuration.
func NewDeployer ¶
func NewDeployer( cfg Config, logger logrus.FieldLogger, client kubernetes.Interface, apiextClient apiextclientv1.CustomResourceDefinitionsGetter, meteringClient meteringclient.MeteringV1Interface, olmV1Client olmclientv1.OperatorsV1Interface, olmV1Alpha1Client olmclientv1alpha1.OperatorsV1alpha1Interface, ) (*Deployer, error)
NewDeployer creates a new reference to a deploy structure, and then calls helper functions that initialize the structure fields based on the value of environment variables and function parameters, returning a reference to this initialized deploy structure
func (*Deployer) Install ¶
Install is the driver function that manages the process of creating all the resources that metering needs to install: namespace, CRDs, etc.
func (*Deployer) InstallOLM ¶
InstallOLM is the driver function that manages the process of creating all of the OLM-related resources that are needed to deploy a Metering installation.
func (*Deployer) Uninstall ¶
Uninstall is the driver function that manages deleting all the resources that metering had created. Depending on the configuration of the deploy structure, resources like the metering CRDs, PVCs, or cluster role/role binding may be skipped
func (*Deployer) UninstallOLM ¶
UninstallOLM is the driver function that manages deleting all of the OLM-related metering resources that get created: the OperatorGroup, Subscription, CSV, etc. Deleting the ClusterServiceVersion object will delete the resources that were provisioned from the CSV, so deleting the MeteringConfig custom resource is still needed to fully cleanup any non-CRD resources, e.g. the reporting-operator pod.
type OperatorResources ¶
type OperatorResources struct { CRDs []CRD Deployment *appsv1.Deployment ServiceAccount *corev1.ServiceAccount RoleBinding *rbacv1.RoleBinding Role *rbacv1.Role ClusterRoleBinding *rbacv1.ClusterRoleBinding ClusterRole *rbacv1.ClusterRole }
OperatorResources contains all the objects that make up the Metering Ansible Operator
func ReadMeteringAnsibleOperatorManifests ¶
func ReadMeteringAnsibleOperatorManifests(manifestDir, platform string) (*OperatorResources, error)