-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Set label filter to nil when it's empty string #70
Conversation
@@ -664,7 +664,15 @@ func deduplicateFilters(filters []acpv1.Selector) []acpv1.Selector { | |||
} | |||
} | |||
if !findDuplicate { | |||
result = append(result, filters[i]) | |||
labelFilter := filters[i].LabelFilter |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we should do the conversion while deduplicating the selectors, we need to do it more straightforwardly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And what about the label for the sentinel
?
@@ -106,9 +106,9 @@ type RefreshMonitoring struct { | |||
|
|||
// Defines the keyValues to be watched. | |||
type Sentinel struct { | |||
Key string `json:"key"` | |||
Key *string `json:"key"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Key should not be nullable.
return results | ||
} | ||
|
||
func processEmptyLabelFilter(filters []acpv1.Selector) []acpv1.Selector { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about rename to "normalizeLableFilter"?
@@ -643,6 +644,40 @@ func GetFeatureFlagFilters(acpSpec acpv1.AzureAppConfigurationProviderSpec) []ac | |||
return featureFlagFilters | |||
} | |||
|
|||
func getSentinels(sentinels []acpv1.Sentinel) []acpv1.Sentinel { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about rename to "normalizeSentinels" ?
@@ -88,15 +88,15 @@ func (s *EtagSettingsClient) GetSettings(ctx context.Context, client *azappconfi | |||
} | |||
|
|||
func (s *SentinelSettingsClient) GetSettings(ctx context.Context, client *azappconfig.Client) (*SettingsResponse, error) { | |||
sentinelSetting, err := client.GetSetting(ctx, s.sentinel.Key, &azappconfig.GetSettingOptions{Label: &s.sentinel.Label, OnlyIfChanged: s.etag}) | |||
sentinelSetting, err := client.GetSetting(ctx, s.sentinel.Key, &azappconfig.GetSettingOptions{Label: s.sentinel.Label, OnlyIfChanged: s.etag}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to do the same as SelectorSettingsClient
, if label is nil, set it to \x00
* set label filter to nil when it is empty string * process empty label of sentinels * update * update * resolve comments * update
No description provided.