add haproxy and proxysql to version-service request
fetch swagger generator by tag
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 \
+ golang:1.14 sh -c 'go install 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
+ go install github.com/go-swagger/go-swagger/cmd/swagger@v0.24.0
fi
rm -rf versionserviceclient

MODIFY
go.mod
go.mod
@@ -3,7 +3,7 @@ module github.com/percona/percona-xtradb-cluster-operator
go 1.13
require (
- github.com/Percona-Lab/percona-version-service/api v0.0.0-20200707073643-e3dd469db8be
+ github.com/Percona-Lab/percona-version-service/api v0.0.0-20200714141734-e9fed619b55c
github.com/fsnotify/fsnotify v1.4.9 // indirect
github.com/go-openapi/errors v0.19.6
github.com/go-openapi/runtime v0.19.16

MODIFY
go.sum
go.sum
@@ -61,8 +61,8 @@ github.com/NYTimes/gziphandler v1.1.1/go.mod h1:n/CVRwUEOgIxrgPvAQhUUr9oeUtvrhMo
github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5/go.mod h1:lmUJ/7eu/Q8D7ML55dXQrVaamCz2vxCfdQBasLZfHKk=
github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU=
github.com/OneOfOne/xxhash v1.2.6/go.mod h1:eZbhyaAYD41SGSSsnmcpxVoRiQ/MPUTjUdIIOT9Um7Q=
-github.com/Percona-Lab/percona-version-service/api v0.0.0-20200707073643-e3dd469db8be h1:TL1Q7CRBmK3vUC9Z6EMdcra6wHmL0fkcMjDgs3ypEyI=
-github.com/Percona-Lab/percona-version-service/api v0.0.0-20200707073643-e3dd469db8be/go.mod h1:QDbZ+DHh0CkTHN6LRkMQd1pEl3b30EaNZ9FA97Mb3TA=
+github.com/Percona-Lab/percona-version-service/api v0.0.0-20200714141734-e9fed619b55c h1:wyHFENXN6jvd8UFy9z+nNgTBmUXVbUjCETqVYwooi40=
+github.com/Percona-Lab/percona-version-service/api v0.0.0-20200714141734-e9fed619b55c/go.mod h1:QDbZ+DHh0CkTHN6LRkMQd1pEl3b30EaNZ9FA97Mb3TA=
github.com/PuerkitoBio/purell v1.0.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0=
github.com/PuerkitoBio/purell v1.1.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0=
github.com/PuerkitoBio/purell v1.1.1 h1:WEQqlqaGbrPkxLJWfBwQmfEAE1Z7ONdDLqrN38tNFfI=

MODIFY
pkg/controller/pxc/version.go
pkg/controller/pxc/version.go
@@ -111,7 +111,7 @@ func (r *ReconcilePerconaXtraDBCluster) ensurePXCVersion(cr *api.PerconaXtraDBCl
PXCVersion: cr.Status.PXC.Version,
PMMVersion: cr.Status.PMM.Version,
HAProxyVersion: cr.Status.HAProxy.Version,
- ProxySqlVersion: cr.Status.ProxySQL.Version,
+ ProxySQLVersion: cr.Status.ProxySQL.Version,
BackupVersion: cr.Status.Backup.Version,
CRUID: string(cr.GetUID()),
})

MODIFY
pkg/controller/pxc/vs.go
pkg/controller/pxc/vs.go
@@ -28,12 +28,14 @@ func (vs VersionServiceClient) GetExactVersion(vm versionMeta) (DepVersion, erro
applyParams := &version_service.VersionServiceApplyParams{
Apply: vm.Apply,
BackupVersion: &vm.BackupVersion,
- CustomResourceOid: &vm.CRUID,
+ CustomResourceUID: &vm.CRUID,
DatabaseVersion: &vm.PXCVersion,
KubeVersion: &vm.KubeVersion,
OperatorVersion: vs.OpVersion,
Platform: &vm.Platform,
PmmVersion: &vm.PMMVersion,
+ ProxysqlVersion: &vm.ProxySQLVersion,
+ HaproxyVersion: &vm.HAProxyVersion,
Product: productName,
HTTPClient: &http.Client{Timeout: 10 * time.Second},
}
@@ -69,7 +71,7 @@ func (vs VersionServiceClient) GetExactVersion(vm versionMeta) (DepVersion, erro
return DepVersion{}, err
}
- haproxyVersion, err := getVersion(r.Versions[0].Matrix.HAProxy)
+ haproxyVersion, err := getVersion(resp.Payload.Versions[0].Matrix.Haproxy)
if err != nil {
return DepVersion{}, err
}
@@ -83,6 +85,8 @@ func (vs VersionServiceClient) GetExactVersion(vm versionMeta) (DepVersion, erro
ProxySqlVersion: proxySqlVersion,
PMMImage: resp.Payload.Versions[0].Matrix.Pmm[pmmVersion].ImagePath,
PMMVersion: pmmVersion,
+ HAProxyImage: resp.Payload.Versions[0].Matrix.Haproxy[haproxyVersion].ImagePath,
+ HAProxyVersion: haproxyVersion,
}, nil
}
@@ -126,5 +130,7 @@ type versionMeta struct {
Platform string
PMMVersion string
BackupVersion string
+ ProxySQLVersion string
+ HAProxyVersion string
CRUID string
}

MODIFY
vendor/github.com/Percona-Lab/percona-version-service/api/version.proto
vendor/github.com/Percona-Lab/percona-version-service/api/version.proto
@@ -46,8 +46,10 @@ message ApplyRequest {
string platform = 6;
string pmm_version = 7;
string backup_version = 8;
- string namespace_oid = 9;
- string custom_resource_oid = 10;
+ string proxysql_version = 9;
+ string haproxy_version = 10;
+ string namespace_uid = 11;
+ string custom_resource_uid = 12;
}
// Status describes the current version status.

MODIFY
vendor/github.com/Percona-Lab/percona-version-service/api/version.swagger.yaml
vendor/github.com/Percona-Lab/percona-version-service/api/version.swagger.yaml
@@ -57,11 +57,19 @@ paths:
in: query
required: false
type: string
- - name: namespaceOid
+ - name: proxysqlVersion
in: query
required: false
type: string
- - name: customResourceOid
+ - name: haproxyVersion
+ in: query
+ required: false
+ type: string
+ - name: namespaceUid
+ in: query
+ required: false
+ type: string
+ - name: customResourceUid
in: query
required: false
type: string

MODIFY
vendor/modules.txt
vendor/modules.txt
# cloud.google.com/go v0.49.0
cloud.google.com/go/compute/metadata
-# github.com/Percona-Lab/percona-version-service/api v0.0.0-20200707073643-e3dd469db8be
+# github.com/Percona-Lab/percona-version-service/api v0.0.0-20200714141734-e9fed619b55c
github.com/Percona-Lab/percona-version-service/api
# github.com/PuerkitoBio/purell v1.1.1
github.com/PuerkitoBio/purell

add haproxy and proxysql to version-service request
fetch swagger generator by tag