Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
Signed-off-by: Derek Su <[email protected]>
  • Loading branch information
derekbit committed Nov 19, 2024
1 parent 92bcd2f commit 2adf734
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pkg/spdk/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ func NewEngine(engineName, volumeName, frontend string, specSize uint64, engineU
}

func isNewEngine(e *Engine) bool {
return e.IP == ""
return e.IP == "" && e.TargetIP == "" && e.StandbyTargetPort == 0

Check warning on line 109 in pkg/spdk/engine.go

View check run for this annotation

Codecov / codecov/patch

pkg/spdk/engine.go#L108-L109

Added lines #L108 - L109 were not covered by tests
}

func (e *Engine) checkInitiatorAndTargetCreationRequirements(podIP, initiatorIP, targetIP string) (bool, bool, error) {
Expand Down Expand Up @@ -214,7 +214,9 @@ func (e *Engine) Create(spdkClient *spdkclient.Client, replicaAddressMap map[str
}

Check warning on line 214 in pkg/spdk/engine.go

View check run for this annotation

Codecov / codecov/patch

pkg/spdk/engine.go#L208-L214

Added lines #L208 - L214 were not covered by tests

if isNewEngine(e) {
e.IP = initiatorIP
if initiatorCreationRequired {
e.IP = initiatorIP
}
e.TargetIP = targetIP

Check warning on line 220 in pkg/spdk/engine.go

View check run for this annotation

Codecov / codecov/patch

pkg/spdk/engine.go#L216-L220

Added lines #L216 - L220 were not covered by tests
}

Expand Down

0 comments on commit 2adf734

Please sign in to comment.