Skip to content

Commit

Permalink
fix(storage):certificateRef validation failed
Browse files Browse the repository at this point in the history
Signed-off-by: soulseen <zhuxiaoyang1996@gmail.com>
  • Loading branch information
soulseen committed Mar 7, 2021
1 parent 3f5c55c commit ca3232b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion apis/goharbor.io/v1alpha2/registry_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -710,7 +710,7 @@ type RegistryStorageDriverS3Spec struct {

// +kubebuilder:validation:Optional
// +kubebuilder:validation:Pattern="[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*"
CertificateRef string `json:"certificateRef"`
CertificateRef string `json:"certificateRef,omitempty"`

// +kubebuilder:validation:Optional
// +kubebuilder:default=true
Expand Down
3 changes: 2 additions & 1 deletion pkg/cluster/controllers/storage/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package storage
import (
"github.com/goharbor/harbor-operator/pkg/cluster/lcm"
netv1 "k8s.io/api/networking/v1beta1"
"k8s.io/apimachinery/pkg/api/equality"
k8serror "k8s.io/apimachinery/pkg/api/errors"
)

Expand Down Expand Up @@ -43,7 +44,7 @@ func (m *MinIOController) checkRedirectUpdate() (bool, error) {
return true, err
}

if currntIngress.Spec.TLS[0].SecretName != desiredingress.Spec.TLS[0].SecretName {
if !equality.Semantic.DeepEqual(currntIngress.DeepCopy().Spec, desiredingress.DeepCopy().Spec) {
return true, err
}

Expand Down

0 comments on commit ca3232b

Please sign in to comment.