Skip to content

Commit

Permalink
docs: add notes in the customization guide about the feature file siz…
Browse files Browse the repository at this point in the history
…e limit

Signed-off-by: AhmedGrati <ahmedgrati1999@gmail.com>
  • Loading branch information
TessaIO committed Sep 6, 2023
1 parent 026534e commit 124dfbf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 3 additions & 0 deletions docs/usage/customization-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,9 @@ The label value defaults to `true`, if not specified.

Label namespace may be specified with `<namespace>/<name>[=<value>]`.

> **NOTE:** The feature file size limit it 64kB. The feature file will be
> ignored if the size limit is exceeded.

Comment lines (starting with `#`) are ignored.

Adding following line anywhere to feature file defines date when
Expand Down
6 changes: 3 additions & 3 deletions source/local/local.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const ExpiryTimeKey = "expiry-time"
const DirectivePrefix = "# +"

// MaxFeatureFileSize defines the maximum size of a feature file size
const MaxFeatureFileSize = 64000
const MaxFeatureFileSize = 65536

// Config
var (
Expand Down Expand Up @@ -334,8 +334,8 @@ func getFeaturesFromFiles() (map[string]string, error) {
fileSize := fileInfo.Size()
if fileSize > MaxFeatureFileSize {
klog.ErrorS(
fmt.Errorf("invalid file size: %d bytes > %d bytes", fileSize, MaxFeatureFileSize),
"skipping file with invalid size",
fmt.Errorf("file size limit exceeded: %d bytes > %d bytes", fileSize, MaxFeatureFileSize),
"skipping too big feature file",
"fileName", fileName, "fileSize", fileSize,
)
continue
Expand Down

0 comments on commit 124dfbf

Please sign in to comment.