Skip to content

Commit

Permalink
config: change the configuration naming
Browse files Browse the repository at this point in the history
  • Loading branch information
danielsinai committed Apr 9, 2024
1 parent d6922bd commit e55b623
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ func Init() {
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.")
NewString(&ApplicationConfig.CRDsToDiscover, "crds-to-discover", "", "Resource definitions autodiscovery, supports both XRDs(Crossplane) and CRDs. Optional.")
NewBool(&ApplicationConfig.OverwriteCRDActions, "overwrite-crds-action-patterns", false, "Resource definitions autodiscovery, supports both XRDs(Crossplane) and CRDs. Optional.")
NewBool(&ApplicationConfig.OverwriteCRDsActions, "overwrite-crds-actions", false, "Resource definitions autodiscovery, supports both XRDs(Crossplane) and CRDs. Optional.")

// Deprecated
NewBool(&ApplicationConfig.DeleteDependents, "delete-dependents", false, "Delete dependents. Optional.")
Expand Down
2 changes: 1 addition & 1 deletion pkg/config/models.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@ type ApplicationConfiguration struct {
DeleteDependents bool `json:"deleteDependents,omitempty"`
CreateMissingRelatedEntities bool `json:"createMissingRelatedEntities,omitempty"`
CRDsToDiscover string `json:"crdsToDiscover,omitempty"`
OverwriteCRDActions bool `json:"overwriteCRDsAction,omitempty"`
OverwriteCRDsActions bool `json:"overwriteCrdsActions,omitempty"`
}
4 changes: 2 additions & 2 deletions pkg/crd/crd.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,13 +141,13 @@ func AutodiscoverCRDsToActions(exporterConfig *port.Config, portConfig *port.Int
_, err = blueprint.NewBlueprintAction(portClient, bp.Identifier, act)
if err != nil {
if strings.Contains(err.Error(), "taken") {
if portConfig.OverwriteCRDActions == true {
if portConfig.OverwriteCRDsActions == true {
_, err = blueprint.UpdateBlueprintAction(portClient, bp.Identifier, act)
if err != nil {
klog.Errorf("Error updating blueprint action: %s", err.Error())
}
} else {
klog.Infof("Action already exists, if you wish to overwrite it, delete it first or provide the configuration overwriteCRDActions: true, in the exporter configuration and resync")
klog.Infof("Action already exists, if you wish to overwrite it, delete it first or provide the configuration overwriteCrdsActions: true, in the exporter configuration and resync")
}
} else {
klog.Errorf("Error creating blueprint action: %s", err.Error())
Expand Down
4 changes: 2 additions & 2 deletions pkg/port/models.go
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ type IntegrationAppConfig struct {
CreateMissingRelatedEntities bool `json:"createMissingRelatedEntities,omitempty"`
Resources []Resource `json:"resources,omitempty"`
CRDSToDiscover string `json:"crdsToDiscover,omitempty"`
OverwriteCRDActions bool `json:"overwriteCRDsAction,omitempty"`
OverwriteCRDsActions bool `json:"overwriteCrdsActions,omitempty"`
}

type Config struct {
Expand All @@ -261,7 +261,7 @@ type Config struct {
// These Configurations are used only for setting up the Integration on installation or when using OverwriteConfigurationOnRestart flag.
Resources []Resource `yaml:"resources,omitempty"`
CRDSToDiscover string `yaml:"crdsToDiscover,omitempty"`
OverwriteCRDActions bool `yaml:"overwriteCRDsAction,omitempty"`
OverwriteCRDsActions bool `yaml:"overwriteCrdsActions,omitempty"`
DeleteDependents bool `yaml:"deleteDependents,omitempty"`
CreateMissingRelatedEntities bool `yaml:"createMissingRelatedEntities,omitempty"`
}

0 comments on commit e55b623

Please sign in to comment.