Skip to content

Commit

Permalink
Merge pull request #65411 from nikhita/fix-publishing-bot-fakeclient
Browse files Browse the repository at this point in the history
Automatic merge from submit-queue (batch tested with PRs 63773, 65411). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

client-go/examples/fake-client: add doc.go to fix go build warnings

The publishing bot is currently broken (#56876 (comment)). This is due to the following error:

```
[24 Jun 18 15:08 UTC]: Running smoke tests for branch master
[24 Jun 18 15:08 UTC]: /bin/bash -xec "godep restore\ngo build ./...\ngo test $(go list ./... | grep -v /vendor/)\n"
	+ godep restore
	+ go build ./...
	go build k8s.io/client-go/examples/fake-client: no non-test Go files in /go-workspace/src/k8s.io/client-go/examples/fake-client
[24 Jun 18 15:09 UTC]: exit status 1
    	+ godep restore
    	+ go build ./...
    	go build k8s.io/client-go/examples/fake-client: no non-test Go files in /go-workspace/src/k8s.io/client-go/examples/fake-client

[24 Jun 18 15:09 UTC]: exit status 1```
```

The fakeclient package does not have any non-test go files. The test file was added in #65291 2 days ago.

This causes `go build` to give a warning: `no non-test Go files in /go-workspace/src/k8s.io/client-go/examples/fake-client`, which breaks the publishing bot. This PR adds a dummy doc.go file in the package to avoid this warning and fix the publishing bot.

**Release note**:

```release-note
NONE
```
  • Loading branch information
Kubernetes Submit Queue committed Jun 24, 2018
2 parents f23ae61 + 764ae69 commit 7a9a30a
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 1 deletion.
11 changes: 10 additions & 1 deletion staging/src/k8s.io/client-go/examples/fake-client/BUILD
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
load("@io_bazel_rules_go//go:def.bzl", "go_test")
load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_test(
name = "go_default_test",
srcs = ["main_test.go"],
embed = [":go_default_library"],
deps = [
"//staging/src/k8s.io/api/core/v1:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
Expand All @@ -25,3 +26,11 @@ filegroup(
tags = ["automanaged"],
visibility = ["//visibility:public"],
)

go_library(
name = "go_default_library",
srcs = ["doc.go"],
importmap = "k8s.io/kubernetes/vendor/k8s.io/client-go/examples/fake-client",
importpath = "k8s.io/client-go/examples/fake-client",
visibility = ["//visibility:public"],
)
20 changes: 20 additions & 0 deletions staging/src/k8s.io/client-go/examples/fake-client/doc.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/*
Copyright 2018 The Kubernetes 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.
*/

// Package fakeclient contains examples on how to use fakeclient in tests.
// Note: This file is here to avoid warnings on go build since there are no
// non-test files in this package.
package fakeclient

0 comments on commit 7a9a30a

Please sign in to comment.