Skip to content

Commit c9dbd0d

Browse files
authored
add stageIndex and correct logPersisterTest write method (#6074)
Signed-off-by: hiep-tk <hiep.trinhkhanh0466@gmail.com>
1 parent 87787ba commit c9dbd0d

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

pkg/plugin/sdk/deployment.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,7 @@ func executeStage[Config, DeployTargetConfig, ApplicationConfigSpec any](
300300
in := &ExecuteStageInput[ApplicationConfigSpec]{
301301
Request: ExecuteStageRequest[ApplicationConfigSpec]{
302302
StageName: request.GetInput().GetStage().GetName(),
303+
StageIndex: int(request.GetInput().GetStage().GetIndex()),
303304
StageConfig: request.GetInput().GetStageConfig(),
304305
RunningDeploymentSource: runningDeploymentSource,
305306
TargetDeploymentSource: targetDeploymentSource,
@@ -538,6 +539,8 @@ type ExecuteStageInput[ApplicationConfigSpec any] struct {
538539
type ExecuteStageRequest[ApplicationConfigSpec any] struct {
539540
// The name of the stage to execute.
540541
StageName string
542+
// The index of the stage to execute.
543+
StageIndex int
541544
// Json encoded configuration of the stage.
542545
StageConfig []byte
543546

pkg/plugin/sdk/logpersister/logpersistertest/logpersister.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ func (lp TestLogPersister) StageLogPersister(deploymentID, stageID string) logpe
3838
func (lp TestLogPersister) Write(log []byte) (int, error) {
3939
// Write the log to the test logger
4040
lp.t.Log(string(log))
41-
return 0, nil
41+
return len(log), nil
4242
}
4343
func (lp TestLogPersister) Info(log string) {
4444
lp.t.Log("INFO", log)

0 commit comments

Comments
 (0)