Skip to content

Commit

Permalink
fix(projects.deploykey): Add nil check before pointer deref for Creat…
Browse files Browse the repository at this point in the history
…edAt in controller

Signed-off-by: Vitalijs <[email protected]>
  • Loading branch information
Vitalijs committed Aug 9, 2023
1 parent 0cb5331 commit 0ee3082
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/controller/projects/deploykeys/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,9 @@ func (e *external) Observe(ctx context.Context, mg resource.Managed) (managed.Ex
lateInitializeProjectDeployKey(&cr.Spec.ForProvider, dk)
isLateInitialized := !cmp.Equal(currentState, &cr.Spec.ForProvider)

cr.Status.AtProvider = v1alpha1.DeployKeyObservation{
ID: &dk.ID,
CreatedAt: &metav1.Time{Time: *dk.CreatedAt},
cr.Status.AtProvider = v1alpha1.DeployKeyObservation{ID: &dk.ID}
if dk.CreatedAt != nil {
cr.Status.AtProvider.CreatedAt = &metav1.Time{Time: *dk.CreatedAt}
}

cr.Status.SetConditions(xpv1.Available())
Expand Down

0 comments on commit 0ee3082

Please sign in to comment.