Skip to content

Commit

Permalink
fix: unsupported success policy when success policy is not specified (#…
Browse files Browse the repository at this point in the history
…1170)

Signed-off-by: Yi Chen <github@chenyicn.net>
  • Loading branch information
ChenYi015 authored Oct 14, 2024
1 parent fdcfd18 commit 45c8e1b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pkg/argsbuilder/submit_tfjob.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License

package argsbuilder

import (
Expand All @@ -34,6 +35,7 @@ import (
const (
disableTFConfigAnnotation = "arena.kubeflow.org/disable-tf-config"

TFJobSuccessPolicyDefault = ""
TFJobSuccessPolicyChiefWorker = "ChiefWorker"
TFJobSuccessPolicyAllWorkers = "AllWorkers"
)
Expand Down Expand Up @@ -268,7 +270,7 @@ func (s *SubmitTFJobArgsBuilder) setRunPolicy() error {

func (s *SubmitTFJobArgsBuilder) check() error {
switch s.args.SuccessPolicy {
case TFJobSuccessPolicyChiefWorker, TFJobSuccessPolicyAllWorkers:
case TFJobSuccessPolicyDefault, TFJobSuccessPolicyAllWorkers:
log.Debugf("Supported successPolicy: %s", s.args.SuccessPolicy)
default:
return fmt.Errorf("unsupported successPolicy %s", s.args.SuccessPolicy)
Expand Down Expand Up @@ -417,7 +419,7 @@ func (s *SubmitTFJobArgsBuilder) transform() error {

if s.args.SuccessPolicy == TFJobSuccessPolicyChiefWorker {
// The value of chief worker policy actually is empty string in training-operator.
s.args.SuccessPolicy = ""
s.args.SuccessPolicy = TFJobSuccessPolicyDefault
}

return nil
Expand Down

0 comments on commit 45c8e1b

Please sign in to comment.