Documentation
¶
Index ¶
- func BundleAdditionalResourcesGenerator(rv1 *bundle.RegistryV1, opts render.Options) ([]client.Object, error)
- func BundleCRDGenerator(rv1 *bundle.RegistryV1, opts render.Options) ([]client.Object, error)
- func BundleCSVClusterPermissionsGenerator(rv1 *bundle.RegistryV1, opts render.Options) ([]client.Object, error)
- func BundleCSVDeploymentGenerator(rv1 *bundle.RegistryV1, opts render.Options) ([]client.Object, error)
- func BundleCSVPermissionsGenerator(rv1 *bundle.RegistryV1, opts render.Options) ([]client.Object, error)
- func BundleCSVServiceAccountGenerator(rv1 *bundle.RegistryV1, opts render.Options) ([]client.Object, error)
- func BundleMutatingWebhookResourceGenerator(rv1 *bundle.RegistryV1, opts render.Options) ([]client.Object, error)
- func BundleValidatingWebhookResourceGenerator(rv1 *bundle.RegistryV1, opts render.Options) ([]client.Object, error)
- func BundleWebhookServiceResourceGenerator(rv1 *bundle.RegistryV1, opts render.Options) ([]client.Object, error)
- func CertProviderResourceGenerator(rv1 *bundle.RegistryV1, opts render.Options) ([]client.Object, error)
- func CreateClusterRoleBindingResource(name string, opts ...ResourceCreatorOption) *rbacv1.ClusterRoleBinding
- func CreateClusterRoleResource(name string, opts ...ResourceCreatorOption) *rbacv1.ClusterRole
- func CreateDeploymentResource(name string, namespace string, opts ...ResourceCreatorOption) *appsv1.Deployment
- func CreateMutatingWebhookConfigurationResource(name string, namespace string, opts ...ResourceCreatorOption) *admissionregistrationv1.MutatingWebhookConfiguration
- func CreateRoleBindingResource(name string, namespace string, opts ...ResourceCreatorOption) *rbacv1.RoleBinding
- func CreateRoleResource(name string, namespace string, opts ...ResourceCreatorOption) *rbacv1.Role
- func CreateServiceAccountResource(name string, namespace string, opts ...ResourceCreatorOption) *corev1.ServiceAccount
- func CreateServiceResource(name string, namespace string, opts ...ResourceCreatorOption) *corev1.Service
- func CreateValidatingWebhookConfigurationResource(name string, namespace string, opts ...ResourceCreatorOption) *admissionregistrationv1.ValidatingWebhookConfiguration
- func WithDeploymentSpec(depSpec appsv1.DeploymentSpec) func(client.Object)
- func WithLabels(labels map[string]string) func(client.Object)
- func WithMutatingWebhooks(webhooks ...admissionregistrationv1.MutatingWebhook) func(client.Object)
- func WithRoleRef(roleRef rbacv1.RoleRef) func(client.Object)
- func WithRules(rules ...rbacv1.PolicyRule) func(client.Object)
- func WithServiceSpec(serviceSpec corev1.ServiceSpec) func(client.Object)
- func WithSubjects(subjects ...rbacv1.Subject) func(client.Object)
- func WithValidatingWebhooks(webhooks ...admissionregistrationv1.ValidatingWebhook) func(client.Object)
- type ResourceCreatorOption
- type ResourceCreatorOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BundleAdditionalResourcesGenerator ¶
func BundleAdditionalResourcesGenerator(rv1 *bundle.RegistryV1, opts render.Options) ([]client.Object, error)
BundleAdditionalResourcesGenerator generates resources for the additional resources included in the bundle. If the bundle resource is namespace scoped, its namespace will be set to the value of opts.InstallNamespace.
func BundleCRDGenerator ¶
BundleCRDGenerator generates CustomResourceDefinition resources from the registry+v1 bundle. If the CRD is referenced by any conversion webhook defined in the bundle's cluster service version spec, the CRD is modified by the CertificateProvider in opts to add any annotations or modifications necessary for certificate injection.
func BundleCSVClusterPermissionsGenerator ¶
func BundleCSVClusterPermissionsGenerator(rv1 *bundle.RegistryV1, opts render.Options) ([]client.Object, error)
BundleCSVClusterPermissionsGenerator generates ClusterRoles and ClusterRoleBindings based on the bundle's cluster service version clusterPermission spec. If the bundle is being installed in AllNamespaces mode (opts.TargetNamespaces = [”]), the CSV's permission spec will be promoted to ClusterRole and ClusterRoleBinding resources. To keep parity with OLMv0, these will also include an extra rule to get, list, watch namespaces (see https://github.com/operator-framework/operator-lifecycle-manager/blob/dfd0b2bea85038d3c0d65348bc812d297f16b8d2/pkg/controller/operators/olm/operatorgroup.go#L539)
func BundleCSVDeploymentGenerator ¶
func BundleCSVDeploymentGenerator(rv1 *bundle.RegistryV1, opts render.Options) ([]client.Object, error)
BundleCSVDeploymentGenerator generates all deployments defined in rv1's cluster service version (CSV). The generated resource aim to have parity with OLMv0 generated Deployment resources: - olm.targetNamespaces annotation is set with the opts.TargetNamespace value - the deployment spec's revision history limit is set to 1 - merges csv annotations to the deployment template's annotations
func BundleCSVPermissionsGenerator ¶
func BundleCSVPermissionsGenerator(rv1 *bundle.RegistryV1, opts render.Options) ([]client.Object, error)
BundleCSVPermissionsGenerator generates the Roles and RoleBindings based on bundle's cluster service version permission spec. If the bundle is being installed in AllNamespaces mode (opts.TargetNamespaces = [”]) no resources will be generated as these permissions will be promoted to ClusterRole/Bunding(s)
func BundleCSVServiceAccountGenerator ¶
func BundleCSVServiceAccountGenerator(rv1 *bundle.RegistryV1, opts render.Options) ([]client.Object, error)
BundleCSVServiceAccountGenerator generates ServiceAccount resources based on the bundle's cluster service version permission and clusterPermission spec. One ServiceAccount resource is created / referenced service account (i.e. if multiple permissions reference the same service account, only one resource will be generated). If a clusterPermission, or permission, references an empty (”) service account, this is considered to be the namespace 'default' service account. A resource for the namespace 'default' service account is not generated.
func BundleMutatingWebhookResourceGenerator ¶
func BundleMutatingWebhookResourceGenerator(rv1 *bundle.RegistryV1, opts render.Options) ([]client.Object, error)
BundleMutatingWebhookResourceGenerator generates MutatingAdmissionWebhookConfiguration resources based on the bundle's cluster service version spec. The resource is modified by the CertificateProvider in opts to add any annotations or modifications necessary for certificate injection.
func BundleValidatingWebhookResourceGenerator ¶
func BundleValidatingWebhookResourceGenerator(rv1 *bundle.RegistryV1, opts render.Options) ([]client.Object, error)
BundleValidatingWebhookResourceGenerator generates ValidatingAdmissionWebhookConfiguration resources based on the bundle's cluster service version spec. The resource is modified by the CertificateProvider in opts to add any annotations or modifications necessary for certificate injection.
func BundleWebhookServiceResourceGenerator ¶
func BundleWebhookServiceResourceGenerator(rv1 *bundle.RegistryV1, opts render.Options) ([]client.Object, error)
BundleWebhookServiceResourceGenerator generates Service resources based that support the webhooks defined in the bundle's cluster service version spec. The resource is modified by the CertificateProvider in opts to add any annotations or modifications necessary for certificate injection.
func CertProviderResourceGenerator ¶
func CertProviderResourceGenerator(rv1 *bundle.RegistryV1, opts render.Options) ([]client.Object, error)
CertProviderResourceGenerator generates any resources necessary for the CertificateProvider in opts to function correctly, e.g. Issuer or Certificate resources.
func CreateClusterRoleBindingResource ¶
func CreateClusterRoleBindingResource(name string, opts ...ResourceCreatorOption) *rbacv1.ClusterRoleBinding
CreateClusterRoleBindingResource creates a ClusterRoleBinding resource with name 'name' and applying any ClusterRoleBinding related options in opts
func CreateClusterRoleResource ¶
func CreateClusterRoleResource(name string, opts ...ResourceCreatorOption) *rbacv1.ClusterRole
CreateClusterRoleResource creates a ClusterRole resource with name 'name' and applying any ClusterRole related options in opts
func CreateDeploymentResource ¶
func CreateDeploymentResource(name string, namespace string, opts ...ResourceCreatorOption) *appsv1.Deployment
CreateDeploymentResource creates a Deployment resource with name 'name', namespace 'namespace', and applying any Deployment related options in opts
func CreateMutatingWebhookConfigurationResource ¶
func CreateMutatingWebhookConfigurationResource(name string, namespace string, opts ...ResourceCreatorOption) *admissionregistrationv1.MutatingWebhookConfiguration
CreateMutatingWebhookConfigurationResource creates a MutatingWebhookConfiguration resource with name 'name', namespace 'namespace', and applying any MutatingWebhookConfiguration related options in opts
func CreateRoleBindingResource ¶
func CreateRoleBindingResource(name string, namespace string, opts ...ResourceCreatorOption) *rbacv1.RoleBinding
CreateRoleBindingResource creates a RoleBinding resource with name 'name', namespace 'namespace', and applying any RoleBinding related options in opts
func CreateRoleResource ¶
func CreateRoleResource(name string, namespace string, opts ...ResourceCreatorOption) *rbacv1.Role
CreateRoleResource creates a Role resource with name 'name' and namespace 'namespace' and applying any Role related options in opts
func CreateServiceAccountResource ¶
func CreateServiceAccountResource(name string, namespace string, opts ...ResourceCreatorOption) *corev1.ServiceAccount
CreateServiceAccountResource creates a ServiceAccount resource with name 'name', namespace 'namespace', and applying any ServiceAccount related options in opts
func CreateServiceResource ¶
func CreateServiceResource(name string, namespace string, opts ...ResourceCreatorOption) *corev1.Service
CreateServiceResource creates a Service resource with name 'name', namespace 'namespace', and applying any Service related options in opts
func CreateValidatingWebhookConfigurationResource ¶
func CreateValidatingWebhookConfigurationResource(name string, namespace string, opts ...ResourceCreatorOption) *admissionregistrationv1.ValidatingWebhookConfiguration
CreateValidatingWebhookConfigurationResource creates a ValidatingWebhookConfiguration resource with name 'name', namespace 'namespace', and applying any ValidatingWebhookConfiguration related options in opts
func WithDeploymentSpec ¶
func WithDeploymentSpec(depSpec appsv1.DeploymentSpec) func(client.Object)
WithDeploymentSpec applies a DeploymentSpec to Deployment resources
func WithLabels ¶
WithLabels applies labels to the metadata of any resource
func WithMutatingWebhooks ¶
func WithMutatingWebhooks(webhooks ...admissionregistrationv1.MutatingWebhook) func(client.Object)
WithMutatingWebhooks applies mutating webhooks to a MutatingWebhookConfiguration resource
func WithRoleRef ¶
WithRoleRef applies rbac RoleRef to ClusterRoleBinding and RoleBinding resources
func WithRules ¶
func WithRules(rules ...rbacv1.PolicyRule) func(client.Object)
WithRules applies rbac PolicyRules to Role and ClusterRole resources
func WithServiceSpec ¶
func WithServiceSpec(serviceSpec corev1.ServiceSpec) func(client.Object)
WithServiceSpec applies a service spec to a Service resource
func WithSubjects ¶
WithSubjects applies rbac subjects to ClusterRoleBinding and RoleBinding resources
func WithValidatingWebhooks ¶
func WithValidatingWebhooks(webhooks ...admissionregistrationv1.ValidatingWebhook) func(client.Object)
WithValidatingWebhooks applies validating webhooks to a ValidatingWebhookConfiguration resource
Types ¶
type ResourceCreatorOption ¶
type ResourceCreatorOptions ¶
type ResourceCreatorOptions []ResourceCreatorOption