Skip to content

Commit

Permalink
fix: unstructure to cvp bug
Browse files Browse the repository at this point in the history
Signed-off-by: kaku <[email protected]>
  • Loading branch information
likakuli committed May 7, 2022
1 parent 28ec5ad commit d7002f6
Show file tree
Hide file tree
Showing 7 changed files with 70 additions and 8 deletions.
2 changes: 1 addition & 1 deletion cmd/app/options/validation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"k8s.io/apimachinery/pkg/util/validation/field"
)

func TestValidateKarmadaWebhookConfiguration(t *testing.T) {
func TestValidateKinitirasWebhookConfiguration(t *testing.T) {
successCases := []Options{
{
BindAddress: "127.0.0.1",
Expand Down
3 changes: 2 additions & 1 deletion cmd/app/webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import (

"github.com/k-cloud-labs/kinitiras/cmd/app/options"
"github.com/k-cloud-labs/kinitiras/pkg/controller/cert"
"github.com/k-cloud-labs/kinitiras/pkg/lister"
"github.com/k-cloud-labs/kinitiras/pkg/util/gclient"
"github.com/k-cloud-labs/kinitiras/pkg/version"
"github.com/k-cloud-labs/kinitiras/pkg/version/sharedcommand"
Expand Down Expand Up @@ -190,5 +191,5 @@ func setupValidatePolicyManager(informerManager informermanager.SingleClusterInf
return nil, errors.New("failed to sync validate policy.")
}

return validatemanager.NewValidateManager(v1alpha1.NewClusterValidatePolicyLister(cvpInformer.GetIndexer())), nil
return validatemanager.NewValidateManager(lister.NewUnstructuredClusterValidatePolicyLister(cvpInformer.GetIndexer())), nil
}
2 changes: 1 addition & 1 deletion deploy/webhook-configuration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ metadata:
name: kinitiras-webhook
namespace: kinitiras-system
webhooks:
- name: webhook.karmada.io
- name: webhook.kinitiras.io
objectSelector:
matchLabels:
kinitiras.kcloudlabs.io/webhook: enabled
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ go 1.17

require (
github.com/go-logr/logr v1.2.3
github.com/k-cloud-labs/pkg v0.1.1-0.20220505083702-9a3b5b0a4254
github.com/k-cloud-labs/pkg v0.1.1-0.20220507021146-ec69e63bbffc
github.com/open-policy-agent/cert-controller v0.3.0
github.com/spf13/cobra v1.4.0
github.com/spf13/pflag v1.0.5
golang.org/x/term v0.0.0-20210615171337-6886f2dfbf5b
k8s.io/api v0.23.6
k8s.io/apimachinery v0.23.6
k8s.io/apiserver v0.23.6
Expand Down Expand Up @@ -82,7 +83,6 @@ require (
golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f // indirect
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c // indirect
golang.org/x/sys v0.0.0-20211029165221-6e7872819dc8 // indirect
golang.org/x/term v0.0.0-20210615171337-6886f2dfbf5b // indirect
golang.org/x/text v0.3.7 // indirect
golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac // indirect
gomodules.xyz/jsonpatch/v2 v2.2.0 // indirect
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -329,8 +329,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.1.1-0.20220505083702-9a3b5b0a4254 h1:uf/cGz2Ei41ElFcQX15g5EG1XybMeu4LU0ZlvEGLZSk=
github.com/k-cloud-labs/pkg v0.1.1-0.20220505083702-9a3b5b0a4254/go.mod h1:+5RsSMC7VOdDXdRLwTBZzcY8W931ETI4r4DBqUSBnCk=
github.com/k-cloud-labs/pkg v0.1.1-0.20220507021146-ec69e63bbffc h1:9vkWf/nfLbe9aqXucKWoQCuppGZggs6jxVOBLu28czk=
github.com/k-cloud-labs/pkg v0.1.1-0.20220507021146-ec69e63bbffc/go.mod h1:+5RsSMC7VOdDXdRLwTBZzcY8W931ETI4r4DBqUSBnCk=
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
61 changes: 61 additions & 0 deletions pkg/lister/validatepolicylister.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pkg/version/base.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package version
// Base version information.
//
// This is the fallback data used when version information from git is not
// provided via go ldflags. It provides an approximation of the Karmada
// provided via go ldflags. It provides an approximation of the kinitiras
// version for ad-hoc builds (e.g. `go build`) that cannot get the version
// information from git.
var (
Expand Down

0 comments on commit d7002f6

Please sign in to comment.