Documentation ¶
Overview ¶
nolint
Index ¶
- Constants
- func AddAnnotationWarnUnknownCRD(c client.Client, log logr.Logger, ibu *lcav1alpha1.ImageBasedUpgrade, ...) error
- func ApplyExtraManifest(ctx context.Context, dc dynamic.Interface, restMapper meta.RESTMapper, ...) error
- func GetMatchingTargetOcpVersionLabelVersions(ocpVersion string) ([]string, error)
- func IsEMFailedError(err error) bool
- func RemoveAnnotationWarnUnknownCRD(c client.Client, ibu *lcav1alpha1.ImageBasedUpgrade, log logr.Logger) error
- type EMHandler
- func (h *EMHandler) ApplyExtraManifests(ctx context.Context, fromDir string) error
- func (h *EMHandler) ExportExtraManifestToDir(ctx context.Context, extraManifestCMs []lcav1alpha1.ConfigMapRef, toDir string) error
- func (h *EMHandler) ExtractAndExportManifestFromPoliciesToDir(ctx context.Context, ...) error
- func (h *EMHandler) GetPolicies(ctx context.Context, labels map[string]string) ([]*policiesv1.Policy, error)
- func (h *EMHandler) ValidateAndExtractManifestFromPolicies(ctx context.Context, ...) ([][]*unstructured.Unstructured, error)
- func (h *EMHandler) ValidateExtraManifestConfigmaps(ctx context.Context, content []lcav1alpha1.ConfigMapRef, ...) error
- type EMStatusError
- type EManifestHandler
Constants ¶
const ( ExtraManifestPath = "/opt/extra-manifests" PolicyManifestPath = "/opt/policy-manifests" WarnAnnotationUnknownCRDKey = "lca.openshift.io/warn-extramanifest-cm-unknown-crd" )
const TargetOcpVersionLabel = "lca.openshift.io/target-ocp-version"
const TargetOcpVersionManifestCountAnnotation = "lca.openshift.io/target-ocp-version-manifest-count"
Variables ¶
This section is empty.
Functions ¶
func AddAnnotationWarnUnknownCRD ¶
func AddAnnotationWarnUnknownCRD(c client.Client, log logr.Logger, ibu *lcav1alpha1.ImageBasedUpgrade, annotationValue string) error
AddAnnotationWarnUnknownCRD add warning in annotation for when CRD is unknown
func ApplyExtraManifest ¶
func ApplyExtraManifest(ctx context.Context, dc dynamic.Interface, restMapper meta.RESTMapper, manifest *unstructured.Unstructured, isDryRun bool) error
func GetMatchingTargetOcpVersionLabelVersions ¶
GetMatchingTargetOcpVersionLabelVersions generates a list of matching versions that be used for extracting manifests from the policy The matching versions include: [full release version, Major.Minor.Patch, Major.Minor]
func IsEMFailedError ¶
func RemoveAnnotationWarnUnknownCRD ¶
func RemoveAnnotationWarnUnknownCRD(c client.Client, ibu *lcav1alpha1.ImageBasedUpgrade, log logr.Logger) error
RemoveAnnotationWarnUnknownCRD remove the warning if present
Types ¶
type EMHandler ¶
EMHandler handles the extra manifests
func (*EMHandler) ApplyExtraManifests ¶
ApplyExtraManifests applies the extra manifests from the preserved extra manifests directory
func (*EMHandler) ExportExtraManifestToDir ¶
func (h *EMHandler) ExportExtraManifestToDir(ctx context.Context, extraManifestCMs []lcav1alpha1.ConfigMapRef, toDir string) error
ExportExtraManifestToDir extracts the extra manifests from configmaps and writes them to the given directory
func (*EMHandler) ExtractAndExportManifestFromPoliciesToDir ¶
func (h *EMHandler) ExtractAndExportManifestFromPoliciesToDir(ctx context.Context, policyLabels, objectLabels, validationAnns map[string]string, toDir string) error
ExtractAndExportManifestFromPoliciesToDir extracts CR specs from policies and writes to a given directory. It matches policies and/or CRs by labels.
func (*EMHandler) GetPolicies ¶
func (h *EMHandler) GetPolicies(ctx context.Context, labels map[string]string) ([]*policiesv1.Policy, error)
GetPolicies gets the policies matching the labels from the namespace and sort them by the ztp wave annotation value
func (*EMHandler) ValidateAndExtractManifestFromPolicies ¶
func (h *EMHandler) ValidateAndExtractManifestFromPolicies(ctx context.Context, policyLabels, objectLabels, validationAnns map[string]string) ([][]*unstructured.Unstructured, error)
func (*EMHandler) ValidateExtraManifestConfigmaps ¶
func (h *EMHandler) ValidateExtraManifestConfigmaps(ctx context.Context, content []lcav1alpha1.ConfigMapRef, ibu *lcav1alpha1.ImageBasedUpgrade) error
type EMStatusError ¶
EMStatusError type
func NewEMFailedError ¶
func NewEMFailedError(msg string) *EMStatusError
func NewEMFailedValidationError ¶
func NewEMFailedValidationError(msg string) *EMStatusError
func NewEMUnknownCRDError ¶
func NewEMUnknownCRDError(msg string) *EMStatusError
func (*EMStatusError) Error ¶
func (e *EMStatusError) Error() string
type EManifestHandler ¶
type EManifestHandler interface { ApplyExtraManifests(ctx context.Context, fromDir string) error ExportExtraManifestToDir(ctx context.Context, extraManifestCMs []lcav1alpha1.ConfigMapRef, toDir string) error ExtractAndExportManifestFromPoliciesToDir(ctx context.Context, policyLabels, objectLabels, validationAnns map[string]string, toDir string) error ValidateAndExtractManifestFromPolicies(ctx context.Context, policyLabels, objectLabels, validationAnns map[string]string) ([][]*unstructured.Unstructured, error) ValidateExtraManifestConfigmaps(ctx context.Context, extraManifestCMs []lcav1alpha1.ConfigMapRef, ibu *lcav1alpha1.ImageBasedUpgrade) error }