Skip to content

Commit

Permalink
Regard DSP as done only when preparation is successful considering of…
Browse files Browse the repository at this point in the history
… reuse the provider (#5216)

* Regard DSP as done only when preparation is successful considering of reuse the provider

Signed-off-by: Yoshiki Fujikane <ffjlabo@gmail.com>

* Same fix for provider.GetReadOnly

Signed-off-by: Yoshiki Fujikane <ffjlabo@gmail.com>

---------

Signed-off-by: Yoshiki Fujikane <ffjlabo@gmail.com>
  • Loading branch information
ffjlabo committed Sep 18, 2024
1 parent 5d3e17d commit 5b9d417
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions pkg/app/piped/deploysource/deploysource.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ func (p *provider) Get(ctx context.Context, lw io.Writer) (*DeploySource, error)

if !p.done {
p.source, p.err = p.prepare(ctx, lw)
p.done = true
p.done = p.err == nil // If there is an error, we should re-prepare it next time.
}

if p.err != nil {
Expand All @@ -114,7 +114,7 @@ func (p *provider) GetReadOnly(ctx context.Context, lw io.Writer) (*DeploySource

if !p.done {
p.source, p.err = p.prepare(ctx, lw)
p.done = true
p.done = p.err == nil // If there is an error, we should re-prepare it next time.
}

if p.err != nil {
Expand Down
2 changes: 1 addition & 1 deletion pkg/app/pipedv1/deploysource/deploysource.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ func (p *provider) Get(ctx context.Context, lw io.Writer) (*DeploySource, error)

if !p.done {
p.source, p.err = p.prepare(ctx, lw)
p.done = true
p.done = p.err == nil // If there is an error, we should re-prepare it next time.
}

if p.err != nil {
Expand Down

0 comments on commit 5b9d417

Please sign in to comment.