Skip to content

Commit

Permalink
refactor: simple logic
Browse files Browse the repository at this point in the history
  • Loading branch information
siyul-park committed Nov 22, 2023
1 parent 11dadeb commit 50864f0
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions cmd/uniflow/apply/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,11 +115,10 @@ func NewCmd(config Config) *cobra.Command {
for _, spec := range specs {
if util.IsZero(spec.GetID()) {
if spec.GetName() != "" {
exist, err := st.FindOne(ctx, storage.Where[string](scheme.KeyName).EQ(spec.GetName()).And(storage.Where[string](scheme.KeyNamespace).EQ(spec.GetNamespace())))
if err != nil {
filter := storage.Where[string](scheme.KeyName).EQ(spec.GetName()).And(storage.Where[string](scheme.KeyNamespace).EQ(spec.GetNamespace()))
if exist, err := st.FindOne(ctx, filter); err != nil {

Check warning on line 119 in cmd/uniflow/apply/cmd.go

View check run for this annotation

Codecov / codecov/patch

cmd/uniflow/apply/cmd.go#L118-L119

Added lines #L118 - L119 were not covered by tests
return err
}
if exist != nil {
} else if exist != nil {

Check warning on line 121 in cmd/uniflow/apply/cmd.go

View check run for this annotation

Codecov / codecov/patch

cmd/uniflow/apply/cmd.go#L121

Added line #L121 was not covered by tests
spec.SetID(exist.GetID())
}
} else {
Expand Down

0 comments on commit 50864f0

Please sign in to comment.