Skip to content

Commit

Permalink
🎉 load space from config
Browse files Browse the repository at this point in the history
Signed-off-by: Salim Afiune Maya <[email protected]>
  • Loading branch information
afiune committed Nov 5, 2024
1 parent 33db85d commit 5fc36d4
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion apps/cnspec/cmd/integrate.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,19 @@ var (
if err != nil {
return err
}
// TODO verify that the config is a service account
config.DisplayUsedConfig()
mondooClient, err := getGqlClient(opts)
if err != nil {
return err
}
spaceInfo, err := cnspec_upstream.GetSpace(context.Background(), mondooClient, spacePrefix+space)
// by default, use the MRN from the config
spaceMrn := opts.GetParentMrn()
if space != "" {
// unless it was specified via flag
spaceMrn = spacePrefix + space
}
spaceInfo, err := cnspec_upstream.GetSpace(context.Background(), mondooClient, spaceMrn)
if err != nil {
log.Fatal().Msgf("unable to verify access to space '%s': %s", space, err)
}
Expand Down

0 comments on commit 5fc36d4

Please sign in to comment.