fix go-get command
MODIFY
Jenkinsfile
Jenkinsfile
@@ -221,7 +221,7 @@ pipeline {
-v $WORKSPACE/src/github.com/percona/percona-xtradb-cluster-operator:/go/src/github.com/percona/percona-xtradb-cluster-operator \
-w /go/src/github.com/percona/percona-xtradb-cluster-operator \
-e GO111MODULE=on \
- golang:1.14 sh -c 'go install github.com/go-swagger/go-swagger/cmd/swagger@v0.24.0 \
+ golang:1.14 sh -c 'go get github.com/go-swagger/go-swagger/cmd/swagger@v0.24.0 \
&& swagger generate client -f vendor/github.com/Percona-Lab/percona-version-service/api/version.swagger.yaml -c versionserviceclient -m versionserviceclient/models \
&& go build -v -mod=vendor -o percona-xtradb-cluster-operator github.com/percona/percona-xtradb-cluster-operator/cmd/manager'
"

MODIFY
build/build-proto.sh
build/build-proto.sh
@@ -4,7 +4,7 @@ set -o errexit
set -o xtrace
if ! swagger version &>/dev/null; then
- go install github.com/go-swagger/go-swagger/cmd/swagger@v0.24.0
+ go get github.com/go-swagger/go-swagger/cmd/swagger@v0.24.0
fi
rm -rf versionserviceclient

MODIFY
pkg/controller/pxc/version.go
pkg/controller/pxc/version.go
@@ -104,7 +104,7 @@ func (r *ReconcilePerconaXtraDBCluster) ensurePXCVersion(cr *api.PerconaXtraDBCl
return errors.New("cluster is not ready")
}
- newVersion, err := vs.GetExactVersion(cr.Spec.UpgradeOptions.VersionServiceEndpoint, VersionMeta{
+ newVersion, err := vs.GetExactVersion(cr.Spec.UpgradeOptions.VersionServiceEndpoint, versionMeta{
Apply: cr.Spec.UpgradeOptions.Apply,
Platform: string(cr.Spec.Platform),
KubeVersion: r.serverVersion.Info.GitVersion,

MODIFY
pkg/controller/pxc/vs.go
pkg/controller/pxc/vs.go
@@ -13,8 +13,8 @@ import (
const productName = "pxc-operator"
-func (vs VersionServiceClient) GetExactVersion(vm versionMeta) (DepVersion, error) {
- requestURL, err := url.Parse(vs.URL)
+func (vs VersionServiceClient) GetExactVersion(endpoint string,vm versionMeta) (DepVersion, error) {
+ requestURL, err := url.Parse(endpoint)
if err != nil {
return DepVersion{}, err
}
@@ -115,11 +115,10 @@ type DepVersion struct {
}
type VersionService interface {
- GetExactVersion(vm versionMeta) (DepVersion, error)
+ GetExactVersion(endpoint string,vm versionMeta) (DepVersion, error)
}
type VersionServiceClient struct {
- URL string
OpVersion string
}

fix go-get command