Skip to content

Commit

Permalink
Merge pull request openshift#1407 from dgoodwin/controller-runtime-0.8.3
Browse files Browse the repository at this point in the history
controller runtime 0.8.3
  • Loading branch information
openshift-merge-robot committed Jun 8, 2021
2 parents e79a4da + c7d6052 commit b818031
Show file tree
Hide file tree
Showing 58 changed files with 1,657 additions and 640 deletions.
16 changes: 8 additions & 8 deletions go.mod
Expand Up @@ -54,22 +54,22 @@ require (
google.golang.org/api v0.33.0
gopkg.in/ini.v1 v1.61.0
gopkg.in/yaml.v2 v2.4.0
k8s.io/api v0.20.0
k8s.io/apiextensions-apiserver v0.20.0
k8s.io/apimachinery v0.20.0
k8s.io/api v0.20.2
k8s.io/apiextensions-apiserver v0.20.2
k8s.io/apimachinery v0.20.2
k8s.io/cli-runtime v0.20.0
k8s.io/client-go v12.0.0+incompatible
k8s.io/cluster-registry v0.0.6
k8s.io/code-generator v0.20.0
k8s.io/code-generator v0.20.2
k8s.io/klog v1.0.0
k8s.io/kube-aggregator v0.20.0
k8s.io/kubectl v0.20.0
k8s.io/utils v0.0.0-20201110183641-67b214c5f920
k8s.io/utils v0.0.0-20210111153108-fddb29f9d009
sigs.k8s.io/cluster-api-provider-aws v0.0.0
sigs.k8s.io/cluster-api-provider-azure v0.0.0
sigs.k8s.io/cluster-api-provider-openstack v0.0.0
sigs.k8s.io/controller-runtime v0.7.0
sigs.k8s.io/controller-tools v0.4.1
sigs.k8s.io/controller-runtime v0.8.3
sigs.k8s.io/controller-tools v0.5.0
sigs.k8s.io/yaml v1.2.0
)

Expand Down Expand Up @@ -115,4 +115,4 @@ replace k8s.io/client-go => k8s.io/client-go v0.20.0
replace github.com/hashicorp/go-slug => github.com/hashicorp/go-slug v0.5.0

// point sigs.k8s.io/controller-runtime to forked version
replace sigs.k8s.io/controller-runtime => github.com/openshift-hive/controller-runtime v0.7.0-openshift
replace sigs.k8s.io/controller-runtime => github.com/openshift-hive/controller-runtime v0.8.3-openshift
31 changes: 26 additions & 5 deletions go.sum
Expand Up @@ -1398,8 +1398,8 @@ github.com/opencontainers/runc v0.0.0-20191031171055-b133feaeeb2e/go.mod h1:qT5X
github.com/opencontainers/runc v0.1.1/go.mod h1:qT5XzbpPznkRYVz/mWwUaVBUv2rmF59PVA73FjuZG0U=
github.com/opencontainers/runtime-spec v0.1.2-0.20190507144316-5b71a03e2700/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0=
github.com/opencontainers/runtime-tools v0.0.0-20181011054405-1d69bd0f9c39/go.mod h1:r3f7wjNzSs2extwzU3Y+6pKfobzPh+kKFJ3ofN+3nfs=
github.com/openshift-hive/controller-runtime v0.7.0-openshift h1:zutnlsqkgc++5Ozj+s80Ay1xkarXrvou8j17WKKCaNU=
github.com/openshift-hive/controller-runtime v0.7.0-openshift/go.mod h1:pJ3YBrJiAqMAZKi6UVGuE98ZrroV1p+pIhoHsMm9wdU=
github.com/openshift-hive/controller-runtime v0.8.3-openshift h1:H+Soe1ZMgUOgscAuVoM/zL7AlNAVBWwVWGFHCLXeg5o=
github.com/openshift-hive/controller-runtime v0.8.3-openshift/go.mod h1:U/l+DUopBc1ecfRZ5aviA9JDmGFQKvLf5YkZNx2e0sU=
github.com/openshift-metal3/terraform-provider-ironic v0.2.4/go.mod h1:ux2W6gsCIYsY/fX5N0V0ZgwFEBNN7P8g6RlH6ACi97k=
github.com/openshift/api v0.0.0-20191219222812-2987a591a72c/go.mod h1:dh9o4Fs58gpFXGSYfnVxGR9PnV53I8TW84pQaJDdGiY=
github.com/openshift/api v0.0.0-20200205133042-34f0ec8dab87/go.mod h1:fT6U/JfG8uZzemTRwZA2kBDJP5nWz7v05UHnty/D+pk=
Expand Down Expand Up @@ -2418,6 +2418,8 @@ gopkg.in/yaml.v3 v3.0.0-20190502103701-55513cacd4ae/go.mod h1:K4uyk7z7BCEPqu6E+C
gopkg.in/yaml.v3 v3.0.0-20190905181640-827449938966/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776 h1:tQIYjPdBoyREyB9XMu+nnTclpTYkz2zFM+lzLJFO4gQ=
gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo=
gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw=
gotest.tools/v3 v3.0.2 h1:kG1BFyqVHuQoVQiR1bWGnfz/fmHvvuiSPIV7rvl360E=
Expand Down Expand Up @@ -2459,6 +2461,9 @@ k8s.io/api v0.19.2/go.mod h1:IQpK0zFQ1xc5iNIQPqzgoOwuFugaYHK4iCknlAQP9nI=
k8s.io/api v0.19.4/go.mod h1:SbtJ2aHCItirzdJ36YslycFNzWADYH3tgOhvBEFtZAk=
k8s.io/api v0.20.0 h1:WwrYoZNM1W1aQEbyl8HNG+oWGzLpZQBlcerS9BQw9yI=
k8s.io/api v0.20.0/go.mod h1:HyLC5l5eoS/ygQYl1BXBgFzWNlkHiAuyNAbevIn+FKg=
k8s.io/api v0.20.1/go.mod h1:KqwcCVogGxQY3nBlRpwt+wpAMF/KjaCc7RpywacvqUo=
k8s.io/api v0.20.2 h1:y/HR22XDZY3pniu9hIFDLpUCPq2w5eQ6aV/VFQ7uJMw=
k8s.io/api v0.20.2/go.mod h1:d7n6Ehyzx+S+cE3VhTGfVNNqtGc/oL9DCdYYahlurV8=
k8s.io/apiextensions-apiserver v0.0.0-20190918161926-8f644eb6e783/go.mod h1:xvae1SZB3E17UpV59AWc271W/Ph25N+bjPyR63X6tPY=
k8s.io/apiextensions-apiserver v0.16.4/go.mod h1:HYQwjujEkXmQNhap2C9YDdIVOSskGZ3et0Mvjcyjbto=
k8s.io/apiextensions-apiserver v0.16.7/go.mod h1:6xYRp4trGp6eT5WZ6tPi/TB2nfWQCzwUvBlpg8iswe0=
Expand All @@ -2471,8 +2476,9 @@ k8s.io/apiextensions-apiserver v0.18.2/go.mod h1:q3faSnRGmYimiocj6cHQ1I3WpLqmDgJ
k8s.io/apiextensions-apiserver v0.19.0/go.mod h1:znfQxNpjqz/ZehvbfMg5N6fvBJW5Lqu5HVLTJQdP4Fs=
k8s.io/apiextensions-apiserver v0.19.2/go.mod h1:EYNjpqIAvNZe+svXVx9j4uBaVhTB4C94HkY3w058qcg=
k8s.io/apiextensions-apiserver v0.19.4/go.mod h1:B9rpH/nu4JBCtuUp3zTTk8DEjZUupZTBEec7/2zNRYw=
k8s.io/apiextensions-apiserver v0.20.0 h1:HmeP9mLET/HlIQ5gjP+1c20tgJrlshY5nUyIand3AVg=
k8s.io/apiextensions-apiserver v0.20.0/go.mod h1:ZH+C33L2Bh1LY1+HphoRmN1IQVLTShVcTojivK3N9xg=
k8s.io/apiextensions-apiserver v0.20.1/go.mod h1:ntnrZV+6a3dB504qwC5PN/Yg9PBiDNt1EVqbW2kORVk=
k8s.io/apiextensions-apiserver v0.20.2 h1:rfrMWQ87lhd8EzQWRnbQ4gXrniL/yTRBgYH1x1+BLlo=
k8s.io/apiextensions-apiserver v0.20.2/go.mod h1:F6TXp389Xntt+LUq3vw6HFOLttPa0V8821ogLGwb6Zs=
k8s.io/apimachinery v0.0.0-20181110190943-2a7c93004028/go.mod h1:ccL7Eh7zubPUSh9A3USN90/OzHNSVN6zxzde07TDCL0=
k8s.io/apimachinery v0.0.0-20190404173353-6a84e37a896d/go.mod h1:ccL7Eh7zubPUSh9A3USN90/OzHNSVN6zxzde07TDCL0=
k8s.io/apimachinery v0.0.0-20190409092423-760d1845f48b/go.mod h1:FW86P8YXVLsbuplGMZeb20J3jYHscrDqw4jELaFJvRU=
Expand All @@ -2498,6 +2504,9 @@ k8s.io/apimachinery v0.19.2/go.mod h1:DnPGDnARWFvYa3pMHgSxtbZb7gpzzAZ1pTfaUNDVlm
k8s.io/apimachinery v0.19.4/go.mod h1:DnPGDnARWFvYa3pMHgSxtbZb7gpzzAZ1pTfaUNDVlmA=
k8s.io/apimachinery v0.20.0 h1:jjzbTJRXk0unNS71L7h3lxGDH/2HPxMPaQY+MjECKL8=
k8s.io/apimachinery v0.20.0/go.mod h1:WlLqWAHZGg07AeltaI0MV5uk1Omp8xaN0JGLY6gkRpU=
k8s.io/apimachinery v0.20.1/go.mod h1:WlLqWAHZGg07AeltaI0MV5uk1Omp8xaN0JGLY6gkRpU=
k8s.io/apimachinery v0.20.2 h1:hFx6Sbt1oG0n6DZ+g4bFt5f6BoMkOjKWsQFu077M3Vg=
k8s.io/apimachinery v0.20.2/go.mod h1:WlLqWAHZGg07AeltaI0MV5uk1Omp8xaN0JGLY6gkRpU=
k8s.io/apiserver v0.0.0-20190918160949-bfa5e2e684ad/go.mod h1:XPCXEwhjaFN29a8NldXA901ElnKeKLrLtREO9ZhFyhg=
k8s.io/apiserver v0.16.4/go.mod h1:kbLJOak655g6W7C+muqu1F76u9wnEycfKMqbVaXIdAc=
k8s.io/apiserver v0.16.7/go.mod h1:/5zSatF30/L9zYfMTl55jzzOnx7r/gGv5a5wtRp8yAw=
Expand All @@ -2513,6 +2522,9 @@ k8s.io/apiserver v0.19.2/go.mod h1:FreAq0bJ2vtZFj9Ago/X0oNGC51GfubKK/ViOKfVAOA=
k8s.io/apiserver v0.19.4/go.mod h1:X8WRHCR1UGZDd7HpV0QDc1h/6VbbpAeAGyxSh8yzZXw=
k8s.io/apiserver v0.20.0 h1:0MwO4xCoqZwhoLbFyyBSJdu55CScp4V4sAgX6z4oPBY=
k8s.io/apiserver v0.20.0/go.mod h1:6gRIWiOkvGvQt12WTYmsiYoUyYW0FXSiMdNl4m+sxY8=
k8s.io/apiserver v0.20.1/go.mod h1:ro5QHeQkgMS7ZGpvf4tSMx6bBOgPfE+f52KwvXfScaU=
k8s.io/apiserver v0.20.2 h1:lGno2t3gcZnLtzsKH4oG0xA9/4GTiBzMO1DGp+K+Bak=
k8s.io/apiserver v0.20.2/go.mod h1:2nKd93WyMhZx4Hp3RfgH2K5PhwyTrprrkWYnI7id7jA=
k8s.io/autoscaler v0.0.0-20190607113959-1b4f1855cb8e/go.mod h1:QEXezc9uKPT91dwqhSJq3GNI3B1HxFRQHiku9kmrsSA=
k8s.io/cli-runtime v0.17.2/go.mod h1:aa8t9ziyQdbkuizkNLAw3qe3srSyWh9zlSB7zTqRNPI=
k8s.io/cli-runtime v0.17.3/go.mod h1:X7idckYphH4SZflgNpOOViSxetiMj6xI0viMAjM81TA=
Expand Down Expand Up @@ -2548,6 +2560,9 @@ k8s.io/code-generator v0.19.2/go.mod h1:moqLn7w0t9cMs4+5CQyxnfA/HV8MF6aAVENF+WZZ
k8s.io/code-generator v0.19.4/go.mod h1:moqLn7w0t9cMs4+5CQyxnfA/HV8MF6aAVENF+WZZhgk=
k8s.io/code-generator v0.20.0 h1:c8JaABvEEZPDE8MICTOtveHX2axchl+EptM+o4OGvbg=
k8s.io/code-generator v0.20.0/go.mod h1:UsqdF+VX4PU2g46NC2JRs4gc+IfrctnwHb76RNbWHJg=
k8s.io/code-generator v0.20.1/go.mod h1:UsqdF+VX4PU2g46NC2JRs4gc+IfrctnwHb76RNbWHJg=
k8s.io/code-generator v0.20.2 h1:SQaysped4EtUDk3u1zphnUJiOAwFdhHx9xS3WKAE0x8=
k8s.io/code-generator v0.20.2/go.mod h1:UsqdF+VX4PU2g46NC2JRs4gc+IfrctnwHb76RNbWHJg=
k8s.io/component-base v0.0.0-20190918160511-547f6c5d7090/go.mod h1:933PBGtQFJky3TEwYx4aEPZ4IxqhWh3R6DCmzqIn1hA=
k8s.io/component-base v0.16.4/go.mod h1:GYQ+4hlkEwdlpAp59Ztc4gYuFhdoZqiAJD1unYDJ3FM=
k8s.io/component-base v0.16.7/go.mod h1:ikdyfezOFMu5O0qJjy/Y9eXwj+fV3pVwdmt0ulVcIR0=
Expand All @@ -2564,6 +2579,9 @@ k8s.io/component-base v0.19.2/go.mod h1:g5LrsiTiabMLZ40AR6Hl45f088DevyGY+cCE2agE
k8s.io/component-base v0.19.4/go.mod h1:ZzuSLlsWhajIDEkKF73j64Gz/5o0AgON08FgRbEPI70=
k8s.io/component-base v0.20.0 h1:BXGL8iitIQD+0NgW49UsM7MraNUUGDU3FBmrfUAtmVQ=
k8s.io/component-base v0.20.0/go.mod h1:wKPj+RHnAr8LW2EIBIK7AxOHPde4gme2lzXwVSoRXeA=
k8s.io/component-base v0.20.1/go.mod h1:guxkoJnNoh8LNrbtiQOlyp2Y2XFCZQmrcg2n/DeYNLk=
k8s.io/component-base v0.20.2 h1:LMmu5I0pLtwjpp5009KLuMGFqSc2S2isGw8t1hpYKLE=
k8s.io/component-base v0.20.2/go.mod h1:pzFtCiwe/ASD0iV7ySMu8SYVJjCapNM9bjvk7ptpKh0=
k8s.io/component-helpers v0.20.0/go.mod h1:nx6NOtfSfGOxnSZsDJxpGbnsVuUA1UXpwDvZIrtigNk=
k8s.io/gengo v0.0.0-20181106084056-51747d6e00da/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0=
k8s.io/gengo v0.0.0-20190128074634-0689ccc1d7d6/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0=
Expand Down Expand Up @@ -2637,9 +2655,10 @@ k8s.io/utils v0.0.0-20200327001022-6496210b90e8/go.mod h1:sZAwmy6armz5eXlNoLmJcl
k8s.io/utils v0.0.0-20200411171748-3d5a2fe318e4/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA=
k8s.io/utils v0.0.0-20200729134348-d5654de09c73/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA=
k8s.io/utils v0.0.0-20200821003339-5e75c0163111/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA=
k8s.io/utils v0.0.0-20200912215256-4140de9c8800/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA=
k8s.io/utils v0.0.0-20201110183641-67b214c5f920 h1:CbnUZsM497iRC5QMVkHwyl8s2tB3g7yaSHkYPkpgelw=
k8s.io/utils v0.0.0-20201110183641-67b214c5f920/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA=
k8s.io/utils v0.0.0-20210111153108-fddb29f9d009 h1:0T5IaWHO3sJTEmCP6mUlBvMukxPKUQWqiI/YuiBNMiQ=
k8s.io/utils v0.0.0-20210111153108-fddb29f9d009/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA=
kubevirt.io/client-go v0.29.0/go.mod h1:JY7hQq+SUT0aLvleXrW/+28fDfZ6BPe4E6f8FyC8jkY=
kubevirt.io/containerized-data-importer v1.10.6/go.mod h1:qF594BtRRkruyrqLwt3zbLCWdPIQNs1qWh4LR1cOzy0=
kubevirt.io/containerized-data-importer v1.10.9/go.mod h1:qF594BtRRkruyrqLwt3zbLCWdPIQNs1qWh4LR1cOzy0=
Expand Down Expand Up @@ -2674,6 +2693,8 @@ sigs.k8s.io/controller-tools v0.2.8/go.mod h1:9VKHPszmf2DHz/QmHkcfZoewO6BL7pPs9u
sigs.k8s.io/controller-tools v0.3.0/go.mod h1:enhtKGfxZD1GFEoMgP8Fdbu+uKQ/cq1/WGJhdVChfvI=
sigs.k8s.io/controller-tools v0.4.1 h1:VkuV0MxlRPmRu5iTgBZU4UxUX2LiR99n3sdQGRxZF4w=
sigs.k8s.io/controller-tools v0.4.1/go.mod h1:G9rHdZMVlBDocIxGkK3jHLWqcTMNvveypYJwrvYKjWU=
sigs.k8s.io/controller-tools v0.5.0 h1:3u2RCwOlp0cjCALAigpOcbAf50pE+kHSdueUosrC/AE=
sigs.k8s.io/controller-tools v0.5.0/go.mod h1:JTsstrMpxs+9BUj6eGuAaEb6SDSPTeVtUyp0jmnAM/I=
sigs.k8s.io/kube-storage-version-migrator v0.0.3/go.mod h1:mXfSLkx9xbJHQsgNDDUZK/iQTs2tMbx/hsJlWe6Fthw=
sigs.k8s.io/kustomize v2.0.3+incompatible h1:JUufWFNlI44MdtnjUqVnvh29rR37PQFzPbLXqhyOyX0=
sigs.k8s.io/kustomize v2.0.3+incompatible/go.mod h1:MkjgH3RdOWrievjo6c9T245dYlB5QeXV4WCbnt/PEpU=
Expand Down
Expand Up @@ -2491,10 +2491,11 @@ func testEmptyClusterDeployment() *hivev1.ClusterDeployment {
Kind: "ClusterDeployment",
},
ObjectMeta: metav1.ObjectMeta{
Name: testName,
Namespace: testNamespace,
Finalizers: []string{hivev1.FinalizerDeprovision},
UID: types.UID("1234"),
Name: testName,
Namespace: testNamespace,
Finalizers: []string{hivev1.FinalizerDeprovision},
UID: types.UID("1234"),
ResourceVersion: "999",
},
}
return cd
Expand Down Expand Up @@ -2708,6 +2709,7 @@ func testProvision() *hivev1.ClusterProvision {
Labels: map[string]string{
constants.ClusterDeploymentNameLabel: testName,
},
ResourceVersion: "999",
},
Spec: hivev1.ClusterProvisionSpec{
ClusterDeploymentRef: corev1.LocalObjectReference{
Expand Down
32 changes: 16 additions & 16 deletions pkg/controller/velerobackup/velerobackup_controller_test.go
Expand Up @@ -116,9 +116,9 @@ func TestReconcile(t *testing.T) {
},
expectedResult: reconcile.Result{},
expectedObjects: []runtime.Object{
testclusterdeployment.Build(clusterDeploymentBase()),
testsyncset.Build(syncSetBase()),
testdnszone.Build(dnsZoneBase()),
testclusterdeployment.Build(clusterDeploymentBase(), testclusterdeployment.WithResourceVersion("999")),
testsyncset.Build(syncSetBase(), testsyncset.WithResourceVersion("999")),
testdnszone.Build(dnsZoneBase(), testdnszone.WithResourceVersion("999")),
testcheckpoint.Build(checkpointBase(), testcheckpoint.WithLastBackupChecksum(calculateRuntimeObjectsChecksum(
[]runtime.Object{
testclusterdeployment.Build(clusterDeploymentBase()),
Expand Down Expand Up @@ -150,7 +150,7 @@ func TestReconcile(t *testing.T) {
},
expectedResult: reconcile.Result{},
expectedObjects: []runtime.Object{
testclusterdeployment.Build(clusterDeploymentBase()),
testclusterdeployment.Build(clusterDeploymentBase(), testclusterdeployment.WithResourceVersion("999")),
testcheckpoint.Build(checkpointBase(),
testcheckpoint.WithLastBackupRef(hivev1.BackupReference{Name: "notarealbackup", Namespace: namespace}),
testcheckpoint.WithLastBackupTime(fiveHoursAgo),
Expand Down Expand Up @@ -186,8 +186,8 @@ func TestReconcile(t *testing.T) {
RequeueAfter: ((3 * time.Minute) - twoMinuteDuration),
},
expectedObjects: []runtime.Object{
testclusterdeployment.Build(clusterDeploymentBase()),
testsyncset.Build(syncSetBase()),
testclusterdeployment.Build(clusterDeploymentBase(), testclusterdeployment.WithResourceVersion("999")),
testsyncset.Build(syncSetBase(), testsyncset.WithResourceVersion("999")),
testcheckpoint.Build(checkpointBase(),
testcheckpoint.WithLastBackupRef(hivev1.BackupReference{Name: "notarealbackup", Namespace: namespace}),
testcheckpoint.WithLastBackupTime(twoMinutesAgo),
Expand Down Expand Up @@ -218,8 +218,8 @@ func TestReconcile(t *testing.T) {
},
expectedResult: reconcile.Result{},
expectedObjects: []runtime.Object{
testclusterdeployment.Build(clusterDeploymentBase()),
testsyncset.Build(syncSetBase()),
testclusterdeployment.Build(clusterDeploymentBase(), testclusterdeployment.WithResourceVersion("999")),
testsyncset.Build(syncSetBase(), testsyncset.WithResourceVersion("999")),
testcheckpoint.Build(checkpointBase(), testcheckpoint.WithLastBackupChecksum(calculateRuntimeObjectsChecksum(
[]runtime.Object{
testclusterdeployment.Build(clusterDeploymentBase()),
Expand Down Expand Up @@ -249,8 +249,8 @@ func TestReconcile(t *testing.T) {
},
expectedResult: reconcile.Result{},
expectedObjects: []runtime.Object{
testclusterdeployment.Build(clusterDeploymentBase()),
testsyncset.Build(syncSetBase()),
testclusterdeployment.Build(clusterDeploymentBase(), testclusterdeployment.WithResourceVersion("999")),
testsyncset.Build(syncSetBase(), testsyncset.WithResourceVersion("999")),
testcheckpoint.Build(checkpointBase(), testcheckpoint.WithLastBackupChecksum(calculateRuntimeObjectsChecksum(
[]runtime.Object{
testclusterdeployment.Build(clusterDeploymentBase()),
Expand Down Expand Up @@ -331,17 +331,17 @@ func TestGetRuntimeObjects(t *testing.T) {
testclusterdeployment.Build(clusterDeploymentBase()),
},
expectedObjects: []runtime.Object{
testclusterdeployment.Build(clusterDeploymentBase()),
testclusterdeployment.Build(clusterDeploymentBase(), testclusterdeployment.WithResourceVersion("999")),
},
},
{
name: "2 ClusterDeployments in different namespaces",
existingObjects: []runtime.Object{
testclusterdeployment.Build(clusterDeploymentBase()),
testclusterdeployment.Build(clusterDeploymentBase(), testclusterdeployment.Generic(generic.WithNamespace("not the correct namespace"))),
testclusterdeployment.Build(clusterDeploymentBase(), testclusterdeployment.Generic(generic.WithNamespace("not the correct namespace")), testclusterdeployment.WithResourceVersion("999")),
},
expectedObjects: []runtime.Object{
testclusterdeployment.Build(clusterDeploymentBase()),
testclusterdeployment.Build(clusterDeploymentBase(), testclusterdeployment.WithResourceVersion("999")),
},
},
}
Expand Down Expand Up @@ -383,7 +383,7 @@ func TestGetNamespaceCheckpoint(t *testing.T) {
name: "Existing Checkpoint",
expectedFound: true,
existingObjects: []runtime.Object{testcheckpoint.Build(checkpointBase(), testcheckpoint.WithLastBackupChecksum("NOTREAL"))},
expectedCheckpoint: testcheckpoint.Build(checkpointBase(), testcheckpoint.WithLastBackupChecksum("NOTREAL"), testcheckpoint.WithTypeMeta()),
expectedCheckpoint: testcheckpoint.Build(checkpointBase(), testcheckpoint.WithLastBackupChecksum("NOTREAL"), testcheckpoint.WithTypeMeta(), testcheckpoint.WithResourceVersion("999")),
expectedError: nil,
},
}
Expand Down Expand Up @@ -441,7 +441,7 @@ func TestCreateOrUpdateNamespaceCheckpoint(t *testing.T) {
existingObjects: []runtime.Object{
testcheckpoint.Build(checkpointBase(), testcheckpoint.WithLastBackupChecksum("NOTREAL-BEFORE")),
},
expectedCheckpoint: testcheckpoint.Build(checkpointBase(), testcheckpoint.WithLastBackupChecksum("NOTREAL-BEFORE"), testcheckpoint.WithTypeMeta()),
expectedCheckpoint: testcheckpoint.Build(checkpointBase(), testcheckpoint.WithLastBackupChecksum("NOTREAL-BEFORE"), testcheckpoint.WithTypeMeta(), testcheckpoint.WithResourceVersion("999")),
expectedError: statusErr,
},
{
Expand Down Expand Up @@ -480,7 +480,7 @@ func TestCalculateObjectsChecksumWithoutStatus(t *testing.T) {
}{
{
name: "Valid ClusterDeployment Checksum",
object: testclusterdeployment.Build(clusterDeploymentBase()),
object: testclusterdeployment.Build(clusterDeploymentBase(), testclusterdeployment.WithResourceVersion("999")),
expectedChecksum: calculateClusterDeploymentChecksum(testclusterdeployment.Build(clusterDeploymentBase())),
},
{
Expand Down
5 changes: 5 additions & 0 deletions pkg/test/clusterdeployment/clusterdeployment.go
Expand Up @@ -81,6 +81,11 @@ func WithName(name string) Option {
return Generic(generic.WithName(name))
}

// WithResourceVersion sets the specified resource version on the supplied object.
func WithResourceVersion(resourceVersion string) Option {
return Generic(generic.WithResourceVersion(resourceVersion))
}

// WithNamespace sets the object.Namespace field when building an object with Build.
func WithNamespace(namespace string) Option {
return Generic(generic.WithNamespace(namespace))
Expand Down
5 changes: 5 additions & 0 deletions pkg/test/syncset/syncset.go
Expand Up @@ -127,3 +127,8 @@ func WithPatches(patches ...hivev1.SyncObjectPatch) Option {
syncSet.Spec.Patches = patches
}
}

// WithResourceVersion sets the specified resource version on the supplied object.
func WithResourceVersion(resourceVersion string) Option {
return Generic(generic.WithResourceVersion(resourceVersion))
}
1 change: 1 addition & 0 deletions vendor/gopkg.in/yaml.v3/.travis.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions vendor/gopkg.in/yaml.v3/apic.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit b818031

Please sign in to comment.