Documentation ¶
Index ¶
- Constants
- func GetCatalogTemplateAnnotation(catalogSource *v1alpha1.CatalogSource) string
- func RemoveStatusConditions(logger *logrus.Entry, client versioned.Interface, ...) error
- func ReplaceTemplates(catalogImageTemplate string) (processedCatalogImageTemplate string, unresolvedTemplates []string)
- func UpdateKubeVersion(serverVersion *version.Info, logger *logrus.Logger)
- func UpdateSpecAndStatusConditions(logger *logrus.Entry, client versioned.Interface, ...) error
- func UpdateStatus(logger *logrus.Entry, client versioned.Interface, ...) error
- func UpdateStatusWithConditions(logger *logrus.Entry, client versioned.Interface, ...) error
Constants ¶
const ( // TemplKubeMajorV is a template that represents the kube major version TemplKubeMajorV = "{kube_major_version}" // TemplKubeMinorV is a template that represents the kube minor version TemplKubeMinorV = "{kube_minor_version}" // TemplKubePatchV is a template that represents the kube patch version TemplKubePatchV = "{kube_patch_version}" // catalogImageTemplateAnnotation is OLM annotation. The annotation value that corresponds // to this key is used as means to adjust a catalog source image, where templated // values are replaced with values found in the cluster CatalogImageTemplateAnnotation = "olm.catalogImageTemplate" )
Variables ¶
This section is empty.
Functions ¶
func GetCatalogTemplateAnnotation ¶
func GetCatalogTemplateAnnotation(catalogSource *v1alpha1.CatalogSource) string
GetCatalogTemplateAnnotation is a helper function to extract the catalog image template annotation. Returns empty string if value not set, otherwise returns annotation.
func RemoveStatusConditions ¶
func RemoveStatusConditions(logger *logrus.Entry, client versioned.Interface, catsrc *v1alpha1.CatalogSource, conditionTypes ...string) error
RemoveStatusConditions can be used to remove the status conditions for the provided catalog source.
This function will make no changes to the other status fields (those fields will be used as-is). If the provided conditions do not result in any status condition changes, then the API server will not be updated. Note that the caller is responsible for ensuring accurate status values for all other fields.
• logger: used to log errors only
• client: used to fetch / update catalog source status
• catsrc: the CatalogSource to use as a source for status condition removal.
• conditionTypes: condition types to be removed
func ReplaceTemplates ¶
func ReplaceTemplates(catalogImageTemplate string) (processedCatalogImageTemplate string, unresolvedTemplates []string)
ReplaceTemplates takes a catalog image reference containing templates (i.e. catalogImageTemplate) and attempts to replace the templates with actual values (if available). The return value processedCatalogImageTemplate represents the catalog image reference after processing. Callers of this function should check the unresolvedTemplates return value to determine if all values were properly resolved (i.e. empty slice means all items were resolved, and presence of a value in the slice means that the template was either not found in the cache or its value has not been fetched yet). Providing an empty catalogImageTemplate results in empty processedCatalogImageTemplate and zero length unresolvedTemplates
func UpdateSpecAndStatusConditions ¶
func UpdateSpecAndStatusConditions(logger *logrus.Entry, client versioned.Interface, catsrc *v1alpha1.CatalogSource, conditions ...metav1.Condition) error
UpdateSpecAndStatusConditions can be used to update the catalog source with the provided status conditions.
This will update the spec and status portions of the catalog source. Calls to the API server will occur even if the provided conditions result in no changes.
• logger: used to log errors only
• client: used to fetch / update catalog source
• catsrc: the CatalogSource to use as a source for image and status condition updates.
• conditions: condition values to be updated
func UpdateStatus ¶
func UpdateStatus(logger *logrus.Entry, client versioned.Interface, catsrc *v1alpha1.CatalogSource) error
UpdateStatus can be used to update the status of the provided catalog source. Note that
the caller is responsible for ensuring accurate status values in the catsrc argument (i.e. the status is used as-is).
• logger: used to log errors only
• client: used to fetch / update catalog source status
• catsrc: the CatalogSource to use as a source for status updates. Callers are responsible for updating the catalog source status values as necessary.
func UpdateStatusWithConditions ¶
func UpdateStatusWithConditions(logger *logrus.Entry, client versioned.Interface, catsrc *v1alpha1.CatalogSource, conditions ...metav1.Condition) error
UpdateStatusWithConditions can be used to update the status conditions for the provided catalog source.
This function will make no changes to the other status fields (those fields will be used as-is). If the provided conditions do not result in any status condition changes, then the API server will not be updated. Note that the caller is responsible for ensuring accurate status values for all other fields.
• logger: used to log errors only
• client: used to fetch / update catalog source status
• catsrc: the CatalogSource to use as a source for status updates.
• conditions: condition values to be updated
Types ¶
This section is empty.