Skip to content

Commit

Permalink
Fix "go generate ..." issues. (istio#16980)
Browse files Browse the repository at this point in the history
* Fix "go generate ..." issues.

* Fix lingering import.
  • Loading branch information
ozevren authored and istio-testing committed Sep 10, 2019
1 parent 7496ec0 commit c10e3bf
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 166 deletions.
3 changes: 1 addition & 2 deletions galley/pkg/config/source/kube/fs/source_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ import (
"istio.io/istio/galley/pkg/config/source/kube/fs"
"istio.io/istio/galley/pkg/config/testing/basicmeta"
"istio.io/istio/galley/pkg/config/testing/data"
"istio.io/istio/galley/pkg/config/testing/data/builtin"
"istio.io/istio/galley/pkg/config/testing/fixtures"
"istio.io/istio/galley/pkg/config/testing/k8smeta"
"istio.io/pkg/appsignals"
Expand Down Expand Up @@ -188,7 +187,7 @@ func TestAddUpdateDelete_K8sResources(t *testing.T) {
event.FullSyncFor(k8smeta.K8SCoreV1Services)))

acc.Clear()
copyFile(t, dir, "bar.yaml", builtin.GetService())
copyFile(t, dir, "bar.yaml", data.GetService())
appsignals.Notify("test", syscall.SIGUSR1)

g.Eventually(acc.EventsWithoutOrigins).Should(HaveLen(1))
Expand Down
3 changes: 1 addition & 2 deletions galley/pkg/config/source/kube/inmemory/kubesource_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import (
"istio.io/istio/galley/pkg/config/resource"
"istio.io/istio/galley/pkg/config/testing/basicmeta"
"istio.io/istio/galley/pkg/config/testing/data"
"istio.io/istio/galley/pkg/config/testing/data/builtin"
"istio.io/istio/galley/pkg/config/testing/fixtures"
"istio.io/istio/galley/pkg/config/testing/k8smeta"
"istio.io/istio/galley/pkg/config/util/kubeyaml"
Expand Down Expand Up @@ -261,7 +260,7 @@ func TestKubeSource_Service(t *testing.T) {
s.Start()
defer s.Stop()

err := s.ApplyContent("foo", builtin.GetService())
err := s.ApplyContent("foo", data.GetService())
g.Expect(err).To(BeNil())

actual := s.Get(k8smeta.K8SCoreV1Services).AllSorted()
Expand Down
14 changes: 7 additions & 7 deletions galley/pkg/config/source/kube/rt/known_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ import (
metaV1 "k8s.io/apimachinery/pkg/apis/meta/v1"

"istio.io/istio/galley/pkg/config/source/kube/rt"
"istio.io/istio/galley/pkg/config/testing/data/builtin"
"istio.io/istio/galley/pkg/config/testing/data"
"istio.io/istio/galley/pkg/config/testing/k8smeta"
)

func TestParse(t *testing.T) {
t.Run("Endpoints", func(t *testing.T) {
g := NewGomegaWithT(t)
input := builtin.GetEndpoints()
input := data.GetEndpoints()

objMeta, objResource := parse(t, []byte(input), "", "Endpoints")

Expand All @@ -47,7 +47,7 @@ func TestParse(t *testing.T) {

t.Run("Namespace", func(t *testing.T) {
g := NewGomegaWithT(t)
input := builtin.GetNamespace()
input := data.GetNamespace()

objMeta, objResource := parse(t, []byte(input), "", "Namespace")

Expand All @@ -61,7 +61,7 @@ func TestParse(t *testing.T) {

t.Run("Ingress", func(t *testing.T) {
g := NewGomegaWithT(t)
input := builtin.GetIngress()
input := data.GetIngress()

objMeta, objResource := parse(t, []byte(input), "extensions", "Ingress")

Expand All @@ -75,7 +75,7 @@ func TestParse(t *testing.T) {

t.Run("Node", func(t *testing.T) {
g := NewGomegaWithT(t)
input := builtin.GetNode()
input := data.GetNode()

objMeta, objResource := parse(t, []byte(input), "", "Node")

Expand All @@ -89,7 +89,7 @@ func TestParse(t *testing.T) {

t.Run("Pod", func(t *testing.T) {
g := NewGomegaWithT(t)
input := builtin.GetPod()
input := data.GetPod()

objMeta, objResource := parse(t, []byte(input), "", "Pod")

Expand All @@ -103,7 +103,7 @@ func TestParse(t *testing.T) {

t.Run("Service", func(t *testing.T) {
g := NewGomegaWithT(t)
input := builtin.GetService()
input := data.GetService()

objMeta, objResource := parse(t, []byte(input), "", "Service")

Expand Down
87 changes: 0 additions & 87 deletions galley/pkg/config/testing/data/builtin.gen.go

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

5 changes: 5 additions & 0 deletions galley/pkg/config/testing/data/builtin.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,8 @@ func GetService() string {
func GetNamespace() string {
return string(MustAsset("builtin/namespace.yaml"))
}

// GetIngress returns Ingress test data
func GetIngress() string {
return string(MustAsset("builtin/ingress.yaml"))
}
67 changes: 0 additions & 67 deletions galley/pkg/config/testing/data/builtin/get.go

This file was deleted.

Binary file modified mixer/adapter/kubernetesenv/config/config.proto_descriptor
Binary file not shown.
2 changes: 1 addition & 1 deletion mixer/adapter/kubernetesenv/config/kubernetesenv.yaml

Large diffs are not rendered by default.

0 comments on commit c10e3bf

Please sign in to comment.