Documentation
¶
Index ¶
- Constants
- Variables
- func AddPodTemplateSpecAnnotation(pts *corev1.PodTemplateSpec, annotation map[string]string)
- func AddSecretResourceVersionAsEnvVar(pts *corev1.PodTemplateSpec, la *wlv1.WebSphereLibertyApplication, ...) error
- func CommaSeparatedStringContains(stringList string, value string) int
- func CompareLibertyVersion(a string, b string) int
- func CompareOperandVersion(a string, b string) int
- func CompareStringTimeGreaterThanOrEqual(time1 string, time2 string) (bool, error)
- func ConfigureLTPAConfig(pts *corev1.PodTemplateSpec, la *wlv1.WebSphereLibertyApplication, ...)
- func ConfigurePasswordEncryption(pts *corev1.PodTemplateSpec, la *wlv1.WebSphereLibertyApplication, ...)
- func ConfigureServiceability(pts *corev1.PodTemplateSpec, la *wlv1.WebSphereLibertyApplication)
- func ConfigureServiceabilityNetworkPolicy(networkPolicy *networkingv1.NetworkPolicy)
- func Contains(list []string, s string) bool
- func CreateServiceabilityPVC(instance *wlv1.WebSphereLibertyApplication) *corev1.PersistentVolumeClaim
- func CreateUnstructuredResourceFromSignature(leaderTrackerType string, assetsFolder *string, args ...string) (*unstructured.Unstructured, string, error)
- func CreateUnstructuredResourceListFromSignature(leaderTrackerType string, assetsFolder *string, args ...string) (*unstructured.UnstructuredList, string, error)
- func CreateVolumeMount(mountPath string, fileName string) corev1.VolumeMount
- func CustomizeEncryptionKeyXML(managedEncryptionXMLSecret *corev1.Secret, encryptionKey string) error
- func CustomizeEnvSSO(pts *corev1.PodTemplateSpec, instance *wlv1.WebSphereLibertyApplication, ...) error
- func CustomizeKnativeServiceFileBasedProbes(ksvc *servingv1.Service, instance *wlv1.WebSphereLibertyApplication)
- func CustomizeKnativeServiceLibertyEnv(ksvc *servingv1.Service, la *wlv1.WebSphereLibertyApplication, ...) error
- func CustomizeLTPAServerXML(xmlSecret *corev1.Secret, la *wlv1.WebSphereLibertyApplication, ...) error
- func CustomizeLeaderTracker(leaderTracker *corev1.Secret, trackerList *[]LeaderTracker)
- func CustomizeLibertyAnnotations(pts *corev1.PodTemplateSpec, la *wlv1.WebSphereLibertyApplication)
- func CustomizeLibertyEnv(pts *corev1.PodTemplateSpec, la *wlv1.WebSphereLibertyApplication, ...) error
- func CustomizeLibertyFileMountXML(mountingPasswordKeySecret *corev1.Secret, mountXMLFileName string, ...) error
- func CustomizeLicenseAnnotations(pts *corev1.PodTemplateSpec, la *wlv1.WebSphereLibertyApplication)
- func CustomizePodSpecFileBasedProbes(pts *corev1.PodTemplateSpec, instance *wlv1.WebSphereLibertyApplication)
- func DecodeLinperfAttr(encodedAttr string) map[string]string
- func EncodeLinperfAttr(instance *wlv1.WebSphereLibertyPerformanceData) string
- func ExecuteCommandInContainer(config *rest.Config, podName, podNamespace, containerName string, ...) (string, error)
- func GetCommaSeparatedArray(stringList string) []string
- func GetCommaSeparatedString(stringList string, index int) (string, error)
- func GetFirstNumberFromString(target string) string
- func GetLastRotationLabelKey(sharedResourceName string) string
- func GetLeaderTracker(instance *wlv1.WebSphereLibertyApplication, operatorShortName string, ...) (*corev1.Secret, *[]LeaderTracker, error)
- func GetMaxTime(args ...string) (string, error)
- func GetOperandVersionString() (string, error)
- func GetOperatorLabels() map[string]string
- func GetPerformanceDataConnectionLostMessage(podName string) string
- func GetPerformanceDataWritingMessage(podName string) string
- func GetRandomAlphanumeric(length int) string
- func GetRandomLowerAlphanumericSuffix(length int) string
- func GetRequiredLabels(name string, instance string) map[string]string
- func GetSecretLastRotationAsLabelMap(la *wlv1.WebSphereLibertyApplication, client client.Client, secretName string, ...) (map[string]string, error)
- func GetSecretLastRotationLabel(la *wlv1.WebSphereLibertyApplication, client client.Client, secretName string, ...) (map[string]string, error)
- func GetTrackedResourceName(sharedResourceName string) string
- func GetWLOLicenseAnnotations() map[string]string
- func InsertIntoSortedLeaderTrackers(leaderTrackers *[]LeaderTracker, newLeader *LeaderTracker)
- func IsFileBasedProbesEnabled(instance *wlv1.WebSphereLibertyApplication) bool
- func IsLibertyVersionCheckNeeded(instance *wlv1.WebSphereLibertyApplication) bool
- func IsLowerAlphanumericSuffix(suffix string) bool
- func IsOperandVersionString(version string) bool
- func IsValidOperandVersion(version string) bool
- func LocalObjectReferenceContainsName(list []corev1.LocalObjectReference, name string) bool
- func MountSecretAsVolume(pts *corev1.PodTemplateSpec, secretName string, volumeMount corev1.VolumeMount)
- func RegisterWithOidcProvider(regData RegisterData) (string, string, error)
- func Remove(list []string, s string) []string
- func RemoveLeaderTracker(leaderTracker *[]LeaderTracker, i int) bool
- func RemoveMapElementByKey(refMap map[string]string, labelKey string)
- func RemovePodTemplateSpecAnnotationByKey(pts *corev1.PodTemplateSpec, annotationKey string)
- func Validate(wlapp *wlv1.WebSphereLibertyApplication) (bool, error)
- type LTPAConfig
- type LTPAMetadata
- type LTPAMetadataList
- type LeaderTracker
- func (tracker *LeaderTracker) ClearOwnerIfMatching(instance string) bool
- func (tracker *LeaderTracker) ClearOwnerIfMatchingAndSharesLastPathParent(instance string, path string) bool
- func (tracker *LeaderTracker) EvictOwner() bool
- func (tracker *LeaderTracker) EvictOwnerIfSubleaseHasExpired() bool
- func (tracker *LeaderTracker) RenewSublease() bool
- func (tracker *LeaderTracker) SetOwner(instance string) bool
- type LeaderTrackerMetadata
- type LeaderTrackerMetadataList
- type PasswordEncryptionMetadata
- type PasswordEncryptionMetadataList
- type PodInjectorClient
- type RegisterData
Constants ¶
const ( FlagDelimiterSpace = " " FlagDelimiterEquals = "=" OpConfigPerformanceDataMaxWorkers = "performanceDataMaxWorkers" OpConfigImageVersionChecks = "imageVersionChecks" OpConfigImageVersionChecksRefreshIntervalMinutes = "imageVersionChecksRefreshIntervalMinutes" OpConfigPasswordEncodingType = "passwordEncodingType" )
const EncryptionKeyMountXMLFileName = "encryptionKeyMount.xml"
const EncryptionKeyXMLFileName = "encryptionKey.xml"
const LTPAKeysFileName = "ltpa.keys"
const LTPAKeysMountXMLFileName = "managedLTPAMount.xml"
const LTPAKeysXMLFileName = "managedLTPA.xml"
const LTPAServerXMLMountSuffix = "-managed-ltpa-mount-server-xml"
const LTPAServerXMLSuffix = "-managed-ltpa-server-xml"
const LeaderVersionLabel = LibertyURI + "/leader-version"
const LibertyURI = "webspherelibertyapplications.liberty.websphere.ibm.com"
const LivenessProbeFileBasedScriptName = "livenessHealthCheck.sh"
const LivenessProbeFileName = "live"
const LocalPasswordEncryptionKeyRootName = "wlo-wlp-password-encryption-key"
const ManagedEncryptionMountServerXML = "-managed-encryption-mount-server-xml"
const ManagedEncryptionServerXML = "-managed-encryption-server-xml"
Password encryption constants
const OperandVersion = "1.5.2"
const PasswordEncryptionKeyRootName = "wlp-password-encryption-key"
const ReadinessProbeFileBasedScriptName = "readinessHealthCheck.sh"
const ReadinessProbeFileName = "ready"
const ResourceOwnersKey = "owners"
const ResourcePathIndexLabel = LibertyURI + "/resource-path-index"
const ResourcePathIndicesKey = "pathIndices"
const ResourcePathsKey = "paths"
const ResourceSuffixLength = 5
const ResourcesKey = "names"
Leader tracking constants
const SecureMountPath = "/output/liberty-operator"
Mount constants
const StartupProbeFileBasedScriptName = "startupHealthCheck.sh"
File-based probe constants
const StartupProbeFileName = "started"
const StatusReferenceLibertyVersion = "libertyVersion"
Status References
const StatusReferenceLibertyVersionLastPull = "libertyVersionLastPull"
Variables ¶
var DefaultLibertyOpConfig *sync.Map
var LeaderTrackerMutexes *sync.Map
Functions ¶
func AddPodTemplateSpecAnnotation ¶
func AddPodTemplateSpecAnnotation(pts *corev1.PodTemplateSpec, annotation map[string]string)
func AddSecretResourceVersionAsEnvVar ¶
func AddSecretResourceVersionAsEnvVar(pts *corev1.PodTemplateSpec, la *wlv1.WebSphereLibertyApplication, client client.Client, secretName string, envNamePrefix string) error
func CommaSeparatedStringContains ¶
returns the index of the contained value in stringList or else -1
func CompareLibertyVersion ¶
func CompareOperandVersion ¶
func CompareStringTimeGreaterThanOrEqual ¶
if time1 >= time2 then return true, otherwise false
func ConfigureLTPAConfig ¶
func ConfigureLTPAConfig(pts *corev1.PodTemplateSpec, la *wlv1.WebSphereLibertyApplication, operatorShortName string, ltpaSecretName string, ltpaSuffixName string)
ConfigureLTPA setups the shared-storage for LTPA keys file generation
func ConfigurePasswordEncryption ¶
func ConfigurePasswordEncryption(pts *corev1.PodTemplateSpec, la *wlv1.WebSphereLibertyApplication, operatorShortName string, passwordEncryptionMetadata *PasswordEncryptionMetadata)
func ConfigureServiceability ¶
func ConfigureServiceability(pts *corev1.PodTemplateSpec, la *wlv1.WebSphereLibertyApplication)
ConfigureServiceability setups the shared-storage for serviceability
func ConfigureServiceabilityNetworkPolicy ¶
func ConfigureServiceabilityNetworkPolicy(networkPolicy *networkingv1.NetworkPolicy)
ConfigureServiceabilityNetworkPolicy adds a network policy rule to permit ingress to the Liberty pod from the operator if serviceability is enabled
func CreateServiceabilityPVC ¶
func CreateServiceabilityPVC(instance *wlv1.WebSphereLibertyApplication) *corev1.PersistentVolumeClaim
CreateServiceabilityPVC creates PersistentVolumeClaim for Serviceability
func CreateUnstructuredResourceFromSignature ¶
func CreateUnstructuredResourceFromSignature(leaderTrackerType string, assetsFolder *string, args ...string) (*unstructured.Unstructured, string, error)
func CreateUnstructuredResourceListFromSignature ¶
func CreateUnstructuredResourceListFromSignature(leaderTrackerType string, assetsFolder *string, args ...string) (*unstructured.UnstructuredList, string, error)
func CreateVolumeMount ¶
func CreateVolumeMount(mountPath string, fileName string) corev1.VolumeMount
func CustomizeEnvSSO ¶
func CustomizeEnvSSO(pts *corev1.PodTemplateSpec, instance *wlv1.WebSphereLibertyApplication, client client.Client, isOpenShift bool) error
CustomizeEnvSSO Process the configuration for SSO login providers
func CustomizeKnativeServiceFileBasedProbes ¶
func CustomizeKnativeServiceFileBasedProbes(ksvc *servingv1.Service, instance *wlv1.WebSphereLibertyApplication)
Modifies the Knative Service instance to use Liberty file-based health checks in the "user-container" container
func CustomizeLTPAServerXML ¶
func CustomizeLeaderTracker ¶
func CustomizeLeaderTracker(leaderTracker *corev1.Secret, trackerList *[]LeaderTracker)
func CustomizeLibertyAnnotations ¶
func CustomizeLibertyAnnotations(pts *corev1.PodTemplateSpec, la *wlv1.WebSphereLibertyApplication)
func CustomizeLibertyEnv ¶
func CustomizeLibertyEnv(pts *corev1.PodTemplateSpec, la *wlv1.WebSphereLibertyApplication, client client.Client) error
CustomizeLibertyEnv adds configured env variables appending configured liberty settings
func CustomizeLicenseAnnotations ¶
func CustomizeLicenseAnnotations(pts *corev1.PodTemplateSpec, la *wlv1.WebSphereLibertyApplication)
func CustomizePodSpecFileBasedProbes ¶
func CustomizePodSpecFileBasedProbes(pts *corev1.PodTemplateSpec, instance *wlv1.WebSphereLibertyApplication)
Modifies the PodTemplateSpec to use Liberty file-based health checks in the "app" container
func DecodeLinperfAttr ¶
func EncodeLinperfAttr ¶
func EncodeLinperfAttr(instance *wlv1.WebSphereLibertyPerformanceData) string
func ExecuteCommandInContainer ¶
func ExecuteCommandInContainer(config *rest.Config, podName, podNamespace, containerName string, command []string) (string, error)
ExecuteCommandInContainer Execute command inside a container in a pod through API
func GetCommaSeparatedArray ¶
func GetCommaSeparatedString ¶
func GetLastRotationLabelKey ¶
func GetLeaderTracker ¶
func GetLeaderTracker(instance *wlv1.WebSphereLibertyApplication, operatorShortName string, leaderTrackerType string, client client.Client) (*corev1.Secret, *[]LeaderTracker, error)
func GetMaxTime ¶
func GetOperandVersionString ¶
Converts semantic version string "a.b.c" to format "va_b_c"
func GetOperatorLabels ¶
func GetRandomAlphanumeric ¶
func GetTrackedResourceName ¶
func InsertIntoSortedLeaderTrackers ¶
func InsertIntoSortedLeaderTrackers(leaderTrackers *[]LeaderTracker, newLeader *LeaderTracker)
func IsFileBasedProbesEnabled ¶
func IsFileBasedProbesEnabled(instance *wlv1.WebSphereLibertyApplication) bool
func IsLibertyVersionCheckNeeded ¶
func IsLibertyVersionCheckNeeded(instance *wlv1.WebSphereLibertyApplication) bool
func IsOperandVersionString ¶
func IsValidOperandVersion ¶
func LocalObjectReferenceContainsName ¶
func LocalObjectReferenceContainsName(list []corev1.LocalObjectReference, name string) bool
func MountSecretAsVolume ¶
func MountSecretAsVolume(pts *corev1.PodTemplateSpec, secretName string, volumeMount corev1.VolumeMount)
func RegisterWithOidcProvider ¶
func RegisterWithOidcProvider(regData RegisterData) (string, string, error)
func RemoveLeaderTracker ¶
func RemoveLeaderTracker(leaderTracker *[]LeaderTracker, i int) bool
func RemoveMapElementByKey ¶
func RemovePodTemplateSpecAnnotationByKey ¶
func RemovePodTemplateSpecAnnotationByKey(pts *corev1.PodTemplateSpec, annotationKey string)
Types ¶
type LTPAConfig ¶
type LTPAConfig struct {
Metadata *LTPAMetadata
SecretName string
SecretInstanceName string
ConfigSecretName string
ConfigSecretInstanceName string
ServiceAccountName string
JobRequestConfigMapName string
ConfigMapName string
FileName string
EncryptionKeySecretName string
EncryptionKeySharingEnabled bool // true or false
}
type LTPAMetadata ¶
func (LTPAMetadata) GetAPIVersion ¶
func (m LTPAMetadata) GetAPIVersion() string
func (LTPAMetadata) GetKind ¶
func (m LTPAMetadata) GetKind() string
func (LTPAMetadata) GetName ¶
func (m LTPAMetadata) GetName() string
func (LTPAMetadata) GetPath ¶
func (m LTPAMetadata) GetPath() string
func (LTPAMetadata) GetPathIndex ¶
func (m LTPAMetadata) GetPathIndex() string
type LTPAMetadataList ¶
type LTPAMetadataList struct {
Items []LeaderTrackerMetadata
}
func (LTPAMetadataList) GetItems ¶
func (ml LTPAMetadataList) GetItems() []LeaderTrackerMetadata
type LeaderTracker ¶
func (*LeaderTracker) ClearOwnerIfMatching ¶
func (tracker *LeaderTracker) ClearOwnerIfMatching(instance string) bool
Clears the LeaderTracker owner if it matches instance, returning true if the LeaderTracker has changed and false otherwise
func (*LeaderTracker) ClearOwnerIfMatchingAndSharesLastPathParent ¶
func (tracker *LeaderTracker) ClearOwnerIfMatchingAndSharesLastPathParent(instance string, path string) bool
func (*LeaderTracker) EvictOwner ¶
func (tracker *LeaderTracker) EvictOwner() bool
Removes the Owner and Sublease attribute from LeaderTracker to indicate the resource is no longer being tracked
func (*LeaderTracker) EvictOwnerIfSubleaseHasExpired ¶
func (tracker *LeaderTracker) EvictOwnerIfSubleaseHasExpired() bool
func (*LeaderTracker) RenewSublease ¶
func (tracker *LeaderTracker) RenewSublease() bool
func (*LeaderTracker) SetOwner ¶
func (tracker *LeaderTracker) SetOwner(instance string) bool
type LeaderTrackerMetadata ¶
type LeaderTrackerMetadataList ¶
type LeaderTrackerMetadataList interface {
GetItems() []LeaderTrackerMetadata
}
type PasswordEncryptionMetadata ¶
type PasswordEncryptionMetadata struct {
Kind string
APIVersion string
Name string
Path string
PathIndex string
}
func (PasswordEncryptionMetadata) GetAPIVersion ¶
func (m PasswordEncryptionMetadata) GetAPIVersion() string
func (PasswordEncryptionMetadata) GetKind ¶
func (m PasswordEncryptionMetadata) GetKind() string
func (PasswordEncryptionMetadata) GetName ¶
func (m PasswordEncryptionMetadata) GetName() string
func (PasswordEncryptionMetadata) GetPath ¶
func (m PasswordEncryptionMetadata) GetPath() string
func (PasswordEncryptionMetadata) GetPathIndex ¶
func (m PasswordEncryptionMetadata) GetPathIndex() string
type PasswordEncryptionMetadataList ¶
type PasswordEncryptionMetadataList struct {
Items []LeaderTrackerMetadata
}
func (PasswordEncryptionMetadataList) GetItems ¶
func (ml PasswordEncryptionMetadataList) GetItems() []LeaderTrackerMetadata
type PodInjectorClient ¶
type PodInjectorClient interface {
Connect() error
CloseConnection()
SetMaxWorkers(scriptName, podName, podNamespace, maxWorkers string) bool
PollStatus(scriptName, podName, podNamespace, attrs string) string
StartScript(scriptName, podName, podNamespace, attrs string) bool
CompleteScript(scriptName, podName, podNamespace, attrs string)
PollLinperfFileName(scriptName, podName, podNamespace, attrs string) string
}