Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 fix discovery of terraform gitlab assets (missing path option) #1784

Merged
merged 2 commits into from
Sep 19, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion motor/discovery/gitlab/gitlab.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,17 +170,19 @@ func (r *Resolver) Resolve(ctx context.Context, root *asset.Asset, pCfg *provide
if err == nil && len(terraformFiles) > 0 {
terraformCfg := pCfg.Clone()
terraformCfg.Backend = providers.ProviderType_TERRAFORM
// git+https://gitlab.com/mondoolabs/example-gitlab.git
terraformCfg.Options["path"] = "git+" + project.HTTPURLToRepo
assets, err := (&terraform_resolver.Resolver{}).Resolve(ctx, projectAsset, terraformCfg, credsResolver, sfn)
if err == nil && len(assets) > 0 {
for i := range assets {
if len(assets[i].PlatformIds) > 0 {
assets[i].PlatformIds[0] = assets[i].PlatformIds[0] + "/" + project.Name
list = append(list, assets[i])
} else {
log.Debug().Msg("missing platform id for asset")
continue
}
}
list = append(list, assets...)
}
}
}
Expand Down