Skip to content

Commit

Permalink
export functions
Browse files Browse the repository at this point in the history
  • Loading branch information
tanmayja committed Apr 11, 2024
1 parent b286c2d commit 9066143
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions asconfig/schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,9 @@ func baseVersion(ver string) (string, error) {
return baseVersion, nil
}

// getDynamic return the map of values which are dynamic
// GetDynamic return the map of values which are dynamic
// values.
func getDynamic(ver string) (sets.Set[string], error) {
func GetDynamic(ver string) (sets.Set[string], error) {
flatSchema, err := getFlatSchema(ver)
if err != nil {
return nil, err
Expand Down Expand Up @@ -178,23 +178,23 @@ func getDynamicSchema(flatSchema map[string]interface{}) sets.Set[string] {

// IsAllDynamicConfig returns true if all the fields in the given configMap are dynamically configured.
func IsAllDynamicConfig(log logr.Logger, configMap DynamicConfigMap, version string) (bool, error) {
dynamic, err := getDynamic(version)
dynamic, err := GetDynamic(version)
if err != nil {
// retry error fall back to rolling restart.
return false, err
}

for confKey := range configMap {
if !isDynamicConfig(log, dynamic, confKey, configMap[confKey]) {
if !IsDynamicConfig(log, dynamic, confKey, configMap[confKey]) {
return false, nil
}
}

return true, nil
}

// isDynamicConfig returns true if the given field is dynamically configured.
func isDynamicConfig(log logr.Logger, dynamic sets.Set[string], conf string,
// IsDynamicConfig returns true if the given field is dynamically configured.
func IsDynamicConfig(log logr.Logger, dynamic sets.Set[string], conf string,
valueMap map[Operation]interface{}) bool {
tokens := SplitKey(log, conf, sep)
baseKey := tokens[len(tokens)-1]
Expand Down

0 comments on commit 9066143

Please sign in to comment.