8000 Add System's USER_SESSION_TTL configurability by miguelsorianod · Pull Request #618 · 3scale/3scale-operator · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Add System's USER_SESSION_TTL configurability #618

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 8000 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

Merged
merged 1 commit into from
Jun 11, 2021

Conversation

miguelsorianod
Copy link
Contributor

This PR exposes the USER_SESSION_TTL System's setting.
Related issue:
It exposes this setting as an attribute in the system-app secret as usual.

This is the behavior:

Secret side:

  • If the attribute is not set with secret pre-creation then it will automatically be set to the "" string

System pod side

  • The value is referenced as an environment variable in the system-app pod containers, as seret entry reference, which should exist.
  • If the referenced value is the empty string "" then USER_SESSION_TTL on system side will be the default at system level

An upgrade procedure has been implemented too to make sure the secret entry is created and that the system-app pod containers reference this secret entry.

The change has also been applied to templates. This change will require an upgrade procedure for templates too.

Pending:
[ ] Functionality verification in a real deployment, in both a clean environment and an upgrade

@miguelsorianod
Copy link
Contributor Author

Pending to do some verifications in a real deployment but let's review it first and if it looks ok I'll proceed to do the verifications

@akostadinov
Copy link
Contributor

Wow, a lot of changes just for one new option.

Copy link
Member
@eguzki eguzki left a comment

Choose a reason for hiding this comment

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

Looking good overall.

I wonder if the upgrade procedure is really needed. Maybe delegating to the regular reconciliation loop would be enough.

Few comments left

if err != nil {
return reconcile.Result{}, err
}
baseAPIManagerLogicReconciler := NewBaseAPIManagerLogicReconciler(u.BaseReconciler, u.apiManager)
Copy link
Member

Choose a reason for hiding this comment

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

Not related to this PR, maybe for another PR: what about embedding BaseAPIManagerLogicReconciler in UpgradeApiManager type?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

👍 I'll take a look at it and open a new PR in that case

@@ -638,11 +688,11 @@ func (u *UpgradeApiManager) upgradeSidekiqBackendRouteEnv(desired *appsv1.Deploy
return reconcile.Result{Requeue: update}, nil
}

func ensureBackendRouteEnvVar(desired v1.EnvVar, existingEnvVars *[]v1.EnvVar) bool {
func ensureEnvVar(desired v1.EnvVar, existingEnvVars *[]v1.EnvVar) bool {
Copy link
Member

Choose a reason for hiding this comment

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

This method belongs to pkg/helper/envvarutils.go

Copy link
Contributor Author

Choose a reason for hiding this comment

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

👍 I'll add it there

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added

@miguelsorianod
Copy link
Contributor Author

I wonder if the upgrade procedure is really needed. Maybe delegating to the regular reconciliation loop would be enough.

I thought about that too but the upgrade is needed because the environment variable needs to be added to the deployment, during regular reconciliation that part is not reconciled, and the value has to be added to the secret because the environment variable references it.

@miguelsorianod miguelsorianod force-pushed the add-system-user-session-ttl-configurability branch from e41d15e to 6fba968 Compare June 10, 2021 09:11
@miguelsorianod miguelsorianod force-pushed the add-system-user-session-ttl-configurability branch from 6fba968 to 05fd286 Compare June 10, 2021 11:00
@codeclimate
Copy link
codeclimate bot commented Jun 10, 2021

Code Climate has analyzed commit 05fd286 and detected 5 issues on this pull request.

Here's the issue category breakdown:

Category Count
Complexity 1
Duplication 3
Style 1

View more on Code Climate.

@miguelsorianod
Copy link
Contributor Author

/retest

1 similar comment
@miguelsorianod
Copy link
Contributor Author

/retest

@miguelsorianod
Copy link
Contributor Author

/retest

1 similar comment
@miguelsorianod
Copy link
Contributor Author

/retest

@eguzki eguzki merged commit 4307318 into master Jun 11, 2021
@eguzki eguzki deleted the add-system-user-session-ttl-configurability branch June 11, 2021 13:34
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.

3 participants
0