Skip to content

Commit

Permalink
Merge pull request #15 from ibuildthecloud/master
Browse files Browse the repository at this point in the history
Switch to wrangler-api
  • Loading branch information
ibuildthecloud authored May 26, 2019
2 parents 2c65887 + 9cd424e commit 4f3b43b
Show file tree
Hide file tree
Showing 183 changed files with 13,914 additions and 10,182 deletions.
3 changes: 2 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ module github.com/rancher/helm-controller
go 1.12

require (
github.com/rancher/wrangler v0.0.0-20190509213517-cd48b2f2b218
github.com/rancher/wrangler v0.1.3
github.com/rancher/wrangler-api v0.1.3
github.com/sirupsen/logrus v1.4.1
github.com/stretchr/testify v1.3.0
github.com/urfave/cli v1.20.0
Expand Down
23 changes: 23 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ github.com/golang/protobuf v1.3.1 h1:YF8+flBXS5eO826T4nzqPrxfhQThhXl0YzfuUPu4SBg
github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/google/btree v1.0.0 h1:0udJVsspx3VBr5FwtLhQQtuAsVc79tTq0ocGIPAU6qo=
github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
github.com/google/gofuzz v0.0.0-20161122191042-44d81051d367/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI=
github.com/google/gofuzz v1.0.0 h1:A8PeW59pxE9IoFRqBp37U+mSNaQoZ46F1f0f863XSXw=
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
Expand All @@ -48,14 +49,18 @@ github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI=
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
github.com/imdario/mergo v0.3.7 h1:Y+UAYTZ7gDEuOfhxKWy+dvb5dRQ6rJjFSdX2HZY1/gI=
github.com/imdario/mergo v0.3.7/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA=
github.com/jetstack/cert-manager v0.7.2/go.mod h1:nbddmhjWxYGt04bxvwVGUSeLhZ2PCyNvd7MpXdq+yWY=
github.com/json-iterator/go v0.0.0-20180612202835-f2b4162afba3/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
github.com/json-iterator/go v1.1.6 h1:MrUvLMLTMxbqFJ9kzlvat/rYZqZnW3u4wkLzWTaFwKs=
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/knative/build v0.6.0/go.mod h1:/sU74ZQkwlYA5FwYDJhYTy61i/Kn+5eWfln2jDbw3Qo=
github.com/knative/pkg v0.0.0-20190514205332-5e4512dcb2ca/go.mod h1:7Ijfhw7rfB+H9VtosIsDYvZQ+qYTz7auK3fHW/5z4ww=
github.com/konsorten/go-windows-terminal-sequences v1.0.1 h1:mweAR1A6xJ3oS2pRaGiHgQ4OO8tzTaLawm8vnODuwDk=
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
github.com/mailru/easyjson v0.0.0-20160728113105-d5b7844b561a/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
github.com/mattbaird/jsonpatch v0.0.0-20171005235357-81af80346b1a/go.mod h1:M1qoD/MqPgTZIk0EWKB38wE28ACRfVcn+cU08jyArI0=
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg=
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/reflect2 v0.0.0-20180320133207-05fbef0ca5da/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
Expand Down Expand Up @@ -83,10 +88,26 @@ github.com/rancher/wrangler v0.0.0-20190508234038-148d437b510d h1:a7LRgBKNx8USp1
github.com/rancher/wrangler v0.0.0-20190508234038-148d437b510d/go.mod h1:snD4YYjLOsxOwXNQORUkKr0y2TOVk54yWjgZ7myL8es=
github.com/rancher/wrangler v0.0.0-20190509213517-cd48b2f2b218 h1:4oOkdVjB8JlNX/89BwMX/tq8h+N31C0egp2XrLfj/nI=
github.com/rancher/wrangler v0.0.0-20190509213517-cd48b2f2b218/go.mod h1:MJVnlQzIsxIt65C9TkmqpYB9mjJW812s2jPNjxYPHNA=
github.com/rancher/wrangler v0.0.0-20190516181950-a7cf48fa83ef/go.mod h1:EYP7cqpg42YqElaCm+U9ieSrGQKAXxUH5xsr+XGpWyE=
github.com/rancher/wrangler v0.1.0 h1:AIvfe1KLVbj7vsp/pWXeBrjxqP7hHZHHECxsniTC78M=
github.com/rancher/wrangler v0.1.0/go.mod h1:EYP7cqpg42YqElaCm+U9ieSrGQKAXxUH5xsr+XGpWyE=
github.com/rancher/wrangler v0.1.1 h1:Xz0i5RtpWaqV/83xisxESOBIjf3JnsPExukR+3fiD8M=
github.com/rancher/wrangler v0.1.1/go.mod h1:EYP7cqpg42YqElaCm+U9ieSrGQKAXxUH5xsr+XGpWyE=
github.com/rancher/wrangler v0.1.2 h1:+oehkcBDInF6dcnG1ZWczL/tV/c7J8ILP3qEFCme7lw=
github.com/rancher/wrangler v0.1.2/go.mod h1:EYP7cqpg42YqElaCm+U9ieSrGQKAXxUH5xsr+XGpWyE=
github.com/rancher/wrangler v0.1.3 h1:WVMLj7kxTOx2pQyAnUKbbFhuFqhAuzkrsSvk37VaYwY=
github.com/rancher/wrangler v0.1.3/go.mod h1:EYP7cqpg42YqElaCm+U9ieSrGQKAXxUH5xsr+XGpWyE=
github.com/rancher/wrangler-api v0.1.1 h1:qzIgDnURHTlJ31jMTy917L3y0tAjYRaHhMdmT+Z393s=
github.com/rancher/wrangler-api v0.1.1/go.mod h1:vholckBg588JqP3M3vyEDUz/ERaB1M3ilnCuV5XxPHM=
github.com/rancher/wrangler-api v0.1.2 h1:PKWfgxQKNG5v2R7Uo+NYWk6wRXShV55WymiKAFk9eIU=
github.com/rancher/wrangler-api v0.1.2/go.mod h1:zD0Xy4pu2mTUE9pabkOwdzhwms8Yl9AGvDJzGW260Wk=
github.com/rancher/wrangler-api v0.1.3 h1:W6FPEb9cGRNpidiw6S5mu+C6iZ4Ji+wBobjybPOdxQo=
github.com/rancher/wrangler-api v0.1.3/go.mod h1:KPJcBpKwfzsfBL8BO+3fU17NBw8bAk3DUVnHIwE8BGE=
github.com/remyoudompheng/bigfft v0.0.0-20170806203942-52369c62f446/go.mod h1:uYEyJGbgTkfkS4+E/PavXkNJcbFIpEtjt2B0KDQ5+9M=
github.com/sirupsen/logrus v1.4.1 h1:GL2rEmy6nsikmW0r8opw9JIRScdMF5hA8cOYLH7In1k=
github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q=
github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk=
github.com/spf13/pflag v0.0.0-20170130214245-9ff6c6923cff h1:VARhShG49tiji6mdRNp7JTNDtJ0FhuprF93GBQ37xGU=
github.com/spf13/pflag v0.0.0-20170130214245-9ff6c6923cff/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
github.com/spf13/pflag v1.0.1 h1:aCvUg6QPl3ibpQUxyLkrEkCHtPqYJL4x9AuhqVqFis4=
github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
Expand Down Expand Up @@ -178,6 +199,8 @@ k8s.io/client-go v11.0.1-0.20190409021438-1a26190bd76a+incompatible h1:U5Bt+dab9
k8s.io/client-go v11.0.1-0.20190409021438-1a26190bd76a+incompatible/go.mod h1:7vJpHMYJwNQCWgzmNV+VYUl1zCObLyodBc8nIyt8L5s=
k8s.io/code-generator v0.0.0-20181117043124-c2090bec4d9b h1:KH0fUlgdFZH8UMxJ/FDCYHpczfSQKefetq5NjL6BVF0=
k8s.io/code-generator v0.0.0-20181117043124-c2090bec4d9b/go.mod h1:MYiN+ZJZ9HkETbgVZdWw2AsuAi9PZ4V80cwfuf2axe8=
k8s.io/code-generator v0.0.0-20190311093542-50b561225d70 h1:lgPp615xLHxN84RBd+viA/oHzJfI0miFYFH4T9wpPQ4=
k8s.io/code-generator v0.0.0-20190311093542-50b561225d70/go.mod h1:MYiN+ZJZ9HkETbgVZdWw2AsuAi9PZ4V80cwfuf2axe8=
k8s.io/code-generator v0.0.0-20190419212335-ff26e7842f9d h1:QY1FeareEgkYrWnF2D2XxZFlF0k5Ir4uE8YjD1kHi94=
k8s.io/code-generator v0.0.0-20190419212335-ff26e7842f9d/go.mod h1:rVrFWfTVftGH7bb972nWC6N4QkJ4LU7FOXu8GH2UkJo=
k8s.io/gengo v0.0.0-20190116091435-f8a0810f38af/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0=
Expand Down
10 changes: 5 additions & 5 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ import (
"context"
"os"

batchv1 "github.com/rancher/helm-controller/pkg/generated/controllers/batch"
corev1 "github.com/rancher/helm-controller/pkg/generated/controllers/core"
helmv1 "github.com/rancher/helm-controller/pkg/generated/controllers/k3s.cattle.io"
rbacv1 "github.com/rancher/helm-controller/pkg/generated/controllers/rbac"
helmv1 "github.com/rancher/helm-controller/pkg/generated/controllers/helm.cattle.io"
helmcontroller "github.com/rancher/helm-controller/pkg/helm"
batchv1 "github.com/rancher/wrangler-api/pkg/generated/controllers/batch"
corev1 "github.com/rancher/wrangler-api/pkg/generated/controllers/core"
rbacv1 "github.com/rancher/wrangler-api/pkg/generated/controllers/rbac"
"github.com/rancher/wrangler/pkg/apply"
"github.com/rancher/wrangler/pkg/signals"
"github.com/rancher/wrangler/pkg/start"
Expand Down Expand Up @@ -118,7 +118,7 @@ func run(c *cli.Context) error {
objectSetApply := apply.New(discoverClient, apply.NewClientFactory(cfg))

helmcontroller.Register(ctx, objectSetApply,
helms.K3s().V1().HelmChart(),
helms.Helm().V1().HelmChart(),
batches.Batch().V1().Job(),
rbacs.Rbac().V1().ClusterRoleBinding(),
cores.Core().V1().ServiceAccount())
Expand Down
4 changes: 2 additions & 2 deletions manifests/crd.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: helmcharts.k3s.cattle.io
name: helmcharts.helm.cattle.io
namespace: kube-system
spec:
group: k3s.cattle.io
group: helm.cattle.io
version: v1
names:
kind: HelmChart
Expand Down
4 changes: 2 additions & 2 deletions manifests/deploy-cluster-scoped.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: helmcharts.k3s.cattle.io
name: helmcharts.helm.cattle.io
namespace: kube-system
spec:
group: k3s.cattle.io
group: helm.cattle.io
version: v1
names:
kind: HelmChart
Expand Down
6 changes: 3 additions & 3 deletions manifests/deploy-namespaced.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ metadata:
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: helmcharts.k3s.cattle.io
name: helmcharts.helm.cattle.io
namespace: helm-controller
spec:
group: k3s.cattle.io
group: helm.cattle.io
version: v1
names:
kind: HelmChart
Expand Down Expand Up @@ -40,4 +40,4 @@ spec:
- name: helm-controller
image: rancher/helm-controller:v0.1.2
command: ["helm-controller"]
args: ["--namespace", "helm-controller"]
args: ["--namespace", "helm-controller"]
2 changes: 1 addition & 1 deletion manifests/example-helmchart.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: k3s.cattle.io/v1
apiVersion: helm.cattle.io/v1
kind: HelmChart
metadata:
name: traefik
Expand Down

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

File renamed without changes.

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

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

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

33 changes: 3 additions & 30 deletions pkg/codegen/main.go
Original file line number Diff line number Diff line change
@@ -1,49 +1,22 @@
package main

import (
v1 "github.com/rancher/helm-controller/pkg/apis/k3s.cattle.io/v1"
controllergen "github.com/rancher/wrangler/pkg/controller-gen"
"github.com/rancher/helm-controller/pkg/apis/helm.cattle.io/v1"
"github.com/rancher/wrangler/pkg/controller-gen"
"github.com/rancher/wrangler/pkg/controller-gen/args"
batch "k8s.io/api/batch/v1"
core "k8s.io/api/core/v1"
rbac "k8s.io/api/rbac/v1"
)

func main() {
controllergen.Run(args.Options{
OutputPackage: "github.com/rancher/helm-controller/pkg/generated",
Boilerplate: "hack/boilerplate.go.txt",
Groups: map[string]args.Group{
"k3s.cattle.io": {
"helm.cattle.io": {
Types: []interface{}{
v1.HelmChart{},
},
GenerateTypes: true,
},
"batch": {
Types: []interface{}{
batch.Job{},
},
InformersPackage: "k8s.io/client-go/informers",
ClientSetPackage: "k8s.io/client-go/kubernetes",
ListersPackage: "k8s.io/client-go/listers",
},
"rbac": {
Types: []interface{}{
rbac.ClusterRoleBinding{},
},
InformersPackage: "k8s.io/client-go/informers",
ClientSetPackage: "k8s.io/client-go/kubernetes",
ListersPackage: "k8s.io/client-go/listers",
},
"core": {
Types: []interface{}{
core.ServiceAccount{},
},
InformersPackage: "k8s.io/client-go/informers",
ClientSetPackage: "k8s.io/client-go/kubernetes",
ListersPackage: "k8s.io/client-go/listers",
},
},
})
}
26 changes: 9 additions & 17 deletions pkg/generated/clientset/versioned/clientset.go

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

15 changes: 5 additions & 10 deletions pkg/generated/clientset/versioned/fake/clientset_generated.go

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

4 changes: 2 additions & 2 deletions pkg/generated/clientset/versioned/fake/register.go

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

4 changes: 2 additions & 2 deletions pkg/generated/clientset/versioned/scheme/register.go

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

Loading

0 comments on commit 4f3b43b

Please sign in to comment.