This is an automated email from the ASF dual-hosted git repository.

tokers pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/apisix-ingress-controller.git


The following commit(s) were added to refs/heads/master by this push:
     new 207f059  chore: remove apisix service related codes (#369)
207f059 is described below

commit 207f05999045025df5484c79c8afd3db4dea1d14
Author: Alex Zhang <[email protected]>
AuthorDate: Wed Apr 14 12:54:05 2021 +0800

    chore: remove apisix service related codes (#369)
---
 pkg/apisix/apisix.go                         |  12 --
 pkg/apisix/cache/cache.go                    |  10 +-
 pkg/apisix/cache/memdb.go                    |  58 +------
 pkg/apisix/cache/memdb_test.go               |  66 +-------
 pkg/apisix/cache/schema.go                   |  21 ---
 pkg/apisix/cluster.go                        |  22 ---
 pkg/apisix/cluster_test.go                   |   9 -
 pkg/apisix/nonexistentclient.go              |  32 ----
 pkg/apisix/resource.go                       |  31 ----
 pkg/apisix/resource_test.go                  |   2 -
 pkg/apisix/route.go                          |   3 -
 pkg/apisix/route_test.go                     |   4 -
 pkg/apisix/service.go                        | 244 ---------------------------
 pkg/apisix/service_test.go                   | 207 -----------------------
 pkg/ingress/endpoint.go                      |   1 -
 pkg/types/apisix/v1/types.go                 |  44 ++---
 pkg/types/apisix/v1/zz_generated.deepcopy.go |  82 +++++++--
 17 files changed, 84 insertions(+), 764 deletions(-)

diff --git a/pkg/apisix/apisix.go b/pkg/apisix/apisix.go
index d16641b..bec4d25 100644
--- a/pkg/apisix/apisix.go
+++ b/pkg/apisix/apisix.go
@@ -37,8 +37,6 @@ type Cluster interface {
        Route() Route
        // Upstream returns a Upstream interface that can operate Upstream 
resources.
        Upstream() Upstream
-       // Service returns a Service interface that can operate Service 
resources.
-       Service() Service
        // SSL returns a SSL interface that can operate SSL resources.
        SSL() SSL
        // String exposes the client information in human readable format.
@@ -78,16 +76,6 @@ type Upstream interface {
        Update(context.Context, *v1.Upstream) (*v1.Upstream, error)
 }
 
-// Service is the specific client interface to take over the create, update,
-// list and delete for APISIX's Service resource.
-type Service interface {
-       Get(context.Context, string) (*v1.Service, error)
-       List(context.Context) ([]*v1.Service, error)
-       Create(context.Context, *v1.Service) (*v1.Service, error)
-       Delete(context.Context, *v1.Service) error
-       Update(context.Context, *v1.Service) (*v1.Service, error)
-}
-
 type apisix struct {
        nonExistentCluster Cluster
        clusters           map[string]Cluster
diff --git a/pkg/apisix/cache/cache.go b/pkg/apisix/cache/cache.go
index 6df8335..7cc9031 100644
--- a/pkg/apisix/cache/cache.go
+++ b/pkg/apisix/cache/cache.go
@@ -19,14 +19,12 @@ import v1 
"github.com/apache/apisix-ingress-controller/pkg/types/apisix/v1"
 
 // Cache defines the necessary behaviors that the cache object should have.
 // Note this interface is for APISIX, not for generic purpose, it supports
-// standard APISIX resources, i.e. Route, Upstream, Service and SSL.
+// standard APISIX resources, i.e. Route, Upstream, and SSL.
 // Cache implementations should copy the target objects before/after read/write
 // operations for the sake of avoiding data corrupted by other writers.
 type Cache interface {
        // InsertRoute adds or updates route to cache.
        InsertRoute(*v1.Route) error
-       // InsertService adds or updates service to cache.
-       InsertService(*v1.Service) error
        // InsertSSL adds or updates ssl to cache.
        InsertSSL(*v1.Ssl) error
        // InsertUpstream adds or updates upstream to cache.
@@ -34,8 +32,6 @@ type Cache interface {
 
        // GetRoute finds the route from cache according to the primary index.
        GetRoute(string) (*v1.Route, error)
-       // GetService finds the service from cache according to the primary 
index.
-       GetService(string) (*v1.Service, error)
        // GetSSL finds the ssl from cache according to the primary index.
        GetSSL(string) (*v1.Ssl, error)
        // GetUpstream finds the upstream from cache according to the primary 
index.
@@ -43,8 +39,6 @@ type Cache interface {
 
        // ListRoutes lists all routes in cache.
        ListRoutes() ([]*v1.Route, error)
-       // ListServices lists all services in cache.
-       ListServices() ([]*v1.Service, error)
        // ListSSL lists all ssl objects in cache.
        ListSSL() ([]*v1.Ssl, error)
        // ListUpstreams lists all upstreams in cache.
@@ -52,8 +46,6 @@ type Cache interface {
 
        // DeleteRoute deletes the specified route in cache.
        DeleteRoute(*v1.Route) error
-       // DeleteService deletes the specified service in cache.
-       DeleteService(*v1.Service) error
        // DeleteSSL deletes the specified ssl in cache.
        DeleteSSL(*v1.Ssl) error
        // DeleteUpstream deletes the specified upstream in cache.
diff --git a/pkg/apisix/cache/memdb.go b/pkg/apisix/cache/memdb.go
index 562d4b9..f610a6d 100644
--- a/pkg/apisix/cache/memdb.go
+++ b/pkg/apisix/cache/memdb.go
@@ -46,20 +46,10 @@ func NewMemDBCache() (Cache, error) {
 }
 
 func (c *dbCache) InsertRoute(r *v1.Route) error {
-       // FIXME this is a work around to bypass the schema index
-       // check. The service id will be removed in the future,
-       // and that time, please remove these codes.
        route := r.DeepCopy()
-       if route.ServiceId == "" {
-               route.ServiceId = "blackhole"
-       }
        return c.insert("route", route)
 }
 
-func (c *dbCache) InsertService(s *v1.Service) error {
-       return c.insert("service", s.DeepCopy())
-}
-
 func (c *dbCache) InsertSSL(ssl *v1.Ssl) error {
        return c.insert("ssl", ssl.DeepCopy())
 }
@@ -86,14 +76,6 @@ func (c *dbCache) GetRoute(key string) (*v1.Route, error) {
        return obj.(*v1.Route).DeepCopy(), nil
 }
 
-func (c *dbCache) GetService(key string) (*v1.Service, error) {
-       obj, err := c.get("service", key)
-       if err != nil {
-               return nil, err
-       }
-       return obj.(*v1.Service).DeepCopy(), nil
-}
-
 func (c *dbCache) GetSSL(key string) (*v1.Ssl, error) {
        obj, err := c.get("ssl", key)
        if err != nil {
@@ -138,18 +120,6 @@ func (c *dbCache) ListRoutes() ([]*v1.Route, error) {
        return routes, nil
 }
 
-func (c *dbCache) ListServices() ([]*v1.Service, error) {
-       raws, err := c.list("service")
-       if err != nil {
-               return nil, err
-       }
-       services := make([]*v1.Service, 0, len(raws))
-       for _, raw := range raws {
-               services = append(services, raw.(*v1.Service).DeepCopy())
-       }
-       return services, nil
-}
-
 func (c *dbCache) ListSSL() ([]*v1.Ssl, error) {
        raws, err := c.list("ssl")
        if err != nil {
@@ -192,13 +162,6 @@ func (c *dbCache) DeleteRoute(r *v1.Route) error {
        return c.delete("route", r)
 }
 
-func (c *dbCache) DeleteService(s *v1.Service) error {
-       if err := c.checkServiceReference(s); err != nil {
-               return err
-       }
-       return c.delete("service", s)
-}
-
 func (c *dbCache) DeleteSSL(ssl *v1.Ssl) error {
        return c.delete("ssl", ssl)
 }
@@ -223,28 +186,11 @@ func (c *dbCache) delete(table string, obj interface{}) 
error {
        return nil
 }
 
-func (c *dbCache) checkServiceReference(s *v1.Service) error {
-       // Service is referenced by Route.
-       txn := c.db.Txn(false)
-       defer txn.Abort()
-       obj, err := txn.First("route", "service_id", s.FullName)
-       if err != nil {
-               if err == memdb.ErrNotFound {
-                       return nil
-               }
-               return err
-       }
-       if obj == nil {
-               return nil
-       }
-       return ErrStillInUse
-}
-
 func (c *dbCache) checkUpstreamReference(u *v1.Upstream) error {
-       // Upstream is referenced by Service.
+       // Upstream is referenced by Route.
        txn := c.db.Txn(false)
        defer txn.Abort()
-       obj, err := txn.First("service", "upstream_id", u.FullName)
+       obj, err := txn.First("route", "upstream_id", u.ID)
        if err != nil {
                if err == memdb.ErrNotFound {
                        return nil
diff --git a/pkg/apisix/cache/memdb_test.go b/pkg/apisix/cache/memdb_test.go
index 5f2c9c7..7bdd933 100644
--- a/pkg/apisix/cache/memdb_test.go
+++ b/pkg/apisix/cache/memdb_test.go
@@ -32,7 +32,6 @@ func TestMemDBCacheRoute(t *testing.T) {
                        FullName: "abc",
                        Name:     "abc",
                },
-               ServiceId: "1",
        }
        assert.Nil(t, c.InsertRoute(r1), "inserting route 1")
 
@@ -45,14 +44,12 @@ func TestMemDBCacheRoute(t *testing.T) {
                        FullName: "def",
                        Name:     "def",
                },
-               ServiceId: "2",
        }
        r3 := &v1.Route{
                Metadata: v1.Metadata{
                        FullName: "ghi",
                        Name:     "ghi",
                },
-               ServiceId: "3",
        }
        assert.Nil(t, c.InsertRoute(r2), "inserting route r2")
        assert.Nil(t, c.InsertRoute(r3), "inserting route r3")
@@ -77,62 +74,10 @@ func TestMemDBCacheRoute(t *testing.T) {
                        FullName: "name4",
                        Name:     "name4",
                },
-               ServiceId: "4",
        }
        assert.Error(t, ErrNotFound, c.DeleteRoute(r4))
 }
 
-func TestMemDBCacheService(t *testing.T) {
-       c, err := NewMemDBCache()
-       assert.Nil(t, err, "NewMemDBCache")
-
-       s1 := &v1.Service{
-               FullName:   "abc",
-               Name:       "abc",
-               UpstreamId: "1",
-       }
-       assert.Nil(t, c.InsertService(s1), "inserting service 1")
-
-       s, err := c.GetService("abc")
-       assert.Nil(t, err)
-       assert.Equal(t, s1, s)
-
-       s2 := &v1.Service{
-               FullName:   "def",
-               Name:       "def",
-               UpstreamId: "2",
-       }
-       s3 := &v1.Service{
-               FullName:   "ghi",
-               Name:       "ghi",
-               UpstreamId: "3",
-       }
-       assert.Nil(t, c.InsertService(s2), "inserting service 2")
-       assert.Nil(t, c.InsertService(s3), "inserting service 3")
-
-       s, err = c.GetService("ghi")
-       assert.Nil(t, err)
-       assert.Equal(t, s3, s)
-
-       assert.Nil(t, c.DeleteService(s3), "delete service 3")
-
-       services, err := c.ListServices()
-       assert.Nil(t, err, "listing services")
-
-       if services[0].FullName > services[1].FullName {
-               services[0], services[1] = services[1], services[0]
-       }
-       assert.Equal(t, services[0], s1)
-       assert.Equal(t, services[1], s2)
-
-       s4 := &v1.Service{
-               FullName:   "name4",
-               Name:       "name4",
-               UpstreamId: "4",
-       }
-       assert.Error(t, ErrNotFound, c.DeleteService(s4))
-}
-
 func TestMemDBCacheSSL(t *testing.T) {
        c, err := NewMemDBCache()
        assert.Nil(t, err, "NewMemDBCache")
@@ -241,15 +186,11 @@ func TestMemDBCacheReference(t *testing.T) {
                        FullName: "route",
                        Name:     "route",
                },
-               ServiceId: "service",
-       }
-       s := &v1.Service{
-               FullName:   "service",
-               Name:       "service",
-               UpstreamId: "upstream",
+               UpstreamId: "1",
        }
        u := &v1.Upstream{
                Metadata: v1.Metadata{
+                       ID:       "1",
                        FullName: "upstream",
                        Name:     "upstream",
                },
@@ -258,12 +199,9 @@ func TestMemDBCacheReference(t *testing.T) {
        db, err := NewMemDBCache()
        assert.Nil(t, err, "NewMemDBCache")
        assert.Nil(t, db.InsertRoute(r))
-       assert.Nil(t, db.InsertService(s))
        assert.Nil(t, db.InsertUpstream(u))
 
-       assert.Error(t, ErrStillInUse, db.DeleteService(s))
        assert.Error(t, ErrStillInUse, db.DeleteUpstream(u))
        assert.Nil(t, db.DeleteRoute(r))
-       assert.Nil(t, db.DeleteService(s))
        assert.Nil(t, db.DeleteUpstream(u))
 }
diff --git a/pkg/apisix/cache/schema.go b/pkg/apisix/cache/schema.go
index 79b483e..159dcfc 100644
--- a/pkg/apisix/cache/schema.go
+++ b/pkg/apisix/cache/schema.go
@@ -36,27 +36,6 @@ var (
                                                Indexer:      
&memdb.StringFieldIndex{Field: "Name"},
                                                AllowMissing: true,
                                        },
-                                       "service_id": {
-                                               Name:    "service_id",
-                                               Unique:  false,
-                                               Indexer: 
&memdb.StringFieldIndex{Field: "ServiceId"},
-                                       },
-                               },
-                       },
-                       "service": {
-                               Name: "service",
-                               Indexes: map[string]*memdb.IndexSchema{
-                                       "id": {
-                                               Name:    "id",
-                                               Unique:  true,
-                                               Indexer: 
&memdb.StringFieldIndex{Field: "FullName"},
-                                       },
-                                       "name": {
-                                               Name:         "name",
-                                               Unique:       true,
-                                               Indexer:      
&memdb.StringFieldIndex{Field: "Name"},
-                                               AllowMissing: true,
-                                       },
                                        "upstream_id": {
                                                Name:         "upstream_id",
                                                Unique:       false,
diff --git a/pkg/apisix/cluster.go b/pkg/apisix/cluster.go
index 9445386..bb6db4b 100644
--- a/pkg/apisix/cluster.go
+++ b/pkg/apisix/cluster.go
@@ -71,7 +71,6 @@ type cluster struct {
        cacheSyncErr error
        route        Route
        upstream     Upstream
-       service      Service
        ssl          SSL
 }
 
@@ -101,7 +100,6 @@ func newCluster(o *ClusterOptions) (Cluster, error) {
        }
        c.route = newRouteClient(c)
        c.upstream = newUpstreamClient(c)
-       c.service = newServiceClient(c)
        c.ssl = newSSLClient(c)
 
        go c.syncCache()
@@ -157,11 +155,6 @@ func (c *cluster) syncCacheOnce() (bool, error) {
                log.Errorf("failed to list route in APISIX: %s", err)
                return false, err
        }
-       services, err := c.service.List(context.TODO())
-       if err != nil {
-               log.Errorf("failed to list services in APISIX: %s", err)
-               return false, err
-       }
        upstreams, err := c.upstream.List(context.TODO())
        if err != nil {
                log.Errorf("failed to list upstreams in APISIX: %s", err)
@@ -183,16 +176,6 @@ func (c *cluster) syncCacheOnce() (bool, error) {
                        return false, err
                }
        }
-       for _, s := range services {
-               if err := c.cache.InsertService(s); err != nil {
-                       log.Errorw("failed to insert service to cache",
-                               zap.String("service", s.ID),
-                               zap.String("cluster", c.name),
-                               zap.String("error", err.Error()),
-                       )
-                       return false, err
-               }
-       }
        for _, u := range upstreams {
                if err := c.cache.InsertUpstream(u); err != nil {
                        log.Errorw("failed to insert upstream to cache",
@@ -253,11 +236,6 @@ func (c *cluster) Upstream() Upstream {
        return c.upstream
 }
 
-// Service implements Cluster.Service method.
-func (c *cluster) Service() Service {
-       return c.service
-}
-
 // SSL implements Cluster.SSL method.
 func (c *cluster) SSL() SSL {
        return c.ssl
diff --git a/pkg/apisix/cluster_test.go b/pkg/apisix/cluster_test.go
index 9f31cb7..523b62e 100644
--- a/pkg/apisix/cluster_test.go
+++ b/pkg/apisix/cluster_test.go
@@ -78,15 +78,6 @@ func TestNonExistentCluster(t *testing.T) {
        err = 
apisix.Cluster("non-existent-cluster").Upstream().Delete(context.Background(), 
&v1.Upstream{})
        assert.Equal(t, ErrClusterNotExist, err)
 
-       _, err = 
apisix.Cluster("non-existent-cluster").Service().List(context.Background())
-       assert.Equal(t, ErrClusterNotExist, err)
-       _, err = 
apisix.Cluster("non-existent-cluster").Service().Create(context.Background(), 
&v1.Service{})
-       assert.Equal(t, ErrClusterNotExist, err)
-       _, err = 
apisix.Cluster("non-existent-cluster").Service().Update(context.Background(), 
&v1.Service{})
-       assert.Equal(t, ErrClusterNotExist, err)
-       err = 
apisix.Cluster("non-existent-cluster").Service().Delete(context.Background(), 
&v1.Service{})
-       assert.Equal(t, ErrClusterNotExist, err)
-
        _, err = 
apisix.Cluster("non-existent-cluster").SSL().List(context.Background())
        assert.Equal(t, ErrClusterNotExist, err)
        _, err = 
apisix.Cluster("non-existent-cluster").SSL().Create(context.Background(), 
&v1.Ssl{})
diff --git a/pkg/apisix/nonexistentclient.go b/pkg/apisix/nonexistentclient.go
index ad5db99..cfc1522 100644
--- a/pkg/apisix/nonexistentclient.go
+++ b/pkg/apisix/nonexistentclient.go
@@ -31,7 +31,6 @@ func newNonExistentCluster() *nonExistentCluster {
                embedDummyResourceImplementer{
                        route:    &dummyRoute{},
                        ssl:      &dummySSL{},
-                       service:  &dummyService{},
                        upstream: &dummyUpstream{},
                },
        }
@@ -41,7 +40,6 @@ type embedDummyResourceImplementer struct {
        route    Route
        ssl      SSL
        upstream Upstream
-       service  Service
 }
 
 type dummyRoute struct{}
@@ -110,28 +108,6 @@ func (f *dummyUpstream) Update(_ context.Context, _ 
*v1.Upstream) (*v1.Upstream,
        return nil, ErrClusterNotExist
 }
 
-type dummyService struct{}
-
-func (f *dummyService) Get(_ context.Context, _ string) (*v1.Service, error) {
-       return nil, ErrClusterNotExist
-}
-
-func (f *dummyService) List(_ context.Context) ([]*v1.Service, error) {
-       return nil, ErrClusterNotExist
-}
-
-func (f *dummyService) Create(_ context.Context, _ *v1.Service) (*v1.Service, 
error) {
-       return nil, ErrClusterNotExist
-}
-
-func (f *dummyService) Delete(_ context.Context, _ *v1.Service) error {
-       return ErrClusterNotExist
-}
-
-func (f *dummyService) Update(_ context.Context, _ *v1.Service) (*v1.Service, 
error) {
-       return nil, ErrClusterNotExist
-}
-
 func (nc *nonExistentCluster) Route() Route {
        return nc.route
 }
@@ -140,10 +116,6 @@ func (nc *nonExistentCluster) SSL() SSL {
        return nc.ssl
 }
 
-func (nc *nonExistentCluster) Service() Service {
-       return nc.service
-}
-
 func (nc *nonExistentCluster) Upstream() Upstream {
        return nc.upstream
 }
@@ -161,18 +133,14 @@ type dummyCache struct{}
 var _ cache.Cache = &dummyCache{}
 
 func (c *dummyCache) InsertRoute(_ *v1.Route) error              { return nil }
-func (c *dummyCache) InsertService(_ *v1.Service) error          { return nil }
 func (c *dummyCache) InsertSSL(_ *v1.Ssl) error                  { return nil }
 func (c *dummyCache) InsertUpstream(_ *v1.Upstream) error        { return nil }
 func (c *dummyCache) GetRoute(_ string) (*v1.Route, error)       { return nil, 
cache.ErrNotFound }
-func (c *dummyCache) GetService(_ string) (*v1.Service, error)   { return nil, 
cache.ErrNotFound }
 func (c *dummyCache) GetSSL(_ string) (*v1.Ssl, error)           { return nil, 
cache.ErrNotFound }
 func (c *dummyCache) GetUpstream(_ string) (*v1.Upstream, error) { return nil, 
cache.ErrNotFound }
 func (c *dummyCache) ListRoutes() ([]*v1.Route, error)           { return nil, 
nil }
-func (c *dummyCache) ListServices() ([]*v1.Service, error)       { return nil, 
nil }
 func (c *dummyCache) ListSSL() ([]*v1.Ssl, error)                { return nil, 
nil }
 func (c *dummyCache) ListUpstreams() ([]*v1.Upstream, error)     { return nil, 
nil }
 func (c *dummyCache) DeleteRoute(_ *v1.Route) error              { return nil }
-func (c *dummyCache) DeleteService(_ *v1.Service) error          { return nil }
 func (c *dummyCache) DeleteSSL(_ *v1.Ssl) error                  { return nil }
 func (c *dummyCache) DeleteUpstream(_ *v1.Upstream) error        { return nil }
diff --git a/pkg/apisix/resource.go b/pkg/apisix/resource.go
index d5ea072..c2effe2 100644
--- a/pkg/apisix/resource.go
+++ b/pkg/apisix/resource.go
@@ -74,7 +74,6 @@ type item struct {
 
 type routeItem struct {
        UpstreamId  string                 `json:"upstream_id"`
-       ServiceId   string                 `json:"service_id"`
        RemoteAddrs []string               `json:"remote_addrs"`
        Host        string                 `json:"host"`
        Hosts       []string               `json:"hosts"`
@@ -116,7 +115,6 @@ func (i *item) route(clusterName string) (*v1.Route, error) 
{
                Methods:     route.Methods,
                RemoteAddrs: route.RemoteAddrs,
                UpstreamId:  route.UpstreamId,
-               ServiceId:   route.ServiceId,
                Plugins:     route.Plugins,
                Hosts:       route.Hosts,
                Priority:    route.Priority,
@@ -176,35 +174,6 @@ func (i *item) upstream(clusterName string) (*v1.Upstream, 
error) {
        }, nil
 }
 
-// service decodes item.Value and converts it to v1.Service.
-func (i *item) service(clusterName string) (*v1.Service, error) {
-       log.Debugf("got service: %s", string(i.Value))
-       var svc serviceItem
-       if err := json.Unmarshal(i.Value, &svc); err != nil {
-               return nil, err
-       }
-
-       list := strings.Split(i.Key, "/")
-       id := list[len(list)-1]
-       var plugins v1.Plugins
-       if svc.Plugins != nil {
-               plugins := make(v1.Plugins, len(svc.Plugins))
-               for k, v := range svc.Plugins {
-                       plugins[k] = v
-               }
-       }
-       fullName := genFullName(svc.Desc, clusterName)
-
-       return &v1.Service{
-               ID:         id,
-               FullName:   fullName,
-               Group:      clusterName,
-               Name:       svc.Desc,
-               UpstreamId: svc.UpstreamId,
-               Plugins:    plugins,
-       }, nil
-}
-
 // ssl decodes item.Value and converts it to v1.Ssl.
 func (i *item) ssl(clusterName string) (*v1.Ssl, error) {
        log.Debugf("got ssl: %s", string(i.Value))
diff --git a/pkg/apisix/resource_test.go b/pkg/apisix/resource_test.go
index 571bb88..0d08750 100644
--- a/pkg/apisix/resource_test.go
+++ b/pkg/apisix/resource_test.go
@@ -57,7 +57,6 @@ func TestItemConvertRoute(t *testing.T) {
                Value: json.RawMessage(`
                        {
                                "upstream_id": "13",
-                               "service_id": "14",
                                "host": "foo.com",
                                "uri": "/shop/133/details",
                                "desc": "unknown",
@@ -69,7 +68,6 @@ func TestItemConvertRoute(t *testing.T) {
        r, err := item.route("qa")
        assert.Nil(t, err)
        assert.Equal(t, r.UpstreamId, "13")
-       assert.Equal(t, r.ServiceId, "14")
        assert.Equal(t, r.Host, "foo.com")
        assert.Equal(t, r.Path, "/shop/133/details")
        assert.Equal(t, r.Methods[0], "GET")
diff --git a/pkg/apisix/route.go b/pkg/apisix/route.go
index 7d87754..ca238f7 100644
--- a/pkg/apisix/route.go
+++ b/pkg/apisix/route.go
@@ -37,7 +37,6 @@ type routeReqBody struct {
        Vars        [][]v1.StringOrSlice `json:"vars,omitempty"`
        Host        string               `json:"host,omitempty"`
        Hosts       []string             `json:"hosts,omitempty"`
-       ServiceId   string               `json:"service_id,omitempty"`
        RemoteAddrs []string             `json:"remote_addrs,omitempty"`
        UpstreamId  string               `json:"upstream_id,omitempty"`
        Plugins     v1.Plugins           `json:"plugins,omitempty"`
@@ -169,7 +168,6 @@ func (r *routeClient) Create(ctx context.Context, obj 
*v1.Route) (*v1.Route, err
                URI:         obj.Path,
                Host:        obj.Host,
                Hosts:       obj.Hosts,
-               ServiceId:   obj.ServiceId,
                UpstreamId:  obj.UpstreamId,
                Uris:        obj.Uris,
                Plugins:     obj.Plugins,
@@ -242,7 +240,6 @@ func (r *routeClient) Update(ctx context.Context, obj 
*v1.Route) (*v1.Route, err
                URI:         obj.Path,
                Host:        obj.Host,
                Hosts:       obj.Hosts,
-               ServiceId:   obj.ServiceId,
                UpstreamId:  obj.UpstreamId,
                Uris:        obj.Uris,
                Plugins:     obj.Plugins,
diff --git a/pkg/apisix/route_test.go b/pkg/apisix/route_test.go
index 5613798..1624e1a 100644
--- a/pkg/apisix/route_test.go
+++ b/pkg/apisix/route_test.go
@@ -187,7 +187,6 @@ func TestRouteClient(t *testing.T) {
                },
                Host:       "www.foo.com",
                Path:       "/bar",
-               ServiceId:  "1",
                UpstreamId: "1",
        })
        assert.Nil(t, err)
@@ -201,7 +200,6 @@ func TestRouteClient(t *testing.T) {
                },
                Host:       "www.foo.com",
                Path:       "/bar",
-               ServiceId:  "1",
                UpstreamId: "1",
        })
        assert.Nil(t, err)
@@ -230,7 +228,6 @@ func TestRouteClient(t *testing.T) {
                },
                Host:       "www.foo.com",
                Path:       "/bar",
-               ServiceId:  "112",
                UpstreamId: "112",
        })
        assert.Nil(t, err)
@@ -238,5 +235,4 @@ func TestRouteClient(t *testing.T) {
        assert.Nil(t, err)
        assert.Len(t, objs, 1)
        assert.Equal(t, "2", objs[0].ID)
-       assert.Equal(t, "112", objs[0].ServiceId)
 }
diff --git a/pkg/apisix/service.go b/pkg/apisix/service.go
deleted file mode 100644
index a16d67a..0000000
--- a/pkg/apisix/service.go
+++ /dev/null
@@ -1,244 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements.  See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You 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.
-
-package apisix
-
-import (
-       "bytes"
-       "context"
-       "encoding/json"
-
-       "go.uber.org/zap"
-
-       "github.com/apache/apisix-ingress-controller/pkg/apisix/cache"
-       "github.com/apache/apisix-ingress-controller/pkg/id"
-       "github.com/apache/apisix-ingress-controller/pkg/log"
-       v1 "github.com/apache/apisix-ingress-controller/pkg/types/apisix/v1"
-)
-
-type serviceClient struct {
-       url         string
-       clusterName string
-       cluster     *cluster
-}
-
-type serviceItem struct {
-       UpstreamId string                 `json:"upstream_id,omitempty"`
-       Plugins    map[string]interface{} `json:"plugins,omitempty"`
-       Desc       string                 `json:"desc,omitempty"`
-}
-
-func newServiceClient(c *cluster) Service {
-       return &serviceClient{
-               url:         c.baseURL + "/services",
-               clusterName: c.name,
-               cluster:     c,
-       }
-}
-
-func (s *serviceClient) Get(ctx context.Context, fullname string) 
(*v1.Service, error) {
-       log.Debugw("try to look up service",
-               zap.String("fullname", fullname),
-               zap.String("url", s.url),
-               zap.String("cluster", s.clusterName),
-       )
-       svc, err := s.cluster.cache.GetService(fullname)
-       if err == nil {
-               return svc, nil
-       }
-       if err != cache.ErrNotFound {
-               log.Errorw("failed to find service in cache, will try to look 
up from APISIX",
-                       zap.String("fullname", fullname),
-                       zap.Error(err),
-               )
-       } else {
-               log.Debugw("failed to find service in cache, will try to look 
up from APISIX",
-                       zap.String("fullname", fullname),
-                       zap.Error(err),
-               )
-       }
-
-       // TODO Add mutex here to avoid dog-pile effection.
-       url := s.url + "/" + id.GenID(fullname)
-       resp, err := s.cluster.getResource(ctx, url)
-       if err != nil {
-               if err == cache.ErrNotFound {
-                       log.Warnw("service not found",
-                               zap.String("fullname", fullname),
-                               zap.String("url", url),
-                               zap.String("cluster", s.clusterName),
-                       )
-               } else {
-                       log.Errorw("failed to get service from APISIX",
-                               zap.String("fullname", fullname),
-                               zap.String("url", url),
-                               zap.String("cluster", s.clusterName),
-                               zap.Error(err),
-                       )
-               }
-               return nil, err
-       }
-
-       svc, err = resp.Item.service(s.clusterName)
-       if err != nil {
-               log.Errorw("failed to convert service item",
-                       zap.String("url", s.url),
-                       zap.String("service_key", resp.Item.Key),
-                       zap.Error(err),
-               )
-               return nil, err
-       }
-
-       if err := s.cluster.cache.InsertService(svc); err != nil {
-               log.Errorf("failed to reflect service create to cache: %s", err)
-               return nil, err
-       }
-       return svc, nil
-}
-
-// List is only used in cache warming up. So here just pass through
-// to APISIX.
-func (s *serviceClient) List(ctx context.Context) ([]*v1.Service, error) {
-       log.Debugw("try to list services in APISIX",
-               zap.String("url", s.url),
-               zap.String("cluster", s.clusterName),
-       )
-
-       upsItems, err := s.cluster.listResource(ctx, s.url)
-       if err != nil {
-               log.Errorf("failed to list upstreams: %s", err)
-               return nil, err
-       }
-
-       var items []*v1.Service
-       for i, item := range upsItems.Node.Items {
-               svc, err := item.service(s.clusterName)
-               if err != nil {
-                       log.Errorw("failed to convert service item",
-                               zap.String("url", s.url),
-                               zap.String("service_key", item.Key),
-                               zap.Error(err),
-                       )
-                       return nil, err
-               }
-               items = append(items, svc)
-               log.Debugf("list service #%d, body: %s", i, string(item.Value))
-       }
-       return items, nil
-}
-
-func (s *serviceClient) Create(ctx context.Context, obj *v1.Service) 
(*v1.Service, error) {
-       log.Debugw("try to create service",
-               zap.String("fullname", obj.FullName),
-               zap.String("cluster", s.clusterName),
-               zap.String("url", s.url),
-       )
-       if err := s.cluster.HasSynced(ctx); err != nil {
-               return nil, err
-       }
-
-       body, err := json.Marshal(serviceItem{
-               UpstreamId: obj.UpstreamId,
-               Plugins:    obj.Plugins,
-               Desc:       obj.Name,
-       })
-       if err != nil {
-               return nil, err
-       }
-
-       url := s.url + "/" + obj.ID
-       log.Debugw("creating service", zap.ByteString("body", body), 
zap.String("url", url))
-       resp, err := s.cluster.createResource(ctx, url, bytes.NewReader(body))
-       if err != nil {
-               log.Errorf("failed to create service: %s", err)
-               return nil, err
-       }
-       var clusterName string
-       if obj.Group != "" {
-               clusterName = obj.Group
-       }
-       svc, err := resp.Item.service(clusterName)
-       if err != nil {
-               return nil, err
-       }
-       if err := s.cluster.cache.InsertService(svc); err != nil {
-               log.Errorf("failed to reflect service create to cache: %s", err)
-               return nil, err
-       }
-       return svc, nil
-}
-
-func (s *serviceClient) Delete(ctx context.Context, obj *v1.Service) error {
-       log.Debugw("try to delete service",
-               zap.String("id", obj.ID),
-               zap.String("fullname", obj.FullName),
-               zap.String("cluster", s.clusterName),
-               zap.String("url", s.url),
-       )
-       if err := s.cluster.HasSynced(ctx); err != nil {
-               return err
-       }
-       url := s.url + "/" + obj.ID
-       if err := s.cluster.deleteResource(ctx, url); err != nil {
-               return err
-       }
-       if err := s.cluster.cache.DeleteService(obj); err != nil {
-               log.Errorf("failed to reflect service delete to cache: %s", err)
-               return err
-       }
-       return nil
-}
-
-func (s *serviceClient) Update(ctx context.Context, obj *v1.Service) 
(*v1.Service, error) {
-       log.Debugw("try to update service",
-               zap.String("id", obj.ID),
-               zap.String("fullname", obj.FullName),
-               zap.String("cluster", s.clusterName),
-               zap.String("url", s.url),
-       )
-
-       if err := s.cluster.HasSynced(ctx); err != nil {
-               return nil, err
-       }
-
-       body, err := json.Marshal(serviceItem{
-               UpstreamId: obj.UpstreamId,
-               Plugins:    obj.Plugins,
-               Desc:       obj.Name,
-       })
-       if err != nil {
-               return nil, err
-       }
-
-       url := s.url + "/" + obj.ID
-       log.Debugw("creating service", zap.ByteString("body", body), 
zap.String("url", url))
-       resp, err := s.cluster.updateResource(ctx, url, bytes.NewReader(body))
-       if err != nil {
-               return nil, err
-       }
-       var clusterName string
-       if obj.Group != "" {
-               clusterName = obj.Group
-       }
-       svc, err := resp.Item.service(clusterName)
-       if err != nil {
-               return nil, err
-       }
-       if err := s.cluster.cache.InsertService(obj); err != nil {
-               log.Errorf("failed to reflect service update to cache: %s", err)
-               return nil, err
-       }
-       return svc, nil
-}
diff --git a/pkg/apisix/service_test.go b/pkg/apisix/service_test.go
deleted file mode 100644
index fd7b027..0000000
--- a/pkg/apisix/service_test.go
+++ /dev/null
@@ -1,207 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements.  See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You 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.
-package apisix
-
-import (
-       "context"
-       "encoding/json"
-       "fmt"
-       "io/ioutil"
-       "net/http"
-       "net/url"
-       "sort"
-       "strconv"
-       "strings"
-       "testing"
-
-       "golang.org/x/net/nettest"
-
-       v1 "github.com/apache/apisix-ingress-controller/pkg/types/apisix/v1"
-       "github.com/stretchr/testify/assert"
-)
-
-type fakeAPISIXServiceSrv struct {
-       service map[string]json.RawMessage
-}
-
-func (srv *fakeAPISIXServiceSrv) ServeHTTP(w http.ResponseWriter, r 
*http.Request) {
-       defer r.Body.Close()
-
-       if !strings.HasPrefix(r.URL.Path, "/apisix/admin/services") {
-               w.WriteHeader(http.StatusNotFound)
-               return
-       }
-
-       if r.Method == http.MethodGet {
-               resp := fakeListResp{
-                       Count: strconv.Itoa(len(srv.service)),
-                       Node: fakeNode{
-                               Key: "/apisix/services",
-                       },
-               }
-               var keys []string
-               for key := range srv.service {
-                       keys = append(keys, key)
-               }
-               sort.Strings(keys)
-               for _, key := range keys {
-                       resp.Node.Items = append(resp.Node.Items, fakeItem{
-                               Key:   key,
-                               Value: srv.service[key],
-                       })
-               }
-               w.WriteHeader(http.StatusOK)
-               data, _ := json.Marshal(resp)
-               _, _ = w.Write(data)
-               return
-       }
-
-       if r.Method == http.MethodDelete {
-               id := strings.TrimPrefix(r.URL.Path, "/apisix/admin/services/")
-               id = "/apisix/services/" + id
-               code := http.StatusNotFound
-               if _, ok := srv.service[id]; ok {
-                       delete(srv.service, id)
-                       code = http.StatusOK
-               }
-               w.WriteHeader(code)
-       }
-
-       if r.Method == http.MethodPut {
-               paths := strings.Split(r.URL.Path, "/")
-               key := fmt.Sprintf("/apisix/services/%s", paths[len(paths)-1])
-               data, _ := ioutil.ReadAll(r.Body)
-               srv.service[key] = data
-               w.WriteHeader(http.StatusCreated)
-               resp := fakeCreateResp{
-                       Action: "create",
-                       Node: fakeItem{
-                               Key:   key,
-                               Value: json.RawMessage(data),
-                       },
-               }
-               data, _ = json.Marshal(resp)
-               _, _ = w.Write(data)
-               return
-       }
-
-       if r.Method == http.MethodPatch {
-               id := strings.TrimPrefix(r.URL.Path, "/apisix/admin/services/")
-               id = "/apisix/services/" + id
-               if _, ok := srv.service[id]; !ok {
-                       w.WriteHeader(http.StatusNotFound)
-                       return
-               }
-
-               data, _ := ioutil.ReadAll(r.Body)
-               srv.service[id] = data
-
-               w.WriteHeader(http.StatusOK)
-               output := fmt.Sprintf(`{"action": "compareAndSwap", "node": 
{"key": "%s", "value": %s}}`, id, string(data))
-               _, _ = w.Write([]byte(output))
-               return
-       }
-}
-
-func runFakeServiceSrv(t *testing.T) *http.Server {
-       srv := &fakeAPISIXServiceSrv{
-               service: make(map[string]json.RawMessage),
-       }
-
-       ln, _ := nettest.NewLocalListener("tcp")
-       httpSrv := &http.Server{
-               Addr:    ln.Addr().String(),
-               Handler: srv,
-       }
-
-       go func() {
-               if err := httpSrv.Serve(ln); err != nil && err != 
http.ErrServerClosed {
-                       t.Errorf("failed to run http server: %s", err)
-               }
-       }()
-
-       return httpSrv
-}
-
-func TestServiceClient(t *testing.T) {
-       srv := runFakeServiceSrv(t)
-       defer func() {
-               assert.Nil(t, srv.Shutdown(context.Background()))
-       }()
-
-       u := url.URL{
-               Scheme: "http",
-               Host:   srv.Addr,
-               Path:   "/apisix/admin",
-       }
-       closedCh := make(chan struct{})
-       close(closedCh)
-       cli := newServiceClient(&cluster{
-               baseURL:     u.String(),
-               cli:         http.DefaultClient,
-               cache:       &dummyCache{},
-               cacheSynced: closedCh,
-       })
-
-       // Create
-       obj, err := cli.Create(context.TODO(), &v1.Service{
-               ID:         "1",
-               FullName:   "default_test",
-               Group:      "default",
-               Name:       "test",
-               UpstreamId: "13",
-       })
-       assert.Nil(t, err)
-       assert.Equal(t, obj.ID, "1")
-
-       obj, err = cli.Create(context.TODO(), &v1.Service{
-               ID:         "2",
-               FullName:   "default_test",
-               Group:      "default",
-               Name:       "test",
-               UpstreamId: "13",
-       })
-       assert.Nil(t, err)
-       assert.Equal(t, obj.ID, "2")
-
-       // List
-       objs, err := cli.List(context.Background())
-       assert.Nil(t, err)
-       assert.Len(t, objs, 2)
-       assert.Equal(t, objs[0].ID, "1")
-       assert.Equal(t, objs[1].ID, "2")
-
-       // Delete then List
-       assert.Nil(t, cli.Delete(context.Background(), objs[0]))
-       objs, err = cli.List(context.Background())
-       assert.Nil(t, err)
-       assert.Len(t, objs, 1)
-       assert.Equal(t, "2", objs[0].ID)
-
-       // Patch then List
-       _, err = cli.Update(context.Background(), &v1.Service{
-               ID:         "2",
-               FullName:   "default_test",
-               Group:      "default",
-               Name:       "test",
-               UpstreamId: "14",
-       })
-       assert.Nil(t, err)
-       objs, err = cli.List(context.Background())
-       assert.Nil(t, err)
-       assert.Len(t, objs, 1)
-       assert.Equal(t, "2", objs[0].ID)
-       assert.Equal(t, "14", objs[0].UpstreamId)
-}
diff --git a/pkg/ingress/endpoint.go b/pkg/ingress/endpoint.go
index 80c6d06..f839150 100644
--- a/pkg/ingress/endpoint.go
+++ b/pkg/ingress/endpoint.go
@@ -148,7 +148,6 @@ func (c *endpointsController) syncToCluster(ctx 
context.Context, cluster apisix.
        }
 
        upstream.Nodes = nodes
-       upstream.FromKind = WatchFromKind
 
        log.Debugw("upstream binds new nodes",
                zap.Any("upstream", upstream),
diff --git a/pkg/types/apisix/v1/types.go b/pkg/types/apisix/v1/types.go
index f314689..5128ba8 100644
--- a/pkg/types/apisix/v1/types.go
+++ b/pkg/types/apisix/v1/types.go
@@ -90,8 +90,6 @@ type Route struct {
        Uris         []string          `json:"uris,omitempty" 
yaml:"uris,omitempty"`
        Methods      []string          `json:"methods,omitempty" 
yaml:"methods,omitempty"`
        RemoteAddrs  []string          `json:"remote_addrs,omitempty" 
yaml:"remote_addrs,omitempty"`
-       ServiceId    string            `json:"service_id,omitempty" 
yaml:"service_id,omitempty"`
-       ServiceName  string            `json:"service_name,omitempty" 
yaml:"service_name,omitempty"`
        UpstreamId   string            `json:"upstream_id,omitempty" 
yaml:"upstream_id,omitempty"`
        UpstreamName string            `json:"upstream_name,omitempty" 
yaml:"upstream_name,omitempty"`
        Plugins      Plugins           `json:"plugins,omitempty" 
yaml:"plugins,omitempty"`
@@ -147,34 +145,19 @@ func (p *Plugins) DeepCopy() *Plugins {
        return out
 }
 
-// Service apisix service
-// +k8s:deepcopy-gen=true
-type Service struct {
-       ID              string  `json:"id,omitempty" yaml:"id,omitempty"`
-       FullName        string  `json:"full_name,omitempty" 
yaml:"full_name,omitempty"`
-       Group           string  `json:"group,omitempty" yaml:"group,omitempty"`
-       ResourceVersion string  `json:"resource_version,omitempty" 
yaml:"resource_version,omitempty"`
-       Name            string  `json:"name,omitempty" yaml:"name,omitempty"`
-       UpstreamId      string  `json:"upstream_id,omitempty" 
yaml:"upstream_id,omitempty"`
-       UpstreamName    string  `json:"upstream_name,omitempty" 
yaml:"upstream_name,omitempty"`
-       Plugins         Plugins `json:"plugins,omitempty" 
yaml:"plugins,omitempty"`
-       FromKind        string  `json:"from_kind,omitempty" 
yaml:"from_kind,omitempty"`
-}
-
 // Upstream is the apisix upstream definition.
 // +k8s:deepcopy-gen=true
 type Upstream struct {
        Metadata `json:",inline" yaml:",inline"`
 
-       Type     string               `json:"type,omitempty" 
yaml:"type,omitempty"`
-       HashOn   string               `json:"hash_on,omitempty" 
yaml:"hash_on,omitempty"`
-       Key      string               `json:"key,omitempty" 
yaml:"key,omitempty"`
-       Checks   *UpstreamHealthCheck `json:"checks,omitempty" 
yaml:"checks,omitempty"`
-       Nodes    []UpstreamNode       `json:"nodes,omitempty" 
yaml:"nodes,omitempty"`
-       FromKind string               `json:"from_kind,omitempty" 
yaml:"from_kind,omitempty"`
-       Scheme   string               `json:"scheme,omitempty" 
yaml:"scheme,omitempty"`
-       Retries  int                  `json:"retries,omitempty" 
yaml:"retries,omitempty"`
-       Timeout  *UpstreamTimeout     `json:"timeout,omitempty" 
yaml:"timeout,omitempty"`
+       Type    string               `json:"type,omitempty" 
yaml:"type,omitempty"`
+       HashOn  string               `json:"hash_on,omitempty" 
yaml:"hash_on,omitempty"`
+       Key     string               `json:"key,omitempty" yaml:"key,omitempty"`
+       Checks  *UpstreamHealthCheck `json:"checks,omitempty" 
yaml:"checks,omitempty"`
+       Nodes   []UpstreamNode       `json:"nodes,omitempty" 
yaml:"nodes,omitempty"`
+       Scheme  string               `json:"scheme,omitempty" 
yaml:"scheme,omitempty"`
+       Retries int                  `json:"retries,omitempty" 
yaml:"retries,omitempty"`
+       Timeout *UpstreamTimeout     `json:"timeout,omitempty" 
yaml:"timeout,omitempty"`
 }
 
 // UpstreamTimeout represents the timeout settings on Upstream.
@@ -282,12 +265,14 @@ type TrafficSplitConfig struct {
 }
 
 // TrafficSplitConfigRule is the rule config in traffic-split plugin config.
+// +k8s:deepcopy-gen=true
 type TrafficSplitConfigRule struct {
        WeightedUpstreams []TrafficSplitConfigRuleWeightedUpstream 
`json:"weighted_upstreams"`
 }
 
 // TrafficSplitConfigRuleWeightedUpstream is the weighted upstream config in
 // the traffic split plugin rule.
+// +k8s:deepcopy-gen=true
 type TrafficSplitConfigRuleWeightedUpstream struct {
        UpstreamID string `json:"upstream_id,omitempty"`
        Weight     int    `json:"weight"`
@@ -296,11 +281,10 @@ type TrafficSplitConfigRuleWeightedUpstream struct {
 // NewDefaultUpstream returns an empty Upstream with default values.
 func NewDefaultUpstream() *Upstream {
        return &Upstream{
-               Type:     LbRoundRobin,
-               Key:      "",
-               Nodes:    nil,
-               FromKind: "",
-               Scheme:   SchemeHTTP,
+               Type:   LbRoundRobin,
+               Key:    "",
+               Nodes:  nil,
+               Scheme: SchemeHTTP,
        }
 }
 
diff --git a/pkg/types/apisix/v1/zz_generated.deepcopy.go 
b/pkg/types/apisix/v1/zz_generated.deepcopy.go
index ae5470a..9d09395 100644
--- a/pkg/types/apisix/v1/zz_generated.deepcopy.go
+++ b/pkg/types/apisix/v1/zz_generated.deepcopy.go
@@ -52,6 +52,11 @@ func (in *Route) DeepCopyInto(out *Route) {
                *out = make([]string, len(*in))
                copy(*out, *in)
        }
+       if in.RemoteAddrs != nil {
+               in, out := &in.RemoteAddrs, &out.RemoteAddrs
+               *out = make([]string, len(*in))
+               copy(*out, *in)
+       }
        in.Plugins.DeepCopyInto(&out.Plugins)
        return
 }
@@ -67,23 +72,6 @@ func (in *Route) DeepCopy() *Route {
 }
 
 // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, 
writing into out. in must be non-nil.
-func (in *Service) DeepCopyInto(out *Service) {
-       *out = *in
-       in.Plugins.DeepCopyInto(&out.Plugins)
-       return
-}
-
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, 
creating a new Service.
-func (in *Service) DeepCopy() *Service {
-       if in == nil {
-               return nil
-       }
-       out := new(Service)
-       in.DeepCopyInto(out)
-       return out
-}
-
-// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, 
writing into out. in must be non-nil.
 func (in *Ssl) DeepCopyInto(out *Ssl) {
        *out = *in
        if in.Snis != nil {
@@ -126,6 +114,66 @@ func (in *StringOrSlice) DeepCopy() *StringOrSlice {
 }
 
 // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, 
writing into out. in must be non-nil.
+func (in *TrafficSplitConfig) DeepCopyInto(out *TrafficSplitConfig) {
+       *out = *in
+       if in.Rules != nil {
+               in, out := &in.Rules, &out.Rules
+               *out = make([]TrafficSplitConfigRule, len(*in))
+               for i := range *in {
+                       (*in)[i].DeepCopyInto(&(*out)[i])
+               }
+       }
+       return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, 
creating a new TrafficSplitConfig.
+func (in *TrafficSplitConfig) DeepCopy() *TrafficSplitConfig {
+       if in == nil {
+               return nil
+       }
+       out := new(TrafficSplitConfig)
+       in.DeepCopyInto(out)
+       return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, 
writing into out. in must be non-nil.
+func (in *TrafficSplitConfigRule) DeepCopyInto(out *TrafficSplitConfigRule) {
+       *out = *in
+       if in.WeightedUpstreams != nil {
+               in, out := &in.WeightedUpstreams, &out.WeightedUpstreams
+               *out = make([]TrafficSplitConfigRuleWeightedUpstream, len(*in))
+               copy(*out, *in)
+       }
+       return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, 
creating a new TrafficSplitConfigRule.
+func (in *TrafficSplitConfigRule) DeepCopy() *TrafficSplitConfigRule {
+       if in == nil {
+               return nil
+       }
+       out := new(TrafficSplitConfigRule)
+       in.DeepCopyInto(out)
+       return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, 
writing into out. in must be non-nil.
+func (in *TrafficSplitConfigRuleWeightedUpstream) DeepCopyInto(out 
*TrafficSplitConfigRuleWeightedUpstream) {
+       *out = *in
+       return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, 
creating a new TrafficSplitConfigRuleWeightedUpstream.
+func (in *TrafficSplitConfigRuleWeightedUpstream) DeepCopy() 
*TrafficSplitConfigRuleWeightedUpstream {
+       if in == nil {
+               return nil
+       }
+       out := new(TrafficSplitConfigRuleWeightedUpstream)
+       in.DeepCopyInto(out)
+       return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, 
writing into out. in must be non-nil.
 func (in *Upstream) DeepCopyInto(out *Upstream) {
        *out = *in
        out.Metadata = in.Metadata

Reply via email to