You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I’m working on fixing OpenShift failures in LitmusChaos and identified an issue with the set_helper_data flag in the go-runner code. For OpenShift, the set_helper_data flag needs to be set to false. However, when this is done, the SetHelperData function sets ImagePullSecrets to nil. This results in the helper pod failing to pull its image in air-gapped clusters, as the required ImagePullSecrets are missing.
What you expected to happen:
The helper pod should be able to pull the required images successfully in air-gapped environments, even when the set_helper_data flag is set to false.
How to reproduce it (as minimally and precisely as possible):
Set up an air-gapped OpenShift cluster with a private registry that requires authentication.
Attempt to run a LitmusChaos test that requires a helper pod.
The helper pod will fail to pull the image because ImagePullSecrets are set to nil due to the set_helper_data flag being set to false.
Anything else we need to know?:
Solution: Update the SetHelperData function in the go-runner code to ensure that ImagePullSecrets are retained even when the set_helper_data flag is set to false. This will allow the helper pods to successfully pull images in air-gapped clusters.
Temporary Workaround: Until the fix is merged into go-runner, create a custom image with the necessary code changes and use it in the setup to temporarily resolve the issue.
funcSetHelperData(chaosDetails*types.ChaosDetails, setHelperDatastring, clients clients.ClientSets) error {
varpod*core_v1.Podpod, err:=GetExperimentPod(chaosDetails.ChaosPodName, chaosDetails.ChaosNamespace, clients)
iferr!=nil {
returnerr
}
// Get Labelslabels:=pod.ObjectMeta.Labelsforlabel:=rangelabels {
ifstrings.HasSuffix(label, "job-name") ||strings.HasSuffix(label, "controller-uid") {
delete(labels, label)
}
}
chaosDetails.Labels=labelsswitchsetHelperData {
case"false":
returnnildefault:
// Get Chaos Pod AnnotationchaosDetails.Annotations=pod.Annotations// Get ImagePullSecretschaosDetails.ImagePullSecrets=pod.Spec.ImagePullSecrets// Get Resource RequirementschaosDetails.Resources, err=getChaosPodResourceRequirements(pod, chaosDetails.ExperimentName)
iferr!=nil {
returnstacktrace.Propagate(err, "could not inherit resource requirements")
}
returnnil
}
}
The text was updated successfully, but these errors were encountered:
Yashi5108
changed the title
Tests with helper pods fail in air-gapped mode with private registry requiring authentication.
Tests Requiring Helper Pods Fail in Air-Gapped OpenShift Cluster with Private Registry Authentication.
Dec 30, 2024
BUG REPORT
What happened:
I’m working on fixing OpenShift failures in LitmusChaos and identified an issue with the set_helper_data flag in the go-runner code. For OpenShift, the set_helper_data flag needs to be set to false. However, when this is done, the SetHelperData function sets ImagePullSecrets to nil. This results in the helper pod failing to pull its image in air-gapped clusters, as the required ImagePullSecrets are missing.
What you expected to happen:
The helper pod should be able to pull the required images successfully in air-gapped environments, even when the set_helper_data flag is set to false.
How to reproduce it (as minimally and precisely as possible):
Anything else we need to know?:
Code Link:
The issue lies in the following go-runner code.
Function to be changed:
The text was updated successfully, but these errors were encountered: