Skip to content

WIP: Add machineconfiguration API#1

Closed
LorbusChris wants to merge 5 commits into
runcom:masterfrom
LorbusChris:machineconfig
Closed

WIP: Add machineconfiguration API#1
LorbusChris wants to merge 5 commits into
runcom:masterfrom
LorbusChris:machineconfig

Conversation

@LorbusChris
Copy link
Copy Markdown

No description provided.

@LorbusChris
Copy link
Copy Markdown
Author

Generating the docs is failing with:

Generating swagger type docs for machineconfiguration/v1 at machineconfiguration/v1
panic: interface conversion: ast.Expr is *ast.SelectorExpr, not *ast.Ident

goroutine 1 [running]:
github.com/openshift/api/vendor/k8s.io/apimachinery/pkg/runtime.fieldName(0xc00002db00, 0x0, 0x0)
    /home/chris/Code/go/src/github.com/openshift/api/vendor/k8s.io/apimachinery/pkg/runtime/swagger_doc_generator.go:111 +0x1e5
github.com/openshift/api/vendor/k8s.io/apimachinery/pkg/runtime.ParseDocumentationFrom(0xc000018660, 0x20, 0xc000064930, 0x1, 0x1)
    /home/chris/Code/go/src/github.com/openshift/api/vendor/k8s.io/apimachinery/pkg/runtime/swagger_doc_generator.go:185 +0x22f
main.main()
    /home/chris/Code/go/src/github.com/openshift/api/tools/genswaggertypedocs/swagger_type_docs.go:71 +0x1d3
exit status 2
make: *** [Makefile:25: generate] Error 1

Could be some explicit conversion is missing, similar to:

// +k8s:conversion-gen=github.com/openshift/origin/pkg/build/apis/build

Comment thread machineconfiguration/OWNERS
Comment thread machineconfiguration/v1/register.go Outdated
Comment thread machineconfiguration/v1/register.go Outdated
@LorbusChris LorbusChris force-pushed the machineconfig branch 2 times, most recently from 26f6982 to f1033f9 Compare February 20, 2019 22:33
Comment thread machineconfiguration/v1/register.go
…gnition types

Also add missing comment to allow for running protobuf/swagger docs generation
@LorbusChris
Copy link
Copy Markdown
Author

next issue:

[chris@localhost api]$ make build
go build github.com/openshift/api/...
# github.com/openshift/api/vendor/k8s.io/kubelet/config/v1beta1
vendor/k8s.io/kubelet/config/v1beta1/generated.pb.go:264:13: arguments to copy have different element types: []byte and []string
vendor/k8s.io/kubelet/config/v1beta1/generated.pb.go:2205:26: cannot use make(map[string]string) (type map[string]string) as type map[string][]string in assignment
vendor/k8s.io/kubelet/config/v1beta1/generated.pb.go:2294:33: cannot use mapvalue (type string) as type []string in assignment
make: *** [Makefile:8: build] Error 2

Maybe it's this issue: golang/go#23536 ?

@kikisdeliveryservice
Copy link
Copy Markdown

the first line 264 error makes sense bc the dAtA is a []byte and v is []string. v is an element of StaticPodURLHeader which is a map[string][]string (see vendor/k8s.io/kubelet/config/v1beta1/types.go)

@kikisdeliveryservice
Copy link
Copy Markdown

kikisdeliveryservice commented Apr 26, 2019

for the second error it's hitting:
m.StaticPodURLHeader = make(map[string]string) which goes against the StaticPodURLHeader type which is a map[string][]string (noted above)

for 3rd it's hitting:
m.StaticPodURLHeader[mapkey] = mapvalue where mapvalue is a string.

Not sure why StaticPodURLHeader is doing this in generated files, but the errors just from poking around seem correct given the def in types.go

Not so familar with the API generation etc tho, but @runcom any idea why this is happening?

Run `glide update && ./hack/update-deps.sh`
Run `make generate && make verify`
@LorbusChris
Copy link
Copy Markdown
Author

moving this over to: openshift#301

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants