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

DSCI CRD: allow default as a value for logmode #1271

Conversation

ykaliuta
Copy link
Contributor

@ykaliuta ykaliuta commented Oct 2, 2024

default is a separate mode in the sources, not just selection of one of the others, so allow it explicitly.

There is no difference if it is set to "" explicitly or not set since "" is a string default value.

In the current code as soon as devFlags are present, the mode is taken in use, so it is reset to default even if it is not set which does not look right (I would expect leave it untouched if is not set). If it is fixed, then it will be impossible to reset logging mode to default from devel or prod: if "" is considered as "not set explicitly", then there is no value for default, the object checker rejects values not in list.

Description

How Has This Been Tested?

Screenshot or short clip

Merge criteria

  • You have read the contributors guide.
  • Commit messages are meaningful - have a clear and concise summary and detailed explanation of what was changed and why.
  • Pull Request contains a description of the solution, a link to the JIRA issue, and to any dependent or related Pull Request.
  • Testing instructions have been added in the PR body (for PRs involving changes that are not immediately obvious).
  • The developer has manually tested the changes and verified that the changes work

default is a separate mode in the sources, not just selection of one
of the others, so allow it explicitly.

There is no difference if it is set to "" explicitly or not set
since "" is a string default value.

In the current code as soon as devFlags are present, the mode is
taken in use, so it is reset to default even if it is not set which
does not look right (I would expect leave it untouched if is not
set). If it is fixed, then it will be impossible to reset logging
mode to default from devel or prod: if "" is considered as "not set
explicitly", then there is no value for default, the object checker
rejects values not in list.

Signed-off-by: Yauheni Kaliuta <[email protected]>
@ykaliuta
Copy link
Contributor Author

ykaliuta commented Oct 2, 2024

/cc @zdtsw

@openshift-ci openshift-ci bot requested a review from zdtsw October 2, 2024 06:58
@zdtsw
Copy link
Member

zdtsw commented Oct 2, 2024

i am fine with this change.
but try to understand the case better:
in DSCI under devFlags we currently have

  1. logmode
  2. manifestsUri => this should have been set to deprecated (docs(api): set manifestUri as deprecated #1137)
    I understand : " In the current code as soon as devFlags are present, the mode is taken in use" as
spec:
  devFlags:
    logmode: ""
    manifestsUri:  ....

is the same as

spec:
  applicationsNamespace: opendatahub
  devFlags:
       manifestsUri:  ....

because "" is the default value for string

but since we do not use manifestsUri
so it can only be done explictiliy as

spec:
  devFlags:
    logmode: ""

not

spec:
  devFlags:

(as this will remove the whole devFlags)

is this the concern for the PR?

@ykaliuta
Copy link
Contributor Author

ykaliuta commented Oct 2, 2024

is this the concern for the PR?

May be not exactly. The point is as soon as devFlags present, logmode is considered to be set to "" even if it is not. I actually had in mind scenario where a "user" sets just manifests (ok, deprecated now, but anyway) and automatically resets the logmode.

@ykaliuta
Copy link
Contributor Author

ykaliuta commented Oct 2, 2024

is this the concern for the PR?

May be not exactly. The point is as soon as devFlags present, logmode is considered to be set to "" even if it is not. I actually had in mind scenario where a "user" sets just manifests (ok, deprecated now, but anyway) and automatically resets the logmode.

And if it fixed (I can only fix it with ignoring of ""), there is no way to force default anymore

@zdtsw
Copy link
Member

zdtsw commented Oct 2, 2024

is this the concern for the PR?

May be not exactly. The point is as soon as devFlags present, logmode is considered to be set to "" even if it is not. I actually had in mind scenario where a "user" sets just manifests (ok, deprecated now, but anyway) and automatically resets the logmode.

yep, so if the user want to set logmode to $value or "" i dont think it could be a case that we have devFlags without logmode there.
but yeah, as i said, i dont see problem with having a value default defined there.

@ykaliuta
Copy link
Contributor Author

ykaliuta commented Oct 2, 2024

i dont think it could be a case that we have devFlags without logmode there

Yep. That is the hypothetical case I'm addressing

Copy link
Member

@zdtsw zdtsw left a comment

Choose a reason for hiding this comment

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

would like to have 2nd eyes on this as well

@openshift-ci openshift-ci bot added the lgtm label Oct 2, 2024
Copy link

openshift-ci bot commented Oct 2, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: zdtsw

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

@openshift-ci openshift-ci bot added the approved label Oct 2, 2024
@openshift-merge-bot openshift-merge-bot bot merged commit eb6ba18 into opendatahub-io:incubation Oct 2, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants