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
feat: Implement reconcile logic #3
Conversation
28bf3ee
to
93864b1
Compare
93864b1
to
c14e0df
Compare
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.
Code lgtm! Will try and do a quick run..
Maybe we could add a couple of examples too |
Ah here is one config/samples/gitops_v1alpha1_cluster_capi.yaml ! |
I don't see the status getting updated on the cluster objects 🤔 .
Though the controller does show stuff going on the logs:
|
ec29f17
to
22a2e8b
Compare
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.
Awesome :)
var secret corev1.Secret | ||
if err := r.Get(ctx, name, &secret); err != nil { | ||
e := fmt.Errorf("failed to get secret %q: %w", name, err) | ||
conditions.MarkFalse(cluster, meta.ReadyCondition, gitopsv1alpha1.WaitingForSecretReason, e.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.
You don't necessarily need to implement it in this branch but I don't think that the secret not being available isn't an error...it's somewhat expected.
Use https://pkg.go.dev/k8s.io/apimachinery/pkg/api/errors#IsNotFound and if the secret isn't found, I'd use a time-based RequeueAfter
result.
If you return errors, you will get backoff, this will top out at 6m, but, as you can imagine, the longer you wait, the more likely it is that the secret will be available (because you're waiting for it to be created) so letting it backoff 'til the maximum means you'll wait for the longest period.
22a2e8b
to
eacfdfd
Compare
eacfdfd
to
e846068
Compare
Fixes: weaveworks/weave-gitops-enterprise#487