fix stripping config options
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user