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

output the same conversion code regardless of the build environment #408

Open
4 tasks
masa213f opened this issue Apr 25, 2022 · 0 comments
Open
4 tasks

Comments

@masa213f
Copy link
Contributor

masa213f commented Apr 25, 2022

What

When I run make generate inside GOPATH, it generates a different code than the committed code.

$ mkdir -p $GOPATH/src/github.com/cybozu-go/
$ cd $GOPATH/src/github.com/cybozu-go/
$ git clone git@github.com:cybozu-go/moco.git
$ cd moco
$ make setup
$ make generate

Then conversion-gen outputs the following error:

/home/m001282/go/src/github.com/cybozu-go/moco/bin/conversion-gen -i ./api/v1beta1/ -o . -O zz_generated.conversion --go-header-file hack/boilerplate.go.txt
E0425 06:42:46.657636  931029 conversion.go:193] Rename function github.com/cybozu-go/moco/api/v1beta1 Convert__MySQLClusterSpec_To_v1beta2_MySQLClusterSpec -> Convert_v1beta1_MySQLClusterSpec_To_v1beta2_MySQLClusterSpec to match expected conversion signature
E0425 06:42:46.657779  931029 conversion.go:193] Rename function github.com/cybozu-go/moco/api/v1beta1 Convert__MySQLCluster_To_v1beta2_MySQLCluster -> Convert_v1beta1_MySQLCluster_To_v1beta2_MySQLCluster to match expected conversion signature
E0425 06:42:46.657885  931029 conversion.go:193] Rename function github.com/cybozu-go/moco/api/v1beta1 Convert_v1beta2_MySQLClusterSpec_To__MySQLClusterSpec -> Convert_v1beta2_MySQLClusterSpec_To_v1beta1_MySQLClusterSpec to match expected conversion signature
E0425 06:42:46.657960  931029 conversion.go:193] Rename function github.com/cybozu-go/moco/api/v1beta1 Convert_v1beta2_MySQLCluster_To__MySQLCluster -> Convert_v1beta2_MySQLCluster_To_v1beta1_MySQLCluster to match expected conversion signature
E0425 06:42:46.658043  931029 conversion.go:193] Rename function github.com/cybozu-go/moco/api/v1beta1 Convert_v1beta2_PodTemplateSpec_To__PodTemplateSpec -> Convert_v1beta2_PodTemplateSpec_To_v1beta1_PodTemplateSpec to match expected conversion signature
E0425 06:42:46.681872  931029 conversion.go:755] Warning: could not find nor generate a final Conversion function for github.com/cybozu-go/moco/api/v1beta1.MySQLClusterSpec -> github.com/cybozu-go/moco/api/v1beta2.MySQLClusterSpec
E0425 06:42:46.682112  931029 conversion.go:756]   the following fields need manual conversion:
E0425 06:42:46.682131  931029 conversion.go:758]       - ServiceTemplate
E0425 06:42:46.683002  931029 conversion.go:755] Warning: could not find nor generate a final Conversion function for github.com/cybozu-go/moco/api/v1beta2.MySQLClusterSpec -> github.com/cybozu-go/moco/api/v1beta1.MySQLClusterSpec
E0425 06:42:46.683028  931029 conversion.go:756]   the following fields need manual conversion:
E0425 06:42:46.683036  931029 conversion.go:758]       - PrimaryServiceTemplate
E0425 06:42:46.683043  931029 conversion.go:758]       - ReplicaServiceTemplate
E0425 06:42:46.692662  931029 conversion.go:755] Warning: could not find nor generate a final Conversion function for github.com/cybozu-go/moco/api/v1beta2.PodTemplateSpec -> github.com/cybozu-go/moco/api/v1beta1.PodTemplateSpec
E0425 06:42:46.692717  931029 conversion.go:756]   the following fields need manual conversion:
E0425 06:42:46.692756  931029 conversion.go:758]       - OverwriteContainers

And It craetes a file in the unexpedted path: <workdir>/github.com/cybozu-go/moco/api/v1beta1/zz_generated.conversion.go

How

The following issue may be helpful.
kubernetes-sigs/cluster-api#4349

Checklist

  • Finish implementation of the issue
  • Test all functions
  • Have enough logs to trace activities
  • Notify developers of necessary actions
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

No branches or pull requests

1 participant