diff --git a/data/data/install.openshift.io_installconfigs.yaml b/data/data/install.openshift.io_installconfigs.yaml index 08180c8613d..2ee4682ef9f 100644 --- a/data/data/install.openshift.io_installconfigs.yaml +++ b/data/data/install.openshift.io_installconfigs.yaml @@ -4,7 +4,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.7.0 + controller-gen.kubebuilder.io/version: v0.8.0 creationTimestamp: null name: installconfigs.install.openshift.io spec: diff --git a/go.mod b/go.mod index 798a4f569e4..812834bc7f7 100644 --- a/go.mod +++ b/go.mod @@ -48,7 +48,8 @@ require ( github.com/openshift/cluster-api-provider-ibmcloud v0.0.0-20211008100740-4d7907adbd6b github.com/openshift/cluster-api-provider-libvirt v0.2.1-0.20191219173431-2336783d4603 github.com/openshift/cluster-api-provider-ovirt v0.1.1-0.20211111151530-06177b773958 - github.com/openshift/library-go v0.0.0-20210811133500-5e31383de2a7 + github.com/openshift/library-go v0.0.0-20211214183058-58531ccbde67 + github.com/openshift/machine-api-provider-powervs v0.0.0-20220303154846-89bb5bec120e github.com/openshift/machine-config-operator v0.0.0 github.com/ovirt/go-ovirt v0.0.0-20210308100159-ac0bcbc88d7c github.com/pborman/uuid v1.2.0 @@ -82,11 +83,11 @@ require ( k8s.io/utils v0.0.0-20211208161948-7d6a63dca704 sigs.k8s.io/cluster-api-provider-aws v0.0.0 sigs.k8s.io/cluster-api-provider-openstack v0.0.0 - sigs.k8s.io/controller-tools v0.7.0 + sigs.k8s.io/controller-tools v0.8.0 ) require ( - github.com/Azure/azure-sdk-for-go/sdk/azcore v0.21.1 // indirect + github.com/Azure/azure-sdk-for-go/sdk/azcore v0.21.0 // indirect github.com/Azure/azure-sdk-for-go/sdk/internal v0.9.1 // indirect github.com/Azure/go-autorest v14.2.0+incompatible // indirect github.com/Azure/go-autorest/autorest/adal v0.9.13 // indirect diff --git a/go.sum b/go.sum index 75f77df856f..996390b0683 100644 --- a/go.sum +++ b/go.sum @@ -54,9 +54,8 @@ github.com/Azure/azure-sdk-for-go v46.0.0+incompatible/go.mod h1:9XXNKU+eRnpl9mo github.com/Azure/azure-sdk-for-go v48.0.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= github.com/Azure/azure-sdk-for-go v55.3.0+incompatible h1:rLKCdFMMCAXt/QZ96skZJUArYS3UDo9Qm1ZWzoDtC9E= github.com/Azure/azure-sdk-for-go v55.3.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= +github.com/Azure/azure-sdk-for-go/sdk/azcore v0.21.0 h1:8wVJL0HUP5yDFXvotdewORTw7Yu88JbreWN/mobSvsQ= github.com/Azure/azure-sdk-for-go/sdk/azcore v0.21.0/go.mod h1:fBF9PQNqB8scdgpZ3ufzaLntG0AG7C1WjPMsiFOmfHM= -github.com/Azure/azure-sdk-for-go/sdk/azcore v0.21.1 h1:qoVeMsc9/fh/yhxVaA0obYjVH/oI/ihrOoMwsLS9KSA= -github.com/Azure/azure-sdk-for-go/sdk/azcore v0.21.1/go.mod h1:fBF9PQNqB8scdgpZ3ufzaLntG0AG7C1WjPMsiFOmfHM= github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.13.0/go.mod h1:TmXReXZ9yPp5D5TBRMTAtyz+UyOl15Py4hL5E5p6igQ= github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.13.1 h1:RxemzI2cHD0A8WyMqHu/UnDjfpGES/cmjtPbQoktWqs= github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.13.1/go.mod h1:+nVKciyKD2J9TyVcEQ82Bo9b+3F92PiQfHrIE/zqLqM= @@ -651,6 +650,7 @@ github.com/goji/httpauth v0.0.0-20160601135302-2da839ab0f4d/go.mod h1:nnjvkQ9ptG github.com/golang-jwt/jwt v3.2.1+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I= github.com/golang-jwt/jwt v3.2.2+incompatible h1:IfV12K8xAKAnZqdXVzCZ+TOjboZ2keLg81eXfW3O+oY= github.com/golang-jwt/jwt v3.2.2+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I= +github.com/golang-jwt/jwt/v4 v4.1.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= github.com/golang-jwt/jwt/v4 v4.2.0 h1:besgBTC8w8HjP6NzQdxwKH9Z5oQMZ24ThTrHp3cZ8eU= github.com/golang-jwt/jwt/v4 v4.2.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= @@ -1149,6 +1149,8 @@ github.com/openshift/api v0.0.0-20210816181336-8ff39b776da3/go.mod h1:x81TFA31x1 github.com/openshift/api v0.0.0-20211025104849-a11323ccb6ea/go.mod h1:RsQCVJu4qhUawxxDP7pGlwU3IA4F01wYm3qKEu29Su8= github.com/openshift/api v0.0.0-20211108165917-be1be0e89115/go.mod h1:RsQCVJu4qhUawxxDP7pGlwU3IA4F01wYm3qKEu29Su8= github.com/openshift/api v0.0.0-20211209135129-c58d9f695577/go.mod h1:DoslCwtqUpr3d/gsbq4ZlkaMEdYqKxuypsDjorcHhME= +github.com/openshift/api v0.0.0-20211215120111-7c47a5f63470/go.mod h1:F/eU6jgr6Q2VhMu1mSpMmygxAELd7+BUxs3NHZ25jV4= +github.com/openshift/api v0.0.0-20211217221424-8779abfbd571/go.mod h1:F/eU6jgr6Q2VhMu1mSpMmygxAELd7+BUxs3NHZ25jV4= github.com/openshift/api v0.0.0-20220222102030-354aa98a475c h1:teP/Es0/vieKbpRde+xwoM0F1cWO5ZFLS4ihJ2WG7BQ= github.com/openshift/api v0.0.0-20220222102030-354aa98a475c/go.mod h1:F/eU6jgr6Q2VhMu1mSpMmygxAELd7+BUxs3NHZ25jV4= github.com/openshift/baremetal-operator v0.0.0-20211201170610-92ffa60c683d h1:4KkYItiWENIs2bV6lKOcIMdWUnZJA+GWT9Us7z0P1UA= @@ -1163,6 +1165,7 @@ github.com/openshift/build-machinery-go v0.0.0-20200819073603-48aa266c95f7/go.mo github.com/openshift/build-machinery-go v0.0.0-20200917070002-f171684f77ab/go.mod h1:b1BuldmJlbA/xYtdZvKi+7j5YGB44qJUJDZ9zwiNCfE= github.com/openshift/build-machinery-go v0.0.0-20210209125900-0da259a2c359/go.mod h1:b1BuldmJlbA/xYtdZvKi+7j5YGB44qJUJDZ9zwiNCfE= github.com/openshift/build-machinery-go v0.0.0-20210712174854-1bb7fd1518d3/go.mod h1:b1BuldmJlbA/xYtdZvKi+7j5YGB44qJUJDZ9zwiNCfE= +github.com/openshift/build-machinery-go v0.0.0-20210806203541-4ea9b6da3a37/go.mod h1:b1BuldmJlbA/xYtdZvKi+7j5YGB44qJUJDZ9zwiNCfE= github.com/openshift/build-machinery-go v0.0.0-20211213093930-7e33a7eb4ce3/go.mod h1:b1BuldmJlbA/xYtdZvKi+7j5YGB44qJUJDZ9zwiNCfE= github.com/openshift/client-go v0.0.0-20200326155132-2a6cd50aedd0/go.mod h1:uUQ4LClRO+fg5MF/P6QxjMCb1C9f7Oh4RKepftDnEJE= github.com/openshift/client-go v0.0.0-20200827190008-3062137373b5/go.mod h1:5rGmrkQ8DJEUXA+AR3rEjfH+HFyg4/apY9iCQFgvPfE= @@ -1204,8 +1207,9 @@ github.com/openshift/library-go v0.0.0-20200831114015-2ab0c61c15de/go.mod h1:6vw github.com/openshift/library-go v0.0.0-20200909173121-1d055d971916/go.mod h1:6vwp+YhYOIlj8MpkQKkebTTSn2TuYyvgiAFQ206jIEQ= github.com/openshift/library-go v0.0.0-20201215165635-4ee79b1caed5/go.mod h1:udseDnqxn5ON8i+NBjDp00fBTK0JRu1/6Y6tf6EivDE= github.com/openshift/library-go v0.0.0-20210408164723-7a65fdb398e2/go.mod h1:pnz961veImKsbn7pQcuFbcVpCQosYiC1fUOjzEDeOLU= -github.com/openshift/library-go v0.0.0-20210811133500-5e31383de2a7 h1:aCoE+Q7jLvV7MFL2aZOnzO3dK6rpSuEE7273ijnAIWU= github.com/openshift/library-go v0.0.0-20210811133500-5e31383de2a7/go.mod h1:3GagmGg6gikg+hAqma7E7axBzs2pjx4+GrAbdl4OYdY= +github.com/openshift/library-go v0.0.0-20211214183058-58531ccbde67 h1:wNd5jvgf9kXsyT+z11aBlh5spqKPNwsQKplrJRx4nsc= +github.com/openshift/library-go v0.0.0-20211214183058-58531ccbde67/go.mod h1:M/Gi/GUUrMdSS07nrYtTiK43J6/VUAyk/+IfN4ZqUY4= github.com/openshift/machine-api-operator v0.0.0-20190312153711-9650e16c9880/go.mod h1:7HeAh0v04zQn1L+4ItUjvpBQYsm2Nf81WaZLiXTcnkc= github.com/openshift/machine-api-operator v0.2.1-0.20200611014855-9a69f85c32dd/go.mod h1:6vMi+R3xqznBdq5rgeal9N3ak3sOpy50t0fdRCcQXjE= github.com/openshift/machine-api-operator v0.2.1-0.20200701225707-950912b03628/go.mod h1:cxjy/RUzv5C2T5FNl1KKXUgtakWsezWQ642B/CD9VQA= @@ -1216,6 +1220,9 @@ github.com/openshift/machine-api-operator v0.2.1-0.20210104142355-8e6ae0acdfcf/g github.com/openshift/machine-api-operator v0.2.1-0.20210504014029-a132ec00f7dd/go.mod h1:DFZBMPtC2TYZH5NE9+2JQIpbZAnruqc9F26QmbOm9pw= github.com/openshift/machine-api-operator v0.2.1-0.20210820103535-d50698c302f5/go.mod h1:ko7xmso6c25h9UL6Ai0I5l+6OgyVf+ebinAYXnwlGNg= github.com/openshift/machine-api-operator v0.2.1-0.20211111133920-c8bba3e64310/go.mod h1:8kWuB/zhnlBsNOyD1yz0epINZX5IodG3Z4iDwQrYKx0= +github.com/openshift/machine-api-operator v0.2.1-0.20211220105028-362d5b50beca/go.mod h1:TVTiuAOEE4sN17wkmtYJJZXGIgZogg1FmvrmkuotK+4= +github.com/openshift/machine-api-provider-powervs v0.0.0-20220303154846-89bb5bec120e h1:CAsqxY4ykI4H9sVXkvRDy5TXxV39EVVyz0wQEZjmIqE= +github.com/openshift/machine-api-provider-powervs v0.0.0-20220303154846-89bb5bec120e/go.mod h1:iEJE/Tyh/+Cqcka6O6u9FmQaFD+5weWD4Uqreh12NV0= github.com/openshift/machine-config-operator v0.0.1-0.20201009041932-4fe8559913b8 h1:C4gCipkWTDp0B9jb0wZdLgB+HWC7EzVVwQOeNaKnTRA= github.com/openshift/machine-config-operator v0.0.1-0.20201009041932-4fe8559913b8/go.mod h1:fjKreLaKEeUKsyIkT4wlzIQwUVJ2ZKDUh3CI73ckYIY= github.com/openshift/runtime-utils v0.0.0-20200415173359-c45d4ff3f912/go.mod h1:0OXNy7VoqFexkxKqyQbHJLPwn1MFp1/CxRJAgKHM+/o= @@ -1264,6 +1271,7 @@ github.com/pmezard/go-difflib v0.0.0-20151028094244-d8ed2627bdf0/go.mod h1:iKH77 github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= +github.com/ppc64le-cloud/powervs-utils v0.0.0-20210415051532-4cdd6a79c8fa/go.mod h1:KImYgHmvBVtAczNhyDBDSN54PGIdz0+QiPVQMmObEQY= github.com/pquerna/cachecontrol v0.0.0-20171018203845-0dec1b30a021/go.mod h1:prYjPmNq4d1NPVmpShWobRqXY3q7Vp+80DqgxxUrUIA= github.com/pquerna/ffjson v0.0.0-20181028064349-e517b90714f7/go.mod h1:YARuvh7BUWHNhzDq2OM5tzR2RiCcN2D7sapiKyCel/M= github.com/pquerna/ffjson v0.0.0-20190813045741-dac163c6c0a9/go.mod h1:YARuvh7BUWHNhzDq2OM5tzR2RiCcN2D7sapiKyCel/M= @@ -1736,6 +1744,7 @@ golang.org/x/net v0.0.0-20210614182718-04defd469f4e/go.mod h1:9nx3DQGgdP8bBQD5qx golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210825183410-e898025ed96a/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20211209124913-491a49abca63/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd h1:O7DYs+zxREGLKzKoMQrtrEacpb0ZVXA5rIwylE2Xchk= golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= @@ -2283,6 +2292,7 @@ k8s.io/cli-runtime v0.19.0/go.mod h1:tun9l0eUklT8IHIM0jors17KmUjcrAxn0myoBYwuNuo k8s.io/cli-runtime v0.20.0/go.mod h1:C5tewU1SC1t09D7pmkk83FT4lMAw+bvMDuRxA7f0t2s= k8s.io/cli-runtime v0.21.0/go.mod h1:XoaHP93mGPF37MkLbjGVYqg3S1MnsFdKtiA/RZzzxOo= k8s.io/cli-runtime v0.22.0/go.mod h1:An6zELQ7udUI0GaXvkuMqyopPA14dIgNqpH8cZu1vig= +k8s.io/cli-runtime v0.23.0/go.mod h1:B5N3YH0KP1iKr6gEuJ/RRmGjO0mJQ/f/JrsmEiPQAlU= k8s.io/client-go v0.23.0 h1:vcsOqyPq7XV3QmQRCBH/t9BICJM9Q1M18qahjv+rebY= k8s.io/client-go v0.23.0/go.mod h1:hrDnpnK1mSr65lHHcUuIZIXDgEbzc7/683c6hyG4jTA= k8s.io/cluster-bootstrap v0.0.0-20190202014938-c9acc0c1bea2/go.mod h1:iBSm2nwo3OaiuW8VDvc3ySDXK5SKfUrxwPvBloKG7zg= @@ -2323,6 +2333,7 @@ k8s.io/component-base v0.23.0/go.mod h1:DHH5uiFvLC1edCpvcTDV++NKULdYYU6pR9Tt3HIK k8s.io/component-helpers v0.20.0/go.mod h1:nx6NOtfSfGOxnSZsDJxpGbnsVuUA1UXpwDvZIrtigNk= k8s.io/component-helpers v0.21.0/go.mod h1:tezqefP7lxfvJyR+0a+6QtVrkZ/wIkyMLK4WcQ3Cj8U= k8s.io/component-helpers v0.22.0/go.mod h1:YNIbQI59ayNiU8JHlPIxVkOUYycbKhk5Niy0pcyJOEY= +k8s.io/component-helpers v0.23.0/go.mod h1:liXMh6FZS4qamKtMJQ7uLHnFe3tlC86RX5mJEk/aerg= k8s.io/gengo v0.0.0-20190128074634-0689ccc1d7d6/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= k8s.io/gengo v0.0.0-20190822140433-26a664648505/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= k8s.io/gengo v0.0.0-20190907103519-ebc107f98eab/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= @@ -2350,6 +2361,7 @@ k8s.io/kube-aggregator v0.19.0/go.mod h1:1Ln45PQggFAG8xOqWPIYMxUq8WNtpPnYsbUJ39D k8s.io/kube-aggregator v0.20.0/go.mod h1:3Is/gzzWmhhG/rA3CpA1+eVye87lreBQDFGcAGT7gzo= k8s.io/kube-aggregator v0.21.0-rc.0/go.mod h1:M+whOmsAeQf8ObJ0/eO9Af1Dz2UQEB9OW9BWmt9b2sU= k8s.io/kube-aggregator v0.22.0-rc.0/go.mod h1:g0xtiBSsbMKvewN7xR/Icib4TrHxtvrJcHtYvFsgw7k= +k8s.io/kube-aggregator v0.23.0/go.mod h1:b1vpoaTWKZjCzvbe1KXFw3vPbISrghJsg7/RI8oZUME= k8s.io/kube-openapi v0.0.0-20180731170545-e3762e86a74c/go.mod h1:BXM9ceUBTj2QnfH2MK1odQs778ajze1RxcmP6S8RVVc= k8s.io/kube-openapi v0.0.0-20190228160746-b3a7cee44a30/go.mod h1:BXM9ceUBTj2QnfH2MK1odQs778ajze1RxcmP6S8RVVc= k8s.io/kube-openapi v0.0.0-20190816220812-743ec37842bf/go.mod h1:1TqjTSzOxsLGIKfj0lK8EeCP7K1iUG65v09OM0/WG5E= @@ -2366,12 +2378,14 @@ k8s.io/kubectl v0.19.0/go.mod h1:gPCjjsmE6unJzgaUNXIFGZGafiUp5jh0If3F/x7/rRg= k8s.io/kubectl v0.20.0/go.mod h1:8x5GzQkgikz7M2eFGGuu6yOfrenwnw5g4RXOUgbjR1M= k8s.io/kubectl v0.21.0/go.mod h1:EU37NukZRXn1TpAkMUoy8Z/B2u6wjHDS4aInsDzVvks= k8s.io/kubectl v0.22.0/go.mod h1:eeuP92uZbVL2UnOaf0nj9OjtI0hi/nekHU+0isURer0= +k8s.io/kubectl v0.23.0/go.mod h1:TfcGEs3u4dkmoC2eku1GYymdGaMtPMcaLLFrX/RB2kI= k8s.io/kubelet v0.19.0/go.mod h1:cGds22piF/LnFzfAaIT+efvOYBHVYdunqka6NVuNw9g= k8s.io/metrics v0.18.0-rc.1/go.mod h1:ME3EkXCyiZ7mVFEiAYKBfuo3JkpgggeATG+DBUQby5o= k8s.io/metrics v0.19.0/go.mod h1:WykpW8B60OeAJx1imdwUgyOID2kDljr/Q+1zrPJ98Wo= k8s.io/metrics v0.20.0/go.mod h1:9yiRhfr8K8sjdj2EthQQE9WvpYDvsXIV3CjN4Ruq4Jw= k8s.io/metrics v0.21.0/go.mod h1:L3Ji9EGPP1YBbfm9sPfEXSpnj8i24bfQbAFAsW0NueQ= k8s.io/metrics v0.22.0/go.mod h1:eYnwafAUNLLpVmY/msoq0RKIKH5C4TzfjKnMZ0Xrt3A= +k8s.io/metrics v0.23.0/go.mod h1:NDiZTwppEtAuKJ1Rxt3S4dhyRzdp6yUcJf0vo023dPo= k8s.io/utils v0.0.0-20190506122338-8fab8cb257d5/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= k8s.io/utils v0.0.0-20190529001817-6999998975a7/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= k8s.io/utils v0.0.0-20200229041039-0a110f9eb7ab/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= @@ -2429,12 +2443,16 @@ sigs.k8s.io/kube-storage-version-migrator v0.0.4/go.mod h1:mXfSLkx9xbJHQsgNDDUZK sigs.k8s.io/kustomize v2.0.3+incompatible/go.mod h1:MkjgH3RdOWrievjo6c9T245dYlB5QeXV4WCbnt/PEpU= sigs.k8s.io/kustomize/api v0.8.5/go.mod h1:M377apnKT5ZHJS++6H4rQoCHmWtt6qTpp3mbe7p6OLY= sigs.k8s.io/kustomize/api v0.8.11/go.mod h1:a77Ls36JdfCWojpUqR6m60pdGY1AYFix4AH83nJtY1g= +sigs.k8s.io/kustomize/api v0.10.1/go.mod h1:2FigT1QN6xKdcnGS2Ppp1uIWrtWN28Ms8A3OZUZhwr8= sigs.k8s.io/kustomize/cmd/config v0.9.7/go.mod h1:MvXCpHs77cfyxRmCNUQjIqCmZyYsbn5PyQpWiq44nW0= sigs.k8s.io/kustomize/cmd/config v0.9.13/go.mod h1:7547FLF8W/lTaDf0BDqFTbZxM9zqwEJqCKN9sSR0xSs= +sigs.k8s.io/kustomize/cmd/config v0.10.2/go.mod h1:K2aW7nXJ0AaT+VA/eO0/dzFLxmpFcTzudmAgDwPY1HQ= sigs.k8s.io/kustomize/kustomize/v4 v4.0.5/go.mod h1:C7rYla7sI8EnxHE/xEhRBSHMNfcL91fx0uKmUlUhrBk= sigs.k8s.io/kustomize/kustomize/v4 v4.2.0/go.mod h1:MOkR6fmhwG7hEDRXBYELTi5GSFcLwfqwzTRHW3kv5go= +sigs.k8s.io/kustomize/kustomize/v4 v4.4.1/go.mod h1:qOKJMMz2mBP+vcS7vK+mNz4HBLjaQSWRY22EF6Tb7Io= sigs.k8s.io/kustomize/kyaml v0.10.15/go.mod h1:mlQFagmkm1P+W4lZJbJ/yaxMd8PqMRSC4cPcfUVt5Hg= sigs.k8s.io/kustomize/kyaml v0.11.0/go.mod h1:GNMwjim4Ypgp/MueD3zXHLRJEjz7RvtPae0AwlvEMFM= +sigs.k8s.io/kustomize/kyaml v0.13.0/go.mod h1:FTJxEZ86ScK184NpGSAQcfEqee0nul8oLCK30D47m4E= sigs.k8s.io/structured-merge-diff v0.0.0-20190525122527-15d366b2352e h1:4Z09Hglb792X0kfOBBJUPFEyvVfQWrYT/l8h5EKA6JQ= sigs.k8s.io/structured-merge-diff v0.0.0-20190525122527-15d366b2352e/go.mod h1:wWxsB5ozmmv/SG7nM11ayaAW51xMvak/t1r0CSlcokI= sigs.k8s.io/structured-merge-diff/v3 v3.0.0-20200116222232-67a7b8c61874/go.mod h1:PlARxl6Hbt/+BC80dRLi1qAmnMqwqDg62YvvVkZjemw= diff --git a/hack/verify-vendor.sh b/hack/verify-vendor.sh index 5be1cc8d05d..b168f59c488 100755 --- a/hack/verify-vendor.sh +++ b/hack/verify-vendor.sh @@ -1,7 +1,7 @@ #!/bin/sh if [ "$IS_CONTAINER" != "" ]; then - set -euxo pipefail + set -eux go mod tidy go mod vendor go mod verify @@ -11,6 +11,6 @@ else --env IS_CONTAINER=TRUE \ --volume "${PWD}:/go/src/github.com/openshift/installer:z" \ --workdir /go/src/github.com/openshift/installer \ - docker.io/openshift/origin-release:golang-1.16 \ + docker.io/golang:1.17 \ ./hack/verify-vendor.sh "${@}" fi diff --git a/pkg/asset/machines/master.go b/pkg/asset/machines/master.go index 1d4c68f6ff0..0397fed14c4 100644 --- a/pkg/asset/machines/master.go +++ b/pkg/asset/machines/master.go @@ -19,6 +19,8 @@ import ( libvirtprovider "github.com/openshift/cluster-api-provider-libvirt/pkg/apis/libvirtproviderconfig/v1beta1" ovirtproviderapi "github.com/openshift/cluster-api-provider-ovirt/pkg/apis" ovirtprovider "github.com/openshift/cluster-api-provider-ovirt/pkg/apis/ovirtprovider/v1beta1" + powervsapi "github.com/openshift/machine-api-provider-powervs/pkg/apis" + powervsprovider "github.com/openshift/machine-api-provider-powervs/pkg/apis/powervsprovider/v1alpha1" mcfgv1 "github.com/openshift/machine-config-operator/pkg/apis/machineconfiguration.openshift.io/v1" "github.com/pkg/errors" "github.com/sirupsen/logrus" @@ -43,6 +45,7 @@ import ( "github.com/openshift/installer/pkg/asset/machines/machineconfig" "github.com/openshift/installer/pkg/asset/machines/openstack" "github.com/openshift/installer/pkg/asset/machines/ovirt" + "github.com/openshift/installer/pkg/asset/machines/powervs" "github.com/openshift/installer/pkg/asset/machines/vsphere" "github.com/openshift/installer/pkg/asset/rhcos" rhcosutils "github.com/openshift/installer/pkg/rhcos" @@ -59,6 +62,7 @@ import ( nonetypes "github.com/openshift/installer/pkg/types/none" openstacktypes "github.com/openshift/installer/pkg/types/openstack" ovirttypes "github.com/openshift/installer/pkg/types/ovirt" + powervstypes "github.com/openshift/installer/pkg/types/powervs" vspheretypes "github.com/openshift/installer/pkg/types/vsphere" ) @@ -424,6 +428,19 @@ func (m *Master) Generate(dependencies asset.Parents) error { return errors.Wrap(err, "failed to create master machine objects") } vsphere.ConfigMasters(machines, clusterID.InfraID) + case powervstypes.Name: + mpool := defaultPowerVSMachinePoolPlatform() + mpool.Set(ic.Platform.PowerVS.DefaultMachinePlatform) + mpool.Set(pool.Platform.PowerVS) + // Only the service instance is guaranteed to exist and be passed via the install config + // The other two, we should standardize a name including the cluster id. At this point, all + // we have are names. + pool.Platform.PowerVS = &mpool + machines, err = powervs.Machines(clusterID.InfraID, ic, &pool, "master", "master-user-data") + if err != nil { + return errors.Wrap(err, "failed to create master machine objects") + } + powervs.ConfigMasters(machines, clusterID.InfraID) case nonetypes.Name: default: return fmt.Errorf("invalid Platform") @@ -557,6 +574,7 @@ func (m *Master) Machines() ([]machinev1beta1.Machine, error) { libvirtapi.AddToScheme(scheme) openstackapi.AddToScheme(scheme) ovirtproviderapi.AddToScheme(scheme) + powervsapi.AddToScheme(scheme) scheme.AddKnownTypes(machinev1beta1.SchemeGroupVersion, &machinev1beta1.VSphereMachineProviderSpec{}, &machinev1beta1.AzureMachineProviderSpec{}, @@ -575,6 +593,7 @@ func (m *Master) Machines() ([]machinev1beta1.Machine, error) { openstackprovider.SchemeGroupVersion, machinev1beta1.SchemeGroupVersion, ovirtprovider.SchemeGroupVersion, + powervsprovider.GroupVersion, ) machines := []machinev1beta1.Machine{} diff --git a/pkg/asset/machines/powervs/machines.go b/pkg/asset/machines/powervs/machines.go new file mode 100644 index 00000000000..d473707d241 --- /dev/null +++ b/pkg/asset/machines/powervs/machines.go @@ -0,0 +1,105 @@ +// Package powervs generates Machine objects for powerVS. +package powervs + +import ( + "fmt" + + corev1 "k8s.io/api/core/v1" + + machineapi "github.com/openshift/api/machine/v1beta1" + "github.com/openshift/installer/pkg/types" + "github.com/openshift/installer/pkg/types/powervs" + powervsprovider "github.com/openshift/machine-api-provider-powervs/pkg/apis/powervsprovider/v1alpha1" + "github.com/pkg/errors" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" +) + +// Machines returns a list of machines for a machinepool. +func Machines(clusterID string, config *types.InstallConfig, pool *types.MachinePool, role, userDataSecret string) ([]machineapi.Machine, error) { + if configPlatform := config.Platform.Name(); configPlatform != powervs.Name { + return nil, fmt.Errorf("non-PowerVS configuration: %q", configPlatform) + } + if poolPlatform := pool.Platform.Name(); poolPlatform != powervs.Name { + return nil, fmt.Errorf("non-PowerVS machine-pool: %q", poolPlatform) + } + platform := config.Platform.PowerVS + mpool := pool.Platform.PowerVS + + // Only the service instance is guaranteed to exist and be passed via the install config + // The other two, we should standardize a name including the cluster id. + image := fmt.Sprintf("rhcos-%s", clusterID) + network := fmt.Sprintf("pvs-net-%s", clusterID) + if platform.ClusterOSImage != "" { + image = platform.ClusterOSImage + } + if platform.PVSNetworkName != "" { + network = platform.PVSNetworkName + } + + total := int64(1) + if pool.Replicas != nil { + total = *pool.Replicas + } + var machines []machineapi.Machine + for idx := int64(0); idx < total; idx++ { + provider, err := provider(clusterID, platform, mpool, userDataSecret, image, network) + if err != nil { + return nil, errors.Wrap(err, "failed to create provider") + } + machine := machineapi.Machine{ + TypeMeta: metav1.TypeMeta{ + APIVersion: "machine.openshift.io/v1beta1", + Kind: "Machine", + }, + ObjectMeta: metav1.ObjectMeta{ + Namespace: "openshift-machine-api", + Name: fmt.Sprintf("%s-%s-%d", clusterID, pool.Name, idx), + Labels: map[string]string{ + "machine.openshift.io/cluster-api-cluster": clusterID, + "machine.openshift.io/cluster-api-machine-role": role, + "machine.openshift.io/cluster-api-machine-type": role, + }, + }, + Spec: machineapi.MachineSpec{ + ProviderSpec: machineapi.ProviderSpec{ + Value: &runtime.RawExtension{Object: provider}, + }, + }, + } + machines = append(machines, machine) + } + return machines, nil +} + +func provider(clusterID string, platform *powervs.Platform, mpool *powervs.MachinePool, userDataSecret string, image string, network string) (*powervsprovider.PowerVSMachineProviderConfig, error) { + + if clusterID == "" || platform == nil || mpool == nil || userDataSecret == "" || image == "" || network == "" { + return nil, fmt.Errorf("invalid value passed to provider") + } + + //Setting only the mandatory parameters + config := &powervsprovider.PowerVSMachineProviderConfig{ + TypeMeta: metav1.TypeMeta{ + Kind: "PowerVSMachineProviderConfig", + APIVersion: powervsprovider.GroupVersion.String(), + }, + ObjectMeta: metav1.ObjectMeta{}, + ServiceInstanceID: platform.ServiceInstanceID, + Image: powervsprovider.PowerVSResourceReference{Name: &image}, + UserDataSecret: &corev1.LocalObjectReference{Name: userDataSecret}, + CredentialsSecret: &corev1.LocalObjectReference{Name: "powervs-credentials"}, + SysType: mpool.SysType, + ProcType: string(mpool.ProcType), + Processors: mpool.Processors, + Memory: mpool.Memory, + Network: powervsprovider.PowerVSResourceReference{Name: &network}, + KeyPairName: fmt.Sprintf("%s-key", clusterID), + } + return config, nil +} + +// ConfigMasters sets the network and boot image IDs +func ConfigMasters(machines []machineapi.Machine, clusterID string) { + +} diff --git a/pkg/asset/machines/powervs/machinesets.go b/pkg/asset/machines/powervs/machinesets.go new file mode 100644 index 00000000000..ea83dddac05 --- /dev/null +++ b/pkg/asset/machines/powervs/machinesets.go @@ -0,0 +1,88 @@ +// Package powervs generates Machine objects for IBM Power VS. +package powervs + +import ( + "fmt" + + "github.com/openshift/installer/pkg/types/powervs" + + machineapi "github.com/openshift/api/machine/v1beta1" + "github.com/pkg/errors" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" + + "github.com/openshift/installer/pkg/types" +) + +// MachineSets returns a list of machinesets for a machinepool. +func MachineSets(clusterID string, config *types.InstallConfig, pool *types.MachinePool, role, userDataSecret string) ([]*machineapi.MachineSet, error) { + if configPlatform := config.Platform.Name(); configPlatform != powervs.Name { + return nil, fmt.Errorf("non-powerVS configuration: %q", configPlatform) + } + if poolPlatform := pool.Platform.Name(); poolPlatform != powervs.Name { + return nil, fmt.Errorf("non-powerVS machine-pool: %q", poolPlatform) + } + + platform := config.Platform.PowerVS + mpool := pool.Platform.PowerVS + image := fmt.Sprintf("rhcos-%s", clusterID) + network := fmt.Sprintf("pvs-net-%s", clusterID) + if platform.ClusterOSImage != "" { + image = platform.ClusterOSImage + } + if platform.PVSNetworkName != "" { + network = platform.PVSNetworkName + } + + total := int32(0) + if pool.Replicas != nil { + total = int32(*pool.Replicas) + } + var machinesets []*machineapi.MachineSet + provider, err := provider(clusterID, platform, mpool, userDataSecret, image, network) + if err != nil { + return nil, errors.Wrap(err, "failed to create provider") + } + + name := fmt.Sprintf("%s-%s", clusterID, pool.Name) + mset := &machineapi.MachineSet{ + TypeMeta: metav1.TypeMeta{ + APIVersion: "machine.openshift.io/v1beta1", + Kind: "MachineSet", + }, + ObjectMeta: metav1.ObjectMeta{ + Namespace: "openshift-machine-api", + Name: name, + Labels: map[string]string{ + "machine.openshift.io/cluster-api-cluster": clusterID, + }, + }, + Spec: machineapi.MachineSetSpec{ + Replicas: &total, + Selector: metav1.LabelSelector{ + MatchLabels: map[string]string{ + "machine.openshift.io/cluster-api-machineset": name, + "machine.openshift.io/cluster-api-cluster": clusterID, + }, + }, + Template: machineapi.MachineTemplateSpec{ + ObjectMeta: machineapi.ObjectMeta{ + Labels: map[string]string{ + "machine.openshift.io/cluster-api-machineset": name, + "machine.openshift.io/cluster-api-cluster": clusterID, + "machine.openshift.io/cluster-api-machine-role": role, + "machine.openshift.io/cluster-api-machine-type": role, + }, + }, + Spec: machineapi.MachineSpec{ + ProviderSpec: machineapi.ProviderSpec{ + Value: &runtime.RawExtension{Object: provider}, + }, + }, + }, + }, + } + machinesets = append(machinesets, mset) + + return machinesets, nil +} diff --git a/pkg/asset/machines/worker.go b/pkg/asset/machines/worker.go index c95c89ccd13..67e7da8d3f1 100644 --- a/pkg/asset/machines/worker.go +++ b/pkg/asset/machines/worker.go @@ -18,6 +18,8 @@ import ( libvirtprovider "github.com/openshift/cluster-api-provider-libvirt/pkg/apis/libvirtproviderconfig/v1beta1" ovirtproviderapi "github.com/openshift/cluster-api-provider-ovirt/pkg/apis" ovirtprovider "github.com/openshift/cluster-api-provider-ovirt/pkg/apis/ovirtprovider/v1beta1" + powervsapi "github.com/openshift/machine-api-provider-powervs/pkg/apis" + powervsprovider "github.com/openshift/machine-api-provider-powervs/pkg/apis/powervsprovider/v1alpha1" mcfgv1 "github.com/openshift/machine-config-operator/pkg/apis/machineconfiguration.openshift.io/v1" "github.com/pkg/errors" "github.com/sirupsen/logrus" @@ -41,6 +43,7 @@ import ( "github.com/openshift/installer/pkg/asset/machines/machineconfig" "github.com/openshift/installer/pkg/asset/machines/openstack" "github.com/openshift/installer/pkg/asset/machines/ovirt" + "github.com/openshift/installer/pkg/asset/machines/powervs" "github.com/openshift/installer/pkg/asset/machines/vsphere" "github.com/openshift/installer/pkg/asset/rhcos" rhcosutils "github.com/openshift/installer/pkg/rhcos" @@ -57,6 +60,7 @@ import ( nonetypes "github.com/openshift/installer/pkg/types/none" openstacktypes "github.com/openshift/installer/pkg/types/openstack" ovirttypes "github.com/openshift/installer/pkg/types/ovirt" + powervstypes "github.com/openshift/installer/pkg/types/powervs" vspheretypes "github.com/openshift/installer/pkg/types/vsphere" ) @@ -158,6 +162,15 @@ func defaultVSphereMachinePoolPlatform() vspheretypes.MachinePool { } } +func defaultPowerVSMachinePoolPlatform() powervstypes.MachinePool { + return powervstypes.MachinePool{ + Memory: "32", + Processors: "0.5", + ProcType: powervstypes.Shared, + SysType: "s922", + } +} + func awsDefaultWorkerMachineTypes(region string, arch types.Architecture) []string { classes := awsdefaults.InstanceClasses(region, arch) types := make([]string, len(classes)) @@ -494,6 +507,18 @@ func (w *Worker) Generate(dependencies asset.Parents) error { for _, set := range sets { machineSets = append(machineSets, set) } + case powervstypes.Name: + mpool := defaultPowerVSMachinePoolPlatform() + mpool.Set(ic.Platform.PowerVS.DefaultMachinePlatform) + mpool.Set(pool.Platform.PowerVS) + pool.Platform.PowerVS = &mpool + sets, err := powervs.MachineSets(clusterID.InfraID, ic, &pool, "worker", "worker-user-data") + if err != nil { + return errors.Wrap(err, "failed to create worker machine objects for powervs provider") + } + for _, set := range sets { + machineSets = append(machineSets, set) + } case nonetypes.Name: default: return fmt.Errorf("invalid Platform") @@ -576,6 +601,7 @@ func (w *Worker) MachineSets() ([]machinev1beta1.MachineSet, error) { libvirtapi.AddToScheme(scheme) openstackapi.AddToScheme(scheme) ovirtproviderapi.AddToScheme(scheme) + powervsapi.AddToScheme(scheme) scheme.AddKnownTypes(machinev1beta1.SchemeGroupVersion, &machinev1beta1.VSphereMachineProviderSpec{}, &machinev1beta1.AzureMachineProviderSpec{}, @@ -592,6 +618,7 @@ func (w *Worker) MachineSets() ([]machinev1beta1.MachineSet, error) { libvirtprovider.SchemeGroupVersion, openstackprovider.SchemeGroupVersion, ovirtprovider.SchemeGroupVersion, + powervsprovider.GroupVersion, machinev1beta1.SchemeGroupVersion, machinev1.GroupVersion, ) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/CHANGELOG.md b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/CHANGELOG.md index d964e4494e1..d2691dbc2ce 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/CHANGELOG.md +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/CHANGELOG.md @@ -1,14 +1,5 @@ # Release History -## 0.21.1 (2022-02-04) - -### Bugs Fixed -* Restore response body after reading in `Poller.FinalResponse()`. (#16911) -* Fixed bug in `NullValue` that could lead to incorrect comparisons for empty maps/slices (#16969) - -### Other Changes -* `BearerTokenPolicy` is more resilient to transient authentication failures. (#16789) - ## 0.21.0 (2022-01-11) ### Features Added diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/core.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/core.go index 68253efccc5..951bc3fba0e 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/core.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/core.go @@ -10,16 +10,9 @@ import ( "reflect" "github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/pollers" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/shared" "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" ) -// AccessToken represents an Azure service bearer access token with expiry information. -type AccessToken = shared.AccessToken - -// TokenCredential represents a credential capable of providing an OAuth token. -type TokenCredential = shared.TokenCredential - // holds sentinel values used to send nulls var nullables map[reflect.Type]interface{} = map[reflect.Type]interface{}{} @@ -34,13 +27,9 @@ func NullValue(v interface{}) interface{} { v, found := nullables[t] if !found { var o reflect.Value - if k := t.Kind(); k == reflect.Map { - o = reflect.MakeMap(t) - } else if k == reflect.Slice { - // empty slices appear to all point to the same data block - // which causes comparisons to become ambiguous. so we create - // a slice with len/cap of one which ensures a unique address. - o = reflect.MakeSlice(t, 1, 1) + if k := t.Kind(); k == reflect.Slice || k == reflect.Map { + o = reflect.New(t) // *[]type / *map[] + o = o.Elem() // []type / map[] } else { o = reflect.New(t.Elem()) } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/credential.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/credential.go new file mode 100644 index 00000000000..ad498ab1c2d --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/credential.go @@ -0,0 +1,26 @@ +//go:build go1.16 +// +build go1.16 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package azcore + +import ( + "context" + "time" + + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" +) + +// TokenCredential represents a credential capable of providing an OAuth token. +type TokenCredential interface { + // GetToken requests an access token for the specified set of scopes. + GetToken(ctx context.Context, options policy.TokenRequestOptions) (*AccessToken, error) +} + +// AccessToken represents an Azure service bearer access token with expiry information. +type AccessToken struct { + Token string + ExpiresOn time.Time +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/pollers/poller.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/pollers/poller.go index a6bccbfb5e0..e8da46bcfe0 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/pollers/poller.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/pollers/poller.go @@ -11,6 +11,7 @@ import ( "encoding/json" "errors" "fmt" + "io/ioutil" "net/http" "reflect" "time" @@ -153,7 +154,8 @@ func (l *Poller) FinalResponse(ctx context.Context, respType interface{}) (*http log.Write(log.EventLRO, "final response specifies a response type but no payload was received") return l.resp, nil } - body, err := shared.Payload(l.resp) + body, err := ioutil.ReadAll(l.resp.Body) + l.resp.Body.Close() if err != nil { return nil, err } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/shared/constants.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/shared/constants.go index 54b04f68b07..50e07ccab19 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/shared/constants.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/shared/constants.go @@ -35,5 +35,5 @@ const ( Module = "azcore" // Version is the semantic version (see http://semver.org) of this module. - Version = "v0.21.1" + Version = "v0.21.0" ) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/shared/expiring_resource.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/shared/expiring_resource.go index 1c285e97df0..9f97ca9559a 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/shared/expiring_resource.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/shared/expiring_resource.go @@ -14,7 +14,7 @@ import ( // AcquireResource abstracts a method for refreshing an expiring resource. type AcquireResource func(state interface{}) (newResource interface{}, newExpiration time.Time, err error) -// ExpiringResource is a temporal resource (usually a credential) that requires periodic refreshing. +// ExpiringResource is a temporal resource (usually a credential), that requires periodic refreshing. type ExpiringResource struct { // cond is used to synchronize access to the shared resource embodied by the remaining fields cond *sync.Cond @@ -28,9 +28,6 @@ type ExpiringResource struct { // expiration indicates when the shared resource expires; it is 0 if the resource was never acquired expiration time.Time - // lastAttempt indicates when a thread/goroutine last attempted to acquire/update the resource - lastAttempt time.Time - // acquireResource is the callback function that actually acquires the resource acquireResource AcquireResource } @@ -46,15 +43,13 @@ func (er *ExpiringResource) GetResource(state interface{}) (interface{}, error) // If the resource is expiring within this time window, update it eagerly. // This allows other threads/goroutines to keep running by using the not-yet-expired // resource value while one thread/goroutine updates the resource. - const window = 5 * time.Minute // This example updates the resource 5 minutes prior to expiration - const backoff = 30 * time.Second // Minimum wait time between eager update attempts + const window = 2 * time.Minute // This example updates the resource 2 minutes prior to expiration - now, acquire, expired, resource := time.Now(), false, false, er.resource + now, acquire, resource := time.Now(), false, er.resource // acquire exclusive lock er.cond.L.Lock() for { - expired = er.expiration.IsZero() || er.expiration.Before(now) - if expired { + if er.expiration.IsZero() || er.expiration.Before(now) { // The resource was never acquired or has expired if !er.acquiring { // If another thread/goroutine is not acquiring/updating the resource, this thread/goroutine will do it @@ -64,9 +59,8 @@ func (er *ExpiringResource) GetResource(state interface{}) (interface{}, error) // Getting here means that this thread/goroutine will wait for the updated resource } else if er.expiration.Add(-window).Before(now) { // The resource is valid but is expiring within the time window - if !er.acquiring && er.lastAttempt.Add(backoff).Before(now) { - // If another thread/goroutine is not acquiring/renewing the resource, and none has attempted - // to do so within the last 30 seconds, this thread/goroutine will do it + if !er.acquiring { + // If another thread/goroutine is not acquiring/renewing the resource, this thread/goroutine will do it er.acquiring, acquire = true, true break } @@ -87,21 +81,15 @@ func (er *ExpiringResource) GetResource(state interface{}) (interface{}, error) if acquire { // This thread/goroutine has been selected to acquire/update the resource var expiration time.Time - var newValue interface{} - er.lastAttempt = now - newValue, expiration, err = er.acquireResource(state) + resource, expiration, err = er.acquireResource(state) // Atomically, update the shared resource's new value & expiration. er.cond.L.Lock() if err == nil { - // Update resource & expiration, return the new value - resource = newValue + // No error, update resource & expiration er.resource, er.expiration = resource, expiration - } else if !expired { - // An eager update failed. Discard the error and return the current--still valid--resource value - err = nil } - er.acquiring = false // Indicate that no thread/goroutine is currently acquiring the resource + er.acquiring = false // Indicate that no thread/goroutine is currently acquiring the resrouce // Wake up any waiting threads/goroutines since there is a resource they can ALL use er.cond.L.Unlock() diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/shared/shared.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/shared/shared.go index 2ee59f52a7d..1e44f27c28f 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/shared/shared.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/shared/shared.go @@ -7,6 +7,7 @@ package shared import ( + "bytes" "context" "encoding/json" "errors" @@ -19,27 +20,6 @@ import ( "time" ) -// TokenRequestOptions contain specific parameter that may be used by credentials types when attempting to get a token. -type TokenRequestOptions struct { - // Scopes contains the list of permission scopes required for the token. - Scopes []string - // TenantID contains the tenant ID to use in a multi-tenant authentication scenario, if TenantID is set - // it will override the tenant ID that was added at credential creation time. - TenantID string -} - -// TokenCredential represents a credential capable of providing an OAuth token. -type TokenCredential interface { - // GetToken requests an access token for the specified set of scopes. - GetToken(ctx context.Context, options TokenRequestOptions) (*AccessToken, error) -} - -// AccessToken represents an Azure service bearer access token with expiry information. -type AccessToken struct { - Token string - ExpiresOn time.Time -} - // CtxWithHTTPHeaderKey is used as a context key for adding/retrieving http.Header. type CtxWithHTTPHeaderKey struct{} @@ -75,13 +55,16 @@ var ErrNoBody = errors.New("the response did not contain a body") // GetJSON reads the response body into a raw JSON object. // It returns ErrNoBody if there was no content. func GetJSON(resp *http.Response) (map[string]interface{}, error) { - body, err := Payload(resp) + body, err := ioutil.ReadAll(resp.Body) + defer resp.Body.Close() if err != nil { return nil, err } if len(body) == 0 { return nil, ErrNoBody } + // put the body back so it's available to others + resp.Body = ioutil.NopCloser(bytes.NewReader(body)) // unmarshall the body to get the value var jsonBody map[string]interface{} if err = json.Unmarshal(body, &jsonBody); err != nil { diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/policy/policy.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/policy/policy.go index d9b948a77e6..bcf98a85b6d 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/policy/policy.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/policy/policy.go @@ -98,7 +98,7 @@ type RetryOptions struct { // TelemetryOptions configures the telemetry policy's behavior. type TelemetryOptions struct { - // ApplicationID is an application-specific identification string to add to the User-Agent. + // ApplicationID is an application-specific identification string used in telemetry. // It has a maximum length of 24 characters and must not contain any spaces. ApplicationID string @@ -107,7 +107,13 @@ type TelemetryOptions struct { } // TokenRequestOptions contain specific parameter that may be used by credentials types when attempting to get a token. -type TokenRequestOptions = shared.TokenRequestOptions +type TokenRequestOptions struct { + // Scopes contains the list of permission scopes required for the token. + Scopes []string + // TenantID contains the tenant ID to use in a multi-tenant authentication scenario, if TenantID is set + // it will override the tenant ID that was added at credential creation time. + TenantID string +} // BearerTokenOptions configures the bearer token policy's behavior. type BearerTokenOptions struct { diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/policy_bearer_token.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/policy_bearer_token.go index 187642d7fbf..d5ed61e1486 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/policy_bearer_token.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/policy_bearer_token.go @@ -7,6 +7,7 @@ import ( "net/http" "time" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" "github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/shared" "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" ) @@ -16,7 +17,7 @@ type BearerTokenPolicy struct { // mainResource is the resource to be retreived using the tenant specified in the credential mainResource *shared.ExpiringResource // the following fields are read-only - cred shared.TokenCredential + cred azcore.TokenCredential scopes []string } @@ -29,7 +30,7 @@ type acquiringResourceState struct { // thread/goroutine at a time ever calls this function func acquire(state interface{}) (newResource interface{}, newExpiration time.Time, err error) { s := state.(acquiringResourceState) - tk, err := s.p.cred.GetToken(s.req.Raw().Context(), shared.TokenRequestOptions{Scopes: s.p.scopes}) + tk, err := s.p.cred.GetToken(s.req.Raw().Context(), policy.TokenRequestOptions{Scopes: s.p.scopes}) if err != nil { return nil, time.Time{}, err } @@ -40,7 +41,7 @@ func acquire(state interface{}) (newResource interface{}, newExpiration time.Tim // cred: an azcore.TokenCredential implementation such as a credential object from azidentity // scopes: the list of permission scopes required for the token. // opts: optional settings. Pass nil to accept default values; this is the same as passing a zero-value options. -func NewBearerTokenPolicy(cred shared.TokenCredential, scopes []string, opts *policy.BearerTokenOptions) *BearerTokenPolicy { +func NewBearerTokenPolicy(cred azcore.TokenCredential, scopes []string, opts *policy.BearerTokenOptions) *BearerTokenPolicy { return &BearerTokenPolicy{ cred: cred, scopes: scopes, @@ -58,7 +59,7 @@ func (b *BearerTokenPolicy) Do(req *policy.Request) (*http.Response, error) { if err != nil { return nil, err } - if token, ok := tk.(*shared.AccessToken); ok { + if token, ok := tk.(*azcore.AccessToken); ok { req.Raw().Header.Set(shared.HeaderAuthorization, shared.BearerTokenPrefix+token.Token) } return req.Next() diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/policy_body_download.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/policy_body_download.go index aa974e5f9d8..42a0279c00f 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/policy_body_download.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/policy_body_download.go @@ -8,6 +8,7 @@ package runtime import ( "fmt" + "io/ioutil" "net/http" "strings" @@ -29,10 +30,12 @@ func bodyDownloadPolicy(req *policy.Request) (*http.Response, error) { } // Either bodyDownloadPolicyOpValues was not specified (so skip is false) // or it was specified and skip is false: don't skip downloading the body - _, err = shared.Payload(resp) + b, err := ioutil.ReadAll(resp.Body) + resp.Body.Close() if err != nil { return resp, newBodyDownloadError(err, req) } + resp.Body = shared.NewNopClosingBytesReader(b) return resp, err } diff --git a/vendor/github.com/openshift/machine-api-provider-powervs/LICENSE b/vendor/github.com/openshift/machine-api-provider-powervs/LICENSE new file mode 100644 index 00000000000..261eeb9e9f8 --- /dev/null +++ b/vendor/github.com/openshift/machine-api-provider-powervs/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/vendor/github.com/openshift/machine-api-provider-powervs/pkg/apis/addtoscheme_openshiftpowervsprovider_v1alpha1.go b/vendor/github.com/openshift/machine-api-provider-powervs/pkg/apis/addtoscheme_openshiftpowervsprovider_v1alpha1.go new file mode 100644 index 00000000000..76b0102b6c3 --- /dev/null +++ b/vendor/github.com/openshift/machine-api-provider-powervs/pkg/apis/addtoscheme_openshiftpowervsprovider_v1alpha1.go @@ -0,0 +1,26 @@ +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package apis + +import ( + "github.com/openshift/machine-api-provider-powervs/pkg/apis/powervsprovider/v1alpha1" +) + +func init() { + // Register the types with the Scheme so the components can map objects to GroupVersionKinds and back + AddToSchemes = append(AddToSchemes, v1alpha1.AddToScheme) +} diff --git a/vendor/github.com/openshift/machine-api-provider-powervs/pkg/apis/apis.go b/vendor/github.com/openshift/machine-api-provider-powervs/pkg/apis/apis.go new file mode 100644 index 00000000000..d4163edd967 --- /dev/null +++ b/vendor/github.com/openshift/machine-api-provider-powervs/pkg/apis/apis.go @@ -0,0 +1,33 @@ +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Generate deepcopy for apis +//go:generate go run ../../vendor/sigs.k8s.io/controller-tools/cmd/controller-gen paths=./... object:headerFile=../../hack/boilerplate/boilerplate.go.txt,year=2021 + +// Package apis contains Kubernetes API groups. +package apis + +import ( + "k8s.io/apimachinery/pkg/runtime" +) + +// AddToSchemes may be used to add all resources defined in the project to a Scheme +var AddToSchemes runtime.SchemeBuilder + +// AddToScheme adds all Resources to the Scheme +func AddToScheme(s *runtime.Scheme) error { + return AddToSchemes.AddToScheme(s) +} diff --git a/vendor/github.com/openshift/machine-api-provider-powervs/pkg/apis/powervsprovider/v1alpha1/groupversion_info.go b/vendor/github.com/openshift/machine-api-provider-powervs/pkg/apis/powervsprovider/v1alpha1/groupversion_info.go new file mode 100644 index 00000000000..6feea851175 --- /dev/null +++ b/vendor/github.com/openshift/machine-api-provider-powervs/pkg/apis/powervsprovider/v1alpha1/groupversion_info.go @@ -0,0 +1,106 @@ +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Package v1alpha1 contains API Schema definitions for the powervsproviderconfig v1alpha1 API group +//+kubebuilder:object:generate=true +//+groupName=powervsproviderconfig.openshift.io +package v1alpha1 + +import ( + "encoding/json" + "fmt" + + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/schema" + "k8s.io/klog/v2" + "sigs.k8s.io/controller-runtime/pkg/scheme" + "sigs.k8s.io/yaml" +) + +var ( + // GroupVersion is group version used to register these objects + GroupVersion = schema.GroupVersion{Group: "powervsproviderconfig.openshift.io", Version: "v1alpha1"} + + // SchemeBuilder is used to add go types to the GroupVersionKind scheme + SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion} + + // AddToScheme adds the types in this group-version to the given scheme. + AddToScheme = SchemeBuilder.AddToScheme +) + +// RawExtensionFromProviderSpec marshals the machine provider spec. +func RawExtensionFromProviderSpec(spec *PowerVSMachineProviderConfig) (*runtime.RawExtension, error) { + if spec == nil { + return &runtime.RawExtension{}, nil + } + + var rawBytes []byte + var err error + if rawBytes, err = json.Marshal(spec); err != nil { + return nil, fmt.Errorf("error marshalling providerSpec: %v", err) + } + + return &runtime.RawExtension{ + Raw: rawBytes, + }, nil +} + +// RawExtensionFromProviderStatus marshals the machine provider status +func RawExtensionFromProviderStatus(status *PowerVSMachineProviderStatus) (*runtime.RawExtension, error) { + if status == nil { + return &runtime.RawExtension{}, nil + } + + var rawBytes []byte + var err error + if rawBytes, err = json.Marshal(status); err != nil { + return nil, fmt.Errorf("error marshalling providerStatus: %v", err) + } + + return &runtime.RawExtension{ + Raw: rawBytes, + }, nil +} + +// ProviderSpecFromRawExtension unmarshals a raw extension into an PowerVSMachineProviderConfig type +func ProviderSpecFromRawExtension(rawExtension *runtime.RawExtension) (*PowerVSMachineProviderConfig, error) { + if rawExtension == nil { + return &PowerVSMachineProviderConfig{}, nil + } + + spec := new(PowerVSMachineProviderConfig) + if err := yaml.Unmarshal(rawExtension.Raw, &spec); err != nil { + return nil, fmt.Errorf("error unmarshalling providerSpec: %v", err) + } + + klog.V(5).Infof("Got provider Spec from raw extension: %+v", spec) + return spec, nil +} + +// ProviderStatusFromRawExtension unmarshals a raw extension into an PowerVSMachineProviderStatus type +func ProviderStatusFromRawExtension(rawExtension *runtime.RawExtension) (*PowerVSMachineProviderStatus, error) { + if rawExtension == nil { + return &PowerVSMachineProviderStatus{}, nil + } + + providerStatus := new(PowerVSMachineProviderStatus) + if err := yaml.Unmarshal(rawExtension.Raw, providerStatus); err != nil { + return nil, fmt.Errorf("error unmarshalling providerStatus: %v", err) + } + + klog.V(5).Infof("Got provider Status from raw extension: %+v", providerStatus) + return providerStatus, nil +} diff --git a/vendor/github.com/openshift/machine-api-provider-powervs/pkg/apis/powervsprovider/v1alpha1/powervsmachineproviderconfig_types.go b/vendor/github.com/openshift/machine-api-provider-powervs/pkg/apis/powervsprovider/v1alpha1/powervsmachineproviderconfig_types.go new file mode 100644 index 00000000000..66597780fa3 --- /dev/null +++ b/vendor/github.com/openshift/machine-api-provider-powervs/pkg/apis/powervsprovider/v1alpha1/powervsmachineproviderconfig_types.go @@ -0,0 +1,90 @@ +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1alpha1 + +import ( + corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN! +// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized. + +//+kubebuilder:object:root=true +//+kubebuilder:subresource:status + +// PowerVSMachineProviderConfig is the Schema for the powervsmachineproviderconfigs API +type PowerVSMachineProviderConfig struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + // ServiceInstanceID is the PowerVS service ID + ServiceInstanceID string `json:"serviceInstanceID"` + + // Image is the reference to the Image from which to create the machine instance. + Image PowerVSResourceReference `json:"image"` + + // UserDataSecret is the k8s secret contains the user data script + UserDataSecret *corev1.LocalObjectReference `json:"userDataSecret,omitempty"` + + // CredentialsSecret is the k8s secret contains the API Key for IBM Cloud authentication + CredentialsSecret *corev1.LocalObjectReference `json:"credentialsSecret,omitempty"` + + // SysType is the System type used to host the vsi + SysType string `json:"sysType"` + + // ProcessorType is the processor type, e.g: dedicated, shared, capped + ProcType string `json:"procType"` + + // Processors is Number of processors allocated + Processors string `json:"processors"` + + // Memory is Amount of memory allocated (in GB) + Memory string `json:"memory"` + + // Network is the reference to the Network to use for this instance. + Network PowerVSResourceReference `json:"network"` + + // KeyPairName is the name of the SSH key pair provided to the server for authenticating users + KeyPairName string `json:"keyPairName,omitempty"` +} + +// PowerVSResourceReference is a reference to a specific PowerVS resource by ID or Name +// Only one of ID or Name may be specified. Specifying more than one will result in +// a validation error. +type PowerVSResourceReference struct { + // ID of resource + // +optional + ID *string `json:"id,omitempty"` + + // Name of resource + // +optional + Name *string `json:"name,omitempty"` +} + +//+kubebuilder:object:root=true + +// PowerVSMachineProviderConfigList contains a list of PowerVSMachineProviderConfig +type PowerVSMachineProviderConfigList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []PowerVSMachineProviderConfig `json:"items"` +} + +func init() { + SchemeBuilder.Register(&PowerVSMachineProviderConfig{}, &PowerVSMachineProviderConfigList{}, &PowerVSMachineProviderStatus{}) +} diff --git a/vendor/github.com/openshift/machine-api-provider-powervs/pkg/apis/powervsprovider/v1alpha1/powervsmachineproviderstatus_types.go b/vendor/github.com/openshift/machine-api-provider-powervs/pkg/apis/powervsprovider/v1alpha1/powervsmachineproviderstatus_types.go new file mode 100644 index 00000000000..cf7a1a5cb39 --- /dev/null +++ b/vendor/github.com/openshift/machine-api-provider-powervs/pkg/apis/powervsprovider/v1alpha1/powervsmachineproviderstatus_types.go @@ -0,0 +1,81 @@ +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1alpha1 + +import ( + corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// PowerVSMachineProviderStatus is the type that will be embedded in a Machine.Status.ProviderStatus field. +// It contains PowerVS-specific status information. +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type PowerVSMachineProviderStatus struct { + metav1.TypeMeta `json:",inline"` + + // InstanceID is the instance ID of the machine created in PowerVS + // +optional + InstanceID *string `json:"instanceId,omitempty"` + + // InstanceState is the state of the PowerVS instance for this machine + // +optional + InstanceState *string `json:"instanceState,omitempty"` + + // Conditions is a set of conditions associated with the Machine to indicate + // errors or other status + Conditions []PowerVSMachineProviderCondition `json:"conditions,omitempty"` +} + +// PowerVSMachineProviderConditionType is a valid value for PowerVSMachineProviderCondition.Type +type PowerVSMachineProviderConditionType string + +// Valid conditions for an PowerVS machine instance. +const ( + // MachineCreation indicates whether the machine has been created or not. If not, + // it should include a reason and message for the failure. + MachineCreation PowerVSMachineProviderConditionType = "MachineCreation" +) + +// PowerVSMachineProviderConditionReason is reason for the condition's last transition. +type PowerVSMachineProviderConditionReason string + +const ( + // MachineCreationSucceeded indicates machine creation success. + MachineCreationSucceeded PowerVSMachineProviderConditionReason = "MachineCreationSucceeded" + // MachineCreationFailed indicates machine creation failure. + MachineCreationFailed PowerVSMachineProviderConditionReason = "MachineCreationFailed" +) + +// PowerVSMachineProviderCondition is a condition in a PowerVSMachineProviderStatus. +type PowerVSMachineProviderCondition struct { + // Type is the type of the condition. + Type PowerVSMachineProviderConditionType `json:"type"` + // Status is the status of the condition. + Status corev1.ConditionStatus `json:"status"` + // LastProbeTime is the last time we probed the condition. + // +optional + LastProbeTime metav1.Time `json:"lastProbeTime,omitempty"` + // LastTransitionTime is the last time the condition transitioned from one status to another. + // +optional + LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty"` + // Reason is a unique, one-word, CamelCase reason for the condition's last transition. + // +optional + Reason PowerVSMachineProviderConditionReason `json:"reason,omitempty"` + // Message is a human-readable message indicating details about last transition. + // +optional + Message string `json:"message,omitempty"` +} diff --git a/vendor/github.com/openshift/machine-api-provider-powervs/pkg/apis/powervsprovider/v1alpha1/zz_generated.deepcopy.go b/vendor/github.com/openshift/machine-api-provider-powervs/pkg/apis/powervsprovider/v1alpha1/zz_generated.deepcopy.go new file mode 100644 index 00000000000..b1cba30be01 --- /dev/null +++ b/vendor/github.com/openshift/machine-api-provider-powervs/pkg/apis/powervsprovider/v1alpha1/zz_generated.deepcopy.go @@ -0,0 +1,179 @@ +//go:build !ignore_autogenerated +// +build !ignore_autogenerated + +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by controller-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + v1 "k8s.io/api/core/v1" + "k8s.io/apimachinery/pkg/runtime" +) + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PowerVSMachineProviderCondition) DeepCopyInto(out *PowerVSMachineProviderCondition) { + *out = *in + in.LastProbeTime.DeepCopyInto(&out.LastProbeTime) + in.LastTransitionTime.DeepCopyInto(&out.LastTransitionTime) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PowerVSMachineProviderCondition. +func (in *PowerVSMachineProviderCondition) DeepCopy() *PowerVSMachineProviderCondition { + if in == nil { + return nil + } + out := new(PowerVSMachineProviderCondition) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PowerVSMachineProviderConfig) DeepCopyInto(out *PowerVSMachineProviderConfig) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Image.DeepCopyInto(&out.Image) + if in.UserDataSecret != nil { + in, out := &in.UserDataSecret, &out.UserDataSecret + *out = new(v1.LocalObjectReference) + **out = **in + } + if in.CredentialsSecret != nil { + in, out := &in.CredentialsSecret, &out.CredentialsSecret + *out = new(v1.LocalObjectReference) + **out = **in + } + in.Network.DeepCopyInto(&out.Network) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PowerVSMachineProviderConfig. +func (in *PowerVSMachineProviderConfig) DeepCopy() *PowerVSMachineProviderConfig { + if in == nil { + return nil + } + out := new(PowerVSMachineProviderConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *PowerVSMachineProviderConfig) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PowerVSMachineProviderConfigList) DeepCopyInto(out *PowerVSMachineProviderConfigList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]PowerVSMachineProviderConfig, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PowerVSMachineProviderConfigList. +func (in *PowerVSMachineProviderConfigList) DeepCopy() *PowerVSMachineProviderConfigList { + if in == nil { + return nil + } + out := new(PowerVSMachineProviderConfigList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *PowerVSMachineProviderConfigList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PowerVSMachineProviderStatus) DeepCopyInto(out *PowerVSMachineProviderStatus) { + *out = *in + out.TypeMeta = in.TypeMeta + if in.InstanceID != nil { + in, out := &in.InstanceID, &out.InstanceID + *out = new(string) + **out = **in + } + if in.InstanceState != nil { + in, out := &in.InstanceState, &out.InstanceState + *out = new(string) + **out = **in + } + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make([]PowerVSMachineProviderCondition, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PowerVSMachineProviderStatus. +func (in *PowerVSMachineProviderStatus) DeepCopy() *PowerVSMachineProviderStatus { + if in == nil { + return nil + } + out := new(PowerVSMachineProviderStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *PowerVSMachineProviderStatus) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PowerVSResourceReference) DeepCopyInto(out *PowerVSResourceReference) { + *out = *in + if in.ID != nil { + in, out := &in.ID, &out.ID + *out = new(string) + **out = **in + } + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PowerVSResourceReference. +func (in *PowerVSResourceReference) DeepCopy() *PowerVSResourceReference { + if in == nil { + return nil + } + out := new(PowerVSResourceReference) + in.DeepCopyInto(out) + return out +} diff --git a/vendor/modules.txt b/vendor/modules.txt index 60ca452ba27..8749ee9b870 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -26,7 +26,7 @@ github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2016-06-01/subscriptio github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2018-02-01/resources github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2018-05-01/resources github.com/Azure/azure-sdk-for-go/version -# github.com/Azure/azure-sdk-for-go/sdk/azcore v0.21.1 +# github.com/Azure/azure-sdk-for-go/sdk/azcore v0.21.0 ## explicit; go 1.16 github.com/Azure/azure-sdk-for-go/sdk/azcore github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/pipeline @@ -640,10 +640,14 @@ github.com/openshift/cluster-api-provider-libvirt/pkg/apis/libvirtproviderconfig ## explicit; go 1.16 github.com/openshift/cluster-api-provider-ovirt/pkg/apis github.com/openshift/cluster-api-provider-ovirt/pkg/apis/ovirtprovider/v1beta1 -# github.com/openshift/library-go v0.0.0-20210811133500-5e31383de2a7 -## explicit; go 1.16 +# github.com/openshift/library-go v0.0.0-20211214183058-58531ccbde67 +## explicit; go 1.17 github.com/openshift/library-go/pkg/config/clusteroperator/v1helpers github.com/openshift/library-go/pkg/route/routeapihelpers +# github.com/openshift/machine-api-provider-powervs v0.0.0-20220303154846-89bb5bec120e +## explicit; go 1.17 +github.com/openshift/machine-api-provider-powervs/pkg/apis +github.com/openshift/machine-api-provider-powervs/pkg/apis/powervsprovider/v1alpha1 # github.com/openshift/machine-config-operator v0.0.0 => github.com/openshift/machine-config-operator v0.0.1-0.20201009041932-4fe8559913b8 ## explicit; go 1.13 github.com/openshift/machine-config-operator/pkg/apis/machineconfiguration.openshift.io/v1 @@ -1339,7 +1343,7 @@ sigs.k8s.io/controller-runtime/pkg/webhook sigs.k8s.io/controller-runtime/pkg/webhook/admission sigs.k8s.io/controller-runtime/pkg/webhook/conversion sigs.k8s.io/controller-runtime/pkg/webhook/internal/metrics -# sigs.k8s.io/controller-tools v0.7.0 => sigs.k8s.io/controller-tools v0.3.1-0.20200617211605-651903477185 +# sigs.k8s.io/controller-tools v0.8.0 => sigs.k8s.io/controller-tools v0.3.1-0.20200617211605-651903477185 ## explicit; go 1.13 sigs.k8s.io/controller-tools/cmd/controller-gen sigs.k8s.io/controller-tools/pkg/crd