Closed full1985 closed 1 year ago
@full1985 If you want to contribute to stolon updating its dependencies feel free to do it. Just open multiple PR for every group of dependencies or the changes will be too much for a single PR.
If you're asking why just updating the dependencies doesn't compile: it's normal if dependencies changes their API, you should understand the compilation error, update the related code and test it.
What happened:
I would like to upgrade stolon with some new libraries and I made these kind of changes inside go module (compiling with go1.20.3):
$go version go version go1.20.3 linux/amd64
$diff --ignore-all-space go.mod_orig3 go.mod_orig 3a4,5
If I try to use library "k8s.io/api v0.18.19" instead of "k8s.io/api v0.17.3", I got the following errors running make command:
$make CGO_ENABLED=0 GO111MODULE=on go build -ldflags "-w -X github.com/sorintlab/stolon/cmd.Version=4bb4107523c2db09fa711c1d96ddfe33bacf405c-dirty" -o /opt/som/db/ta/git/stolon//bin/stolon-sentinel github.com/sorintlab/stolon/cmd/sentinel
github.com/sorintlab/stolon/internal/store
internal/store/k8s.go:80:41: not enough arguments in call to podsClient.Get have (string, "k8s.io/apimachinery/pkg/apis/meta/v1".GetOptions) want ("context".Context, string, "k8s.io/apimachinery/pkg/apis/meta/v1".GetOptions) internal/store/k8s.go:105:62: not enough arguments in call to podsClient.Patch have (string, "k8s.io/apimachinery/pkg/types".PatchType, []byte) want ("context".Context, string, "k8s.io/apimachinery/pkg/types".PatchType, []byte, "k8s.io/apimachinery/pkg/apis/meta/v1".PatchOptions, ...string) internal/store/k8s.go:122:48: not enough arguments in call to epsClient.Get have (string, "k8s.io/apimachinery/pkg/apis/meta/v1".GetOptions) want ("context".Context, string, "k8s.io/apimachinery/pkg/apis/meta/v1".GetOptions) internal/store/k8s.go:161:30: not enough arguments in call to epsClient.Update have ("k8s.io/api/core/v1".ConfigMap) want ("context".Context, "k8s.io/api/core/v1".ConfigMap, "k8s.io/apimachinery/pkg/apis/meta/v1".UpdateOptions) internal/store/k8s.go:171:30: not enough arguments in call to epsClient.Create have ("k8s.io/api/core/v1".ConfigMap) want ("context".Context, "k8s.io/api/core/v1".ConfigMap, "k8s.io/apimachinery/pkg/apis/meta/v1".CreateOptions) internal/store/k8s.go:194:48: not enough arguments in call to epsClient.Get have (string, "k8s.io/apimachinery/pkg/apis/meta/v1".GetOptions) want ("context".Context, string, "k8s.io/apimachinery/pkg/apis/meta/v1".GetOptions) internal/store/k8s.go:204:30: not enough arguments in call to epsClient.Update have ("k8s.io/api/core/v1".ConfigMap) want ("context".Context, "k8s.io/api/core/v1".ConfigMap, "k8s.io/apimachinery/pkg/apis/meta/v1".UpdateOptions) internal/store/k8s.go:209:30: not enough arguments in call to epsClient.Create have ("k8s.io/api/core/v1".ConfigMap) want ("context".Context, "k8s.io/api/core/v1".ConfigMap, "k8s.io/apimachinery/pkg/apis/meta/v1".CreateOptions) internal/store/k8s.go:226:47: not enough arguments in call to epsClient.Get have (string, "k8s.io/apimachinery/pkg/apis/meta/v1".GetOptions) want ("context".Context, string, "k8s.io/apimachinery/pkg/apis/meta/v1".GetOptions) internal/store/k8s.go:263:33: not enough arguments in call to podsClient.List have ("k8s.io/apimachinery/pkg/apis/meta/v1".ListOptions) want ("context".Context, "k8s.io/apimachinery/pkg/apis/meta/v1".ListOptions) internal/store/k8s.go:263:33: too many errors make: *** [sentinel] Error 1 $
What you expected to happen:
I should be able to compile correctly, I guess that with the new library that methods changed the number of arguments and need to be fixed accordingly
How to reproduce it (as minimally and precisely as possible):
see above the details
Anything else we need to know?:
Environment:
development
sorintlab/stolon:master-pg13
$cat /etc/os-release NAME="Amazon Linux" VERSION="2" ID="amzn" ID_LIKE="centos rhel fedora" VERSION_ID="2" PRETTY_NAME="Amazon Linux 2" ANSI_COLOR="0;33" CPE_NAME="cpe:2.3:o:amazon:amazon_linux:2" HOME_URL="https://amazonlinux.com/"