Skip to content

Commit d69980c

Browse files
committed
remove admission again, datastructure is now validating itself for the most part
On-behalf-of: @SAP [email protected]
1 parent eda7b86 commit d69980c

File tree

2 files changed

+0
-72
lines changed

2 files changed

+0
-72
lines changed

internal/admission/publishedresource/validation.go

Lines changed: 0 additions & 61 deletions
This file was deleted.

internal/controller/syncmanager/controller.go

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ import (
2424
"github.com/kcp-dev/logicalcluster/v3"
2525
"go.uber.org/zap"
2626

27-
"github.com/kcp-dev/api-syncagent/internal/admission/publishedresource"
2827
"github.com/kcp-dev/api-syncagent/internal/controller/sync"
2928
"github.com/kcp-dev/api-syncagent/internal/controller/syncmanager/lifecycle"
3029
"github.com/kcp-dev/api-syncagent/internal/controllerutil"
@@ -275,16 +274,6 @@ func (r *Reconciler) ensureSyncControllers(ctx context.Context, log *zap.Sugared
275274
continue
276275
}
277276

278-
// If the PR is invalid, do not even start a controller for it. Since the $key contains
279-
// the resource version, if the invalidt PR is fixed, a new controller can be spawned.
280-
// In the future, validation issues like this should be caught by a validation webhook
281-
// or more advanced CEL-based validations on the CRD itself, rather than validating in
282-
// a controller.
283-
if err := publishedresource.ValidatePublishedResource(&pubRes); err != nil {
284-
log.Errorw("Not starting controller for published resource because of errors", zap.Error(err), "pr", pubRes.Name)
285-
continue
286-
}
287-
288277
log.Infow("Starting new sync controller…", "key", key)
289278

290279
// create the sync controller;

0 commit comments

Comments
 (0)