Skip to content

Commit

Permalink
upgrade client go to v0.27.4 (#362)
Browse files Browse the repository at this point in the history
Signed-off-by: Xiangjing Li <xiangli@redhat.com>
  • Loading branch information
xiangjingli authored Aug 25, 2023
1 parent 5469297 commit d1fd79e
Show file tree
Hide file tree
Showing 19 changed files with 330 additions and 856 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/go-presubmit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ jobs:
- name: Run Gosec Security Scanner
uses: securego/gosec@master
with:
args: -exclude-generated ./...
# gosec doesn't support in-line comment like `//nolint` to ignore the G602 warning.
args: -exclude-generated -exclude=G602 ./...

e2e:
name: e2e
Expand All @@ -124,12 +125,12 @@ jobs:
- name: setup kind
uses: engineerd/setup-kind@v0.5.0
with:
version: v0.14.0
version: v0.20.0
name: cluster1
- name: setup kind
uses: engineerd/setup-kind@v0.5.0
with:
version: v0.14.0
version: v0.20.0
name: hub
- name: Load image on the nodes of the cluster
run: |
Expand Down
8 changes: 6 additions & 2 deletions addon/addon.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"github.com/openshift/library-go/pkg/operator/events"
"github.com/openshift/library-go/pkg/operator/resource/resourceapply"
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/equality"
"k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime/schema"
Expand Down Expand Up @@ -89,7 +90,7 @@ func getValue(cluster *clusterv1.ManagedCluster,
addonValues.OnHubCluster = true
}

annotations := addon.GetAnnotations()
annotations := cluster.GetAnnotations()

// set OnMulticlusterHub to true for regional hub clusters, so that 3 addon crds won't be cleaned up when the regional hub is detached.
if val, ok := annotations["addon.open-cluster-management.io/on-multicluster-hub"]; ok {
Expand Down Expand Up @@ -234,7 +235,10 @@ func NewAddonManager(kubeConfig *rest.Config, agentImage string, agentInstallAll
toAddonResources,
),
).
WithAgentRegistrationOption(newRegistrationOption(kubeClient, AppMgrAddonName))
WithAgentRegistrationOption(newRegistrationOption(kubeClient, AppMgrAddonName)).
WithAgentDeployTriggerClusterFilter(func(old, new *clusterv1.ManagedCluster) bool {
return !equality.Semantic.DeepEqual(old.Annotations, new.Annotations)
})

if agentInstallAllStrategy {
agentFactory.WithInstallStrategy(agent.InstallAllStrategy("open-cluster-management-agent-addon"))
Expand Down
4 changes: 2 additions & 2 deletions build/run-e2e-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ if [ "$TRAVIS_BUILD" != 1 ]; then
sed -i -e "s|image: .*:latest$|image: $BUILD_IMAGE|" deploy/standalone/operator.yaml

echo -e "\nDownload and install KinD\n"
GO111MODULE=on go get sigs.k8s.io/kind@v0.13.0
GO111MODULE=on go get sigs.k8s.io/kind@v0.20.0


else
Expand All @@ -68,7 +68,7 @@ if [ $? != 0 ]; then
exit $?;
fi

kind create cluster --image=kindest/node:v1.21.1
kind create cluster --image=kindest/node:v1.27.3
if [ $? != 0 ]; then
exit $?;
fi
Expand Down
6 changes: 5 additions & 1 deletion cmd/appsubsummary/exec/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@ func RunManager() {
"renewDeadline", options.LeaderElectionRenewDeadline,
"retryPeriod", options.LeaderElectionRetryPeriod)

webhookServer := k8swebhook.NewServer(k8swebhook.Options{
TLSMinVersion: appsubv1.TLSMinVersionString,
})

// Create a new Cmd to provide shared dependencies and start components
mgr, err := ctrl.NewManager(cfg, ctrl.Options{
MetricsBindAddress: fmt.Sprintf("%s:%d", metricsHost, metricsPort),
Expand All @@ -81,7 +85,7 @@ func RunManager() {
LeaseDuration: &options.LeaderElectionLeaseDuration,
RenewDeadline: &options.LeaderElectionRenewDeadline,
RetryPeriod: &options.LeaderElectionRetryPeriod,
WebhookServer: &k8swebhook.Server{TLSMinVersion: appsubv1.TLSMinVersionString},
WebhookServer: webhookServer,
ClientDisableCacheFor: []client.Object{&corev1.Secret{}, &corev1.ServiceAccount{}},
})
if err != nil {
Expand Down
6 changes: 5 additions & 1 deletion cmd/manager/exec/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,10 @@ func RunManager() {
"renewDeadline", Options.LeaderElectionRenewDeadline,
"retryPeriod", Options.LeaderElectionRetryPeriod)

webhookServer := k8swebhook.NewServer(k8swebhook.Options{
TLSMinVersion: appsubv1.TLSMinVersionString,
})

// Create a new Cmd to provide shared dependencies and start components
mgr, err := ctrl.NewManager(cfg, ctrl.Options{
MetricsBindAddress: fmt.Sprintf("%s:%d", metricsHost, metricsPort),
Expand All @@ -126,7 +130,7 @@ func RunManager() {
LeaseDuration: &Options.LeaderElectionLeaseDuration,
RenewDeadline: &Options.LeaderElectionRenewDeadline,
RetryPeriod: &Options.LeaderElectionRetryPeriod,
WebhookServer: &k8swebhook.Server{TLSMinVersion: appsubv1.TLSMinVersionString},
WebhookServer: webhookServer,
ClientDisableCacheFor: []client.Object{&corev1.Secret{}, &corev1.ServiceAccount{}},
})

Expand Down
6 changes: 5 additions & 1 deletion cmd/placementrule/exec/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@ func RunManager() {
"renewDeadline", options.LeaderElectionRenewDeadline,
"retryPeriod", options.LeaderElectionRetryPeriod)

webhookServer := k8swebhook.NewServer(k8swebhook.Options{
TLSMinVersion: appsubv1.TLSMinVersionString,
})

mgr, err := ctrl.NewManager(cfg, ctrl.Options{
MetricsBindAddress: fmt.Sprintf("%s:%d", metricsHost, metricsPort),
Port: operatorMetricsPort,
Expand All @@ -83,7 +87,7 @@ func RunManager() {
LeaseDuration: &options.LeaderElectionLeaseDuration,
RenewDeadline: &options.LeaderElectionRenewDeadline,
RetryPeriod: &options.LeaderElectionRetryPeriod,
WebhookServer: &k8swebhook.Server{TLSMinVersion: appsubv1.TLSMinVersionString},
WebhookServer: webhookServer,
})

if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion deploy/ocm/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ KUBECTL=${KUBECTL:-kubectl}
rm -rf ocm

echo "############ Cloning ocm"
git clone https://github.com/open-cluster-management-io/ocm.git
git clone --depth 1 --branch main https://github.com/open-cluster-management-io/ocm.git

cd ocm || {
printf "cd failed, ocm does not exist"
Expand Down
142 changes: 68 additions & 74 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,58 +3,51 @@ module open-cluster-management.io/multicloud-operators-subscription
go 1.20

require (
github.com/Masterminds/semver/v3 v3.1.1
github.com/Masterminds/semver/v3 v3.2.0
github.com/aws/aws-sdk-go-v2 v1.16.7
github.com/aws/aws-sdk-go-v2/config v1.15.14
github.com/aws/aws-sdk-go-v2/service/s3 v1.27.1
github.com/ghodss/yaml v1.0.1-0.20190212211648-25d852aebe32
github.com/go-git/go-git/v5 v5.4.2
github.com/go-logr/logr v1.2.3
github.com/go-logr/logr v1.2.4
github.com/google/go-github/v42 v42.0.0
github.com/johannesboyne/gofakes3 v0.0.0-20210819161434-5c8dfcfe5310
github.com/onsi/ginkgo/v2 v2.1.6
github.com/onsi/gomega v1.20.1
github.com/openshift/api v0.0.0-20220525145417-ee5b62754c68
github.com/openshift/library-go v0.0.0-20220727134723-6802b30e83ba
github.com/operator-framework/operator-lib v0.11.0
github.com/onsi/ginkgo/v2 v2.9.5
github.com/onsi/gomega v1.27.7
github.com/openshift/api v0.0.0-20230816181854-a7ca92db022a
github.com/openshift/library-go v0.0.0-20230809121909-d7e7beca5bae
github.com/operator-framework/operator-lib v0.11.1-0.20230717184314-6efbe3a22f6f
github.com/pkg/errors v0.9.1
github.com/prometheus/client_golang v1.12.2
github.com/prometheus/client_golang v1.15.1
github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06
github.com/spf13/pflag v1.0.5
github.com/stretchr/testify v1.8.0
golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa
golang.org/x/net v0.7.0
github.com/stretchr/testify v1.8.1
golang.org/x/crypto v0.5.0
golang.org/x/net v0.10.0
gomodules.xyz/jsonpatch/v3 v3.0.1
gopkg.in/src-d/go-git.v4 v4.13.1
helm.sh/helm/v3 v3.10.3
k8s.io/api v0.25.7
k8s.io/apiextensions-apiserver v0.25.7
k8s.io/apimachinery v0.25.7
k8s.io/cli-runtime v0.25.7
k8s.io/client-go v0.25.7
helm.sh/helm/v3 v3.11.1
k8s.io/api v0.27.4
k8s.io/apiextensions-apiserver v0.27.4
k8s.io/apimachinery v0.27.4
k8s.io/cli-runtime v0.26.0
k8s.io/client-go v0.27.4
k8s.io/klog v1.0.0
k8s.io/klog/v2 v2.70.1
open-cluster-management.io/addon-framework v0.5.0
open-cluster-management.io/api v0.9.0
k8s.io/klog/v2 v2.90.1
open-cluster-management.io/addon-framework v0.7.1-0.20230801094803-822eeca5fb8a
open-cluster-management.io/api v0.11.1-0.20230727093131-915f5826cff9
open-cluster-management.io/multicloud-operators-channel v0.10.1-0.20230316173315-10f48e51f3aa
sigs.k8s.io/controller-runtime v0.12.3
sigs.k8s.io/controller-runtime v0.15.1
sigs.k8s.io/kustomize/api v0.12.1
sigs.k8s.io/kustomize/kyaml v0.13.9
)

require (
cloud.google.com/go/compute v1.7.0 // indirect
github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 // indirect
github.com/Azure/go-autorest v14.2.0+incompatible // indirect
github.com/Azure/go-autorest/autorest v0.11.28 // indirect
github.com/Azure/go-autorest/autorest/adal v0.9.21 // indirect
github.com/Azure/go-autorest/autorest/date v0.3.0 // indirect
github.com/Azure/go-autorest/logger v0.2.1 // indirect
github.com/Azure/go-autorest/tracing v0.6.0 // indirect
github.com/BurntSushi/toml v1.2.0 // indirect
github.com/BurntSushi/toml v1.2.1 // indirect
github.com/MakeNowJust/heredoc v1.0.0 // indirect
github.com/Masterminds/goutils v1.1.1 // indirect
github.com/Masterminds/sprig/v3 v3.2.2 // indirect
github.com/Masterminds/sprig/v3 v3.2.3 // indirect
github.com/Masterminds/squirrel v1.5.3 // indirect
github.com/Microsoft/go-winio v0.5.2 // indirect
github.com/acomagu/bufpipe v1.0.3 // indirect
Expand All @@ -76,52 +69,54 @@ require (
github.com/aws/smithy-go v1.12.0 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/blang/semver/v4 v4.0.0 // indirect
github.com/cespare/xxhash/v2 v2.1.2 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/chai2010/gettext-go v1.0.2 // indirect
github.com/containerd/containerd v1.6.6 // indirect
github.com/containerd/containerd v1.6.15 // indirect
github.com/cyphar/filepath-securejoin v0.2.3 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/docker/cli v20.10.17+incompatible // indirect
github.com/docker/cli v20.10.21+incompatible // indirect
github.com/docker/distribution v2.8.1+incompatible // indirect
github.com/docker/docker v20.10.17+incompatible // indirect
github.com/docker/docker-credential-helpers v0.6.4 // indirect
github.com/docker/docker v20.10.21+incompatible // indirect
github.com/docker/docker-credential-helpers v0.7.0 // indirect
github.com/docker/go-connections v0.4.0 // indirect
github.com/docker/go-metrics v0.0.1 // indirect
github.com/docker/go-units v0.4.0 // indirect
github.com/emicklei/go-restful/v3 v3.9.0 // indirect
github.com/emirpasic/gods v1.18.1 // indirect
github.com/evanphx/json-patch v5.6.0+incompatible // indirect
github.com/evanphx/json-patch/v5 v5.6.0 // indirect
github.com/exponent-io/jsonpath v0.0.0-20210407135951-1de76d718b3f // indirect
github.com/fatih/color v1.13.0 // indirect
github.com/fatih/structs v1.1.0 // indirect
github.com/fsnotify/fsnotify v1.5.4 // indirect
github.com/fsnotify/fsnotify v1.6.0 // indirect
github.com/gliderlabs/ssh v0.3.3 // indirect
github.com/go-errors/errors v1.4.2 // indirect
github.com/go-git/gcfg v1.5.0 // indirect
github.com/go-git/go-billy/v5 v5.3.1 // indirect
github.com/go-git/go-git-fixtures/v4 v4.3.1 // indirect
github.com/go-gorp/gorp/v3 v3.0.2 // indirect
github.com/go-openapi/jsonpointer v0.19.5 // indirect
github.com/go-openapi/jsonreference v0.20.0 // indirect
github.com/go-openapi/swag v0.21.1 // indirect
github.com/go-openapi/jsonpointer v0.19.6 // indirect
github.com/go-openapi/jsonreference v0.20.1 // indirect
github.com/go-openapi/swag v0.22.3 // indirect
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 // indirect
github.com/gobwas/glob v0.2.3 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang-jwt/jwt/v4 v4.4.2 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/google/btree v1.1.2 // indirect
github.com/google/gnostic v0.6.9 // indirect
github.com/google/go-cmp v0.5.8 // indirect
github.com/google/go-cmp v0.5.9 // indirect
github.com/google/go-querystring v1.1.0 // indirect
github.com/google/gofuzz v1.2.0 // indirect
github.com/google/pprof v0.0.0-20230510103437-eeec1cb781c3 // indirect
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/gorilla/mux v1.8.0 // indirect
github.com/gosuri/uitable v0.0.4 // indirect
github.com/gregjones/httpcache v0.0.0-20190611155906-901d90724c79 // indirect
github.com/huandu/xstrings v1.3.2 // indirect
github.com/huandu/xstrings v1.3.3 // indirect
github.com/imdario/mergo v0.3.13 // indirect
github.com/inconshreveable/mousetrap v1.0.0 // indirect
github.com/inconshreveable/mousetrap v1.0.1 // indirect
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect
github.com/jmoiron/sqlx v1.3.5 // indirect
github.com/josharian/intern v1.0.0 // indirect
Expand All @@ -130,78 +125,77 @@ require (
github.com/klauspost/compress v1.15.9 // indirect
github.com/lann/builder v0.0.0-20180802200727-47ae307949d0 // indirect
github.com/lann/ps v0.0.0-20150810152359-62de8c46ede0 // indirect
github.com/lib/pq v1.10.6 // indirect
github.com/lib/pq v1.10.7 // indirect
github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/matryer/is v1.4.0 // indirect
github.com/mattn/go-colorable v0.1.12 // indirect
github.com/mattn/go-isatty v0.0.14 // indirect
github.com/mattn/go-runewidth v0.0.13 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
github.com/mitchellh/copystructure v1.2.0 // indirect
github.com/mitchellh/go-homedir v1.1.0 // indirect
github.com/mitchellh/go-wordwrap v1.0.1 // indirect
github.com/mitchellh/reflectwalk v1.0.2 // indirect
github.com/moby/locker v1.0.1 // indirect
github.com/moby/spdystream v0.2.0 // indirect
github.com/moby/term v0.0.0-20210619224110-3f7ff695adc6 // indirect
github.com/moby/term v0.0.0-20221205130635-1aeaba878587 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00 // indirect
github.com/morikuni/aec v1.0.0 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/opencontainers/go-digest v1.0.0 // indirect
github.com/opencontainers/image-spec v1.0.3-0.20220303224323-02efb9a75ee1 // indirect
github.com/opencontainers/image-spec v1.1.0-rc2 // indirect
github.com/peterbourgon/diskv v2.0.1+incompatible // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/prometheus/client_model v0.2.0 // indirect
github.com/prometheus/common v0.37.0 // indirect
github.com/prometheus/procfs v0.8.0 // indirect
github.com/prometheus/client_model v0.4.0 // indirect
github.com/prometheus/common v0.42.0 // indirect
github.com/prometheus/procfs v0.9.0 // indirect
github.com/rivo/uniseg v0.3.1 // indirect
github.com/rubenv/sql-migrate v1.1.2 // indirect
github.com/russross/blackfriday v1.6.0 // indirect
github.com/rubenv/sql-migrate v1.2.0 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/ryszard/goskiplist v0.0.0-20150312221310-2dfbae5fcf46 // indirect
github.com/sergi/go-diff v1.2.0 // indirect
github.com/shabbyrobe/gocovmerge v0.0.0-20190829150210-3e036491d500 // indirect
github.com/shopspring/decimal v1.3.1 // indirect
github.com/sirupsen/logrus v1.9.0 // indirect
github.com/spf13/cast v1.5.0 // indirect
github.com/spf13/cobra v1.5.0 // indirect
github.com/spf13/cobra v1.6.1 // indirect
github.com/src-d/gcfg v1.4.0 // indirect
github.com/xanzy/ssh-agent v0.3.1 // indirect
github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb // indirect
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect
github.com/xeipuuv/gojsonschema v1.2.0 // indirect
github.com/xlab/treeprint v1.1.0 // indirect
go.etcd.io/etcd/api/v3 v3.5.4 // indirect
go.starlark.net v0.0.0-20220714194419-4cadf0a12139 // indirect
golang.org/x/oauth2 v0.0.0-20220722155238-128564f6959c // indirect
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4 // indirect
golang.org/x/sys v0.5.0 // indirect
golang.org/x/term v0.5.0 // indirect
golang.org/x/text v0.7.0 // indirect
golang.org/x/time v0.0.0-20220722155302-e5dcc9cfc0b9 // indirect
golang.org/x/tools v0.1.12 // indirect
gomodules.xyz/jsonpatch/v2 v2.2.0 // indirect
golang.org/x/oauth2 v0.5.0 // indirect
golang.org/x/sync v0.2.0 // indirect
golang.org/x/sys v0.8.0 // indirect
golang.org/x/term v0.8.0 // indirect
golang.org/x/text v0.9.0 // indirect
golang.org/x/time v0.3.0 // indirect
golang.org/x/tools v0.9.1 // indirect
gomodules.xyz/jsonpatch/v2 v2.3.0 // indirect
gomodules.xyz/orderedmap v0.1.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/genproto v0.0.0-20220725144611-272f38e5d71b // indirect
google.golang.org/grpc v1.48.0 // indirect
google.golang.org/protobuf v1.28.1 // indirect
google.golang.org/grpc v1.51.0 // indirect
google.golang.org/protobuf v1.30.0 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/src-d/go-billy.v4 v4.3.2 // indirect
gopkg.in/warnings.v0 v0.1.2 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/apiserver v0.25.7 // indirect
k8s.io/component-base v0.25.7 // indirect
k8s.io/kube-aggregator v0.24.3 // indirect
k8s.io/kube-openapi v0.0.0-20220803162953-67bda5d908f1 // indirect
k8s.io/kubectl v0.25.2 // indirect
k8s.io/utils v0.0.0-20220728103510-ee6ede2d64ed // indirect
oras.land/oras-go v1.2.0 // indirect
sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2 // indirect
sigs.k8s.io/kube-storage-version-migrator v0.0.5 // indirect
k8s.io/apiserver v0.27.4 // indirect
k8s.io/component-base v0.27.4 // indirect
k8s.io/kube-aggregator v0.27.4 // indirect
k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f // indirect
k8s.io/kubectl v0.26.0 // indirect
k8s.io/utils v0.0.0-20230406110748-d93618cff8a2 // indirect
oras.land/oras-go v1.2.2 // indirect
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
sigs.k8s.io/kube-storage-version-migrator v0.0.6-0.20230721195810-5c8923c5ff96 // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect
sigs.k8s.io/yaml v1.3.0 // indirect
)
Loading

0 comments on commit d1fd79e

Please sign in to comment.