Skip to content

Commit

Permalink
Make this project can be run correctly.
Browse files Browse the repository at this point in the history
  • Loading branch information
yongzhi.yang committed May 10, 2019
1 parent 0d9a75b commit c317898
Show file tree
Hide file tree
Showing 36 changed files with 23 additions and 2,006 deletions.
2 changes: 1 addition & 1 deletion Godeps/Godeps.json

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

10 changes: 5 additions & 5 deletions controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ import (
"k8s.io/client-go/util/workqueue"
"k8s.io/klog"

samplev1alpha1 "k8s.io/sample-controller/pkg/apis/migrate/v1"
clientset "k8s.io/sample-controller/pkg/client/clientset/versioned"
samplescheme "k8s.io/sample-controller/pkg/client/clientset/versioned/scheme"
informers "k8s.io/sample-controller/pkg/client/informers/externalversions/migrate/v1"
listers "k8s.io/sample-controller/pkg/client/listers/migrate/v1"
samplev1alpha1 "github.com/yangyongzhi/sym-operator/pkg/apis/migrate/v1"
clientset "github.com/yangyongzhi/sym-operator/pkg/client/clientset/versioned"
samplescheme "github.com/yangyongzhi/sym-operator/pkg/client/clientset/versioned/scheme"
informers "github.com/yangyongzhi/sym-operator/pkg/client/informers/externalversions/migrate/v1"
listers "github.com/yangyongzhi/sym-operator/pkg/client/listers/migrate/v1"
)

const controllerAgentName = "sample-controller"
Expand Down
10 changes: 5 additions & 5 deletions controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ import (
"k8s.io/client-go/tools/cache"
"k8s.io/client-go/tools/record"

samplecontroller "k8s.io/sample-controller/pkg/apis/samplecontroller/v1alpha1"
"k8s.io/sample-controller/pkg/generated/clientset/versioned/fake"
informers "k8s.io/sample-controller/pkg/generated/informers/externalversions"
samplecontroller "github.com/yangyongzhi/sym-operator/pkg/apis/migrate/v1"
"github.com/yangyongzhi/sym-operator/pkg/client/clientset/versioned/fake"
informers "github.com/yangyongzhi/sym-operator/pkg/client/informers/externalversions"
)

var (
Expand Down Expand Up @@ -89,14 +89,14 @@ func (f *fixture) newController() (*Controller, informers.SharedInformerFactory,
k8sI := kubeinformers.NewSharedInformerFactory(f.kubeclient, noResyncPeriodFunc())

c := NewController(f.kubeclient, f.client,
k8sI.Apps().V1().Deployments(), i.Samplecontroller().V1alpha1().Foos())
k8sI.Apps().V1().Deployments(), i.Migrate().V1().Foos())

c.foosSynced = alwaysReady
c.deploymentsSynced = alwaysReady
c.recorder = &record.FakeRecorder{}

for _, f := range f.fooLister {
i.Samplecontroller().V1alpha1().Foos().Informer().GetIndexer().Add(f)
i.Migrate().V1().Foos().Informer().GetIndexer().Add(f)
}

for _, d := range f.deploymentLister {
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// This is a generated file. Do not edit directly.

module k8s.io/sample-controller
module github.com/yangyongzhi/sym-operator

go 1.12

Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ k8s.io/klog v0.3.0 h1:0VPpR+sizsiivjIfIAQH/rl8tan6jvWkS7lU+0di3lE=
k8s.io/klog v0.3.0/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk=
k8s.io/kube-openapi v0.0.0-20190228160746-b3a7cee44a30 h1:TRb4wNWoBVrH9plmkp2q86FIDppkbrEXdXlxU3a3BMI=
k8s.io/kube-openapi v0.0.0-20190228160746-b3a7cee44a30/go.mod h1:BXM9ceUBTj2QnfH2MK1odQs778ajze1RxcmP6S8RVVc=
github.com/YangYongZhi/sym-operator v0.0.0-20190425173525-f9c23632fb31 h1:FdGzSRXIeoPvlZjAkPE2jEcivZNLUbCJ3ncej+l5Rsc=
github.com/YangYongZhi/sym-operator v0.0.0-20190425173525-f9c23632fb31/go.mod h1:GHuOX/EqRZMKxNeVbZW7O0e9A6QsqDjruyOD0k49uVc=
k8s.io/utils v0.0.0-20190221042446-c2654d5206da h1:ElyM7RPonbKnQqOcw7dG2IK5uvQQn3b/WPHqD5mBvP4=
k8s.io/utils v0.0.0-20190221042446-c2654d5206da/go.mod h1:8k8uAuAQ0rXslZKaEWd0c3oVhZz7sSzSiPnVZayjIX0=
modernc.org/cc v1.0.0/go.mod h1:1Sk4//wdnYJiUIxnW8ddKpaOJCF37yAdqYnkxUpaYxw=
Expand Down
13 changes: 1 addition & 12 deletions hack/boilerplate.go.txt
Original file line number Diff line number Diff line change
@@ -1,16 +1,5 @@
/*
Copyright The Kubernetes Authors.
Copyright The Symphony Authors.

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.
*/

6 changes: 3 additions & 3 deletions hack/codegen.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
set -x

GOPATH=$(go env GOPATH)
PACKAGE_NAME=k8s.io/sample-controller
PACKAGE_NAME=github.com/yangyongzhi/sym-operator
REPO_ROOT="$GOPATH/src/$PACKAGE_NAME"
DOCKER_REPO_ROOT="/go/src/$PACKAGE_NAME"
DOCKER_CODEGEN_PKG="/go/src/k8s.io/code-generator"
Expand All @@ -21,8 +21,8 @@ docker run --rm -ti -u $(id -u):$(id -g) \
-v "$REPO_ROOT":"$DOCKER_REPO_ROOT" \
-w "$DOCKER_REPO_ROOT" \
hub.tencentyun.com/xkcp0324/gengo:release-1.12 "$DOCKER_CODEGEN_PKG"/generate-groups.sh all \
k8s.io/sample-controller/pkg/client \
k8s.io/sample-controller/pkg/apis \
$PACKAGE_NAME/pkg/client \
$PACKAGE_NAME/pkg/apis \
"migrate:v1" \
--go-header-file "$DOCKER_REPO_ROOT/hack/boilerplate.go.txt"

Expand Down
2 changes: 1 addition & 1 deletion hack/update-codegen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ CODEGEN_PKG=${CODEGEN_PKG:-$(cd "${SCRIPT_ROOT}"; ls -d -1 ./vendor/k8s.io/code-
# k8s.io/kubernetes. The output-base is needed for the generators to output into the vendor dir
# instead of the $GOPATH directly. For normal projects this can be dropped.
"${CODEGEN_PKG}"/generate-groups.sh "deepcopy,client,informer,lister" \
k8s.io/sample-controller/pkg/generated k8s.io/sample-controller/pkg/apis \
github.com/yangyongzhi/sym-operator/pkg/generated github.com/yangyongzhi/sym-operator/pkg/apis \
samplecontroller:v1alpha1 \
--output-base "$(dirname "${BASH_SOURCE[0]}")/../../.." \
--go-header-file "${SCRIPT_ROOT}"/hack/boilerplate.go.txt
Expand Down
6 changes: 3 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ import (
// Uncomment the following line to load the gcp plugin (only required to authenticate against GKE clusters).
// _ "k8s.io/client-go/plugin/pkg/client/auth/gcp"

clientset "k8s.io/sample-controller/pkg/client/clientset/versioned"
informers "k8s.io/sample-controller/pkg/client/informers/externalversions"
"k8s.io/sample-controller/pkg/signals"
clientset "github.com/yangyongzhi/sym-operator/pkg/client/clientset/versioned"
informers "github.com/yangyongzhi/sym-operator/pkg/client/informers/externalversions"
"github.com/yangyongzhi/sym-operator/pkg/signals"
)

var (
Expand Down
13 changes: 1 addition & 12 deletions pkg/apis/migrate/v1/zz_generated.deepcopy.go

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

98 changes: 0 additions & 98 deletions pkg/client/clientset/versioned/clientset.go

This file was deleted.

20 changes: 0 additions & 20 deletions pkg/client/clientset/versioned/doc.go

This file was deleted.

82 changes: 0 additions & 82 deletions pkg/client/clientset/versioned/fake/clientset_generated.go

This file was deleted.

20 changes: 0 additions & 20 deletions pkg/client/clientset/versioned/fake/doc.go

This file was deleted.

Loading

0 comments on commit c317898

Please sign in to comment.