Skip to content
This repository has been archived by the owner on Aug 28, 2024. It is now read-only.

Commit

Permalink
Handle nil actual resource in resource manager
Browse files Browse the repository at this point in the history
Signed-off-by: Scott Andrews <[email protected]>
  • Loading branch information
scothis committed Jun 2, 2023
1 parent 4e5ee37 commit 50d2840
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion reconcilers/reconcilers.go
Original file line number Diff line number Diff line change
Expand Up @@ -1706,7 +1706,7 @@ func (r *ResourceManager[T]) Manage(ctx context.Context, resource client.Object,
}

// create resource if it doesn't exist
if actual.GetCreationTimestamp().Time.IsZero() {
if internal.IsNil(actual) || actual.GetCreationTimestamp().Time.IsZero() {
log.Info("creating resource", "resource", r.sanitize(desired))
if err := c.Create(ctx, desired); err != nil {
log.Error(err, "unable to create resource", "resource", namespaceName(desired))
Expand Down

0 comments on commit 50d2840

Please sign in to comment.