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

Add config for packageserver wakeup interval #298

Merged

Conversation

tmshort
Copy link
Contributor

@tmshort tmshort commented Sep 28, 2023

No description provided.

@codecov
Copy link

codecov bot commented Sep 28, 2023

Codecov Report

Attention: 4 lines in your changes are missing coverage. Please review.

Comparison is base (28c6773) 41.99% compared to head (9274a37) 41.99%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #298   +/-   ##
=======================================
  Coverage   41.99%   41.99%           
=======================================
  Files          39       39           
  Lines        3505     3512    +7     
=======================================
+ Hits         1472     1475    +3     
- Misses       1887     1891    +4     
  Partials      146      146           
Files Coverage Δ
crds/zz_defs.go 35.84% <ø> (ø)
pkg/operators/v1/olmconfig_types.go 100.00% <100.00%> (ø)
pkg/operators/v1/zz_generated.deepcopy.go 0.00% <0.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

pkg/operators/v1/olmconfig_test.go Outdated Show resolved Hide resolved
pkg/operators/v1/olmconfig_test.go Outdated Show resolved Hide resolved
pkg/operators/v1/olmconfig_types.go Outdated Show resolved Hide resolved
@tmshort
Copy link
Contributor Author

tmshort commented Sep 28, 2023

The one thing missing here is validation; it gets parsed as a duration, but doesn't validate beforehand (i.e. no regex)

@ncdc
Copy link
Member

ncdc commented Sep 28, 2023

Try // +kubebuilder:validation:Format=duration

@ncdc
Copy link
Member

ncdc commented Sep 28, 2023

@@ -43,6 +43,9 @@ spec:
disableCopiedCSVs:
description: DisableCopiedCSVs is used to disable OLM's "Copied CSV" feature for operators installed at the cluster scope, where a cluster scoped operator is one that has been installed in an OperatorGroup that targets all namespaces. When reenabled, OLM will recreate the "Copied CSVs" for each cluster scoped operator.
type: boolean
packageServerWakeupInterval:
Copy link
Member

Choose a reason for hiding this comment

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

Would packageServerPeriodicSyncInterval be more appropriate?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's called wakeupInterval in the code... but I really don't care.

Copy link
Contributor Author

@tmshort tmshort Sep 28, 2023

Choose a reason for hiding this comment

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

"Periodic" and "Interval" are redundant. So, perhaps just "packageServerSyncInterval"?

@dinhxuanvu
Copy link
Member

While this config is on olmconfig api which users choose to do this, I still feel a bit concerned that if they set this duration too longer (either intentionally or accidentally), the catalog data in package server is gonna be stale for a long time. I wonder if there is a way to validate and warn against this. Having said that, this should only impact the consumer of packageserver which is console at the moment. This shouldn’t impact the runtime resolution which is more important.

@tmshort
Copy link
Contributor Author

tmshort commented Sep 28, 2023

Try // +kubebuilder:validation:Format=duration

meh: kubernetes/apiextensions-apiserver#56

I found this, and reduced it (before @dinhxuanvu even said anything) to limit it to hours/minutes/seconds.
openshift/hive#1684

@dinhxuanvu
Copy link
Member

dinhxuanvu commented Sep 28, 2023

Try // +kubebuilder:validation:Format=duration
meh: kubernetes/apiextensions-apiserver#56

I found this, and reduced it (before @dinhxuanvu even said anything) to limit it to hours/minutes/seconds. openshift/hive#1684

I can live with hours restrictions. At least that will allow daily update of catalog content.

@tmshort
Copy link
Contributor Author

tmshort commented Sep 28, 2023

Try // +kubebuilder:validation:Format=duration
meh: kubernetes/apiextensions-apiserver#56

I found this, and reduced it (before @dinhxuanvu even said anything) to limit it to hours/minutes/seconds. openshift/hive#1684

I can live with hours restrictions. At least that will allow daily update of catalog content.

There's no limit to the number before the hours, so it could be e.g. 72h

Signed-off-by: Todd Short <todd.short@me.com>
@dinhxuanvu
Copy link
Member

Try // +kubebuilder:validation:Format=duration
meh: kubernetes/apiextensions-apiserver#56

I found this, and reduced it (before @dinhxuanvu even said anything) to limit it to hours/minutes/seconds. openshift/hive#1684

I can live with hours restrictions. At least that will allow daily update of catalog content.

There's no limit to the number before the hours, so it could be e.g. 72h

I’m aware of that but it’s unlikely that they mistakenly add that big of a number though it could still be a typo. That at least reduces the risk of having days of waiting if we allow days or beyond. I would prefer to restrict it to mins only but then that may sound too restrictive. I think this is reasonable compromise.
We can do further by issuing warning if the number exceeds 24 hrs but that is up to you.

@tmshort
Copy link
Contributor Author

tmshort commented Sep 28, 2023

I’m aware of that but it’s unlikely that they mistakenly add that big of a number though it could still be a typo. That at least reduces the risk of having days of waiting if we allow days or beyond. I would prefer to restrict it to mins only but then that may sound too restrictive. I think this is reasonable compromise. We can do further by issuing warning if the number exceeds 24 hrs but that is up to you.

It seemed telcos wanted to increase the period to days, and this is meant for IoT-type devices (which again, they may want to update reasonably quickly).

@dinhxuanvu
Copy link
Member

I’m aware of that but it’s unlikely that they mistakenly add that big of a number though it could still be a typo. That at least reduces the risk of having days of waiting if we allow days or beyond. I would prefer to restrict it to mins only but then that may sound too restrictive. I think this is reasonable compromise. We can do further by issuing warning if the number exceeds 24 hrs but that is up to you.

It seemed telcos wanted to increase the period to days, and this is meant for IoT-type devices (which again, they may want to update reasonably quickly).

Given this is for single-node/telco/LP usage, I wonder if their intention is to suppress the packageserver as much as possible because they simply don't use console at all. Deploying via CLI is usually more common then point-and-click console for these types of deployments. If that is the case then frankly I don't care as much about safeguarding this feature given packageserver has nothing to do with runtime catalog update.

@tmshort
Copy link
Contributor Author

tmshort commented Sep 29, 2023

ping for approval/lgtm?

Copy link
Member

@dinhxuanvu dinhxuanvu left a comment

Choose a reason for hiding this comment

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

/approve

@openshift-ci
Copy link

openshift-ci bot commented Sep 29, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dinhxuanvu, tmshort

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 Indicates a PR has been approved by an approver from all required OWNERS files. label Sep 29, 2023
@dinhxuanvu
Copy link
Member

dinhxuanvu commented Sep 29, 2023

ping for approval/lgtm?

I approved this but will need a secondary person to lgtm.

@ncdc
Copy link
Member

ncdc commented Sep 29, 2023

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Sep 29, 2023
@ncdc
Copy link
Member

ncdc commented Sep 29, 2023

I approved this but will need a secondary person to lgtm.

@dinhxuanvu why?

@openshift-merge-robot openshift-merge-robot merged commit 7961b02 into operator-framework:master Sep 29, 2023
5 checks passed
@dinhxuanvu
Copy link
Member

I approved this but will need a secondary person to lgtm.

@dinhxuanvu why?

Usually we require two separate people to review and thumb up on the PR especially involving an API change at least that's how we worked back in my time. I'm still following that rule. That's why I didn't approve and lgtm at the same time. Plus, I wanted other people to have a chance to block this PR if they didn't agree with me.

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. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants