Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
小 白蛋
Clusternet
Commits
8ff54d8f
Unverified
Commit
8ff54d8f
authored
3 years ago
by
Di Xu
Committed by
GitHub
3 years ago
Browse files
Options
Download
Email Patches
Plain Diff
generate hr name based on namespaced name of chart (#153)
parent
0ea44634
main
v0.13.0
v0.12.0
v0.11.0
v0.10.0
v0.9.1
v0.9.0
v0.8.0
v0.7.0
v0.6.0
v0.5.0
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
pkg/hub/deployer/helm/helm.go
+1
-1
pkg/hub/deployer/helm/helm.go
pkg/utils/deployer.go
+5
-1
pkg/utils/deployer.go
with
6 additions
and
2 deletions
+6
-2
pkg/hub/deployer/helm/helm.go
+
1
-
1
View file @
8ff54d8f
...
...
@@ -251,7 +251,7 @@ func (deployer *Deployer) populateHelmRelease(desc *appsapi.Description) error {
hr
:=
&
appsapi
.
HelmRelease
{
ObjectMeta
:
metav1
.
ObjectMeta
{
Name
:
fmt
.
Sprintf
(
"%s-%s"
,
desc
.
Name
,
chartRef
.
Name
),
Name
:
utils
.
GenerateHelmReleaseName
(
desc
.
Name
,
chartRef
),
Namespace
:
desc
.
Namespace
,
Labels
:
map
[
string
]
string
{
known
.
ObjectCreatedByLabel
:
known
.
ClusternetHubName
,
...
...
This diff is collapsed.
Click to expand it.
pkg/utils/deployer.go
+
5
-
1
View file @
8ff54d8f
...
...
@@ -196,7 +196,7 @@ func GetOverrides(descLister applisters.DescriptionLister, hr *appsapi.HelmRelea
var
found
bool
var
index
int
for
idx
,
chart
:=
range
desc
.
Spec
.
Charts
{
if
chart
.
Namespace
==
hr
.
Namespace
&&
chart
.
Name
==
hr
.
Name
{
if
GenerateHelmReleaseName
(
desc
.
Name
,
chart
)
==
hr
.
Name
{
found
=
true
index
=
idx
break
...
...
@@ -223,6 +223,10 @@ func GetOverrides(descLister applisters.DescriptionLister, hr *appsapi.HelmRelea
return
overrideValues
,
nil
}
func
GenerateHelmReleaseName
(
descName
string
,
chartRef
appsapi
.
ChartReference
)
string
{
return
fmt
.
Sprintf
(
"%s-%s-%s"
,
descName
,
chartRef
.
Namespace
,
chartRef
.
Name
)
}
func
UpdateHelmReleaseStatus
(
ctx
context
.
Context
,
clusternetClient
*
clusternetclientset
.
Clientset
,
hrLister
applisters
.
HelmReleaseLister
,
descLister
applisters
.
DescriptionLister
,
hr
*
appsapi
.
HelmRelease
,
status
*
appsapi
.
HelmReleaseStatus
)
error
{
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help