1
0
Fork 0
mirror of https://github.com/arangodb/kube-arangodb.git synced 2024-12-14 11:57:37 +00:00

Change less.

This commit is contained in:
lamai93 2018-12-05 15:25:45 +01:00
parent 42dca02b36
commit a438d333d1
3 changed files with 21 additions and 0 deletions

View file

@ -302,12 +302,18 @@ func (s DeploymentSpec) ResetImmutableFields(target *DeploymentSpec) []string {
target.DisableIPv6 = util.NewBoolOrNil(s.DisableIPv6)
resetFields = append(resetFields, "disableIPv6")
}
if l := s.ExternalAccess.ResetImmutableFields("externalAccess", &target.ExternalAccess); l != nil {
resetFields = append(resetFields, l...)
}
if l := s.RocksDB.ResetImmutableFields("rocksdb", &target.RocksDB); l != nil {
resetFields = append(resetFields, l...)
}
if l := s.Authentication.ResetImmutableFields("auth", &target.Authentication); l != nil {
resetFields = append(resetFields, l...)
}
if l := s.Sync.ResetImmutableFields("sync", &target.Sync); l != nil {
resetFields = append(resetFields, l...)
}
if l := s.Single.ResetImmutableFields(ServerGroupSingle, "single", &target.Single); l != nil {
resetFields = append(resetFields, l...)
}

View file

@ -99,3 +99,10 @@ func (s *ExternalAccessSpec) SetDefaultsFrom(source ExternalAccessSpec) {
s.AdvertisedEndpoint = source.AdvertisedEndpoint
}
}
// ResetImmutableFields replaces all immutable fields in the given target with values from the source spec.
// It returns a list of fields that have been reset.
// Field names are relative to given field prefix.
func (s ExternalAccessSpec) ResetImmutableFields(fieldPrefix string, target *ExternalAccessSpec) []string {
return nil
}

View file

@ -92,3 +92,11 @@ func (s *SyncExternalAccessSpec) SetDefaultsFrom(source SyncExternalAccessSpec)
s.AccessPackageSecretNames = append([]string{}, source.AccessPackageSecretNames...)
}
}
// ResetImmutableFields replaces all immutable fields in the given target with values from the source spec.
// It returns a list of fields that have been reset.
// Field names are relative to given field prefix.
func (s SyncExternalAccessSpec) ResetImmutableFields(fieldPrefix string, target *SyncExternalAccessSpec) []string {
result := s.ExternalAccessSpec.ResetImmutableFields(fieldPrefix, &s.ExternalAccessSpec)
return result
}