Skip to content
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
fixing integration test
  • Loading branch information
Akshay2191 committed Oct 3, 2025
commit ed28bf1144fb057f417054a79773f49937adc89e
26 changes: 10 additions & 16 deletions internal/datasource/config/nginx_config_parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -710,31 +710,25 @@ func (ncp *NginxConfigParser) apiDetailsFromLocationDirective(
return nil
}

isWriteEnabled := false
for _, locChild := range current.Block {
if ncp.isPlusAPIWriteEnabled(ctx, locChild, current.Args[0]) {
isWriteEnabled = true
break
}
}

addresses := ncp.parseAddressFromServerDirective(parent)
path := ncp.parsePathFromLocationDirective(current)

params := apiCreationParams{
locationDirectiveName: locationDirectiveName,
path: path,
caCertLocation: caCertLocation,
isSSL: isSSL,
isWriteEnabled: isWriteEnabled,
}

for _, locChild := range current.Block {
if locChild.Directive != plusAPIDirective && locChild.Directive != stubStatusAPIDirective {
continue
}

if locChild.Directive == locationDirectiveName {
isWriteEnabled := ncp.isPlusAPIWriteEnabled(ctx, locChild, current.Args[0])

params := apiCreationParams{
locationDirectiveName: locationDirectiveName,
path: path,
caCertLocation: caCertLocation,
isSSL: isSSL,
isWriteEnabled: isWriteEnabled,
}

details = append(details, ncp.createAPIDetailsForAddresses(
params,
addresses,
Expand Down
Loading