You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Before this patch, We were replacing go.mod in openstack-operator with
PR commit using branch name.
ex:
~~
go mod edit --replace
github.com/openstack-k8s-operators/keystone-operator/api@$version=
github.com/ysandeep93/keystone-operator/api@dependabot/go_modules/
sigs.k8s.io/controller-runtime-0.13.1
~~~
After Go 1.13, there is an known issue if we have slashes in branch name.[1]
~~~
$go mod tidy
go: errors parsing go.mod:
/tmp/openstack-operator/go.mod:97:
replace github.com/ysandeep93/keystone-operator/api: version
"dependabot/go_modules/sigs.k8s.io/controller-runtime-0.13.1"
invalid: version "dependabot/go_modules/sigs.k8s.io/controller-runtime-0.13.1"
invalid: disallowed version string
~~~
With this patch, updating our logic to use hash of branch instead of branch
name, same workaround/fix is mentioned here[2].
[1] golang/go#32955
[2] golang/go#34175 (comment)
go mod edit --replace github.com/openstack-k8s-operators/${{ inputs.operator_name }}/api@$version=github.com/${{github.event.pull_request.head.repo.full_name}}/api@${{github.head_ref }}
186
+
go mod edit --replace github.com/openstack-k8s-operators/${{ inputs.operator_name }}/api@$version=github.com/${{github.event.pull_request.head.repo.full_name}}/api@${{github.event.pull_request.head.sha}}
187
187
go mod tidy
188
188
cd ./apis/
189
-
go mod edit --replace github.com/openstack-k8s-operators/${{ inputs.operator_name }}/api@$version=github.com/${{github.event.pull_request.head.repo.full_name}}/api@${{github.head_ref }}
189
+
go mod edit --replace github.com/openstack-k8s-operators/${{ inputs.operator_name }}/api@$version=github.com/${{github.event.pull_request.head.repo.full_name}}/api@${{github.event.pull_request.head.sha}}
0 commit comments