Skip to content

Commit

Permalink
Fix cspm gcp installation script (#2985)
Browse files Browse the repository at this point in the history
* fix cspm gcp install script

* update script
  • Loading branch information
gurevichdmitry authored Feb 4, 2025
1 parent 7fc2948 commit ea883c3
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions tests/integrations_setup/install_cspm_gcp_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,22 @@
INTEGRATION_INPUT["vars"] = {
"gcp.account_type": "single-account",
}

json_path = Path(__file__).parent / cnfg.gcp_dm_config.credentials_file
if cnfg.gcp_dm_config.service_account_json_path:
logger.info("Using service account credentials json")
json_path = Path(__file__).parent / cnfg.gcp_dm_config.service_account_json_path
service_account_json = read_json(json_path)
INTEGRATION_INPUT["vars"]["gcp.credentials.json"] = json.dumps(service_account_json)

service_account_json = read_json(json_path)
INTEGRATION_INPUT["vars"]["gcp.credentials.json"] = json.dumps(service_account_json)

if version.parse(package_version) > version.parse("1.12"):
INTEGRATION_INPUT["vars"].update(
{
"gcp.project_id": cnfg.gcp_dm_config.project_id,
"gcp.credentials.type": "credentials-json",
},
)

logger.info(f"Starting installation of {INTEGRATION_NAME} integration.")
agent_data, package_data = load_data(
Expand Down

0 comments on commit ea883c3

Please sign in to comment.