-
-
Notifications
You must be signed in to change notification settings - Fork 240
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(oci): clean dead code #290
Conversation
@jycamier Please fix DCO issue. |
a8006c7
to
382637f
Compare
382637f
to
0553230
Compare
0553230
to
b39ae8c
Compare
@@ -3339,22 +3328,3 @@ func (st *HelmState) getOCIChart(pullChan chan PullCommand, release *ReleaseSpec | |||
|
|||
return &chartPath, nil | |||
} | |||
|
|||
// Pull charts one by one to prevent concurrent pull problems with Helm |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm just curious why this part is no longer needed? does helm fix it upstream?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the worker which manipulate the pullChan
channel is pulling charts only for the getOCIChart
function and the charts pulled are never used : this worker runs for nothing.
I don't know why this code was write but today, if it works, I imagine the previous helm issue you speak about is fixed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jycamier Can we maintain the original functional logic, reform it, or give a better reason to clean it up?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For your reference, here's the original issue that reported the helm pull issue:
roboll/helmfile#1705
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From my limited test result, I can say that this is no longer an issue since helm 3.8.
Previsouly helm chart pull
pulled to the chart into a local registry cache maintained by helm and apparently it was subject to a race condition.
However since Helm 3.8, the command has been merged into helm fetch
and renamed to helm pull
, and the new implementation seems to pull into the local directory. Naturally, there will be no place for race conditions as long as you don't pull the same chart multiple times while reading the chart before all other chart pull operations complete. Helmfile does wait for all the chart pull operations to finish before doing subsequent operations like chartify, diff, template, and so on. Everything should work ok.
That said, I think it's fine to remove this legacy code in this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mumoshu ok. got it. Thanks very much.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can say that this is no longer an issue since helm 3.8.
Let me correct this. I meant to say "helm 3.7"
98b5caa
to
2a5ed80
Compare
Signed-off-by: Jean-Yves CAMIER <jycamier@gmail.com>
2a5ed80
to
303a449
Compare
ping |
_ = os.RemoveAll(tempDir) | ||
}() | ||
helmArgs = []string{"fetch", ociChartURL, "--version", ociChartTag, "--destination", tempDir} | ||
helmArgs = []string{"pull", ociChartURL, "--version", ociChartTag, "--destination", path} | ||
} else { | ||
helmArgs = []string{"chart", "pull", chart} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes. you are right. @mumoshu
helmArgs = []string{"chart", "export", chart} | ||
// in the 3.7.0 version, the chart export has been removed | ||
// https://github.com/helm/helm/releases/tag/v3.7.0 | ||
return nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably we'd better panic here as we shouldn't reach this line in practice?
Signed-off-by: Yusuke Kuoka <ykuoka@gmail.com>
b2c3ce2
to
fd786c0
Compare
@mumoshu yes. I think so. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks a lot for investigating and fixing it @jycamier!
Your welcome @mumoshu. This is my first golang contribution 🍼 |
Referring to the issue #281
Helmfile supports the OCI format but executes the
helm pull
command twice, resulting in :How
template
command)chartPull
andchartExport