Skip to content

Commit

Permalink
fix: register own crd scheme (#4)
Browse files Browse the repository at this point in the history
* fix: register own crd scheme

Signed-off-by: Yusan Kurban <[email protected]>
  • Loading branch information
yusank authored Dec 19, 2022
1 parent 0178d86 commit 00c6445
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion cmd/app/webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ func (s *setupManager) setupInterrupter() error {
Kind: "ClusterValidatePolicy",
}, interrupter.NewClusterValidatePolicyInterrupter(baseInterrupter, s.tokenManager, s.client, s.cvpLister))

return nil
return s.policyInterrupterManager.OnStartUp()
}

func (s *setupManager) setupOverridePolicyManager() (err error) {
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ go 1.18

require (
github.com/go-logr/logr v1.2.3
github.com/k-cloud-labs/pkg v0.4.1
github.com/k-cloud-labs/pkg v0.4.2
github.com/open-policy-agent/cert-controller v0.3.0
github.com/spf13/cobra v1.4.0
github.com/spf13/pflag v1.0.5
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -323,8 +323,8 @@ github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/X
github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU=
github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w=
github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM=
github.com/k-cloud-labs/pkg v0.4.1 h1:uPbttHdkMBze+F1I9kbrL6EUjbhei0cf4ApN/XRF6iA=
github.com/k-cloud-labs/pkg v0.4.1/go.mod h1:xIgN1grjPSJY7/fKtA+4Q/gWsaVyjmT/AnOagIh2BJM=
github.com/k-cloud-labs/pkg v0.4.2 h1:U8F8wpF06hEabJ1EyKwJ49j146yNixxoWH1ltiKlhlY=
github.com/k-cloud-labs/pkg v0.4.2/go.mod h1:IlPsCdDrC9lTY5eX241KsVvN9FKGMUTm2MEJA1vEQ/I=
github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q=
github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00=
github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=
Expand Down
3 changes: 3 additions & 0 deletions pkg/util/gclient/gclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import (
"k8s.io/client-go/kubernetes/scheme"
"k8s.io/client-go/rest"
"sigs.k8s.io/controller-runtime/pkg/client"

clientsetscheme "github.com/k-cloud-labs/pkg/client/clientset/versioned/scheme"
)

// aggregatedScheme aggregates Kubernetes and extended schemes.
Expand All @@ -13,6 +15,7 @@ var aggregatedScheme = runtime.NewScheme()
func init() {
var _ = scheme.AddToScheme(aggregatedScheme) // add Kubernetes schemes
// add custom crd scheme to aggregatedScheme
var _ = clientsetscheme.AddToScheme(aggregatedScheme)
}

// NewSchema returns a singleton schema set which aggregated Kubernetes's schemes and extended schemes.
Expand Down

0 comments on commit 00c6445

Please sign in to comment.