Skip to content

Commit

Permalink
Rebase to master & fix merge conflicts
Browse files Browse the repository at this point in the history
Signed-off-by: David-Jaeyoon-Lee <[email protected]>
  • Loading branch information
David-Jaeyoon-Lee committed Oct 30, 2024
1 parent 9892845 commit f9e6699
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions pkg/gator/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ var (
// SyncSet.
ErrNotAGVKManifest = errors.New("not a GVKManifest")
// ErrNotAnExpansion indicates the user-indicated file does not contain a
// ErrNotAnExpansion indicates the user-indicated file does not contain an
// ExpansionTemplate.
ErrNotAnExpansion = errors.New("not an Expansion Template")
// ErrAddingTemplate indicates a problem instantiating a Suite's ConstraintTemplate.
Expand Down
2 changes: 1 addition & 1 deletion pkg/gator/reader/read_resources.go
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ func ReadExpansion(f fs.FS, path string) (*unstructured.Unstructured, error) {
}

gvk := u.GroupVersionKind()
if gvk.Group != "expansion.gatekeeper.sh" {
if gvk.Group != "expansion.gatekeeper.sh" || gvk.Kind != "ExpansionTemplate" {
return nil, gator.ErrNotAnExpansion
}

Expand Down
4 changes: 4 additions & 0 deletions pkg/gator/verify/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,10 @@ func (r *Runner) runReview(ctx context.Context, newClient func() (gator.Client,
}

review, err := c.Review(ctx, au, reviews.EnforcementPoint(util.GatorEnforcementPoint))
if err != nil {
return nil, fmt.Errorf("reviewing %v %s/%s: %w",
toReview.GroupVersionKind(), toReview.GetNamespace(), toReview.GetName(), err)
}

if e != nil {
resultants, err := e.Expand(toReview)
Expand Down

0 comments on commit f9e6699

Please sign in to comment.