Skip to content

Commit 521dba1

Browse files
authored
Fix delta bug (#163)
Issue #, if available: If the user creates a training job with a profileRuleConfiguration but without a debugRuleConfiguration the controller crashes because it compares profileRuleConfiguration and debugRuleConfiguration(which could have a length of zero) and causes an index error. Steps to reproduce: Run trainingjob with normal parameters(https://github.com/aws-controllers-k8s/sagemaker-controller/blob/main/samples/training/my-training-job.yaml) but with a profileRuleConfiguration and profilerConfig Description of changes: Changes custom set defaults function to compare only profileRuleConfiguration. By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
1 parent c752d87 commit 521dba1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pkg/resource/training_job/custom_delta.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ func customSetDefaults(
2828

2929
if ackcompare.IsNotNil(a.ko.Spec.ProfilerRuleConfigurations) && ackcompare.IsNotNil(b.ko.Spec.ProfilerRuleConfigurations) {
3030
for index := range a.ko.Spec.ProfilerRuleConfigurations {
31-
if ackcompare.IsNil(a.ko.Spec.ProfilerRuleConfigurations[index].VolumeSizeInGB) && ackcompare.IsNotNil(b.ko.Spec.DebugRuleConfigurations[index].VolumeSizeInGB) {
31+
if ackcompare.IsNil(a.ko.Spec.ProfilerRuleConfigurations[index].VolumeSizeInGB) && ackcompare.IsNotNil(b.ko.Spec.ProfilerRuleConfigurations[index].VolumeSizeInGB) {
3232
a.ko.Spec.ProfilerRuleConfigurations[index].VolumeSizeInGB = defaultVolumeSizeInGB
3333
}
3434
}

0 commit comments

Comments
 (0)