Skip to content
Open
Show file tree
Hide file tree
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/validation/internal/community.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,12 @@ type CommunityOperatorChecks struct {

// validateCommunityBundle will check the bundle against the community-operator criterias
func validateCommunityBundle(bundle *manifests.Bundle, indexImagePath string) errors.ManifestResult {
result := errors.ManifestResult{Name: bundle.Name}
result := errors.ManifestResult{}
if bundle == nil {
result.Add(errors.ErrInvalidBundle("Bundle is nil", nil))
return result
}
result.Name = bundle.Name

if bundle.CSV == nil {
result.Add(errors.ErrInvalidBundle("Bundle csv is nil", bundle.Name))
Expand Down
3 changes: 2 additions & 1 deletion pkg/validation/internal/operatorhub.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,12 +163,13 @@ func validateOperatorHubDeprecated(objs ...interface{}) (results []errors.Manife
}

func validateBundleOperatorHub(bundle *manifests.Bundle, k8sVersion string) errors.ManifestResult {
result := errors.ManifestResult{Name: bundle.Name}
result := errors.ManifestResult{}

if bundle == nil {
result.Add(errors.ErrInvalidBundle("Bundle is nil", nil))
return result
}
result.Name = bundle.Name

if bundle.CSV == nil {
result.Add(errors.ErrInvalidBundle("Bundle csv is nil", bundle.Name))
Expand Down
4 changes: 2 additions & 2 deletions pkg/validation/internal/operatorhubv2.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ func validateOperatorHubV2(objs ...interface{}) (results []errors.ManifestResult
}

func validateBundleOperatorHubV2(bundle *manifests.Bundle, k8sVersion string) errors.ManifestResult {
result := errors.ManifestResult{Name: bundle.Name}

result := errors.ManifestResult{}
if bundle == nil {
result.Add(errors.ErrInvalidBundle("Bundle is nil", nil))
return result
}
result.Name = bundle.Name

if bundle.CSV == nil {
result.Add(errors.ErrInvalidBundle("Bundle csv is nil", bundle.Name))
Expand Down
Loading