Skip to content

Commit

Permalink
Merge pull request #52 from tirthct/ocm-11956
Browse files Browse the repository at this point in the history
OCM-11956 : Run account-manager binary with absolute path while syncing cloud resources
  • Loading branch information
tirthct authored Oct 24, 2024
2 parents aec37f3 + a17d7eb commit 77fec2c
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion cmd/ocm-support/sync-cloud-resources/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,14 @@ func syncCloudResources(cmd *cobra.Command, argv []string) error {
}

fmt.Println("Generating quota rules")
_, err = ExecuteCmd(fmt.Sprintf("cd %s && make generate-quota", tempDir))
_, err = ExecuteCmd(fmt.Sprintf("cd %s && make install && make binary", tempDir))
if err != nil {
return fmt.Errorf("an error occurred while building AMS: %v", err)
}
// Run account-manager command with an absolute path so that valid binary is found and executed
// cd is done here as GetProjectRootDir() in AMS detects the directory based on the presence of .git
// Ref: https://gitlab.cee.redhat.com/service/uhc-account-manager/-/blob/master/pkg/config/config.go?ref_type=heads#L215
_, err = ExecuteCmd(fmt.Sprintf("cd %s && %s/account-manager generate quota", tempDir, tempDir))
if err != nil {
return fmt.Errorf("an error occurred while generating quota rules: %v", err)
}
Expand Down

0 comments on commit 77fec2c

Please sign in to comment.