Skip to content

Commit

Permalink
Ignore empty files
Browse files Browse the repository at this point in the history
OpenShift gathers have some file called
`./pod_network_connectivity_check/podnetworkconnectivitychecks.yaml`
that is sometimes empty and this leads to a `""` groupVersion being
parsed which later leads to static-kas failing to start down the line
  • Loading branch information
omertuc committed Dec 13, 2023
1 parent 2e305e0 commit aaa64e8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/discovery/discovery.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ func Discover(l *zap.Logger, basePath string) (map[string]*metav1.APIResourceLis
return
}

if len(raw) == 0 {
return
}

u := &unstructured.Unstructured{}
if err := yaml.Unmarshal(raw, u); err != nil {
errs.add(fmt.Errorf("failed to decode %s into an unstructured: %w", path, err))
Expand Down

0 comments on commit aaa64e8

Please sign in to comment.