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

LOG-6532: fix validation rule for Loki Tuning to allow it to be empty without failing validation #2956

Open
wants to merge 1 commit into
base: release-6.1
Choose a base branch
from

Conversation

vparfonov
Copy link
Contributor

Description

/cc @cahartma
/assign @jcantrill

/cherry-pick

Links

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Feb 6, 2025
@openshift-ci-robot
Copy link

openshift-ci-robot commented Feb 6, 2025

@vparfonov: This pull request references LOG-6532 which is a valid jira issue.

In response to this:

Description

/cc @cahartma
/assign @jcantrill

/cherry-pick

Links

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci openshift-ci bot requested review from Clee2691 and jcantrill February 6, 2025 10:37
@vparfonov
Copy link
Contributor Author

/retest

@@ -739,6 +739,7 @@ type LokiTuningSpec struct {
// Compression causes data to be compressed before sending over the network.
//
// +kubebuilder:validation:Enum:=none;gzip;snappy
// +kubebuilder:default=none
Copy link
Contributor

Choose a reason for hiding this comment

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

Per our larger API discussions, @xperimental has recommended not setting any defaults because of the element of "surprise" when a CR is different from that spec'd by the user once fetched from storage. Doing this means you will do nothing but the return will be set to none.

I believe the only way to resolve this is via an initializer that evaluates and modifies the CLF based upon the type and datamodel

Copy link
Contributor Author

@vparfonov vparfonov Feb 6, 2025

Choose a reason for hiding this comment

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

Revised code again and think problem was in validation rule, added checking !has(self.tuning.compression)

@jcantrill
Copy link
Contributor

/hold

@openshift-ci openshift-ci bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Feb 6, 2025
@jcantrill jcantrill added release/6.1 and removed do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. labels Feb 6, 2025
… without failing validation

Signed-off-by: Vitalii Parfonov <vparfonov@redhat.com>
@jcantrill
Copy link
Contributor

/approve

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 6, 2025
@vparfonov vparfonov changed the title LOG-6532: add default value 'none' for Compression in LokiTuningSpec LOG-6532: fix validation rule for Loki Tuning to allow it to be empty without failing validation Feb 6, 2025
@vparfonov
Copy link
Contributor Author

/test unit

@vparfonov
Copy link
Contributor Author

/test functional-target

Copy link
Contributor

openshift-ci bot commented Feb 6, 2025

@vparfonov: all tests passed!

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@jcantrill
Copy link
Contributor

/hold

@openshift-ci openshift-ci bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Feb 7, 2025
@jcantrill
Copy link
Contributor

/approve
/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Feb 12, 2025
Copy link
Contributor

openshift-ci bot commented Feb 12, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jcantrill, vparfonov

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged. release/6.1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants