Skip to content

Commit

Permalink
Merge branch 'main' into docs/api-compatibility-review
Browse files Browse the repository at this point in the history
  • Loading branch information
ADubhlaoich committed Dec 5, 2023
2 parents eff2e08 + d27dde5 commit 60b478d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
15 changes: 13 additions & 2 deletions internal/mode/static/nginx/file/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ import (
)

const (
// regularFileMode defines the default file mode for regular files.
regularFileMode = 0o644
// secretFileMode defines the default file mode for files with secrets.
secretFileMode = 0o640
)
Expand Down Expand Up @@ -136,11 +138,20 @@ func writeFile(fileMgr OSFileManager, file File) error {
}
}()

if file.Type == TypeSecret {
switch file.Type {
case TypeRegular:
if err := fileMgr.Chmod(f, regularFileMode); err != nil {
resultErr = fmt.Errorf(
"failed to set file mode to %#o for %q: %w", regularFileMode, file.Path, err)
return resultErr
}
case TypeSecret:
if err := fileMgr.Chmod(f, secretFileMode); err != nil {
resultErr = fmt.Errorf("failed to set file mode for %q: %w", file.Path, err)
resultErr = fmt.Errorf("failed to set file mode to %#o for %q: %w", secretFileMode, file.Path, err)
return resultErr
}
default:
panic(fmt.Sprintf("unknown file type %d", file.Type))
}

if err := fileMgr.Write(f, file.Content); err != nil {
Expand Down
2 changes: 1 addition & 1 deletion site/content/overview/gateway-api-compatibility.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ For a description of each field, visit the [Gateway API documentation](https://g
| Gateway | Supported | Not supported | Not supported | v1 |
{{< /bootstrap-table >}}

NGINX Gateway Fabric supports a single Gateway resource. The Gateway resource must reference NGINX Gateway Fabric's corresponding GatewayClass.
NGINX Gateway Fabric supports a single Gateway resource. The Gateway resource must reference NGINX Gateway Fabric's corresponding GatewayClass.

See the [static-mode]({{< relref "/reference/cli-help.md#static-mode">}}) command for more information.

Expand Down

0 comments on commit 60b478d

Please sign in to comment.