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

Disconnected #162

Merged
merged 2 commits into from
May 6, 2022
Merged

Disconnected #162

merged 2 commits into from
May 6, 2022

Conversation

TerryHowe
Copy link
Contributor

@TerryHowe TerryHowe commented May 4, 2022

NAMESPACE       NAME                                                                                 STATE          DETAIL
default         packagebundlecontroller.packages.eks.amazonaws.com/bob                               ignored        
default         packagebundlecontroller.packages.eks.amazonaws.com/eksa-packages-bundle-controller   ignored        
eksa-packages   packagebundlecontroller.packages.eks.amazonaws.com/billy                             ignored        
eksa-packages   packagebundlecontroller.packages.eks.amazonaws.com/eksa-packages-bundle-controller   disconnected  

Closes: #109

@eks-distro-bot eks-distro-bot added approved size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels May 4, 2022
@TerryHowe
Copy link
Contributor Author

/hold until other pr merges

pbc.Status.State = api.BundleControllerStateDisconnected
err = r.Client.Status().Update(ctx, pbc, &client.UpdateOptions{})
if err != nil {
return result, fmt.Errorf("updating status to active: %s", err)
Copy link
Contributor

Choose a reason for hiding this comment

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

It would seem there might have been a cut and paste error with this log message?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

}

latestBundle, err := r.bundleManager.LatestBundle(ctx, pbc.Spec.Source.BaseRef())
if err != nil {
r.Log.Error(err, "Unable to get latest bundle")
if pbc.Status.State != api.BundleControllerStateDisconnected {
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm unclear on the intention here. If we fail (for any reason) to retrieve a bundle, we mark the bundle controller as disconnected? Maybe I don't understand what is meant by disconnected in this case, but that doesn't seem right. Could you give me more insight into the "why" behind this please?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is related to #109 and it was a request during our high level design review. If for whatever reason we cannot download new bundles, we should notify the customer that we are in an error state. They can tell they are in an error state using kubectl instead of looking at logs

Copy link
Contributor

Choose a reason for hiding this comment

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

Hmm, thanks. Shoot, I see now that you linked that issue in your PR description, and I just missed it cuz of the nice table there.

Copy link
Contributor

Choose a reason for hiding this comment

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

I might need a little time to get used to disconnected as the term. It doesn't feel right to me, but I can't think of anything better. :)

if changed {
err = r.Client.Status().Update(ctx, pbc, &client.UpdateOptions{})
if err != nil {
return result, fmt.Errorf("updating status to active: %s", err)
Copy link
Contributor

Choose a reason for hiding this comment

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

Another cut and paste error?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

@@ -113,20 +113,31 @@ func (r *PackageBundleControllerReconciler) Reconcile(ctx context.Context, req c
return withoutRequeue(result), nil
}

changed := false
Copy link
Contributor

Choose a reason for hiding this comment

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

Github won't let me comment on the top of this method, but it seems it's growing a lot. We should review it and see if it follows our design intents and/or how we can logically break it into smaller, more bite-sized chunks.

(Not for this PR of course)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeh, totally agree, some of this code should be in manager.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.

Created a issue to track

@eks-distro-bot eks-distro-bot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels May 5, 2022
@TerryHowe
Copy link
Contributor Author

/unhold

@jonahjon
Copy link
Contributor

jonahjon commented May 6, 2022

/lgtm

Copy link
Contributor

@ewollesen ewollesen left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

@eks-distro-bot eks-distro-bot merged commit 782354c into aws:main May 6, 2022
@eks-distro-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ewollesen, jonahjon, TerryHowe

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:
  • OWNERS [TerryHowe,ewollesen,jonahjon]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@TerryHowe TerryHowe deleted the disconnected branch May 9, 2022 22:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Failure to download bundle should update add-on status
4 participants