Skip to content

Call runningDSP.Get when runningDSP is not nil#5541

Merged
ffjlabo merged 1 commit intomasterfrom
check-whether-running-dsp-is-nil
Feb 6, 2025
Merged

Call runningDSP.Get when runningDSP is not nil#5541
ffjlabo merged 1 commit intomasterfrom
check-whether-running-dsp-is-nil

Conversation

@ffjlabo
Copy link
Member

@ffjlabo ffjlabo commented Feb 5, 2025

What this PR does:

I fixed to call runningDSP.Get when runningDSP is not nil.

Why we need it:

When first deploy, runningDSP is nil because previous running commit is not found.
So it led panic.

Which issue(s) this PR fixes:

Part of #4980

Does this PR introduce a user-facing change?:

  • How are users affected by this change:
  • Is this breaking change:
  • How to migrate (if breaking change):

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

codecov bot commented Feb 5, 2025

Codecov Report

Attention: Patch coverage is 42.85714% with 4 lines in your changes missing coverage. Please review.

Project coverage is 26.45%. Comparing base (edcf430) to head (0f635be).
Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
pkg/app/pipedv1/controller/scheduler.go 42.85% 3 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5541      +/-   ##
==========================================
+ Coverage   26.42%   26.45%   +0.02%     
==========================================
  Files         465      465              
  Lines       49858    49860       +2     
==========================================
+ Hits        13175    13188      +13     
+ Misses      35629    35618      -11     
  Partials     1054     1054              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@Warashi Warashi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Member

@t-kikuc t-kikuc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

like here? i got it

if s.deployment.RunningCommitHash != "" {
gp := *s.deployment.GitPath
gp.ConfigFilename = s.deployment.RunningConfigFilename
s.runningDSP = deploysource.NewProvider(
filepath.Join(s.workingDir, "running-deploysource"),
deploysource.NewGitSourceCloner(s.gitClient, repoCfg, "running", s.deployment.RunningCommitHash),
gp,
s.secretDecrypter,
)
}

@ffjlabo ffjlabo merged commit d24e16b into master Feb 6, 2025
14 checks passed
@ffjlabo ffjlabo deleted the check-whether-running-dsp-is-nil branch February 6, 2025 01:30
@github-actions github-actions bot mentioned this pull request Mar 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants