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

logrotate: add design and api for logrotate #37

Merged
merged 1 commit into from
Jul 19, 2024

Conversation

parth-gr
Copy link
Contributor

@parth-gr parth-gr commented Jul 5, 2024

Describe what this PR does

api for the csi pods logrotate

Provide some context for the reviewer

Check the API flow

Is there anything that requires special attention

Do you have any questions?

Is the change backward compatible?

Are there concerns around backward compatibility?

Provide any external context for the change, if any.

For example:

  • Kubernetes links that explain why the change is required
  • Ceph-CSI spec related changes/catch-up that necessitates this patch
  • golang related practices that necessitates this change

Related issues

Mention any github issues relevant to this PR. Adding below line
will help to auto close the issue once the PR is merged.

Fixes: #issue_number

Future concerns

List items that are not part of the PR and do not impact it's
functionality, but are work items that can be taken up subsequently.

Checklist:

  • Commit Message Formatting: Commit titles and messages follow
    guidelines in the developer
    guide
    .
  • Reviewed the developer guide on Submitting a Pull
    Request
  • Pending release
    notes

    updated with breaking and/or notable changes for the next major release.
  • Documentation has been updated, if necessary.
  • Unit tests have been added, if necessary.
  • Integration tests have been added, if necessary.

@parth-gr
Copy link
Contributor Author

parth-gr commented Jul 5, 2024

[rider@localhost ceph-csi-operator]$ make generate 
Downloading sigs.k8s.io/controller-tools/cmd/[email protected]
# runtime/cgo
In file included from /usr/include/features.h:489,
                 from /usr/include/bits/libc-header-start.h:33,
                 from /usr/include/stdlib.h:25,
                 from _cgo_export.c:3:
/usr/include/gnu/stubs.h:7:11: fatal error: gnu/stubs-32.h: No such file or directory
    7 | # include <gnu/stubs-32.h>
      |           ^~~~~~~~~~~~~~~~
compilation terminated.
make: *** [Makefile:180: /home/rider/go/src/github.com/ceph-csi-operator/bin/controller-gen-v0.14.0] Error 1

Not able to build the crds

@parth-gr parth-gr changed the title logrotate: add api for logrotate logrotate: add design and api for logrotate Jul 5, 2024
api/v1alpha1/driver_types.go Outdated Show resolved Hide resolved
api/v1alpha1/driver_types.go Show resolved Hide resolved
api/v1alpha1/driver_types.go Show resolved Hide resolved
api/v1alpha1/driver_types.go Outdated Show resolved Hide resolved
docs/design/logrotate.md Show resolved Hide resolved
docs/design/logrotate.md Show resolved Hide resolved
api/v1alpha1/driver_types.go Outdated Show resolved Hide resolved
docs/design/logrotate.md Outdated Show resolved Hide resolved
docs/design/logrotate.md Outdated Show resolved Hide resolved
docs/design/logrotate.md Outdated Show resolved Hide resolved
docs/design/logrotate.md Outdated Show resolved Hide resolved
docs/design/logrotate.md Outdated Show resolved Hide resolved
@parth-gr parth-gr requested review from nb-ohad and Madhu-1 July 8, 2024 14:29
@nb-ohad
Copy link
Collaborator

nb-ohad commented Jul 8, 2024

@parth-gr The way this API change is written assumes log rotation is always enabled if you want to change the log level which I think is a mistake. We need to make a decision:

  • either we have log rotation always which means we need good defaults
  • or we separate the rotation params to LogRotationSpec which is an optional field under LogSpec (via a pointer)

@parth-gr
Copy link
Contributor Author

parth-gr commented Jul 9, 2024

Collaborator

@parth-gr The way this API change is written assumes log rotation is always enabled if you want to change the log level which I think is a mistake. We need to make a decision:

  • either we have log rotation always which means we need good defaults
  • or we separate the rotation params to LogRotationSpec which is an optional field under LogSpec (via a pointer)

@Madhu-1 what do you think? should we have enabled disable??
Or do good defaults work??

And downstream it is only enabled when

`CephCSIOperatorConfig CRD`:
```yaml
spec:
    provisioner:
        privileged: true

@Madhu-1
Copy link
Collaborator

Madhu-1 commented Jul 9, 2024

Collaborator

@parth-gr The way this API change is written assumes log rotation is always enabled if you want to change the log level which I think is a mistake. We need to make a decision:

  • either we have log rotation always which means we need good defaults
  • or we separate the rotation params to LogRotationSpec which is an optional field under LogSpec (via a pointer)

@Madhu-1 what do you think? should we have enabled disable?? Or do good defaults work??

And downstream it is only enabled when

`CephCSIOperatorConfig CRD`:
```yaml
spec:
    provisioner:
        privileged: true

both are independent, both need to be set for it to work properly for openshift. why do we need to enable it by default, we are setting the values that user expected us to set, user should know what is being done.

@parth-gr
Copy link
Contributor Author

@Madhu-1 @nb-ohad good for final round of review, once this has the green flag, I can work on the follow up subtasks(Prs)

@parth-gr parth-gr force-pushed the logrotate-design branch 2 times, most recently from 19e126e to 75635ad Compare July 10, 2024 15:00
api/v1alpha1/driver_types.go Show resolved Hide resolved
docs/design/logrotate.md Outdated Show resolved Hide resolved
@parth-gr parth-gr requested a review from travisn July 11, 2024 06:49
@parth-gr parth-gr force-pushed the logrotate-design branch 2 times, most recently from 4bfedfb to cc48915 Compare July 11, 2024 07:13
api/v1alpha1/driver_types.go Outdated Show resolved Hide resolved
api/v1alpha1/driver_types.go Outdated Show resolved Hide resolved
docs/design/logrotate.md Outdated Show resolved Hide resolved
docs/design/logrotate.md Outdated Show resolved Hide resolved
docs/design/logrotate.md Outdated Show resolved Hide resolved
docs/design/logrotate.md Outdated Show resolved Hide resolved
docs/design/logrotate.md Outdated Show resolved Hide resolved
docs/design/operator.md Outdated Show resolved Hide resolved
docs/design/operator.md Outdated Show resolved Hide resolved
Copy link
Collaborator

@Madhu-1 Madhu-1 left a comment

Choose a reason for hiding this comment

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

@parth-gr can you please rebase this PR?

api/v1alpha1/driver_types.go Outdated Show resolved Hide resolved
Madhu-1
Madhu-1 previously approved these changes Jul 16, 2024
Copy link
Collaborator

@Madhu-1 Madhu-1 left a comment

Choose a reason for hiding this comment

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

LGTM

Madhu-1
Madhu-1 previously approved these changes Jul 17, 2024
api/v1alpha1/driver_types.go Outdated Show resolved Hide resolved
api/v1alpha1/driver_types.go Outdated Show resolved Hide resolved
api/v1alpha1/driver_types.go Show resolved Hide resolved
api/v1alpha1/driver_types.go Outdated Show resolved Hide resolved
docs/design/logrotate.md Show resolved Hide resolved
nb-ohad
nb-ohad previously approved these changes Jul 18, 2024
@parth-gr parth-gr requested a review from Madhu-1 July 19, 2024 07:56
docs/design/operator.md Outdated Show resolved Hide resolved
design and api for the csi pods logrotate

Signed-off-by: parth-gr <[email protected]>
@Madhu-1 Madhu-1 merged commit d8db354 into ceph:main Jul 19, 2024
7 checks passed
@nb-ohad
Copy link
Collaborator

nb-ohad commented Jul 20, 2024

image

@parth-gr I already asked in a prev comment to call the field Rotation and not LogRotation because we do not need the reputation:
Driver.Spec.Log.LogRotation -> Driver.Spec.Log.Rotation

The struct name itself should still be called LogRotationSepc because that is what it describes but the field name should change

As this one was already merged by @Madhu-1. Please issue another PR for the API fix

@parth-gr
Copy link
Contributor Author

@nb-ohad I did updated it before, but with your recent suggestions I did change it back #37 (comment)

I can open a follow PR to address this ;)

@nb-ohad
Copy link
Collaborator

nb-ohad commented Jul 20, 2024

You are correct!!!

When I wrote the comment you are pointing to, I was thinking about the field in isolation, not as part of the entire spec. The point I was trying to make was that we need Spec in the struct name. calling the field LogRotation instead of Rotation, on that comment, was just a simple oversight.

My bad. And yes let's have a follow up PR to fix this.

leelavg pushed a commit to leelavg/ceph-csi-operator that referenced this pull request Oct 17, 2024
add ocs default toleration to csi-op podspec
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.

5 participants