From 7798ebb8bf0791a56254a611c79cedc73496bd77 Mon Sep 17 00:00:00 2001 From: DeeJay Date: Tue, 24 Sep 2019 19:35:13 +0530 Subject: [PATCH] Fix for b23llc/nifi-stateless-operator#8 --- config/deploy/nifi-stateless-operator.yaml | 4 ++-- config/rbac/role.yaml | 4 ++-- controllers/nififn_controller.go | 5 +++-- controllers/suite_test.go | 3 ++- go.mod | 6 ------ go.sum | 14 -------------- main.go | 5 +++-- 7 files changed, 12 insertions(+), 29 deletions(-) diff --git a/config/deploy/nifi-stateless-operator.yaml b/config/deploy/nifi-stateless-operator.yaml index dac89414..d19a0dc4 100644 --- a/config/deploy/nifi-stateless-operator.yaml +++ b/config/deploy/nifi-stateless-operator.yaml @@ -195,7 +195,7 @@ rules: - patch - update - apiGroups: - - nififns.nififn.nifi-stateless.b23.io + - nififn.nifi-stateless.b23.io resources: - nififns verbs: @@ -207,7 +207,7 @@ rules: - update - watch - apiGroups: - - nififns.nififn.nifi-stateless.b23.io + - nififn.nifi-stateless.b23.io resources: - nififns/status verbs: diff --git a/config/rbac/role.yaml b/config/rbac/role.yaml index 90c1745f..d88cb3f3 100644 --- a/config/rbac/role.yaml +++ b/config/rbac/role.yaml @@ -27,7 +27,7 @@ rules: - patch - update - apiGroups: - - nififns.nififn.nifi-stateless.b23.io + - nififn.nifi-stateless.b23.io resources: - nififns verbs: @@ -39,7 +39,7 @@ rules: - update - watch - apiGroups: - - nififns.nififn.nifi-stateless.b23.io + - nififn.nifi-stateless.b23.io resources: - nififns/status verbs: diff --git a/controllers/nififn_controller.go b/controllers/nififn_controller.go index 20e66af5..eb67f39d 100644 --- a/controllers/nififn_controller.go +++ b/controllers/nififn_controller.go @@ -14,8 +14,8 @@ limitations under the License. */ // Package controllers implements kubernetes controllers for nifi-stateless resources -// +kubebuilder:rbac:groups=nififns.nififn.nifi-stateless.b23.io,resources=nififns,verbs=get;list;watch;create;update;patch;delete -// +kubebuilder:rbac:groups=nififns.nififn.nifi-stateless.b23.io,resources=nififns/status,verbs=get;update;patch +// +kubebuilder:rbac:groups=nififn.nifi-stateless.b23.io,resources=nififns,verbs=get;list;watch;create;update;patch;delete +// +kubebuilder:rbac:groups=nififn.nifi-stateless.b23.io,resources=nififns/status,verbs=get;update;patch // +kubebuilder:rbac:groups=batch,resources=jobs,verbs=get;list;watch;create;update;patch;delete // +kubebuilder:rbac:groups=batch,resources=jobs/status,verbs=get;update;patch package controllers @@ -34,6 +34,7 @@ import ( batchv1 "k8s.io/api/batch/v1" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + nifi "nifi-stateless.b23.io/project/api/v1alpha1" ) diff --git a/controllers/suite_test.go b/controllers/suite_test.go index d2b2ee3d..2bd80e31 100644 --- a/controllers/suite_test.go +++ b/controllers/suite_test.go @@ -24,11 +24,12 @@ import ( "k8s.io/client-go/kubernetes/scheme" "k8s.io/client-go/rest" - nififnv1alpha1 "nifi-stateless.b23.io/project/api/v1alpha1" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/envtest" logf "sigs.k8s.io/controller-runtime/pkg/log" "sigs.k8s.io/controller-runtime/pkg/log/zap" + + nififnv1alpha1 "nifi-stateless.b23.io/project/api/v1alpha1" // +kubebuilder:scaffold:imports ) diff --git a/go.mod b/go.mod index ca69adc9..aa1766e9 100644 --- a/go.mod +++ b/go.mod @@ -3,15 +3,9 @@ module nifi-stateless.b23.io/project go 1.12 require ( - github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 // indirect - github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4 // indirect - github.com/b23llc/nifi-fn-operator v0.0.0-20190822133708-50c24821a1e1 github.com/go-logr/logr v0.1.0 github.com/onsi/ginkgo v1.8.0 github.com/onsi/gomega v1.5.0 - github.com/prometheus/common v0.0.0-20180801064454-c7de2306084e - github.com/sirupsen/logrus v1.4.2 // indirect - gopkg.in/alecthomas/kingpin.v2 v2.2.6 // indirect k8s.io/api v0.0.0-20190409021203-6e4e0e4f393b k8s.io/apimachinery v0.0.0-20190404173353-6a84e37a896d k8s.io/client-go v11.0.1-0.20190409021438-1a26190bd76a+incompatible diff --git a/go.sum b/go.sum index 13bb749e..9cdc5f7b 100644 --- a/go.sum +++ b/go.sum @@ -1,11 +1,5 @@ cloud.google.com/go v0.26.0 h1:e0WKqKTd5BnrG8aKH3J3h+QvEIQtSUcf2n5UZ5ZgLtQ= cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 h1:JYp7IbQjafoB+tBA3gMyHYHrpOtNuDiK/uB5uXxq5wM= -github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= -github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4 h1:Hs82Z41s6SdL1CELW+XaDYmOH4hkBN4/N9og/AsOv7E= -github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= -github.com/b23llc/nifi-fn-operator v0.0.0-20190822133708-50c24821a1e1 h1:GZ2mXKWO3rrENiYAjHNS3a8llsgd6lbMf/2m4XsbIEY= -github.com/b23llc/nifi-fn-operator v0.0.0-20190822133708-50c24821a1e1/go.mod h1:fu81DVy/BRC9KVwVBRKD3fTN2SIRIyHgB4NCgSj8ZFY= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973 h1:xJ4a3vCFaGF/jqvzLMYoU8P317H5OQ+Via4RmuPwCS0= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -49,7 +43,6 @@ github.com/json-iterator/go v1.1.6 h1:MrUvLMLTMxbqFJ9kzlvat/rYZqZnW3u4wkLzWTaFwK github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= @@ -89,8 +82,6 @@ github.com/prometheus/common v0.0.0-20180801064454-c7de2306084e h1:n/3MEhJQjQxrO github.com/prometheus/common v0.0.0-20180801064454-c7de2306084e/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= github.com/prometheus/procfs v0.0.0-20180725123919-05ee40e3a273 h1:agujYaXJSxSo18YNX3jzl+4G6Bstwt+kqv47GS12uL0= github.com/prometheus/procfs v0.0.0-20180725123919-05ee40e3a273/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= -github.com/sirupsen/logrus v1.4.2 h1:SPIRibHv4MatM3XXNO2BJeFLZwZ2LvZgfQ5+UNI2im4= -github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= github.com/spf13/cobra v0.0.3 h1:ZlrZ4XsMRm04Fr5pSFxBgfND2EBVa1nLpiy1stUsX/8= github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= @@ -99,8 +90,6 @@ github.com/spf13/pflag v1.0.2/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnIn github.com/spf13/pflag v1.0.3 h1:zPAT6CGy6wXeQ7NtTnaTerfKOsV6V6F8agHXFiazDkg= github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= go.uber.org/atomic v1.3.2 h1:2Oa65PReHzfn29GpvgsYwloV9AVFHPDk8tYxt2c2tr4= @@ -127,7 +116,6 @@ golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e h1:o3PsSEY8E4eXWkXrIP9YJALUk golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190429190828-d89cdac9e872 h1:cGjJzUd8RgBw428LXP65YXni0aiGNA4Bl+ls8SmLOm8= golang.org/x/sys v0.0.0-20190429190828-d89cdac9e872/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= @@ -144,8 +132,6 @@ gomodules.xyz/jsonpatch/v2 v2.0.1 h1:xyiBuvkD2g5n7cYzx6u2sxQvsAy4QJsZFCzGVdzOXZ0 gomodules.xyz/jsonpatch/v2 v2.0.1/go.mod h1:IhYNNY4jnS53ZnfE4PAmpKtDpTCj1JFXc+3mwe7XcUU= google.golang.org/appengine v1.1.0 h1:igQkv0AAhEIvTEpD5LIpAfav2eeVO9HBTjvKHVJPRSs= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= -gopkg.in/alecthomas/kingpin.v2 v2.2.6 h1:jMFz6MfLP0/4fUyZle81rXUoxOBFi19VUFKVDOQfozc= -gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/main.go b/main.go index a8ffeed6..87d8fc7e 100644 --- a/main.go +++ b/main.go @@ -23,10 +23,11 @@ import ( "k8s.io/apimachinery/pkg/runtime" clientgoscheme "k8s.io/client-go/kubernetes/scheme" _ "k8s.io/client-go/plugin/pkg/client/auth/gcp" - nifi "nifi-stateless.b23.io/project/api/v1alpha1" - "nifi-stateless.b23.io/project/controllers" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/log/zap" + + nifi "nifi-stateless.b23.io/project/api/v1alpha1" + "nifi-stateless.b23.io/project/controllers" // +kubebuilder:scaffold:imports )