-
Notifications
You must be signed in to change notification settings - Fork 102
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
Wait for deployments #2010
base: main
Are you sure you want to change the base?
Wait for deployments #2010
Conversation
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: skonto 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@skonto: 4 warnings.
In response to this:
Fixes #2009
Proposed Changes
- Re-enqueue until deployments are available. This make sure resources can be reconciled properly.
Release Note
Proper order is enforced now during manifest installation.
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.
return nil | ||
} | ||
|
||
func InstallWebhookConfigs(ctx context.Context, manifest *mf.Manifest, instance base.KComponent) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Golint comments: exported function InstallWebhookConfigs should have comment or be unexported. More info.
pkg/reconciler/common/install.go
Outdated
return nil | ||
} | ||
|
||
func InstallWebhookDepResources(ctx context.Context, manifest *mf.Manifest, instance base.KComponent) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Golint comments: exported function InstallWebhookDepResources should have comment or be unexported. More info.
return nil | ||
} | ||
|
||
func MarkStatusSuccess(ctx context.Context, manifest *mf.Manifest, instance base.KComponent) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Golint comments: exported function MarkStatusSuccess should have comment or be unexported. More info.
return nil | ||
} | ||
|
||
func SetManifestPaths(ctx context.Context, manifest *mf.Manifest, instance base.KComponent) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Golint comments: exported function SetManifestPaths should have comment or be unexported. More info.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2010 +/- ##
==========================================
+ Coverage 62.76% 62.79% +0.03%
==========================================
Files 49 49
Lines 2291 2293 +2
==========================================
+ Hits 1438 1440 +2
Misses 761 761
Partials 92 92 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Istio cni is not coming up for e2e tests
|
|
verify should be fixed with #2011 |
@houshengbo gentle ping. |
pkg/reconciler/common/deployments.go
Outdated
@@ -52,7 +55,7 @@ func CheckDeployments(ctx context.Context, manifest *mf.Manifest, instance base. | |||
|
|||
if len(nonReadyDeployments) > 0 { | |||
status.MarkDeploymentsNotReady(nonReadyDeployments) | |||
return nil | |||
return controller.NewRequeueAfter(1 * time.Second) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to requeue blindly as this could create a hard loop when there is not actual progress?
The controllers are setting up informers for deployments, so the resource will get requeued anyway when they change (including when they become ready)
operator/pkg/reconciler/knativeeventing/controller.go
Lines 71 to 74 in 59db3c0
deploymentInformer.Informer().AddEventHandler(cache.FilteringResourceEventHandler{ | |
FilterFunc: controller.FilterControllerGVK(v1beta1.SchemeGroupVersion.WithKind("KnativeEventing")), | |
Handler: controller.HandleAll(impl.EnqueueControllerOf), | |
}) |
operator/pkg/reconciler/knativeserving/controller.go
Lines 71 to 74 in 59db3c0
deploymentInformer.Informer().AddEventHandler(cache.FilteringResourceEventHandler{ | |
FilterFunc: controller.FilterControllerGVK(v1beta1.SchemeGroupVersion.WithKind("KnativeServing")), | |
Handler: controller.HandleAll(impl.EnqueueControllerOf), | |
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and if that's not happening, then the informer handling is where we need to tweak to fix the issue
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am aware of that, I wanted to make sure it happens faster in case something is slow.
The idea is that you cannot progress with an install if your deployments are not up and I wanted to enforce that. So it is not exactly blindly done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The other thing is that if I dont re-enqueue there and block the logic we still face the problem (an error is printed) as the dependent resources will be deployed e.g. Certificate. We need to interrupt the deployment (returning an error) or block until deployments are up. I have tested both options, here I have the former.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are the stages:
stages := common.Stages{
common.AppendTarget,
ingress.AppendTargetIngress,
security.AppendTargetSecurity,
common.AppendAdditionalManifests,
r.appendExtensionManifests,
r.transform,
manifests.Install,
common.CheckDeployments, // <- Make sure we are up here otherwise don't progress bellow
common.InstallWebhookConfigs,
common.InstallWebhookDependentResources,
manifests.SetManifestPaths,
common.MarkStatusSuccess,
common.DeleteObsoleteResources(ctx, ks, r.installed),
}
@pierDipi I removed the re-enqueue thing and now I just skip the next stages until we are up. If no deployment change happens no reconciliation will happen. |
@houshengbo gentle ping |
@skonto I just fixed the CI issue, could you rebase this PR? |
Sure. |
role mf.Predicate = mf.Any(mf.ByKind("ClusterRole"), mf.ByKind("Role")) | ||
rolebinding mf.Predicate = mf.Any(mf.ByKind("ClusterRoleBinding"), mf.ByKind("RoleBinding")) | ||
webhook mf.Predicate = mf.Any(mf.ByKind("MutatingWebhookConfiguration"), mf.ByKind("ValidatingWebhookConfiguration")) | ||
webhookDependentResources mf.Predicate = mf.ByGVK(schema.GroupVersionKind{Group: "networking.internal.knative.dev", Version: "v1alpha1", Kind: "Certificate"}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to specify Version: "v1alpha1"
here, as it may change in future? If version is empty, it will just return a GroupKind. It should be fine, right?
Fixes #2009
Proposed Changes
Release Note