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

feat: config query grammar #1224

Merged
merged 8 commits into from
Jan 1, 2025
Merged

feat: config query grammar #1224

merged 8 commits into from
Jan 1, 2025

Conversation

moshloop
Copy link
Member

No description provided.

@yashmehrotra yashmehrotra force-pushed the config-queries branch 2 times, most recently from 597cc87 to 099b828 Compare December 31, 2024 04:31
query/config_changes.go Outdated Show resolved Hide resolved
var _ = Describe("grammer", func() {

It("parses", func() {
result, err := ParsePEG("john:doe metadata.name=bob metadata.name!=harry spec.status.reason!=\"failed reson\" -jane johnny type!=pod type!=replicaset namespace!=\"a,b,c\"")
Copy link
Member Author

Choose a reason for hiding this comment

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

Can we expand these tests out ?

}{
{
description: "config item query",
query: `name="node-b" type="Kubernetes::Node"`,
Copy link
Member Author

Choose a reason for hiding this comment

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

Suggested change
query: `name="node-b" type="Kubernetes::Node"`,
query: `name=node-b type=Kubernetes::Node`,

Copy link
Member Author

Choose a reason for hiding this comment

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

can we also add a name=node-b type=kubernetes::node (case insensitivity)

Copy link
Member

Choose a reason for hiding this comment

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

Doing the suggested will cause the test to fail as things get parsed incorrectly

@moshloop moshloop merged commit 4be7147 into main Jan 1, 2025
7 checks passed
@moshloop moshloop deleted the config-queries branch January 1, 2025 11:08
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