diff --git a/pkg/server/config/config.go b/pkg/server/config/config.go index aabec075b..e1a064125 100644 --- a/pkg/server/config/config.go +++ b/pkg/server/config/config.go @@ -250,7 +250,7 @@ func (c *Config) stripEmptyOptions() { c.LdapOptions = nil } - if c.OpenPitrixOptions != nil && len(c.OpenPitrixOptions.Validate()) > 0 { + if c.OpenPitrixOptions != nil && c.OpenPitrixOptions.IsEmpty() { c.OpenPitrixOptions = nil } diff --git a/pkg/simple/client/openpitrix/options.go b/pkg/simple/client/openpitrix/options.go index 9a6eb20e5..d577bd5f4 100644 --- a/pkg/simple/client/openpitrix/options.go +++ b/pkg/simple/client/openpitrix/options.go @@ -30,6 +30,16 @@ func (s *OpenPitrixOptions) ApplyTo(options *OpenPitrixOptions) { } } +func (s *OpenPitrixOptions) IsEmpty() bool { + return s.RuntimeManagerEndpoint == "" && + s.ClusterManagerEndpoint == "" && + s.RepoManagerEndpoint == "" && + s.AppManagerEndpoint == "" && + s.CategoryManagerEndpoint == "" && + s.AttachmentManagerEndpoint == "" && + s.RepoIndexerEndpoint == "" +} + func (s *OpenPitrixOptions) Validate() []error { var errs []error