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

Adding template check for indexed projects #1008

Merged
merged 1 commit into from
Mar 18, 2024
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
18 changes: 18 additions & 0 deletions pkg/trcx/xutil/xmanager.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,24 @@ func GenerateSeedSectionFromVaultRaw(config *eUtils.DriverConfig, templateFromVa
if len(config.ServiceFilter) > 0 {
service = config.ServiceFilter[0]
}

//This checks whether indexed section is available in current directory.
if len(config.SectionKey) > 0 && len(config.ProjectSections) > 0 {
projectFound := false
for _, projectSection := range config.ProjectSections {
for _, templatePath := range templatePaths {
if strings.Contains(templatePath, projectSection) {
projectFound = true
goto projectFound
}
}
projectFound:
if !projectFound {
return nil, false, nil, nil, nil, "", eUtils.LogAndSafeExit(config, "Unable to find indexed project in local templates.", 1)
}
}
}

multiService := false
var mod *helperkv.Modifier

Expand Down