-
Notifications
You must be signed in to change notification settings - Fork 135
Open
Description
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):
- 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.
Code Link:
The issue lies in the following go-runner code.
Function to be changed:
func SetHelperData(chaosDetails *types.ChaosDetails, setHelperData string, clients clients.ClientSets) error {
var pod *core_v1.Pod
pod, err := GetExperimentPod(chaosDetails.ChaosPodName, chaosDetails.ChaosNamespace, clients)
if err != nil {
return err
}
// Get Labels
labels := pod.ObjectMeta.Labels
for label := range labels {
if strings.HasSuffix(label, "job-name") || strings.HasSuffix(label, "controller-uid") {
delete(labels, label)
}
}
chaosDetails.Labels = labels
switch setHelperData {
case "false":
return nil
default:
// Get Chaos Pod Annotation
chaosDetails.Annotations = pod.Annotations
// Get ImagePullSecrets
chaosDetails.ImagePullSecrets = pod.Spec.ImagePullSecrets
// Get Resource Requirements
chaosDetails.Resources, err = getChaosPodResourceRequirements(pod, chaosDetails.ExperimentName)
if err != nil {
return stacktrace.Propagate(err, "could not inherit resource requirements")
}
return nil
}
}Metadata
Metadata
Assignees
Labels
No labels