Skip to content

Commit

Permalink
fix: add missing component spec copy for exporter
Browse files Browse the repository at this point in the history
Signed-off-by: He Weiwei <hweiwei@vmware.com>
  • Loading branch information
heww authored and bitsf committed Jul 22, 2021
1 parent 6208eb3 commit cc9952e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion apis/goharbor.io/v1alpha3/harbor_types.go
Expand Up @@ -49,14 +49,15 @@ func (h *Harbor) GetComponentSpec(ctx context.Context, component harbormetav1.Co
}

func (h *Harbor) deepCopyComponentSpecInto(_ context.Context, component harbormetav1.Component, spec *harbormetav1.ComponentSpec) {
// nolint:exhaustive
switch component {
case harbormetav1.ChartMuseumComponent:
if h.Spec.ChartMuseum != nil {
h.Spec.ChartMuseum.ComponentSpec.DeepCopyInto(spec)
}
case harbormetav1.CoreComponent:
h.Spec.Core.ComponentSpec.DeepCopyInto(spec)
case harbormetav1.ExporterComponent:
h.Spec.Exporter.ComponentSpec.DeepCopyInto(spec)
case harbormetav1.JobServiceComponent:
h.Spec.JobService.ComponentSpec.DeepCopyInto(spec)
case harbormetav1.NotaryServerComponent:
Expand Down
3 changes: 2 additions & 1 deletion apis/goharbor.io/v1beta1/harbor_types.go
Expand Up @@ -50,14 +50,15 @@ func (h *Harbor) GetComponentSpec(ctx context.Context, component harbormetav1.Co
}

func (h *Harbor) deepCopyComponentSpecInto(_ context.Context, component harbormetav1.Component, spec *harbormetav1.ComponentSpec) {
// nolint:exhaustive
switch component {
case harbormetav1.ChartMuseumComponent:
if h.Spec.ChartMuseum != nil {
h.Spec.ChartMuseum.ComponentSpec.DeepCopyInto(spec)
}
case harbormetav1.CoreComponent:
h.Spec.Core.ComponentSpec.DeepCopyInto(spec)
case harbormetav1.ExporterComponent:
h.Spec.Exporter.ComponentSpec.DeepCopyInto(spec)
case harbormetav1.JobServiceComponent:
h.Spec.JobService.ComponentSpec.DeepCopyInto(spec)
case harbormetav1.NotaryServerComponent:
Expand Down

0 comments on commit cc9952e

Please sign in to comment.