Skip to content

Commit

Permalink
add prefix folder for chartmuseum
Browse files Browse the repository at this point in the history
Signed-off-by: Ziming Zhang <zziming@vmware.com>
  • Loading branch information
bitsf committed Mar 16, 2022
1 parent 96639f9 commit 1a3f4a0
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions controllers/goharbor/chartmuseum/deployments.go
Expand Up @@ -136,7 +136,7 @@ func (r *Reconciler) GetDeployment(ctx context.Context, chartMuseum *goharborv1.
Value: GcsJSONKeyFilePath,
}, corev1.EnvVar{
Name: "STORAGE_GOOGLE_PREFIX",
Value: chartMuseum.Spec.Chart.Storage.Gcs.PathPrefix,
Value: getChartFolder(chartMuseum.Spec.Chart.Storage.Gcs.PathPrefix),
})

volumes = append(volumes, corev1.Volume{
Expand Down Expand Up @@ -176,7 +176,7 @@ func (r *Reconciler) GetDeployment(ctx context.Context, chartMuseum *goharborv1.
Value: chartMuseum.Spec.Chart.Storage.Azure.BaseURL,
}, corev1.EnvVar{
Name: "STORAGE_MICROSOFT_PREFIX",
Value: chartMuseum.Spec.Chart.Storage.Azure.PathPrefix,
Value: getChartFolder(chartMuseum.Spec.Chart.Storage.Azure.PathPrefix),
})

if chartMuseum.Spec.Chart.Storage.Azure.AccountKeyRef != "" {
Expand Down Expand Up @@ -206,7 +206,7 @@ func (r *Reconciler) GetDeployment(ctx context.Context, chartMuseum *goharborv1.
Value: chartMuseum.Spec.Chart.Storage.Amazon.Bucket,
}, corev1.EnvVar{
Name: "STORAGE_AMAZON_PREFIX",
Value: chartMuseum.Spec.Chart.Storage.Amazon.Prefix,
Value: getChartFolder(chartMuseum.Spec.Chart.Storage.Amazon.Prefix),
}, corev1.EnvVar{
Name: "STORAGE_AMAZON_REGION",
Value: chartMuseum.Spec.Chart.Storage.Amazon.Region,
Expand Down Expand Up @@ -249,7 +249,7 @@ func (r *Reconciler) GetDeployment(ctx context.Context, chartMuseum *goharborv1.
},
}, corev1.EnvVar{
Name: "STORAGE_OPENSTACK_PREFIX",
Value: chartMuseum.Spec.Chart.Storage.OpenStack.Prefix,
Value: getChartFolder(chartMuseum.Spec.Chart.Storage.OpenStack.Prefix),
}, corev1.EnvVar{
Name: "STORAGE_OPENSTACK_REGION",
Value: chartMuseum.Spec.Chart.Storage.OpenStack.Region,
Expand Down Expand Up @@ -433,3 +433,7 @@ func (r *Reconciler) GetDeployment(ctx context.Context, chartMuseum *goharborv1.

return deploy, nil
}

func getChartFolder(prefix string) string {
return path.Join(prefix, "chart_storage")
}

0 comments on commit 1a3f4a0

Please sign in to comment.