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

✨ Make clusterctl cert-manager timeout configurable #2834

Merged

Conversation

nader-ziada
Copy link
Contributor

What this PR does / why we need it:

  • cert-manager-timeout can be set in config file
  • default of 10 minutes if no value is set

**Which issue(s) this PR fixes
Fixes #2822

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Mar 31, 2020
@nader-ziada
Copy link
Contributor Author

nader-ziada commented Mar 31, 2020

/cc @fabriziopandini

Copy link
Member

@fabriziopandini fabriziopandini left a comment

Choose a reason for hiding this comment

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

@nader-ziada
Considering that cert-manager-timeout is a simple variable, IMO we can do a much simpler solution using o.configClient.Variables instead of introducting a full fladged CertManagerTimeoutClient.

On the contrary, the CertManagerTimeoutClient can be justified only if we plan to support many other timeouts in the future, but in this case we should create a generic TimeoutClient backed by a configuration entry with type map[string]time.Duration

@nader-ziada @vincepri @wfernandes opinions?

func (cm *certManagerClient) getWaitTimeout() time.Duration {
log := logf.Log

timeout, err := cm.configClient.CertManagerTimeout().Get()
Copy link
Member

Choose a reason for hiding this comment

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

Can we do o.configClient.Variables.Get(overrideFolderKey) like we are already doing for e.g. overrideFolders

f, err := o.configVariablesClient.Get(overrideFolderKey)

Copy link
Contributor

Choose a reason for hiding this comment

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

I agree with leveraging the Variables Client.
As an example if you define certManagerTimeout similar to the overridesFolder in clusterctl.yaml. It should be made accessible via the variables client. Then we don't need ot have a specific client just for a component's timeout.

overridesFolder:${ARTIFACTS}/testdata

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok, I was just trying to follow the pattern I found, will re-work it

@nader-ziada nader-ziada force-pushed the cert-manager-timeout branch from fd39aad to dec981a Compare April 1, 2020 13:12
@nader-ziada
Copy link
Contributor Author

@fabriziopandini @wfernandes made the switch to variables, please take another look

Copy link
Member

@fabriziopandini fabriziopandini left a comment

Choose a reason for hiding this comment

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

@nader-ziada thanks for reworking!
/approve


timeout, err := cm.configClient.Variables().Get(timeoutConfigKey)
if err != nil {
return waitCertManagerTimeout
Copy link
Member

Choose a reason for hiding this comment

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

nit (not blocking) waitCertManagerDefaultTimeout

Copy link
Contributor Author

Choose a reason for hiding this comment

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

changed it

- cert-manager-timeout can be set in config file
- default of 10 minutes if no value is set
@nader-ziada nader-ziada force-pushed the cert-manager-timeout branch from dec981a to cd655cd Compare April 1, 2020 15:40
Copy link
Member

@vincepri vincepri left a comment

Choose a reason for hiding this comment

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

/lgtm
/milestone v0.3.4

@k8s-ci-robot k8s-ci-robot added this to the v0.3.4 milestone Apr 1, 2020
@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Apr 1, 2020
@vincepri
Copy link
Member

vincepri commented Apr 1, 2020

/approve

per @fabriziopandini approval above

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: fabriziopandini, nader-ziada, vincepri

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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 1, 2020
@k8s-ci-robot k8s-ci-robot merged commit b5b5f50 into kubernetes-sigs:master Apr 1, 2020
@nader-ziada nader-ziada deleted the cert-manager-timeout branch April 3, 2020 14:57
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. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make clusterctl cert-manager timeout configurable
5 participants