Skip to content

Commit

Permalink
Mark Release available with connection details
Browse files Browse the repository at this point in the history
Only mark a release as available once all connection details are ready.

Fixes crossplane-contrib#81

Signed-off-by: Simon Rüegg <simon@rueggs.ch>
  • Loading branch information
srueg committed Mar 25, 2021
1 parent 94c5b9a commit 2db31bc
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions pkg/controller/release/release.go
Original file line number Diff line number Diff line change
Expand Up @@ -242,12 +242,12 @@ func (e *helmExternal) Observe(ctx context.Context, mg resource.Managed) (manage
cd := managed.ConnectionDetails{}
if cr.Status.AtProvider.State == release.StatusDeployed && s {
cr.Status.Failed = 0
cr.Status.SetConditions(xpv1.Available())

cd, err = connectionDetails(ctx, e.kube, cr.Spec.ConnectionDetails, rel.Name, rel.Namespace)
if err != nil {
return managed.ExternalObservation{}, errors.Wrap(err, "cannot get connection details")
}
cr.Status.SetConditions(xpv1.Available())
} else {
cr.Status.SetConditions(xpv1.Unavailable())
}
Expand Down Expand Up @@ -310,7 +310,6 @@ func (e *helmExternal) deploy(ctx context.Context, cr *v1beta1.Release, action d
}
cr.Status.PatchesSha = sha
cr.Status.AtProvider = generateObservation(rel)
cr.Status.SetConditions(xpv1.Available())

return nil
}
Expand Down

0 comments on commit 2db31bc

Please sign in to comment.