From e22c54c84ce9e4ae158d8d681c65f2fc0e6dc171 Mon Sep 17 00:00:00 2001 From: Darren Shepherd Date: Fri, 17 May 2019 12:04:22 -0700 Subject: [PATCH 1/3] Add info and move publicdomain to admin group --- cli/cmd/edit/raw_edit.go | 2 +- cli/cmd/publicdomain/add.go | 6 +- cli/cmd/tui/tui.go | 5 +- cli/pkg/clicontext/types.go | 31 +- modules/istio/controllers/istio/controller.go | 17 +- .../controllers/istio/populate/gateway.go | 5 +- .../istio/controllers/service/controller.go | 8 +- modules/service/controllers/info/info.go | 32 + .../publicdomain/populate/ingress.go | 4 +- .../controllers/publicdomain/publicdomain.go | 14 +- .../service/controllers/service/controller.go | 4 + .../populate/podcontrollers/controllers.go | 8 +- .../populate/podcontrollers/deployment.go | 8 +- modules/service/features/feature.go | 5 +- .../controllers/issuer/controller.go | 11 +- .../controllers/publicdomain/controller.go | 21 +- pkg/apis/admin.rio.cattle.io/v1/info.go | 29 + .../v1/publicdomain.go | 0 .../v1/zz_generated_deepcopy.go | 180 +++ .../v1/zz_generated_list_types.go | 34 + .../v1/zz_generated_register.go | 4 + .../v1/{stack.go => question.go} | 0 pkg/apis/rio.cattle.io/v1/service_types.go | 8 +- .../rio.cattle.io/v1/zz_generated_deepcopy.go | 109 +- .../v1/zz_generated_list_types.go | 17 - .../rio.cattle.io/v1/zz_generated_register.go | 2 - pkg/codegen/main.go | 9 +- .../v1/admin.rio.cattle.io_client.go | 10 + .../fake/fake_admin.rio.cattle.io_client.go | 8 + .../v1/fake/fake_publicdomain.go | 50 +- .../v1/fake/fake_rioinfo.go | 131 ++ .../v1/generated_expansion.go | 4 + .../v1/publicdomain.go | 4 +- .../typed/admin.rio.cattle.io/v1/rioinfo.go | 180 +++ .../v1/fake/fake_rio.cattle.io_client.go | 4 - .../rio.cattle.io/v1/generated_expansion.go | 2 - .../rio.cattle.io/v1/rio.cattle.io_client.go | 5 - .../fakes/zz_generated_public_domain_mock.go | 4 +- .../v1/fakes/zz_generated_rio_info_mock.go | 1433 +++++++++++++++++ .../admin.rio.cattle.io/v1/interface.go | 8 + .../v1/publicdomain.go | 8 +- .../admin.rio.cattle.io/v1/rioinfo.go | 242 +++ .../controllers/rio.cattle.io/v1/interface.go | 4 - .../admin.rio.cattle.io/v1/interface.go | 14 + .../v1/publicdomain.go | 12 +- .../admin.rio.cattle.io/v1/rioinfo.go | 88 + .../informers/externalversions/generic.go | 6 +- .../rio.cattle.io/v1/interface.go | 7 - .../v1/expansion_generated.go | 12 + .../v1/publicdomain.go | 2 +- .../listers/admin.rio.cattle.io/v1/rioinfo.go | 65 + .../rio.cattle.io/v1/expansion_generated.go | 8 - pkg/server/startup.go | 40 +- 53 files changed, 2628 insertions(+), 296 deletions(-) create mode 100644 modules/service/controllers/info/info.go create mode 100644 pkg/apis/admin.rio.cattle.io/v1/info.go rename pkg/apis/{rio.cattle.io => admin.rio.cattle.io}/v1/publicdomain.go (100%) rename pkg/apis/rio.cattle.io/v1/{stack.go => question.go} (100%) rename pkg/generated/clientset/versioned/typed/{rio.cattle.io => admin.rio.cattle.io}/v1/fake/fake_publicdomain.go (66%) create mode 100644 pkg/generated/clientset/versioned/typed/admin.rio.cattle.io/v1/fake/fake_rioinfo.go rename pkg/generated/clientset/versioned/typed/{rio.cattle.io => admin.rio.cattle.io}/v1/publicdomain.go (97%) create mode 100644 pkg/generated/clientset/versioned/typed/admin.rio.cattle.io/v1/rioinfo.go rename pkg/generated/controllers/{rio.cattle.io => admin.rio.cattle.io}/v1/fakes/zz_generated_public_domain_mock.go (99%) create mode 100644 pkg/generated/controllers/admin.rio.cattle.io/v1/fakes/zz_generated_rio_info_mock.go rename pkg/generated/controllers/{rio.cattle.io => admin.rio.cattle.io}/v1/publicdomain.go (97%) create mode 100644 pkg/generated/controllers/admin.rio.cattle.io/v1/rioinfo.go rename pkg/generated/informers/externalversions/{rio.cattle.io => admin.rio.cattle.io}/v1/publicdomain.go (88%) create mode 100644 pkg/generated/informers/externalversions/admin.rio.cattle.io/v1/rioinfo.go rename pkg/generated/listers/{rio.cattle.io => admin.rio.cattle.io}/v1/publicdomain.go (98%) create mode 100644 pkg/generated/listers/admin.rio.cattle.io/v1/rioinfo.go diff --git a/cli/cmd/edit/raw_edit.go b/cli/cmd/edit/raw_edit.go index 22b4e155c..2c23868d6 100644 --- a/cli/cmd/edit/raw_edit.go +++ b/cli/cmd/edit/raw_edit.go @@ -70,7 +70,7 @@ func convertRuntime(t string) runtime.Object { case types.ConfigType: return &corev1.ConfigMap{} case types.PublicDomainType: - return &riov1.PublicDomain{} + return &projectv1.PublicDomain{} case types.RouterType: return &riov1.Router{} case types.FeatureType: diff --git a/cli/cmd/publicdomain/add.go b/cli/cmd/publicdomain/add.go index c5fc1cc38..ca5cc4f6b 100644 --- a/cli/cmd/publicdomain/add.go +++ b/cli/cmd/publicdomain/add.go @@ -4,7 +4,7 @@ import ( "github.com/pkg/errors" "github.com/rancher/rio/cli/pkg/clicontext" "github.com/rancher/rio/cli/pkg/stack" - riov1 "github.com/rancher/rio/pkg/apis/rio.cattle.io/v1" + adminv1 "github.com/rancher/rio/pkg/apis/admin.rio.cattle.io/v1" name2 "github.com/rancher/rio/pkg/name" ) @@ -20,8 +20,8 @@ func (a *Add) Run(ctx *clicontext.CLIContext) error { namespace, name := stack.NamespaceAndName(ctx, target) - return ctx.Create(riov1.NewPublicDomain(namespace, name2.PublicDomain(domainName), riov1.PublicDomain{ - Spec: riov1.PublicDomainSpec{ + return ctx.Create(adminv1.NewPublicDomain(namespace, name2.PublicDomain(domainName), adminv1.PublicDomain{ + Spec: adminv1.PublicDomainSpec{ DomainName: domainName, TargetServiceName: name, }, diff --git a/cli/cmd/tui/tui.go b/cli/cmd/tui/tui.go index 42f46453c..54ea9666a 100644 --- a/cli/cmd/tui/tui.go +++ b/cli/cmd/tui/tui.go @@ -5,6 +5,7 @@ import ( "github.com/rancher/axe/throwing" "github.com/rancher/rio/cli/pkg/clicontext" + adminv1 "github.com/rancher/rio/pkg/apis/admin.rio.cattle.io/v1" riov1 "github.com/rancher/rio/pkg/apis/rio.cattle.io/v1" "github.com/rancher/rio/types" "github.com/rancher/wrangler/pkg/leader" @@ -50,7 +51,7 @@ func register(ctx context.Context, rioContext *types.Context, h *handler) { rioContext.Rio.Rio().V1().App().AddGenericHandler(ctx, "rio-app-tui", h.syncObject) rioContext.Rio.Rio().V1().Service().AddGenericHandler(ctx, "rio-service-tui", h.syncObject) rioContext.Rio.Rio().V1().Router().AddGenericHandler(ctx, "rio-router-tui", h.syncObject) - rioContext.Rio.Rio().V1().PublicDomain().AddGenericHandler(ctx, "rio-domain-tui", h.syncObject) + rioContext.Global.Admin().V1().PublicDomain().AddGenericHandler(ctx, "rio-domain-tui", h.syncObject) rioContext.Rio.Rio().V1().ExternalService().AddGenericHandler(ctx, "rio-external-tui", h.syncObject) } @@ -80,7 +81,7 @@ func (h handler) syncObject(k string, object runtime.Object) (runtime.Object, er go func() { s <- struct{}{} }() - case *riov1.PublicDomain: + case *adminv1.PublicDomain: s := h.signals[publicdomainKind] go func() { s <- struct{}{} diff --git a/cli/pkg/clicontext/types.go b/cli/pkg/clicontext/types.go index 72d282790..5bd34cb05 100644 --- a/cli/pkg/clicontext/types.go +++ b/cli/pkg/clicontext/types.go @@ -9,20 +9,17 @@ import ( "sync" "time" - "k8s.io/apimachinery/pkg/api/errors" - - multierror "github.com/hashicorp/go-multierror" - - "github.com/rancher/wrangler/pkg/kv" - "github.com/docker/docker/pkg/namesgenerator" "github.com/rancher/rio/cli/pkg/lookup" "github.com/rancher/rio/cli/pkg/types" clitypes "github.com/rancher/rio/cli/pkg/types" projectv1 "github.com/rancher/rio/pkg/apis/admin.rio.cattle.io/v1" riov1 "github.com/rancher/rio/pkg/apis/rio.cattle.io/v1" + "github.com/rancher/wrangler/pkg/kv" + "github.com/rancher/wrangler/pkg/merr" "golang.org/x/sync/errgroup" corev1 "k8s.io/api/core/v1" + "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/api/meta" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/labels" @@ -88,7 +85,7 @@ func (c *CLIContext) getResource(r types.Resource) (ret types.Resource, err erro case clitypes.ExternalServiceType: r.Object, err = c.Rio.ExternalServices(r.Namespace).Get(r.Name, metav1.GetOptions{}) case clitypes.PublicDomainType: - r.Object, err = c.Rio.PublicDomains(r.Namespace).Get(r.Name, metav1.GetOptions{}) + r.Object, err = c.Project.PublicDomains(r.Namespace).Get(r.Name, metav1.GetOptions{}) case clitypes.NamespaceType: r.Object, err = c.Core.Namespaces().Get(r.Name, metav1.GetOptions{}) case clitypes.FeatureType: @@ -115,23 +112,23 @@ func (c *CLIContext) DeleteResource(r types.Resource) (err error) { case clitypes.ExternalServiceType: err = c.Rio.ExternalServices(r.Namespace).Delete(r.Name, &metav1.DeleteOptions{}) case clitypes.PublicDomainType: - err = c.Rio.PublicDomains(r.Namespace).Delete(r.Name, &metav1.DeleteOptions{}) + err = c.Project.PublicDomains(r.Namespace).Delete(r.Name, &metav1.DeleteOptions{}) case clitypes.BuildType: err = c.Build.Builds(r.Namespace).Delete(r.Name, &metav1.DeleteOptions{}) case clitypes.AppType: app := r.Object.(*riov1.App) - var errs multierror.Error + var errs []error for _, rev := range app.Spec.Revisions { newerr := c.Rio.Services(r.Namespace).Delete(rev.ServiceName, &metav1.DeleteOptions{}) if newerr != nil && !errors.IsNotFound(err) { - errs.Errors = append(errs.Errors, newerr) + errs = append(errs, newerr) } } newerr := c.Rio.Apps(r.Namespace).Delete(r.Name, &metav1.DeleteOptions{}) if newerr != nil { - errs.Errors = append(errs.Errors, newerr) + errs = append(errs, newerr) } - err = errs.ErrorOrNil() + err = merr.NewErrors(errs...) default: return fmt.Errorf("unknown delete type %s", r.Type) } @@ -160,8 +157,8 @@ func (c *CLIContext) Create(obj runtime.Object) (err error) { _, err = c.Rio.Routers(o.Namespace).Create(o) case *riov1.ExternalService: _, err = c.Rio.ExternalServices(o.Namespace).Create(o) - case *riov1.PublicDomain: - _, err = c.Rio.PublicDomains(o.Namespace).Create(o) + case *projectv1.PublicDomain: + _, err = c.Project.PublicDomains(o.Namespace).Create(o) default: return fmt.Errorf("unknown delete type %v", reflect.TypeOf(obj)) } @@ -182,8 +179,8 @@ func (c *CLIContext) UpdateObject(obj runtime.Object) (err error) { _, err = c.Rio.ExternalServices(o.Namespace).Update(o) case *projectv1.Feature: _, err = c.Project.Features(o.Namespace).Update(o) - case *riov1.PublicDomain: - _, err = c.Rio.PublicDomains(o.Namespace).Update(o) + case *projectv1.PublicDomain: + _, err = c.Project.PublicDomains(o.Namespace).Update(o) default: return fmt.Errorf("unknown delete type %v", reflect.TypeOf(obj)) } @@ -322,7 +319,7 @@ func (c *CLIContext) listNamespace(namespace, typeName string) (ret []runtime.Ob } return ret, err case clitypes.PublicDomainType: - objs, err := c.Rio.PublicDomains(namespace).List(opts) + objs, err := c.Project.PublicDomains(namespace).List(opts) for i := range objs.Items { ret = append(ret, &objs.Items[i]) } diff --git a/modules/istio/controllers/istio/controller.go b/modules/istio/controllers/istio/controller.go index a80a3e247..6fb4f0dd0 100644 --- a/modules/istio/controllers/istio/controller.go +++ b/modules/istio/controllers/istio/controller.go @@ -8,9 +8,8 @@ import ( "github.com/rancher/rio/modules/istio/controllers/istio/populate" "github.com/rancher/rio/modules/istio/pkg/istio/config" adminv1 "github.com/rancher/rio/pkg/apis/admin.rio.cattle.io/v1" - riov1 "github.com/rancher/rio/pkg/apis/rio.cattle.io/v1" "github.com/rancher/rio/pkg/constants" - projectv1controller "github.com/rancher/rio/pkg/generated/controllers/admin.rio.cattle.io/v1" + adminv1controller "github.com/rancher/rio/pkg/generated/controllers/admin.rio.cattle.io/v1" riov1controller "github.com/rancher/rio/pkg/generated/controllers/rio.cattle.io/v1" "github.com/rancher/rio/types" appsv1controller "github.com/rancher/wrangler-api/pkg/generated/controllers/apps/v1" @@ -67,7 +66,7 @@ func Register(ctx context.Context, rContext *types.Context) error { serviceApply: rContext.Apply.WithSetID(istioInjector).WithInjectorName(istioInjector), apps: rContext.Rio.Rio().V1().App(), services: rContext.Rio.Rio().V1().Service(), - publicDomainCache: rContext.Rio.Rio().V1().PublicDomain().Cache(), + publicDomainCache: rContext.Global.Admin().V1().PublicDomain().Cache(), clusterDomain: rContext.Global.Admin().V1().ClusterDomain(), secretCache: rContext.Core.Core().V1().Secret().Cache(), nodeCache: rContext.Core.Core().V1().Node().Cache(), @@ -85,7 +84,7 @@ func Register(ctx context.Context, rContext *types.Context) error { relatedresource.Watch(ctx, "cluster-domain-service", s.resolve, rContext.Global.Admin().V1().ClusterDomain(), - rContext.Rio.Rio().V1().PublicDomain()) + rContext.Global.Admin().V1().PublicDomain()) relatedresource.Watch(ctx, "node-enpoint", s.resolveEndpoint, rContext.Core.Core().V1().Endpoints(), @@ -113,8 +112,8 @@ type istioDeployController struct { serviceApply apply.Apply apps riov1controller.AppController services riov1controller.ServiceController - publicDomainCache riov1controller.PublicDomainCache - clusterDomain projectv1controller.ClusterDomainController + publicDomainCache adminv1controller.PublicDomainCache + clusterDomain adminv1controller.ClusterDomainController secretCache corev1controller.SecretCache nodeCache corev1controller.NodeCache endpointCache corev1controller.EndpointsCache @@ -140,7 +139,7 @@ func (i *istioDeployController) updateDaemonSets() error { } deepcopy := svc.DeepCopy() - deepcopy.Spec.SystemSpec.PodSpec.NodeSelector = map[string]string{ + deepcopy.SystemSpec.PodSpec.NodeSelector = map[string]string{ nodeSelectorLabel: "true", } if _, err := i.services.Update(deepcopy); err != nil { @@ -215,7 +214,7 @@ func (i *istioDeployController) resolve(namespace, name string, obj runtime.Obje }) } return keys, nil - case *riov1.PublicDomain: + case *adminv1.PublicDomain: return []relatedresource.Key{ { Name: constants.ClusterDomainName, @@ -412,7 +411,7 @@ func setupConfigmapAndInjectors(ctx context.Context, rContext *types.Context) er return nil } -func ensureClusterDomain(ns string, clusterDomain projectv1controller.ClusterDomainClient) error { +func ensureClusterDomain(ns string, clusterDomain adminv1controller.ClusterDomainClient) error { _, err := clusterDomain.Get(ns, constants.ClusterDomainName, metav1.GetOptions{}) if errors.IsNotFound(err) { _, err := clusterDomain.Create(adminv1.NewClusterDomain(ns, constants.ClusterDomainName, adminv1.ClusterDomain{ diff --git a/modules/istio/controllers/istio/populate/gateway.go b/modules/istio/controllers/istio/populate/gateway.go index 1a8a58dde..82e67b7e9 100644 --- a/modules/istio/controllers/istio/populate/gateway.go +++ b/modules/istio/controllers/istio/populate/gateway.go @@ -5,9 +5,10 @@ import ( "strconv" "strings" + "github.com/rancher/rio/pkg/apis/admin.rio.cattle.io/v1" + "github.com/knative/pkg/apis/istio/v1alpha3" "github.com/rancher/rio/modules/system/features/letsencrypt/pkg/issuers" - riov1 "github.com/rancher/rio/pkg/apis/rio.cattle.io/v1" "github.com/rancher/rio/pkg/constants" "github.com/rancher/rio/pkg/constructors" "github.com/rancher/wrangler/pkg/objectset" @@ -22,7 +23,7 @@ var ( } ) -func Gateway(systemNamespace string, clusterDomain string, publicdomains []*riov1.PublicDomain, output *objectset.ObjectSet) { +func Gateway(systemNamespace string, clusterDomain string, publicdomains []*v1.PublicDomain, output *objectset.ObjectSet) { // Istio Gateway gws := v1alpha3.GatewaySpec{ Selector: map[string]string{ diff --git a/modules/istio/controllers/service/controller.go b/modules/istio/controllers/service/controller.go index 1739d7590..6693e9a7d 100644 --- a/modules/istio/controllers/service/controller.go +++ b/modules/istio/controllers/service/controller.go @@ -9,7 +9,7 @@ import ( adminv1 "github.com/rancher/rio/pkg/apis/admin.rio.cattle.io/v1" riov1 "github.com/rancher/rio/pkg/apis/rio.cattle.io/v1" "github.com/rancher/rio/pkg/constants" - projectv1controller "github.com/rancher/rio/pkg/generated/controllers/admin.rio.cattle.io/v1" + adminv1controller "github.com/rancher/rio/pkg/generated/controllers/admin.rio.cattle.io/v1" riov1controller "github.com/rancher/rio/pkg/generated/controllers/rio.cattle.io/v1" v1 "github.com/rancher/rio/pkg/generated/controllers/rio.cattle.io/v1" services2 "github.com/rancher/rio/pkg/services" @@ -40,7 +40,7 @@ func Register(ctx context.Context, rContext *types.Context) error { secretCache: rContext.Core.Core().V1().Secret().Cache(), externalServiceCache: rContext.Rio.Rio().V1().ExternalService().Cache(), clusterDomainCache: rContext.Global.Admin().V1().ClusterDomain().Cache(), - publicDomainCache: rContext.Rio.Rio().V1().PublicDomain().Cache(), + publicDomainCache: rContext.Global.Admin().V1().PublicDomain().Cache(), } rContext.Rio.Rio().V1().Service().OnChange(ctx, serviceDomainUpdate, riov1controller.UpdateServiceOnChange(rContext.Rio.Rio().V1().Service().Updater(), sh.syncDomain)) @@ -56,8 +56,8 @@ type serviceHandler struct { serviceCache v1.ServiceCache secretCache corev1controller.SecretCache externalServiceCache v1.ExternalServiceCache - clusterDomainCache projectv1controller.ClusterDomainCache - publicDomainCache riov1controller.PublicDomainCache + clusterDomainCache adminv1controller.ClusterDomainCache + publicDomainCache adminv1controller.PublicDomainCache } func (s *serviceHandler) populate(obj runtime.Object, namespace *corev1.Namespace, os *objectset.ObjectSet) error { diff --git a/modules/service/controllers/info/info.go b/modules/service/controllers/info/info.go new file mode 100644 index 000000000..bc5be146a --- /dev/null +++ b/modules/service/controllers/info/info.go @@ -0,0 +1,32 @@ +package info + +import ( + "context" + + adminv1 "github.com/rancher/rio/pkg/apis/admin.rio.cattle.io/v1" + "github.com/rancher/rio/pkg/version" + "github.com/rancher/rio/types" + "k8s.io/apimachinery/pkg/api/errors" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +func Register(ctx context.Context, rContext *types.Context) error { + client := rContext.Global.Admin().V1().RioInfo() + newInfo := adminv1.NewRioInfo("", "rio", adminv1.RioInfo{ + Status: adminv1.RioInfoStatus{ + SystemNamespace: rContext.Namespace, + Version: version.Version, + GitCommit: version.GitCommit, + }, + }) + + info, err := client.Get("rio", metav1.GetOptions{}) + if errors.IsNotFound(err) { + _, err = client.Create(newInfo) + } else if err == nil { + info.Status = newInfo.Status + _, err = client.Update(info) + } + + return err +} diff --git a/modules/service/controllers/publicdomain/populate/ingress.go b/modules/service/controllers/publicdomain/populate/ingress.go index 44200b2ed..04b843dbe 100644 --- a/modules/service/controllers/publicdomain/populate/ingress.go +++ b/modules/service/controllers/publicdomain/populate/ingress.go @@ -1,7 +1,7 @@ package populate import ( - riov1 "github.com/rancher/rio/pkg/apis/rio.cattle.io/v1" + "github.com/rancher/rio/pkg/apis/admin.rio.cattle.io/v1" "github.com/rancher/rio/pkg/constants" "github.com/rancher/rio/pkg/constructors" "github.com/rancher/wrangler/pkg/name" @@ -10,7 +10,7 @@ import ( "k8s.io/apimachinery/pkg/util/intstr" ) -func Ingress(systemNamespace string, publicdomain *riov1.PublicDomain, os *objectset.ObjectSet) error { +func Ingress(systemNamespace string, publicdomain *v1.PublicDomain, os *objectset.ObjectSet) error { ingress := constructors.NewIngress(systemNamespace, name.SafeConcatName(publicdomain.Name, name.Hex(publicdomain.Spec.DomainName, 5)), v1beta1.Ingress{}) ingress.Spec.Rules = []v1beta1.IngressRule{ diff --git a/modules/service/controllers/publicdomain/publicdomain.go b/modules/service/controllers/publicdomain/publicdomain.go index fe75fd9b6..55cde2305 100644 --- a/modules/service/controllers/publicdomain/publicdomain.go +++ b/modules/service/controllers/publicdomain/publicdomain.go @@ -3,7 +3,9 @@ package publicdomain import ( "context" + "github.com/rancher/rio/pkg/apis/admin.rio.cattle.io/v1" riov1 "github.com/rancher/rio/pkg/apis/rio.cattle.io/v1" + adminv1controller "github.com/rancher/rio/pkg/generated/controllers/admin.rio.cattle.io/v1" riov1controller "github.com/rancher/rio/pkg/generated/controllers/rio.cattle.io/v1" "github.com/rancher/rio/types" "github.com/rancher/wrangler/pkg/relatedresource" @@ -20,7 +22,7 @@ func Register(ctx context.Context, rContext *types.Context) error { services: rContext.Rio.Rio().V1().Service(), routers: rContext.Rio.Rio().V1().Router(), apps: rContext.Rio.Rio().V1().App(), - domains: rContext.Rio.Rio().V1().PublicDomain().Cache(), + domains: rContext.Global.Admin().V1().PublicDomain().Cache(), } svcUpdator := riov1controller.UpdateAppOnChange(rContext.Rio.Rio().V1().App().Updater(), h.syncApp) @@ -31,11 +33,11 @@ func Register(ctx context.Context, rContext *types.Context) error { relatedresource.Watch(ctx, "publicdomain-app", h.resolve, rContext.Rio.Rio().V1().App(), - rContext.Rio.Rio().V1().PublicDomain()) + rContext.Global.Admin().V1().PublicDomain()) relatedresource.Watch(ctx, "publicdomain-router", h.resolve, rContext.Rio.Rio().V1().Router(), - rContext.Rio.Rio().V1().PublicDomain()) + rContext.Global.Admin().V1().PublicDomain()) return nil } @@ -44,13 +46,13 @@ type handler struct { services riov1controller.ServiceController apps riov1controller.AppController routers riov1controller.RouterController - domains riov1controller.PublicDomainCache + domains adminv1controller.PublicDomainCache } func (h handler) resolve(namespace, name string, obj runtime.Object) ([]relatedresource.Key, error) { switch obj.(type) { - case *riov1.PublicDomain: - pd := obj.(*riov1.PublicDomain) + case *v1.PublicDomain: + pd := obj.(*v1.PublicDomain) return []relatedresource.Key{ { Name: pd.Spec.TargetServiceName, diff --git a/modules/service/controllers/service/controller.go b/modules/service/controllers/service/controller.go index d4c413972..da34a53e1 100644 --- a/modules/service/controllers/service/controller.go +++ b/modules/service/controllers/service/controller.go @@ -49,5 +49,9 @@ type serviceHandler struct { func (s *serviceHandler) populate(obj runtime.Object, ns *corev1.Namespace, os *objectset.ObjectSet) error { service := obj.(*riov1.Service) + if service.Namespace != s.namespace && service.SystemSpec != nil { + service = service.DeepCopy() + service.SystemSpec = nil + } return populate.Service(service, s.namespace, os) } diff --git a/modules/service/controllers/service/populate/podcontrollers/controllers.go b/modules/service/controllers/service/populate/podcontrollers/controllers.go index 51b31e88d..27c2b9c83 100644 --- a/modules/service/controllers/service/populate/podcontrollers/controllers.go +++ b/modules/service/controllers/service/populate/podcontrollers/controllers.go @@ -9,10 +9,10 @@ import ( ) func Populate(service *riov1.Service, os *objectset.ObjectSet) error { - if service.Spec.SystemSpec != nil { - pod.Roles(service, &service.Spec.SystemSpec.PodSpec, os) - cp := newControllerParams(service, v1.PodTemplateSpec{Spec: service.Spec.SystemSpec.PodSpec}) - if service.Spec.SystemSpec.Global { + if service.SystemSpec != nil { + pod.Roles(service, &service.SystemSpec.PodSpec, os) + cp := newControllerParams(service, v1.PodTemplateSpec{Spec: service.SystemSpec.PodSpec}) + if service.SystemSpec.Global { daemonset(service, cp, os) } else { deployment(service, cp, os) diff --git a/modules/service/controllers/service/populate/podcontrollers/deployment.go b/modules/service/controllers/service/populate/podcontrollers/deployment.go index dcc60ff2b..f0d34747b 100644 --- a/modules/service/controllers/service/populate/podcontrollers/deployment.go +++ b/modules/service/controllers/service/populate/podcontrollers/deployment.go @@ -26,8 +26,8 @@ func deployment(service *riov1.Service, cp *controllerParams, os *objectset.Obje }, }) - if service.Spec.SystemSpec != nil && service.Spec.SystemSpec.DeploymentStrategy != "" { - dep.Spec.Strategy.Type = appsv1.DeploymentStrategyType(service.Spec.SystemSpec.DeploymentStrategy) + if service.SystemSpec != nil && service.SystemSpec.DeploymentStrategy != "" { + dep.Spec.Strategy.Type = appsv1.DeploymentStrategyType(service.SystemSpec.DeploymentStrategy) } else { if cp.Scale.Scale > 0 && cp.Scale.BatchSize > 0 { dep.Spec.Strategy.RollingUpdate = &appsv1.RollingUpdateDeployment{ @@ -58,8 +58,8 @@ func daemonset(service *riov1.Service, cp *controllerParams, os *objectset.Objec }, }) - if service.Spec.SystemSpec != nil && service.Spec.SystemSpec.DeploymentStrategy != "" { - ds.Spec.Strategy.Type = appsv1.DeploymentStrategyType(service.Spec.SystemSpec.DeploymentStrategy) + if service.SystemSpec != nil && service.SystemSpec.DeploymentStrategy != "" { + ds.Spec.Strategy.Type = appsv1.DeploymentStrategyType(service.SystemSpec.DeploymentStrategy) } else { if cp.Scale.Scale > 0 && cp.Scale.BatchSize > 0 { ds.Spec.Strategy.RollingUpdate = &appsv1.RollingUpdateDeployment{ diff --git a/modules/service/features/feature.go b/modules/service/features/feature.go index 329f20309..6ddaba8cd 100644 --- a/modules/service/features/feature.go +++ b/modules/service/features/feature.go @@ -4,13 +4,13 @@ import ( "context" "github.com/rancher/rio/modules/service/controllers/appweight" - "github.com/rancher/rio/modules/service/controllers/servicestatus" - "github.com/rancher/rio/modules/service/controllers/externalservice" + "github.com/rancher/rio/modules/service/controllers/info" "github.com/rancher/rio/modules/service/controllers/publicdomain" "github.com/rancher/rio/modules/service/controllers/routeset" "github.com/rancher/rio/modules/service/controllers/service" "github.com/rancher/rio/modules/service/controllers/serviceset" + "github.com/rancher/rio/modules/service/controllers/servicestatus" projectv1 "github.com/rancher/rio/pkg/apis/admin.rio.cattle.io/v1" "github.com/rancher/rio/pkg/features" "github.com/rancher/rio/types" @@ -31,6 +31,7 @@ func Register(ctx context.Context, rContext *types.Context) error { servicestatus.Register, appweight.Register, publicdomain.Register, + info.Register, }, } diff --git a/modules/system/features/letsencrypt/controllers/issuer/controller.go b/modules/system/features/letsencrypt/controllers/issuer/controller.go index ec088388b..344bf28e3 100644 --- a/modules/system/features/letsencrypt/controllers/issuer/controller.go +++ b/modules/system/features/letsencrypt/controllers/issuer/controller.go @@ -11,8 +11,7 @@ import ( v1 "github.com/rancher/rio/pkg/apis/admin.rio.cattle.io/v1" "github.com/rancher/rio/pkg/constants" "github.com/rancher/rio/pkg/constructors" - projectv1controller "github.com/rancher/rio/pkg/generated/controllers/admin.rio.cattle.io/v1" - v12 "github.com/rancher/rio/pkg/generated/controllers/rio.cattle.io/v1" + adminv1controller "github.com/rancher/rio/pkg/generated/controllers/admin.rio.cattle.io/v1" "github.com/rancher/rio/types" "github.com/rancher/wrangler/pkg/apply" "github.com/rancher/wrangler/pkg/kv" @@ -36,7 +35,7 @@ func Register(ctx context.Context, rContext *types.Context) error { WithCacheTypes(rContext.CertManager.Certmanager().V1alpha1().ClusterIssuer(), rContext.CertManager.Certmanager().V1alpha1().Certificate()), clusterDomain: rContext.Global.Admin().V1().ClusterDomain(), - publicdomain: rContext.Rio.Rio().V1().PublicDomain(), + publicdomain: rContext.Global.Admin().V1().PublicDomain(), featureCache: rContext.Global.Admin().V1().Feature().Cache(), } @@ -48,9 +47,9 @@ func Register(ctx context.Context, rContext *types.Context) error { type certsHandler struct { namespace string apply apply.Apply - clusterDomain projectv1controller.ClusterDomainController - publicdomain v12.PublicDomainController - featureCache projectv1controller.FeatureCache + clusterDomain adminv1controller.ClusterDomainController + publicdomain adminv1controller.PublicDomainController + featureCache adminv1controller.FeatureCache } func (f *certsHandler) onChangeClusterDomain(key string, clusterDomain *v1.ClusterDomain) (*v1.ClusterDomain, error) { diff --git a/modules/system/features/letsencrypt/controllers/publicdomain/controller.go b/modules/system/features/letsencrypt/controllers/publicdomain/controller.go index 098f37033..c3b19f61a 100644 --- a/modules/system/features/letsencrypt/controllers/publicdomain/controller.go +++ b/modules/system/features/letsencrypt/controllers/publicdomain/controller.go @@ -7,11 +7,10 @@ import ( certmanagerapi "github.com/jetstack/cert-manager/pkg/apis/certmanager/v1alpha1" "github.com/rancher/rio/modules/system/features/letsencrypt/pkg/issuers" projectv1 "github.com/rancher/rio/pkg/apis/admin.rio.cattle.io/v1" - riov1 "github.com/rancher/rio/pkg/apis/rio.cattle.io/v1" "github.com/rancher/rio/pkg/constants" "github.com/rancher/rio/pkg/constructors" + adminv1controller "github.com/rancher/rio/pkg/generated/controllers/admin.rio.cattle.io/v1" v12 "github.com/rancher/rio/pkg/generated/controllers/admin.rio.cattle.io/v1" - riov1controller "github.com/rancher/rio/pkg/generated/controllers/rio.cattle.io/v1" "github.com/rancher/rio/types" "github.com/rancher/wrangler/pkg/apply" "github.com/rancher/wrangler/pkg/generic" @@ -29,12 +28,12 @@ func Register(ctx context.Context, rContexts *types.Context) error { WithStrictCaching(). WithCacheTypes(rContexts.CertManager.Certmanager().V1alpha1().Certificate()), featureClientCache: rContexts.Global.Admin().V1().Feature().Cache(), - publicDomains: rContexts.Rio.Rio().V1().PublicDomain(), - publicDomainCache: rContexts.Rio.Rio().V1().PublicDomain().Cache(), + publicDomains: rContexts.Global.Admin().V1().PublicDomain(), + publicDomainCache: rContexts.Global.Admin().V1().PublicDomain().Cache(), } - rContexts.Rio.Rio().V1().PublicDomain().AddGenericHandler(ctx, "letsencrypt-handler", generic.UpdateOnChange(rContexts.Rio.Rio().V1().PublicDomain().Updater(), p.onChange)) - rContexts.Rio.Rio().V1().PublicDomain().OnRemove(ctx, "letsencrypt-handler", p.onRemove) + rContexts.Global.Admin().V1().PublicDomain().AddGenericHandler(ctx, "letsencrypt-handler", generic.UpdateOnChange(rContexts.Global.Admin().V1().PublicDomain().Updater(), p.onChange)) + rContexts.Global.Admin().V1().PublicDomain().OnRemove(ctx, "letsencrypt-handler", p.onRemove) rContexts.Global.Admin().V1().Feature().OnChange(ctx, "letsencrypt-handler", p.featureChanged) return nil @@ -43,8 +42,8 @@ func Register(ctx context.Context, rContexts *types.Context) error { type publicDomainHandler struct { namespace string apply apply.Apply - publicDomains riov1controller.PublicDomainController - publicDomainCache riov1controller.PublicDomainCache + publicDomains adminv1controller.PublicDomainController + publicDomainCache adminv1controller.PublicDomainCache featureClientCache v12.FeatureCache } @@ -73,7 +72,7 @@ func (p *publicDomainHandler) onChange(key string, obj runtime.Object) (runtime. if obj == nil { return nil, nil } - domain := obj.(*riov1.PublicDomain) + domain := obj.(*projectv1.PublicDomain) if domain.Spec.DisableLetsencrypt { return domain, nil @@ -100,7 +99,7 @@ func (p *publicDomainHandler) onChange(key string, obj runtime.Object) (runtime. return domain, p.apply.WithOwner(domain).Apply(os) } -func (p *publicDomainHandler) onRemove(key string, domain *riov1.PublicDomain) (*riov1.PublicDomain, error) { +func (p *publicDomainHandler) onRemove(key string, domain *projectv1.PublicDomain) (*projectv1.PublicDomain, error) { if domain == nil { return domain, nil } @@ -112,7 +111,7 @@ func (p *publicDomainHandler) onRemove(key string, domain *riov1.PublicDomain) ( return domain, p.apply.WithOwner(domain).Apply(nil) } -func certificateHTTP(namespace string, domain *riov1.PublicDomain, issuerName string) runtime.Object { +func certificateHTTP(namespace string, domain *projectv1.PublicDomain, issuerName string) runtime.Object { name := fmt.Sprintf("%s-%s", domain.Namespace, domain.Name) cert := constructors.NewCertificate(namespace, name, certmanagerapi.Certificate{ diff --git a/pkg/apis/admin.rio.cattle.io/v1/info.go b/pkg/apis/admin.rio.cattle.io/v1/info.go new file mode 100644 index 000000000..041a010e9 --- /dev/null +++ b/pkg/apis/admin.rio.cattle.io/v1/info.go @@ -0,0 +1,29 @@ +package v1 + +import ( + "github.com/rancher/wrangler/pkg/condition" + "github.com/rancher/wrangler/pkg/genericcondition" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +var ( + RioInfoReady = condition.Cond("Ready") +) + +// +genclient +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +type RioInfo struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Status RioInfoStatus `json:"status,omitempty"` +} + +type RioInfoStatus struct { + Version string `json:"version,omitempty"` + GitCommit string `json:"gitCommit,omitempty"` + SystemNamespace string `json:"systemNamespace,omitempty"` + Conditions []genericcondition.GenericCondition `json:"conditions,omitempty"` +} diff --git a/pkg/apis/rio.cattle.io/v1/publicdomain.go b/pkg/apis/admin.rio.cattle.io/v1/publicdomain.go similarity index 100% rename from pkg/apis/rio.cattle.io/v1/publicdomain.go rename to pkg/apis/admin.rio.cattle.io/v1/publicdomain.go diff --git a/pkg/apis/admin.rio.cattle.io/v1/zz_generated_deepcopy.go b/pkg/apis/admin.rio.cattle.io/v1/zz_generated_deepcopy.go index ea5ee6c10..c8eabd25b 100644 --- a/pkg/apis/admin.rio.cattle.io/v1/zz_generated_deepcopy.go +++ b/pkg/apis/admin.rio.cattle.io/v1/zz_generated_deepcopy.go @@ -280,6 +280,186 @@ func (in *FeatureStatus) DeepCopy() *FeatureStatus { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PublicDomain) DeepCopyInto(out *PublicDomain) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec + in.Status.DeepCopyInto(&out.Status) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PublicDomain. +func (in *PublicDomain) DeepCopy() *PublicDomain { + if in == nil { + return nil + } + out := new(PublicDomain) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *PublicDomain) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PublicDomainList) DeepCopyInto(out *PublicDomainList) { + *out = *in + out.TypeMeta = in.TypeMeta + out.ListMeta = in.ListMeta + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]PublicDomain, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PublicDomainList. +func (in *PublicDomainList) DeepCopy() *PublicDomainList { + if in == nil { + return nil + } + out := new(PublicDomainList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *PublicDomainList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PublicDomainSpec) DeepCopyInto(out *PublicDomainSpec) { + *out = *in + out.SecretRef = in.SecretRef + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PublicDomainSpec. +func (in *PublicDomainSpec) DeepCopy() *PublicDomainSpec { + if in == nil { + return nil + } + out := new(PublicDomainSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PublicDomainStatus) DeepCopyInto(out *PublicDomainStatus) { + *out = *in + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make([]genericcondition.GenericCondition, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PublicDomainStatus. +func (in *PublicDomainStatus) DeepCopy() *PublicDomainStatus { + if in == nil { + return nil + } + out := new(PublicDomainStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RioInfo) DeepCopyInto(out *RioInfo) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Status.DeepCopyInto(&out.Status) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RioInfo. +func (in *RioInfo) DeepCopy() *RioInfo { + if in == nil { + return nil + } + out := new(RioInfo) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *RioInfo) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RioInfoList) DeepCopyInto(out *RioInfoList) { + *out = *in + out.TypeMeta = in.TypeMeta + out.ListMeta = in.ListMeta + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]RioInfo, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RioInfoList. +func (in *RioInfoList) DeepCopy() *RioInfoList { + if in == nil { + return nil + } + out := new(RioInfoList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *RioInfoList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RioInfoStatus) DeepCopyInto(out *RioInfoStatus) { + *out = *in + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make([]genericcondition.GenericCondition, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RioInfoStatus. +func (in *RioInfoStatus) DeepCopy() *RioInfoStatus { + if in == nil { + return nil + } + out := new(RioInfoStatus) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *Subdomain) DeepCopyInto(out *Subdomain) { *out = *in diff --git a/pkg/apis/admin.rio.cattle.io/v1/zz_generated_list_types.go b/pkg/apis/admin.rio.cattle.io/v1/zz_generated_list_types.go index 5eac254f1..6dba7a38c 100644 --- a/pkg/apis/admin.rio.cattle.io/v1/zz_generated_list_types.go +++ b/pkg/apis/admin.rio.cattle.io/v1/zz_generated_list_types.go @@ -57,3 +57,37 @@ func NewFeature(namespace, name string, obj Feature) *Feature { obj.Namespace = namespace return &obj } + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// RioInfoList is a list of RioInfo resources +type RioInfoList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata"` + + Items []RioInfo `json:"items"` +} + +func NewRioInfo(namespace, name string, obj RioInfo) *RioInfo { + obj.APIVersion, obj.Kind = SchemeGroupVersion.WithKind("RioInfo").ToAPIVersionAndKind() + obj.Name = name + obj.Namespace = namespace + return &obj +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// PublicDomainList is a list of PublicDomain resources +type PublicDomainList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata"` + + Items []PublicDomain `json:"items"` +} + +func NewPublicDomain(namespace, name string, obj PublicDomain) *PublicDomain { + obj.APIVersion, obj.Kind = SchemeGroupVersion.WithKind("PublicDomain").ToAPIVersionAndKind() + obj.Name = name + obj.Namespace = namespace + return &obj +} diff --git a/pkg/apis/admin.rio.cattle.io/v1/zz_generated_register.go b/pkg/apis/admin.rio.cattle.io/v1/zz_generated_register.go index be8b4ca3d..4b967b166 100644 --- a/pkg/apis/admin.rio.cattle.io/v1/zz_generated_register.go +++ b/pkg/apis/admin.rio.cattle.io/v1/zz_generated_register.go @@ -52,6 +52,10 @@ func addKnownTypes(scheme *runtime.Scheme) error { &ClusterDomainList{}, &Feature{}, &FeatureList{}, + &PublicDomain{}, + &PublicDomainList{}, + &RioInfo{}, + &RioInfoList{}, ) metav1.AddToGroupVersion(scheme, SchemeGroupVersion) return nil diff --git a/pkg/apis/rio.cattle.io/v1/stack.go b/pkg/apis/rio.cattle.io/v1/question.go similarity index 100% rename from pkg/apis/rio.cattle.io/v1/stack.go rename to pkg/apis/rio.cattle.io/v1/question.go diff --git a/pkg/apis/rio.cattle.io/v1/service_types.go b/pkg/apis/rio.cattle.io/v1/service_types.go index 1b80229c9..f224007b7 100644 --- a/pkg/apis/rio.cattle.io/v1/service_types.go +++ b/pkg/apis/rio.cattle.io/v1/service_types.go @@ -29,8 +29,9 @@ type Service struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` - Spec ServiceSpec `json:"spec,omitempty"` - Status ServiceStatus `json:"status,omitempty"` + Spec ServiceSpec `json:"spec,omitempty"` + SystemSpec *SystemServiceSpec `json:"systemSpec,omitempty"` + Status ServiceStatus `json:"status,omitempty"` } // ServiceRevision speficies the APP name, Version and Weight to uniquely identify each Revision @@ -108,9 +109,6 @@ type ServiceSpec struct { // GlobalPermissions to the Services. It will create corresponding ServiceAccounts, ClusterRoles and ClusterRoleBinding. GlobalPermissions []Permission `json:"globalPermissions,omitempty"` - - // System Field Spec - SystemSpec *SystemServiceSpec `json:"systemSpec,omitempty"` } // PodDNSConfig Specifies the DNS parameters of a pod. Parameters specified here will be merged to the generated DNS configuration based on DNSPolicy. diff --git a/pkg/apis/rio.cattle.io/v1/zz_generated_deepcopy.go b/pkg/apis/rio.cattle.io/v1/zz_generated_deepcopy.go index 8dbb4aaf1..b9c8497b7 100644 --- a/pkg/apis/rio.cattle.io/v1/zz_generated_deepcopy.go +++ b/pkg/apis/rio.cattle.io/v1/zz_generated_deepcopy.go @@ -693,105 +693,6 @@ func (in *PodDNSConfigOption) DeepCopy() *PodDNSConfigOption { return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *PublicDomain) DeepCopyInto(out *PublicDomain) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - out.Spec = in.Spec - in.Status.DeepCopyInto(&out.Status) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PublicDomain. -func (in *PublicDomain) DeepCopy() *PublicDomain { - if in == nil { - return nil - } - out := new(PublicDomain) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *PublicDomain) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *PublicDomainList) DeepCopyInto(out *PublicDomainList) { - *out = *in - out.TypeMeta = in.TypeMeta - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]PublicDomain, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PublicDomainList. -func (in *PublicDomainList) DeepCopy() *PublicDomainList { - if in == nil { - return nil - } - out := new(PublicDomainList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *PublicDomainList) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *PublicDomainSpec) DeepCopyInto(out *PublicDomainSpec) { - *out = *in - out.SecretRef = in.SecretRef - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PublicDomainSpec. -func (in *PublicDomainSpec) DeepCopy() *PublicDomainSpec { - if in == nil { - return nil - } - out := new(PublicDomainSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *PublicDomainStatus) DeepCopyInto(out *PublicDomainStatus) { - *out = *in - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make([]genericcondition.GenericCondition, len(*in)) - copy(*out, *in) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PublicDomainStatus. -func (in *PublicDomainStatus) DeepCopy() *PublicDomainStatus { - if in == nil { - return nil - } - out := new(PublicDomainStatus) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *Question) DeepCopyInto(out *Question) { *out = *in @@ -1121,6 +1022,11 @@ func (in *Service) DeepCopyInto(out *Service) { out.TypeMeta = in.TypeMeta in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) in.Spec.DeepCopyInto(&out.Spec) + if in.SystemSpec != nil { + in, out := &in.SystemSpec, &out.SystemSpec + *out = new(SystemServiceSpec) + (*in).DeepCopyInto(*out) + } in.Status.DeepCopyInto(&out.Status) return } @@ -1263,11 +1169,6 @@ func (in *ServiceSpec) DeepCopyInto(out *ServiceSpec) { (*in)[i].DeepCopyInto(&(*out)[i]) } } - if in.SystemSpec != nil { - in, out := &in.SystemSpec, &out.SystemSpec - *out = new(SystemServiceSpec) - (*in).DeepCopyInto(*out) - } return } diff --git a/pkg/apis/rio.cattle.io/v1/zz_generated_list_types.go b/pkg/apis/rio.cattle.io/v1/zz_generated_list_types.go index cf6ea47ba..f2d943a1e 100644 --- a/pkg/apis/rio.cattle.io/v1/zz_generated_list_types.go +++ b/pkg/apis/rio.cattle.io/v1/zz_generated_list_types.go @@ -77,23 +77,6 @@ func NewService(namespace, name string, obj Service) *Service { // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -// PublicDomainList is a list of PublicDomain resources -type PublicDomainList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata"` - - Items []PublicDomain `json:"items"` -} - -func NewPublicDomain(namespace, name string, obj PublicDomain) *PublicDomain { - obj.APIVersion, obj.Kind = SchemeGroupVersion.WithKind("PublicDomain").ToAPIVersionAndKind() - obj.Name = name - obj.Namespace = namespace - return &obj -} - -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - // AppList is a list of App resources type AppList struct { metav1.TypeMeta `json:",inline"` diff --git a/pkg/apis/rio.cattle.io/v1/zz_generated_register.go b/pkg/apis/rio.cattle.io/v1/zz_generated_register.go index 5edf478d4..be081b7b0 100644 --- a/pkg/apis/rio.cattle.io/v1/zz_generated_register.go +++ b/pkg/apis/rio.cattle.io/v1/zz_generated_register.go @@ -52,8 +52,6 @@ func addKnownTypes(scheme *runtime.Scheme) error { &AppList{}, &ExternalService{}, &ExternalServiceList{}, - &PublicDomain{}, - &PublicDomainList{}, &Router{}, &RouterList{}, &Service{}, diff --git a/pkg/codegen/main.go b/pkg/codegen/main.go index b613df2fd..249274503 100644 --- a/pkg/codegen/main.go +++ b/pkg/codegen/main.go @@ -1,7 +1,7 @@ package main import ( - projectv1 "github.com/rancher/rio/pkg/apis/admin.rio.cattle.io/v1" + adminv1 "github.com/rancher/rio/pkg/apis/admin.rio.cattle.io/v1" autoscalev1 "github.com/rancher/rio/pkg/apis/autoscale.rio.cattle.io/v1" riov1 "github.com/rancher/rio/pkg/apis/rio.cattle.io/v1" controllergen "github.com/rancher/wrangler/pkg/controller-gen" @@ -19,8 +19,10 @@ func main() { Groups: map[string]args.Group{ "admin.rio.cattle.io": { Types: []interface{}{ - projectv1.ClusterDomain{}, - projectv1.Feature{}, + adminv1.ClusterDomain{}, + adminv1.Feature{}, + adminv1.RioInfo{}, + adminv1.PublicDomain{}, }, GenerateTypes: true, }, @@ -35,7 +37,6 @@ func main() { riov1.ExternalService{}, riov1.Router{}, riov1.Service{}, - riov1.PublicDomain{}, riov1.App{}, }, GenerateTypes: true, diff --git a/pkg/generated/clientset/versioned/typed/admin.rio.cattle.io/v1/admin.rio.cattle.io_client.go b/pkg/generated/clientset/versioned/typed/admin.rio.cattle.io/v1/admin.rio.cattle.io_client.go index bc556de96..823e1f7a8 100644 --- a/pkg/generated/clientset/versioned/typed/admin.rio.cattle.io/v1/admin.rio.cattle.io_client.go +++ b/pkg/generated/clientset/versioned/typed/admin.rio.cattle.io/v1/admin.rio.cattle.io_client.go @@ -29,6 +29,8 @@ type AdminV1Interface interface { RESTClient() rest.Interface ClusterDomainsGetter FeaturesGetter + PublicDomainsGetter + RioInfosGetter } // AdminV1Client is used to interact with features provided by the admin.rio.cattle.io group. @@ -44,6 +46,14 @@ func (c *AdminV1Client) Features(namespace string) FeatureInterface { return newFeatures(c, namespace) } +func (c *AdminV1Client) PublicDomains(namespace string) PublicDomainInterface { + return newPublicDomains(c, namespace) +} + +func (c *AdminV1Client) RioInfos() RioInfoInterface { + return newRioInfos(c) +} + // NewForConfig creates a new AdminV1Client for the given config. func NewForConfig(c *rest.Config) (*AdminV1Client, error) { config := *c diff --git a/pkg/generated/clientset/versioned/typed/admin.rio.cattle.io/v1/fake/fake_admin.rio.cattle.io_client.go b/pkg/generated/clientset/versioned/typed/admin.rio.cattle.io/v1/fake/fake_admin.rio.cattle.io_client.go index 15badad6e..e15b885bc 100644 --- a/pkg/generated/clientset/versioned/typed/admin.rio.cattle.io/v1/fake/fake_admin.rio.cattle.io_client.go +++ b/pkg/generated/clientset/versioned/typed/admin.rio.cattle.io/v1/fake/fake_admin.rio.cattle.io_client.go @@ -36,6 +36,14 @@ func (c *FakeAdminV1) Features(namespace string) v1.FeatureInterface { return &FakeFeatures{c, namespace} } +func (c *FakeAdminV1) PublicDomains(namespace string) v1.PublicDomainInterface { + return &FakePublicDomains{c, namespace} +} + +func (c *FakeAdminV1) RioInfos() v1.RioInfoInterface { + return &FakeRioInfos{c} +} + // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. func (c *FakeAdminV1) RESTClient() rest.Interface { diff --git a/pkg/generated/clientset/versioned/typed/rio.cattle.io/v1/fake/fake_publicdomain.go b/pkg/generated/clientset/versioned/typed/admin.rio.cattle.io/v1/fake/fake_publicdomain.go similarity index 66% rename from pkg/generated/clientset/versioned/typed/rio.cattle.io/v1/fake/fake_publicdomain.go rename to pkg/generated/clientset/versioned/typed/admin.rio.cattle.io/v1/fake/fake_publicdomain.go index d9793bb7e..2905f91a4 100644 --- a/pkg/generated/clientset/versioned/typed/rio.cattle.io/v1/fake/fake_publicdomain.go +++ b/pkg/generated/clientset/versioned/typed/admin.rio.cattle.io/v1/fake/fake_publicdomain.go @@ -19,7 +19,7 @@ limitations under the License. package fake import ( - riocattleiov1 "github.com/rancher/rio/pkg/apis/rio.cattle.io/v1" + adminriocattleiov1 "github.com/rancher/rio/pkg/apis/admin.rio.cattle.io/v1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" schema "k8s.io/apimachinery/pkg/runtime/schema" @@ -30,29 +30,29 @@ import ( // FakePublicDomains implements PublicDomainInterface type FakePublicDomains struct { - Fake *FakeRioV1 + Fake *FakeAdminV1 ns string } -var publicdomainsResource = schema.GroupVersionResource{Group: "rio.cattle.io", Version: "v1", Resource: "publicdomains"} +var publicdomainsResource = schema.GroupVersionResource{Group: "admin.rio.cattle.io", Version: "v1", Resource: "publicdomains"} -var publicdomainsKind = schema.GroupVersionKind{Group: "rio.cattle.io", Version: "v1", Kind: "PublicDomain"} +var publicdomainsKind = schema.GroupVersionKind{Group: "admin.rio.cattle.io", Version: "v1", Kind: "PublicDomain"} // Get takes name of the publicDomain, and returns the corresponding publicDomain object, and an error if there is any. -func (c *FakePublicDomains) Get(name string, options v1.GetOptions) (result *riocattleiov1.PublicDomain, err error) { +func (c *FakePublicDomains) Get(name string, options v1.GetOptions) (result *adminriocattleiov1.PublicDomain, err error) { obj, err := c.Fake. - Invokes(testing.NewGetAction(publicdomainsResource, c.ns, name), &riocattleiov1.PublicDomain{}) + Invokes(testing.NewGetAction(publicdomainsResource, c.ns, name), &adminriocattleiov1.PublicDomain{}) if obj == nil { return nil, err } - return obj.(*riocattleiov1.PublicDomain), err + return obj.(*adminriocattleiov1.PublicDomain), err } // List takes label and field selectors, and returns the list of PublicDomains that match those selectors. -func (c *FakePublicDomains) List(opts v1.ListOptions) (result *riocattleiov1.PublicDomainList, err error) { +func (c *FakePublicDomains) List(opts v1.ListOptions) (result *adminriocattleiov1.PublicDomainList, err error) { obj, err := c.Fake. - Invokes(testing.NewListAction(publicdomainsResource, publicdomainsKind, c.ns, opts), &riocattleiov1.PublicDomainList{}) + Invokes(testing.NewListAction(publicdomainsResource, publicdomainsKind, c.ns, opts), &adminriocattleiov1.PublicDomainList{}) if obj == nil { return nil, err @@ -62,8 +62,8 @@ func (c *FakePublicDomains) List(opts v1.ListOptions) (result *riocattleiov1.Pub if label == nil { label = labels.Everything() } - list := &riocattleiov1.PublicDomainList{ListMeta: obj.(*riocattleiov1.PublicDomainList).ListMeta} - for _, item := range obj.(*riocattleiov1.PublicDomainList).Items { + list := &adminriocattleiov1.PublicDomainList{ListMeta: obj.(*adminriocattleiov1.PublicDomainList).ListMeta} + for _, item := range obj.(*adminriocattleiov1.PublicDomainList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } @@ -79,43 +79,43 @@ func (c *FakePublicDomains) Watch(opts v1.ListOptions) (watch.Interface, error) } // Create takes the representation of a publicDomain and creates it. Returns the server's representation of the publicDomain, and an error, if there is any. -func (c *FakePublicDomains) Create(publicDomain *riocattleiov1.PublicDomain) (result *riocattleiov1.PublicDomain, err error) { +func (c *FakePublicDomains) Create(publicDomain *adminriocattleiov1.PublicDomain) (result *adminriocattleiov1.PublicDomain, err error) { obj, err := c.Fake. - Invokes(testing.NewCreateAction(publicdomainsResource, c.ns, publicDomain), &riocattleiov1.PublicDomain{}) + Invokes(testing.NewCreateAction(publicdomainsResource, c.ns, publicDomain), &adminriocattleiov1.PublicDomain{}) if obj == nil { return nil, err } - return obj.(*riocattleiov1.PublicDomain), err + return obj.(*adminriocattleiov1.PublicDomain), err } // Update takes the representation of a publicDomain and updates it. Returns the server's representation of the publicDomain, and an error, if there is any. -func (c *FakePublicDomains) Update(publicDomain *riocattleiov1.PublicDomain) (result *riocattleiov1.PublicDomain, err error) { +func (c *FakePublicDomains) Update(publicDomain *adminriocattleiov1.PublicDomain) (result *adminriocattleiov1.PublicDomain, err error) { obj, err := c.Fake. - Invokes(testing.NewUpdateAction(publicdomainsResource, c.ns, publicDomain), &riocattleiov1.PublicDomain{}) + Invokes(testing.NewUpdateAction(publicdomainsResource, c.ns, publicDomain), &adminriocattleiov1.PublicDomain{}) if obj == nil { return nil, err } - return obj.(*riocattleiov1.PublicDomain), err + return obj.(*adminriocattleiov1.PublicDomain), err } // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakePublicDomains) UpdateStatus(publicDomain *riocattleiov1.PublicDomain) (*riocattleiov1.PublicDomain, error) { +func (c *FakePublicDomains) UpdateStatus(publicDomain *adminriocattleiov1.PublicDomain) (*adminriocattleiov1.PublicDomain, error) { obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(publicdomainsResource, "status", c.ns, publicDomain), &riocattleiov1.PublicDomain{}) + Invokes(testing.NewUpdateSubresourceAction(publicdomainsResource, "status", c.ns, publicDomain), &adminriocattleiov1.PublicDomain{}) if obj == nil { return nil, err } - return obj.(*riocattleiov1.PublicDomain), err + return obj.(*adminriocattleiov1.PublicDomain), err } // Delete takes name of the publicDomain and deletes it. Returns an error if one occurs. func (c *FakePublicDomains) Delete(name string, options *v1.DeleteOptions) error { _, err := c.Fake. - Invokes(testing.NewDeleteAction(publicdomainsResource, c.ns, name), &riocattleiov1.PublicDomain{}) + Invokes(testing.NewDeleteAction(publicdomainsResource, c.ns, name), &adminriocattleiov1.PublicDomain{}) return err } @@ -124,17 +124,17 @@ func (c *FakePublicDomains) Delete(name string, options *v1.DeleteOptions) error func (c *FakePublicDomains) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { action := testing.NewDeleteCollectionAction(publicdomainsResource, c.ns, listOptions) - _, err := c.Fake.Invokes(action, &riocattleiov1.PublicDomainList{}) + _, err := c.Fake.Invokes(action, &adminriocattleiov1.PublicDomainList{}) return err } // Patch applies the patch and returns the patched publicDomain. -func (c *FakePublicDomains) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *riocattleiov1.PublicDomain, err error) { +func (c *FakePublicDomains) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *adminriocattleiov1.PublicDomain, err error) { obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(publicdomainsResource, c.ns, name, pt, data, subresources...), &riocattleiov1.PublicDomain{}) + Invokes(testing.NewPatchSubresourceAction(publicdomainsResource, c.ns, name, pt, data, subresources...), &adminriocattleiov1.PublicDomain{}) if obj == nil { return nil, err } - return obj.(*riocattleiov1.PublicDomain), err + return obj.(*adminriocattleiov1.PublicDomain), err } diff --git a/pkg/generated/clientset/versioned/typed/admin.rio.cattle.io/v1/fake/fake_rioinfo.go b/pkg/generated/clientset/versioned/typed/admin.rio.cattle.io/v1/fake/fake_rioinfo.go new file mode 100644 index 000000000..8629998d1 --- /dev/null +++ b/pkg/generated/clientset/versioned/typed/admin.rio.cattle.io/v1/fake/fake_rioinfo.go @@ -0,0 +1,131 @@ +/* +Copyright 2019 Rancher Labs. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by main. DO NOT EDIT. + +package fake + +import ( + adminriocattleiov1 "github.com/rancher/rio/pkg/apis/admin.rio.cattle.io/v1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeRioInfos implements RioInfoInterface +type FakeRioInfos struct { + Fake *FakeAdminV1 +} + +var rioinfosResource = schema.GroupVersionResource{Group: "admin.rio.cattle.io", Version: "v1", Resource: "rioinfos"} + +var rioinfosKind = schema.GroupVersionKind{Group: "admin.rio.cattle.io", Version: "v1", Kind: "RioInfo"} + +// Get takes name of the rioInfo, and returns the corresponding rioInfo object, and an error if there is any. +func (c *FakeRioInfos) Get(name string, options v1.GetOptions) (result *adminriocattleiov1.RioInfo, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(rioinfosResource, name), &adminriocattleiov1.RioInfo{}) + if obj == nil { + return nil, err + } + return obj.(*adminriocattleiov1.RioInfo), err +} + +// List takes label and field selectors, and returns the list of RioInfos that match those selectors. +func (c *FakeRioInfos) List(opts v1.ListOptions) (result *adminriocattleiov1.RioInfoList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(rioinfosResource, rioinfosKind, opts), &adminriocattleiov1.RioInfoList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &adminriocattleiov1.RioInfoList{ListMeta: obj.(*adminriocattleiov1.RioInfoList).ListMeta} + for _, item := range obj.(*adminriocattleiov1.RioInfoList).Items { + if label.Matches(labels.Set(item.Labels)) { + list.Items = append(list.Items, item) + } + } + return list, err +} + +// Watch returns a watch.Interface that watches the requested rioInfos. +func (c *FakeRioInfos) Watch(opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(rioinfosResource, opts)) +} + +// Create takes the representation of a rioInfo and creates it. Returns the server's representation of the rioInfo, and an error, if there is any. +func (c *FakeRioInfos) Create(rioInfo *adminriocattleiov1.RioInfo) (result *adminriocattleiov1.RioInfo, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(rioinfosResource, rioInfo), &adminriocattleiov1.RioInfo{}) + if obj == nil { + return nil, err + } + return obj.(*adminriocattleiov1.RioInfo), err +} + +// Update takes the representation of a rioInfo and updates it. Returns the server's representation of the rioInfo, and an error, if there is any. +func (c *FakeRioInfos) Update(rioInfo *adminriocattleiov1.RioInfo) (result *adminriocattleiov1.RioInfo, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(rioinfosResource, rioInfo), &adminriocattleiov1.RioInfo{}) + if obj == nil { + return nil, err + } + return obj.(*adminriocattleiov1.RioInfo), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeRioInfos) UpdateStatus(rioInfo *adminriocattleiov1.RioInfo) (*adminriocattleiov1.RioInfo, error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateSubresourceAction(rioinfosResource, "status", rioInfo), &adminriocattleiov1.RioInfo{}) + if obj == nil { + return nil, err + } + return obj.(*adminriocattleiov1.RioInfo), err +} + +// Delete takes name of the rioInfo and deletes it. Returns an error if one occurs. +func (c *FakeRioInfos) Delete(name string, options *v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(rioinfosResource, name), &adminriocattleiov1.RioInfo{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeRioInfos) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(rioinfosResource, listOptions) + + _, err := c.Fake.Invokes(action, &adminriocattleiov1.RioInfoList{}) + return err +} + +// Patch applies the patch and returns the patched rioInfo. +func (c *FakeRioInfos) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *adminriocattleiov1.RioInfo, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(rioinfosResource, name, pt, data, subresources...), &adminriocattleiov1.RioInfo{}) + if obj == nil { + return nil, err + } + return obj.(*adminriocattleiov1.RioInfo), err +} diff --git a/pkg/generated/clientset/versioned/typed/admin.rio.cattle.io/v1/generated_expansion.go b/pkg/generated/clientset/versioned/typed/admin.rio.cattle.io/v1/generated_expansion.go index a2da9d5d8..79b85f985 100644 --- a/pkg/generated/clientset/versioned/typed/admin.rio.cattle.io/v1/generated_expansion.go +++ b/pkg/generated/clientset/versioned/typed/admin.rio.cattle.io/v1/generated_expansion.go @@ -21,3 +21,7 @@ package v1 type ClusterDomainExpansion interface{} type FeatureExpansion interface{} + +type PublicDomainExpansion interface{} + +type RioInfoExpansion interface{} diff --git a/pkg/generated/clientset/versioned/typed/rio.cattle.io/v1/publicdomain.go b/pkg/generated/clientset/versioned/typed/admin.rio.cattle.io/v1/publicdomain.go similarity index 97% rename from pkg/generated/clientset/versioned/typed/rio.cattle.io/v1/publicdomain.go rename to pkg/generated/clientset/versioned/typed/admin.rio.cattle.io/v1/publicdomain.go index 02f09ab19..ed8336250 100644 --- a/pkg/generated/clientset/versioned/typed/rio.cattle.io/v1/publicdomain.go +++ b/pkg/generated/clientset/versioned/typed/admin.rio.cattle.io/v1/publicdomain.go @@ -21,7 +21,7 @@ package v1 import ( "time" - v1 "github.com/rancher/rio/pkg/apis/rio.cattle.io/v1" + v1 "github.com/rancher/rio/pkg/apis/admin.rio.cattle.io/v1" scheme "github.com/rancher/rio/pkg/generated/clientset/versioned/scheme" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" @@ -56,7 +56,7 @@ type publicDomains struct { } // newPublicDomains returns a PublicDomains -func newPublicDomains(c *RioV1Client, namespace string) *publicDomains { +func newPublicDomains(c *AdminV1Client, namespace string) *publicDomains { return &publicDomains{ client: c.RESTClient(), ns: namespace, diff --git a/pkg/generated/clientset/versioned/typed/admin.rio.cattle.io/v1/rioinfo.go b/pkg/generated/clientset/versioned/typed/admin.rio.cattle.io/v1/rioinfo.go new file mode 100644 index 000000000..8fbc78b37 --- /dev/null +++ b/pkg/generated/clientset/versioned/typed/admin.rio.cattle.io/v1/rioinfo.go @@ -0,0 +1,180 @@ +/* +Copyright 2019 Rancher Labs. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by main. DO NOT EDIT. + +package v1 + +import ( + "time" + + v1 "github.com/rancher/rio/pkg/apis/admin.rio.cattle.io/v1" + scheme "github.com/rancher/rio/pkg/generated/clientset/versioned/scheme" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" +) + +// RioInfosGetter has a method to return a RioInfoInterface. +// A group's client should implement this interface. +type RioInfosGetter interface { + RioInfos() RioInfoInterface +} + +// RioInfoInterface has methods to work with RioInfo resources. +type RioInfoInterface interface { + Create(*v1.RioInfo) (*v1.RioInfo, error) + Update(*v1.RioInfo) (*v1.RioInfo, error) + UpdateStatus(*v1.RioInfo) (*v1.RioInfo, error) + Delete(name string, options *metav1.DeleteOptions) error + DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error + Get(name string, options metav1.GetOptions) (*v1.RioInfo, error) + List(opts metav1.ListOptions) (*v1.RioInfoList, error) + Watch(opts metav1.ListOptions) (watch.Interface, error) + Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.RioInfo, err error) + RioInfoExpansion +} + +// rioInfos implements RioInfoInterface +type rioInfos struct { + client rest.Interface +} + +// newRioInfos returns a RioInfos +func newRioInfos(c *AdminV1Client) *rioInfos { + return &rioInfos{ + client: c.RESTClient(), + } +} + +// Get takes name of the rioInfo, and returns the corresponding rioInfo object, and an error if there is any. +func (c *rioInfos) Get(name string, options metav1.GetOptions) (result *v1.RioInfo, err error) { + result = &v1.RioInfo{} + err = c.client.Get(). + Resource("rioinfos"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of RioInfos that match those selectors. +func (c *rioInfos) List(opts metav1.ListOptions) (result *v1.RioInfoList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.RioInfoList{} + err = c.client.Get(). + Resource("rioinfos"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested rioInfos. +func (c *rioInfos) Watch(opts metav1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + opts.Watch = true + return c.client.Get(). + Resource("rioinfos"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch() +} + +// Create takes the representation of a rioInfo and creates it. Returns the server's representation of the rioInfo, and an error, if there is any. +func (c *rioInfos) Create(rioInfo *v1.RioInfo) (result *v1.RioInfo, err error) { + result = &v1.RioInfo{} + err = c.client.Post(). + Resource("rioinfos"). + Body(rioInfo). + Do(). + Into(result) + return +} + +// Update takes the representation of a rioInfo and updates it. Returns the server's representation of the rioInfo, and an error, if there is any. +func (c *rioInfos) Update(rioInfo *v1.RioInfo) (result *v1.RioInfo, err error) { + result = &v1.RioInfo{} + err = c.client.Put(). + Resource("rioinfos"). + Name(rioInfo.Name). + Body(rioInfo). + Do(). + Into(result) + return +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). + +func (c *rioInfos) UpdateStatus(rioInfo *v1.RioInfo) (result *v1.RioInfo, err error) { + result = &v1.RioInfo{} + err = c.client.Put(). + Resource("rioinfos"). + Name(rioInfo.Name). + SubResource("status"). + Body(rioInfo). + Do(). + Into(result) + return +} + +// Delete takes name of the rioInfo and deletes it. Returns an error if one occurs. +func (c *rioInfos) Delete(name string, options *metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("rioinfos"). + Name(name). + Body(options). + Do(). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *rioInfos) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { + var timeout time.Duration + if listOptions.TimeoutSeconds != nil { + timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("rioinfos"). + VersionedParams(&listOptions, scheme.ParameterCodec). + Timeout(timeout). + Body(options). + Do(). + Error() +} + +// Patch applies the patch and returns the patched rioInfo. +func (c *rioInfos) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.RioInfo, err error) { + result = &v1.RioInfo{} + err = c.client.Patch(pt). + Resource("rioinfos"). + SubResource(subresources...). + Name(name). + Body(data). + Do(). + Into(result) + return +} diff --git a/pkg/generated/clientset/versioned/typed/rio.cattle.io/v1/fake/fake_rio.cattle.io_client.go b/pkg/generated/clientset/versioned/typed/rio.cattle.io/v1/fake/fake_rio.cattle.io_client.go index 08f73186d..434686c6f 100644 --- a/pkg/generated/clientset/versioned/typed/rio.cattle.io/v1/fake/fake_rio.cattle.io_client.go +++ b/pkg/generated/clientset/versioned/typed/rio.cattle.io/v1/fake/fake_rio.cattle.io_client.go @@ -36,10 +36,6 @@ func (c *FakeRioV1) ExternalServices(namespace string) v1.ExternalServiceInterfa return &FakeExternalServices{c, namespace} } -func (c *FakeRioV1) PublicDomains(namespace string) v1.PublicDomainInterface { - return &FakePublicDomains{c, namespace} -} - func (c *FakeRioV1) Routers(namespace string) v1.RouterInterface { return &FakeRouters{c, namespace} } diff --git a/pkg/generated/clientset/versioned/typed/rio.cattle.io/v1/generated_expansion.go b/pkg/generated/clientset/versioned/typed/rio.cattle.io/v1/generated_expansion.go index f1d54dba7..ca9fb53de 100644 --- a/pkg/generated/clientset/versioned/typed/rio.cattle.io/v1/generated_expansion.go +++ b/pkg/generated/clientset/versioned/typed/rio.cattle.io/v1/generated_expansion.go @@ -22,8 +22,6 @@ type AppExpansion interface{} type ExternalServiceExpansion interface{} -type PublicDomainExpansion interface{} - type RouterExpansion interface{} type ServiceExpansion interface{} diff --git a/pkg/generated/clientset/versioned/typed/rio.cattle.io/v1/rio.cattle.io_client.go b/pkg/generated/clientset/versioned/typed/rio.cattle.io/v1/rio.cattle.io_client.go index bf286d49c..7e6a973f2 100644 --- a/pkg/generated/clientset/versioned/typed/rio.cattle.io/v1/rio.cattle.io_client.go +++ b/pkg/generated/clientset/versioned/typed/rio.cattle.io/v1/rio.cattle.io_client.go @@ -29,7 +29,6 @@ type RioV1Interface interface { RESTClient() rest.Interface AppsGetter ExternalServicesGetter - PublicDomainsGetter RoutersGetter ServicesGetter } @@ -47,10 +46,6 @@ func (c *RioV1Client) ExternalServices(namespace string) ExternalServiceInterfac return newExternalServices(c, namespace) } -func (c *RioV1Client) PublicDomains(namespace string) PublicDomainInterface { - return newPublicDomains(c, namespace) -} - func (c *RioV1Client) Routers(namespace string) RouterInterface { return newRouters(c, namespace) } diff --git a/pkg/generated/controllers/rio.cattle.io/v1/fakes/zz_generated_public_domain_mock.go b/pkg/generated/controllers/admin.rio.cattle.io/v1/fakes/zz_generated_public_domain_mock.go similarity index 99% rename from pkg/generated/controllers/rio.cattle.io/v1/fakes/zz_generated_public_domain_mock.go rename to pkg/generated/controllers/admin.rio.cattle.io/v1/fakes/zz_generated_public_domain_mock.go index 3c3240b0a..b2abe49d3 100644 --- a/pkg/generated/controllers/rio.cattle.io/v1/fakes/zz_generated_public_domain_mock.go +++ b/pkg/generated/controllers/admin.rio.cattle.io/v1/fakes/zz_generated_public_domain_mock.go @@ -7,8 +7,8 @@ import ( context "context" sync "sync" - v1a "github.com/rancher/rio/pkg/apis/rio.cattle.io/v1" - v1 "github.com/rancher/rio/pkg/generated/controllers/rio.cattle.io/v1" + v1a "github.com/rancher/rio/pkg/apis/admin.rio.cattle.io/v1" + v1 "github.com/rancher/rio/pkg/generated/controllers/admin.rio.cattle.io/v1" generic "github.com/rancher/wrangler/pkg/generic" v1b "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" diff --git a/pkg/generated/controllers/admin.rio.cattle.io/v1/fakes/zz_generated_rio_info_mock.go b/pkg/generated/controllers/admin.rio.cattle.io/v1/fakes/zz_generated_rio_info_mock.go new file mode 100644 index 000000000..ad4d72d58 --- /dev/null +++ b/pkg/generated/controllers/admin.rio.cattle.io/v1/fakes/zz_generated_rio_info_mock.go @@ -0,0 +1,1433 @@ +// Code generated by moq; DO NOT EDIT. +// github.com/matryer/moq + +package fakes + +import ( + context "context" + sync "sync" + + v1a "github.com/rancher/rio/pkg/apis/admin.rio.cattle.io/v1" + v1 "github.com/rancher/rio/pkg/generated/controllers/admin.rio.cattle.io/v1" + generic "github.com/rancher/wrangler/pkg/generic" + v1b "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +var ( + lockRioInfoControllerMockAddGenericHandler sync.RWMutex + lockRioInfoControllerMockAddGenericRemoveHandler sync.RWMutex + lockRioInfoControllerMockCache sync.RWMutex + lockRioInfoControllerMockCreate sync.RWMutex + lockRioInfoControllerMockDelete sync.RWMutex + lockRioInfoControllerMockEnqueue sync.RWMutex + lockRioInfoControllerMockGet sync.RWMutex + lockRioInfoControllerMockGroupVersionKind sync.RWMutex + lockRioInfoControllerMockInformer sync.RWMutex + lockRioInfoControllerMockList sync.RWMutex + lockRioInfoControllerMockOnChange sync.RWMutex + lockRioInfoControllerMockOnRemove sync.RWMutex + lockRioInfoControllerMockPatch sync.RWMutex + lockRioInfoControllerMockUpdate sync.RWMutex + lockRioInfoControllerMockUpdateStatus sync.RWMutex + lockRioInfoControllerMockUpdater sync.RWMutex + lockRioInfoControllerMockWatch sync.RWMutex +) + +// Ensure, that RioInfoControllerMock does implement RioInfoController. +// If this is not the case, regenerate this file with moq. +var _ v1.RioInfoController = &RioInfoControllerMock{} + +// RioInfoControllerMock is a mock implementation of RioInfoController. +// +// func TestSomethingThatUsesRioInfoController(t *testing.T) { +// +// // make and configure a mocked RioInfoController +// mockedRioInfoController := &RioInfoControllerMock{ +// AddGenericHandlerFunc: func(ctx context.Context, name string, handler generic.Handler) { +// panic("mock out the AddGenericHandler method") +// }, +// AddGenericRemoveHandlerFunc: func(ctx context.Context, name string, handler generic.Handler) { +// panic("mock out the AddGenericRemoveHandler method") +// }, +// CacheFunc: func() v1.RioInfoCache { +// panic("mock out the Cache method") +// }, +// CreateFunc: func(in1 *v1a.RioInfo) (*v1a.RioInfo, error) { +// panic("mock out the Create method") +// }, +// DeleteFunc: func(name string, options *v1b.DeleteOptions) error { +// panic("mock out the Delete method") +// }, +// EnqueueFunc: func(name string) { +// panic("mock out the Enqueue method") +// }, +// GetFunc: func(name string, options v1b.GetOptions) (*v1a.RioInfo, error) { +// panic("mock out the Get method") +// }, +// GroupVersionKindFunc: func() schema.GroupVersionKind { +// panic("mock out the GroupVersionKind method") +// }, +// InformerFunc: func() cache.SharedIndexInformer { +// panic("mock out the Informer method") +// }, +// ListFunc: func(opts v1b.ListOptions) (*v1a.RioInfoList, error) { +// panic("mock out the List method") +// }, +// OnChangeFunc: func(ctx context.Context, name string, sync v1.RioInfoHandler) { +// panic("mock out the OnChange method") +// }, +// OnRemoveFunc: func(ctx context.Context, name string, sync v1.RioInfoHandler) { +// panic("mock out the OnRemove method") +// }, +// PatchFunc: func(name string, pt types.PatchType, data []byte, subresources ...string) (*v1a.RioInfo, error) { +// panic("mock out the Patch method") +// }, +// UpdateFunc: func(in1 *v1a.RioInfo) (*v1a.RioInfo, error) { +// panic("mock out the Update method") +// }, +// UpdateStatusFunc: func(in1 *v1a.RioInfo) (*v1a.RioInfo, error) { +// panic("mock out the UpdateStatus method") +// }, +// UpdaterFunc: func() generic.Updater { +// panic("mock out the Updater method") +// }, +// WatchFunc: func(opts v1b.ListOptions) (watch.Interface, error) { +// panic("mock out the Watch method") +// }, +// } +// +// // use mockedRioInfoController in code that requires RioInfoController +// // and then make assertions. +// +// } +type RioInfoControllerMock struct { + // AddGenericHandlerFunc mocks the AddGenericHandler method. + AddGenericHandlerFunc func(ctx context.Context, name string, handler generic.Handler) + + // AddGenericRemoveHandlerFunc mocks the AddGenericRemoveHandler method. + AddGenericRemoveHandlerFunc func(ctx context.Context, name string, handler generic.Handler) + + // CacheFunc mocks the Cache method. + CacheFunc func() v1.RioInfoCache + + // CreateFunc mocks the Create method. + CreateFunc func(in1 *v1a.RioInfo) (*v1a.RioInfo, error) + + // DeleteFunc mocks the Delete method. + DeleteFunc func(name string, options *v1b.DeleteOptions) error + + // EnqueueFunc mocks the Enqueue method. + EnqueueFunc func(name string) + + // GetFunc mocks the Get method. + GetFunc func(name string, options v1b.GetOptions) (*v1a.RioInfo, error) + + // GroupVersionKindFunc mocks the GroupVersionKind method. + GroupVersionKindFunc func() schema.GroupVersionKind + + // InformerFunc mocks the Informer method. + InformerFunc func() cache.SharedIndexInformer + + // ListFunc mocks the List method. + ListFunc func(opts v1b.ListOptions) (*v1a.RioInfoList, error) + + // OnChangeFunc mocks the OnChange method. + OnChangeFunc func(ctx context.Context, name string, sync v1.RioInfoHandler) + + // OnRemoveFunc mocks the OnRemove method. + OnRemoveFunc func(ctx context.Context, name string, sync v1.RioInfoHandler) + + // PatchFunc mocks the Patch method. + PatchFunc func(name string, pt types.PatchType, data []byte, subresources ...string) (*v1a.RioInfo, error) + + // UpdateFunc mocks the Update method. + UpdateFunc func(in1 *v1a.RioInfo) (*v1a.RioInfo, error) + + // UpdateStatusFunc mocks the UpdateStatus method. + UpdateStatusFunc func(in1 *v1a.RioInfo) (*v1a.RioInfo, error) + + // UpdaterFunc mocks the Updater method. + UpdaterFunc func() generic.Updater + + // WatchFunc mocks the Watch method. + WatchFunc func(opts v1b.ListOptions) (watch.Interface, error) + + // calls tracks calls to the methods. + calls struct { + // AddGenericHandler holds details about calls to the AddGenericHandler method. + AddGenericHandler []struct { + // Ctx is the ctx argument value. + Ctx context.Context + // Name is the name argument value. + Name string + // Handler is the handler argument value. + Handler generic.Handler + } + // AddGenericRemoveHandler holds details about calls to the AddGenericRemoveHandler method. + AddGenericRemoveHandler []struct { + // Ctx is the ctx argument value. + Ctx context.Context + // Name is the name argument value. + Name string + // Handler is the handler argument value. + Handler generic.Handler + } + // Cache holds details about calls to the Cache method. + Cache []struct { + } + // Create holds details about calls to the Create method. + Create []struct { + // In1 is the in1 argument value. + In1 *v1a.RioInfo + } + // Delete holds details about calls to the Delete method. + Delete []struct { + // Name is the name argument value. + Name string + // Options is the options argument value. + Options *v1b.DeleteOptions + } + // Enqueue holds details about calls to the Enqueue method. + Enqueue []struct { + // Name is the name argument value. + Name string + } + // Get holds details about calls to the Get method. + Get []struct { + // Name is the name argument value. + Name string + // Options is the options argument value. + Options v1b.GetOptions + } + // GroupVersionKind holds details about calls to the GroupVersionKind method. + GroupVersionKind []struct { + } + // Informer holds details about calls to the Informer method. + Informer []struct { + } + // List holds details about calls to the List method. + List []struct { + // Opts is the opts argument value. + Opts v1b.ListOptions + } + // OnChange holds details about calls to the OnChange method. + OnChange []struct { + // Ctx is the ctx argument value. + Ctx context.Context + // Name is the name argument value. + Name string + // Sync is the sync argument value. + Sync v1.RioInfoHandler + } + // OnRemove holds details about calls to the OnRemove method. + OnRemove []struct { + // Ctx is the ctx argument value. + Ctx context.Context + // Name is the name argument value. + Name string + // Sync is the sync argument value. + Sync v1.RioInfoHandler + } + // Patch holds details about calls to the Patch method. + Patch []struct { + // Name is the name argument value. + Name string + // Pt is the pt argument value. + Pt types.PatchType + // Data is the data argument value. + Data []byte + // Subresources is the subresources argument value. + Subresources []string + } + // Update holds details about calls to the Update method. + Update []struct { + // In1 is the in1 argument value. + In1 *v1a.RioInfo + } + // UpdateStatus holds details about calls to the UpdateStatus method. + UpdateStatus []struct { + // In1 is the in1 argument value. + In1 *v1a.RioInfo + } + // Updater holds details about calls to the Updater method. + Updater []struct { + } + // Watch holds details about calls to the Watch method. + Watch []struct { + // Opts is the opts argument value. + Opts v1b.ListOptions + } + } +} + +// AddGenericHandler calls AddGenericHandlerFunc. +func (mock *RioInfoControllerMock) AddGenericHandler(ctx context.Context, name string, handler generic.Handler) { + if mock.AddGenericHandlerFunc == nil { + panic("RioInfoControllerMock.AddGenericHandlerFunc: method is nil but RioInfoController.AddGenericHandler was just called") + } + callInfo := struct { + Ctx context.Context + Name string + Handler generic.Handler + }{ + Ctx: ctx, + Name: name, + Handler: handler, + } + lockRioInfoControllerMockAddGenericHandler.Lock() + mock.calls.AddGenericHandler = append(mock.calls.AddGenericHandler, callInfo) + lockRioInfoControllerMockAddGenericHandler.Unlock() + mock.AddGenericHandlerFunc(ctx, name, handler) +} + +// AddGenericHandlerCalls gets all the calls that were made to AddGenericHandler. +// Check the length with: +// len(mockedRioInfoController.AddGenericHandlerCalls()) +func (mock *RioInfoControllerMock) AddGenericHandlerCalls() []struct { + Ctx context.Context + Name string + Handler generic.Handler +} { + var calls []struct { + Ctx context.Context + Name string + Handler generic.Handler + } + lockRioInfoControllerMockAddGenericHandler.RLock() + calls = mock.calls.AddGenericHandler + lockRioInfoControllerMockAddGenericHandler.RUnlock() + return calls +} + +// AddGenericRemoveHandler calls AddGenericRemoveHandlerFunc. +func (mock *RioInfoControllerMock) AddGenericRemoveHandler(ctx context.Context, name string, handler generic.Handler) { + if mock.AddGenericRemoveHandlerFunc == nil { + panic("RioInfoControllerMock.AddGenericRemoveHandlerFunc: method is nil but RioInfoController.AddGenericRemoveHandler was just called") + } + callInfo := struct { + Ctx context.Context + Name string + Handler generic.Handler + }{ + Ctx: ctx, + Name: name, + Handler: handler, + } + lockRioInfoControllerMockAddGenericRemoveHandler.Lock() + mock.calls.AddGenericRemoveHandler = append(mock.calls.AddGenericRemoveHandler, callInfo) + lockRioInfoControllerMockAddGenericRemoveHandler.Unlock() + mock.AddGenericRemoveHandlerFunc(ctx, name, handler) +} + +// AddGenericRemoveHandlerCalls gets all the calls that were made to AddGenericRemoveHandler. +// Check the length with: +// len(mockedRioInfoController.AddGenericRemoveHandlerCalls()) +func (mock *RioInfoControllerMock) AddGenericRemoveHandlerCalls() []struct { + Ctx context.Context + Name string + Handler generic.Handler +} { + var calls []struct { + Ctx context.Context + Name string + Handler generic.Handler + } + lockRioInfoControllerMockAddGenericRemoveHandler.RLock() + calls = mock.calls.AddGenericRemoveHandler + lockRioInfoControllerMockAddGenericRemoveHandler.RUnlock() + return calls +} + +// Cache calls CacheFunc. +func (mock *RioInfoControllerMock) Cache() v1.RioInfoCache { + if mock.CacheFunc == nil { + panic("RioInfoControllerMock.CacheFunc: method is nil but RioInfoController.Cache was just called") + } + callInfo := struct { + }{} + lockRioInfoControllerMockCache.Lock() + mock.calls.Cache = append(mock.calls.Cache, callInfo) + lockRioInfoControllerMockCache.Unlock() + return mock.CacheFunc() +} + +// CacheCalls gets all the calls that were made to Cache. +// Check the length with: +// len(mockedRioInfoController.CacheCalls()) +func (mock *RioInfoControllerMock) CacheCalls() []struct { +} { + var calls []struct { + } + lockRioInfoControllerMockCache.RLock() + calls = mock.calls.Cache + lockRioInfoControllerMockCache.RUnlock() + return calls +} + +// Create calls CreateFunc. +func (mock *RioInfoControllerMock) Create(in1 *v1a.RioInfo) (*v1a.RioInfo, error) { + if mock.CreateFunc == nil { + panic("RioInfoControllerMock.CreateFunc: method is nil but RioInfoController.Create was just called") + } + callInfo := struct { + In1 *v1a.RioInfo + }{ + In1: in1, + } + lockRioInfoControllerMockCreate.Lock() + mock.calls.Create = append(mock.calls.Create, callInfo) + lockRioInfoControllerMockCreate.Unlock() + return mock.CreateFunc(in1) +} + +// CreateCalls gets all the calls that were made to Create. +// Check the length with: +// len(mockedRioInfoController.CreateCalls()) +func (mock *RioInfoControllerMock) CreateCalls() []struct { + In1 *v1a.RioInfo +} { + var calls []struct { + In1 *v1a.RioInfo + } + lockRioInfoControllerMockCreate.RLock() + calls = mock.calls.Create + lockRioInfoControllerMockCreate.RUnlock() + return calls +} + +// Delete calls DeleteFunc. +func (mock *RioInfoControllerMock) Delete(name string, options *v1b.DeleteOptions) error { + if mock.DeleteFunc == nil { + panic("RioInfoControllerMock.DeleteFunc: method is nil but RioInfoController.Delete was just called") + } + callInfo := struct { + Name string + Options *v1b.DeleteOptions + }{ + Name: name, + Options: options, + } + lockRioInfoControllerMockDelete.Lock() + mock.calls.Delete = append(mock.calls.Delete, callInfo) + lockRioInfoControllerMockDelete.Unlock() + return mock.DeleteFunc(name, options) +} + +// DeleteCalls gets all the calls that were made to Delete. +// Check the length with: +// len(mockedRioInfoController.DeleteCalls()) +func (mock *RioInfoControllerMock) DeleteCalls() []struct { + Name string + Options *v1b.DeleteOptions +} { + var calls []struct { + Name string + Options *v1b.DeleteOptions + } + lockRioInfoControllerMockDelete.RLock() + calls = mock.calls.Delete + lockRioInfoControllerMockDelete.RUnlock() + return calls +} + +// Enqueue calls EnqueueFunc. +func (mock *RioInfoControllerMock) Enqueue(name string) { + if mock.EnqueueFunc == nil { + panic("RioInfoControllerMock.EnqueueFunc: method is nil but RioInfoController.Enqueue was just called") + } + callInfo := struct { + Name string + }{ + Name: name, + } + lockRioInfoControllerMockEnqueue.Lock() + mock.calls.Enqueue = append(mock.calls.Enqueue, callInfo) + lockRioInfoControllerMockEnqueue.Unlock() + mock.EnqueueFunc(name) +} + +// EnqueueCalls gets all the calls that were made to Enqueue. +// Check the length with: +// len(mockedRioInfoController.EnqueueCalls()) +func (mock *RioInfoControllerMock) EnqueueCalls() []struct { + Name string +} { + var calls []struct { + Name string + } + lockRioInfoControllerMockEnqueue.RLock() + calls = mock.calls.Enqueue + lockRioInfoControllerMockEnqueue.RUnlock() + return calls +} + +// Get calls GetFunc. +func (mock *RioInfoControllerMock) Get(name string, options v1b.GetOptions) (*v1a.RioInfo, error) { + if mock.GetFunc == nil { + panic("RioInfoControllerMock.GetFunc: method is nil but RioInfoController.Get was just called") + } + callInfo := struct { + Name string + Options v1b.GetOptions + }{ + Name: name, + Options: options, + } + lockRioInfoControllerMockGet.Lock() + mock.calls.Get = append(mock.calls.Get, callInfo) + lockRioInfoControllerMockGet.Unlock() + return mock.GetFunc(name, options) +} + +// GetCalls gets all the calls that were made to Get. +// Check the length with: +// len(mockedRioInfoController.GetCalls()) +func (mock *RioInfoControllerMock) GetCalls() []struct { + Name string + Options v1b.GetOptions +} { + var calls []struct { + Name string + Options v1b.GetOptions + } + lockRioInfoControllerMockGet.RLock() + calls = mock.calls.Get + lockRioInfoControllerMockGet.RUnlock() + return calls +} + +// GroupVersionKind calls GroupVersionKindFunc. +func (mock *RioInfoControllerMock) GroupVersionKind() schema.GroupVersionKind { + if mock.GroupVersionKindFunc == nil { + panic("RioInfoControllerMock.GroupVersionKindFunc: method is nil but RioInfoController.GroupVersionKind was just called") + } + callInfo := struct { + }{} + lockRioInfoControllerMockGroupVersionKind.Lock() + mock.calls.GroupVersionKind = append(mock.calls.GroupVersionKind, callInfo) + lockRioInfoControllerMockGroupVersionKind.Unlock() + return mock.GroupVersionKindFunc() +} + +// GroupVersionKindCalls gets all the calls that were made to GroupVersionKind. +// Check the length with: +// len(mockedRioInfoController.GroupVersionKindCalls()) +func (mock *RioInfoControllerMock) GroupVersionKindCalls() []struct { +} { + var calls []struct { + } + lockRioInfoControllerMockGroupVersionKind.RLock() + calls = mock.calls.GroupVersionKind + lockRioInfoControllerMockGroupVersionKind.RUnlock() + return calls +} + +// Informer calls InformerFunc. +func (mock *RioInfoControllerMock) Informer() cache.SharedIndexInformer { + if mock.InformerFunc == nil { + panic("RioInfoControllerMock.InformerFunc: method is nil but RioInfoController.Informer was just called") + } + callInfo := struct { + }{} + lockRioInfoControllerMockInformer.Lock() + mock.calls.Informer = append(mock.calls.Informer, callInfo) + lockRioInfoControllerMockInformer.Unlock() + return mock.InformerFunc() +} + +// InformerCalls gets all the calls that were made to Informer. +// Check the length with: +// len(mockedRioInfoController.InformerCalls()) +func (mock *RioInfoControllerMock) InformerCalls() []struct { +} { + var calls []struct { + } + lockRioInfoControllerMockInformer.RLock() + calls = mock.calls.Informer + lockRioInfoControllerMockInformer.RUnlock() + return calls +} + +// List calls ListFunc. +func (mock *RioInfoControllerMock) List(opts v1b.ListOptions) (*v1a.RioInfoList, error) { + if mock.ListFunc == nil { + panic("RioInfoControllerMock.ListFunc: method is nil but RioInfoController.List was just called") + } + callInfo := struct { + Opts v1b.ListOptions + }{ + Opts: opts, + } + lockRioInfoControllerMockList.Lock() + mock.calls.List = append(mock.calls.List, callInfo) + lockRioInfoControllerMockList.Unlock() + return mock.ListFunc(opts) +} + +// ListCalls gets all the calls that were made to List. +// Check the length with: +// len(mockedRioInfoController.ListCalls()) +func (mock *RioInfoControllerMock) ListCalls() []struct { + Opts v1b.ListOptions +} { + var calls []struct { + Opts v1b.ListOptions + } + lockRioInfoControllerMockList.RLock() + calls = mock.calls.List + lockRioInfoControllerMockList.RUnlock() + return calls +} + +// OnChange calls OnChangeFunc. +func (mock *RioInfoControllerMock) OnChange(ctx context.Context, name string, sync v1.RioInfoHandler) { + if mock.OnChangeFunc == nil { + panic("RioInfoControllerMock.OnChangeFunc: method is nil but RioInfoController.OnChange was just called") + } + callInfo := struct { + Ctx context.Context + Name string + Sync v1.RioInfoHandler + }{ + Ctx: ctx, + Name: name, + Sync: sync, + } + lockRioInfoControllerMockOnChange.Lock() + mock.calls.OnChange = append(mock.calls.OnChange, callInfo) + lockRioInfoControllerMockOnChange.Unlock() + mock.OnChangeFunc(ctx, name, sync) +} + +// OnChangeCalls gets all the calls that were made to OnChange. +// Check the length with: +// len(mockedRioInfoController.OnChangeCalls()) +func (mock *RioInfoControllerMock) OnChangeCalls() []struct { + Ctx context.Context + Name string + Sync v1.RioInfoHandler +} { + var calls []struct { + Ctx context.Context + Name string + Sync v1.RioInfoHandler + } + lockRioInfoControllerMockOnChange.RLock() + calls = mock.calls.OnChange + lockRioInfoControllerMockOnChange.RUnlock() + return calls +} + +// OnRemove calls OnRemoveFunc. +func (mock *RioInfoControllerMock) OnRemove(ctx context.Context, name string, sync v1.RioInfoHandler) { + if mock.OnRemoveFunc == nil { + panic("RioInfoControllerMock.OnRemoveFunc: method is nil but RioInfoController.OnRemove was just called") + } + callInfo := struct { + Ctx context.Context + Name string + Sync v1.RioInfoHandler + }{ + Ctx: ctx, + Name: name, + Sync: sync, + } + lockRioInfoControllerMockOnRemove.Lock() + mock.calls.OnRemove = append(mock.calls.OnRemove, callInfo) + lockRioInfoControllerMockOnRemove.Unlock() + mock.OnRemoveFunc(ctx, name, sync) +} + +// OnRemoveCalls gets all the calls that were made to OnRemove. +// Check the length with: +// len(mockedRioInfoController.OnRemoveCalls()) +func (mock *RioInfoControllerMock) OnRemoveCalls() []struct { + Ctx context.Context + Name string + Sync v1.RioInfoHandler +} { + var calls []struct { + Ctx context.Context + Name string + Sync v1.RioInfoHandler + } + lockRioInfoControllerMockOnRemove.RLock() + calls = mock.calls.OnRemove + lockRioInfoControllerMockOnRemove.RUnlock() + return calls +} + +// Patch calls PatchFunc. +func (mock *RioInfoControllerMock) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (*v1a.RioInfo, error) { + if mock.PatchFunc == nil { + panic("RioInfoControllerMock.PatchFunc: method is nil but RioInfoController.Patch was just called") + } + callInfo := struct { + Name string + Pt types.PatchType + Data []byte + Subresources []string + }{ + Name: name, + Pt: pt, + Data: data, + Subresources: subresources, + } + lockRioInfoControllerMockPatch.Lock() + mock.calls.Patch = append(mock.calls.Patch, callInfo) + lockRioInfoControllerMockPatch.Unlock() + return mock.PatchFunc(name, pt, data, subresources...) +} + +// PatchCalls gets all the calls that were made to Patch. +// Check the length with: +// len(mockedRioInfoController.PatchCalls()) +func (mock *RioInfoControllerMock) PatchCalls() []struct { + Name string + Pt types.PatchType + Data []byte + Subresources []string +} { + var calls []struct { + Name string + Pt types.PatchType + Data []byte + Subresources []string + } + lockRioInfoControllerMockPatch.RLock() + calls = mock.calls.Patch + lockRioInfoControllerMockPatch.RUnlock() + return calls +} + +// Update calls UpdateFunc. +func (mock *RioInfoControllerMock) Update(in1 *v1a.RioInfo) (*v1a.RioInfo, error) { + if mock.UpdateFunc == nil { + panic("RioInfoControllerMock.UpdateFunc: method is nil but RioInfoController.Update was just called") + } + callInfo := struct { + In1 *v1a.RioInfo + }{ + In1: in1, + } + lockRioInfoControllerMockUpdate.Lock() + mock.calls.Update = append(mock.calls.Update, callInfo) + lockRioInfoControllerMockUpdate.Unlock() + return mock.UpdateFunc(in1) +} + +// UpdateCalls gets all the calls that were made to Update. +// Check the length with: +// len(mockedRioInfoController.UpdateCalls()) +func (mock *RioInfoControllerMock) UpdateCalls() []struct { + In1 *v1a.RioInfo +} { + var calls []struct { + In1 *v1a.RioInfo + } + lockRioInfoControllerMockUpdate.RLock() + calls = mock.calls.Update + lockRioInfoControllerMockUpdate.RUnlock() + return calls +} + +// UpdateStatus calls UpdateStatusFunc. +func (mock *RioInfoControllerMock) UpdateStatus(in1 *v1a.RioInfo) (*v1a.RioInfo, error) { + if mock.UpdateStatusFunc == nil { + panic("RioInfoControllerMock.UpdateStatusFunc: method is nil but RioInfoController.UpdateStatus was just called") + } + callInfo := struct { + In1 *v1a.RioInfo + }{ + In1: in1, + } + lockRioInfoControllerMockUpdateStatus.Lock() + mock.calls.UpdateStatus = append(mock.calls.UpdateStatus, callInfo) + lockRioInfoControllerMockUpdateStatus.Unlock() + return mock.UpdateStatusFunc(in1) +} + +// UpdateStatusCalls gets all the calls that were made to UpdateStatus. +// Check the length with: +// len(mockedRioInfoController.UpdateStatusCalls()) +func (mock *RioInfoControllerMock) UpdateStatusCalls() []struct { + In1 *v1a.RioInfo +} { + var calls []struct { + In1 *v1a.RioInfo + } + lockRioInfoControllerMockUpdateStatus.RLock() + calls = mock.calls.UpdateStatus + lockRioInfoControllerMockUpdateStatus.RUnlock() + return calls +} + +// Updater calls UpdaterFunc. +func (mock *RioInfoControllerMock) Updater() generic.Updater { + if mock.UpdaterFunc == nil { + panic("RioInfoControllerMock.UpdaterFunc: method is nil but RioInfoController.Updater was just called") + } + callInfo := struct { + }{} + lockRioInfoControllerMockUpdater.Lock() + mock.calls.Updater = append(mock.calls.Updater, callInfo) + lockRioInfoControllerMockUpdater.Unlock() + return mock.UpdaterFunc() +} + +// UpdaterCalls gets all the calls that were made to Updater. +// Check the length with: +// len(mockedRioInfoController.UpdaterCalls()) +func (mock *RioInfoControllerMock) UpdaterCalls() []struct { +} { + var calls []struct { + } + lockRioInfoControllerMockUpdater.RLock() + calls = mock.calls.Updater + lockRioInfoControllerMockUpdater.RUnlock() + return calls +} + +// Watch calls WatchFunc. +func (mock *RioInfoControllerMock) Watch(opts v1b.ListOptions) (watch.Interface, error) { + if mock.WatchFunc == nil { + panic("RioInfoControllerMock.WatchFunc: method is nil but RioInfoController.Watch was just called") + } + callInfo := struct { + Opts v1b.ListOptions + }{ + Opts: opts, + } + lockRioInfoControllerMockWatch.Lock() + mock.calls.Watch = append(mock.calls.Watch, callInfo) + lockRioInfoControllerMockWatch.Unlock() + return mock.WatchFunc(opts) +} + +// WatchCalls gets all the calls that were made to Watch. +// Check the length with: +// len(mockedRioInfoController.WatchCalls()) +func (mock *RioInfoControllerMock) WatchCalls() []struct { + Opts v1b.ListOptions +} { + var calls []struct { + Opts v1b.ListOptions + } + lockRioInfoControllerMockWatch.RLock() + calls = mock.calls.Watch + lockRioInfoControllerMockWatch.RUnlock() + return calls +} + +var ( + lockRioInfoClientMockCreate sync.RWMutex + lockRioInfoClientMockDelete sync.RWMutex + lockRioInfoClientMockGet sync.RWMutex + lockRioInfoClientMockList sync.RWMutex + lockRioInfoClientMockPatch sync.RWMutex + lockRioInfoClientMockUpdate sync.RWMutex + lockRioInfoClientMockUpdateStatus sync.RWMutex + lockRioInfoClientMockWatch sync.RWMutex +) + +// Ensure, that RioInfoClientMock does implement RioInfoClient. +// If this is not the case, regenerate this file with moq. +var _ v1.RioInfoClient = &RioInfoClientMock{} + +// RioInfoClientMock is a mock implementation of RioInfoClient. +// +// func TestSomethingThatUsesRioInfoClient(t *testing.T) { +// +// // make and configure a mocked RioInfoClient +// mockedRioInfoClient := &RioInfoClientMock{ +// CreateFunc: func(in1 *v1a.RioInfo) (*v1a.RioInfo, error) { +// panic("mock out the Create method") +// }, +// DeleteFunc: func(name string, options *v1b.DeleteOptions) error { +// panic("mock out the Delete method") +// }, +// GetFunc: func(name string, options v1b.GetOptions) (*v1a.RioInfo, error) { +// panic("mock out the Get method") +// }, +// ListFunc: func(opts v1b.ListOptions) (*v1a.RioInfoList, error) { +// panic("mock out the List method") +// }, +// PatchFunc: func(name string, pt types.PatchType, data []byte, subresources ...string) (*v1a.RioInfo, error) { +// panic("mock out the Patch method") +// }, +// UpdateFunc: func(in1 *v1a.RioInfo) (*v1a.RioInfo, error) { +// panic("mock out the Update method") +// }, +// UpdateStatusFunc: func(in1 *v1a.RioInfo) (*v1a.RioInfo, error) { +// panic("mock out the UpdateStatus method") +// }, +// WatchFunc: func(opts v1b.ListOptions) (watch.Interface, error) { +// panic("mock out the Watch method") +// }, +// } +// +// // use mockedRioInfoClient in code that requires RioInfoClient +// // and then make assertions. +// +// } +type RioInfoClientMock struct { + // CreateFunc mocks the Create method. + CreateFunc func(in1 *v1a.RioInfo) (*v1a.RioInfo, error) + + // DeleteFunc mocks the Delete method. + DeleteFunc func(name string, options *v1b.DeleteOptions) error + + // GetFunc mocks the Get method. + GetFunc func(name string, options v1b.GetOptions) (*v1a.RioInfo, error) + + // ListFunc mocks the List method. + ListFunc func(opts v1b.ListOptions) (*v1a.RioInfoList, error) + + // PatchFunc mocks the Patch method. + PatchFunc func(name string, pt types.PatchType, data []byte, subresources ...string) (*v1a.RioInfo, error) + + // UpdateFunc mocks the Update method. + UpdateFunc func(in1 *v1a.RioInfo) (*v1a.RioInfo, error) + + // UpdateStatusFunc mocks the UpdateStatus method. + UpdateStatusFunc func(in1 *v1a.RioInfo) (*v1a.RioInfo, error) + + // WatchFunc mocks the Watch method. + WatchFunc func(opts v1b.ListOptions) (watch.Interface, error) + + // calls tracks calls to the methods. + calls struct { + // Create holds details about calls to the Create method. + Create []struct { + // In1 is the in1 argument value. + In1 *v1a.RioInfo + } + // Delete holds details about calls to the Delete method. + Delete []struct { + // Name is the name argument value. + Name string + // Options is the options argument value. + Options *v1b.DeleteOptions + } + // Get holds details about calls to the Get method. + Get []struct { + // Name is the name argument value. + Name string + // Options is the options argument value. + Options v1b.GetOptions + } + // List holds details about calls to the List method. + List []struct { + // Opts is the opts argument value. + Opts v1b.ListOptions + } + // Patch holds details about calls to the Patch method. + Patch []struct { + // Name is the name argument value. + Name string + // Pt is the pt argument value. + Pt types.PatchType + // Data is the data argument value. + Data []byte + // Subresources is the subresources argument value. + Subresources []string + } + // Update holds details about calls to the Update method. + Update []struct { + // In1 is the in1 argument value. + In1 *v1a.RioInfo + } + // UpdateStatus holds details about calls to the UpdateStatus method. + UpdateStatus []struct { + // In1 is the in1 argument value. + In1 *v1a.RioInfo + } + // Watch holds details about calls to the Watch method. + Watch []struct { + // Opts is the opts argument value. + Opts v1b.ListOptions + } + } +} + +// Create calls CreateFunc. +func (mock *RioInfoClientMock) Create(in1 *v1a.RioInfo) (*v1a.RioInfo, error) { + if mock.CreateFunc == nil { + panic("RioInfoClientMock.CreateFunc: method is nil but RioInfoClient.Create was just called") + } + callInfo := struct { + In1 *v1a.RioInfo + }{ + In1: in1, + } + lockRioInfoClientMockCreate.Lock() + mock.calls.Create = append(mock.calls.Create, callInfo) + lockRioInfoClientMockCreate.Unlock() + return mock.CreateFunc(in1) +} + +// CreateCalls gets all the calls that were made to Create. +// Check the length with: +// len(mockedRioInfoClient.CreateCalls()) +func (mock *RioInfoClientMock) CreateCalls() []struct { + In1 *v1a.RioInfo +} { + var calls []struct { + In1 *v1a.RioInfo + } + lockRioInfoClientMockCreate.RLock() + calls = mock.calls.Create + lockRioInfoClientMockCreate.RUnlock() + return calls +} + +// Delete calls DeleteFunc. +func (mock *RioInfoClientMock) Delete(name string, options *v1b.DeleteOptions) error { + if mock.DeleteFunc == nil { + panic("RioInfoClientMock.DeleteFunc: method is nil but RioInfoClient.Delete was just called") + } + callInfo := struct { + Name string + Options *v1b.DeleteOptions + }{ + Name: name, + Options: options, + } + lockRioInfoClientMockDelete.Lock() + mock.calls.Delete = append(mock.calls.Delete, callInfo) + lockRioInfoClientMockDelete.Unlock() + return mock.DeleteFunc(name, options) +} + +// DeleteCalls gets all the calls that were made to Delete. +// Check the length with: +// len(mockedRioInfoClient.DeleteCalls()) +func (mock *RioInfoClientMock) DeleteCalls() []struct { + Name string + Options *v1b.DeleteOptions +} { + var calls []struct { + Name string + Options *v1b.DeleteOptions + } + lockRioInfoClientMockDelete.RLock() + calls = mock.calls.Delete + lockRioInfoClientMockDelete.RUnlock() + return calls +} + +// Get calls GetFunc. +func (mock *RioInfoClientMock) Get(name string, options v1b.GetOptions) (*v1a.RioInfo, error) { + if mock.GetFunc == nil { + panic("RioInfoClientMock.GetFunc: method is nil but RioInfoClient.Get was just called") + } + callInfo := struct { + Name string + Options v1b.GetOptions + }{ + Name: name, + Options: options, + } + lockRioInfoClientMockGet.Lock() + mock.calls.Get = append(mock.calls.Get, callInfo) + lockRioInfoClientMockGet.Unlock() + return mock.GetFunc(name, options) +} + +// GetCalls gets all the calls that were made to Get. +// Check the length with: +// len(mockedRioInfoClient.GetCalls()) +func (mock *RioInfoClientMock) GetCalls() []struct { + Name string + Options v1b.GetOptions +} { + var calls []struct { + Name string + Options v1b.GetOptions + } + lockRioInfoClientMockGet.RLock() + calls = mock.calls.Get + lockRioInfoClientMockGet.RUnlock() + return calls +} + +// List calls ListFunc. +func (mock *RioInfoClientMock) List(opts v1b.ListOptions) (*v1a.RioInfoList, error) { + if mock.ListFunc == nil { + panic("RioInfoClientMock.ListFunc: method is nil but RioInfoClient.List was just called") + } + callInfo := struct { + Opts v1b.ListOptions + }{ + Opts: opts, + } + lockRioInfoClientMockList.Lock() + mock.calls.List = append(mock.calls.List, callInfo) + lockRioInfoClientMockList.Unlock() + return mock.ListFunc(opts) +} + +// ListCalls gets all the calls that were made to List. +// Check the length with: +// len(mockedRioInfoClient.ListCalls()) +func (mock *RioInfoClientMock) ListCalls() []struct { + Opts v1b.ListOptions +} { + var calls []struct { + Opts v1b.ListOptions + } + lockRioInfoClientMockList.RLock() + calls = mock.calls.List + lockRioInfoClientMockList.RUnlock() + return calls +} + +// Patch calls PatchFunc. +func (mock *RioInfoClientMock) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (*v1a.RioInfo, error) { + if mock.PatchFunc == nil { + panic("RioInfoClientMock.PatchFunc: method is nil but RioInfoClient.Patch was just called") + } + callInfo := struct { + Name string + Pt types.PatchType + Data []byte + Subresources []string + }{ + Name: name, + Pt: pt, + Data: data, + Subresources: subresources, + } + lockRioInfoClientMockPatch.Lock() + mock.calls.Patch = append(mock.calls.Patch, callInfo) + lockRioInfoClientMockPatch.Unlock() + return mock.PatchFunc(name, pt, data, subresources...) +} + +// PatchCalls gets all the calls that were made to Patch. +// Check the length with: +// len(mockedRioInfoClient.PatchCalls()) +func (mock *RioInfoClientMock) PatchCalls() []struct { + Name string + Pt types.PatchType + Data []byte + Subresources []string +} { + var calls []struct { + Name string + Pt types.PatchType + Data []byte + Subresources []string + } + lockRioInfoClientMockPatch.RLock() + calls = mock.calls.Patch + lockRioInfoClientMockPatch.RUnlock() + return calls +} + +// Update calls UpdateFunc. +func (mock *RioInfoClientMock) Update(in1 *v1a.RioInfo) (*v1a.RioInfo, error) { + if mock.UpdateFunc == nil { + panic("RioInfoClientMock.UpdateFunc: method is nil but RioInfoClient.Update was just called") + } + callInfo := struct { + In1 *v1a.RioInfo + }{ + In1: in1, + } + lockRioInfoClientMockUpdate.Lock() + mock.calls.Update = append(mock.calls.Update, callInfo) + lockRioInfoClientMockUpdate.Unlock() + return mock.UpdateFunc(in1) +} + +// UpdateCalls gets all the calls that were made to Update. +// Check the length with: +// len(mockedRioInfoClient.UpdateCalls()) +func (mock *RioInfoClientMock) UpdateCalls() []struct { + In1 *v1a.RioInfo +} { + var calls []struct { + In1 *v1a.RioInfo + } + lockRioInfoClientMockUpdate.RLock() + calls = mock.calls.Update + lockRioInfoClientMockUpdate.RUnlock() + return calls +} + +// UpdateStatus calls UpdateStatusFunc. +func (mock *RioInfoClientMock) UpdateStatus(in1 *v1a.RioInfo) (*v1a.RioInfo, error) { + if mock.UpdateStatusFunc == nil { + panic("RioInfoClientMock.UpdateStatusFunc: method is nil but RioInfoClient.UpdateStatus was just called") + } + callInfo := struct { + In1 *v1a.RioInfo + }{ + In1: in1, + } + lockRioInfoClientMockUpdateStatus.Lock() + mock.calls.UpdateStatus = append(mock.calls.UpdateStatus, callInfo) + lockRioInfoClientMockUpdateStatus.Unlock() + return mock.UpdateStatusFunc(in1) +} + +// UpdateStatusCalls gets all the calls that were made to UpdateStatus. +// Check the length with: +// len(mockedRioInfoClient.UpdateStatusCalls()) +func (mock *RioInfoClientMock) UpdateStatusCalls() []struct { + In1 *v1a.RioInfo +} { + var calls []struct { + In1 *v1a.RioInfo + } + lockRioInfoClientMockUpdateStatus.RLock() + calls = mock.calls.UpdateStatus + lockRioInfoClientMockUpdateStatus.RUnlock() + return calls +} + +// Watch calls WatchFunc. +func (mock *RioInfoClientMock) Watch(opts v1b.ListOptions) (watch.Interface, error) { + if mock.WatchFunc == nil { + panic("RioInfoClientMock.WatchFunc: method is nil but RioInfoClient.Watch was just called") + } + callInfo := struct { + Opts v1b.ListOptions + }{ + Opts: opts, + } + lockRioInfoClientMockWatch.Lock() + mock.calls.Watch = append(mock.calls.Watch, callInfo) + lockRioInfoClientMockWatch.Unlock() + return mock.WatchFunc(opts) +} + +// WatchCalls gets all the calls that were made to Watch. +// Check the length with: +// len(mockedRioInfoClient.WatchCalls()) +func (mock *RioInfoClientMock) WatchCalls() []struct { + Opts v1b.ListOptions +} { + var calls []struct { + Opts v1b.ListOptions + } + lockRioInfoClientMockWatch.RLock() + calls = mock.calls.Watch + lockRioInfoClientMockWatch.RUnlock() + return calls +} + +var ( + lockRioInfoCacheMockAddIndexer sync.RWMutex + lockRioInfoCacheMockGet sync.RWMutex + lockRioInfoCacheMockGetByIndex sync.RWMutex + lockRioInfoCacheMockList sync.RWMutex +) + +// Ensure, that RioInfoCacheMock does implement RioInfoCache. +// If this is not the case, regenerate this file with moq. +var _ v1.RioInfoCache = &RioInfoCacheMock{} + +// RioInfoCacheMock is a mock implementation of RioInfoCache. +// +// func TestSomethingThatUsesRioInfoCache(t *testing.T) { +// +// // make and configure a mocked RioInfoCache +// mockedRioInfoCache := &RioInfoCacheMock{ +// AddIndexerFunc: func(indexName string, indexer v1.RioInfoIndexer) { +// panic("mock out the AddIndexer method") +// }, +// GetFunc: func(name string) (*v1a.RioInfo, error) { +// panic("mock out the Get method") +// }, +// GetByIndexFunc: func(indexName string, key string) ([]*v1a.RioInfo, error) { +// panic("mock out the GetByIndex method") +// }, +// ListFunc: func(selector labels.Selector) ([]*v1a.RioInfo, error) { +// panic("mock out the List method") +// }, +// } +// +// // use mockedRioInfoCache in code that requires RioInfoCache +// // and then make assertions. +// +// } +type RioInfoCacheMock struct { + // AddIndexerFunc mocks the AddIndexer method. + AddIndexerFunc func(indexName string, indexer v1.RioInfoIndexer) + + // GetFunc mocks the Get method. + GetFunc func(name string) (*v1a.RioInfo, error) + + // GetByIndexFunc mocks the GetByIndex method. + GetByIndexFunc func(indexName string, key string) ([]*v1a.RioInfo, error) + + // ListFunc mocks the List method. + ListFunc func(selector labels.Selector) ([]*v1a.RioInfo, error) + + // calls tracks calls to the methods. + calls struct { + // AddIndexer holds details about calls to the AddIndexer method. + AddIndexer []struct { + // IndexName is the indexName argument value. + IndexName string + // Indexer is the indexer argument value. + Indexer v1.RioInfoIndexer + } + // Get holds details about calls to the Get method. + Get []struct { + // Name is the name argument value. + Name string + } + // GetByIndex holds details about calls to the GetByIndex method. + GetByIndex []struct { + // IndexName is the indexName argument value. + IndexName string + // Key is the key argument value. + Key string + } + // List holds details about calls to the List method. + List []struct { + // Selector is the selector argument value. + Selector labels.Selector + } + } +} + +// AddIndexer calls AddIndexerFunc. +func (mock *RioInfoCacheMock) AddIndexer(indexName string, indexer v1.RioInfoIndexer) { + if mock.AddIndexerFunc == nil { + panic("RioInfoCacheMock.AddIndexerFunc: method is nil but RioInfoCache.AddIndexer was just called") + } + callInfo := struct { + IndexName string + Indexer v1.RioInfoIndexer + }{ + IndexName: indexName, + Indexer: indexer, + } + lockRioInfoCacheMockAddIndexer.Lock() + mock.calls.AddIndexer = append(mock.calls.AddIndexer, callInfo) + lockRioInfoCacheMockAddIndexer.Unlock() + mock.AddIndexerFunc(indexName, indexer) +} + +// AddIndexerCalls gets all the calls that were made to AddIndexer. +// Check the length with: +// len(mockedRioInfoCache.AddIndexerCalls()) +func (mock *RioInfoCacheMock) AddIndexerCalls() []struct { + IndexName string + Indexer v1.RioInfoIndexer +} { + var calls []struct { + IndexName string + Indexer v1.RioInfoIndexer + } + lockRioInfoCacheMockAddIndexer.RLock() + calls = mock.calls.AddIndexer + lockRioInfoCacheMockAddIndexer.RUnlock() + return calls +} + +// Get calls GetFunc. +func (mock *RioInfoCacheMock) Get(name string) (*v1a.RioInfo, error) { + if mock.GetFunc == nil { + panic("RioInfoCacheMock.GetFunc: method is nil but RioInfoCache.Get was just called") + } + callInfo := struct { + Name string + }{ + Name: name, + } + lockRioInfoCacheMockGet.Lock() + mock.calls.Get = append(mock.calls.Get, callInfo) + lockRioInfoCacheMockGet.Unlock() + return mock.GetFunc(name) +} + +// GetCalls gets all the calls that were made to Get. +// Check the length with: +// len(mockedRioInfoCache.GetCalls()) +func (mock *RioInfoCacheMock) GetCalls() []struct { + Name string +} { + var calls []struct { + Name string + } + lockRioInfoCacheMockGet.RLock() + calls = mock.calls.Get + lockRioInfoCacheMockGet.RUnlock() + return calls +} + +// GetByIndex calls GetByIndexFunc. +func (mock *RioInfoCacheMock) GetByIndex(indexName string, key string) ([]*v1a.RioInfo, error) { + if mock.GetByIndexFunc == nil { + panic("RioInfoCacheMock.GetByIndexFunc: method is nil but RioInfoCache.GetByIndex was just called") + } + callInfo := struct { + IndexName string + Key string + }{ + IndexName: indexName, + Key: key, + } + lockRioInfoCacheMockGetByIndex.Lock() + mock.calls.GetByIndex = append(mock.calls.GetByIndex, callInfo) + lockRioInfoCacheMockGetByIndex.Unlock() + return mock.GetByIndexFunc(indexName, key) +} + +// GetByIndexCalls gets all the calls that were made to GetByIndex. +// Check the length with: +// len(mockedRioInfoCache.GetByIndexCalls()) +func (mock *RioInfoCacheMock) GetByIndexCalls() []struct { + IndexName string + Key string +} { + var calls []struct { + IndexName string + Key string + } + lockRioInfoCacheMockGetByIndex.RLock() + calls = mock.calls.GetByIndex + lockRioInfoCacheMockGetByIndex.RUnlock() + return calls +} + +// List calls ListFunc. +func (mock *RioInfoCacheMock) List(selector labels.Selector) ([]*v1a.RioInfo, error) { + if mock.ListFunc == nil { + panic("RioInfoCacheMock.ListFunc: method is nil but RioInfoCache.List was just called") + } + callInfo := struct { + Selector labels.Selector + }{ + Selector: selector, + } + lockRioInfoCacheMockList.Lock() + mock.calls.List = append(mock.calls.List, callInfo) + lockRioInfoCacheMockList.Unlock() + return mock.ListFunc(selector) +} + +// ListCalls gets all the calls that were made to List. +// Check the length with: +// len(mockedRioInfoCache.ListCalls()) +func (mock *RioInfoCacheMock) ListCalls() []struct { + Selector labels.Selector +} { + var calls []struct { + Selector labels.Selector + } + lockRioInfoCacheMockList.RLock() + calls = mock.calls.List + lockRioInfoCacheMockList.RUnlock() + return calls +} diff --git a/pkg/generated/controllers/admin.rio.cattle.io/v1/interface.go b/pkg/generated/controllers/admin.rio.cattle.io/v1/interface.go index 8c607064a..adef48bb3 100644 --- a/pkg/generated/controllers/admin.rio.cattle.io/v1/interface.go +++ b/pkg/generated/controllers/admin.rio.cattle.io/v1/interface.go @@ -28,6 +28,8 @@ import ( type Interface interface { ClusterDomain() ClusterDomainController Feature() FeatureController + PublicDomain() PublicDomainController + RioInfo() RioInfoController } func New(controllerManager *generic.ControllerManager, client clientset.AdminV1Interface, @@ -51,3 +53,9 @@ func (c *version) ClusterDomain() ClusterDomainController { func (c *version) Feature() FeatureController { return NewFeatureController(v1.SchemeGroupVersion.WithKind("Feature"), c.controllerManager, c.client, c.informers.Features()) } +func (c *version) PublicDomain() PublicDomainController { + return NewPublicDomainController(v1.SchemeGroupVersion.WithKind("PublicDomain"), c.controllerManager, c.client, c.informers.PublicDomains()) +} +func (c *version) RioInfo() RioInfoController { + return NewRioInfoController(v1.SchemeGroupVersion.WithKind("RioInfo"), c.controllerManager, c.client, c.informers.RioInfos()) +} diff --git a/pkg/generated/controllers/rio.cattle.io/v1/publicdomain.go b/pkg/generated/controllers/admin.rio.cattle.io/v1/publicdomain.go similarity index 97% rename from pkg/generated/controllers/rio.cattle.io/v1/publicdomain.go rename to pkg/generated/controllers/admin.rio.cattle.io/v1/publicdomain.go index 0aa75b474..b96cce431 100644 --- a/pkg/generated/controllers/rio.cattle.io/v1/publicdomain.go +++ b/pkg/generated/controllers/admin.rio.cattle.io/v1/publicdomain.go @@ -21,10 +21,10 @@ package v1 import ( "context" - v1 "github.com/rancher/rio/pkg/apis/rio.cattle.io/v1" - clientset "github.com/rancher/rio/pkg/generated/clientset/versioned/typed/rio.cattle.io/v1" - informers "github.com/rancher/rio/pkg/generated/informers/externalversions/rio.cattle.io/v1" - listers "github.com/rancher/rio/pkg/generated/listers/rio.cattle.io/v1" + v1 "github.com/rancher/rio/pkg/apis/admin.rio.cattle.io/v1" + clientset "github.com/rancher/rio/pkg/generated/clientset/versioned/typed/admin.rio.cattle.io/v1" + informers "github.com/rancher/rio/pkg/generated/informers/externalversions/admin.rio.cattle.io/v1" + listers "github.com/rancher/rio/pkg/generated/listers/admin.rio.cattle.io/v1" "github.com/rancher/wrangler/pkg/generic" "k8s.io/apimachinery/pkg/api/equality" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/pkg/generated/controllers/admin.rio.cattle.io/v1/rioinfo.go b/pkg/generated/controllers/admin.rio.cattle.io/v1/rioinfo.go new file mode 100644 index 000000000..1459eca79 --- /dev/null +++ b/pkg/generated/controllers/admin.rio.cattle.io/v1/rioinfo.go @@ -0,0 +1,242 @@ +/* +Copyright 2019 Rancher Labs. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by main. DO NOT EDIT. + +package v1 + +import ( + "context" + + v1 "github.com/rancher/rio/pkg/apis/admin.rio.cattle.io/v1" + clientset "github.com/rancher/rio/pkg/generated/clientset/versioned/typed/admin.rio.cattle.io/v1" + informers "github.com/rancher/rio/pkg/generated/informers/externalversions/admin.rio.cattle.io/v1" + listers "github.com/rancher/rio/pkg/generated/listers/admin.rio.cattle.io/v1" + "github.com/rancher/wrangler/pkg/generic" + "k8s.io/apimachinery/pkg/api/equality" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/schema" + "k8s.io/apimachinery/pkg/types" + utilruntime "k8s.io/apimachinery/pkg/util/runtime" + "k8s.io/apimachinery/pkg/watch" + "k8s.io/client-go/tools/cache" +) + +type RioInfoHandler func(string, *v1.RioInfo) (*v1.RioInfo, error) + +type RioInfoController interface { + RioInfoClient + + OnChange(ctx context.Context, name string, sync RioInfoHandler) + OnRemove(ctx context.Context, name string, sync RioInfoHandler) + Enqueue(name string) + + Cache() RioInfoCache + + Informer() cache.SharedIndexInformer + GroupVersionKind() schema.GroupVersionKind + + AddGenericHandler(ctx context.Context, name string, handler generic.Handler) + AddGenericRemoveHandler(ctx context.Context, name string, handler generic.Handler) + Updater() generic.Updater +} + +type RioInfoClient interface { + Create(*v1.RioInfo) (*v1.RioInfo, error) + Update(*v1.RioInfo) (*v1.RioInfo, error) + UpdateStatus(*v1.RioInfo) (*v1.RioInfo, error) + Delete(name string, options *metav1.DeleteOptions) error + Get(name string, options metav1.GetOptions) (*v1.RioInfo, error) + List(opts metav1.ListOptions) (*v1.RioInfoList, error) + Watch(opts metav1.ListOptions) (watch.Interface, error) + Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.RioInfo, err error) +} + +type RioInfoCache interface { + Get(name string) (*v1.RioInfo, error) + List(selector labels.Selector) ([]*v1.RioInfo, error) + + AddIndexer(indexName string, indexer RioInfoIndexer) + GetByIndex(indexName, key string) ([]*v1.RioInfo, error) +} + +type RioInfoIndexer func(obj *v1.RioInfo) ([]string, error) + +type rioInfoController struct { + controllerManager *generic.ControllerManager + clientGetter clientset.RioInfosGetter + informer informers.RioInfoInformer + gvk schema.GroupVersionKind +} + +func NewRioInfoController(gvk schema.GroupVersionKind, controllerManager *generic.ControllerManager, clientGetter clientset.RioInfosGetter, informer informers.RioInfoInformer) RioInfoController { + return &rioInfoController{ + controllerManager: controllerManager, + clientGetter: clientGetter, + informer: informer, + gvk: gvk, + } +} + +func FromRioInfoHandlerToHandler(sync RioInfoHandler) generic.Handler { + return func(key string, obj runtime.Object) (ret runtime.Object, err error) { + var v *v1.RioInfo + if obj == nil { + v, err = sync(key, nil) + } else { + v, err = sync(key, obj.(*v1.RioInfo)) + } + if v == nil { + return nil, err + } + return v, err + } +} + +func (c *rioInfoController) Updater() generic.Updater { + return func(obj runtime.Object) (runtime.Object, error) { + newObj, err := c.Update(obj.(*v1.RioInfo)) + if newObj == nil { + return nil, err + } + return newObj, err + } +} + +func UpdateRioInfoOnChange(updater generic.Updater, handler RioInfoHandler) RioInfoHandler { + return func(key string, obj *v1.RioInfo) (*v1.RioInfo, error) { + if obj == nil { + return handler(key, nil) + } + + copyObj := obj.DeepCopy() + newObj, err := handler(key, copyObj) + if newObj != nil { + copyObj = newObj + } + if obj.ResourceVersion == copyObj.ResourceVersion && !equality.Semantic.DeepEqual(obj, copyObj) { + newObj, err := updater(copyObj) + if newObj != nil && err == nil { + copyObj = newObj.(*v1.RioInfo) + } + } + + return copyObj, err + } +} + +func (c *rioInfoController) AddGenericHandler(ctx context.Context, name string, handler generic.Handler) { + c.controllerManager.AddHandler(ctx, c.gvk, c.informer.Informer(), name, handler) +} + +func (c *rioInfoController) AddGenericRemoveHandler(ctx context.Context, name string, handler generic.Handler) { + removeHandler := generic.NewRemoveHandler(name, c.Updater(), handler) + c.controllerManager.AddHandler(ctx, c.gvk, c.informer.Informer(), name, removeHandler) +} + +func (c *rioInfoController) OnChange(ctx context.Context, name string, sync RioInfoHandler) { + c.AddGenericHandler(ctx, name, FromRioInfoHandlerToHandler(sync)) +} + +func (c *rioInfoController) OnRemove(ctx context.Context, name string, sync RioInfoHandler) { + removeHandler := generic.NewRemoveHandler(name, c.Updater(), FromRioInfoHandlerToHandler(sync)) + c.AddGenericHandler(ctx, name, removeHandler) +} + +func (c *rioInfoController) Enqueue(name string) { + c.controllerManager.Enqueue(c.gvk, "", name) +} + +func (c *rioInfoController) Informer() cache.SharedIndexInformer { + return c.informer.Informer() +} + +func (c *rioInfoController) GroupVersionKind() schema.GroupVersionKind { + return c.gvk +} + +func (c *rioInfoController) Cache() RioInfoCache { + return &rioInfoCache{ + lister: c.informer.Lister(), + indexer: c.informer.Informer().GetIndexer(), + } +} + +func (c *rioInfoController) Create(obj *v1.RioInfo) (*v1.RioInfo, error) { + return c.clientGetter.RioInfos().Create(obj) +} + +func (c *rioInfoController) Update(obj *v1.RioInfo) (*v1.RioInfo, error) { + return c.clientGetter.RioInfos().Update(obj) +} + +func (c *rioInfoController) UpdateStatus(obj *v1.RioInfo) (*v1.RioInfo, error) { + return c.clientGetter.RioInfos().UpdateStatus(obj) +} + +func (c *rioInfoController) Delete(name string, options *metav1.DeleteOptions) error { + return c.clientGetter.RioInfos().Delete(name, options) +} + +func (c *rioInfoController) Get(name string, options metav1.GetOptions) (*v1.RioInfo, error) { + return c.clientGetter.RioInfos().Get(name, options) +} + +func (c *rioInfoController) List(opts metav1.ListOptions) (*v1.RioInfoList, error) { + return c.clientGetter.RioInfos().List(opts) +} + +func (c *rioInfoController) Watch(opts metav1.ListOptions) (watch.Interface, error) { + return c.clientGetter.RioInfos().Watch(opts) +} + +func (c *rioInfoController) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.RioInfo, err error) { + return c.clientGetter.RioInfos().Patch(name, pt, data, subresources...) +} + +type rioInfoCache struct { + lister listers.RioInfoLister + indexer cache.Indexer +} + +func (c *rioInfoCache) Get(name string) (*v1.RioInfo, error) { + return c.lister.Get(name) +} + +func (c *rioInfoCache) List(selector labels.Selector) ([]*v1.RioInfo, error) { + return c.lister.List(selector) +} + +func (c *rioInfoCache) AddIndexer(indexName string, indexer RioInfoIndexer) { + utilruntime.Must(c.indexer.AddIndexers(map[string]cache.IndexFunc{ + indexName: func(obj interface{}) (strings []string, e error) { + return indexer(obj.(*v1.RioInfo)) + }, + })) +} + +func (c *rioInfoCache) GetByIndex(indexName, key string) (result []*v1.RioInfo, err error) { + objs, err := c.indexer.ByIndex(indexName, key) + if err != nil { + return nil, err + } + for _, obj := range objs { + result = append(result, obj.(*v1.RioInfo)) + } + return result, nil +} diff --git a/pkg/generated/controllers/rio.cattle.io/v1/interface.go b/pkg/generated/controllers/rio.cattle.io/v1/interface.go index b933ef72a..4138672e1 100644 --- a/pkg/generated/controllers/rio.cattle.io/v1/interface.go +++ b/pkg/generated/controllers/rio.cattle.io/v1/interface.go @@ -28,7 +28,6 @@ import ( type Interface interface { App() AppController ExternalService() ExternalServiceController - PublicDomain() PublicDomainController Router() RouterController Service() ServiceController } @@ -54,9 +53,6 @@ func (c *version) App() AppController { func (c *version) ExternalService() ExternalServiceController { return NewExternalServiceController(v1.SchemeGroupVersion.WithKind("ExternalService"), c.controllerManager, c.client, c.informers.ExternalServices()) } -func (c *version) PublicDomain() PublicDomainController { - return NewPublicDomainController(v1.SchemeGroupVersion.WithKind("PublicDomain"), c.controllerManager, c.client, c.informers.PublicDomains()) -} func (c *version) Router() RouterController { return NewRouterController(v1.SchemeGroupVersion.WithKind("Router"), c.controllerManager, c.client, c.informers.Routers()) } diff --git a/pkg/generated/informers/externalversions/admin.rio.cattle.io/v1/interface.go b/pkg/generated/informers/externalversions/admin.rio.cattle.io/v1/interface.go index 20b2418db..5f2987dfa 100644 --- a/pkg/generated/informers/externalversions/admin.rio.cattle.io/v1/interface.go +++ b/pkg/generated/informers/externalversions/admin.rio.cattle.io/v1/interface.go @@ -28,6 +28,10 @@ type Interface interface { ClusterDomains() ClusterDomainInformer // Features returns a FeatureInformer. Features() FeatureInformer + // PublicDomains returns a PublicDomainInformer. + PublicDomains() PublicDomainInformer + // RioInfos returns a RioInfoInformer. + RioInfos() RioInfoInformer } type version struct { @@ -50,3 +54,13 @@ func (v *version) ClusterDomains() ClusterDomainInformer { func (v *version) Features() FeatureInformer { return &featureInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } + +// PublicDomains returns a PublicDomainInformer. +func (v *version) PublicDomains() PublicDomainInformer { + return &publicDomainInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} +} + +// RioInfos returns a RioInfoInformer. +func (v *version) RioInfos() RioInfoInformer { + return &rioInfoInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} diff --git a/pkg/generated/informers/externalversions/rio.cattle.io/v1/publicdomain.go b/pkg/generated/informers/externalversions/admin.rio.cattle.io/v1/publicdomain.go similarity index 88% rename from pkg/generated/informers/externalversions/rio.cattle.io/v1/publicdomain.go rename to pkg/generated/informers/externalversions/admin.rio.cattle.io/v1/publicdomain.go index 3a7f45620..ed41025f0 100644 --- a/pkg/generated/informers/externalversions/rio.cattle.io/v1/publicdomain.go +++ b/pkg/generated/informers/externalversions/admin.rio.cattle.io/v1/publicdomain.go @@ -21,10 +21,10 @@ package v1 import ( time "time" - riocattleiov1 "github.com/rancher/rio/pkg/apis/rio.cattle.io/v1" + adminriocattleiov1 "github.com/rancher/rio/pkg/apis/admin.rio.cattle.io/v1" versioned "github.com/rancher/rio/pkg/generated/clientset/versioned" internalinterfaces "github.com/rancher/rio/pkg/generated/informers/externalversions/internalinterfaces" - v1 "github.com/rancher/rio/pkg/generated/listers/rio.cattle.io/v1" + v1 "github.com/rancher/rio/pkg/generated/listers/admin.rio.cattle.io/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" @@ -61,16 +61,16 @@ func NewFilteredPublicDomainInformer(client versioned.Interface, namespace strin if tweakListOptions != nil { tweakListOptions(&options) } - return client.RioV1().PublicDomains(namespace).List(options) + return client.AdminV1().PublicDomains(namespace).List(options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.RioV1().PublicDomains(namespace).Watch(options) + return client.AdminV1().PublicDomains(namespace).Watch(options) }, }, - &riocattleiov1.PublicDomain{}, + &adminriocattleiov1.PublicDomain{}, resyncPeriod, indexers, ) @@ -81,7 +81,7 @@ func (f *publicDomainInformer) defaultInformer(client versioned.Interface, resyn } func (f *publicDomainInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&riocattleiov1.PublicDomain{}, f.defaultInformer) + return f.factory.InformerFor(&adminriocattleiov1.PublicDomain{}, f.defaultInformer) } func (f *publicDomainInformer) Lister() v1.PublicDomainLister { diff --git a/pkg/generated/informers/externalversions/admin.rio.cattle.io/v1/rioinfo.go b/pkg/generated/informers/externalversions/admin.rio.cattle.io/v1/rioinfo.go new file mode 100644 index 000000000..cc56b08f9 --- /dev/null +++ b/pkg/generated/informers/externalversions/admin.rio.cattle.io/v1/rioinfo.go @@ -0,0 +1,88 @@ +/* +Copyright 2019 Rancher Labs. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by main. DO NOT EDIT. + +package v1 + +import ( + time "time" + + adminriocattleiov1 "github.com/rancher/rio/pkg/apis/admin.rio.cattle.io/v1" + versioned "github.com/rancher/rio/pkg/generated/clientset/versioned" + internalinterfaces "github.com/rancher/rio/pkg/generated/informers/externalversions/internalinterfaces" + v1 "github.com/rancher/rio/pkg/generated/listers/admin.rio.cattle.io/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// RioInfoInformer provides access to a shared informer and lister for +// RioInfos. +type RioInfoInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.RioInfoLister +} + +type rioInfoInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewRioInfoInformer constructs a new informer for RioInfo type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewRioInfoInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredRioInfoInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredRioInfoInformer constructs a new informer for RioInfo type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredRioInfoInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.AdminV1().RioInfos().List(options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.AdminV1().RioInfos().Watch(options) + }, + }, + &adminriocattleiov1.RioInfo{}, + resyncPeriod, + indexers, + ) +} + +func (f *rioInfoInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredRioInfoInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *rioInfoInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&adminriocattleiov1.RioInfo{}, f.defaultInformer) +} + +func (f *rioInfoInformer) Lister() v1.RioInfoLister { + return v1.NewRioInfoLister(f.Informer().GetIndexer()) +} diff --git a/pkg/generated/informers/externalversions/generic.go b/pkg/generated/informers/externalversions/generic.go index 5e33aec33..66e9fce84 100644 --- a/pkg/generated/informers/externalversions/generic.go +++ b/pkg/generated/informers/externalversions/generic.go @@ -59,6 +59,10 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource return &genericInformer{resource: resource.GroupResource(), informer: f.Admin().V1().ClusterDomains().Informer()}, nil case v1.SchemeGroupVersion.WithResource("features"): return &genericInformer{resource: resource.GroupResource(), informer: f.Admin().V1().Features().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("publicdomains"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Admin().V1().PublicDomains().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("rioinfos"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Admin().V1().RioInfos().Informer()}, nil // Group=autoscale.rio.cattle.io, Version=v1 case autoscaleriocattleiov1.SchemeGroupVersion.WithResource("servicescalerecommendations"): @@ -69,8 +73,6 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource return &genericInformer{resource: resource.GroupResource(), informer: f.Rio().V1().Apps().Informer()}, nil case riocattleiov1.SchemeGroupVersion.WithResource("externalservices"): return &genericInformer{resource: resource.GroupResource(), informer: f.Rio().V1().ExternalServices().Informer()}, nil - case riocattleiov1.SchemeGroupVersion.WithResource("publicdomains"): - return &genericInformer{resource: resource.GroupResource(), informer: f.Rio().V1().PublicDomains().Informer()}, nil case riocattleiov1.SchemeGroupVersion.WithResource("routers"): return &genericInformer{resource: resource.GroupResource(), informer: f.Rio().V1().Routers().Informer()}, nil case riocattleiov1.SchemeGroupVersion.WithResource("services"): diff --git a/pkg/generated/informers/externalversions/rio.cattle.io/v1/interface.go b/pkg/generated/informers/externalversions/rio.cattle.io/v1/interface.go index e68219670..33031499b 100644 --- a/pkg/generated/informers/externalversions/rio.cattle.io/v1/interface.go +++ b/pkg/generated/informers/externalversions/rio.cattle.io/v1/interface.go @@ -28,8 +28,6 @@ type Interface interface { Apps() AppInformer // ExternalServices returns a ExternalServiceInformer. ExternalServices() ExternalServiceInformer - // PublicDomains returns a PublicDomainInformer. - PublicDomains() PublicDomainInformer // Routers returns a RouterInformer. Routers() RouterInformer // Services returns a ServiceInformer. @@ -57,11 +55,6 @@ func (v *version) ExternalServices() ExternalServiceInformer { return &externalServiceInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } -// PublicDomains returns a PublicDomainInformer. -func (v *version) PublicDomains() PublicDomainInformer { - return &publicDomainInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} -} - // Routers returns a RouterInformer. func (v *version) Routers() RouterInformer { return &routerInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} diff --git a/pkg/generated/listers/admin.rio.cattle.io/v1/expansion_generated.go b/pkg/generated/listers/admin.rio.cattle.io/v1/expansion_generated.go index f4677cf62..93725a9c3 100644 --- a/pkg/generated/listers/admin.rio.cattle.io/v1/expansion_generated.go +++ b/pkg/generated/listers/admin.rio.cattle.io/v1/expansion_generated.go @@ -33,3 +33,15 @@ type FeatureListerExpansion interface{} // FeatureNamespaceListerExpansion allows custom methods to be added to // FeatureNamespaceLister. type FeatureNamespaceListerExpansion interface{} + +// PublicDomainListerExpansion allows custom methods to be added to +// PublicDomainLister. +type PublicDomainListerExpansion interface{} + +// PublicDomainNamespaceListerExpansion allows custom methods to be added to +// PublicDomainNamespaceLister. +type PublicDomainNamespaceListerExpansion interface{} + +// RioInfoListerExpansion allows custom methods to be added to +// RioInfoLister. +type RioInfoListerExpansion interface{} diff --git a/pkg/generated/listers/rio.cattle.io/v1/publicdomain.go b/pkg/generated/listers/admin.rio.cattle.io/v1/publicdomain.go similarity index 98% rename from pkg/generated/listers/rio.cattle.io/v1/publicdomain.go rename to pkg/generated/listers/admin.rio.cattle.io/v1/publicdomain.go index 1ca65ac22..46de978fe 100644 --- a/pkg/generated/listers/rio.cattle.io/v1/publicdomain.go +++ b/pkg/generated/listers/admin.rio.cattle.io/v1/publicdomain.go @@ -19,7 +19,7 @@ limitations under the License. package v1 import ( - v1 "github.com/rancher/rio/pkg/apis/rio.cattle.io/v1" + v1 "github.com/rancher/rio/pkg/apis/admin.rio.cattle.io/v1" "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/tools/cache" diff --git a/pkg/generated/listers/admin.rio.cattle.io/v1/rioinfo.go b/pkg/generated/listers/admin.rio.cattle.io/v1/rioinfo.go new file mode 100644 index 000000000..21fded8a9 --- /dev/null +++ b/pkg/generated/listers/admin.rio.cattle.io/v1/rioinfo.go @@ -0,0 +1,65 @@ +/* +Copyright 2019 Rancher Labs. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by main. DO NOT EDIT. + +package v1 + +import ( + v1 "github.com/rancher/rio/pkg/apis/admin.rio.cattle.io/v1" + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// RioInfoLister helps list RioInfos. +type RioInfoLister interface { + // List lists all RioInfos in the indexer. + List(selector labels.Selector) (ret []*v1.RioInfo, err error) + // Get retrieves the RioInfo from the index for a given name. + Get(name string) (*v1.RioInfo, error) + RioInfoListerExpansion +} + +// rioInfoLister implements the RioInfoLister interface. +type rioInfoLister struct { + indexer cache.Indexer +} + +// NewRioInfoLister returns a new RioInfoLister. +func NewRioInfoLister(indexer cache.Indexer) RioInfoLister { + return &rioInfoLister{indexer: indexer} +} + +// List lists all RioInfos in the indexer. +func (s *rioInfoLister) List(selector labels.Selector) (ret []*v1.RioInfo, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.RioInfo)) + }) + return ret, err +} + +// Get retrieves the RioInfo from the index for a given name. +func (s *rioInfoLister) Get(name string) (*v1.RioInfo, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("rioinfo"), name) + } + return obj.(*v1.RioInfo), nil +} diff --git a/pkg/generated/listers/rio.cattle.io/v1/expansion_generated.go b/pkg/generated/listers/rio.cattle.io/v1/expansion_generated.go index 535ac27bd..18b8d1404 100644 --- a/pkg/generated/listers/rio.cattle.io/v1/expansion_generated.go +++ b/pkg/generated/listers/rio.cattle.io/v1/expansion_generated.go @@ -34,14 +34,6 @@ type ExternalServiceListerExpansion interface{} // ExternalServiceNamespaceLister. type ExternalServiceNamespaceListerExpansion interface{} -// PublicDomainListerExpansion allows custom methods to be added to -// PublicDomainLister. -type PublicDomainListerExpansion interface{} - -// PublicDomainNamespaceListerExpansion allows custom methods to be added to -// PublicDomainNamespaceLister. -type PublicDomainNamespaceListerExpansion interface{} - // RouterListerExpansion allows custom methods to be added to // RouterLister. type RouterListerExpansion interface{} diff --git a/pkg/server/startup.go b/pkg/server/startup.go index 9535bbc20..889019bd8 100644 --- a/pkg/server/startup.go +++ b/pkg/server/startup.go @@ -57,58 +57,60 @@ func Types(ctx context.Context, config *rest.Config) error { } crds := crd.NonNamespacedTypes( - "Setting.project.rio.cattle.io/v1", "ClusterIssuer.certmanager.k8s.io/v1alpha1", + "ClusterBuildTemplate.build.knative.dev/v1alpha1", + + "RioInfo.admin.rio.cattle.io/v1", ) crds = append(crds, crd.NamespacedTypes( "BuildTemplate.build.knative.dev/v1alpha1", "Image.caching.internal.knative.dev/v1alpha1", + "App.rio.cattle.io/v1", "ExternalService.rio.cattle.io/v1", "Router.rio.cattle.io/v1", "Service.rio.cattle.io/v1", - "PublicDomain.rio.cattle.io/v1", - "App.rio.cattle.io/v1", "ClusterDomain.admin.rio.cattle.io/v1", "Feature.admin.rio.cattle.io/v1", "ListenConfig.admin.rio.cattle.io/v1", + "PublicDomain.admin.rio.cattle.io/v1", "DestinationRule.networking.istio.io/v1alpha3", "Gateway.networking.istio.io/v1alpha3", - "VirtualService.networking.istio.io/v1alpha3", "ServiceEntry.networking.istio.io/v1alpha3", + "VirtualService.networking.istio.io/v1alpha3", + "adapter.config.istio.io/v1alpha2", + "attributemanifest.config.istio.io/v1alpha2", "EgressRule.config.istio.io/v1alpha2", - "RouteRule.config.istio.io/v1alpha2", + "handler.config.istio.io/v1alpha2", "HTTPAPISpecBinding.config.istio.io/v1alpha2", "HTTPAPISpec.config.istio.io/v1alpha2", + "instance.config.istio.io/v1alpha2", + "kubernetes.config.istio.io/v1alpha2", + "kubernetesenv.config.istio.io/v1alpha2", + "logentry.config.istio.io/v1alpha2", + "metric.config.istio.io/v1alpha2", + "Policy.authentication.istio.io/v1alpha1", + "prometheus.config.istio.io/v1alpha2", "QuotaSpecBinding.config.istio.io/v1alpha2", "QuotaSpec.config.istio.io/v1alpha2", - "Policy.authentication.istio.io/v1alpha1", - "metric.config.istio.io/v1alpha2", + "RouteRule.config.istio.io/v1alpha2", "rule.config.istio.io/v1alpha2", - "prometheus.config.istio.io/v1alpha2", - "kubernetes.config.istio.io/v1alpha2", - "template.config.istio.io/v1alpha2", - "attributemanifest.config.istio.io/v1alpha2", - "instance.config.istio.io/v1alpha2", - "adapter.config.istio.io/v1alpha2", - "handler.config.istio.io/v1alpha2", - "logentry.config.istio.io/v1alpha2", "stdio.config.istio.io/v1alpha2", - "kubernetesenv.config.istio.io/v1alpha2", + "template.config.istio.io/v1alpha2", - "GitWatcher.gitwatcher.cattle.io/v1", "GitCommit.gitwatcher.cattle.io/v1", + "GitWatcher.gitwatcher.cattle.io/v1", "ServiceScaleRecommendation.autoscale.rio.cattle.io/v1", - "Issuer.certmanager.k8s.io/v1alpha1", + "Certificate.certmanager.k8s.io/v1alpha1", "Challenge.certmanager.k8s.io/v1alpha1", + "Issuer.certmanager.k8s.io/v1alpha1", "Order.certmanager.k8s.io/v1alpha1", - "Certificate.certmanager.k8s.io/v1alpha1", )...) factory.BatchCreateCRDs(ctx, crds...) From f43ec8bf189602b78649c533191072d617a03602 Mon Sep 17 00:00:00 2001 From: Darren Shepherd Date: Fri, 17 May 2019 14:58:01 -0700 Subject: [PATCH 2/3] Fix first commit --- .../build/controllers/gitcommit/controller.go | 32 +++++++++++++++---- .../build/controllers/service/controller.go | 13 +++++--- package/Dockerfile | 2 +- pkg/apis/rio.cattle.io/v1/service_types.go | 3 ++ stacks/bindata.go | 2 +- stacks/build-stack.yaml | 2 +- 6 files changed, 39 insertions(+), 15 deletions(-) diff --git a/modules/build/controllers/gitcommit/controller.go b/modules/build/controllers/gitcommit/controller.go index fb4d73fa6..2cd937306 100644 --- a/modules/build/controllers/gitcommit/controller.go +++ b/modules/build/controllers/gitcommit/controller.go @@ -17,9 +17,10 @@ import ( func Register(ctx context.Context, rContext *types.Context) error { h := Handler{ - ctx: ctx, - appsCache: rContext.Rio.Rio().V1().App().Cache(), - services: rContext.Rio.Rio().V1().Service(), + ctx: ctx, + appsCache: rContext.Rio.Rio().V1().App().Cache(), + services: rContext.Rio.Rio().V1().Service(), + gitWatcherCache: rContext.Webhook.Gitwatcher().V1().GitWatcher().Cache(), } wupdator := webhookv1controller.UpdateGitCommitOnChange(rContext.Webhook.Gitwatcher().V1().GitCommit().Updater(), h.onChange) @@ -29,9 +30,10 @@ func Register(ctx context.Context, rContext *types.Context) error { } type Handler struct { - ctx context.Context - appsCache riov1controller.AppCache - services riov1controller.ServiceController + ctx context.Context + appsCache riov1controller.AppCache + gitWatcherCache webhookv1controller.GitWatcherCache + services riov1controller.ServiceController } func (h Handler) updateBaseRevision(commit string, svc *riov1.Service) error { @@ -69,13 +71,29 @@ func (h Handler) onChange(key string, obj *webhookv1.GitCommit) (*webhookv1.GitC return nil, nil } - service, err := h.services.Cache().Get(obj.Namespace, obj.Spec.GitWebHookReceiverName) + gitWatcher, err := h.gitWatcherCache.Get(obj.Namespace, obj.Spec.GitWatcherName) + if err != nil { + return nil, err + } + + service, err := h.services.Cache().Get(obj.Namespace, obj.Spec.GitWatcherName) if err != nil { if errors.IsNotFound(err) { return obj, nil } return obj, err } + + if obj.Spec.Commit == gitWatcher.Status.FirstCommit { + if service.Status.FirstRevision == "" && service.Status.FirstRevision != gitWatcher.Status.FirstCommit { + service = service.DeepCopy() + service.Status.FirstRevision = gitWatcher.Status.FirstCommit + _, err := h.services.Update(service) + return obj, err + } + return obj, nil + } + return obj, webhookv1.GitWebHookExecutionConditionHandled.Once(obj, func() (runtime.Object, error) { appName, _ := services.AppAndVersion(service) specCopy := service.Spec.DeepCopy() diff --git a/modules/build/controllers/service/controller.go b/modules/build/controllers/service/controller.go index f899992d3..b806217c1 100644 --- a/modules/build/controllers/service/controller.go +++ b/modules/build/controllers/service/controller.go @@ -121,6 +121,9 @@ func (p *populator) populate(obj runtime.Object, ns *corev1.Namespace, os *objec func populateBuild(service *riov1.Service, customRegistry, systemNamespace, domain string, os *objectset.ObjectSet) error { // we only support setting imageBuild for primary container rev := service.Spec.Build.Revision + if rev == "" { + rev = service.Status.FirstRevision + } if rev == "" { return nil } @@ -163,11 +166,11 @@ func populateBuild(service *riov1.Service, customRegistry, systemNamespace, doma func populateWebhookAndSecrets(webhookService *riov1.Service, service *riov1.Service, os *objectset.ObjectSet) { webhookReceiver := webhookv1.NewGitWatcher(service.Namespace, service.Name, webhookv1.GitWatcher{ Spec: webhookv1.GitWatcherSpec{ - RepositoryURL: service.Spec.Build.Repo, - Enabled: true, - Push: true, - Tag: true, - Branch: service.Spec.Build.Branch, + RepositoryURL: service.Spec.Build.Repo, + Enabled: true, + Push: true, + Tag: true, + Branch: service.Spec.Build.Branch, RepositoryCredentialSecretName: service.Spec.Build.Secret, }, }) diff --git a/package/Dockerfile b/package/Dockerfile index 9f1f80a61..b4242887d 100644 --- a/package/Dockerfile +++ b/package/Dockerfile @@ -1,4 +1,4 @@ FROM alpine:3.9 -RUN apk -U --no-cache add ca-certificates git +RUN apk -U --no-cache add ca-certificates COPY bin/rio-controller /usr/bin/ CMD ["rio-controller"] diff --git a/pkg/apis/rio.cattle.io/v1/service_types.go b/pkg/apis/rio.cattle.io/v1/service_types.go index f224007b7..c2f27d952 100644 --- a/pkg/apis/rio.cattle.io/v1/service_types.go +++ b/pkg/apis/rio.cattle.io/v1/service_types.go @@ -307,6 +307,9 @@ type ServiceStatus struct { // Most recently observed status of the Deployment. DeploymentStatus *appsv1.DeploymentStatus `json:"deploymentStatus,omitempty"` + // The first observed commit for the build + FirstRevision string `json:"firstRevision,omitempty"` + // ScaleStatus for the Service ScaleStatus *ScaleStatus `json:"scaleStatus,omitempty"` diff --git a/stacks/bindata.go b/stacks/bindata.go index 274d02746..4e3e3252c 100644 --- a/stacks/bindata.go +++ b/stacks/bindata.go @@ -77,7 +77,7 @@ func (fi bindataFileInfo) Sys() interface{} { return nil } -var _stacksBuildStackYaml = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xbc\x59\x7f\x8f\xdb\x36\xd2\xfe\xdf\x9f\x82\x30\x0a\xa4\x0d\x56\xb6\x24\x5b\x96\x2c\x60\xf1\x76\xeb\x75\xdb\x7d\x93\xec\x2e\xd6\xee\x1d\x82\x22\x58\x50\xe4\xc8\xe6\x99\x12\x75\x24\xe5\x64\x2f\xcd\x77\x3f\x50\x12\x65\xf9\xd7\xe6\x90\xa4\x49\x80\xc0\xe2\x3c\x1c\xce\x3c\x9c\x19\x0e\x19\x22\xf2\x94\xad\x54\xdc\x43\x88\x8b\xd5\x8a\xe5\x2b\xf3\x13\x21\x22\x72\x0d\xb9\x8e\xd1\x5f\x4e\xf5\x5d\x89\x39\x6c\x81\x0f\x8c\x48\x0a\xce\x41\xc6\x88\xe5\xa9\x68\xe4\x5d\x84\x04\xaa\x1c\x96\x33\x7d\x0e\xb1\x62\xfa\x59\xf9\x7b\x48\xd6\x42\x6c\x0e\xc4\xff\xc1\x85\x63\xac\x04\xe9\xd4\x76\xc7\xe8\xaf\x56\x88\xd0\xc7\xce\x6f\x84\xfa\x95\xa6\x7e\x8c\xfa\x46\x47\xff\x62\x5f\x48\x8d\x50\x14\x19\xe4\xba\x1f\xa3\x14\x73\x05\x07\x08\x85\xb3\x82\xb3\x7c\xd5\x8f\x0f\x14\x23\xa3\x91\x69\x86\x8d\x72\xcf\x75\x2f\x0e\xa5\x7a\x0d\x12\x70\xaa\x41\xd6\x80\x3d\xf9\xa7\x83\x65\x44\xa9\x8b\x52\xdf\x63\xbd\x56\xfd\x18\xfd\xd9\x57\x9a\x8a\x52\xf7\xdf\x1d\xc0\x40\x4a\x21\xef\x8e\xb1\x20\xe5\x31\x36\x27\x82\xd6\x96\xf7\xff\xa5\x44\x7e\xe8\x7b\x25\x07\x39\xab\x28\x3c\xe5\x9e\x66\x19\xbc\x82\x27\x33\xbf\x7f\xe4\x5d\x45\x6b\x23\xad\x29\x3e\x82\xe4\xb8\x9d\x5f\x6f\xd7\x31\x84\x60\x13\x40\x0d\xa8\xfe\x38\x06\x65\xa0\x14\x5e\x59\x55\x99\x5a\x1d\x43\x94\xc6\x64\xa3\x25\x26\x16\xb5\x1b\x38\x61\x3a\xcb\x61\x9e\x5b\x6a\xce\xb8\x36\xaf\xd9\x39\x8d\x30\xcc\x3c\x0b\xa0\xa5\xc4\x9a\x89\xfc\x59\x50\xed\x6f\x17\xb2\x1f\x22\xbd\xee\xef\x9e\x02\xb9\x65\x04\xaa\x1c\x4d\x4a\xc6\xe9\x86\xe9\x3a\x49\x33\xfc\x61\x41\x30\x07\x13\x65\xf5\x00\xcb\xed\x80\xcd\x62\x52\x4a\x09\x39\x79\x8a\x51\x50\x0d\x15\x42\x6a\x55\x4f\x77\xd0\xd4\x75\xbd\xa1\x26\xc5\x85\xd5\x7b\xc1\x72\x0d\x32\xc7\xfc\x52\xcb\x12\x2a\x94\x7a\x52\x1a\xb2\x45\x01\x24\x6e\xec\x2a\x04\xed\x7e\xd6\xc5\x02\xb3\x1c\xa4\xda\x8d\x39\x88\x65\x78\x05\x31\xca\x44\xf2\x34\x6c\xed\xde\xba\x83\xd1\x60\xd4\x71\x10\xcb\x55\x67\x96\x99\xe7\x38\x98\x52\xb9\x37\xa4\x49\x11\x0f\x87\xee\xa0\xfa\x1b\x1b\xab\x3b\x62\x13\x6d\x71\xcb\x0c\xed\x48\x3a\xbe\x5a\x4d\xad\xa9\xf7\x42\xea\x18\x1d\xa8\x52\x40\x4a\xc9\xf4\xd3\xcc\x54\xbf\x0f\x3a\xde\xdb\x96\x42\xb2\x2d\xe3\xb0\x02\x1a\xa3\x86\x1d\x09\x2b\xa6\xb4\x7c\xaa\x81\x8d\xc3\xed\xa0\x5f\x8d\x72\x9c\x00\x6f\xad\x90\xf0\xef\x12\x94\x76\x54\x99\x50\x91\x61\x96\xc7\xe8\x85\x51\xf6\xa2\xd7\xac\x2f\x61\xb7\x3d\x92\x09\xe7\x3d\xe3\x94\x60\x49\xe3\x21\x68\x32\xb4\xba\x2b\x00\xe4\x5b\x8b\x7c\x98\xff\x76\xb3\x58\x3e\xbc\x7d\xfc\x7d\xb9\xbc\x7f\xbc\xba\xbe\x7e\xb8\xb4\x6c\x8d\xc7\xa3\x93\xa0\xe5\xeb\xc5\xe3\x6c\xfe\xb0\xbc\xf9\xf5\x66\x76\xb5\x9c\x5f\xee\xe9\x1f\x6a\xae\x06\x44\xea\xb3\x33\x5f\xcd\xdf\x9e\x98\xb1\x81\xa7\xe3\x20\x1b\x8f\x47\xc6\x88\x2a\xce\xf6\xec\xdf\x0a\x5e\x66\xd0\xe2\x94\x16\x12\xaf\xc0\x69\xf9\x1b\x6e\xb1\x1c\x72\x96\xec\x7b\x7d\x18\x6c\x4e\x13\x00\x04\xa4\x76\xc8\x1a\xc8\x06\x6c\xf0\xd4\x27\x4c\x1b\xc9\xbb\x1d\xc2\x39\x59\x83\x1c\x1a\x7e\xbb\xd3\x4c\x74\x7a\x03\xd7\x91\x24\xec\x4e\xb8\x2f\x39\xbf\x17\x9c\x99\x24\xba\xe2\xef\xf1\x93\xea\xb5\xe1\xb2\xdb\xae\xcf\x6e\x98\x3d\xd3\x2a\xf4\x8a\x8b\x04\xf3\xc7\x02\x64\xc6\x94\x62\x22\x6f\xbd\xe9\xbf\x44\x2b\xa6\xdf\x63\x6d\x4c\x1c\x10\xac\x35\x87\x01\x13\xc3\xdd\xa0\xea\x7f\x1e\x4a\x44\x96\x31\xdd\x22\x5f\xbc\x44\xf5\x89\x99\xe1\x42\xbd\xd8\x0d\xc2\x16\x72\xdd\x0e\x34\xfe\xf4\x4e\x50\xb5\x5b\xc7\x90\xe4\x0f\xea\xac\xd9\x25\xaf\xd3\xb1\xa4\x67\xf3\x98\x33\xa5\x21\xaf\xd2\x19\x94\x6a\x86\xe3\xc8\x9d\xba\xbd\x93\xe4\xe2\x1d\xb9\x7b\x11\x64\x66\x54\xe1\xb3\xd6\xba\x70\x1a\x1e\x59\x8e\xb5\x90\xb6\x26\x3a\x9d\xae\xe4\x33\x04\xbf\x78\x69\x2a\x58\x97\x05\x13\x40\xaa\xc0\x04\xba\x83\x0d\x19\x67\xc9\xaa\x20\x55\x65\xc6\x84\x88\x72\x5f\x72\x9a\xec\x0f\xa6\xa5\x32\xa6\x0c\x29\x14\x5c\x3c\x65\x7b\xfa\x88\x04\xac\xe1\x62\x05\xfa\xc2\x10\x77\x51\xb1\x79\x51\x54\xff\x96\x05\x35\x32\x0a\x1c\x34\xd4\x1e\x0f\x36\x39\xd6\x6c\x0b\x03\x0a\xdb\xba\xbe\x7e\x4b\x55\x43\xa5\xb1\x2e\xbf\xa1\x46\x0d\x59\xc1\xb1\x86\x6f\xa3\x92\xf0\x52\x69\x90\x67\x34\xbf\x44\x04\x93\x35\xcb\x57\x03\x7b\x9c\xed\x4d\xae\xe2\xae\x8b\xc6\x05\xab\xf6\xa6\x0a\x93\xc1\x26\x52\x26\x89\x48\xa9\xb4\xc8\x24\x28\x51\x4a\x02\x14\xd2\xaa\xe9\x13\x79\x33\xb1\xc9\x8f\x15\x91\x06\xdc\xa8\x77\x24\x70\xc0\x0a\x94\xc9\x97\x75\x99\x0c\x88\xc8\xac\xac\xa6\x61\x48\x32\x3a\xdc\xc5\xea\xcf\x6a\x8d\xfd\x60\x12\x87\x61\x12\x45\xa3\x14\x48\x18\xf9\x6e\x42\x47\xbe\x37\x25\xae\xe7\x85\xd3\x49\x1a\x04\x7e\xea\x05\x41\xe8\x63\x77\x14\x46\xd3\x20\x4d\x20\xc4\x21\x09\x23\x12\x8e\xfc\x28\xa5\xd3\x89\x17\x85\xb6\x32\xda\x5e\xde\x38\xd6\xf4\xf3\x43\xdb\xca\x57\xf5\xa8\xc6\x38\x8d\xec\xf0\x18\x59\xbc\x5d\x2c\xe7\x6f\x1e\x6f\xaf\xde\xcc\x17\xf7\x57\xb3\xf9\xe5\x0f\x1f\xdb\xdf\x9f\x8e\x32\xde\x68\xd1\xa2\x6e\x42\xed\x50\xfd\xa5\xd7\x12\xd4\x5a\x70\xda\x0c\xdf\xdc\xfe\x7a\x67\x11\xcd\xe5\xc0\xd0\x67\x2b\xc7\x17\x71\xd8\xde\x31\x2c\x87\x90\xa4\x41\x94\x46\xe3\x88\x4c\x02\x12\xb8\x38\xf4\x82\x08\x7b\x41\x40\x93\x10\xdc\x51\x34\x26\xa3\xf1\xc8\xf5\x7d\x2f\x98\x8c\xc9\x38\x49\x70\x1a\x8d\x20\x4a\x13\x0a\x51\x1a\x06\x93\xd4\x5a\xe3\x54\x77\x93\xaf\x35\xcf\x5e\x70\xac\x71\xee\x34\xf5\xfd\xa9\x37\xf5\x83\x49\x82\xc7\x69\x38\x0e\x3c\x18\x43\x30\x0d\x7c\x3f\x4c\x93\x28\xf0\x13\x17\x07\x01\x04\xe0\xc1\x78\x32\x1d\x93\x24\xa4\x69\x90\x60\x17\xd3\x70\xec\x27\xbe\x3d\xc2\x9d\x5c\x14\x5f\x6f\x5c\x2e\x0a\x6b\x17\x1e\x79\x11\x40\xe8\x47\x34\xf0\x26\x69\x1a\x8e\x7c\xf0\xa3\x89\x47\x5c\x9f\xd2\x34\x9a\x78\xd3\x10\x02\x9f\x4c\xfc\x28\x72\xc7\xd3\xc9\x34\x08\x23\x0f\x93\x24\x0c\x3d\x97\x44\x63\x8f\x8e\x7b\xbd\xde\xa6\x4c\x40\xe6\xa0\xeb\x93\x3c\xc3\x39\x4b\x41\xed\x6e\x8e\xb8\x60\xff\x00\x69\x52\x2b\x3e\x9d\x68\x5b\x2f\x01\x8d\xeb\x03\x65\xc3\x72\x1a\xa3\x59\x95\x7a\x0f\x4d\xea\x5d\xb7\xa9\x57\xf7\xb8\xa0\x31\xc5\x1a\xdb\x53\x77\xbf\xbf\x42\x68\xaf\x4c\x48\xea\xb0\x5c\x69\xcc\x79\x8c\xfa\xa6\x11\xb0\x9d\x76\xa7\x69\x54\x83\xa3\xfa\x52\x37\x63\x9d\x1e\x17\x53\x5a\x59\x80\xf9\xbd\xac\x6a\xca\xcc\xf4\x2e\x79\xe7\xe8\xff\xff\xc5\xdd\xad\xb9\x99\xc5\x68\x50\x97\x4e\x73\x4f\xae\x27\xa9\x3f\xff\xef\xc7\x9f\x07\xfa\xa9\x80\xcb\xcb\xfe\xa2\x24\x04\x80\x02\xed\xff\xf4\xae\x41\xb6\xa6\xd7\x46\xb5\x88\x76\xdc\x4c\x8d\x91\xd2\xd2\xa6\xec\x17\x2f\x28\x01\xab\x86\xc7\xdd\x82\x0f\xfb\x83\xff\xe3\x6a\x4a\x63\xa9\x97\x2c\x83\x43\xf3\x8f\xc6\x6b\x85\xa6\xa0\x3f\x6b\x7c\x56\x70\x30\xd6\x9f\xd0\x39\x3b\x2d\x3c\x52\xbc\x92\xa2\x2c\xe2\xe3\xf3\xa2\xb3\xe9\x9d\x48\x21\x58\xc3\x4a\x48\x06\x7b\xd7\x16\xcc\x79\xe7\xab\x51\xb2\x8b\xae\x2a\x40\x7f\x31\x0b\xb4\x63\x05\x2f\x25\xe6\x36\x9a\x6c\x6f\x48\x84\x31\xee\xd6\xb6\x16\x16\xae\xca\xc4\x9e\x29\x9d\x65\x6b\x12\x62\xf4\xd1\xde\xfd\xb6\x36\x65\xb6\x1e\xe6\xc5\xba\x49\x0f\xc7\x39\xce\xa9\x67\x8f\xba\xbd\xd9\xb5\xed\x37\x6d\xf5\x38\xcc\xa4\xa6\x8f\x6e\x0b\x6b\x97\x35\xe3\x42\x8c\x8e\x8e\x83\x6e\x8e\x7c\xd5\x89\xf8\x37\x55\xf3\xef\xc0\x97\xad\xf4\xdf\x91\xad\xbf\xe7\x70\xf9\x1e\x5c\x11\xe5\xa4\xb0\xbb\x24\x7c\x29\x5d\x84\x8b\x92\x3a\x15\x21\x20\xd5\xf0\x50\xed\xf7\x70\x25\x17\xc5\x77\xdc\xf1\x6f\x79\x62\x9f\x63\xe8\xb8\xcb\x3e\x41\xcb\xac\x6e\xbc\xab\x02\xb8\x6c\x1a\xef\x67\x58\xb2\xaf\x32\x47\x64\x14\x58\xe2\x0c\x74\xe7\xc9\xc8\xde\xe3\x6f\xde\x5c\xfd\x36\x6f\x0b\x23\x05\x45\x24\x2b\x74\x65\xe1\x3f\xd7\x20\x01\x69\x81\x8a\x32\xe1\x4c\xad\x91\x5e\x03\x92\xa0\x4a\xae\x59\xbe\x42\xbb\xbe\x68\xa7\xed\xfa\x6e\xf6\x6a\xfe\xf0\xeb\xcd\xeb\x33\x2a\x97\x6b\xa8\x90\x48\xa4\x95\xb6\x6b\x41\x36\x20\x53\xc6\xa1\x83\x4f\x71\xc9\x75\x8c\xfa\x3b\x61\xff\x60\x99\xfb\x3f\x16\xbf\x9f\xb5\x59\xaf\x41\xa2\xa2\x54\x6b\x24\x24\xca\x85\x3e\xa1\xb9\xdb\x9a\xb4\xa6\xdf\x3c\xcc\x67\xcb\xbb\x87\xb7\xe7\x2d\xa7\x4c\x02\xd1\x42\x3e\xd9\x57\x11\x43\x83\x71\x03\x17\xc5\x89\x55\x86\xef\x85\xdc\x54\xa1\x7a\xb8\xd6\x2f\x7f\xdc\xbc\xbe\x7e\x75\xb3\x7c\x9c\xbd\xbe\x99\xdf\x2e\x1f\x9f\xd9\x84\x43\xc6\xaa\x50\x78\xc5\x34\x22\x9c\x41\xae\xd1\x8f\xd5\x9e\x13\xcd\x7f\xda\xdb\x90\xae\x1d\x27\x9e\x04\x3d\x47\x0a\xa1\x39\x28\x65\xe3\xdc\x1f\xbb\x21\x21\x61\xea\x8f\xc1\x0b\xc6\x38\x4c\x26\xd3\xe9\x34\x9c\x92\x90\x00\x8d\xa2\x49\xe4\x06\x04\x93\x49\x38\xf5\x5d\x6f\x32\xa5\x04\x12\x42\xf0\xd4\x9b\x4c\xc6\xd3\x11\x80\x9f\x4c\xce\xba\x78\x7d\x35\x7f\x73\x77\x5b\x3d\x92\xcd\x17\x8b\xf3\x4e\x36\xcf\x16\x47\x7e\x52\x0c\x99\xc8\x1b\x3f\x37\x4c\xd3\x9f\xec\x43\xc0\xa9\x8d\xad\x5e\x2e\x5b\x68\xec\xf9\xa3\xb1\xb5\x4c\x69\x28\x8e\xc2\xbf\x7e\xcd\xc0\x39\x75\x4c\xc4\xb4\x1a\x9b\xe2\xf1\xc3\x0f\x1f\x4f\x6e\xd5\xee\xc9\xd8\x6c\x31\xcb\x57\xd7\x4c\x56\xe8\x36\x88\x76\x08\x22\xb2\x0c\x9b\x5c\xfe\xb3\x6f\xb7\xaa\x7f\x81\xfa\xf5\xb3\xeb\x65\x77\x85\x7d\xa6\x3e\x19\x54\x35\xe3\xe8\x45\xdb\xfc\xe9\x3b\x4e\x21\xc5\xca\x50\x76\x59\x70\xcc\x0e\xff\xdb\xa1\x45\xa5\xb2\xba\x90\xd2\x4b\xda\xa6\xd3\x60\xeb\x7e\x0e\xed\x88\x42\x1b\x03\x0c\xdc\x30\x65\x0c\xdd\x25\xf7\xa7\x73\xd3\xb9\x20\xb8\x72\x8f\xd4\x4f\xba\x97\x83\xda\xd7\x76\x7c\x67\x84\x11\x9d\x56\x02\x1f\x0a\x21\x35\xc8\xcb\x6a\x17\x6a\x05\x76\xcc\xda\x65\x6d\xaa\xb7\xe3\x34\xc6\xec\xa8\xc1\x98\x6a\xf1\xa9\xff\xae\xf7\xdf\x00\x00\x00\xff\xff\x1d\x62\x82\x8c\x7d\x1b\x00\x00") +var _stacksBuildStackYaml = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xbc\x59\x7f\x8f\xdb\x36\xd2\xfe\xdf\x9f\x82\x30\x0a\xa4\x0d\x56\xb6\x24\x5b\x96\x2c\x60\xf1\x76\xeb\x75\xdb\x7d\x93\xec\x2e\xd6\xee\x1d\x82\x22\x58\x50\xe4\xc8\xe6\x99\x12\x75\x24\xe5\x64\x2f\xcd\x77\x3f\x50\x12\x65\xf9\xd7\xe6\x90\xa4\x49\x80\xc0\xe2\x3c\x1c\xce\x3c\x9c\x19\x0e\x19\x22\xf2\x94\xad\x54\xdc\x43\x88\x8b\xd5\x8a\xe5\x2b\xf3\x13\x21\x22\x72\x0d\xb9\x8e\xd1\x5f\x4e\xf5\x5d\x89\x39\x6c\x81\x0f\x8c\x48\x0a\xce\x41\xc6\x88\xe5\xa9\x68\xe4\x5d\x84\x04\xaa\x1c\x96\x33\x7d\x0e\xb1\x62\xfa\x59\xf9\x7b\x48\xd6\x42\x6c\x0e\xc4\xff\xc1\x85\x63\xac\x04\xe9\xd4\x76\xc7\xe8\xaf\x56\x88\xd0\xc7\xce\x6f\x84\xfa\x95\xa6\x7e\x8c\xfa\x46\x47\xff\x62\x5f\x48\x8d\x50\x14\x19\xe4\xba\x1f\xa3\x14\x73\x05\x07\x08\x85\xb3\x82\xb3\x7c\xd5\x8f\x0f\x14\x23\xa3\x91\x69\x86\x8d\x72\xcf\x75\x2f\x0e\xa5\x7a\x0d\x12\x70\xaa\x41\xd6\x80\x3d\xf9\xa7\x83\x65\x44\xa9\x8b\x52\xdf\x63\xbd\x56\xfd\x18\xfd\xd9\x57\x9a\x8a\x52\xf7\xdf\x1d\xc0\x40\x4a\x21\xef\x8e\xb1\x20\xe5\x31\x36\x27\x82\xd6\x96\xf7\xff\xa5\x44\x7e\xe8\x7b\x25\x07\x39\xab\x28\x3c\xe5\x9e\x66\x19\xbc\x82\x27\x33\xbf\x7f\xe4\x5d\x45\x6b\x23\xad\x29\x3e\x82\xe4\xb8\x9d\x5f\x6f\xd7\x31\x84\x60\x13\x40\x0d\xa8\xfe\x38\x06\x65\xa0\x14\x5e\x59\x55\x99\x5a\x1d\x43\x94\xc6\x64\xa3\x25\x26\x16\xb5\x1b\x38\x61\x3a\xcb\x61\x9e\x5b\x6a\xce\xb8\x36\xaf\xd9\x39\x8d\x30\xcc\x3c\x0b\xa0\xa5\xc4\x9a\x89\xfc\x59\x50\xed\x6f\x17\xb2\x1f\x22\xbd\xee\xef\x9e\x02\xb9\x65\x04\xaa\x1c\x4d\x4a\xc6\xe9\x86\xe9\x3a\x49\x33\xfc\x61\x41\x30\x07\x13\x65\xf5\x00\xcb\xed\x80\xcd\x62\x52\x4a\x09\x39\x79\x8a\x51\x50\x0d\x15\x42\x6a\x55\x4f\x77\xd0\xd4\x75\xbd\xa1\x26\xc5\x85\xd5\x7b\xc1\x72\x0d\x32\xc7\xfc\x52\xcb\x12\x2a\x94\x7a\x52\x1a\xb2\x45\x01\x24\x6e\xec\x2a\x04\xed\x7e\xd6\xc5\x02\xb3\x1c\xa4\xda\x8d\x39\x88\x65\x78\x05\x31\xca\x44\xf2\x34\x6c\xed\xde\xba\x83\xd1\x60\xd4\x71\x10\xcb\x55\x67\x96\x99\xe7\x38\x98\x52\xb9\x37\xa4\x49\x11\x0f\x87\xee\xa0\xfa\x1b\x1b\xab\x3b\x62\x13\x6d\x71\xcb\x0c\xed\x48\x3a\xbe\x5a\x4d\xad\xa9\xf7\x42\xea\x18\x1d\xa8\x52\x40\x4a\xc9\xf4\xd3\xcc\x54\xbf\x0f\x3a\xde\xdb\x96\x42\xb2\x2d\xe3\xb0\x02\x1a\xa3\x86\x1d\x09\x2b\xa6\xb4\x7c\xaa\x81\x8d\xc3\xed\xa0\x5f\x8d\x72\x9c\x00\x6f\xad\x90\xf0\xef\x12\x94\x76\x54\x99\x50\x91\x61\x96\xc7\xe8\x85\x51\xf6\xa2\xd7\xac\x2f\x61\xb7\x3d\x92\x09\xe7\x3d\xe3\x94\x60\x49\xe3\x21\x68\x32\xb4\xba\x2b\x00\xe4\x5b\x8b\x7c\x98\xff\x76\xb3\x58\x3e\xbc\x7d\xfc\x7d\xb9\xbc\x7f\xbc\xba\xbe\x7e\xb8\xb4\x6c\x8d\xc7\xa3\x93\xa0\xe5\xeb\xc5\xe3\x6c\xfe\xb0\xbc\xf9\xf5\x66\x76\xb5\x9c\x5f\xee\xe9\x1f\x6a\xae\x06\x44\xea\xb3\x33\x5f\xcd\xdf\x9e\x98\xb1\x81\xa7\xe3\x20\x1b\x8f\x47\xc6\x88\x2a\xce\xf6\xec\xdf\x0a\x5e\x66\xd0\xe2\x94\x16\x12\xaf\xc0\x69\xf9\x1b\x6e\xb1\x1c\x72\x96\xec\x7b\x7d\x18\x6c\x4e\x13\x00\x04\xa4\x76\xc8\x1a\xc8\x06\x6c\xf0\xd4\x27\x4c\x1b\xc9\xbb\x1d\xc2\x39\x59\x83\x1c\x1a\x7e\xbb\xd3\x4c\x74\x7a\x03\xd7\x91\x24\xec\x4e\xb8\x2f\x39\xbf\x17\x9c\x99\x24\xba\xe2\xef\xf1\x93\xea\xb5\xe1\xb2\xdb\xae\xcf\x6e\x98\x3d\xd3\x2a\xf4\x8a\x8b\x04\xf3\xc7\x02\x64\xc6\x94\x62\x22\x6f\xbd\xe9\xbf\x44\x2b\xa6\xdf\x63\x6d\x4c\x1c\x10\xac\x35\x87\x01\x13\xc3\xdd\xa0\xea\x7f\x1e\x4a\x44\x96\x31\xdd\x22\x5f\xbc\x44\xf5\x89\x99\xe1\x42\xbd\xd8\x0d\xc2\x16\x72\xdd\x0e\x34\xfe\xf4\x4e\x50\xb5\x5b\xc7\x90\xe4\x0f\xea\xd8\xde\x25\xaf\xd3\xb1\xa4\x67\xf3\x98\x33\xa5\x21\xaf\xd2\x19\x94\x6a\x86\xe3\xc8\x9d\xba\xbd\x93\xe4\xe2\x1d\xb9\x7b\x11\x64\x66\x54\xe1\xb3\xd6\xba\x70\x1a\x1e\x59\x8e\xb5\x90\xb6\x26\x3a\x9d\xae\xe4\x33\x04\xbf\x78\x69\x2a\x58\x97\x05\x13\x40\xaa\xc0\x04\xba\x83\x0d\x19\x67\xc9\xaa\x20\x55\x65\xc6\x84\x88\x72\x5f\x72\x9a\xec\x0f\xa6\xa5\x32\xa6\x0c\x29\x14\x5c\x3c\x65\x7b\xfa\x88\x04\xac\xe1\x62\x05\xfa\xc2\x10\x77\x51\xb1\x79\x51\x54\xff\x96\x05\x35\x32\x0a\x1c\x34\xd4\x1e\x0f\x36\x39\xd6\x6c\x0b\x03\x0a\xdb\xba\xbe\x7e\x4b\x55\x43\xa5\xb1\x2e\xbf\xa1\x46\x0d\x59\xc1\xb1\x86\x6f\xa3\x92\xf0\x52\x69\x90\x67\x34\xbf\x44\x04\x93\x35\xcb\x57\x03\x7b\x9c\xed\x4d\xae\xe2\xae\x8b\xc6\x05\xab\xf6\xa6\x0a\x93\xc1\x26\x52\x26\x89\x48\xa9\xb4\xc8\x24\x28\x51\x4a\x02\x14\xd2\xaa\xe9\x13\x79\x33\xb1\xc9\x8f\x15\x91\x06\xdc\xa8\x77\x24\x70\xc0\x0a\x94\xc9\x97\x75\x99\x0c\x88\xc8\xac\xac\xa6\x61\x48\x32\x3a\xdc\xc5\xea\xcf\x6a\x8d\xfd\x60\x12\x87\x61\x12\x45\xa3\x14\x48\x18\xf9\x6e\x42\x47\xbe\x37\x25\xae\xe7\x85\xd3\x49\x1a\x04\x7e\xea\x05\x41\xe8\x63\x77\x14\x46\xd3\x20\x4d\x20\xc4\x21\x09\x23\x12\x8e\xfc\x28\xa5\xd3\x89\x17\x85\xb6\x32\xda\x5e\xde\x38\xd6\xf4\xf3\x43\xdb\xca\x57\xf5\xa8\xc6\x38\x8d\xec\xf0\x18\x59\xbc\x5d\x2c\xe7\x6f\x1e\x6f\xaf\xde\xcc\x17\xf7\x57\xb3\xf9\xe5\x0f\x1f\xdb\xdf\x9f\x8e\x32\xde\x68\xd1\xa2\x6e\x42\xed\x50\xfd\xa5\xd7\x12\xd4\x5a\x70\xda\x0c\xdf\xdc\xfe\x7a\x67\x11\xcd\xe5\xc0\xd0\x67\x2b\xc7\x17\x71\xd8\xde\x31\x2c\x87\x90\xa4\x41\x94\x46\xe3\x88\x4c\x02\x12\xb8\x38\xf4\x82\x08\x7b\x41\x40\x93\x10\xdc\x51\x34\x26\xa3\xf1\xc8\xf5\x7d\x2f\x98\x8c\xc9\x38\x49\x70\x1a\x8d\x20\x4a\x13\x0a\x51\x1a\x06\x93\xd4\x5a\xe3\x54\x77\x93\xaf\x35\xcf\x5e\x70\xac\x71\xee\x34\xf5\xfd\xa9\x37\xf5\x83\x49\x82\xc7\x69\x38\x0e\x3c\x18\x43\x30\x0d\x7c\x3f\x4c\x93\x28\xf0\x13\x17\x07\x01\x04\xe0\xc1\x78\x32\x1d\x93\x24\xa4\x69\x90\x60\x17\xd3\x70\xec\x27\xbe\x3d\xc2\x9d\x5c\x14\x5f\x6f\x5c\x2e\x0a\x6b\x17\x1e\x79\x11\x40\xe8\x47\x34\xf0\x26\x69\x1a\x8e\x7c\xf0\xa3\x89\x47\x5c\x9f\xd2\x34\x9a\x78\xd3\x10\x02\x9f\x4c\xfc\x28\x72\xc7\xd3\xc9\x34\x08\x23\x0f\x93\x24\x0c\x3d\x97\x44\x63\x8f\x8e\x7b\xbd\xde\xa6\x4c\x40\xe6\xa0\xeb\x93\x3c\xc3\x39\x4b\x41\xed\x6e\x8e\xb8\x60\xff\x00\x69\x52\x2b\x3e\x9d\x68\x5b\x2f\x01\x8d\xeb\x36\x6c\xc3\x72\x1a\xa3\x59\x95\x7a\x0f\x4d\xea\x5d\xb7\xa9\x57\xf7\xb8\xa0\x31\xc5\x1a\xdb\x53\x77\xbf\xbf\x42\x68\xaf\x4c\x48\xea\xb0\x5c\x69\xcc\x79\x8c\xfa\xa6\x11\xb0\x9d\x76\xa7\x69\x54\x83\xa3\xfa\x52\x37\x63\x9d\x1e\x17\x53\x5a\x59\x80\xf9\xbd\xac\x6a\xca\xcc\xf4\x2e\x79\xe7\xe8\xff\xff\xc5\xdd\xad\xb9\x99\xc5\x68\x50\x97\x4e\x73\x4f\xae\x27\xa9\x3f\xff\xef\xc7\x9f\x07\xfa\xa9\x80\xcb\xcb\xfe\xa2\x24\x04\x80\x02\xed\xff\xf4\xae\x41\xb6\xa6\xd7\x46\xb5\x88\x76\xdc\x4c\x8d\x91\xd2\xd2\xa6\xec\x17\x2f\x28\x01\xab\x86\xc7\xdd\x82\x0f\xfb\x83\xff\xe3\x6a\x4a\x63\xa9\x97\x2c\x83\x43\xf3\x8f\xc6\x6b\x85\xa6\xa0\x3f\x6b\x7c\x56\x70\x30\xd6\x9f\xd0\x39\x3b\x2d\x3c\x52\xbc\x92\xa2\x2c\xe2\xe3\xf3\xa2\xb3\xe9\x9d\x48\x21\x58\xc3\x4a\x48\x06\x7b\xd7\x16\xcc\x79\xe7\xab\x51\xb2\x8b\xae\x2a\x40\x7f\x31\x0b\xb4\x63\x05\x2f\x25\xe6\x36\x9a\x6c\x6f\x48\x84\x31\xee\xd6\xb6\x16\x16\xae\xca\xc4\x9e\x29\x9d\x65\x6b\x12\x62\xf4\xd1\xde\xfd\xb6\x36\x65\xb6\x1e\xe6\xc5\xba\x49\x0f\xc7\x39\xce\xa9\x67\x8f\xba\xbd\xd9\xb5\xed\x37\x6d\xf5\x38\xcc\xa4\xa6\x8f\x6e\x0b\x6b\x97\x35\xe3\x42\x8c\x8e\x8e\x83\x6e\x8e\x7c\xd5\x89\xf8\x37\x55\xf3\xef\xc0\x97\xad\xf4\xdf\x91\xad\xbf\xe7\x70\xf9\x1e\x5c\x11\xe5\xa4\xb0\xbb\x24\x7c\x29\x5d\x84\x8b\x92\x3a\x15\x21\x20\xd5\xf0\x50\xed\xf7\x70\x25\x17\xc5\x77\xdc\xf1\x6f\x79\x62\x9f\x63\xe8\xb8\xcb\x3e\x41\xcb\xac\x6e\xbc\xab\x02\xb8\x6c\x1a\xef\x67\x58\xb2\xaf\x32\x47\x64\x14\x58\xe2\x0c\x74\xe7\xc9\xc8\xde\xe3\x6f\xde\x5c\xfd\x36\x6f\x0b\x23\x05\x45\x24\x2b\x74\x65\xe1\x3f\xd7\x20\x01\x69\x81\x8a\x32\xe1\x4c\xad\x91\x5e\x03\x92\xa0\x4a\xae\x59\xbe\x42\xbb\xbe\x68\xa7\xed\xfa\x6e\xf6\x6a\xfe\xf0\xeb\xcd\xeb\x33\x2a\x97\x6b\xa8\x90\x48\xa4\x95\xb6\x6b\x41\x36\x20\x53\xc6\xa1\x83\x4f\x71\xc9\x75\x8c\xfa\x3b\x61\xff\x60\x99\xfb\x3f\x16\xbf\x9f\xb5\x59\xaf\x41\xa2\xa2\x54\x6b\x24\x24\xca\x85\x3e\xa1\xb9\xdb\x9a\xb4\xa6\xdf\x3c\xcc\x67\xcb\xbb\x87\xb7\xe7\x2d\xa7\x4c\x02\xd1\x42\x3e\xd9\x57\x11\x43\x83\x71\x03\x17\xc5\x89\x55\x86\xef\x85\xdc\x54\xa1\x7a\xb8\xd6\x2f\x7f\xdc\xbc\xbe\x7e\x75\xb3\x7c\x9c\xbd\xbe\x99\xdf\x2e\x1f\x9f\xd9\x84\x43\xc6\xaa\x50\x78\xc5\x34\x22\x9c\x41\xae\xd1\x8f\xd5\x9e\x13\xcd\x7f\xda\xdb\x90\xae\x1d\x27\x9e\x04\x3d\x47\x0a\xa1\x39\x28\x65\xe3\xdc\x1f\xbb\x21\x21\x61\xea\x8f\xc1\x0b\xc6\x38\x4c\x26\xd3\xe9\x34\x9c\x92\x90\x00\x8d\xa2\x49\xe4\x06\x04\x93\x49\x38\xf5\x5d\x6f\x32\xa5\x04\x12\x42\xf0\xd4\x9b\x4c\xc6\xd3\x11\x80\x9f\x4c\xce\xba\x78\x7d\x35\x7f\x73\x77\x5b\x3d\x92\xcd\x17\x8b\xf3\x4e\x36\xcf\x16\x47\x7e\x52\x0c\x99\xc8\x1b\x3f\x37\x4c\xd3\x9f\xec\x43\xc0\xa9\x8d\xad\x5e\x2e\x5b\x68\xec\xf9\xa3\xb1\xb5\x4c\x69\x28\x8e\xc2\xbf\x7e\xcd\xc0\x39\x75\x4c\xc4\xb4\x1a\x9b\xe2\xf1\xc3\x0f\x1f\x4f\x6e\xd5\xee\xc9\xd8\x6c\x31\xcb\x57\xd7\x4c\x56\xe8\x36\x88\x76\x08\x22\xb2\x0c\x9b\x5c\xfe\xb3\x6f\xb7\xaa\x7f\x81\xfa\xf5\xb3\xeb\x65\x77\x85\x7d\xa6\x3e\x19\x54\x35\xe3\xe8\x45\xdb\xfc\xe9\x3b\x4e\x21\xc5\xca\x50\x76\x59\x70\xcc\x0e\xff\xdb\xa1\x45\xa5\xb2\xba\x90\xd2\x4b\xda\xa6\xd3\x60\xeb\x7e\x0e\xed\x88\x42\x1b\x03\x0c\xdc\x30\x65\x0c\xdd\x25\xf7\xa7\x73\xd3\xb9\x20\xb8\x72\x8f\xd4\x4f\xba\x97\x83\xda\xd7\x76\x7c\x67\x84\x11\x9d\x56\x02\x1f\x0a\x21\x35\xc8\xcb\x6a\x17\x6a\x05\x76\xcc\xda\x65\x6d\xaa\xb7\xe3\x34\xc6\xec\xa8\xc1\x98\x6a\xf1\xa9\xff\xae\xf7\xdf\x00\x00\x00\xff\xff\xb9\x16\x71\xee\x7d\x1b\x00\x00") func stacksBuildStackYamlBytes() ([]byte, error) { return bindataRead( diff --git a/stacks/build-stack.yaml b/stacks/build-stack.yaml index 9ec41a31c..e97b88a62 100644 --- a/stacks/build-stack.yaml +++ b/stacks/build-stack.yaml @@ -78,7 +78,7 @@ services: - '* configmaps' - '* events' - secrets - image: rancher/gitwatcher:v0.2.1 + image: rancher/gitwatcher:v0.2.2 args: - gitwatcher - --listen-address From 32ad8df58025672f7a54010758287263948c4509 Mon Sep 17 00:00:00 2001 From: Darren Shepherd Date: Fri, 17 May 2019 13:57:36 -0700 Subject: [PATCH 3/3] Update vendor --- trash.lock | 2 +- vendor.conf | 2 +- vendor/github.com/rancher/gitwatcher/go.mod | 4 +-- vendor/github.com/rancher/gitwatcher/go.sum | 4 +++ .../pkg/apis/gitwatcher.cattle.io/v1/types.go | 26 +++++++++---------- 5 files changed, 21 insertions(+), 17 deletions(-) diff --git a/trash.lock b/trash.lock index d0a7fe9d9..d699036e0 100755 --- a/trash.lock +++ b/trash.lock @@ -128,7 +128,7 @@ import: - package: github.com/rancher/axe version: 84566a81582b26b0195c5ccd194473f9d8296ee5 - package: github.com/rancher/gitwatcher - version: bcb7b44baef4cc5a776813c5c9c1c98493a9120a + version: v0.2.2 - package: github.com/rancher/mapper version: 84da984f31461af0a2f39f3079bbbd8efe4bc4bb - package: github.com/rancher/rdns-server diff --git a/vendor.conf b/vendor.conf index 1078689d6..a64725c43 100644 --- a/vendor.conf +++ b/vendor.conf @@ -6,7 +6,7 @@ k8s.io/kubernetes v1.14.1-k3s.4 github.com/rancher/wrangler a7cf48fa83ef5cc872170f850aa771ef818a196b github.com/rancher/mapper 84da984f31461af0a2f39f3079bbbd8efe4bc4bb -github.com/rancher/gitwatcher bcb7b44baef4cc5a776813c5c9c1c98493a9120a +github.com/rancher/gitwatcher v0.2.2 github.com/rancher/wrangler-api 347e75e8ad4cfe3d411ac07abc7626ea3e34a4be https://github.com/StrongMonkey/wrangler-api.git github.com/Masterminds/semver v1.4.2 github.com/Masterminds/sprig v2.15.0 diff --git a/vendor/github.com/rancher/gitwatcher/go.mod b/vendor/github.com/rancher/gitwatcher/go.mod index 0f7e170b5..04d0e2b49 100644 --- a/vendor/github.com/rancher/gitwatcher/go.mod +++ b/vendor/github.com/rancher/gitwatcher/go.mod @@ -9,8 +9,8 @@ require ( github.com/google/uuid v1.1.1 github.com/gorilla/mux v1.7.1 github.com/pkg/errors v0.8.1 - github.com/rancher/wrangler v0.0.0-20190516181950-a7cf48fa83ef - github.com/rancher/wrangler-api v0.0.0-20190516182105-c5ea888bdf54 + github.com/rancher/wrangler v0.1.0 + github.com/rancher/wrangler-api v0.1.1 github.com/sirupsen/logrus v1.4.1 github.com/spf13/pflag v1.0.3 // indirect github.com/urfave/cli v1.20.0 diff --git a/vendor/github.com/rancher/gitwatcher/go.sum b/vendor/github.com/rancher/gitwatcher/go.sum index 4b711f080..8b026ae39 100644 --- a/vendor/github.com/rancher/gitwatcher/go.sum +++ b/vendor/github.com/rancher/gitwatcher/go.sum @@ -91,10 +91,14 @@ github.com/rancher/wrangler v0.0.0-20190516065845-c1b3a51a1fac h1:7cLgBAOmh8FQSa github.com/rancher/wrangler v0.0.0-20190516065845-c1b3a51a1fac/go.mod h1:HM0BuhAugqM5cGtQn2hrMwpbExuLQe7NCUTD+crAxV0= github.com/rancher/wrangler v0.0.0-20190516181950-a7cf48fa83ef h1:7oP1PQw+BXenm/UqZXPPdZiNvRjnYmzO3JSb4TJd6zU= 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-api v0.0.0-20190516180046-63ff3fdb07f5 h1:ZjxFLvvg8usi7tHv8y1VtkSxbq6SUUGKWsyAMSxaFLc= github.com/rancher/wrangler-api v0.0.0-20190516180046-63ff3fdb07f5/go.mod h1:Mur7JY+P/ZTAcxMi7aUOZsywecRrk8vsc/9vpn8j/Kg= github.com/rancher/wrangler-api v0.0.0-20190516182105-c5ea888bdf54 h1:DD6LweGfLYtnHX3pkr3x/azh1ax2sbRbZhn6XVSQ6VE= github.com/rancher/wrangler-api v0.0.0-20190516182105-c5ea888bdf54/go.mod h1:dUci1AIbRyiufT6HIr9PUcZB8AD4JRXDpHrjgRvqRnU= +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/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= diff --git a/vendor/github.com/rancher/gitwatcher/pkg/apis/gitwatcher.cattle.io/v1/types.go b/vendor/github.com/rancher/gitwatcher/pkg/apis/gitwatcher.cattle.io/v1/types.go index d974f17d7..a19e7c9af 100644 --- a/vendor/github.com/rancher/gitwatcher/pkg/apis/gitwatcher.cattle.io/v1/types.go +++ b/vendor/github.com/rancher/gitwatcher/pkg/apis/gitwatcher.cattle.io/v1/types.go @@ -48,19 +48,19 @@ type GitCommit struct { } type GitCommitSpec struct { - Payload string `json:"payload,omitempty"` - GitWebHookReceiverName string `json:"gitWebHookReceiverName,omitempty"` - Commit string `json:"commit,omitempty"` - Branch string `json:"branch,omitempty"` - Tag string `json:"tag,omitempty"` - PR string `json:"pr,omitempty"` - SourceLink string `json:"sourceLink,omitempty"` - RepositoryURL string `json:"repositoryUrl,omitempty"` - Title string `json:"title,omitempty"` - Message string `json:"message,omitempty"` - Author string `json:"author,omitempty"` - AuthorEmail string `json:"authorEmail,omitempty"` - AuthorAvatar string `json:"authorAvatar,omitempty"` + Payload string `json:"payload,omitempty"` + GitWatcherName string `json:"gitWatcherName,omitempty"` + Commit string `json:"commit,omitempty"` + Branch string `json:"branch,omitempty"` + Tag string `json:"tag,omitempty"` + PR string `json:"pr,omitempty"` + SourceLink string `json:"sourceLink,omitempty"` + RepositoryURL string `json:"repositoryUrl,omitempty"` + Title string `json:"title,omitempty"` + Message string `json:"message,omitempty"` + Author string `json:"author,omitempty"` + AuthorEmail string `json:"authorEmail,omitempty"` + AuthorAvatar string `json:"authorAvatar,omitempty"` } type GitWatcherStatus struct {