Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add patch for openapi #2031

Merged
merged 1 commit into from
Oct 4, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions hack/godeps/godep-save.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,6 @@ git checkout -- ${MINIKUBE_ROOT}/vendor/golang.org/x/sys/windows
pushd ${MINIKUBE_ROOT} >/dev/null
git apply ${MINIKUBE_ROOT}/hack/tpr-patch.diff
git apply ${MINIKUBE_ROOT}/hack/kube-proxy-patch.diff
git apply ${MINIKUBE_ROOT}/hack/openapi.diff
popd >/dev/null

31 changes: 31 additions & 0 deletions hack/openapi.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
diff --git a/vendor/k8s.io/apiserver/pkg/endpoints/openapi/openapi.go b/vendor/k8s.io/apiserver/pkg/endpoints/openapi/openapi.go
index 182c51796..03725947c 100644
--- a/vendor/k8s.io/apiserver/pkg/endpoints/openapi/openapi.go
+++ b/vendor/k8s.io/apiserver/pkg/endpoints/openapi/openapi.go
@@ -26,11 +26,12 @@ import (
"github.com/emicklei/go-restful"
"github.com/go-openapi/spec"

+ "sort"
+
"k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/apiserver/pkg/util/trie"
- "sort"
)

var verbs = trie.New([]string{"get", "log", "read", "replace", "patch", "delete", "deletecollection", "watch", "connect", "proxy", "list", "create", "patch"})
@@ -135,7 +136,11 @@ func friendlyName(name string) string {
}

func typeName(t reflect.Type) string {
- return fmt.Sprintf("%s.%s", t.PkgPath(), t.Name())
+ path := t.PkgPath()
+ if strings.Contains(path, "/vendor/") {
+ path = path[strings.Index(path, "/vendor/")+len("/vendor/"):]
+ }
+ return fmt.Sprintf("%s.%s", path, t.Name())
}

// NewDefinitionNamer constructs a new DefinitionNamer to be used to customize OpenAPI spec.
9 changes: 7 additions & 2 deletions vendor/k8s.io/apiserver/pkg/endpoints/openapi/openapi.go

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