Skip to content

Commit

Permalink
let the flag also be null
Browse files Browse the repository at this point in the history
  • Loading branch information
razsamuel committed May 28, 2024
1 parent 48bf459 commit e8fcd10
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 3 deletions.
1 change: 0 additions & 1 deletion pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ func Init() {
NewString(&ApplicationConfig.PortClientSecret, "port-client-secret", "", "Port client secret. Required.")
NewBool(&ApplicationConfig.CreateDefaultResources, "create-default-resources", true, "Create default resources on installation. Optional.")
NewBool(&ApplicationConfig.OverwriteConfigurationOnRestart, "overwrite-configuration-on-restart", false, "Overwrite the configuration in port on restarting the exporter. Optional.")
NewBool(&ApplicationConfig.UpdateEntityOnlyOnDiff, "update-entity-only-on-diff", true, "Optimization to reduce requests to port. Optional.")

// Deprecated
NewBool(&ApplicationConfig.DeleteDependents, "delete-dependents", false, "Delete dependents. Optional.")
Expand Down
2 changes: 1 addition & 1 deletion pkg/k8s/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ func NewController(resource port.AggregatedResource, portClient *cli.PortClient,
item.Key, err = cache.MetaNamespaceKeyFunc(new)
if err == nil {

if controller.shouldSendUpdateEvent(old, new, integrationConfig.UpdateEntityOnlyOnDiff) {
if controller.shouldSendUpdateEvent(old, new, integrationConfig.UpdateEntityOnlyOnDiff == nil || *(integrationConfig.UpdateEntityOnlyOnDiff)) {
controller.workqueue.Add(item)
}
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/port/models.go
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ type IntegrationAppConfig struct {
Resources []Resource `json:"resources,omitempty" yaml:"resources,omitempty"`
CRDSToDiscover string `json:"crdsToDiscover,omitempty"`
OverwriteCRDsActions bool `json:"overwriteCrdsActions,omitempty"`
UpdateEntityOnlyOnDiff bool `json:"updateEntityOnlyOnDiff,omitempty"`
UpdateEntityOnlyOnDiff *bool `json:"updateEntityOnlyOnDiff,omitempty"`
}

type Config struct {
Expand Down

0 comments on commit e8fcd10

Please sign in to comment.