kubernetes / sample-controller

Repository for sample controller. Complements sample-apiserver
Apache License 2.0
3.17k stars 1.1k forks source link

go build with error sf.IsExported undefined #84

Closed molinjun closed 2 years ago

molinjun commented 2 years ago

I pulled the latest version and go build. There is some issues:

$ go build -o sample-controller .
# sigs.k8s.io/json/internal/golang/encoding/json
vendor/sigs.k8s.io/json/internal/golang/encoding/json/encode.go:1249:12: sf.IsExported undefined (type reflect.StructField has no field or method IsExported)
vendor/sigs.k8s.io/json/internal/golang/encoding/json/encode.go:1255:18: sf.IsExported undefined (type reflect.StructField has no field or method IsExported)

I googled and someone mentioned it should update the go version from go 1.16 to go 1.17. I am not sure if this is the issue.

blueriver1125 commented 2 years ago

+1

blueriver1125 commented 2 years ago

I pulled the latest version and go build. There is some issues:

$ go build -o sample-controller .
# sigs.k8s.io/json/internal/golang/encoding/json
vendor/sigs.k8s.io/json/internal/golang/encoding/json/encode.go:1249:12: sf.IsExported undefined (type reflect.StructField has no field or method IsExported)
vendor/sigs.k8s.io/json/internal/golang/encoding/json/encode.go:1255:18: sf.IsExported undefined (type reflect.StructField has no field or method IsExported)

I googled and someone mentioned it should update the go version from go 1.16 to go 1.17. I am not sure if this is the issue.

maybe you should upgrade the Kubernates module's version, such as k8s.io/client-go , I'v solved it . k8s.io/client-go v0.19.0

molinjun commented 2 years ago

@blueriver1125 Thank you. could you like to share your go.mod. Why does the repo use a wrong version?

blueriver1125 commented 2 years ago

module example.com/example-broker

go 1.16

require ( github.com/gin-gonic/gin v1.7.7 github.com/kubernetes-sigs/service-catalog v0.3.1 k8s.io/apimachinery v0.19.0 k8s.io/client-go v0.19.0 )

k8s-triage-robot commented 2 years ago

The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

You can:

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

k8s-triage-robot commented 2 years ago

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

You can:

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle rotten

k8s-triage-robot commented 2 years ago

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

You can:

Please send feedback to sig-contributor-experience at kubernetes/community.

/close

k8s-ci-robot commented 2 years ago

@k8s-triage-robot: Closing this issue.

In response to [this](https://github.com/kubernetes/sample-controller/issues/84#issuecomment-1200141297): >The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs. > >This bot triages issues and PRs according to the following rules: >- After 90d of inactivity, `lifecycle/stale` is applied >- After 30d of inactivity since `lifecycle/stale` was applied, `lifecycle/rotten` is applied >- After 30d of inactivity since `lifecycle/rotten` was applied, the issue is closed > >You can: >- Reopen this issue or PR with `/reopen` >- Mark this issue or PR as fresh with `/remove-lifecycle rotten` >- Offer to help out with [Issue Triage][1] > >Please send feedback to sig-contributor-experience at [kubernetes/community](https://github.com/kubernetes/community). > >/close > >[1]: https://www.kubernetes.dev/docs/guide/issue-triage/ Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.