Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Patryk Małek <patryk.malek@konghq.com>
  • Loading branch information
tao12345666333 and pmalek authored Dec 9, 2024
1 parent 651d7d3 commit d058779
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -220,8 +220,8 @@ Adding a new version? You'll need three changes:
[#6759](https://github.com/Kong/kubernetes-ingress-controller/pull/6759)
[#6780](https://github.com/Kong/kubernetes-ingress-controller/pull/6780)
- Added the flag `--secret-label-selector` to set the label selector for `Secrets` to ingest.
By setting this flag, KIC will choose secrets that has this label set to "true",
it can mitigate the memory usage in scenarios with a large number of giant secrets.
By setting this flag, the secrets that are ingested will be limited to those having this label set to "true".
This can reduce the memory usage in scenarios with a large number of giant secrets.
[#6795](https://github.com/Kong/kubernetes-ingress-controller/pull/6795)


Expand Down
2 changes: 1 addition & 1 deletion internal/controllers/configuration/secret_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ func (r *CoreV1SecretReconciler) SetupWithManager(mgr ctrl.Manager) error {
labelPredicate, err = predicate.LabelSelectorPredicate(metav1.LabelSelector{})
}
if err != nil {
return fmt.Errorf("failed to create label selector predicate: %w", err)
return fmt.Errorf("failed to create secret label selector predicate: %w", err)
}

return ctrl.NewControllerManagedBy(mgr).
Expand Down
6 changes: 3 additions & 3 deletions internal/manager/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,10 +131,10 @@ type Config struct {
GatewayAPIReferenceGrantController bool
GatewayAPIGRPCRouteController bool

// KIC can only reconcile the specified Gateway.
// GatewayToReconcile specifies the Gateway to be reconciled.
GatewayToReconcile OptionalNamespacedName

// KIC can only cache secrets resources with specified label.
// SecretLabelSelector specifies the label which will be used to limit the ingestion of secrets. Only those that have this label set to "true" will be ingested.
SecretLabelSelector string

// Admission Webhook server config
Expand Down Expand Up @@ -284,7 +284,7 @@ func (c *Config) FlagSet() *pflag.FlagSet {
flagSet.Var(flags.NewValidatedValue(&c.GatewayToReconcile, namespacedNameFromFlagValue, nnTypeNameOverride), "gateway-to-reconcile",
`Gateway namespaced name in "namespace/name" format. Makes KIC reconcile only the specified Gateway.`)
flagSet.StringVar(&c.SecretLabelSelector, "secret-label-selector", "",
`KIC can only cache secrets resources with specified label. If not specified, KIC will cache all secrets. If specified, KIC will only cache secrets with the specified label and a value of "true".`)
`Limits the secrets ingested to those having this label set to "true". If not specified, all secrets are ingested.`)
flagSet.BoolVar(&c.KongServiceFacadeEnabled, "enable-controller-kong-service-facade", true, "Enable the KongServiceFacade controller.")
flagSet.BoolVar(&c.KongVaultEnabled, "enable-controller-kong-vault", true, "Enable the KongVault controller.")
flagSet.BoolVar(&c.KongLicenseEnabled, "enable-controller-kong-license", true, "Enable the KongLicense controller.")
Expand Down

0 comments on commit d058779

Please sign in to comment.