Documentation ¶
Index ¶
- Constants
- Variables
- func CopyOutsideChroot(src, dest string) error
- func ExtractResourcesFromConfigmaps[T metav1.Object](configmaps []corev1.ConfigMap, gvk schema.GroupVersionKind) ([]T, error)
- func GenerateDeleteOptions() *client.DeleteOptions
- func GetConfigMap(ctx context.Context, c client.Client, configMap ibuv1.ConfigMapRef) (*corev1.ConfigMap, error)
- func GetConfigMaps(ctx context.Context, c client.Client, configMaps []ibuv1.ConfigMapRef) ([]corev1.ConfigMap, error)
- func GetDesiredStaterootName(ibu *ibuv1.ImageBasedUpgrade) string
- func GetStaterootCertsDir(ibu *ibuv1.ImageBasedUpgrade) string
- func GetStaterootName(seedImageVersion string) string
- func GetStaterootOptOpenshift(staterootPath string) string
- func GetStaterootPath(osname string) string
- func IsJobFinished(job *kbatch.Job) (bool, kbatch.JobConditionType)
- func LogPodLogs(job *kbatch.Job, log logr.Logger, clientset *kubernetes.Clientset)
- func PathInsideChroot(filename string) (string, error)
- func PathOutsideChroot(filename string) string
- func RemoveDuplicates[T comparable](list []T) []T
- func SortAndGroupByApplyWave[T metav1.Object](objs []T) ([][]T, error)
Constants ¶
const ( VarFolder = "/var" BackupDir = "/var/tmp/backup" BackupCertsDir = "/var/tmp/backupCertsDir" BackupChecksDir = "/var/tmp/checks" // Workload partitioning annotation key and value WorkloadManagementAnnotationKey = "target.workload.openshift.io/management" WorkloadManagementAnnotationValue = `{"effect": "PreferredDuringScheduling"}` // ImageRegistryAuthFile is the pull secret. Written by the machine-config-operator ImageRegistryAuthFile = "/var/lib/kubelet/config.json" KubeconfigFile = "/etc/kubernetes/static-pod-resources/kube-apiserver-certs/secrets/node-kubeconfigs/lb-ext.kubeconfig" RecertImageEnvKey = "RELATED_IMAGE_RECERT_IMAGE" DefaultRecertImage = "quay.io/edge-infrastructure/recert:v0" EtcdStaticPodFile = "/etc/kubernetes/manifests/etcd-pod.yaml" EtcdStaticPodContainer = "etcd" EtcdDefaultEndpoint = "localhost:2379" OvnIcEtcFolder = "/var/lib/ovn-ic/etc" OvnNodeCerts = OvnIcEtcFolder + "/ovnkube-node-certs" MultusCerts = "/etc/cni/multus/certs" ChronyConfig = "/etc/chrony.conf" SSHServerKeysDirectory = "/etc/ssh" MCDCurrentConfig = "/etc/machine-config-daemon/currentconfig" InstallationConfigurationFilesDir = "/usr/local/installation_configuration_files" OptOpenshift = "/opt/openshift" SeedDataDir = "/var/seed_data" KubeconfigCryptoDir = "kubeconfig-crypto" ClusterConfigDir = "cluster-configuration" SeedClusterInfoFileName = "manifest.json" SeedReconfigurationFileName = "manifest.json" ManifestsDir = "manifests" ExtraManifestsDir = "extra-manifests" EtcdContainerName = "recert_etcd" LvmConfigDir = "lvm-configuration" LvmDevicesPath = "/etc/lvm/devices/system.devices" CABundleFilePath = "/etc/pki/ca-trust/source/anchors/openshift-config-user-ca-bundle.crt" LCAConfigDir = "/var/lib/lca" IBUAutoRollbackConfigFile = LCAConfigDir + "/autorollback_config.json" IBUAutoRollbackInitMonitorTimeoutDefaultSeconds = 1800 IBUInitMonitorService = "lca-init-monitor.service" IBUInitMonitorServiceFile = "/etc/systemd/system/" + IBUInitMonitorService // AutoRollbackOnFailurePostRebootConfigAnnotation configure automatic rollback when the reconfiguration of the cluster fails upon the first reboot. // Only acceptable value is AutoRollbackDisableValue. Any other value is treated as "Enabled". AutoRollbackOnFailurePostRebootConfigAnnotation = "auto-rollback-on-failure.lca.openshift.io/post-reboot-config" // AutoRollbackOnFailureUpgradeCompletionAnnotation configure automatic rollback after the Lifecycle Agent reports a failed upgrade upon completion. // Only acceptable value is AutoRollbackDisableValue. Any other value is treated as "Enabled". AutoRollbackOnFailureUpgradeCompletionAnnotation = "auto-rollback-on-failure.lca.openshift.io/upgrade-completion" // AutoRollbackOnFailureInitMonitorAnnotation configure automatic rollback LCA Init Monitor watchdog, which triggers auto-rollback if timeout occurs before upgrade completion // Only acceptable value is AutoRollbackDisableValue. Any other value is treated as "Enabled". AutoRollbackOnFailureInitMonitorAnnotation = "auto-rollback-on-failure.lca.openshift.io/init-monitor" // AutoRollbackDisableValue value that decides if rollback is disabled AutoRollbackDisableValue = "Disabled" // ContainerStorageUsageThresholdPercentAnnotation overrides default /var/lib/containers disk usage threshold for image cleanup ContainerStorageUsageThresholdPercentAnnotation = "image-cleanup.lca.openshift.io/disk-usage-threshold-percent" // ContainerStorageUsageThresholdPercentDefault is the default /var/lib/containers disk usage threshold for image cleanu ContainerStorageUsageThresholdPercentDefault = 50 // ImageCleanupOnPrepAnnotation configures automatic image cleanup during IBU Prep, if disk usage threshold is exceeded // Only acceptable value is ImageCleanupDisabledValue. Any other value is treated as "Enabled". ImageCleanupOnPrepAnnotation = "image-cleanup.lca.openshift.io/on-prep" // ImageCleanupDisabledValue value to disable image cleanup ImageCleanupDisabledValue = "Disabled" LcaNamespace = "openshift-lifecycle-agent" Host = "/host" CsvDeploymentName = "cluster-version-operator" CsvDeploymentNamespace = "openshift-cluster-version" // InstallConfigCM cm name InstallConfigCM = "cluster-config-v1" // InstallConfigCMNamespace cm namespace InstallConfigCMNamespace = "kube-system" // InstallConfigCMNamespace data key InstallConfigCMInstallConfigDataKey = "install-config" OpenshiftInfraCRName = "cluster" OpenshiftProxyCRName = "cluster" // Env var to configure auto rollback for post-reboot config failure IBUPostRebootConfigAutoRollbackOnFailureEnv = "LCA_IBU_AUTO_ROLLBACK_ON_CONFIG_FAILURE" // Bump this every time the seed format changes in a backwards incompatible way SeedFormatVersion = 4 SeedFormatOCILabel = "com.openshift.lifecycle-agent.seed_format_version" SeedClusterInfoOCILabel = "com.openshift.lifecycle-agent.seed_cluster_info" PullSecretName = "pull-secret" PullSecretEmptyData = "" //nolint:gosec /* 138-byte string literal not displayed */ OpenshiftConfigNamespace = "openshift-config" NMConnectionFolder = "/etc/NetworkManager/system-connections" NetworkDir = "network-configuration" CaBundleDataKey = "ca-bundle.crt" ClusterAdditionalTrustBundleName = "user-ca-bundle" IBIPSFile = "/var/tmp/pull-secret.json" PostDeploymentScriptPath = "/var/tmp/post.sh" ContainerStoragePath = "/var/lib/containers" )
Common constants mainly used by packages in lca-cli
const ( ApplyWaveAnn = "lca.openshift.io/apply-wave" ApplyTypeAnnotation = "lca.openshift.io/apply-type" ApplyTypeReplace = "replace" // default if annotation doesn't exist ApplyTypeMerge = "merge" )
Annotation names and values related to extra manifest
Variables ¶
var ( BackupGvk = schema.GroupVersionKind{Group: "velero.io", Kind: "Backup", Version: "v1"} RestoreGvk = schema.GroupVersionKind{Group: "velero.io", Kind: "Restore", Version: "v1"} )
var CertPrefixes = []string{
"loadbalancer-serving-signer",
"localhost-serving-signer",
"service-network-serving-signer",
}
CertPrefixes is the list of certificate prefixes to be backed up before creating the seed image
var OstreeDeployPathPrefix = ""
TODO: Need a better way to change this but will require relatively big refactoring
var TarOpts = []string{"--selinux", "--xattrs", "--xattrs-include=*", "--acls"}
Functions ¶
func CopyOutsideChroot ¶
func GenerateDeleteOptions ¶
func GenerateDeleteOptions() *client.DeleteOptions
func GetConfigMap ¶
func GetConfigMap(ctx context.Context, c client.Client, configMap ibuv1.ConfigMapRef) (*corev1.ConfigMap, error)
GetConfigMap retrieves the configmap from cluster
func GetConfigMaps ¶
func GetConfigMaps(ctx context.Context, c client.Client, configMaps []ibuv1.ConfigMapRef) ([]corev1.ConfigMap, error)
GetConfigMaps retrieves a collection of configmaps from cluster
func GetDesiredStaterootName ¶
func GetDesiredStaterootName(ibu *ibuv1.ImageBasedUpgrade) string
func GetStaterootCertsDir ¶
func GetStaterootCertsDir(ibu *ibuv1.ImageBasedUpgrade) string
func GetStaterootName ¶
func GetStaterootOptOpenshift ¶
GetStaterootOptOpenshift returns the path to the `/opt/openshift` directory in a given stateroot. Note that since `/opt` in ostree systems is actually a symlink to `/var/opt`, and the `/var` directory of a stateroot is outside the stateroot deployment, we need to access it in this odd manner.
func GetStaterootPath ¶
func IsJobFinished ¶
func IsJobFinished(job *kbatch.Job) (bool, kbatch.JobConditionType)
IsJobFinished job "finished" if it has a "Complete" or "Failed" condition marked as true.
func LogPodLogs ¶
LogPodLogs a function to print out logs from pods generated by job. If any error it will simply log the error and exit silently
func PathInsideChroot ¶
PathInsideChroot returns filepath removing host fs prefix
func PathOutsideChroot ¶
PathOutsideChroot returns filepath with host fs
func RemoveDuplicates ¶
func RemoveDuplicates[T comparable](list []T) []T
func SortAndGroupByApplyWave ¶
Types ¶
This section is empty.