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

parser: add strict mode #413

Merged
merged 2 commits into from
Jul 18, 2024
Merged

parser: add strict mode #413

merged 2 commits into from
Jul 18, 2024

Conversation

cainelli
Copy link
Collaborator

@cainelli cainelli commented Jul 17, 2024

-strict decodes test files using https://pkg.go.dev/encoding/json#Decoder.DisallowUnknownFields and Istio validation scheme.

@cainelli cainelli requested review from x-way and gygrobot as code owners July 17, 2024 17:58
@cainelli cainelli requested review from Smeb and emes4 July 17, 2024 17:58
meta := &v1.TypeMeta{}
if err = json.Unmarshal(jsonBytes, meta); err != nil {
slog.Debug("error extracting the metadata of the virtualservice", zapcore.Field{Key: "file", Type: zapcore.StringType, String: file})
configs, _, err := crd.ParseInputs(string(fileContent))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❤️

Copy link
Contributor

@Smeb Smeb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, small nits

Signed-off-by: Fernando Cainelli <[email protected]>
@cainelli cainelli merged commit e602f45 into main Jul 18, 2024
5 checks passed
@cainelli cainelli deleted the strict-parsing branch July 18, 2024 16:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants