Skip to content

Commit

Permalink
Merge pull request #52 from microsoft/eedorenko/patch
Browse files Browse the repository at this point in the history
Deployment Assignment Conflict
  • Loading branch information
eedorenko authored Jul 31, 2024
2 parents a9bd8d3 + efa145e commit e338866
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion controllers/azureresourcegraph_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ func (r *AzureResourceGraphReconciler) getReconcilersDataFromChildKalypsoObjects
})
if err != nil {
//log workspace, application, workloadName and deploymentTargetName
logger.Error(err, "Failed to get deployment target", "workspace", workspace, "application", application, "workloadName", workloadName, "deploymentTargetName", deploymentTargetName)
logger.Info("Could not find deployment target", "workspace", workspace, "application", application, "workloadName", workloadName, "deploymentTargetName", deploymentTargetName)
continue
}

Expand Down
5 changes: 4 additions & 1 deletion storage/postgres/deployment_assignment.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ var _ Entity = (*DeploymentAssignment)(nil)
func (da *DeploymentAssignment) update(conn *sql.DB) (Entity, error) {
var id int32
err := conn.QueryRow(`INSERT INTO deployment_assignment (deployment_target_id, workload_version_id, gitops_commit_id) VALUES ($1, $2, $3)
ON CONFLICT (deployment_target_id, workload_version_id, gitops_commit_id) DO NOTHING
ON CONFLICT (deployment_target_id, workload_version_id, gitops_commit_id) DO
UPDATE SET deployment_target_id=$1,
workload_version_id=$2,
gitops_commit_id=$3
RETURNING id`, da.DeploymentTargetId, da.WorkloadVersionId, da.GitopsCommitId).Scan(&id)
if err != nil {
return nil, err
Expand Down

0 comments on commit e338866

Please sign in to comment.