INNER CODE UNIT · Go
targetDir
nginx/nginx-gateway-fabric · apis/policygen.go:201
targetDir := filepath.Dir(*outputFile)
policyFiles, err := findPolicyFiles(targetDir)
if err != nil {
log.Fatalf("Error: failed to find the policy files %v", err)
}
policies, err := extractPolicies(policyFiles)
if err != nil {
log.Fatalf("Error: failed to extract the policy names %v", err)
}
if len(policies) == 0 {
log.Fatalf("failed to find policies in the %s directory", targetDir)
return
}
// Render the template.