This commit is contained in:
Mikalai Radchuk 2021-05-19 14:08:23 +01:00
Родитель 9d5490c90c
Коммит 350dc63c24
5 изменённых файлов: 912 добавлений и 258 удалений

Просмотреть файл

@ -142,7 +142,7 @@ admin.kubeconfig:
hack/get-admin-kubeconfig.sh /subscriptions/${AZURE_SUBSCRIPTION_ID}/resourceGroups/${RESOURCEGROUP}/providers/Microsoft.RedHatOpenShift/openShiftClusters/${CLUSTER} >admin.kubeconfig
vendor:
# https://groups.google.com/forum/#!topic/golang-nuts/51-D_YFC78k
# See comments in the script for background on why we need it
hack/update-go-module-dependencies.sh
.PHONY: admin.kubeconfig aro az clean client deploy discoverycache generate image-aro image-aro-multistage image-fluentbit image-proxy lint-go proxy publish-image-aro publish-image-aro-multistage publish-image-fluentbit publish-image-proxy secrets secrets-update e2e.test tunnel test-e2e test-go test-python vendor

Просмотреть файл

@ -5,7 +5,7 @@ upstream OCP.
## Installer carry patches
See https://github.com/openshift/installer/compare/release-4.6...mjudeikis:release-4.6-azure.
See https://github.com/openshift/installer/compare/release-4.7...mjudeikis:release-4.7-azure.
## Installation differences
@ -35,3 +35,55 @@ See https://github.com/openshift/installer/compare/release-4.6...mjudeikis:relea
communicate with the cluster.
* ARO runs a dnsmasq service on the nodes through the use of a machineconfig to resolve api-int and *.apps domains on the node locally allowing for custom DNS configured on the VNET.
# Introducing new OCP release into ARO RP
## Update installer fork
To bring new OCP release branch into ARO installer fork:
1. Check git diff between the target release branch release-X.Y and previous one release-X.Y-1
to see if any resources changed and/or architecture changed.
These changes might require more modifications on ARO-RP side later on.
1. Create a new release-X.Y-azure branch in the ARO installer fork from upstream release-X.Y branch.
1. Cherry-pick all commits from the previous release-X.Y-1-azure branch into the new one & fix conflicts.
* While cherry-picking `commit data/assets_vfsdata.go` commit, run `cd ./hack/assets/ && go run ./assets.go`
to generate assets and then add them to this commit.
1. Run `./hack/build.sh` and `./hack/go-test.sh` as part of every commit (`git rebase` with `-x` can help with this).
* Fix build and test failures.
**Note:** If any changes are required during the process, make sure to amend the relevant patch or create a new one.
Each commit should be atomic/complete - you should be able to cherry-pick it into the upstream installer and bring
the fix or feature it carries in full, without a need to cherry-pick additional commits.
This makes it easier to understand the nature of the patch as well as contribute our carry patches
back to the upstream installer.
# Update ARO-RP
Once installer fork is ready:
1. Update `go mod edit -replace` calls in `hack/update-go-module-dependencies.sh` to use a new release-X.Y branch.
* Make sure to read comments in the script.
1. `make vendor`.
* You most likely will have to make changes to the RP codebase at this point to adjust it to new versions of dependencies.
* Also you likely will have to repeat this step several time until you resolve all conflicting dependencies.
Follow `go mod` failures, which will tell you what module requires what other module.
You will probably need to look at the `go.mod` files of these modules and see whether they set own replace directives,
as the script is likely to fail with something like this:
```
go: github.com/openshift/installer@v0.16.1 requires
github.com/openshift/cluster-api-provider-kubevirt@v0.0.0-20201214114543-e5aed9c73f1f requires
kubevirt.io/client-go@v0.0.0-00010101000000-000000000000: invalid version: unknown revision 000000000000
```
In the example above you need to:
* Checkout `github.com/openshift/cluster-api-provider-kubevirt` at commit `e5aed9c73f1f`.
* In go.mod find a replace directive for `kubevirt.io/client-go`.
* Add/update relevant replace directive in ARO-RP `go.mod`.
1. `make generate`.
1. Update `pkg/util/version/const.go` to point to the new release.
* You should be able to find latest published release and image hash [on quay.io](https://quay.io/repository/openshift-release-dev/ocp-release?tab=tags).
* After this point, you should be able to create a dev cluster using the RP and it should use the new release.
1. `make discoverycache`.
* This command requires a running cluster with the new version.

194
go.mod
Просмотреть файл

@ -3,9 +3,9 @@ module github.com/Azure/ARO-RP
go 1.14
require (
cloud.google.com/go v0.77.0 // indirect
cloud.google.com/go v0.82.0 // indirect
github.com/AlekSi/gocov-xml v0.0.0-20190121064608-3a14fb1c4737
github.com/Azure/azure-sdk-for-go v52.5.0+incompatible
github.com/Azure/azure-sdk-for-go v54.3.0+incompatible
github.com/Azure/go-autorest/autorest v0.11.18
github.com/Azure/go-autorest/autorest/adal v0.9.13
github.com/Azure/go-autorest/autorest/azure/auth v0.5.7
@ -13,106 +13,119 @@ require (
github.com/Azure/go-autorest/autorest/to v0.4.0
github.com/Azure/go-autorest/autorest/validation v0.3.1
github.com/Azure/go-autorest/tracing v0.6.0
github.com/Microsoft/go-winio v0.4.16 // indirect
github.com/alvaroloes/enumer v1.1.2
github.com/apparentlymart/go-cidr v1.1.0
github.com/aws/aws-sdk-go v1.37.12 // indirect
github.com/aws/aws-sdk-go v1.38.46 // indirect
github.com/axw/gocov v1.0.0
github.com/clarketm/json v1.15.7 // indirect
github.com/codahale/etm v0.0.0-20141003032925-c00c9e6fb4c9
github.com/containers/image/v5 v5.10.2
github.com/containers/image/v5 v5.12.0
github.com/containers/libtrust v0.0.0-20200511145503-9c3a6c22cd9a // indirect
github.com/containers/ocicrypt v1.1.0 // indirect
github.com/containers/storage v1.25.0 // indirect
github.com/containers/storage v1.31.2 // indirect
github.com/coreos/go-oidc v2.2.1+incompatible
github.com/coreos/go-systemd/v22 v22.1.0
github.com/coreos/ignition/v2 v2.9.0 // indirect
github.com/docker/docker v20.10.3+incompatible // indirect
github.com/coreos/go-systemd/v22 v22.3.2
github.com/coreos/ignition/v2 v2.10.1 // indirect
github.com/coreos/vcontext v0.0.0-20210511154938-8fbad538d364 // indirect
github.com/docker/docker v20.10.6+incompatible // indirect
github.com/docker/spdystream v0.2.0 // indirect
github.com/emicklei/go-restful v2.15.0+incompatible // indirect
github.com/form3tech-oss/jwt-go v3.2.2+incompatible
github.com/exponent-io/jsonpath v0.0.0-20210407135951-1de76d718b3f // indirect
github.com/form3tech-oss/jwt-go v3.2.3+incompatible
github.com/ghodss/yaml v1.0.1-0.20190212211648-25d852aebe32
github.com/go-bindata/go-bindata v3.1.2+incompatible
github.com/go-logr/logr v0.4.0
github.com/go-openapi/jsonpointer v0.19.5 // indirect
github.com/go-openapi/jsonreference v0.19.5 // indirect
github.com/go-openapi/spec v0.20.3 // indirect
github.com/go-playground/validator/v10 v10.4.1 // indirect
github.com/go-openapi/swag v0.19.15 // indirect
github.com/go-playground/validator/v10 v10.6.1 // indirect
github.com/go-test/deep v1.0.7
github.com/gofrs/uuid v3.3.0+incompatible
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/mock v1.4.4
github.com/gofrs/uuid v4.0.0+incompatible
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/mock v1.5.0
github.com/golangci/golangci-lint v1.32.2
github.com/google/go-cmp v0.5.4
github.com/google/gofuzz v1.2.0 // indirect
github.com/google/uuid v1.2.0 // indirect
github.com/googleapis/gnostic v0.5.4
github.com/gophercloud/utils v0.0.0-20210216074907-f6de111f2eae // indirect
github.com/google/btree v1.0.1 // indirect
github.com/google/go-cmp v0.5.6
github.com/googleapis/gnostic v0.5.5
github.com/gophercloud/gophercloud v0.17.0 // indirect
github.com/gorilla/csrf v1.7.0
github.com/gorilla/mux v1.8.0
github.com/gorilla/securecookie v1.1.1
github.com/gorilla/sessions v1.2.1
github.com/gregjones/httpcache v0.0.0-20190611155906-901d90724c79 // indirect
github.com/h2non/filetype v1.1.1 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/imdario/mergo v0.3.12 // indirect
github.com/jstemmer/go-junit-report v0.9.1
github.com/k8snetworkplumbingwg/network-attachment-definition-client v1.1.0 // indirect
github.com/klauspost/compress v1.12.3 // indirect
github.com/leodido/go-urn v1.2.1 // indirect
github.com/libvirt/libvirt-go v7.0.0+incompatible // indirect
github.com/magefile/mage v1.11.0 // indirect
github.com/libvirt/libvirt-go v7.3.0+incompatible // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/mattn/go-runewidth v0.0.10 // indirect
github.com/mattn/go-runewidth v0.0.13 // indirect
github.com/metal3-io/cluster-api-provider-baremetal v0.2.2 // indirect
github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d // indirect
github.com/mitchellh/go-wordwrap v1.0.1 // indirect
github.com/mjudeikis/go-cosmosdb v0.0.0-20210518104404-b205b3cefd36
github.com/nxadm/tail v1.4.8 // indirect
github.com/onsi/ginkgo v1.15.0
github.com/onsi/gomega v1.10.5
github.com/moby/term v0.0.0-20201216013528-df9cb8a40635 // indirect
github.com/onsi/ginkgo v1.16.2
github.com/onsi/gomega v1.12.0
github.com/openshift/api v3.9.1-0.20191111211345-a27ff30ebf09+incompatible
github.com/openshift/client-go v0.0.0-20200827190008-3062137373b5
github.com/openshift/cloud-credential-operator v0.0.0-20210217002926-dce99f70f22c // indirect
github.com/openshift/cluster-api-provider-baremetal v0.0.0-20210126223742-4e254d08e0ad // indirect
github.com/openshift/console-operator v0.0.0-20210216151626-6e1cbc849915
github.com/openshift/client-go v3.9.0+incompatible
github.com/openshift/cloud-credential-operator v0.0.0-20210525141023-02cc6303cd10 // indirect
github.com/openshift/cluster-api-provider-baremetal v0.0.0-20210518162658-a60d493e45aa // indirect
github.com/openshift/cluster-api-provider-kubevirt v0.0.0-20210515110917-b0e15d7907de // indirect
github.com/openshift/console-operator v0.0.0-20210518192856-2d7be8eea682
github.com/openshift/custom-resource-status v1.1.0 // indirect
github.com/openshift/installer v0.16.1
github.com/openshift/library-go v0.0.0-20200909173121-1d055d971916
github.com/openshift/machine-api-operator v0.2.1-0.20210104142355-8e6ae0acdfcf
github.com/openshift/library-go v0.0.0-20210521084623-7392ea9b02ca
github.com/openshift/machine-api-operator v0.2.1-0.20210516083017-bb9e0b5c1170
github.com/openshift/machine-config-operator v4.2.0-alpha.0.0.20190917115525-033375cbe820+incompatible
github.com/operator-framework/operator-sdk v1.4.2
github.com/ovirt/go-ovirt v0.0.0-20210112072624-e4d3b104de71 // indirect
github.com/operator-framework/operator-sdk v1.7.2
github.com/pborman/uuid v1.2.1 // indirect
github.com/pquerna/cachecontrol v0.0.0-20201205024021-ac21108117ac // indirect
github.com/prometheus/client_golang v1.9.0 // indirect
github.com/prometheus/common v0.15.0
github.com/prometheus/procfs v0.6.0 // indirect
github.com/rivo/uniseg v0.2.0 // indirect
github.com/sirupsen/logrus v1.7.1
github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635 // indirect
github.com/ugorji/go/codec v1.2.5-0.20210320190651-a2bb12368408
github.com/ulikunitz/xz v0.5.10 // indirect
github.com/vmware/govmomi v0.24.0 // indirect
go.opencensus.io v0.22.6 // indirect
golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad
golang.org/x/net v0.0.0-20210119194325-5f4716e94777
golang.org/x/oauth2 v0.0.0-20210216194517-16ff1888fd2e
golang.org/x/sync v0.0.0-20201207232520-09787c993a3a
golang.org/x/sys v0.0.0-20210217105451-b926d437f341 // indirect
golang.org/x/term v0.0.0-20201210144234-2321bbc49cbf // indirect
golang.org/x/time v0.0.0-20201208040808-7e3f01d25324 // indirect
golang.org/x/tools v0.1.0
gomodules.xyz/jsonpatch/v2 v2.1.0 // indirect
github.com/pquerna/cachecontrol v0.1.0 // indirect
github.com/prometheus/client_golang v1.10.0 // indirect
github.com/prometheus/common v0.25.0
github.com/russross/blackfriday v1.6.0 // indirect
github.com/sirupsen/logrus v1.8.1
github.com/spf13/cobra v1.1.3 // indirect
github.com/ugorji/go/codec v1.2.6
github.com/vbauerster/mpb/v6 v6.0.4 // indirect
github.com/vmware/govmomi v0.25.0 // indirect
golang.org/x/crypto v0.0.0-20210513164829-c07d793c2f9a
golang.org/x/mod v0.4.2 // indirect
golang.org/x/net v0.0.0-20210525063256-abc453219eb5
golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c
golang.org/x/sys v0.0.0-20210525143221-35b2ab0089ea // indirect
golang.org/x/term v0.0.0-20210503060354-a79de5458b56 // indirect
golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba // indirect
golang.org/x/tools v0.1.1
gomodules.xyz/jsonpatch/v2 v2.2.0 // indirect
google.golang.org/api v0.47.0 // indirect
google.golang.org/genproto v0.0.0-20210524171403-669157292da3 // indirect
google.golang.org/grpc v1.38.0 // indirect
gopkg.in/ini.v1 v1.62.0 // indirect
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
k8s.io/api v0.20.2
k8s.io/apiextensions-apiserver v0.20.2
k8s.io/apimachinery v0.20.2
k8s.io/api v0.21.1
k8s.io/apiextensions-apiserver v0.21.1
k8s.io/apimachinery v0.21.1
k8s.io/apiserver v0.21.1 // indirect
k8s.io/cli-runtime v0.21.1 // indirect
k8s.io/client-go v12.0.0+incompatible
k8s.io/code-generator v0.19.4
k8s.io/klog/v2 v2.5.0 // indirect
k8s.io/kube-openapi v0.0.0-20210216185858-15cd8face8d6 // indirect
k8s.io/kubectl v0.19.4
k8s.io/kubernetes v1.13.0
k8s.io/utils v0.0.0-20210111153108-fddb29f9d009 // indirect
sigs.k8s.io/cluster-api-provider-aws v0.6.4 // indirect
sigs.k8s.io/cluster-api-provider-azure v0.4.12
sigs.k8s.io/cluster-api-provider-openstack v0.3.3 // indirect
sigs.k8s.io/controller-runtime v0.8.2
k8s.io/code-generator v0.20.6
k8s.io/component-base v0.21.1 // indirect
k8s.io/kube-openapi v0.0.0-20210524163139-412c2b45c7d3 // indirect
k8s.io/kubectl v0.21.1
k8s.io/kubernetes v1.21.1
k8s.io/utils v0.0.0-20210521133846-da695404a2bc // indirect
kubevirt.io/client-go v0.41.0 // indirect
kubevirt.io/containerized-data-importer v1.34.0 // indirect
sigs.k8s.io/cluster-api-provider-aws v0.6.6 // indirect
sigs.k8s.io/cluster-api-provider-azure v0.4.15
sigs.k8s.io/cluster-api-provider-openstack v0.3.4 // indirect
sigs.k8s.io/controller-runtime v0.9.0-beta.1.0.20210512131817-ce2f0c92d77e
sigs.k8s.io/controller-tools v0.5.0
sigs.k8s.io/structured-merge-diff/v3 v3.0.1 // indirect
)
exclude (
@ -180,19 +193,6 @@ replace (
bitbucket.org/ww/goautoneg => github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d // 404 on bitbucket.org/ww/goautoneg
github.com/docker/spdystream => github.com/docker/spdystream v0.1.0
github.com/go-openapi/spec => github.com/go-openapi/spec v0.19.8
github.com/metal3-io/baremetal-operator => github.com/openshift/baremetal-operator v0.0.0-20210128152529-b4b10a088a0c
github.com/metal3-io/cluster-api-provider-baremetal => github.com/openshift/cluster-api-provider-baremetal v0.0.0-20201105032354-fcd9e769a45c
github.com/openshift/api => github.com/openshift/api v0.0.0-20210127195806-54e5e88cf848
github.com/openshift/client-go => github.com/openshift/client-go v0.0.0-20200929181438-91d71ef2122c
github.com/openshift/cloud-credential-operator => github.com/openshift/cloud-credential-operator v0.0.0-20201202215507-371eb009d9a1
github.com/openshift/cluster-api => github.com/openshift/cluster-api v0.0.0-20191129101638-b09907ac6668
github.com/openshift/cluster-api-provider-gcp => github.com/openshift/cluster-api-provider-gcp v0.0.1-0.20201002153134-a0fc9aa4ce81
github.com/openshift/cluster-api-provider-libvirt => github.com/openshift/cluster-api-provider-libvirt v0.2.1-0.20200919090150-1ca52adab176
github.com/openshift/cluster-api-provider-ovirt => github.com/openshift/cluster-api-provider-ovirt v0.1.1-0.20210210114935-91f12f3f7dee
github.com/openshift/console-operator => github.com/openshift/console-operator v0.0.0-20210116095614-7fd78a283616
github.com/openshift/installer => github.com/mjudeikis/installer v0.9.0-master.0.20210423142443-7756cb69c32a
github.com/openshift/machine-api-operator => github.com/openshift/machine-api-operator v0.2.1-0.20210212025836-cb508cd8777d
github.com/openshift/machine-config-operator => github.com/openshift/machine-config-operator v0.0.1-0.20210211205336-14a2b82d9f4c
github.com/operator-framework/operator-sdk => github.com/operator-framework/operator-sdk v0.19.4
// https://www.whitesourcesoftware.com/vulnerability-database/WS-2018-0594
github.com/satori/go.uuid => github.com/satori/go.uuid v1.2.1-0.20181028125025-b2ce2384e17b
@ -202,6 +202,7 @@ replace (
github.com/terraform-providers/terraform-provider-ignition/v2 => github.com/community-terraform-providers/terraform-provider-ignition/v2 v2.1.0
// https://github.com/ugorji/go/issues/357
github.com/ugorji/go/codec => github.com/ugorji/go/codec v1.2.2
golang.org/x/tools => golang.org/x/tools v0.1.0 // We are still using Go 1.14, but >=v0.1.1 depends on standard library from Go 1.16
k8s.io/api => k8s.io/api v0.19.0-rc.2
k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver v0.19.0-rc.2
k8s.io/apimachinery => k8s.io/apimachinery v0.19.0-rc.2
@ -225,12 +226,31 @@ replace (
k8s.io/legacy-cloud-providers => k8s.io/legacy-cloud-providers v0.19.0-rc.2
k8s.io/metrics => k8s.io/metrics v0.19.0-rc.2
k8s.io/sample-apiserver => k8s.io/sample-apiserver v0.19.0-rc.2
sigs.k8s.io/cluster-api-provider-aws => github.com/openshift/cluster-api-provider-aws v0.2.1-0.20201002185235-b1a6ba661ed8
sigs.k8s.io/cluster-api-provider-azure => github.com/openshift/cluster-api-provider-azure v0.1.0-alpha.3.0.20201119004617-db9109863f2f
sigs.k8s.io/cluster-api-provider-gcp => github.com/openshift/cluster-api-provider-gcp v0.0.1-0.20201002153134-a0fc9aa4ce81
sigs.k8s.io/cluster-api-provider-openstack => github.com/openshift/cluster-api-provider-openstack v0.0.0-20201002114634-3622a0ce6b56
sigs.k8s.io/controller-runtime => sigs.k8s.io/controller-runtime v0.6.4
sigs.k8s.io/controller-runtime => sigs.k8s.io/controller-runtime v0.7.0
sigs.k8s.io/controller-tools => sigs.k8s.io/controller-tools v0.5.0
)
replace golang.org/x/tools => golang.org/x/tools v0.1.0
// Installer dependencies. Some of them are being used directly in the RP.
replace (
github.com/kubevirt/terraform-provider-kubevirt => github.com/nirarg/terraform-provider-kubevirt v0.0.0-20201222125919-101cee051ed3
github.com/metal3-io/baremetal-operator => github.com/openshift/baremetal-operator v0.0.0-20210517134619-524201a0dbaa
github.com/metal3-io/cluster-api-provider-baremetal => github.com/openshift/cluster-api-provider-baremetal v0.0.0-20210326083810-25cbb8d8f9e5
github.com/openshift/api => github.com/openshift/api v0.0.0-20210428205234-a8389931bee7
github.com/openshift/client-go => github.com/openshift/client-go v0.0.0-20210112165513-ebc401615f47
github.com/openshift/cloud-credential-operator => github.com/openshift/cloud-credential-operator v0.0.0-20200316201045-d10080b52c9e
github.com/openshift/cluster-api-provider-gcp => github.com/openshift/cluster-api-provider-gcp v0.0.1-0.20210521181620-5f6589d4ef94
github.com/openshift/cluster-api-provider-kubevirt => github.com/openshift/cluster-api-provider-kubevirt v0.0.0-20210114164510-1f8fc18a50aa
github.com/openshift/cluster-api-provider-libvirt => github.com/openshift/cluster-api-provider-libvirt v0.2.1-0.20210324200850-033be25ca038
github.com/openshift/cluster-api-provider-ovirt => github.com/openshift/cluster-api-provider-ovirt v0.1.1-0.20210409185359-01b9bf8368a3
github.com/openshift/console-operator => github.com/openshift/console-operator v0.0.0-20210323072657-4f933d59784b
github.com/openshift/installer => github.com/mjudeikis/installer v0.9.0-master.0.20210521150000-41d78ae90525
github.com/openshift/library-go => github.com/openshift/library-go v0.0.0-20210205203934-9eb0d970f2f4
github.com/openshift/machine-api-operator => github.com/openshift/machine-api-operator v0.2.1-0.20210521181620-e179bb5ce397
github.com/openshift/machine-config-operator => github.com/openshift/machine-config-operator v0.0.1-0.20210522053223-c4b7e3f5118d
github.com/ovirt/go-ovirt => github.com/ovirt/go-ovirt v0.0.0-20210112072624-e4d3b104de71
kubevirt.io/client-go => kubevirt.io/client-go v0.29.0
sigs.k8s.io/cluster-api-provider-aws => github.com/openshift/cluster-api-provider-aws v0.2.1-0.20210521181620-82202163e220
sigs.k8s.io/cluster-api-provider-azure => github.com/openshift/cluster-api-provider-azure v0.1.0-alpha.3.0.20210318155632-e744815d9f05
sigs.k8s.io/cluster-api-provider-openstack => github.com/openshift/cluster-api-provider-openstack v0.0.0-20210122093124-471cf3ab636c
sigs.k8s.io/structured-merge-diff => sigs.k8s.io/structured-merge-diff v1.0.1-0.20191108220359-b1b620dd3f06
)

855
go.sum

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -1,31 +1,70 @@
#!/bin/bash -ex
# Background: https://groups.google.com/forum/#!topic/golang-nuts/51-D_YFC78k
#
# TLDR: OCP consists of many repos where for each release a new release branch gets created (release-X.Y).
# When we update vendors we want to get latest changes from the release branch for all of the dependencies.
# With Go modules we can't easily do it, but there is a workaround which consists of multiple steps:
# 1. Get the latest commit from the branch using `go list -mod=mod -m MODULE@release-x.y`.
# 2. Using `sed`, transform output of the above command into format accepted by `go mod edit -replace`.
# 3. Modify `go.mod` by calling `go mod edit -replace`.
#
# This needs to happen for each module that uses this branching strategy: all these repos
# live under github.com/openshift organisation.
#
# There are however, some exceptions:
# * Some repos under github.com/openshift do not use this strategy.
# We should skip them in this script and manage directly with `go mod`.
# * Some dependencies pin their own dependencies to older commits.
# For example, dependency Foo from release-4.7 branch requires
# dependency Bar at older commit which is
# not compatible with Bar@release-4.7.
#
# Note that github.com/openshift org also contains forks of K8s upstream repos and we
# use these forks (indirectly in most cases). This means that
# we also must take care of replacing modules such as sigs.k8s.io/cluster-api-provider-azure
# with github.com/openshift/cluster-api-provider-azure (just an example, there are more).
for x in vendor/github.com/openshift/*; do
case $x in
vendor/github.com/openshift/installer|vendor/github.com/openshift/cluster-api-provider-baremetal)
# Review the list of special cases on each release.
# Replace the installer with our own fork below in this script.
vendor/github.com/openshift/installer)
;;
# Inconsistent imports: some of our dependencies import it as github.com/metal3-io/cluster-api-provider-baremetal
# but in some places directly from the openshift fork.
# Replace github.com/metal3-io/cluster-api-provider-baremetal with an openshift fork below in this script.
vendor/github.com/openshift/cluster-api-provider-baremetal)
;;
# It is only used indirectly and intermediate dependencies pin to different incompatible commits.
# We force a specific commit here to make all dependencies happy.
vendor/github.com/openshift/cloud-credential-operator)
go mod edit -replace ${x##vendor/}=$(go list -mod=mod -m ${x##vendor/}@release-4.5 | sed -e 's/ /@/')
go mod edit -replace github.com/openshift/cloud-credential-operator=github.com/openshift/cloud-credential-operator@v0.0.0-20200316201045-d10080b52c9e
;;
# This repo doesn't follow release-x.y branching strategy
# We skip it and let go mod resolve it
vendor/github.com/openshift/custom-resource-status)
;;
*)
go mod edit -replace ${x##vendor/}=$(go list -mod=mod -m ${x##vendor/}@release-4.6 | sed -e 's/ /@/')
go mod edit -replace ${x##vendor/}=$(go list -mod=mod -m ${x##vendor/}@release-4.7 | sed -e 's/ /@/')
;;
esac
done
for x in aws azure gcp openstack; do
go mod edit -replace sigs.k8s.io/cluster-api-provider-$x=$(go list -mod=mod -m github.com/openshift/cluster-api-provider-$x@release-4.6 | sed -e 's/ /@/')
for x in aws azure openstack; do
go mod edit -replace sigs.k8s.io/cluster-api-provider-$x=$(go list -mod=mod -m github.com/openshift/cluster-api-provider-$x@release-4.7 | sed -e 's/ /@/')
done
go mod edit -replace github.com/metal3-io/baremetal-operator=$(go list -mod=mod -m github.com/openshift/baremetal-operator@release-4.6 | sed -e 's/ /@/')
go mod edit -replace github.com/metal3-io/cluster-api-provider-baremetal=$(go list -mod=mod -m github.com/openshift/cluster-api-provider-baremetal@release-4.6 | sed -e 's/ /@/')
go mod edit -replace github.com/metal3-io/cluster-api-provider-baremetal=$(go list -mod=mod -m github.com/openshift/cluster-api-provider-baremetal@release-4.7 | sed -e 's/ /@/')
# We use release-4.8 here so we can use new version of sigs.k8s.io/controller-runtime sooner.
go mod edit -replace github.com/metal3-io/baremetal-operator=$(go list -mod=mod -m github.com/openshift/baremetal-operator@release-4.8 | sed -e 's/ /@/')
go mod edit -replace github.com/openshift/installer=$(go list -mod=mod -m github.com/mjudeikis/installer@release-4.6-azure | sed -e 's/ /@/')
go mod edit -replace k8s.io/kube-openapi=$(go list -mod=mod -m k8s.io/kube-openapi@release-1.19 | sed -e 's/ /@/')
# We are still using Go 1.14, but >=v0.1.1 depends on standard library from Go 1.16
go mod edit -replace golang.org/x/tools=golang.org/x/tools@v0.1.0
go mod edit -replace github.com/openshift/installer=$(go list -mod=mod -m github.com/mjudeikis/installer@release-4.7-azure | sed -e 's/ /@/')
go get -u ./...