Skip to content

Commit

Permalink
fix: correct the validate registryctl
Browse files Browse the repository at this point in the history
Ensure the ImageChartStorage is not nil when validate registryctl.

Signed-off-by: He Weiwei <hweiwei@vmware.com>
  • Loading branch information
heww committed Mar 22, 2021
1 parent 5af4ba9 commit f583809
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion apis/goharbor.io/v1alpha3/harbor_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ func (spec *HarborSpec) ValidateRegistryController() *field.Error {
// nodeSelector and tolerations must equal with registry's
// when the image chart storage is filesystem and the access mode of pvc is ReadWriteOnce
// TODO: check the access mode of pvc is ReadWriteOnce
if spec.ImageChartStorage.FileSystem != nil {
if spec.ImageChartStorage != nil && spec.ImageChartStorage.FileSystem != nil {
if len(spec.RegistryController.NodeSelector) > 0 &&
!equality.Semantic.DeepEqual(spec.RegistryController.NodeSelector, spec.Registry.NodeSelector) {
p := field.NewPath("spec").Child("registryctl", "nodeSelector")
Expand Down

0 comments on commit f583809

Please sign in to comment.