Skip to content

Conversation

Fedosin
Copy link
Contributor

@Fedosin Fedosin commented Jun 4, 2023

What this PR does / why we need it:
Currently Cluster API Operator keeps refetching data from the specified URL after successful provider installation. It means that in case of network error Operator can't download manifests again and marks providers as unhealthy.

To prevent this, we fetch manifests only once in the beginning and store them in a configmap. For all the following reconciliations we take data from the configmap instead of downloading it from github/gitlab.

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #119

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jun 4, 2023
@k8s-ci-robot k8s-ci-robot requested a review from JoelSpeed June 4, 2023 20:48
@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Jun 4, 2023
Copy link
Contributor

@alexander-demicev alexander-demicev left a comment

Choose a reason for hiding this comment

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

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: alexander-demicev

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 Jun 5, 2023
Copy link
Member

@furkatgofurov7 furkatgofurov7 left a comment

Choose a reason for hiding this comment

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

Few nits, overall LGTM, thanks for the PR @Fedosin


log := ctrl.LoggerFrom(ctx)

log.Info("Downloading provider manifests")
Copy link
Member

Choose a reason for hiding this comment

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

we could add a verbosity to the logger:

Suggested change
log.Info("Downloading provider manifests")
log.V(5).Info("Downloading provider manifests")

func (p *phaseReconciler) load(ctx context.Context) (reconcile.Result, error) {
log := ctrl.LoggerFrom(ctx)

log.Info("Loading provider")
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
log.Info("Loading provider")
log.V(5).Info("Loading provider")

Copy link
Contributor

Choose a reason for hiding this comment

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

We actually moved these logs to the 0 level some time ago so the operator is not too silent by default

Copy link
Member

Choose a reason for hiding this comment

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

@alexander-demicev you mean in all cases? Because I spotted

log.V(5).Info("Custom ConfigMap was provided for fetching manifests")
where it is using the log level, but if that is just a left out then you can disregard my comment

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 think setting log level is not strictly related to this PR, so for now we can keep it as-is and address it later.

@Fedosin Fedosin force-pushed the download_manifests branch 2 times, most recently from 803636e to 6c819f6 Compare June 6, 2023 12:44
Copy link
Member

@furkatgofurov7 furkatgofurov7 left a comment

Choose a reason for hiding this comment

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

/lgtm
/hold

in case you want someone else as well to do another round of reviews before it is merged.
(@Fedosin feel free to unhold)

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jun 6, 2023
@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 6, 2023
@Fedosin Fedosin force-pushed the download_manifests branch from 6c819f6 to 67bed92 Compare June 6, 2023 15:37
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 6, 2023
Copy link
Member

@furkatgofurov7 furkatgofurov7 left a comment

Choose a reason for hiding this comment

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

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 6, 2023
@Fedosin
Copy link
Contributor Author

Fedosin commented Jun 6, 2023

/hold cancel

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jun 6, 2023
@k8s-ci-robot k8s-ci-robot merged commit eeab2cb into kubernetes-sigs:main Jun 6, 2023
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.

Cluster API Operator keeps refetching data from the specified URL after successful provider installation

4 participants