Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion pkg/resource/bucket/hook.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ package bucket
import (
"context"
"fmt"
"reflect"
"strings"

"github.com/pkg/errors"
Expand Down Expand Up @@ -1685,7 +1686,7 @@ func (rm *resourceManager) syncWebsite(
ctx context.Context,
r *resource,
) (err error) {
if r.ko.Spec.Website == nil {
if r.ko.Spec.Website == nil || reflect.ValueOf(*r.ko.Spec.Website).IsZero() {
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 be good to have a unit test validating that deleteWebsite is called when Spec.Website is nil or empty.

return rm.deleteWebsite(ctx, r)
}
return rm.putWebsite(ctx, r)
Expand Down