diff --git a/cmd/manager/main.go b/cmd/manager/main.go index c07a37abaf..7704c3ac1d 100644 --- a/cmd/manager/main.go +++ b/cmd/manager/main.go @@ -22,6 +22,7 @@ import ( configv1 "github.com/openshift/api/config/v1" mapiv1beta1 "github.com/openshift/machine-api-operator/pkg/apis/machine/v1beta1" "github.com/openshift/machine-api-operator/pkg/controller/machine" + "github.com/openshift/machine-api-operator/pkg/metrics" _ "k8s.io/client-go/plugin/pkg/client/auth/gcp" "k8s.io/klog" "k8s.io/klog/klogr" @@ -43,6 +44,12 @@ func main() { "print version and exit", ) + metricsAddress := flag.String( + "metrics-bind-address", + metrics.DefaultMachineMetricsAddress, + "Address for hosting metrics", + ) + watchNamespace := flag.String( "namespace", "", @@ -95,10 +102,9 @@ func main() { LeaderElectionNamespace: *leaderElectResourceNamespace, LeaderElectionID: "cluster-api-provider-aws-leader", LeaseDuration: leaderElectLeaseDuration, + HealthProbeBindAddress: *healthAddr, SyncPeriod: &syncPeriod, - // Disable metrics serving - MetricsBindAddress: "0", - HealthProbeBindAddress: *healthAddr, + MetricsBindAddress: *metricsAddress, } if *watchNamespace != "" { diff --git a/go.mod b/go.mod index e71153258f..b8304d4fee 100644 --- a/go.mod +++ b/go.mod @@ -6,10 +6,11 @@ require ( github.com/aws/aws-sdk-go v1.15.66 github.com/blang/semver v3.5.1+incompatible github.com/go-logr/logr v0.1.0 - github.com/golang/mock v1.2.0 + github.com/golang/mock v1.3.1 github.com/onsi/ginkgo v1.12.0 github.com/onsi/gomega v1.8.1 - github.com/openshift/machine-api-operator v0.2.1-0.20200611014855-9a69f85c32dd + github.com/openshift/api v0.0.0-20200424083944-0422dc17083e + github.com/openshift/machine-api-operator v0.2.1-0.20200701225707-950912b03628 // kube 1.18 k8s.io/api v0.18.2 @@ -22,4 +23,7 @@ require ( sigs.k8s.io/yaml v1.2.0 ) -replace sigs.k8s.io/cluster-api-provider-aws => github.com/openshift/cluster-api-provider-aws v0.2.1-0.20200612013036-1a97c62077cb +replace ( + sigs.k8s.io/cluster-api-provider-aws => github.com/openshift/cluster-api-provider-aws v0.2.1-0.20200618031251-e16dd65fdd85 + sigs.k8s.io/cluster-api-provider-azure => github.com/openshift/cluster-api-provider-azure v0.1.0-alpha.3.0.20200618001858-af08a66b92de +) diff --git a/go.sum b/go.sum index dfc465891f..fe27628938 100644 --- a/go.sum +++ b/go.sum @@ -2,13 +2,20 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMT cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.38.0 h1:ROfEUZz+Gh5pa62DJWXSaonyu3StP6EA6lPEXPI6mCo= cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= +github.com/Azure/azure-sdk-for-go v32.5.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78 h1:w+iIsaOQNcT7OZ575w+acHgRric5iCyQh+xv+KJ4HB8= github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8= github.com/Azure/go-autorest/autorest v0.9.0/go.mod h1:xyHB1BMZT0cuDHU7I0+g046+BFDTQ8rEZB0s4Yfa6bI= +github.com/Azure/go-autorest/autorest v0.9.2/go.mod h1:xyHB1BMZT0cuDHU7I0+g046+BFDTQ8rEZB0s4Yfa6bI= github.com/Azure/go-autorest/autorest/adal v0.5.0/go.mod h1:8Z9fGy2MpX0PvDjB1pEgQTmVqjGhiHBW7RJJEciWzS0= +github.com/Azure/go-autorest/autorest/adal v0.7.0/go.mod h1:Z6vX6WXXuyieHAXwMj0S6HY6e6wcHn37qQMBQlvY3lc= github.com/Azure/go-autorest/autorest/date v0.1.0/go.mod h1:plvfp3oPSKwf2DNjlBjWF/7vwR+cUD/ELuzDCXwHUVA= +github.com/Azure/go-autorest/autorest/date v0.2.0/go.mod h1:vcORJHLJEh643/Ioh9+vPmf1Ij9AEBM5FuBIXLmIy0g= github.com/Azure/go-autorest/autorest/mocks v0.1.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0= github.com/Azure/go-autorest/autorest/mocks v0.2.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0= +github.com/Azure/go-autorest/autorest/mocks v0.3.0/go.mod h1:a8FDP3DYzQ4RYfVAxAN3SVSiiO77gL2j2ronKKP0syM= +github.com/Azure/go-autorest/autorest/to v0.3.0/go.mod h1:MgwOyqaIuKdG4TL/2ywSsIWKAfJfgHDo8ObuUk3t5sA= +github.com/Azure/go-autorest/autorest/validation v0.2.0/go.mod h1:3EEqHnBxQGHXRYq3HT1WyXAvT7LLY3tl70hw6tQIbjI= github.com/Azure/go-autorest/logger v0.1.0/go.mod h1:oExouG+K6PryycPJfVSxi/koC6LSNgds39diKLz7Vrc= github.com/Azure/go-autorest/tracing v0.5.0/go.mod h1:r/s2XiOKccPW3HrqB+W0TQzfbtp2fGCgRFtBroKn4Dk= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= @@ -35,7 +42,6 @@ github.com/asaskevich/govalidator v0.0.0-20180720115003-f9ffefc3facf/go.mod h1:l github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= github.com/aws/aws-sdk-go v1.15.66 h1:c2ScQzjFUoD1pK+6GQzX8yMXwppIjP5Oy8ljMRr2cbo= github.com/aws/aws-sdk-go v1.15.66/go.mod h1:E3/ieXAlvM0XWO57iftYVDLLvQ824smPP3ATZkfNZeM= -github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973 h1:xJ4a3vCFaGF/jqvzLMYoU8P317H5OQ+Via4RmuPwCS0= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0 h1:HWo1m869IqiPhD389kmkxeTalrjNbbJTC8LXupb+sl0= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= @@ -131,14 +137,12 @@ github.com/go-openapi/errors v0.19.2/go.mod h1:qX0BLWsyaKfvhluLejVpVNwNRdXZhEbTA github.com/go-openapi/jsonpointer v0.0.0-20160704185906-46af16f9f7b1/go.mod h1:+35s3my2LFTysnkMfxsJBAMHj/DoqoB9knIWoYG/Vk0= github.com/go-openapi/jsonpointer v0.17.0/go.mod h1:cOnomiV+CVVwFLk0A/MExoFMjwdsUdVpsRhURCKh+3M= github.com/go-openapi/jsonpointer v0.18.0/go.mod h1:cOnomiV+CVVwFLk0A/MExoFMjwdsUdVpsRhURCKh+3M= -github.com/go-openapi/jsonpointer v0.19.2 h1:A9+F4Dc/MCNB5jibxf6rRvOvR/iFgQdyNx9eIhnGqq0= github.com/go-openapi/jsonpointer v0.19.2/go.mod h1:3akKfEdA7DF1sugOqz1dVQHBcuDBPKZGEoHC/NkiQRg= github.com/go-openapi/jsonpointer v0.19.3 h1:gihV7YNZK1iK6Tgwwsxo2rJbD1GTbdm72325Bq8FI3w= github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= github.com/go-openapi/jsonreference v0.0.0-20160704190145-13c6e3589ad9/go.mod h1:W3Z9FmVs9qj+KR4zFKmDPGiLdk1D9Rlm7cyMvf57TTg= github.com/go-openapi/jsonreference v0.17.0/go.mod h1:g4xxGn04lDIRh0GJb5QlpE3HfopLOL6uZrK/VgnsK9I= github.com/go-openapi/jsonreference v0.18.0/go.mod h1:g4xxGn04lDIRh0GJb5QlpE3HfopLOL6uZrK/VgnsK9I= -github.com/go-openapi/jsonreference v0.19.2 h1:o20suLFB4Ri0tuzpWtyHlh7E7HnkqTNLq6aR6WVNS1w= github.com/go-openapi/jsonreference v0.19.2/go.mod h1:jMjeRr2HHw6nAVajTXJ4eiUwohSTlpa0o73RUL1owJc= github.com/go-openapi/jsonreference v0.19.3 h1:5cxNfTy0UVC3X8JL5ymxzyoUZmo8iZb+jeTWn7tUa8o= github.com/go-openapi/jsonreference v0.19.3/go.mod h1:rjx6GuL8TTa9VaixXglHmQmIL98+wF9xc8zWvFonSJ8= @@ -153,7 +157,6 @@ github.com/go-openapi/runtime v0.19.4/go.mod h1:X277bwSUBxVlCYR3r7xgZZGKVvBd/29g github.com/go-openapi/spec v0.0.0-20160808142527-6aced65f8501/go.mod h1:J8+jY1nAiCcj+friV/PDoE1/3eeccG9LYBs0tYvLOWc= github.com/go-openapi/spec v0.17.0/go.mod h1:XkF/MOi14NmjsfZ8VtAKf8pIlbZzyoTvZsdfssdxcBI= github.com/go-openapi/spec v0.18.0/go.mod h1:XkF/MOi14NmjsfZ8VtAKf8pIlbZzyoTvZsdfssdxcBI= -github.com/go-openapi/spec v0.19.2 h1:SStNd1jRcYtfKCN7R0laGNs80WYYvn5CbBjM2sOmCrE= github.com/go-openapi/spec v0.19.2/go.mod h1:sCxk3jxKgioEJikev4fgkNmwS+3kuYdJtcsZsD5zxMY= github.com/go-openapi/spec v0.19.3 h1:0XRyw8kguri6Yw4SxhsQA/atC88yqrk0+G4YhI2wabc= github.com/go-openapi/spec v0.19.3/go.mod h1:FpwSN1ksY1eteniUU7X0N/BgJ7a4WvBFVA8Lj9mJglo= @@ -164,7 +167,6 @@ github.com/go-openapi/strfmt v0.19.3/go.mod h1:0yX7dbo8mKIvc3XSKp7MNfxw4JytCfCD6 github.com/go-openapi/swag v0.0.0-20160704191624-1d0bd113de87/go.mod h1:DXUve3Dpr1UfpPtxFw+EFuQ41HhCWZfha5jSVRG7C7I= github.com/go-openapi/swag v0.17.0/go.mod h1:AByQ+nYG6gQg71GINrmuDXCPWdL640yX49/kXLo40Tg= github.com/go-openapi/swag v0.18.0/go.mod h1:AByQ+nYG6gQg71GINrmuDXCPWdL640yX49/kXLo40Tg= -github.com/go-openapi/swag v0.19.2 h1:jvO6bCMBEilGwMfHhrd61zIID4oIFdwb76V17SM88dE= github.com/go-openapi/swag v0.19.2/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= github.com/go-openapi/swag v0.19.5 h1:lTz6Ys4CmqqCQmZPBlbQENR1/GucA2bzYTE12Pw4tFY= github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= @@ -176,11 +178,9 @@ github.com/gobuffalo/flect v0.2.0 h1:EWCvMGGxOjsgwlWaP+f4+Hh6yrrte7JeFL2S6b+0hdM github.com/gobuffalo/flect v0.2.0/go.mod h1:W3K3X9ksuZfir8f/LrfVtWmCDQFfayuylOJ7sz/Fj80= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= -github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d h1:3PaI8p3seN09VjbTYC/QWlUZdZ1qS1zGjy7LH2Wt07I= github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= github.com/gogo/protobuf v1.3.1 h1:DqDEcV5aeaTmdFBePNpYsp3FlcVH/2ISVVM9Qf8PSls= github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= -github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20180513044358-24b0969c4cb7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= @@ -188,12 +188,11 @@ github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef h1:veQD95Isof8w9 github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20191002201903-404acd9df4cc h1:55rEp52jU6bkyslZ1+C/7NGfpQsEc6pxGLAGDOctqbw= github.com/golang/groupcache v0.0.0-20191002201903-404acd9df4cc/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/mock v1.1.1 h1:G5FRp8JnTd7RQH5kemVNlMeyXQAztQ3mOWV95KxsXH8= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/mock v1.2.0 h1:28o5sBqPkBsMGnC6b4MvE2TzSr5/AT4c/1fLqVGIwlk= github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.3.1 h1:qGJ6qTW+x6xX/my+8YUVl4WNpX9B7+/l2tRsHGZ7f2s= +github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= github.com/golang/protobuf v0.0.0-20161109072736-4bd1920723d7/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2 h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs= @@ -216,14 +215,12 @@ github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMyw github.com/google/go-cmp v0.3.1 h1:Xye71clBPdm5HgqGwUkwhbynsUJZhDbS20FvLhQ2izg= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/gofuzz v0.0.0-20161122191042-44d81051d367/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI= -github.com/google/gofuzz v1.0.0 h1:A8PeW59pxE9IoFRqBp37U+mSNaQoZ46F1f0f863XSXw= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gofuzz v1.1.0 h1:Hsa8mG0dQ46ij8Sl2AYJDUv1oA9/d6Vk+3LG99Oe02g= github.com/google/gofuzz v1.1.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= github.com/google/uuid v0.0.0-20170306145142-6a5e28554805/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.0.0 h1:b4Gk+7WdP/d3HZH8EJsZpvV7EtDOgaZLtnaNGIu1adA= github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= @@ -245,7 +242,6 @@ github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= github.com/grpc-ecosystem/grpc-gateway v1.3.0/go.mod h1:RSKVYQBd5MCa4OVpNdGskqpgL2+G+NZTnrVHpWWfpdw= github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= -github.com/hashicorp/golang-lru v0.5.0 h1:CL2msUPvZTLb5O648aiLNJw3hnBxN2+1Jq8rCOH9wdo= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1 h1:0hERBMJE1eitiLkihrMvRVBYAkpHzc/J3QdDN+dAcgU= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= @@ -266,9 +262,7 @@ github.com/jmespath/go-jmespath v0.0.0-20160202185014-0b12d6b521d8 h1:12VvqtR6Ao github.com/jmespath/go-jmespath v0.0.0-20160202185014-0b12d6b521d8/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= github.com/json-iterator/go v0.0.0-20180612202835-f2b4162afba3/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= -github.com/json-iterator/go v1.1.6 h1:MrUvLMLTMxbqFJ9kzlvat/rYZqZnW3u4wkLzWTaFwKs= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= -github.com/json-iterator/go v1.1.7 h1:KfgG9LzI+pYjr4xvmz/5H4FXjokeP+rlHLhv3iH62Fo= github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.8 h1:QiWkFLKq0T7mpzwOTu6BzNDbfTE8OLrYhVKYMLF46Ok= github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= @@ -296,7 +290,6 @@ github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czP github.com/mailru/easyjson v0.0.0-20160728113105-d5b7844b561a/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.0.0-20180823135443-60711f1a8329/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.0.0-20190312143242-1de009706dbe/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63 h1:nTT4s92Dgz2HlrB2NaMgvlfqHH39OgMhA7z3PK7PGD4= github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.7.0 h1:aizVhC/NAAcKWb+5QsU1iNOZb4Yws5UO2I+aIprQITM= @@ -318,7 +311,6 @@ github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJ github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v0.0.0-20180320133207-05fbef0ca5da/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742 h1:Esafd1046DLDQ0W1YjYsBW+p8U2u7vzgW2SQVmlNazg= github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.1 h1:9f412s+6RmYXLWZSEzVVgPGK7C2PphHj5RJrvfx9AWI= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= @@ -329,18 +321,13 @@ github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRW github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw= github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.6.0 h1:Ix8l273rp3QzYgXSR+c8d1fTG7UPgYkOSELPhiY/YGw= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.8.0 h1:VkHVNpR4iVnU8XQR6DBm8BqYjN7CRzw+xKUbVVbbW9w= github.com/onsi/ginkgo v1.8.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.11.0 h1:JAKSXpt1YjtLA7YpPiqO9ss6sNXEsPfSGdwN0UHqzrw= github.com/onsi/ginkgo v1.11.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.0 h1:Iw5WCbBcaAAd0fpRb1c9r5YCylv4XDoCSigm1zLevwU= github.com/onsi/ginkgo v1.12.0/go.mod h1:oUhWkIvk5aDxtKvDDuw8gItl8pKl42LzjC9KZE0HfGg= github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= -github.com/onsi/gomega v1.5.0 h1:izbySO9zDPmjJ8rDjLvkA2zJHIo+HkYXHnf7eN7SSyo= github.com/onsi/gomega v1.5.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= -github.com/onsi/gomega v1.7.0 h1:XPnZz8VVBHjVsy1vzJmRwIcSwiUO+JFfrv/xGiigmME= github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.8.1 h1:C5Dqfs/LeauYDX0jJXIe2SWmwCbGzx9yF8C8xy3Lh34= @@ -355,12 +342,16 @@ github.com/openshift/build-machinery-go v0.0.0-20200211121458-5e3d6e570160/go.mo github.com/openshift/build-machinery-go v0.0.0-20200424080330-082bf86082cc/go.mod h1:1CkcsT3aVebzRBzVTSbiKSkJMsC/CASqxesfqEMfJEc= github.com/openshift/client-go v0.0.0-20200326155132-2a6cd50aedd0 h1:kMiuiZXH1GdfbiMwsuAQOqGaMxlo9NCUk0wT4XAdfNM= github.com/openshift/client-go v0.0.0-20200326155132-2a6cd50aedd0/go.mod h1:uUQ4LClRO+fg5MF/P6QxjMCb1C9f7Oh4RKepftDnEJE= -github.com/openshift/cluster-api-provider-aws v0.2.1-0.20200612013036-1a97c62077cb/go.mod h1:4560PS0EgzfODrXC01k3f1vYfbCDjEQwhrlRrsiDhO0= +github.com/openshift/cluster-api-provider-aws v0.2.1-0.20200618031251-e16dd65fdd85/go.mod h1:FxIU+vzZ4b5A7kGKootyJeTI3xafRTljVJF7/+4Iz4s= +github.com/openshift/cluster-api-provider-azure v0.1.0-alpha.3.0.20200618001858-af08a66b92de h1:mnWhjHtRfZDzP+W8Q0IT2VABy8RtEjzmMLATtLf3094= +github.com/openshift/cluster-api-provider-azure v0.1.0-alpha.3.0.20200618001858-af08a66b92de/go.mod h1:XTKOAoCAzFtgljQ9HUs4KeTyczeFUoXa0S9+0R2WCmk= +github.com/openshift/cluster-api-provider-gcp v0.0.1-0.20200701112720-3a7d727c9a10 h1:AZczulAAkBuMm058BGtk5id9lhupszVQXvZFdKmSHEE= +github.com/openshift/cluster-api-provider-gcp v0.0.1-0.20200701112720-3a7d727c9a10/go.mod h1:wgkZrOlcIMWTzo8khB4Js2PoDJDlIUUdzCBm7BuDdqw= github.com/openshift/library-go v0.0.0-20200512120242-21a1ff978534/go.mod h1:2kWwXTkpoQJUN3jZ3QW88EIY1hdRMqxgRs2hheEW/pg= -github.com/openshift/machine-api-operator v0.2.1-0.20200527204437-14e5e0c7d862 h1:uI/6lz/E7ngKe0Fy0wy/wOpLuoS8eJlmoyuLLYfK1bs= github.com/openshift/machine-api-operator v0.2.1-0.20200527204437-14e5e0c7d862/go.mod h1:YKEQMHjXzrzm4fQGTyHBafFfQ/Yq/FrV+1YcGdPCp+0= -github.com/openshift/machine-api-operator v0.2.1-0.20200611014855-9a69f85c32dd h1:DSKbDT7nkLuoidsw0MAXjVaSZULy/alBARdN0/VV4OU= 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 h1:8ErZADoEg3XJBqY8tM9eUEJ9szb7jQHNHSlw2j9Gr5Y= +github.com/openshift/machine-api-operator v0.2.1-0.20200701225707-950912b03628/go.mod h1:cxjy/RUzv5C2T5FNl1KKXUgtakWsezWQ642B/CD9VQA= github.com/operator-framework/operator-sdk v0.5.1-0.20190301204940-c2efe6f74e7b/go.mod h1:iVyukRkam5JZa8AnjYf+/G3rk7JI1+M6GsU0sq0B9NA= github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= @@ -375,28 +366,25 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/pquerna/cachecontrol v0.0.0-20171018203845-0dec1b30a021/go.mod h1:prYjPmNq4d1NPVmpShWobRqXY3q7Vp+80DqgxxUrUIA= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= -github.com/prometheus/client_golang v0.9.2 h1:awm861/B8OKDd2I/6o1dy3ra4BamzKhYOiGItCeZ740= github.com/prometheus/client_golang v0.9.2/go.mod h1:OsXs2jCmiKlQ1lTBmv21f2mNfw4xf/QclQDMrYNZzcM= github.com/prometheus/client_golang v1.0.0 h1:vrDKnkGzuGvhNAL56c7DBz29ZL+KxnoR0x7enabFceM= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= github.com/prometheus/client_golang v1.1.0 h1:BQ53HtBmfOitExawJ6LokA4x8ov/z0SYYb0+HxJfRI8= github.com/prometheus/client_golang v1.1.0/go.mod h1:I1FGZT9+L76gKKOs5djB6ezCbFQP1xR9D75/vuwEF3g= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= -github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90 h1:S/YWwWx/RA8rT8tKFRuGUZhuA90OyIBpPCXkcbwU8DE= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4 h1:gQz4mCbXsO+nc9n1hCxHcGA3Zx3Eo+UHZoInFGUIXNM= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.2.0 h1:uq5h0d+GuxiXLJLNABMgp2qUWDPiLvgCzz2dUR+/W/M= github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/common v0.0.0-20181126121408-4724e9255275 h1:PnBWHBf+6L0jOqq0gIVUe6Yk0/QMZ640k6NvkxcBf+8= github.com/prometheus/common v0.0.0-20181126121408-4724e9255275/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= +github.com/prometheus/common v0.4.1 h1:K0MGApIoQvMw27RTdJkPbr3JZ7DNbtxQNyi5STVM6Kw= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= -github.com/prometheus/common v0.6.0 h1:kRhiuYSXR3+uv2IbVbZhUxK5zVD/2pp3Gd2PpvPkpEo= github.com/prometheus/common v0.6.0/go.mod h1:eBmuwkDJBwy6iBfxCBob6t6dR6ENT/y+J+Zk0j9GMYc= github.com/prometheus/common v0.7.0 h1:L+1lyG48J1zAQXA3RBX/nG/B3gjlHq0zTt2tlbJLyCY= github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt26CguLLsqA= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20181204211112-1dc9a6cbc91a/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= +github.com/prometheus/procfs v0.0.2 h1:6LJUbpNm42llc4HRCuvApCSWB/WfhuNo9K98Q9sNGfs= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.3/go.mod h1:4A/X28fw3Fc593LaREMrKMqOKvUAntwMDaekg4FpcdQ= github.com/prometheus/procfs v0.0.5 h1:3+auTFlqw+ZaQYJARz6ArODtkaIwtvBTx3N2NehQlL8= @@ -420,7 +408,6 @@ github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tL github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= github.com/spf13/pflag v0.0.0-20170130214245-9ff6c6923cff/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= -github.com/spf13/pflag v1.0.3 h1:zPAT6CGy6wXeQ7NtTnaTerfKOsV6V6F8agHXFiazDkg= github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= @@ -430,7 +417,6 @@ github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+ github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= github.com/stretchr/testify v0.0.0-20151208002404-e3a8ff8ce365/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= -github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= @@ -454,7 +440,6 @@ go.mongodb.org/mongo-driver v1.1.1/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qL go.mongodb.org/mongo-driver v1.1.2/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.uber.org/atomic v0.0.0-20181018215023-8dc6146f7569/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= -go.uber.org/atomic v1.3.2 h1:2Oa65PReHzfn29GpvgsYwloV9AVFHPDk8tYxt2c2tr4= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.4.0 h1:cxzIVoETapQEqDhQu3QfnvXAV4AlzcvUCxkVUFw3+EU= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= @@ -462,7 +447,6 @@ go.uber.org/multierr v0.0.0-20180122172545-ddea229ff1df/go.mod h1:wR5kodmAFQ0UK8 go.uber.org/multierr v1.1.0 h1:HoEmRHQPVSqub6w2z2d2EOVs2fjyFRGyofhKuyDq0QI= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= go.uber.org/zap v0.0.0-20180814183419-67bc79d13d15/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= -go.uber.org/zap v1.9.1 h1:XCJQEf3W6eZaVwhRBof6ImoYGJSITeKWsyeh3HFu/5o= go.uber.org/zap v1.9.1/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.10.0 h1:ORx85nbTijNz8ljznvCMR1ZBIPKFn3jQrag10X2AsuM= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= @@ -472,10 +456,8 @@ golang.org/x/crypto v0.0.0-20190211182817-74369b46fc67/go.mod h1:6SG95UA2DQfeDnf golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190320223903-b7391e95e576/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8 h1:1wopBVtVdWnn03fZelqdXTqk7U7zPQCb+T4rbU9ZEoU= golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190617133340-57b3e21c3d56/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550 h1:ObdrDkeb4kJdCP557AjRjq69pTHfNouLtWZG7j9rPN8= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200220183623-bac4c82f6975 h1:/Tl7pH94bvbAAHBdZJT947M/+gp0+CqQXDtMRC0fseo= golang.org/x/crypto v0.0.0-20200220183623-bac4c82f6975/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= @@ -495,7 +477,6 @@ golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73r golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181005035420-146acd28ed58/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181201002055-351d144fa1fc h1:a3CU5tJYVj92DY2LaA1kUkrsqD5/3mLDhx2NcNqyW+0= golang.org/x/net v0.0.0-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -504,10 +485,8 @@ golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn golang.org/x/net v0.0.0-20190320064053-1272bf9dcd53/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= -golang.org/x/net v0.0.0-20190613194153-d28f0bde5980 h1:dfGZHvZk057jK2MCeWus/TowKpJ8y4AmooUzdBSR9GU= golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190812203447-cdfb69ac37fc h1:gkKoSkUmnU6bpS/VhkuO27bzQeSA51uaEfbOW5dNb68= golang.org/x/net v0.0.0-20190812203447-cdfb69ac37fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -524,7 +503,6 @@ golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190423024810-112230192c58 h1:8gQV6CLnAEikrhgkHFbMAEhagSSnXWGV915qUMm9mrU= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20170830134202-bb24a47a89ea/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -542,24 +520,20 @@ golang.org/x/sys v0.0.0-20190321052220-f7bb7a8bee54/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190616124812-15dcb6c0061f h1:25KHgbfyiSm6vwQLbM3zZIe1v9p/3ea4Rz+nnM5K/i4= golang.org/x/sys v0.0.0-20190616124812-15dcb6c0061f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190801041406-cbf593c0f2f3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191022100944-742c48ecaeb7 h1:HmbHVPwrPEKPGLAcHSrMe6+hqSUlvZU0rab6x5EXfGU= golang.org/x/sys v0.0.0-20191022100944-742c48ecaeb7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e h1:N7DeIrjYszNmSW409R3frPPwglRwMkXSBzwVbkOjLLA= golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd h1:xhmwyvizuTgC2qz7ZlMluP20uW+C3Rm0FD/WLDX8884= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/text v0.0.0-20160726164857-2910a502d2bf/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20181108054448-85acf8d2951c h1:fqgJT0MGcGpPgpWU7VRdRjuArfcOvC4AoJmILihzhDg= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4 h1:SvFZT6jyqRaOeXpc5h/JSfZenJ2O330aBsf7JfSUXmQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -576,17 +550,15 @@ golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3 golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190614205625-5aca471b1d59 h1:QjA/9ArTfVTLfEhClDCG7SGrZkZixxWpwNCDiwJfh88= golang.org/x/tools v0.0.0-20190614205625-5aca471b1d59/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190617190820-da514acc4774/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac h1:MQEvx39qSf8vyrx3XRaOe+j1UDIzKwkYOVObRgGPVqI= golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190920225731-5eefd052ad72/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20200115044656-831fdb1e1868 h1:6VZw2h4iwEB4GwgQU3Jvcsm8l9+yReTrErAEK1k6AC4= golang.org/x/tools v0.0.0-20200115044656-831fdb1e1868/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7 h1:9zdDQZ7Thm29KFXgAX/+yaf3eVbP7djjWp/dXAppNCc= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898 h1:/atklqdjdhuosWIl6AIbOeHJjicWYPqR9bpxqxYG2pA= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -614,7 +586,6 @@ google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8 gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/asn1-ber.v1 v1.0.0-20181015200546-f715ec2f112d/go.mod h1:cuepJuh7vyXfUyUwEgHQXw849cJrilpS5NeIjOWESAw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -633,9 +604,7 @@ gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkep gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI= gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= -gopkg.in/yaml.v2 v2.2.1 h1:mUhvW9EsL+naU5Q3cakzfE91YhliOondGd6ZrsDBHQE= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10= @@ -649,20 +618,15 @@ honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= k8s.io/api v0.0.0-20190918155943-95b840bb6a1f/go.mod h1:uWuOHnjmNrtQomJrvEBg0c0HRNyQ+8KTEERVsK0PW48= k8s.io/api v0.18.0-rc.1/go.mod h1:ZOh6SbHjOYyaMLlWmB2+UOQKEWDpCnVEVpEyt7S2J9s= -k8s.io/api v0.18.0 h1:lwYk8Vt7rsVTwjRU6pzEsa9YNhThbmbocQlKvNBB4EQ= k8s.io/api v0.18.0/go.mod h1:q2HRQkfDzHMBZL9l/y9rH63PkQl4vae0xRT+8prbrK8= k8s.io/api v0.18.2 h1:wG5g5ZmSVgm5B+eHMIbI9EGATS2L8Z72rda19RIEgY8= k8s.io/api v0.18.2/go.mod h1:SJCWI7OLzhZSvbY7U8zwNl9UA4o1fizoug34OV/2r78= -k8s.io/apiextensions-apiserver v0.0.0-20190918161926-8f644eb6e783 h1:V6ndwCPoao1yZ52agqOKaUAl7DYWVGiXjV7ePA2i610= k8s.io/apiextensions-apiserver v0.0.0-20190918161926-8f644eb6e783/go.mod h1:xvae1SZB3E17UpV59AWc271W/Ph25N+bjPyR63X6tPY= -k8s.io/apiextensions-apiserver v0.18.0 h1:HN4/P8vpGZFvB5SOMuPPH2Wt9Y/ryX+KRvIyAkchu1Q= k8s.io/apiextensions-apiserver v0.18.0/go.mod h1:18Cwn1Xws4xnWQNC00FLq1E350b9lUF+aOdIWDOZxgo= k8s.io/apiextensions-apiserver v0.18.2 h1:I4v3/jAuQC+89L3Z7dDgAiN4EOjN6sbm6iBqQwHTah8= k8s.io/apiextensions-apiserver v0.18.2/go.mod h1:q3faSnRGmYimiocj6cHQ1I3WpLqmDgJFlKL37fC4ZvY= -k8s.io/apimachinery v0.0.0-20190913080033-27d36303b655 h1:CS1tBQz3HOXiseWZu6ZicKX361CZLT97UFnnPx0aqBw= k8s.io/apimachinery v0.0.0-20190913080033-27d36303b655/go.mod h1:nL6pwRT8NgfF8TT68DBI8uEePRt89cSvoXUVqbkWHq4= k8s.io/apimachinery v0.18.0-rc.1/go.mod h1:9SnR/e11v5IbyPCGbvJViimtJ0SwHG4nfZFjU77ftcA= -k8s.io/apimachinery v0.18.0 h1:fuPfYpk3cs1Okp/515pAf0dNhL66+8zk8RLbSX+EgAE= k8s.io/apimachinery v0.18.0/go.mod h1:9SnR/e11v5IbyPCGbvJViimtJ0SwHG4nfZFjU77ftcA= k8s.io/apimachinery v0.18.2 h1:44CmtbmkzVDAhCpRVSiP2R5PPrC2RtlIv/MoB8xpdRA= k8s.io/apimachinery v0.18.2/go.mod h1:9SnR/e11v5IbyPCGbvJViimtJ0SwHG4nfZFjU77ftcA= @@ -673,43 +637,33 @@ k8s.io/cli-runtime v0.18.0-rc.1 h1:ZqBtm2Qvc7zK2aiQ0Gnb5MutRobKs4jLmS8KINCt2gY= k8s.io/cli-runtime v0.18.0-rc.1/go.mod h1:yuKZYDG8raONmwjwIkT77lCfIuPwX+Bsp88MKYf1TlU= k8s.io/client-go v0.0.0-20190918160344-1fbdaa4c8d90/go.mod h1:J69/JveO6XESwVgG53q3Uz5OSfgsv4uxpScmmyYOOlk= k8s.io/client-go v0.18.0-rc.1/go.mod h1:0lGW/AaaFfNWlmyYvWSJrtaDlti7oNRyCjq4CNK/Ipk= -k8s.io/client-go v0.18.0 h1:yqKw4cTUQraZK3fcVCMeSa+lqKwcjZ5wtcOIPnxQno4= k8s.io/client-go v0.18.0/go.mod h1:uQSYDYs4WhVZ9i6AIoEZuwUggLVEF64HOD37boKAtF8= k8s.io/client-go v0.18.2 h1:aLB0iaD4nmwh7arT2wIn+lMnAq7OswjaejkQ8p9bBYE= k8s.io/client-go v0.18.2/go.mod h1:Xcm5wVGXX9HAA2JJ2sSBUn3tCJ+4SVlCbl2MNNv+CIU= k8s.io/code-generator v0.0.0-20190912054826-cd179ad6a269/go.mod h1:V5BD6M4CyaN5m+VthcclXWsVcT1Hu+glwa1bi3MIsyE= k8s.io/code-generator v0.18.0-rc.1/go.mod h1:+UHX5rSbxmR8kzS+FAv7um6dtYrZokQvjHpDSYRVkTc= k8s.io/code-generator v0.18.0/go.mod h1:+UHX5rSbxmR8kzS+FAv7um6dtYrZokQvjHpDSYRVkTc= -k8s.io/code-generator v0.18.2 h1:C1Nn2JiMf244CvBDKVPX0W2mZFJkVBg54T8OV7/Imso= k8s.io/code-generator v0.18.2/go.mod h1:+UHX5rSbxmR8kzS+FAv7um6dtYrZokQvjHpDSYRVkTc= k8s.io/component-base v0.0.0-20190918160511-547f6c5d7090/go.mod h1:933PBGtQFJky3TEwYx4aEPZ4IxqhWh3R6DCmzqIn1hA= k8s.io/component-base v0.18.0-rc.1/go.mod h1:NNlRaxZEdLqTs2+6yXiU2SHl8gKsbcy19Ii+Sfq53RM= -k8s.io/component-base v0.18.0 h1:I+lP0fNfsEdTDpHaL61bCAqTZLoiWjEEP304Mo5ZQgE= k8s.io/component-base v0.18.0/go.mod h1:u3BCg0z1uskkzrnAKFzulmYaEpZF7XC9Pf/uFyb1v2c= k8s.io/component-base v0.18.2 h1:SJweNZAGcUvsypLGNPNGeJ9UgPZQ6+bW+gEHe8uyh/Y= k8s.io/component-base v0.18.2/go.mod h1:kqLlMuhJNHQ9lz8Z7V5bxUUtjFZnrypArGl58gmDfUM= -k8s.io/gengo v0.0.0-20190128074634-0689ccc1d7d6 h1:4s3/R4+OYYYUKptXPhZKjQ04WJ6EhQQVFdjOFvCazDk= k8s.io/gengo v0.0.0-20190128074634-0689ccc1d7d6/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= -k8s.io/gengo v0.0.0-20190822140433-26a664648505 h1:ZY6yclUKVbZ+SdWnkfY+Je5vrMpKOxmGeKRbsXVmqYM= k8s.io/gengo v0.0.0-20190822140433-26a664648505/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= -k8s.io/gengo v0.0.0-20200114144118-36b2048a9120 h1:RPscN6KhmG54S33L+lr3GS+oD1jmchIU0ll519K6FA4= k8s.io/gengo v0.0.0-20200114144118-36b2048a9120/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= k8s.io/klog v0.0.0-20181102134211-b9b56d5dfc92/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= -k8s.io/klog v0.3.0 h1:0VPpR+sizsiivjIfIAQH/rl8tan6jvWkS7lU+0di3lE= k8s.io/klog v0.3.0/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= -k8s.io/klog v0.4.0 h1:lCJCxf/LIowc2IGS9TPjWDyXY4nOmdGdfcwwDQCOURQ= k8s.io/klog v0.4.0/go.mod h1:4Bi6QPql/J/LkTDqv7R/cd3hPo4k2DG6Ptcz060Ez5I= k8s.io/klog v1.0.0 h1:Pt+yjF5aB1xDSVbau4VsWe+dQNzA0qv1LlXdC2dF6Q8= k8s.io/klog v1.0.0/go.mod h1:4Bi6QPql/J/LkTDqv7R/cd3hPo4k2DG6Ptcz060Ez5I= k8s.io/kube-aggregator v0.18.2/go.mod h1:ijq6FnNUoKinA6kKbkN6svdTacSoQVNtKqmQ1+XJEYQ= -k8s.io/kube-openapi v0.0.0-20190816220812-743ec37842bf h1:EYm5AW/UUDbnmnI+gK0TJDVK9qPLhM+sRHYanNKw0EQ= k8s.io/kube-openapi v0.0.0-20190816220812-743ec37842bf/go.mod h1:1TqjTSzOxsLGIKfj0lK8EeCP7K1iUG65v09OM0/WG5E= k8s.io/kube-openapi v0.0.0-20200121204235-bf4fb3bd569c h1:/KUFqjjqAcY4Us6luF5RDNZ16KJtb49HfR3ZHB9qYXM= k8s.io/kube-openapi v0.0.0-20200121204235-bf4fb3bd569c/go.mod h1:GRQhZsXIAJ1xR0C9bd8UpWHZ5plfAS9fzPjJuQ6JL3E= k8s.io/kubectl v0.18.0-rc.1 h1:DJEZsg8U+lnosidJbj5D46rLILRCbtbqhZQerBOb5CI= k8s.io/kubectl v0.18.0-rc.1/go.mod h1:UpG1w7klD633nyMS73/29cNl2tMdEbXU0nWupttyha4= k8s.io/metrics v0.18.0-rc.1/go.mod h1:ME3EkXCyiZ7mVFEiAYKBfuo3JkpgggeATG+DBUQby5o= -k8s.io/utils v0.0.0-20190801114015-581e00157fb1 h1:+ySTxfHnfzZb9ys375PXNlLhkJPLKgHajBU0N62BDvE= k8s.io/utils v0.0.0-20190801114015-581e00157fb1/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= k8s.io/utils v0.0.0-20200229041039-0a110f9eb7ab/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= k8s.io/utils v0.0.0-20200324210504-a9aa75ae1b89/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= @@ -722,11 +676,9 @@ modernc.org/strutil v1.0.0/go.mod h1:lstksw84oURvj9y3tn8lGvRxyRC1S2+g5uuIzNfIOBs modernc.org/xc v1.0.0/go.mod h1:mRNCo0bvLjGhHO9WsyuKVU4q0ceiDDDoEeWDJHrNx8I= sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.7/go.mod h1:PHgbrJT7lCHcxMU+mDHEm+nx46H4zuuHZkDP6icnhu0= sigs.k8s.io/controller-runtime v0.3.1-0.20191016212439-2df793d02076/go.mod h1:p2vzQ3RuSVv9YR4AcM0y8TKHQA+0oLXazKFt6Z0OdS8= -sigs.k8s.io/controller-runtime v0.5.1-0.20200330174416-a11a908d91e0 h1:3aPkagGN7ZrvaDFAMJoZXyDesY0Otz+S4aXvmHGkQ2s= sigs.k8s.io/controller-runtime v0.5.1-0.20200330174416-a11a908d91e0/go.mod h1:j4echH3Y/UPHRpXS65rxGXujda8iWOheMQvDh1uNgaY= sigs.k8s.io/controller-runtime v0.6.0 h1:Fzna3DY7c4BIP6KwfSlrfnj20DJ+SeMBK8HSFvOk9NM= sigs.k8s.io/controller-runtime v0.6.0/go.mod h1:CpYf5pdNY/B352A1TFLAS2JVSlnGQ5O2cftPHndTroo= -sigs.k8s.io/controller-tools v0.2.9-0.20200331153640-3c5446d407dd h1:q2VrviTVgpbV4H+J8XjXnFtuGCkgED3M9tcykEgN7c4= sigs.k8s.io/controller-tools v0.2.9-0.20200331153640-3c5446d407dd/go.mod h1:D2LzYpGDYjxaAALDVYAwaqaKp2fNuyO5yfOBoU/cbBE= sigs.k8s.io/controller-tools v0.3.0 h1:y3YD99XOyWaXkiF1kd41uRvfp/64teWcrEZFuHxPhJ4= sigs.k8s.io/controller-tools v0.3.0/go.mod h1:enhtKGfxZD1GFEoMgP8Fdbu+uKQ/cq1/WGJhdVChfvI= @@ -739,7 +691,6 @@ sigs.k8s.io/structured-merge-diff/v3 v3.0.0-20200116222232-67a7b8c61874/go.mod h sigs.k8s.io/structured-merge-diff/v3 v3.0.0 h1:dOmIZBMfhcHS09XZkMyUgkq5trg3/jRyJYFZUiaOp8E= sigs.k8s.io/structured-merge-diff/v3 v3.0.0/go.mod h1:PlARxl6Hbt/+BC80dRLi1qAmnMqwqDg62YvvVkZjemw= sigs.k8s.io/testing_frameworks v0.1.1/go.mod h1:VVBKrHmJ6Ekkfz284YKhQePcdycOzNH9qL6ht1zEr/U= -sigs.k8s.io/yaml v1.1.0 h1:4A07+ZFc2wgJwo8YNlQpr1rVlgUDlxXHhPJciaPY5gs= sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= sigs.k8s.io/yaml v1.2.0 h1:kr/MCeFWJWTwyaHoR9c8EjH9OumOmoF9YGiZd7lFm/Q= sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc= diff --git a/pkg/actuators/machine/instances.go b/pkg/actuators/machine/instances.go index c3b4a3c994..3e925dd7d1 100644 --- a/pkg/actuators/machine/instances.go +++ b/pkg/actuators/machine/instances.go @@ -12,6 +12,7 @@ import ( "github.com/aws/aws-sdk-go/aws/awserr" machinev1 "github.com/openshift/machine-api-operator/pkg/apis/machine/v1beta1" mapierrors "github.com/openshift/machine-api-operator/pkg/controller/machine" + "github.com/openshift/machine-api-operator/pkg/metrics" "k8s.io/klog" awsproviderv1 "sigs.k8s.io/cluster-api-provider-aws/pkg/apis/awsprovider/v1beta1" @@ -355,6 +356,11 @@ func launchInstance(machine *machinev1.Machine, machineProviderConfig *awsprovid } } } + metrics.RegisterFailedInstanceCreate(&metrics.MachineLabels{ + Name: machine.Name, + Namespace: machine.Namespace, + Reason: err.Error(), + }) klog.Errorf("Error creating EC2 instance: %v", err) return nil, mapierrors.CreateMachine("error creating EC2 instance: %v", err) } diff --git a/pkg/actuators/machine/reconciler.go b/pkg/actuators/machine/reconciler.go index f48809369d..6008ad9e6d 100644 --- a/pkg/actuators/machine/reconciler.go +++ b/pkg/actuators/machine/reconciler.go @@ -7,6 +7,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ec2" machinecontroller "github.com/openshift/machine-api-operator/pkg/controller/machine" + "github.com/openshift/machine-api-operator/pkg/metrics" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/types" errorutil "k8s.io/apimachinery/pkg/util/errors" @@ -73,11 +74,15 @@ func (r *Reconciler) create() error { } if err = r.updateLoadBalancers(instance); err != nil { + metrics.RegisterFailedInstanceCreate(&metrics.MachineLabels{ + Name: r.machine.Name, + Namespace: r.machine.Namespace, + Reason: err.Error(), + }) return fmt.Errorf("failed to updated update load balancers: %w", err) } klog.Infof("Created Machine %v", r.machine.Name) - if err = r.setProviderID(instance); err != nil { return fmt.Errorf("failed to update machine object with providerID: %w", err) } @@ -111,6 +116,11 @@ func (r *Reconciler) delete() error { terminatingInstances, err := terminateInstances(r.awsClient, existingInstances) if err != nil { + metrics.RegisterFailedInstanceDelete(&metrics.MachineLabels{ + Name: r.machine.Name, + Namespace: r.machine.Namespace, + Reason: err.Error(), + }) return fmt.Errorf("failed to delete instaces: %w", err) } @@ -169,6 +179,11 @@ func (r *Reconciler) update() error { err = r.updateLoadBalancers(newestInstance) if err != nil { + metrics.RegisterFailedInstanceUpdate(&metrics.MachineLabels{ + Name: r.machine.Name, + Namespace: r.machine.Namespace, + Reason: err.Error(), + }) return fmt.Errorf("failed to updated update load balancers: %w", err) } } else { diff --git a/vendor/github.com/golang/mock/gomock/controller.go b/vendor/github.com/golang/mock/gomock/controller.go index 6fde25f508..0651c91e44 100644 --- a/vendor/github.com/golang/mock/gomock/controller.go +++ b/vendor/github.com/golang/mock/gomock/controller.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -// GoMock - a mock framework for Go. +// Package gomock is a mock framework for Go. // // Standard usage: // (1) Define an interface that you wish to mock. @@ -63,8 +63,8 @@ import ( "sync" ) -// A TestReporter is something that can be used to report test failures. -// It is satisfied by the standard library's *testing.T. +// A TestReporter is something that can be used to report test failures. It +// is satisfied by the standard library's *testing.T. type TestReporter interface { Errorf(format string, args ...interface{}) Fatalf(format string, args ...interface{}) @@ -77,14 +77,35 @@ type TestHelper interface { Helper() } -// A Controller represents the top-level control of a mock ecosystem. -// It defines the scope and lifetime of mock objects, as well as their expectations. -// It is safe to call Controller's methods from multiple goroutines. +// A Controller represents the top-level control of a mock ecosystem. It +// defines the scope and lifetime of mock objects, as well as their +// expectations. It is safe to call Controller's methods from multiple +// goroutines. Each test should create a new Controller and invoke Finish via +// defer. +// +// func TestFoo(t *testing.T) { +// ctrl := gomock.NewController(st) +// defer ctrl.Finish() +// // .. +// } +// +// func TestBar(t *testing.T) { +// t.Run("Sub-Test-1", st) { +// ctrl := gomock.NewController(st) +// defer ctrl.Finish() +// // .. +// }) +// t.Run("Sub-Test-2", st) { +// ctrl := gomock.NewController(st) +// defer ctrl.Finish() +// // .. +// }) +// }) type Controller struct { // T should only be called within a generated mock. It is not intended to // be used in user code and may be changed in future versions. T is the // TestReporter passed in when creating the Controller via NewController. - // If the TestReporter does not implment a TestHelper it will be wrapped + // If the TestReporter does not implement a TestHelper it will be wrapped // with a nopTestHelper. T TestHelper mu sync.Mutex @@ -92,6 +113,8 @@ type Controller struct { finished bool } +// NewController returns a new Controller. It is the preferred way to create a +// Controller. func NewController(t TestReporter) *Controller { h, ok := t.(TestHelper) if !ok { @@ -135,6 +158,7 @@ type nopTestHelper struct { func (h nopTestHelper) Helper() {} +// RecordCall is called by a mock. It should not be called by user code. func (ctrl *Controller) RecordCall(receiver interface{}, method string, args ...interface{}) *Call { ctrl.T.Helper() @@ -148,6 +172,7 @@ func (ctrl *Controller) RecordCall(receiver interface{}, method string, args ... panic("unreachable") } +// RecordCallWithMethodType is called by a mock. It should not be called by user code. func (ctrl *Controller) RecordCallWithMethodType(receiver interface{}, method string, methodType reflect.Type, args ...interface{}) *Call { ctrl.T.Helper() @@ -160,6 +185,7 @@ func (ctrl *Controller) RecordCallWithMethodType(receiver interface{}, method st return call } +// Call is called by a mock. It should not be called by user code. func (ctrl *Controller) Call(receiver interface{}, method string, args ...interface{}) []interface{} { ctrl.T.Helper() @@ -200,6 +226,9 @@ func (ctrl *Controller) Call(receiver interface{}, method string, args ...interf return rets } +// Finish checks to see if all the methods that were expected to be called +// were called. It should be invoked for each Controller. It is not idempotent +// and therefore can only be invoked once. func (ctrl *Controller) Finish() { ctrl.T.Helper() diff --git a/vendor/github.com/golang/mock/gomock/matchers.go b/vendor/github.com/golang/mock/gomock/matchers.go index 189796f865..fbff06062f 100644 --- a/vendor/github.com/golang/mock/gomock/matchers.go +++ b/vendor/github.com/golang/mock/gomock/matchers.go @@ -98,9 +98,30 @@ func (m assignableToTypeOfMatcher) String() string { } // Constructors -func Any() Matcher { return anyMatcher{} } +// Any returns a matcher that always matches. +func Any() Matcher { return anyMatcher{} } + +// Eq returns a matcher that matches on equality. +// +// Example usage: +// Eq(5).Matches(5) // returns true +// Eq(5).Matches(4) // returns false func Eq(x interface{}) Matcher { return eqMatcher{x} } -func Nil() Matcher { return nilMatcher{} } + +// Nil returns a matcher that matches if the received value is nil. +// +// Example usage: +// var x *bytes.Buffer +// Nil().Matches(x) // returns true +// x = &bytes.Buffer{} +// Nil().Matches(x) // returns false +func Nil() Matcher { return nilMatcher{} } + +// Not reverses the results of its given child matcher. +// +// Example usage: +// Not(Eq(5)).Matches(4) // returns true +// Not(Eq(5)).Matches(5) // returns false func Not(x interface{}) Matcher { if m, ok := x.(Matcher); ok { return notMatcher{m} @@ -112,11 +133,9 @@ func Not(x interface{}) Matcher { // function is assignable to the type of the parameter to this function. // // Example usage: -// -// dbMock.EXPECT(). -// Insert(gomock.AssignableToTypeOf(&EmployeeRecord{})). -// Return(errors.New("DB error")) -// +// var s fmt.Stringer = &bytes.Buffer{} +// AssignableToTypeOf(s).Matches(time.Second) // returns true +// AssignableToTypeOf(s).Matches(99) // returns false func AssignableToTypeOf(x interface{}) Matcher { return assignableToTypeOfMatcher{reflect.TypeOf(x)} } diff --git a/vendor/github.com/golang/mock/mockgen/mockgen.go b/vendor/github.com/golang/mock/mockgen/mockgen.go index 3a16948767..a64bd2554f 100644 --- a/vendor/github.com/golang/mock/mockgen/mockgen.go +++ b/vendor/github.com/golang/mock/mockgen/mockgen.go @@ -26,6 +26,7 @@ import ( "go/format" "go/token" "io" + "io/ioutil" "log" "os" "path" @@ -49,6 +50,7 @@ var ( packageOut = flag.String("package", "", "Package of the generated code; defaults to the package of the input with a 'mock_' prefix.") selfPackage = flag.String("self_package", "", "The full package import path for the generated code. The purpose of this flag is to prevent import cycles in the generated code by trying to include its own package. This can happen if the mock's package is set to one of its inputs (usually the main one) and the output is stdio so mockgen cannot detect the final output package. Setting this flag will then tell mockgen which import to exclude.") writePkgComment = flag.Bool("write_package_comment", true, "Writes package documentation comment (godoc) if true.") + copyrightFile = flag.String("copyright_file", "", "Copyright file used to add copyright header") debugParser = flag.Bool("debug_parser", false, "Print out parser results only.") ) @@ -60,13 +62,13 @@ func main() { var pkg *model.Package var err error if *source != "" { - pkg, err = ParseFile(*source) + pkg, err = parseFile(*source) } else { if flag.NArg() != 2 { usage() log.Fatal("Expected exactly two arguments") } - pkg, err = Reflect(flag.Arg(0), strings.Split(flag.Arg(1), ",")) + pkg, err = reflect(flag.Arg(0), strings.Split(flag.Arg(1), ",")) } if err != nil { log.Fatalf("Loading input failed: %v", err) @@ -127,6 +129,14 @@ func main() { if *mockNames != "" { g.mockNames = parseMockNames(*mockNames) } + if *copyrightFile != "" { + header, err := ioutil.ReadFile(*copyrightFile) + if err != nil { + log.Fatalf("Failed reading copyright file: %v", err) + } + + g.copyrightHeader = string(header) + } if err := g.Generate(pkg, packageName, outputPackagePath); err != nil { log.Fatalf("Failed generating mock: %v", err) } @@ -134,6 +144,7 @@ func main() { log.Fatalf("Failed writing to destination: %v", err) } } + func parseMockNames(names string) map[string]string { mocksMap := make(map[string]string) for _, kv := range strings.Split(names, ",") { @@ -171,9 +182,10 @@ Example: type generator struct { buf bytes.Buffer indent string - mockNames map[string]string //may be empty + mockNames map[string]string // may be empty filename string // may be empty srcPackage, srcInterfaces string // may be empty + copyrightHeader string packageMap map[string]string // map from import path to package name } @@ -223,6 +235,18 @@ func sanitize(s string) string { } func (g *generator) Generate(pkg *model.Package, pkgName string, outputPackagePath string) error { + if pkgName != pkg.Name { + outputPackagePath = "" + } + + if g.copyrightHeader != "" { + lines := strings.Split(g.copyrightHeader, "\n") + for _, line := range lines { + g.p("// %s", line) + } + g.p("") + } + g.p("// Code generated by MockGen. DO NOT EDIT.") if g.filename != "" { g.p("// Source: %v", g.filename) @@ -245,17 +269,17 @@ func (g *generator) Generate(pkg *model.Package, pkgName string, outputPackagePa } // Sort keys to make import alias generation predictable - sorted_paths := make([]string, len(im), len(im)) + sortedPaths := make([]string, len(im), len(im)) x := 0 for pth := range im { - sorted_paths[x] = pth + sortedPaths[x] = pth x++ } - sort.Strings(sorted_paths) + sort.Strings(sortedPaths) g.packageMap = make(map[string]string, len(im)) localNames := make(map[string]bool, len(im)) - for _, pth := range sorted_paths { + for _, pth := range sortedPaths { base := sanitize(path.Base(pth)) // Local names for an imported package can usually be the basename of the import path. diff --git a/vendor/github.com/golang/mock/mockgen/model/model.go b/vendor/github.com/golang/mock/mockgen/model/model.go index 1b6683dd8d..8113e3d399 100644 --- a/vendor/github.com/golang/mock/mockgen/model/model.go +++ b/vendor/github.com/golang/mock/mockgen/model/model.go @@ -359,15 +359,8 @@ func typeFromType(t reflect.Type) (Type, error) { } if imp := t.PkgPath(); imp != "" { - // PkgPath might return a path that includes "vendor" - // These paths do not compile, so we need to remove everything - // up to and including "/vendor/" - // see https://github.com/golang/go/issues/12019 - if i := strings.LastIndex(imp, "/vendor/"); i != -1 { - imp = imp[i+len("/vendor/"):] - } return &NamedType{ - Package: imp, + Package: impPath(imp), Type: t.Name(), }, nil } @@ -452,3 +445,17 @@ func typeFromType(t reflect.Type) (Type, error) { // TODO: Struct, UnsafePointer return nil, fmt.Errorf("can't yet turn %v (%v) into a model.Type", t, t.Kind()) } + +// impPath sanitizes the package path returned by `PkgPath` method of a reflect Type so that +// it is importable. PkgPath might return a path that includes "vendor". These paths do not +// compile, so we need to remove everything up to and including "/vendor/". +// See https://github.com/golang/go/issues/12019. +func impPath(imp string) string { + if strings.HasPrefix(imp, "vendor/") { + imp = "/" + imp + } + if i := strings.LastIndex(imp, "/vendor/"); i != -1 { + imp = imp[i+len("/vendor/"):] + } + return imp +} diff --git a/vendor/github.com/golang/mock/mockgen/parse.go b/vendor/github.com/golang/mock/mockgen/parse.go index 7282fff930..9c5475e93a 100644 --- a/vendor/github.com/golang/mock/mockgen/parse.go +++ b/vendor/github.com/golang/mock/mockgen/parse.go @@ -17,6 +17,7 @@ package main // This file contains the model construction by parsing source files. import ( + "errors" "flag" "fmt" "go/ast" @@ -30,6 +31,7 @@ import ( "strings" "github.com/golang/mock/mockgen/model" + "golang.org/x/tools/go/packages" ) var ( @@ -39,16 +41,25 @@ var ( // TODO: simplify error reporting -func ParseFile(source string) (*model.Package, error) { +func parseFile(source string) (*model.Package, error) { srcDir, err := filepath.Abs(filepath.Dir(source)) if err != nil { return nil, fmt.Errorf("failed getting source directory: %v", err) } - var packageImport string - if p, err := build.ImportDir(srcDir, 0); err == nil { - packageImport = p.ImportPath - } // TODO: should we fail if this returns an error? + cfg := &packages.Config{Mode: packages.LoadSyntax, Tests: true} + pkgs, err := packages.Load(cfg, "file="+source) + if err != nil { + return nil, err + } + if packages.PrintErrors(pkgs) > 0 || len(pkgs) == 0 { + return nil, errors.New("loading package failed") + } + + packageImport := pkgs[0].PkgPath + + // It is illegal to import a _test package. + packageImport = strings.TrimSuffix(packageImport, "_test") fs := token.NewFileSet() file, err := parser.ParseFile(fs, source, nil, 0) @@ -386,10 +397,10 @@ func (p *fileParser) parseType(pkg string, typ ast.Expr) (model.Type, error) { } // assume type in this package return &model.NamedType{Package: pkg, Type: v.Name}, nil - } else { - // assume predeclared type - return model.PredeclaredType(v.Name), nil } + + // assume predeclared type + return model.PredeclaredType(v.Name), nil case *ast.InterfaceType: if v.Methods != nil && len(v.Methods.List) > 0 { return nil, p.errorf(v.Pos(), "can't handle non-empty unnamed interface types") diff --git a/vendor/github.com/golang/mock/mockgen/reflect.go b/vendor/github.com/golang/mock/mockgen/reflect.go index b80f97ffcd..d4c7b7fe2d 100644 --- a/vendor/github.com/golang/mock/mockgen/reflect.go +++ b/vendor/github.com/golang/mock/mockgen/reflect.go @@ -22,6 +22,7 @@ import ( "flag" "go/build" "io/ioutil" + "log" "os" "os/exec" "path/filepath" @@ -52,6 +53,10 @@ func writeProgram(importPath string, symbols []string) ([]byte, error) { // run the given program and parse the output as a model.Package. func run(program string) (*model.Package, error) { f, err := ioutil.TempFile("", "") + if err != nil { + return nil, err + } + filename := f.Name() defer os.Remove(filename) if err := f.Close(); err != nil { @@ -92,7 +97,11 @@ func runInDir(program []byte, dir string) (*model.Package, error) { if err != nil { return nil, err } - defer func() { os.RemoveAll(tmpDir) }() + defer func() { + if err := os.RemoveAll(tmpDir); err != nil { + log.Printf("failed to remove temp directory: %s", err) + } + }() const progSource = "prog.go" var progBinary = "prog.bin" if runtime.GOOS == "windows" { @@ -122,7 +131,7 @@ func runInDir(program []byte, dir string) (*model.Package, error) { return run(filepath.Join(tmpDir, progBinary)) } -func Reflect(importPath string, symbols []string) (*model.Package, error) { +func reflect(importPath string, symbols []string) (*model.Package, error) { // TODO: sanity check arguments if *execOnly != "" { diff --git a/vendor/github.com/openshift/cluster-api-provider-gcp/LICENSE b/vendor/github.com/openshift/cluster-api-provider-gcp/LICENSE new file mode 100644 index 0000000000..261eeb9e9f --- /dev/null +++ b/vendor/github.com/openshift/cluster-api-provider-gcp/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/cluster-api-provider-gcp/pkg/apis/gcpprovider/v1beta1/doc.go b/vendor/github.com/openshift/cluster-api-provider-gcp/pkg/apis/gcpprovider/v1beta1/doc.go new file mode 100644 index 0000000000..eea429419b --- /dev/null +++ b/vendor/github.com/openshift/cluster-api-provider-gcp/pkg/apis/gcpprovider/v1beta1/doc.go @@ -0,0 +1,7 @@ +// Package v1beta1 contains API Schema definitions for the gcpprovider v1beta1 API group +// +k8s:openapi-gen=true +// +k8s:deepcopy-gen=package,register +// +k8s:conversion-gen=github.com/openshift/cluster-api-provider-gcp/pkg/apis/gcpprovider +// +k8s:defaulter-gen=TypeMeta +// +groupName=gcpprovider.machine.openshift.io +package v1beta1 diff --git a/vendor/github.com/openshift/cluster-api-provider-gcp/pkg/apis/gcpprovider/v1beta1/gcpmachineproviderconfig_types.go b/vendor/github.com/openshift/cluster-api-provider-gcp/pkg/apis/gcpprovider/v1beta1/gcpmachineproviderconfig_types.go new file mode 100644 index 0000000000..b1e9ec4c18 --- /dev/null +++ b/vendor/github.com/openshift/cluster-api-provider-gcp/pkg/apis/gcpprovider/v1beta1/gcpmachineproviderconfig_types.go @@ -0,0 +1,76 @@ +package v1beta1 + +import ( + corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// +genclient +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// GCPMachineProviderSpec is the type that will be embedded in a Machine.Spec.ProviderSpec field +// for an GCP virtual machine. It is used by the GCP machine actuator to create a single Machine. +// +k8s:openapi-gen=true +type GCPMachineProviderSpec struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + // UserDataSecret contains a local reference to a secret that contains the + // UserData to apply to the instance + UserDataSecret *corev1.LocalObjectReference `json:"userDataSecret,omitempty"` + + // CredentialsSecret is a reference to the secret with GCP credentials. + CredentialsSecret *corev1.LocalObjectReference `json:"credentialsSecret,omitempty"` + + CanIPForward bool `json:"canIPForward"` + DeletionProtection bool `json:"deletionProtection"` + Disks []*GCPDisk `json:"disks,omitempty"` + Labels map[string]string `json:"labels,omitempty"` + Metadata []*GCPMetadata `json:"gcpMetadata,omitempty"` + NetworkInterfaces []*GCPNetworkInterface `json:"networkInterfaces,omitempty"` + ServiceAccounts []GCPServiceAccount `json:"serviceAccounts"` + Tags []string `json:"tags,omitempty"` + TargetPools []string `json:"targetPools,omitempty"` + MachineType string `json:"machineType"` + Region string `json:"region"` + Zone string `json:"zone"` + ProjectID string `json:"projectID,omitempty"` + + // Preemptible indicates if created instance is preemptible + Preemptible bool `json:"preemptible,omitempty"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +func init() { + SchemeBuilder.Register(&GCPMachineProviderSpec{}) +} + +// GCPDisk describes disks for GCP. +type GCPDisk struct { + AutoDelete bool `json:"autoDelete"` + Boot bool `json:"boot"` + SizeGb int64 `json:"sizeGb"` + Type string `json:"type"` + Image string `json:"image"` + Labels map[string]string `json:"labels"` +} + +// GCPMetadata describes metadata for GCP. +type GCPMetadata struct { + Key string `json:"key"` + Value *string `json:"value"` +} + +// GCPNetworkInterface describes network interfaces for GCP +type GCPNetworkInterface struct { + PublicIP bool `json:"publicIP,omitempty"` + Network string `json:"network,omitempty"` + Subnetwork string `json:"subnetwork,omitempty"` +} + +// GCPServiceAccount describes service accounts for GCP. +type GCPServiceAccount struct { + Email string `json:"email"` + Scopes []string `json:"scopes"` +} diff --git a/vendor/github.com/openshift/cluster-api-provider-gcp/pkg/apis/gcpprovider/v1beta1/gcpmachineproviderstatus_types.go b/vendor/github.com/openshift/cluster-api-provider-gcp/pkg/apis/gcpprovider/v1beta1/gcpmachineproviderstatus_types.go new file mode 100644 index 0000000000..144b6cc025 --- /dev/null +++ b/vendor/github.com/openshift/cluster-api-provider-gcp/pkg/apis/gcpprovider/v1beta1/gcpmachineproviderstatus_types.go @@ -0,0 +1,65 @@ +package v1beta1 + +import ( + corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// +genclient +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// GCPMachineProviderStatus is the type that will be embedded in a Machine.Status.ProviderStatus field. +// It contains GCP-specific status information. +// +k8s:openapi-gen=true +type GCPMachineProviderStatus struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + // InstanceID is the ID of the instance in GCP + // +optional + InstanceID *string `json:"instanceId,omitempty"` + + // InstanceState is the provisioning state of the GCP Instance. + // +optional + InstanceState *string `json:"instanceState,omitempty"` + + // Conditions is a set of conditions associated with the Machine to indicate + // errors or other status + Conditions []GCPMachineProviderCondition `json:"conditions,omitempty"` +} + +// GCPMachineProviderConditionType is a valid value for GCPMachineProviderCondition.Type +type GCPMachineProviderConditionType string + +// Valid conditions for an GCP machine instance +const ( + // MachineCreated indicates whether the machine has been created or not. If not, + // it should include a reason and message for the failure. + MachineCreated GCPMachineProviderConditionType = "MachineCreated" +) + +// GCPMachineProviderCondition is a condition in a GCPMachineProviderStatus +type GCPMachineProviderCondition struct { + // Type is the type of the condition. + Type GCPMachineProviderConditionType `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 string `json:"reason,omitempty"` + // Message is a human-readable message indicating details about last transition. + // +optional + Message string `json:"message,omitempty"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +func init() { + SchemeBuilder.Register(&GCPMachineProviderStatus{}) +} diff --git a/vendor/github.com/openshift/cluster-api-provider-gcp/pkg/apis/gcpprovider/v1beta1/register.go b/vendor/github.com/openshift/cluster-api-provider-gcp/pkg/apis/gcpprovider/v1beta1/register.go new file mode 100644 index 0000000000..8ce9dc5a14 --- /dev/null +++ b/vendor/github.com/openshift/cluster-api-provider-gcp/pkg/apis/gcpprovider/v1beta1/register.go @@ -0,0 +1,90 @@ +// Package v1beta1 contains API Schema definitions for the gcpprovider v1beta1 API group +// +k8s:openapi-gen=true +// +k8s:deepcopy-gen=package,register +// +k8s:conversion-gen=github.com/openshift/cluster-api-provider-gcp/pkg/apis/gcpprovider +// +k8s:defaulter-gen=TypeMeta +// +groupName=gcpprovider.machine.openshift.io +package v1beta1 + +import ( + "encoding/json" + "fmt" + + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/schema" + "k8s.io/klog" + "sigs.k8s.io/controller-runtime/pkg/scheme" + "sigs.k8s.io/yaml" +) + +var ( + // SchemeGroupVersion is group version used to register these objects + SchemeGroupVersion = schema.GroupVersion{Group: "gcpprovider.openshift.io", Version: "v1beta1"} + + // SchemeBuilder is used to add go types to the GroupVersionKind scheme + SchemeBuilder = &scheme.Builder{GroupVersion: SchemeGroupVersion} +) + +// RawExtensionFromProviderSpec marshals the machine provider spec. +func RawExtensionFromProviderSpec(spec *GCPMachineProviderSpec) (*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 provider status +func RawExtensionFromProviderStatus(status *GCPMachineProviderStatus) (*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 the JSON-encoded spec +func ProviderSpecFromRawExtension(rawExtension *runtime.RawExtension) (*GCPMachineProviderSpec, error) { + if rawExtension == nil { + return &GCPMachineProviderSpec{}, nil + } + + spec := new(GCPMachineProviderSpec) + 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 a GCPMachineProviderStatus type +func ProviderStatusFromRawExtension(rawExtension *runtime.RawExtension) (*GCPMachineProviderStatus, error) { + if rawExtension == nil { + return &GCPMachineProviderStatus{}, nil + } + + providerStatus := new(GCPMachineProviderStatus) + 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/cluster-api-provider-gcp/pkg/apis/gcpprovider/v1beta1/zz_generated.deepcopy.go b/vendor/github.com/openshift/cluster-api-provider-gcp/pkg/apis/gcpprovider/v1beta1/zz_generated.deepcopy.go new file mode 100644 index 0000000000..08c506c2a3 --- /dev/null +++ b/vendor/github.com/openshift/cluster-api-provider-gcp/pkg/apis/gcpprovider/v1beta1/zz_generated.deepcopy.go @@ -0,0 +1,254 @@ +// +build !ignore_autogenerated + +/* +Copyright 2019 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 v1beta1 + +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 *GCPDisk) DeepCopyInto(out *GCPDisk) { + *out = *in + if in.Labels != nil { + in, out := &in.Labels, &out.Labels + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GCPDisk. +func (in *GCPDisk) DeepCopy() *GCPDisk { + if in == nil { + return nil + } + out := new(GCPDisk) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GCPMachineProviderCondition) DeepCopyInto(out *GCPMachineProviderCondition) { + *out = *in + in.LastProbeTime.DeepCopyInto(&out.LastProbeTime) + in.LastTransitionTime.DeepCopyInto(&out.LastTransitionTime) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GCPMachineProviderCondition. +func (in *GCPMachineProviderCondition) DeepCopy() *GCPMachineProviderCondition { + if in == nil { + return nil + } + out := new(GCPMachineProviderCondition) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GCPMachineProviderSpec) DeepCopyInto(out *GCPMachineProviderSpec) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + 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 + } + if in.Disks != nil { + in, out := &in.Disks, &out.Disks + *out = make([]*GCPDisk, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(GCPDisk) + (*in).DeepCopyInto(*out) + } + } + } + if in.Labels != nil { + in, out := &in.Labels, &out.Labels + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.Metadata != nil { + in, out := &in.Metadata, &out.Metadata + *out = make([]*GCPMetadata, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(GCPMetadata) + (*in).DeepCopyInto(*out) + } + } + } + if in.NetworkInterfaces != nil { + in, out := &in.NetworkInterfaces, &out.NetworkInterfaces + *out = make([]*GCPNetworkInterface, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(GCPNetworkInterface) + **out = **in + } + } + } + if in.ServiceAccounts != nil { + in, out := &in.ServiceAccounts, &out.ServiceAccounts + *out = make([]GCPServiceAccount, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Tags != nil { + in, out := &in.Tags, &out.Tags + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.TargetPools != nil { + in, out := &in.TargetPools, &out.TargetPools + *out = make([]string, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GCPMachineProviderSpec. +func (in *GCPMachineProviderSpec) DeepCopy() *GCPMachineProviderSpec { + if in == nil { + return nil + } + out := new(GCPMachineProviderSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *GCPMachineProviderSpec) 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 *GCPMachineProviderStatus) DeepCopyInto(out *GCPMachineProviderStatus) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + 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([]GCPMachineProviderCondition, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GCPMachineProviderStatus. +func (in *GCPMachineProviderStatus) DeepCopy() *GCPMachineProviderStatus { + if in == nil { + return nil + } + out := new(GCPMachineProviderStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *GCPMachineProviderStatus) 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 *GCPMetadata) DeepCopyInto(out *GCPMetadata) { + *out = *in + if in.Value != nil { + in, out := &in.Value, &out.Value + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GCPMetadata. +func (in *GCPMetadata) DeepCopy() *GCPMetadata { + if in == nil { + return nil + } + out := new(GCPMetadata) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GCPNetworkInterface) DeepCopyInto(out *GCPNetworkInterface) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GCPNetworkInterface. +func (in *GCPNetworkInterface) DeepCopy() *GCPNetworkInterface { + if in == nil { + return nil + } + out := new(GCPNetworkInterface) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GCPServiceAccount) DeepCopyInto(out *GCPServiceAccount) { + *out = *in + if in.Scopes != nil { + in, out := &in.Scopes, &out.Scopes + *out = make([]string, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GCPServiceAccount. +func (in *GCPServiceAccount) DeepCopy() *GCPServiceAccount { + if in == nil { + return nil + } + out := new(GCPServiceAccount) + in.DeepCopyInto(out) + return out +} diff --git a/vendor/github.com/openshift/machine-api-operator/pkg/apis/machine/v1beta1/machine_webhook.go b/vendor/github.com/openshift/machine-api-operator/pkg/apis/machine/v1beta1/machine_webhook.go index f4da024d4e..d5a9b2d6e2 100644 --- a/vendor/github.com/openshift/machine-api-operator/pkg/apis/machine/v1beta1/machine_webhook.go +++ b/vendor/github.com/openshift/machine-api-operator/pkg/apis/machine/v1beta1/machine_webhook.go @@ -5,23 +5,29 @@ import ( "encoding/json" "fmt" "net/http" + "strings" osconfigv1 "github.com/openshift/api/config/v1" osclientset "github.com/openshift/client-go/config/clientset/versioned" + gcp "github.com/openshift/cluster-api-provider-gcp/pkg/apis/gcpprovider/v1beta1" + vsphere "github.com/openshift/machine-api-operator/pkg/apis/vsphereprovider/v1beta1" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" utilerrors "k8s.io/apimachinery/pkg/util/errors" + "k8s.io/apimachinery/pkg/util/sets" "k8s.io/apimachinery/pkg/util/validation/field" "k8s.io/klog" "k8s.io/utils/pointer" aws "sigs.k8s.io/cluster-api-provider-aws/pkg/apis/awsprovider/v1beta1" + azure "sigs.k8s.io/cluster-api-provider-azure/pkg/apis/azureprovider/v1beta1" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/webhook/admission" yaml "sigs.k8s.io/yaml" ) var ( + // AWS Defaults defaultAWSIAMInstanceProfile = func(clusterID string) *string { return pointer.StringPtr(fmt.Sprintf("%s-worker-profile", clusterID)) } @@ -31,12 +37,77 @@ var ( defaultAWSSubnet = func(clusterID, az string) string { return fmt.Sprintf("%s-private-%s", clusterID, az) } + + // Azure Defaults + defaultAzureVnet = func(clusterID string) string { + return fmt.Sprintf("%s-vnet", clusterID) + } + defaultAzureSubnet = func(clusterID string) string { + return fmt.Sprintf("%s-worker-subnet", clusterID) + } + defaultAzureNetworkResourceGroup = func(clusterID string) string { + return fmt.Sprintf("%s-rg", clusterID) + } + defaultAzureImageResourceID = func(clusterID string) string { + return fmt.Sprintf("/resourceGroups/%s/providers/Microsoft.Compute/images/%s", clusterID+"-rg", clusterID) + } + defaultAzureManagedIdentiy = func(clusterID string) string { + return fmt.Sprintf("%s-identity", clusterID) + } + defaultAzureResourceGroup = func(clusterID string) string { + return fmt.Sprintf("%s-rg", clusterID) + } + + // GCP Defaults + defaultGCPNetwork = func(clusterID string) string { + return fmt.Sprintf("%s-network", clusterID) + } + defaultGCPSubnetwork = func(clusterID string) string { + return fmt.Sprintf("%s-worker-subnet", clusterID) + } + defaultGCPDiskImage = func(clusterID string) string { + return fmt.Sprintf("%s-rhcos-image", clusterID) + } + defaultGCPTags = func(clusterID string) []string { + return []string{fmt.Sprintf("%s-worker", clusterID)} + } + defaultGCPServiceAccounts = func(clusterID, projectID string) []gcp.GCPServiceAccount { + if clusterID == "" || projectID == "" { + return []gcp.GCPServiceAccount{} + } + + return []gcp.GCPServiceAccount{{ + Email: fmt.Sprintf("%s-w@%s.iam.gserviceaccount.com", clusterID, projectID), + Scopes: []string{"https://www.googleapis.com/auth/cloud-platform"}, + }} + } ) const ( - defaultAWSUserDataSecret = "worker-user-data" + defaultUserDataSecret = "worker-user-data" + defaultSecretNamespace = "openshift-machine-api" + + // AWS Defaults defaultAWSCredentialsSecret = "aws-cloud-credentials" defaultAWSInstanceType = "m4.large" + + // Azure Defaults + defaultAzureVMSize = "Standard_D4s_V3" + defaultAzureCredentialsSecret = "azure-cloud-credentials" + defaultAzureOSDiskOSType = "Linux" + defaultAzureOSDiskStorageType = "Premium_LRS" + + // GCP Defaults + defaultGCPMachineType = "n1-standard-4" + defaultGCPCredentialsSecret = "gcp-cloud-credentials" + defaultGCPDiskSizeGb = 128 + defaultGCPDiskType = "pd-standard" + + // vSphere Defaults + defaultVSphereCredentialsSecret = "vsphere-cloud-credentials" + // Minimum vSphere values taken from vSphere reconciler + minVSphereCPU = 2 + minVSphereMemoryMiB = 2048 ) func getInfra() (*osconfigv1.Infrastructure, error) { @@ -55,29 +126,36 @@ func getInfra() (*osconfigv1.Infrastructure, error) { return infra, nil } -type handlerValidationFn func(h *validatorHandler, m *Machine) (bool, utilerrors.Aggregate) -type handlerMutationFn func(h *defaulterHandler, m *Machine) (bool, utilerrors.Aggregate) +type machineAdmissionFn func(m *Machine, clusterID string) (bool, utilerrors.Aggregate) -// validatorHandler validates Machine API resources. -// implements type Handler interface. -// https://godoc.org/github.com/kubernetes-sigs/controller-runtime/pkg/webhook/admission#Handler -type validatorHandler struct { +type admissionHandler struct { clusterID string - webhookOperations handlerValidationFn + webhookOperations machineAdmissionFn decoder *admission.Decoder } -// defaulterHandler defaults Machine API resources. +// InjectDecoder injects the decoder. +func (a *admissionHandler) InjectDecoder(d *admission.Decoder) error { + a.decoder = d + return nil +} + +// machineValidatorHandler validates Machine API resources. // implements type Handler interface. // https://godoc.org/github.com/kubernetes-sigs/controller-runtime/pkg/webhook/admission#Handler -type defaulterHandler struct { - clusterID string - webhookOperations handlerMutationFn - decoder *admission.Decoder +type machineValidatorHandler struct { + *admissionHandler } -// NewValidator returns a new validatorHandler. -func NewMachineValidator() (*validatorHandler, error) { +// machineDefaulterHandler defaults Machine API resources. +// implements type Handler interface. +// https://godoc.org/github.com/kubernetes-sigs/controller-runtime/pkg/webhook/admission#Handler +type machineDefaulterHandler struct { + *admissionHandler +} + +// NewValidator returns a new machineValidatorHandler. +func NewMachineValidator() (*machineValidatorHandler, error) { infra, err := getInfra() if err != nil { return nil, err @@ -86,64 +164,76 @@ func NewMachineValidator() (*validatorHandler, error) { return createMachineValidator(infra.Status.PlatformStatus.Type, infra.Status.InfrastructureName), nil } -func createMachineValidator(platform osconfigv1.PlatformType, clusterID string) *validatorHandler { - h := &validatorHandler{ - clusterID: clusterID, +func createMachineValidator(platform osconfigv1.PlatformType, clusterID string) *machineValidatorHandler { + return &machineValidatorHandler{ + admissionHandler: &admissionHandler{ + clusterID: clusterID, + webhookOperations: getMachineValidatorOperation(platform), + }, } +} +func getMachineValidatorOperation(platform osconfigv1.PlatformType) machineAdmissionFn { switch platform { case osconfigv1.AWSPlatformType: - h.webhookOperations = validateAWS + return validateAWS + case osconfigv1.AzurePlatformType: + return validateAzure + case osconfigv1.GCPPlatformType: + return validateGCP + case osconfigv1.VSpherePlatformType: + return validateVSphere default: // just no-op - h.webhookOperations = func(h *validatorHandler, m *Machine) (bool, utilerrors.Aggregate) { + return func(m *Machine, clusterID string) (bool, utilerrors.Aggregate) { return true, nil } } - return h } -// NewDefaulter returns a new defaulterHandler. -func NewMachineDefaulter() (*defaulterHandler, error) { +// NewDefaulter returns a new machineDefaulterHandler. +func NewMachineDefaulter() (*machineDefaulterHandler, error) { infra, err := getInfra() if err != nil { return nil, err } - return createMachineDefaulter(infra.Status.PlatformStatus.Type, infra.Status.InfrastructureName), nil + return createMachineDefaulter(infra.Status.PlatformStatus, infra.Status.InfrastructureName), nil } -func createMachineDefaulter(platform osconfigv1.PlatformType, clusterID string) *defaulterHandler { - h := &defaulterHandler{ - clusterID: clusterID, +func createMachineDefaulter(platformStatus *osconfigv1.PlatformStatus, clusterID string) *machineDefaulterHandler { + return &machineDefaulterHandler{ + admissionHandler: &admissionHandler{ + clusterID: clusterID, + webhookOperations: getMachineDefaulterOperation(platformStatus), + }, } +} - switch platform { +func getMachineDefaulterOperation(platformStatus *osconfigv1.PlatformStatus) machineAdmissionFn { + switch platformStatus.Type { case osconfigv1.AWSPlatformType: - h.webhookOperations = defaultAWS + return defaultAWS + case osconfigv1.AzurePlatformType: + return defaultAzure + case osconfigv1.GCPPlatformType: + projectID := "" + if platformStatus.GCP != nil { + projectID = platformStatus.GCP.ProjectID + } + return gcpDefaulter{projectID: projectID}.defaultGCP + case osconfigv1.VSpherePlatformType: + return defaultVSphere default: // just no-op - h.webhookOperations = func(h *defaulterHandler, m *Machine) (bool, utilerrors.Aggregate) { + return func(m *Machine, clusterID string) (bool, utilerrors.Aggregate) { return true, nil } } - return h -} - -// InjectDecoder injects the decoder. -func (v *validatorHandler) InjectDecoder(d *admission.Decoder) error { - v.decoder = d - return nil -} - -// InjectDecoder injects the decoder. -func (v *defaulterHandler) InjectDecoder(d *admission.Decoder) error { - v.decoder = d - return nil } // Handle handles HTTP requests for admission webhook servers. -func (h *validatorHandler) Handle(ctx context.Context, req admission.Request) admission.Response { +func (h *machineValidatorHandler) Handle(ctx context.Context, req admission.Request) admission.Response { m := &Machine{} if err := h.decoder.Decode(req, m); err != nil { @@ -152,7 +242,7 @@ func (h *validatorHandler) Handle(ctx context.Context, req admission.Request) ad klog.V(3).Infof("Validate webhook called for Machine: %s", m.GetName()) - if ok, err := h.webhookOperations(h, m); !ok { + if ok, err := h.webhookOperations(m, h.clusterID); !ok { return admission.Denied(err.Error()) } @@ -160,7 +250,7 @@ func (h *validatorHandler) Handle(ctx context.Context, req admission.Request) ad } // Handle handles HTTP requests for admission webhook servers. -func (h *defaulterHandler) Handle(ctx context.Context, req admission.Request) admission.Response { +func (h *machineDefaulterHandler) Handle(ctx context.Context, req admission.Request) admission.Response { m := &Machine{} if err := h.decoder.Decode(req, m); err != nil { @@ -169,7 +259,7 @@ func (h *defaulterHandler) Handle(ctx context.Context, req admission.Request) ad klog.V(3).Infof("Mutate webhook called for Machine: %s", m.GetName()) - if ok, err := h.webhookOperations(h, m); !ok { + if ok, err := h.webhookOperations(m, h.clusterID); !ok { return admission.Denied(err.Error()) } @@ -180,20 +270,13 @@ func (h *defaulterHandler) Handle(ctx context.Context, req admission.Request) ad return admission.PatchResponseFromRaw(req.Object.Raw, marshaledMachine) } -func defaultAWS(h *defaulterHandler, m *Machine) (bool, utilerrors.Aggregate) { +func defaultAWS(m *Machine, clusterID string) (bool, utilerrors.Aggregate) { klog.V(3).Infof("Defaulting AWS providerSpec") var errs []error providerSpec := new(aws.AWSMachineProviderConfig) - if err := yaml.Unmarshal(m.Spec.ProviderSpec.Value.Raw, &providerSpec); err != nil { - errs = append( - errs, - field.Invalid( - field.NewPath("providerSpec", "value"), - providerSpec, - err.Error(), - ), - ) + if err := unmarshalInto(m, providerSpec); err != nil { + errs = append(errs, err) return false, utilerrors.NewAggregate(errs) } @@ -201,10 +284,10 @@ func defaultAWS(h *defaulterHandler, m *Machine) (bool, utilerrors.Aggregate) { providerSpec.InstanceType = defaultAWSInstanceType } if providerSpec.IAMInstanceProfile == nil { - providerSpec.IAMInstanceProfile = &aws.AWSResourceReference{ID: defaultAWSIAMInstanceProfile(h.clusterID)} + providerSpec.IAMInstanceProfile = &aws.AWSResourceReference{ID: defaultAWSIAMInstanceProfile(clusterID)} } if providerSpec.UserDataSecret == nil { - providerSpec.UserDataSecret = &corev1.LocalObjectReference{Name: defaultAWSUserDataSecret} + providerSpec.UserDataSecret = &corev1.LocalObjectReference{Name: defaultUserDataSecret} } if providerSpec.CredentialsSecret == nil { @@ -217,7 +300,7 @@ func defaultAWS(h *defaulterHandler, m *Machine) (bool, utilerrors.Aggregate) { Filters: []aws.Filter{ { Name: "tag:Name", - Values: []string{defaultAWSSecurityGroup(h.clusterID)}, + Values: []string{defaultAWSSecurityGroup(clusterID)}, }, }, }, @@ -228,7 +311,7 @@ func defaultAWS(h *defaulterHandler, m *Machine) (bool, utilerrors.Aggregate) { providerSpec.Subnet.Filters = []aws.Filter{ { Name: "tag:Name", - Values: []string{defaultAWSSubnet(h.clusterID, providerSpec.Placement.AvailabilityZone)}, + Values: []string{defaultAWSSubnet(clusterID, providerSpec.Placement.AvailabilityZone)}, }, } } @@ -246,20 +329,24 @@ func defaultAWS(h *defaulterHandler, m *Machine) (bool, utilerrors.Aggregate) { return true, nil } -func validateAWS(h *validatorHandler, m *Machine) (bool, utilerrors.Aggregate) { +func unmarshalInto(m *Machine, providerSpec interface{}) error { + if m.Spec.ProviderSpec.Value == nil { + return field.Required(field.NewPath("providerSpec", "value"), "a value must be provided") + } + + if err := yaml.Unmarshal(m.Spec.ProviderSpec.Value.Raw, &providerSpec); err != nil { + return field.Invalid(field.NewPath("providerSpec", "value"), providerSpec, err.Error()) + } + return nil +} + +func validateAWS(m *Machine, clusterID string) (bool, utilerrors.Aggregate) { klog.V(3).Infof("Validating AWS providerSpec") var errs []error providerSpec := new(aws.AWSMachineProviderConfig) - if err := yaml.Unmarshal(m.Spec.ProviderSpec.Value.Raw, &providerSpec); err != nil { - errs = append( - errs, - field.Invalid( - field.NewPath("providerSpec", "value"), - providerSpec, - err.Error(), - ), - ) + if err := unmarshalInto(m, providerSpec); err != nil { + errs = append(errs, err) return false, utilerrors.NewAggregate(errs) } @@ -341,3 +428,501 @@ func validateAWS(h *validatorHandler, m *Machine) (bool, utilerrors.Aggregate) { return true, nil } + +func defaultAzure(m *Machine, clusterID string) (bool, utilerrors.Aggregate) { + klog.V(3).Infof("Defaulting Azure providerSpec") + + var errs []error + providerSpec := new(azure.AzureMachineProviderSpec) + if err := unmarshalInto(m, providerSpec); err != nil { + errs = append(errs, err) + return false, utilerrors.NewAggregate(errs) + } + + if providerSpec.VMSize == "" { + providerSpec.VMSize = defaultAzureVMSize + } + + // Vnet and Subnet need to be provided together by the user + if providerSpec.Vnet == "" && providerSpec.Subnet == "" { + providerSpec.Vnet = defaultAzureVnet(clusterID) + providerSpec.Subnet = defaultAzureSubnet(clusterID) + + // NetworkResourceGroup can be set by the user without Vnet and Subnet, + // only override if they didn't set it + if providerSpec.NetworkResourceGroup == "" { + providerSpec.NetworkResourceGroup = defaultAzureNetworkResourceGroup(clusterID) + } + } + + if providerSpec.Image == (azure.Image{}) { + providerSpec.Image.ResourceID = defaultAzureImageResourceID(clusterID) + } + + if providerSpec.ManagedIdentity == "" { + providerSpec.ManagedIdentity = defaultAzureManagedIdentiy(clusterID) + } + + if providerSpec.ResourceGroup == "" { + providerSpec.ResourceGroup = defaultAzureResourceGroup(clusterID) + } + + if providerSpec.UserDataSecret == nil { + providerSpec.UserDataSecret = &corev1.SecretReference{Name: defaultUserDataSecret} + } else if providerSpec.UserDataSecret.Name == "" { + providerSpec.UserDataSecret.Name = defaultUserDataSecret + } + + if providerSpec.CredentialsSecret == nil { + providerSpec.CredentialsSecret = &corev1.SecretReference{Name: defaultAzureCredentialsSecret, Namespace: defaultSecretNamespace} + } else { + if providerSpec.CredentialsSecret.Namespace == "" { + providerSpec.CredentialsSecret.Namespace = defaultSecretNamespace + } + if providerSpec.CredentialsSecret.Name == "" { + providerSpec.CredentialsSecret.Name = defaultAzureCredentialsSecret + } + } + + if providerSpec.OSDisk.OSType == "" { + providerSpec.OSDisk.OSType = defaultAzureOSDiskOSType + } + + if providerSpec.OSDisk.ManagedDisk.StorageAccountType == "" { + providerSpec.OSDisk.ManagedDisk.StorageAccountType = defaultAzureOSDiskStorageType + } + + rawBytes, err := json.Marshal(providerSpec) + if err != nil { + errs = append(errs, err) + } + + if len(errs) > 0 { + return false, utilerrors.NewAggregate(errs) + } + + m.Spec.ProviderSpec.Value = &runtime.RawExtension{Raw: rawBytes} + return true, nil +} + +func validateAzure(m *Machine, clusterID string) (bool, utilerrors.Aggregate) { + klog.V(3).Infof("Validating Azure providerSpec") + + var errs []error + providerSpec := new(azure.AzureMachineProviderSpec) + if err := unmarshalInto(m, providerSpec); err != nil { + errs = append(errs, err) + return false, utilerrors.NewAggregate(errs) + } + + if providerSpec.Location == "" { + errs = append(errs, field.Required(field.NewPath("providerSpec", "location"), "location should be set to one of the supported Azure regions")) + } + + if providerSpec.VMSize == "" { + errs = append(errs, field.Required(field.NewPath("providerSpec", "vmSize"), "vmSize should be set to one of the supported Azure VM sizes")) + } + + // Vnet requires Subnet + if providerSpec.Vnet != "" && providerSpec.Subnet == "" { + errs = append(errs, field.Required(field.NewPath("providerSpec", "subnet"), "must provide a subnet when a virtual network is specified")) + } + + // Subnet requires Vnet + if providerSpec.Subnet != "" && providerSpec.Vnet == "" { + errs = append(errs, field.Required(field.NewPath("providerSpec", "vnet"), "must provide a virtual network when supplying subnets")) + } + + // Vnet + Subnet requires NetworkResourceGroup + if (providerSpec.Vnet != "" || providerSpec.Subnet != "") && providerSpec.NetworkResourceGroup == "" { + errs = append(errs, field.Required(field.NewPath("providerSpec", "networkResourceGroup"), "must provide a network resource group when a virtual network or subnet is specified")) + } + + errs = append(errs, validateAzureImage(providerSpec.Image)...) + + if providerSpec.ManagedIdentity == "" { + errs = append(errs, field.Required(field.NewPath("providerSpec", "managedIdentity"), "managedIdentity must be provided")) + } + + if providerSpec.ResourceGroup == "" { + errs = append(errs, field.Required(field.NewPath("providerSpec", "resourceGroup"), "resourceGroup must be provided")) + } + + if providerSpec.UserDataSecret == nil { + errs = append(errs, field.Required(field.NewPath("providerSpec", "userDataSecret"), "userDataSecret must be provided")) + } else if providerSpec.UserDataSecret.Name == "" { + errs = append(errs, field.Required(field.NewPath("providerSpec", "userDataSecret", "name"), "name must be provided")) + } + + if providerSpec.CredentialsSecret == nil { + errs = append(errs, field.Required(field.NewPath("providerSpec", "credentialsSecret"), "credentialsSecret must be provided")) + } else { + if providerSpec.CredentialsSecret.Namespace == "" { + errs = append(errs, field.Required(field.NewPath("providerSpec", "credentialsSecret", "namespace"), "namespace must be provided")) + } + if providerSpec.CredentialsSecret.Name == "" { + errs = append(errs, field.Required(field.NewPath("providerSpec", "credentialsSecret", "name"), "name must be provided")) + } + } + + if providerSpec.OSDisk.DiskSizeGB <= 0 { + errs = append(errs, field.Invalid(field.NewPath("providerSpec", "osDisk", "diskSizeGB"), providerSpec.OSDisk.DiskSizeGB, "diskSizeGB must be greater than zero")) + } + + if providerSpec.OSDisk.OSType == "" { + errs = append(errs, field.Required(field.NewPath("providerSpec", "osDisk", "osType"), "osType must be provided")) + } + if providerSpec.OSDisk.ManagedDisk.StorageAccountType == "" { + errs = append(errs, field.Required(field.NewPath("providerSpec", "osDisk", "managedDisk", "storageAccountType"), "storageAccountType must be provided")) + } + + if len(errs) > 0 { + return false, utilerrors.NewAggregate(errs) + } + return true, nil +} + +func validateAzureImage(image azure.Image) []error { + errors := []error{} + if image == (azure.Image{}) { + return append(errors, field.Required(field.NewPath("providerSpec", "image"), "an image reference must be provided")) + } + + if image.ResourceID != "" { + if image != (azure.Image{ResourceID: image.ResourceID}) { + return append(errors, field.Required(field.NewPath("providerSpec", "image", "resourceID"), "resourceID is already specified, other fields such as [Offer, Publisher, SKU, Version] should not be set")) + } + return errors + } + + // Resource ID not provided, so Offer, Publisher, SKU and Version are required + if image.Offer == "" { + errors = append(errors, field.Required(field.NewPath("providerSpec", "image", "Offer"), "Offer must be provided")) + } + if image.Publisher == "" { + errors = append(errors, field.Required(field.NewPath("providerSpec", "image", "Publisher"), "Publisher must be provided")) + } + if image.SKU == "" { + errors = append(errors, field.Required(field.NewPath("providerSpec", "image", "SKU"), "SKU must be provided")) + } + if image.Version == "" { + errors = append(errors, field.Required(field.NewPath("providerSpec", "image", "Version"), "Version must be provided")) + } + + return errors +} + +type gcpDefaulter struct { + projectID string +} + +func (g gcpDefaulter) defaultGCP(m *Machine, clusterID string) (bool, utilerrors.Aggregate) { + klog.V(3).Infof("Defaulting GCP providerSpec") + + var errs []error + providerSpec := new(gcp.GCPMachineProviderSpec) + if err := unmarshalInto(m, providerSpec); err != nil { + errs = append(errs, err) + return false, utilerrors.NewAggregate(errs) + } + + if providerSpec.MachineType == "" { + providerSpec.MachineType = defaultGCPMachineType + } + + if len(providerSpec.NetworkInterfaces) == 0 { + providerSpec.NetworkInterfaces = append(providerSpec.NetworkInterfaces, &gcp.GCPNetworkInterface{ + Network: defaultGCPNetwork(clusterID), + Subnetwork: defaultGCPSubnetwork(clusterID), + }) + } + + providerSpec.Disks = defaultGCPDisks(providerSpec.Disks, clusterID) + + if len(providerSpec.Tags) == 0 { + providerSpec.Tags = defaultGCPTags(clusterID) + } + + if providerSpec.UserDataSecret == nil { + providerSpec.UserDataSecret = &corev1.LocalObjectReference{Name: defaultUserDataSecret} + } + + if providerSpec.CredentialsSecret == nil { + providerSpec.CredentialsSecret = &corev1.LocalObjectReference{Name: defaultGCPCredentialsSecret} + } + + if len(providerSpec.ServiceAccounts) == 0 { + providerSpec.ServiceAccounts = defaultGCPServiceAccounts(clusterID, g.projectID) + } + + rawBytes, err := json.Marshal(providerSpec) + if err != nil { + errs = append(errs, err) + } + + if len(errs) > 0 { + return false, utilerrors.NewAggregate(errs) + } + + m.Spec.ProviderSpec.Value = &runtime.RawExtension{Raw: rawBytes} + return true, nil +} + +func defaultGCPDisks(disks []*gcp.GCPDisk, clusterID string) []*gcp.GCPDisk { + if len(disks) == 0 { + return []*gcp.GCPDisk{ + { + AutoDelete: true, + Boot: true, + SizeGb: defaultGCPDiskSizeGb, + Type: defaultGCPDiskType, + Image: defaultGCPDiskImage(clusterID), + }, + } + } + + for _, disk := range disks { + if disk.Type == "" { + disk.Type = defaultGCPDiskType + } + + if disk.Image == "" { + disk.Image = defaultGCPDiskImage(clusterID) + } + } + + return disks +} + +func validateGCP(m *Machine, clusterID string) (bool, utilerrors.Aggregate) { + klog.V(3).Infof("Validating GCP providerSpec") + + var errs []error + providerSpec := new(gcp.GCPMachineProviderSpec) + if err := unmarshalInto(m, providerSpec); err != nil { + errs = append(errs, err) + return false, utilerrors.NewAggregate(errs) + } + + if providerSpec.Region == "" { + errs = append(errs, field.Required(field.NewPath("providerSpec", "region"), "region is required")) + } + + if !strings.HasPrefix(providerSpec.Zone, providerSpec.Region) { + errs = append(errs, field.Invalid(field.NewPath("providerSpec", "zone"), providerSpec.Zone, fmt.Sprintf("zone not in configured region (%s)", providerSpec.Region))) + } + + if providerSpec.MachineType == "" { + errs = append(errs, field.Required(field.NewPath("providerSpec", "machineType"), "machineType should be set to one of the supported GCP machine types")) + } + + errs = append(errs, validateGCPNetworkInterfaces(providerSpec.NetworkInterfaces, field.NewPath("providerSpec", "networkInterfaces"))...) + errs = append(errs, validateGCPDisks(providerSpec.Disks, field.NewPath("providerSpec", "disks"))...) + errs = append(errs, validateGCPServiceAccounts(providerSpec.ServiceAccounts, field.NewPath("providerSpec", "serviceAccounts"))...) + + if providerSpec.UserDataSecret == nil { + errs = append(errs, field.Required(field.NewPath("providerSpec", "userDataSecret"), "userDataSecret must be provided")) + } else { + if providerSpec.UserDataSecret.Name == "" { + errs = append(errs, field.Required(field.NewPath("providerSpec", "userDataSecret", "name"), "name must be provided")) + } + } + + if providerSpec.CredentialsSecret == nil { + errs = append(errs, field.Required(field.NewPath("providerSpec", "credentialsSecret"), "credentialsSecret must be provided")) + } else { + if providerSpec.CredentialsSecret.Name == "" { + errs = append(errs, field.Required(field.NewPath("providerSpec", "credentialsSecret", "name"), "name must be provided")) + } + } + + if len(errs) > 0 { + return false, utilerrors.NewAggregate(errs) + } + return true, nil +} + +func validateGCPNetworkInterfaces(networkInterfaces []*gcp.GCPNetworkInterface, parentPath *field.Path) []error { + if len(networkInterfaces) == 0 { + return []error{field.Required(parentPath, "at least 1 network interface is required")} + } + + var errs []error + for i, ni := range networkInterfaces { + fldPath := parentPath.Index(i) + + if ni.Network == "" { + errs = append(errs, field.Required(fldPath.Child("network"), "network is required")) + } + + if ni.Subnetwork == "" { + errs = append(errs, field.Required(fldPath.Child("subnetwork"), "subnetwork is required")) + } + } + + return errs +} + +func validateGCPDisks(disks []*gcp.GCPDisk, parentPath *field.Path) []error { + if len(disks) == 0 { + return []error{field.Required(parentPath, "at least 1 disk is required")} + } + + var errs []error + for i, disk := range disks { + fldPath := parentPath.Index(i) + + if disk.SizeGb != 0 { + if disk.SizeGb < 16 { + errs = append(errs, field.Invalid(fldPath.Child("sizeGb"), disk.SizeGb, "must be at least 16GB in size")) + } else if disk.SizeGb > 65536 { + errs = append(errs, field.Invalid(fldPath.Child("sizeGb"), disk.SizeGb, "exceeding maximum GCP disk size limit, must be below 65536")) + } + } + + if disk.Type != "" { + diskTypes := sets.NewString("pd-standard", "pd-ssd") + if !diskTypes.Has(disk.Type) { + errs = append(errs, field.NotSupported(fldPath.Child("type"), disk.Type, diskTypes.List())) + } + } + } + + return errs +} + +func validateGCPServiceAccounts(serviceAccounts []gcp.GCPServiceAccount, parentPath *field.Path) []error { + if len(serviceAccounts) != 1 { + return []error{field.Invalid(parentPath, fmt.Sprintf("%d service accounts supplied", len(serviceAccounts)), "exactly 1 service account must be supplied")} + } + + var errs []error + for i, serviceAccount := range serviceAccounts { + fldPath := parentPath.Index(i) + + if serviceAccount.Email == "" { + errs = append(errs, field.Required(fldPath.Child("email"), "email is required")) + } + + if len(serviceAccount.Scopes) == 0 { + errs = append(errs, field.Required(fldPath.Child("scopes"), "at least 1 scope is required")) + } + } + return errs +} + +func defaultVSphere(m *Machine, clusterID string) (bool, utilerrors.Aggregate) { + klog.V(3).Infof("Defaulting vSphere providerSpec") + + var errs []error + providerSpec := new(vsphere.VSphereMachineProviderSpec) + if err := unmarshalInto(m, providerSpec); err != nil { + errs = append(errs, err) + return false, utilerrors.NewAggregate(errs) + } + + if providerSpec.UserDataSecret == nil { + providerSpec.UserDataSecret = &corev1.LocalObjectReference{Name: defaultUserDataSecret} + } + + if providerSpec.CredentialsSecret == nil { + providerSpec.CredentialsSecret = &corev1.LocalObjectReference{Name: defaultVSphereCredentialsSecret} + } + + rawBytes, err := json.Marshal(providerSpec) + if err != nil { + errs = append(errs, err) + } + + if len(errs) > 0 { + return false, utilerrors.NewAggregate(errs) + } + + m.Spec.ProviderSpec.Value = &runtime.RawExtension{Raw: rawBytes} + return true, nil +} + +func validateVSphere(m *Machine, clusterID string) (bool, utilerrors.Aggregate) { + klog.V(3).Infof("Validating vSphere providerSpec") + + var errs []error + providerSpec := new(vsphere.VSphereMachineProviderSpec) + if err := unmarshalInto(m, providerSpec); err != nil { + errs = append(errs, err) + return false, utilerrors.NewAggregate(errs) + } + + if providerSpec.Template == "" { + errs = append(errs, field.Required(field.NewPath("providerSpec", "template"), "template must be provided")) + } + + errs = append(errs, validateVSphereWorkspace(providerSpec.Workspace, field.NewPath("providerSpec", "workspace"))...) + errs = append(errs, validateVSphereNetwork(providerSpec.Network, field.NewPath("providerSpec", "network"))...) + + if providerSpec.NumCPUs != 0 && providerSpec.NumCPUs < minVSphereCPU { + errs = append(errs, field.Invalid(field.NewPath("providerSpec", "numCPUs"), providerSpec.NumCPUs, fmt.Sprintf("numCPUs is below minimum value (%d)", minVSphereCPU))) + } + if providerSpec.MemoryMiB != 0 && providerSpec.MemoryMiB < minVSphereMemoryMiB { + errs = append(errs, field.Invalid(field.NewPath("providerSpec", "memoryMiB"), providerSpec.MemoryMiB, fmt.Sprintf("memoryMiB is below minimum value (%d)", minVSphereMemoryMiB))) + } + + if providerSpec.UserDataSecret == nil { + errs = append(errs, field.Required(field.NewPath("providerSpec", "userDataSecret"), "userDataSecret must be provided")) + } else { + if providerSpec.UserDataSecret.Name == "" { + errs = append(errs, field.Required(field.NewPath("providerSpec", "userDataSecret", "name"), "name must be provided")) + } + } + + if providerSpec.CredentialsSecret == nil { + errs = append(errs, field.Required(field.NewPath("providerSpec", "credentialsSecret"), "credentialsSecret must be provided")) + } else { + if providerSpec.CredentialsSecret.Name == "" { + errs = append(errs, field.Required(field.NewPath("providerSpec", "credentialsSecret", "name"), "name must be provided")) + } + } + + if len(errs) > 0 { + return false, utilerrors.NewAggregate(errs) + } + return true, nil +} + +func validateVSphereWorkspace(workspace *vsphere.Workspace, parentPath *field.Path) []error { + if workspace == nil { + return []error{field.Required(parentPath, "workspace must be provided")} + } + + var errs []error + if workspace.Server == "" { + errs = append(errs, field.Required(parentPath.Child("server"), "server must be provided")) + } + if workspace.Datacenter == "" { + errs = append(errs, field.Required(parentPath.Child("datacenter"), "datacenter must be provided")) + } + if workspace.Folder != "" { + expectedPrefix := fmt.Sprintf("/%s/vm/", workspace.Datacenter) + if !strings.HasPrefix(workspace.Folder, expectedPrefix) { + errMsg := fmt.Sprintf("folder must be absolute path: expected prefix %q", expectedPrefix) + errs = append(errs, field.Invalid(parentPath.Child("folder"), workspace.Folder, errMsg)) + } + } + + return errs +} + +func validateVSphereNetwork(network vsphere.NetworkSpec, parentPath *field.Path) []error { + if len(network.Devices) == 0 { + return []error{field.Required(parentPath.Child("devices"), "at least 1 network device must be provided")} + } + + var errs []error + for i, spec := range network.Devices { + fldPath := parentPath.Child("devices").Index(i) + if spec.NetworkName == "" { + errs = append(errs, field.Required(fldPath.Child("networkName"), "networkName must be provided")) + } + } + + return errs +} diff --git a/vendor/github.com/openshift/machine-api-operator/pkg/apis/machine/v1beta1/machineset_webhook.go b/vendor/github.com/openshift/machine-api-operator/pkg/apis/machine/v1beta1/machineset_webhook.go new file mode 100644 index 0000000000..595f406028 --- /dev/null +++ b/vendor/github.com/openshift/machine-api-operator/pkg/apis/machine/v1beta1/machineset_webhook.go @@ -0,0 +1,135 @@ +package v1beta1 + +import ( + "context" + "encoding/json" + "net/http" + + osconfigv1 "github.com/openshift/api/config/v1" + utilerrors "k8s.io/apimachinery/pkg/util/errors" + "k8s.io/klog" + "sigs.k8s.io/controller-runtime/pkg/webhook/admission" +) + +// machineSetValidatorHandler validates MachineSet API resources. +// implements type Handler interface. +// https://godoc.org/github.com/kubernetes-sigs/controller-runtime/pkg/webhook/admission#Handler +type machineSetValidatorHandler struct { + *admissionHandler +} + +// machineSetDefaulterHandler defaults MachineSet API resources. +// implements type Handler interface. +// https://godoc.org/github.com/kubernetes-sigs/controller-runtime/pkg/webhook/admission#Handler +type machineSetDefaulterHandler struct { + *admissionHandler +} + +// NewMachineSetValidator returns a new machineSetValidatorHandler. +func NewMachineSetValidator() (*machineSetValidatorHandler, error) { + infra, err := getInfra() + if err != nil { + return nil, err + } + + return createMachineSetValidator(infra.Status.PlatformStatus.Type, infra.Status.InfrastructureName), nil +} + +func createMachineSetValidator(platform osconfigv1.PlatformType, clusterID string) *machineSetValidatorHandler { + return &machineSetValidatorHandler{ + admissionHandler: &admissionHandler{ + clusterID: clusterID, + webhookOperations: getMachineValidatorOperation(platform), + }, + } +} + +// NewMachineSetDefaulter returns a new machineSetDefaulterHandler. +func NewMachineSetDefaulter() (*machineSetDefaulterHandler, error) { + infra, err := getInfra() + if err != nil { + return nil, err + } + + return createMachineSetDefaulter(infra.Status.PlatformStatus, infra.Status.InfrastructureName), nil +} + +func createMachineSetDefaulter(platformStatus *osconfigv1.PlatformStatus, clusterID string) *machineSetDefaulterHandler { + return &machineSetDefaulterHandler{ + admissionHandler: &admissionHandler{ + clusterID: clusterID, + webhookOperations: getMachineDefaulterOperation(platformStatus), + }, + } +} + +// Handle handles HTTP requests for admission webhook servers. +func (h *machineSetValidatorHandler) Handle(ctx context.Context, req admission.Request) admission.Response { + ms := &MachineSet{} + + if err := h.decoder.Decode(req, ms); err != nil { + return admission.Errored(http.StatusBadRequest, err) + } + + klog.V(3).Infof("Validate webhook called for MachineSet: %s", ms.GetName()) + + if ok, err := h.validateMachineSet(ms); !ok { + return admission.Denied(err.Error()) + } + + return admission.Allowed("MachineSet valid") +} + +// Handle handles HTTP requests for admission webhook servers. +func (h *machineSetDefaulterHandler) Handle(ctx context.Context, req admission.Request) admission.Response { + ms := &MachineSet{} + + if err := h.decoder.Decode(req, ms); err != nil { + return admission.Errored(http.StatusBadRequest, err) + } + + klog.V(3).Infof("Mutate webhook called for MachineSet: %s", ms.GetName()) + + if ok, err := h.defaultMachineSet(ms); !ok { + return admission.Denied(err.Error()) + } + + marshaledMachineSet, err := json.Marshal(ms) + if err != nil { + return admission.Errored(http.StatusInternalServerError, err) + } + return admission.PatchResponseFromRaw(req.Object.Raw, marshaledMachineSet) +} + +func (h *machineSetValidatorHandler) validateMachineSet(ms *MachineSet) (bool, utilerrors.Aggregate) { + var errs []error + + // Create a Machine from the MachineSet and validate the Machine template + m := &Machine{Spec: ms.Spec.Template.Spec} + if ok, err := h.webhookOperations(m, h.clusterID); !ok { + errs = append(errs, err.Errors()...) + } + + if len(errs) > 0 { + return false, utilerrors.NewAggregate(errs) + } + return true, nil +} + +func (h *machineSetDefaulterHandler) defaultMachineSet(ms *MachineSet) (bool, utilerrors.Aggregate) { + var errs []error + + // Create a Machine from the MachineSet and default the Machine template + m := &Machine{Spec: ms.Spec.Template.Spec} + if ok, err := h.webhookOperations(m, h.clusterID); !ok { + errs = append(errs, err.Errors()...) + } else { + // Restore the defaulted template + ms.Spec.Template.Spec = m.Spec + } + + if len(errs) > 0 { + return false, utilerrors.NewAggregate(errs) + } + return true, nil +} diff --git a/vendor/github.com/openshift/machine-api-operator/pkg/apis/vsphereprovider/v1beta1/doc.go b/vendor/github.com/openshift/machine-api-operator/pkg/apis/vsphereprovider/v1beta1/doc.go new file mode 100644 index 0000000000..d59eebf3d6 --- /dev/null +++ b/vendor/github.com/openshift/machine-api-operator/pkg/apis/vsphereprovider/v1beta1/doc.go @@ -0,0 +1,7 @@ +// Package v1beta1 contains API Schema definitions for the vsphereprovider v1beta1 API group +// +k8s:openapi-gen=true +// +k8s:deepcopy-gen=package,register +// +k8s:conversion-gen=github.com/openshift/machine-api-operator/pkg/apis/vsphereprovider +// +k8s:defaulter-gen=TypeMeta +// +groupName=vsphereprovider.machine.openshift.io +package v1beta1 diff --git a/vendor/github.com/openshift/machine-api-operator/pkg/apis/vsphereprovider/v1beta1/register.go b/vendor/github.com/openshift/machine-api-operator/pkg/apis/vsphereprovider/v1beta1/register.go new file mode 100644 index 0000000000..04fb4543fc --- /dev/null +++ b/vendor/github.com/openshift/machine-api-operator/pkg/apis/vsphereprovider/v1beta1/register.go @@ -0,0 +1,90 @@ +// Package v1beta1 contains API Schema definitions for the vsphereprovider v1beta1 API group +// +k8s:openapi-gen=true +// +k8s:deepcopy-gen=package,register +// +k8s:conversion-gen=github.com/openshift/machine-api-operator/pkg/apis/vsphereprovider +// +k8s:defaulter-gen=TypeMeta +// +groupName=vsphereprovider.machine.openshift.io +package v1beta1 + +import ( + "encoding/json" + "fmt" + + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/schema" + "k8s.io/klog" + "sigs.k8s.io/controller-runtime/pkg/scheme" + "sigs.k8s.io/yaml" +) + +var ( + // SchemeGroupVersion is group version used to register these objects + SchemeGroupVersion = schema.GroupVersion{Group: "vsphereprovider.openshift.io", Version: "v1beta1"} + + // SchemeBuilder is used to add go types to the GroupVersionKind scheme + SchemeBuilder = &scheme.Builder{GroupVersion: SchemeGroupVersion} +) + +// RawExtensionFromProviderSpec marshals the machine provider spec. +func RawExtensionFromProviderSpec(spec *VSphereMachineProviderSpec) (*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 provider status +func RawExtensionFromProviderStatus(status *VSphereMachineProviderStatus) (*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 the JSON-encoded spec +func ProviderSpecFromRawExtension(rawExtension *runtime.RawExtension) (*VSphereMachineProviderSpec, error) { + if rawExtension == nil { + return &VSphereMachineProviderSpec{}, nil + } + + spec := new(VSphereMachineProviderSpec) + 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 a VSphereMachineProviderStatus type +func ProviderStatusFromRawExtension(rawExtension *runtime.RawExtension) (*VSphereMachineProviderStatus, error) { + if rawExtension == nil { + return &VSphereMachineProviderStatus{}, nil + } + + providerStatus := new(VSphereMachineProviderStatus) + 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-operator/pkg/apis/vsphereprovider/v1beta1/vsphereproviderconfig_types.go b/vendor/github.com/openshift/machine-api-operator/pkg/apis/vsphereprovider/v1beta1/vsphereproviderconfig_types.go new file mode 100644 index 0000000000..68682cd1d3 --- /dev/null +++ b/vendor/github.com/openshift/machine-api-operator/pkg/apis/vsphereprovider/v1beta1/vsphereproviderconfig_types.go @@ -0,0 +1,128 @@ +package v1beta1 + +import ( + corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// +genclient +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// VSphereMachineProviderSpec is the type that will be embedded in a Machine.Spec.ProviderSpec field +// for an VSphere virtual machine. It is used by the vSphere machine actuator to create a single Machine. +// +k8s:openapi-gen=true +type VSphereMachineProviderSpec struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + // UserDataSecret contains a local reference to a secret that contains the + // UserData to apply to the instance + UserDataSecret *corev1.LocalObjectReference `json:"userDataSecret,omitempty"` + + // CredentialsSecret is a reference to the secret with vSphere credentials. + CredentialsSecret *corev1.LocalObjectReference `json:"credentialsSecret,omitempty"` + + // Template is the name, inventory path, or instance UUID of the template + // used to clone new machines. + Template string `json:"template"` + + Workspace *Workspace `json:"workspace,omitempty"` + + // Network is the network configuration for this machine's VM. + Network NetworkSpec `json:"network"` + + // NumCPUs is the number of virtual processors in a virtual machine. + // Defaults to the analogue property value in the template from which this + // machine is cloned. + // +optional + NumCPUs int32 `json:"numCPUs,omitempty"` + // NumCPUs is the number of cores among which to distribute CPUs in this + // virtual machine. + // Defaults to the analogue property value in the template from which this + // machine is cloned. + // +optional + NumCoresPerSocket int32 `json:"numCoresPerSocket,omitempty"` + // MemoryMiB is the size of a virtual machine's memory, in MiB. + // Defaults to the analogue property value in the template from which this + // machine is cloned. + // +optional + MemoryMiB int64 `json:"memoryMiB,omitempty"` + // DiskGiB is the size of a virtual machine's disk, in GiB. + // Defaults to the analogue property value in the template from which this + // machine is cloned. + // +optional + DiskGiB int32 `json:"diskGiB,omitempty"` + // Snapshot is the name of the snapshot from which the VM was cloned + // +optional + Snapshot string `json:"snapshot"` + + // CloneMode specifies the type of clone operation. + // The LinkedClone mode is only support for templates that have at least + // one snapshot. If the template has no snapshots, then CloneMode defaults + // to FullClone. + // When LinkedClone mode is enabled the DiskGiB field is ignored as it is + // not possible to expand disks of linked clones. + // Defaults to LinkedClone, but fails gracefully to FullClone if the source + // of the clone operation has no snapshots. + // +optional + CloneMode CloneMode `json:"cloneMode,omitempty"` +} + +// CloneMode is the type of clone operation used to clone a VM from a template. +type CloneMode string + +const ( + // FullClone indicates a VM will have no relationship to the source of the + // clone operation once the operation is complete. This is the safest clone + // mode, but it is not the fastest. + FullClone CloneMode = "fullClone" + + // LinkedClone means resulting VMs will be dependent upon the snapshot of + // the source VM/template from which the VM was cloned. This is the fastest + // clone mode, but it also prevents expanding a VMs disk beyond the size of + // the source VM/template. + LinkedClone CloneMode = "linkedClone" +) + +// NetworkSpec defines the virtual machine's network configuration. +type NetworkSpec struct { + Devices []NetworkDeviceSpec `json:"devices"` +} + +// NetworkDeviceSpec defines the network configuration for a virtual machine's +// network device. +type NetworkDeviceSpec struct { + // NetworkName is the name of the vSphere network to which the device + // will be connected. + NetworkName string `json:"networkName"` +} + +// WorkspaceConfig defines a workspace configuration for the vSphere cloud +// provider. +type Workspace struct { + // Server is the IP address or FQDN of the vSphere endpoint. + // +optional + Server string `gcfg:"server,omitempty" json:"server,omitempty"` + + // Datacenter is the datacenter in which VMs are created/located. + // +optional + Datacenter string `gcfg:"datacenter,omitempty" json:"datacenter,omitempty"` + + // Folder is the folder in which VMs are created/located. + // +optional + Folder string `gcfg:"folder,omitempty" json:"folder,omitempty"` + + // Datastore is the datastore in which VMs are created/located. + // +optional + Datastore string `gcfg:"default-datastore,omitempty" json:"datastore,omitempty"` + + // ResourcePool is the resource pool in which VMs are created/located. + // +optional + ResourcePool string `gcfg:"resourcepool-path,omitempty" json:"resourcePool,omitempty"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +func init() { + SchemeBuilder.Register(&VSphereMachineProviderSpec{}) +} diff --git a/vendor/github.com/openshift/machine-api-operator/pkg/apis/vsphereprovider/v1beta1/vsphereproviderstatus_types.go b/vendor/github.com/openshift/machine-api-operator/pkg/apis/vsphereprovider/v1beta1/vsphereproviderstatus_types.go new file mode 100644 index 0000000000..ccffbb367e --- /dev/null +++ b/vendor/github.com/openshift/machine-api-operator/pkg/apis/vsphereprovider/v1beta1/vsphereproviderstatus_types.go @@ -0,0 +1,83 @@ +package v1beta1 + +import ( + corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// VSphereMachineProviderConditionType is a valid value for VSphereMachineProviderCondition.Type. +type VSphereMachineProviderConditionType string + +// Valid conditions for an vSphere 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 VSphereMachineProviderConditionType = "MachineCreation" +) + +// VSphereMachineProviderConditionReason is reason for the condition's last transition. +type VSphereMachineProviderConditionReason string + +const ( + // MachineCreationSucceeded indicates machine creation success. + MachineCreationSucceeded VSphereMachineProviderConditionReason = "MachineCreationSucceeded" + // MachineCreationFailed indicates machine creation failure. + MachineCreationFailed VSphereMachineProviderConditionReason = "MachineCreationFailed" +) + +// VSphereMachineProviderCondition is a condition in a VSphereMachineProviderStatus. +type VSphereMachineProviderCondition struct { + // Type is the type of the condition. + Type VSphereMachineProviderConditionType `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 VSphereMachineProviderConditionReason `json:"reason,omitempty"` + // Message is a human-readable message indicating details about last transition. + // +optional + Message string `json:"message,omitempty"` +} + +// +genclient +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// VSphereMachineProviderStatus is the type that will be embedded in a Machine.Status.ProviderStatus field. +// It contains VSphere-specific status information. +// +k8s:openapi-gen=true +type VSphereMachineProviderStatus struct { + metav1.TypeMeta `json:",inline"` + + // TODO: populate what we need here: + // InstanceID is the ID of the instance in VSphere + // +optional + InstanceID *string `json:"instanceId,omitempty"` + + // InstanceState is the provisioning state of the VSphere Instance. + // +optional + InstanceState *string `json:"instanceState,omitempty"` + // + // TaskRef? + // Ready? + // Conditions is a set of conditions associated with the Machine to indicate + // errors or other status + Conditions []VSphereMachineProviderCondition `json:"conditions,omitempty"` + + // TaskRef is a managed object reference to a Task related to the machine. + // This value is set automatically at runtime and should not be set or + // modified by users. + // +optional + TaskRef string `json:"taskRef,omitempty"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +func init() { + SchemeBuilder.Register(&VSphereMachineProviderStatus{}) +} diff --git a/vendor/github.com/openshift/machine-api-operator/pkg/apis/vsphereprovider/v1beta1/zz_generated.deepcopy.go b/vendor/github.com/openshift/machine-api-operator/pkg/apis/vsphereprovider/v1beta1/zz_generated.deepcopy.go new file mode 100644 index 0000000000..36ab434bcb --- /dev/null +++ b/vendor/github.com/openshift/machine-api-operator/pkg/apis/vsphereprovider/v1beta1/zz_generated.deepcopy.go @@ -0,0 +1,176 @@ +// +build !ignore_autogenerated + +/* + * 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. + * + * Copyright 2019 Red Hat, Inc. + * + */ + +// Code generated by controller-gen. DO NOT EDIT. + +package v1beta1 + +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 *NetworkDeviceSpec) DeepCopyInto(out *NetworkDeviceSpec) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NetworkDeviceSpec. +func (in *NetworkDeviceSpec) DeepCopy() *NetworkDeviceSpec { + if in == nil { + return nil + } + out := new(NetworkDeviceSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NetworkSpec) DeepCopyInto(out *NetworkSpec) { + *out = *in + if in.Devices != nil { + in, out := &in.Devices, &out.Devices + *out = make([]NetworkDeviceSpec, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NetworkSpec. +func (in *NetworkSpec) DeepCopy() *NetworkSpec { + if in == nil { + return nil + } + out := new(NetworkSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VSphereMachineProviderCondition) DeepCopyInto(out *VSphereMachineProviderCondition) { + *out = *in + in.LastProbeTime.DeepCopyInto(&out.LastProbeTime) + in.LastTransitionTime.DeepCopyInto(&out.LastTransitionTime) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VSphereMachineProviderCondition. +func (in *VSphereMachineProviderCondition) DeepCopy() *VSphereMachineProviderCondition { + if in == nil { + return nil + } + out := new(VSphereMachineProviderCondition) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VSphereMachineProviderSpec) DeepCopyInto(out *VSphereMachineProviderSpec) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + 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 + } + if in.Workspace != nil { + in, out := &in.Workspace, &out.Workspace + *out = new(Workspace) + **out = **in + } + in.Network.DeepCopyInto(&out.Network) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VSphereMachineProviderSpec. +func (in *VSphereMachineProviderSpec) DeepCopy() *VSphereMachineProviderSpec { + if in == nil { + return nil + } + out := new(VSphereMachineProviderSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *VSphereMachineProviderSpec) 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 *VSphereMachineProviderStatus) DeepCopyInto(out *VSphereMachineProviderStatus) { + *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([]VSphereMachineProviderCondition, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VSphereMachineProviderStatus. +func (in *VSphereMachineProviderStatus) DeepCopy() *VSphereMachineProviderStatus { + if in == nil { + return nil + } + out := new(VSphereMachineProviderStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *VSphereMachineProviderStatus) 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 *Workspace) DeepCopyInto(out *Workspace) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Workspace. +func (in *Workspace) DeepCopy() *Workspace { + if in == nil { + return nil + } + out := new(Workspace) + in.DeepCopyInto(out) + return out +} diff --git a/vendor/github.com/openshift/machine-api-operator/pkg/generated/clientset/versioned/clientset.go b/vendor/github.com/openshift/machine-api-operator/pkg/generated/clientset/versioned/clientset.go new file mode 100644 index 0000000000..07b9a63358 --- /dev/null +++ b/vendor/github.com/openshift/machine-api-operator/pkg/generated/clientset/versioned/clientset.go @@ -0,0 +1,97 @@ +/* + * 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. + * + * Copyright 2019 Red Hat, Inc. + * + */ +// Code generated by client-gen. DO NOT EDIT. + +package versioned + +import ( + "fmt" + + machinev1beta1 "github.com/openshift/machine-api-operator/pkg/generated/clientset/versioned/typed/machine/v1beta1" + discovery "k8s.io/client-go/discovery" + rest "k8s.io/client-go/rest" + flowcontrol "k8s.io/client-go/util/flowcontrol" +) + +type Interface interface { + Discovery() discovery.DiscoveryInterface + MachineV1beta1() machinev1beta1.MachineV1beta1Interface +} + +// Clientset contains the clients for groups. Each group has exactly one +// version included in a Clientset. +type Clientset struct { + *discovery.DiscoveryClient + machineV1beta1 *machinev1beta1.MachineV1beta1Client +} + +// MachineV1beta1 retrieves the MachineV1beta1Client +func (c *Clientset) MachineV1beta1() machinev1beta1.MachineV1beta1Interface { + return c.machineV1beta1 +} + +// Discovery retrieves the DiscoveryClient +func (c *Clientset) Discovery() discovery.DiscoveryInterface { + if c == nil { + return nil + } + return c.DiscoveryClient +} + +// NewForConfig creates a new Clientset for the given config. +// If config's RateLimiter is not set and QPS and Burst are acceptable, +// NewForConfig will generate a rate-limiter in configShallowCopy. +func NewForConfig(c *rest.Config) (*Clientset, error) { + configShallowCopy := *c + if configShallowCopy.RateLimiter == nil && configShallowCopy.QPS > 0 { + if configShallowCopy.Burst <= 0 { + return nil, fmt.Errorf("burst is required to be greater than 0 when RateLimiter is not set and QPS is set to greater than 0") + } + configShallowCopy.RateLimiter = flowcontrol.NewTokenBucketRateLimiter(configShallowCopy.QPS, configShallowCopy.Burst) + } + var cs Clientset + var err error + cs.machineV1beta1, err = machinev1beta1.NewForConfig(&configShallowCopy) + if err != nil { + return nil, err + } + + cs.DiscoveryClient, err = discovery.NewDiscoveryClientForConfig(&configShallowCopy) + if err != nil { + return nil, err + } + return &cs, nil +} + +// NewForConfigOrDie creates a new Clientset for the given config and +// panics if there is an error in the config. +func NewForConfigOrDie(c *rest.Config) *Clientset { + var cs Clientset + cs.machineV1beta1 = machinev1beta1.NewForConfigOrDie(c) + + cs.DiscoveryClient = discovery.NewDiscoveryClientForConfigOrDie(c) + return &cs +} + +// New creates a new Clientset for the given RESTClient. +func New(c rest.Interface) *Clientset { + var cs Clientset + cs.machineV1beta1 = machinev1beta1.New(c) + + cs.DiscoveryClient = discovery.NewDiscoveryClient(c) + return &cs +} diff --git a/vendor/github.com/openshift/machine-api-operator/pkg/generated/clientset/versioned/doc.go b/vendor/github.com/openshift/machine-api-operator/pkg/generated/clientset/versioned/doc.go new file mode 100644 index 0000000000..955e667a69 --- /dev/null +++ b/vendor/github.com/openshift/machine-api-operator/pkg/generated/clientset/versioned/doc.go @@ -0,0 +1,20 @@ +/* + * 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. + * + * Copyright 2019 Red Hat, Inc. + * + */ +// Code generated by client-gen. DO NOT EDIT. + +// This package has the automatically generated clientset. +package versioned diff --git a/vendor/github.com/openshift/machine-api-operator/pkg/generated/clientset/versioned/scheme/doc.go b/vendor/github.com/openshift/machine-api-operator/pkg/generated/clientset/versioned/scheme/doc.go new file mode 100644 index 0000000000..35df78e9c4 --- /dev/null +++ b/vendor/github.com/openshift/machine-api-operator/pkg/generated/clientset/versioned/scheme/doc.go @@ -0,0 +1,20 @@ +/* + * 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. + * + * Copyright 2019 Red Hat, Inc. + * + */ +// Code generated by client-gen. DO NOT EDIT. + +// This package contains the scheme of the automatically generated clientset. +package scheme diff --git a/vendor/github.com/openshift/machine-api-operator/pkg/generated/clientset/versioned/scheme/register.go b/vendor/github.com/openshift/machine-api-operator/pkg/generated/clientset/versioned/scheme/register.go new file mode 100644 index 0000000000..6d21458f1a --- /dev/null +++ b/vendor/github.com/openshift/machine-api-operator/pkg/generated/clientset/versioned/scheme/register.go @@ -0,0 +1,56 @@ +/* + * 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. + * + * Copyright 2019 Red Hat, Inc. + * + */ +// Code generated by client-gen. DO NOT EDIT. + +package scheme + +import ( + machinev1beta1 "github.com/openshift/machine-api-operator/pkg/apis/machine/v1beta1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + schema "k8s.io/apimachinery/pkg/runtime/schema" + serializer "k8s.io/apimachinery/pkg/runtime/serializer" + utilruntime "k8s.io/apimachinery/pkg/util/runtime" +) + +var Scheme = runtime.NewScheme() +var Codecs = serializer.NewCodecFactory(Scheme) +var ParameterCodec = runtime.NewParameterCodec(Scheme) +var localSchemeBuilder = runtime.SchemeBuilder{ + machinev1beta1.AddToScheme, +} + +// AddToScheme adds all types of this clientset into the given scheme. This allows composition +// of clientsets, like in: +// +// import ( +// "k8s.io/client-go/kubernetes" +// clientsetscheme "k8s.io/client-go/kubernetes/scheme" +// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" +// ) +// +// kclientset, _ := kubernetes.NewForConfig(c) +// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) +// +// After this, RawExtensions in Kubernetes types will serialize kube-aggregator types +// correctly. +var AddToScheme = localSchemeBuilder.AddToScheme + +func init() { + v1.AddToGroupVersion(Scheme, schema.GroupVersion{Version: "v1"}) + utilruntime.Must(AddToScheme(Scheme)) +} diff --git a/vendor/github.com/openshift/machine-api-operator/pkg/generated/clientset/versioned/typed/machine/v1beta1/doc.go b/vendor/github.com/openshift/machine-api-operator/pkg/generated/clientset/versioned/typed/machine/v1beta1/doc.go new file mode 100644 index 0000000000..813ac9eb62 --- /dev/null +++ b/vendor/github.com/openshift/machine-api-operator/pkg/generated/clientset/versioned/typed/machine/v1beta1/doc.go @@ -0,0 +1,20 @@ +/* + * 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. + * + * Copyright 2019 Red Hat, Inc. + * + */ +// Code generated by client-gen. DO NOT EDIT. + +// This package has the automatically generated typed clients. +package v1beta1 diff --git a/vendor/github.com/openshift/machine-api-operator/pkg/generated/clientset/versioned/typed/machine/v1beta1/generated_expansion.go b/vendor/github.com/openshift/machine-api-operator/pkg/generated/clientset/versioned/typed/machine/v1beta1/generated_expansion.go new file mode 100644 index 0000000000..d3ff3bc39c --- /dev/null +++ b/vendor/github.com/openshift/machine-api-operator/pkg/generated/clientset/versioned/typed/machine/v1beta1/generated_expansion.go @@ -0,0 +1,25 @@ +/* + * 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. + * + * Copyright 2019 Red Hat, Inc. + * + */ +// Code generated by client-gen. DO NOT EDIT. + +package v1beta1 + +type MachineExpansion interface{} + +type MachineHealthCheckExpansion interface{} + +type MachineSetExpansion interface{} diff --git a/vendor/github.com/openshift/machine-api-operator/pkg/generated/clientset/versioned/typed/machine/v1beta1/machine.go b/vendor/github.com/openshift/machine-api-operator/pkg/generated/clientset/versioned/typed/machine/v1beta1/machine.go new file mode 100644 index 0000000000..e0efc668c1 --- /dev/null +++ b/vendor/github.com/openshift/machine-api-operator/pkg/generated/clientset/versioned/typed/machine/v1beta1/machine.go @@ -0,0 +1,195 @@ +/* + * 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. + * + * Copyright 2019 Red Hat, Inc. + * + */ +// Code generated by client-gen. DO NOT EDIT. + +package v1beta1 + +import ( + "context" + "time" + + v1beta1 "github.com/openshift/machine-api-operator/pkg/apis/machine/v1beta1" + scheme "github.com/openshift/machine-api-operator/pkg/generated/clientset/versioned/scheme" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" +) + +// MachinesGetter has a method to return a MachineInterface. +// A group's client should implement this interface. +type MachinesGetter interface { + Machines(namespace string) MachineInterface +} + +// MachineInterface has methods to work with Machine resources. +type MachineInterface interface { + Create(ctx context.Context, machine *v1beta1.Machine, opts v1.CreateOptions) (*v1beta1.Machine, error) + Update(ctx context.Context, machine *v1beta1.Machine, opts v1.UpdateOptions) (*v1beta1.Machine, error) + UpdateStatus(ctx context.Context, machine *v1beta1.Machine, opts v1.UpdateOptions) (*v1beta1.Machine, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.Machine, error) + List(ctx context.Context, opts v1.ListOptions) (*v1beta1.MachineList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Machine, err error) + MachineExpansion +} + +// machines implements MachineInterface +type machines struct { + client rest.Interface + ns string +} + +// newMachines returns a Machines +func newMachines(c *MachineV1beta1Client, namespace string) *machines { + return &machines{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the machine, and returns the corresponding machine object, and an error if there is any. +func (c *machines) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.Machine, err error) { + result = &v1beta1.Machine{} + err = c.client.Get(). + Namespace(c.ns). + Resource("machines"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of Machines that match those selectors. +func (c *machines) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.MachineList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1beta1.MachineList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("machines"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested machines. +func (c *machines) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + opts.Watch = true + return c.client.Get(). + Namespace(c.ns). + Resource("machines"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a machine and creates it. Returns the server's representation of the machine, and an error, if there is any. +func (c *machines) Create(ctx context.Context, machine *v1beta1.Machine, opts v1.CreateOptions) (result *v1beta1.Machine, err error) { + result = &v1beta1.Machine{} + err = c.client.Post(). + Namespace(c.ns). + Resource("machines"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(machine). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a machine and updates it. Returns the server's representation of the machine, and an error, if there is any. +func (c *machines) Update(ctx context.Context, machine *v1beta1.Machine, opts v1.UpdateOptions) (result *v1beta1.Machine, err error) { + result = &v1beta1.Machine{} + err = c.client.Put(). + Namespace(c.ns). + Resource("machines"). + Name(machine.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(machine). + Do(ctx). + Into(result) + return +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *machines) UpdateStatus(ctx context.Context, machine *v1beta1.Machine, opts v1.UpdateOptions) (result *v1beta1.Machine, err error) { + result = &v1beta1.Machine{} + err = c.client.Put(). + Namespace(c.ns). + Resource("machines"). + Name(machine.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(machine). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the machine and deletes it. Returns an error if one occurs. +func (c *machines) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("machines"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *machines) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("machines"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched machine. +func (c *machines) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Machine, err error) { + result = &v1beta1.Machine{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("machines"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/github.com/openshift/machine-api-operator/pkg/generated/clientset/versioned/typed/machine/v1beta1/machine_client.go b/vendor/github.com/openshift/machine-api-operator/pkg/generated/clientset/versioned/typed/machine/v1beta1/machine_client.go new file mode 100644 index 0000000000..7eb75589c1 --- /dev/null +++ b/vendor/github.com/openshift/machine-api-operator/pkg/generated/clientset/versioned/typed/machine/v1beta1/machine_client.go @@ -0,0 +1,99 @@ +/* + * 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. + * + * Copyright 2019 Red Hat, Inc. + * + */ +// Code generated by client-gen. DO NOT EDIT. + +package v1beta1 + +import ( + v1beta1 "github.com/openshift/machine-api-operator/pkg/apis/machine/v1beta1" + "github.com/openshift/machine-api-operator/pkg/generated/clientset/versioned/scheme" + rest "k8s.io/client-go/rest" +) + +type MachineV1beta1Interface interface { + RESTClient() rest.Interface + MachinesGetter + MachineHealthChecksGetter + MachineSetsGetter +} + +// MachineV1beta1Client is used to interact with features provided by the machine.openshift.io group. +type MachineV1beta1Client struct { + restClient rest.Interface +} + +func (c *MachineV1beta1Client) Machines(namespace string) MachineInterface { + return newMachines(c, namespace) +} + +func (c *MachineV1beta1Client) MachineHealthChecks(namespace string) MachineHealthCheckInterface { + return newMachineHealthChecks(c, namespace) +} + +func (c *MachineV1beta1Client) MachineSets(namespace string) MachineSetInterface { + return newMachineSets(c, namespace) +} + +// NewForConfig creates a new MachineV1beta1Client for the given config. +func NewForConfig(c *rest.Config) (*MachineV1beta1Client, error) { + config := *c + if err := setConfigDefaults(&config); err != nil { + return nil, err + } + client, err := rest.RESTClientFor(&config) + if err != nil { + return nil, err + } + return &MachineV1beta1Client{client}, nil +} + +// NewForConfigOrDie creates a new MachineV1beta1Client for the given config and +// panics if there is an error in the config. +func NewForConfigOrDie(c *rest.Config) *MachineV1beta1Client { + client, err := NewForConfig(c) + if err != nil { + panic(err) + } + return client +} + +// New creates a new MachineV1beta1Client for the given RESTClient. +func New(c rest.Interface) *MachineV1beta1Client { + return &MachineV1beta1Client{c} +} + +func setConfigDefaults(config *rest.Config) error { + gv := v1beta1.SchemeGroupVersion + config.GroupVersion = &gv + config.APIPath = "/apis" + config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() + + if config.UserAgent == "" { + config.UserAgent = rest.DefaultKubernetesUserAgent() + } + + return nil +} + +// RESTClient returns a RESTClient that is used to communicate +// with API server by this client implementation. +func (c *MachineV1beta1Client) RESTClient() rest.Interface { + if c == nil { + return nil + } + return c.restClient +} diff --git a/vendor/github.com/openshift/machine-api-operator/pkg/generated/clientset/versioned/typed/machine/v1beta1/machinehealthcheck.go b/vendor/github.com/openshift/machine-api-operator/pkg/generated/clientset/versioned/typed/machine/v1beta1/machinehealthcheck.go new file mode 100644 index 0000000000..78ee76ec7a --- /dev/null +++ b/vendor/github.com/openshift/machine-api-operator/pkg/generated/clientset/versioned/typed/machine/v1beta1/machinehealthcheck.go @@ -0,0 +1,195 @@ +/* + * 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. + * + * Copyright 2019 Red Hat, Inc. + * + */ +// Code generated by client-gen. DO NOT EDIT. + +package v1beta1 + +import ( + "context" + "time" + + v1beta1 "github.com/openshift/machine-api-operator/pkg/apis/machine/v1beta1" + scheme "github.com/openshift/machine-api-operator/pkg/generated/clientset/versioned/scheme" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" +) + +// MachineHealthChecksGetter has a method to return a MachineHealthCheckInterface. +// A group's client should implement this interface. +type MachineHealthChecksGetter interface { + MachineHealthChecks(namespace string) MachineHealthCheckInterface +} + +// MachineHealthCheckInterface has methods to work with MachineHealthCheck resources. +type MachineHealthCheckInterface interface { + Create(ctx context.Context, machineHealthCheck *v1beta1.MachineHealthCheck, opts v1.CreateOptions) (*v1beta1.MachineHealthCheck, error) + Update(ctx context.Context, machineHealthCheck *v1beta1.MachineHealthCheck, opts v1.UpdateOptions) (*v1beta1.MachineHealthCheck, error) + UpdateStatus(ctx context.Context, machineHealthCheck *v1beta1.MachineHealthCheck, opts v1.UpdateOptions) (*v1beta1.MachineHealthCheck, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.MachineHealthCheck, error) + List(ctx context.Context, opts v1.ListOptions) (*v1beta1.MachineHealthCheckList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.MachineHealthCheck, err error) + MachineHealthCheckExpansion +} + +// machineHealthChecks implements MachineHealthCheckInterface +type machineHealthChecks struct { + client rest.Interface + ns string +} + +// newMachineHealthChecks returns a MachineHealthChecks +func newMachineHealthChecks(c *MachineV1beta1Client, namespace string) *machineHealthChecks { + return &machineHealthChecks{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the machineHealthCheck, and returns the corresponding machineHealthCheck object, and an error if there is any. +func (c *machineHealthChecks) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.MachineHealthCheck, err error) { + result = &v1beta1.MachineHealthCheck{} + err = c.client.Get(). + Namespace(c.ns). + Resource("machinehealthchecks"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of MachineHealthChecks that match those selectors. +func (c *machineHealthChecks) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.MachineHealthCheckList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1beta1.MachineHealthCheckList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("machinehealthchecks"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested machineHealthChecks. +func (c *machineHealthChecks) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + opts.Watch = true + return c.client.Get(). + Namespace(c.ns). + Resource("machinehealthchecks"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a machineHealthCheck and creates it. Returns the server's representation of the machineHealthCheck, and an error, if there is any. +func (c *machineHealthChecks) Create(ctx context.Context, machineHealthCheck *v1beta1.MachineHealthCheck, opts v1.CreateOptions) (result *v1beta1.MachineHealthCheck, err error) { + result = &v1beta1.MachineHealthCheck{} + err = c.client.Post(). + Namespace(c.ns). + Resource("machinehealthchecks"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(machineHealthCheck). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a machineHealthCheck and updates it. Returns the server's representation of the machineHealthCheck, and an error, if there is any. +func (c *machineHealthChecks) Update(ctx context.Context, machineHealthCheck *v1beta1.MachineHealthCheck, opts v1.UpdateOptions) (result *v1beta1.MachineHealthCheck, err error) { + result = &v1beta1.MachineHealthCheck{} + err = c.client.Put(). + Namespace(c.ns). + Resource("machinehealthchecks"). + Name(machineHealthCheck.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(machineHealthCheck). + Do(ctx). + Into(result) + return +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *machineHealthChecks) UpdateStatus(ctx context.Context, machineHealthCheck *v1beta1.MachineHealthCheck, opts v1.UpdateOptions) (result *v1beta1.MachineHealthCheck, err error) { + result = &v1beta1.MachineHealthCheck{} + err = c.client.Put(). + Namespace(c.ns). + Resource("machinehealthchecks"). + Name(machineHealthCheck.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(machineHealthCheck). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the machineHealthCheck and deletes it. Returns an error if one occurs. +func (c *machineHealthChecks) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("machinehealthchecks"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *machineHealthChecks) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("machinehealthchecks"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched machineHealthCheck. +func (c *machineHealthChecks) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.MachineHealthCheck, err error) { + result = &v1beta1.MachineHealthCheck{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("machinehealthchecks"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/github.com/openshift/machine-api-operator/pkg/generated/clientset/versioned/typed/machine/v1beta1/machineset.go b/vendor/github.com/openshift/machine-api-operator/pkg/generated/clientset/versioned/typed/machine/v1beta1/machineset.go new file mode 100644 index 0000000000..531fcec96d --- /dev/null +++ b/vendor/github.com/openshift/machine-api-operator/pkg/generated/clientset/versioned/typed/machine/v1beta1/machineset.go @@ -0,0 +1,195 @@ +/* + * 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. + * + * Copyright 2019 Red Hat, Inc. + * + */ +// Code generated by client-gen. DO NOT EDIT. + +package v1beta1 + +import ( + "context" + "time" + + v1beta1 "github.com/openshift/machine-api-operator/pkg/apis/machine/v1beta1" + scheme "github.com/openshift/machine-api-operator/pkg/generated/clientset/versioned/scheme" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" +) + +// MachineSetsGetter has a method to return a MachineSetInterface. +// A group's client should implement this interface. +type MachineSetsGetter interface { + MachineSets(namespace string) MachineSetInterface +} + +// MachineSetInterface has methods to work with MachineSet resources. +type MachineSetInterface interface { + Create(ctx context.Context, machineSet *v1beta1.MachineSet, opts v1.CreateOptions) (*v1beta1.MachineSet, error) + Update(ctx context.Context, machineSet *v1beta1.MachineSet, opts v1.UpdateOptions) (*v1beta1.MachineSet, error) + UpdateStatus(ctx context.Context, machineSet *v1beta1.MachineSet, opts v1.UpdateOptions) (*v1beta1.MachineSet, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.MachineSet, error) + List(ctx context.Context, opts v1.ListOptions) (*v1beta1.MachineSetList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.MachineSet, err error) + MachineSetExpansion +} + +// machineSets implements MachineSetInterface +type machineSets struct { + client rest.Interface + ns string +} + +// newMachineSets returns a MachineSets +func newMachineSets(c *MachineV1beta1Client, namespace string) *machineSets { + return &machineSets{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the machineSet, and returns the corresponding machineSet object, and an error if there is any. +func (c *machineSets) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.MachineSet, err error) { + result = &v1beta1.MachineSet{} + err = c.client.Get(). + Namespace(c.ns). + Resource("machinesets"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of MachineSets that match those selectors. +func (c *machineSets) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.MachineSetList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1beta1.MachineSetList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("machinesets"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested machineSets. +func (c *machineSets) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + opts.Watch = true + return c.client.Get(). + Namespace(c.ns). + Resource("machinesets"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a machineSet and creates it. Returns the server's representation of the machineSet, and an error, if there is any. +func (c *machineSets) Create(ctx context.Context, machineSet *v1beta1.MachineSet, opts v1.CreateOptions) (result *v1beta1.MachineSet, err error) { + result = &v1beta1.MachineSet{} + err = c.client.Post(). + Namespace(c.ns). + Resource("machinesets"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(machineSet). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a machineSet and updates it. Returns the server's representation of the machineSet, and an error, if there is any. +func (c *machineSets) Update(ctx context.Context, machineSet *v1beta1.MachineSet, opts v1.UpdateOptions) (result *v1beta1.MachineSet, err error) { + result = &v1beta1.MachineSet{} + err = c.client.Put(). + Namespace(c.ns). + Resource("machinesets"). + Name(machineSet.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(machineSet). + Do(ctx). + Into(result) + return +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *machineSets) UpdateStatus(ctx context.Context, machineSet *v1beta1.MachineSet, opts v1.UpdateOptions) (result *v1beta1.MachineSet, err error) { + result = &v1beta1.MachineSet{} + err = c.client.Put(). + Namespace(c.ns). + Resource("machinesets"). + Name(machineSet.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(machineSet). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the machineSet and deletes it. Returns an error if one occurs. +func (c *machineSets) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("machinesets"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *machineSets) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("machinesets"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched machineSet. +func (c *machineSets) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.MachineSet, err error) { + result = &v1beta1.MachineSet{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("machinesets"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/github.com/openshift/machine-api-operator/pkg/generated/informers/externalversions/internalinterfaces/factory_interfaces.go b/vendor/github.com/openshift/machine-api-operator/pkg/generated/informers/externalversions/internalinterfaces/factory_interfaces.go new file mode 100644 index 0000000000..cb72490d4c --- /dev/null +++ b/vendor/github.com/openshift/machine-api-operator/pkg/generated/informers/externalversions/internalinterfaces/factory_interfaces.go @@ -0,0 +1,40 @@ +/* + * 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. + * + * Copyright 2019 Red Hat, Inc. + * + */ +// Code generated by informer-gen. DO NOT EDIT. + +package internalinterfaces + +import ( + time "time" + + versioned "github.com/openshift/machine-api-operator/pkg/generated/clientset/versioned" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + cache "k8s.io/client-go/tools/cache" +) + +// NewInformerFunc takes versioned.Interface and time.Duration to return a SharedIndexInformer. +type NewInformerFunc func(versioned.Interface, time.Duration) cache.SharedIndexInformer + +// SharedInformerFactory a small interface to allow for adding an informer without an import cycle +type SharedInformerFactory interface { + Start(stopCh <-chan struct{}) + InformerFor(obj runtime.Object, newFunc NewInformerFunc) cache.SharedIndexInformer +} + +// TweakListOptionsFunc is a function that transforms a v1.ListOptions. +type TweakListOptionsFunc func(*v1.ListOptions) diff --git a/vendor/github.com/openshift/machine-api-operator/pkg/generated/informers/externalversions/machine/v1beta1/interface.go b/vendor/github.com/openshift/machine-api-operator/pkg/generated/informers/externalversions/machine/v1beta1/interface.go new file mode 100644 index 0000000000..9bbf4950d7 --- /dev/null +++ b/vendor/github.com/openshift/machine-api-operator/pkg/generated/informers/externalversions/machine/v1beta1/interface.go @@ -0,0 +1,59 @@ +/* + * 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. + * + * Copyright 2019 Red Hat, Inc. + * + */ +// Code generated by informer-gen. DO NOT EDIT. + +package v1beta1 + +import ( + internalinterfaces "github.com/openshift/machine-api-operator/pkg/generated/informers/externalversions/internalinterfaces" +) + +// Interface provides access to all the informers in this group version. +type Interface interface { + // Machines returns a MachineInformer. + Machines() MachineInformer + // MachineHealthChecks returns a MachineHealthCheckInformer. + MachineHealthChecks() MachineHealthCheckInformer + // MachineSets returns a MachineSetInformer. + MachineSets() MachineSetInformer +} + +type version struct { + factory internalinterfaces.SharedInformerFactory + namespace string + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// New returns a new Interface. +func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { + return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} +} + +// Machines returns a MachineInformer. +func (v *version) Machines() MachineInformer { + return &machineInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} +} + +// MachineHealthChecks returns a MachineHealthCheckInformer. +func (v *version) MachineHealthChecks() MachineHealthCheckInformer { + return &machineHealthCheckInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} +} + +// MachineSets returns a MachineSetInformer. +func (v *version) MachineSets() MachineSetInformer { + return &machineSetInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} +} diff --git a/vendor/github.com/openshift/machine-api-operator/pkg/generated/informers/externalversions/machine/v1beta1/machine.go b/vendor/github.com/openshift/machine-api-operator/pkg/generated/informers/externalversions/machine/v1beta1/machine.go new file mode 100644 index 0000000000..44fedc0df1 --- /dev/null +++ b/vendor/github.com/openshift/machine-api-operator/pkg/generated/informers/externalversions/machine/v1beta1/machine.go @@ -0,0 +1,90 @@ +/* + * 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. + * + * Copyright 2019 Red Hat, Inc. + * + */ +// Code generated by informer-gen. DO NOT EDIT. + +package v1beta1 + +import ( + "context" + time "time" + + machinev1beta1 "github.com/openshift/machine-api-operator/pkg/apis/machine/v1beta1" + versioned "github.com/openshift/machine-api-operator/pkg/generated/clientset/versioned" + internalinterfaces "github.com/openshift/machine-api-operator/pkg/generated/informers/externalversions/internalinterfaces" + v1beta1 "github.com/openshift/machine-api-operator/pkg/generated/listers/machine/v1beta1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// MachineInformer provides access to a shared informer and lister for +// Machines. +type MachineInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1beta1.MachineLister +} + +type machineInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc + namespace string +} + +// NewMachineInformer constructs a new informer for Machine type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewMachineInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredMachineInformer(client, namespace, resyncPeriod, indexers, nil) +} + +// NewFilteredMachineInformer constructs a new informer for Machine type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredMachineInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.MachineV1beta1().Machines(namespace).List(context.TODO(), options) + }, + WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.MachineV1beta1().Machines(namespace).Watch(context.TODO(), options) + }, + }, + &machinev1beta1.Machine{}, + resyncPeriod, + indexers, + ) +} + +func (f *machineInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredMachineInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *machineInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&machinev1beta1.Machine{}, f.defaultInformer) +} + +func (f *machineInformer) Lister() v1beta1.MachineLister { + return v1beta1.NewMachineLister(f.Informer().GetIndexer()) +} diff --git a/vendor/github.com/openshift/machine-api-operator/pkg/generated/informers/externalversions/machine/v1beta1/machinehealthcheck.go b/vendor/github.com/openshift/machine-api-operator/pkg/generated/informers/externalversions/machine/v1beta1/machinehealthcheck.go new file mode 100644 index 0000000000..036e8e70a3 --- /dev/null +++ b/vendor/github.com/openshift/machine-api-operator/pkg/generated/informers/externalversions/machine/v1beta1/machinehealthcheck.go @@ -0,0 +1,90 @@ +/* + * 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. + * + * Copyright 2019 Red Hat, Inc. + * + */ +// Code generated by informer-gen. DO NOT EDIT. + +package v1beta1 + +import ( + "context" + time "time" + + machinev1beta1 "github.com/openshift/machine-api-operator/pkg/apis/machine/v1beta1" + versioned "github.com/openshift/machine-api-operator/pkg/generated/clientset/versioned" + internalinterfaces "github.com/openshift/machine-api-operator/pkg/generated/informers/externalversions/internalinterfaces" + v1beta1 "github.com/openshift/machine-api-operator/pkg/generated/listers/machine/v1beta1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// MachineHealthCheckInformer provides access to a shared informer and lister for +// MachineHealthChecks. +type MachineHealthCheckInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1beta1.MachineHealthCheckLister +} + +type machineHealthCheckInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc + namespace string +} + +// NewMachineHealthCheckInformer constructs a new informer for MachineHealthCheck type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewMachineHealthCheckInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredMachineHealthCheckInformer(client, namespace, resyncPeriod, indexers, nil) +} + +// NewFilteredMachineHealthCheckInformer constructs a new informer for MachineHealthCheck type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredMachineHealthCheckInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.MachineV1beta1().MachineHealthChecks(namespace).List(context.TODO(), options) + }, + WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.MachineV1beta1().MachineHealthChecks(namespace).Watch(context.TODO(), options) + }, + }, + &machinev1beta1.MachineHealthCheck{}, + resyncPeriod, + indexers, + ) +} + +func (f *machineHealthCheckInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredMachineHealthCheckInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *machineHealthCheckInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&machinev1beta1.MachineHealthCheck{}, f.defaultInformer) +} + +func (f *machineHealthCheckInformer) Lister() v1beta1.MachineHealthCheckLister { + return v1beta1.NewMachineHealthCheckLister(f.Informer().GetIndexer()) +} diff --git a/vendor/github.com/openshift/machine-api-operator/pkg/generated/informers/externalversions/machine/v1beta1/machineset.go b/vendor/github.com/openshift/machine-api-operator/pkg/generated/informers/externalversions/machine/v1beta1/machineset.go new file mode 100644 index 0000000000..e0225d2183 --- /dev/null +++ b/vendor/github.com/openshift/machine-api-operator/pkg/generated/informers/externalversions/machine/v1beta1/machineset.go @@ -0,0 +1,90 @@ +/* + * 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. + * + * Copyright 2019 Red Hat, Inc. + * + */ +// Code generated by informer-gen. DO NOT EDIT. + +package v1beta1 + +import ( + "context" + time "time" + + machinev1beta1 "github.com/openshift/machine-api-operator/pkg/apis/machine/v1beta1" + versioned "github.com/openshift/machine-api-operator/pkg/generated/clientset/versioned" + internalinterfaces "github.com/openshift/machine-api-operator/pkg/generated/informers/externalversions/internalinterfaces" + v1beta1 "github.com/openshift/machine-api-operator/pkg/generated/listers/machine/v1beta1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// MachineSetInformer provides access to a shared informer and lister for +// MachineSets. +type MachineSetInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1beta1.MachineSetLister +} + +type machineSetInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc + namespace string +} + +// NewMachineSetInformer constructs a new informer for MachineSet type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewMachineSetInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredMachineSetInformer(client, namespace, resyncPeriod, indexers, nil) +} + +// NewFilteredMachineSetInformer constructs a new informer for MachineSet type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredMachineSetInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.MachineV1beta1().MachineSets(namespace).List(context.TODO(), options) + }, + WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.MachineV1beta1().MachineSets(namespace).Watch(context.TODO(), options) + }, + }, + &machinev1beta1.MachineSet{}, + resyncPeriod, + indexers, + ) +} + +func (f *machineSetInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredMachineSetInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *machineSetInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&machinev1beta1.MachineSet{}, f.defaultInformer) +} + +func (f *machineSetInformer) Lister() v1beta1.MachineSetLister { + return v1beta1.NewMachineSetLister(f.Informer().GetIndexer()) +} diff --git a/vendor/github.com/openshift/machine-api-operator/pkg/generated/listers/machine/v1beta1/expansion_generated.go b/vendor/github.com/openshift/machine-api-operator/pkg/generated/listers/machine/v1beta1/expansion_generated.go new file mode 100644 index 0000000000..596792bf07 --- /dev/null +++ b/vendor/github.com/openshift/machine-api-operator/pkg/generated/listers/machine/v1beta1/expansion_generated.go @@ -0,0 +1,43 @@ +/* + * 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. + * + * Copyright 2019 Red Hat, Inc. + * + */ +// Code generated by lister-gen. DO NOT EDIT. + +package v1beta1 + +// MachineListerExpansion allows custom methods to be added to +// MachineLister. +type MachineListerExpansion interface{} + +// MachineNamespaceListerExpansion allows custom methods to be added to +// MachineNamespaceLister. +type MachineNamespaceListerExpansion interface{} + +// MachineHealthCheckListerExpansion allows custom methods to be added to +// MachineHealthCheckLister. +type MachineHealthCheckListerExpansion interface{} + +// MachineHealthCheckNamespaceListerExpansion allows custom methods to be added to +// MachineHealthCheckNamespaceLister. +type MachineHealthCheckNamespaceListerExpansion interface{} + +// MachineSetListerExpansion allows custom methods to be added to +// MachineSetLister. +type MachineSetListerExpansion interface{} + +// MachineSetNamespaceListerExpansion allows custom methods to be added to +// MachineSetNamespaceLister. +type MachineSetNamespaceListerExpansion interface{} diff --git a/vendor/github.com/openshift/machine-api-operator/pkg/generated/listers/machine/v1beta1/machine.go b/vendor/github.com/openshift/machine-api-operator/pkg/generated/listers/machine/v1beta1/machine.go new file mode 100644 index 0000000000..5c5e4b0328 --- /dev/null +++ b/vendor/github.com/openshift/machine-api-operator/pkg/generated/listers/machine/v1beta1/machine.go @@ -0,0 +1,94 @@ +/* + * 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. + * + * Copyright 2019 Red Hat, Inc. + * + */ +// Code generated by lister-gen. DO NOT EDIT. + +package v1beta1 + +import ( + v1beta1 "github.com/openshift/machine-api-operator/pkg/apis/machine/v1beta1" + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// MachineLister helps list Machines. +type MachineLister interface { + // List lists all Machines in the indexer. + List(selector labels.Selector) (ret []*v1beta1.Machine, err error) + // Machines returns an object that can list and get Machines. + Machines(namespace string) MachineNamespaceLister + MachineListerExpansion +} + +// machineLister implements the MachineLister interface. +type machineLister struct { + indexer cache.Indexer +} + +// NewMachineLister returns a new MachineLister. +func NewMachineLister(indexer cache.Indexer) MachineLister { + return &machineLister{indexer: indexer} +} + +// List lists all Machines in the indexer. +func (s *machineLister) List(selector labels.Selector) (ret []*v1beta1.Machine, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1beta1.Machine)) + }) + return ret, err +} + +// Machines returns an object that can list and get Machines. +func (s *machineLister) Machines(namespace string) MachineNamespaceLister { + return machineNamespaceLister{indexer: s.indexer, namespace: namespace} +} + +// MachineNamespaceLister helps list and get Machines. +type MachineNamespaceLister interface { + // List lists all Machines in the indexer for a given namespace. + List(selector labels.Selector) (ret []*v1beta1.Machine, err error) + // Get retrieves the Machine from the indexer for a given namespace and name. + Get(name string) (*v1beta1.Machine, error) + MachineNamespaceListerExpansion +} + +// machineNamespaceLister implements the MachineNamespaceLister +// interface. +type machineNamespaceLister struct { + indexer cache.Indexer + namespace string +} + +// List lists all Machines in the indexer for a given namespace. +func (s machineNamespaceLister) List(selector labels.Selector) (ret []*v1beta1.Machine, err error) { + err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { + ret = append(ret, m.(*v1beta1.Machine)) + }) + return ret, err +} + +// Get retrieves the Machine from the indexer for a given namespace and name. +func (s machineNamespaceLister) Get(name string) (*v1beta1.Machine, error) { + obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1beta1.Resource("machine"), name) + } + return obj.(*v1beta1.Machine), nil +} diff --git a/vendor/github.com/openshift/machine-api-operator/pkg/generated/listers/machine/v1beta1/machinehealthcheck.go b/vendor/github.com/openshift/machine-api-operator/pkg/generated/listers/machine/v1beta1/machinehealthcheck.go new file mode 100644 index 0000000000..bed08ad3e4 --- /dev/null +++ b/vendor/github.com/openshift/machine-api-operator/pkg/generated/listers/machine/v1beta1/machinehealthcheck.go @@ -0,0 +1,94 @@ +/* + * 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. + * + * Copyright 2019 Red Hat, Inc. + * + */ +// Code generated by lister-gen. DO NOT EDIT. + +package v1beta1 + +import ( + v1beta1 "github.com/openshift/machine-api-operator/pkg/apis/machine/v1beta1" + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// MachineHealthCheckLister helps list MachineHealthChecks. +type MachineHealthCheckLister interface { + // List lists all MachineHealthChecks in the indexer. + List(selector labels.Selector) (ret []*v1beta1.MachineHealthCheck, err error) + // MachineHealthChecks returns an object that can list and get MachineHealthChecks. + MachineHealthChecks(namespace string) MachineHealthCheckNamespaceLister + MachineHealthCheckListerExpansion +} + +// machineHealthCheckLister implements the MachineHealthCheckLister interface. +type machineHealthCheckLister struct { + indexer cache.Indexer +} + +// NewMachineHealthCheckLister returns a new MachineHealthCheckLister. +func NewMachineHealthCheckLister(indexer cache.Indexer) MachineHealthCheckLister { + return &machineHealthCheckLister{indexer: indexer} +} + +// List lists all MachineHealthChecks in the indexer. +func (s *machineHealthCheckLister) List(selector labels.Selector) (ret []*v1beta1.MachineHealthCheck, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1beta1.MachineHealthCheck)) + }) + return ret, err +} + +// MachineHealthChecks returns an object that can list and get MachineHealthChecks. +func (s *machineHealthCheckLister) MachineHealthChecks(namespace string) MachineHealthCheckNamespaceLister { + return machineHealthCheckNamespaceLister{indexer: s.indexer, namespace: namespace} +} + +// MachineHealthCheckNamespaceLister helps list and get MachineHealthChecks. +type MachineHealthCheckNamespaceLister interface { + // List lists all MachineHealthChecks in the indexer for a given namespace. + List(selector labels.Selector) (ret []*v1beta1.MachineHealthCheck, err error) + // Get retrieves the MachineHealthCheck from the indexer for a given namespace and name. + Get(name string) (*v1beta1.MachineHealthCheck, error) + MachineHealthCheckNamespaceListerExpansion +} + +// machineHealthCheckNamespaceLister implements the MachineHealthCheckNamespaceLister +// interface. +type machineHealthCheckNamespaceLister struct { + indexer cache.Indexer + namespace string +} + +// List lists all MachineHealthChecks in the indexer for a given namespace. +func (s machineHealthCheckNamespaceLister) List(selector labels.Selector) (ret []*v1beta1.MachineHealthCheck, err error) { + err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { + ret = append(ret, m.(*v1beta1.MachineHealthCheck)) + }) + return ret, err +} + +// Get retrieves the MachineHealthCheck from the indexer for a given namespace and name. +func (s machineHealthCheckNamespaceLister) Get(name string) (*v1beta1.MachineHealthCheck, error) { + obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1beta1.Resource("machinehealthcheck"), name) + } + return obj.(*v1beta1.MachineHealthCheck), nil +} diff --git a/vendor/github.com/openshift/machine-api-operator/pkg/generated/listers/machine/v1beta1/machineset.go b/vendor/github.com/openshift/machine-api-operator/pkg/generated/listers/machine/v1beta1/machineset.go new file mode 100644 index 0000000000..f6d5eca2c0 --- /dev/null +++ b/vendor/github.com/openshift/machine-api-operator/pkg/generated/listers/machine/v1beta1/machineset.go @@ -0,0 +1,94 @@ +/* + * 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. + * + * Copyright 2019 Red Hat, Inc. + * + */ +// Code generated by lister-gen. DO NOT EDIT. + +package v1beta1 + +import ( + v1beta1 "github.com/openshift/machine-api-operator/pkg/apis/machine/v1beta1" + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// MachineSetLister helps list MachineSets. +type MachineSetLister interface { + // List lists all MachineSets in the indexer. + List(selector labels.Selector) (ret []*v1beta1.MachineSet, err error) + // MachineSets returns an object that can list and get MachineSets. + MachineSets(namespace string) MachineSetNamespaceLister + MachineSetListerExpansion +} + +// machineSetLister implements the MachineSetLister interface. +type machineSetLister struct { + indexer cache.Indexer +} + +// NewMachineSetLister returns a new MachineSetLister. +func NewMachineSetLister(indexer cache.Indexer) MachineSetLister { + return &machineSetLister{indexer: indexer} +} + +// List lists all MachineSets in the indexer. +func (s *machineSetLister) List(selector labels.Selector) (ret []*v1beta1.MachineSet, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1beta1.MachineSet)) + }) + return ret, err +} + +// MachineSets returns an object that can list and get MachineSets. +func (s *machineSetLister) MachineSets(namespace string) MachineSetNamespaceLister { + return machineSetNamespaceLister{indexer: s.indexer, namespace: namespace} +} + +// MachineSetNamespaceLister helps list and get MachineSets. +type MachineSetNamespaceLister interface { + // List lists all MachineSets in the indexer for a given namespace. + List(selector labels.Selector) (ret []*v1beta1.MachineSet, err error) + // Get retrieves the MachineSet from the indexer for a given namespace and name. + Get(name string) (*v1beta1.MachineSet, error) + MachineSetNamespaceListerExpansion +} + +// machineSetNamespaceLister implements the MachineSetNamespaceLister +// interface. +type machineSetNamespaceLister struct { + indexer cache.Indexer + namespace string +} + +// List lists all MachineSets in the indexer for a given namespace. +func (s machineSetNamespaceLister) List(selector labels.Selector) (ret []*v1beta1.MachineSet, err error) { + err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { + ret = append(ret, m.(*v1beta1.MachineSet)) + }) + return ret, err +} + +// Get retrieves the MachineSet from the indexer for a given namespace and name. +func (s machineSetNamespaceLister) Get(name string) (*v1beta1.MachineSet, error) { + obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1beta1.Resource("machineset"), name) + } + return obj.(*v1beta1.MachineSet), nil +} diff --git a/vendor/github.com/openshift/machine-api-operator/pkg/metrics/metrics.go b/vendor/github.com/openshift/machine-api-operator/pkg/metrics/metrics.go new file mode 100644 index 0000000000..ce70b98665 --- /dev/null +++ b/vendor/github.com/openshift/machine-api-operator/pkg/metrics/metrics.go @@ -0,0 +1,217 @@ +package metrics + +import ( + mapiv1beta1 "github.com/openshift/machine-api-operator/pkg/apis/machine/v1beta1" + machineinformers "github.com/openshift/machine-api-operator/pkg/generated/informers/externalversions/machine/v1beta1" + machinelisters "github.com/openshift/machine-api-operator/pkg/generated/listers/machine/v1beta1" + "github.com/prometheus/client_golang/prometheus" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/klog" + "sigs.k8s.io/controller-runtime/pkg/metrics" +) + +const ( + DefaultHealthCheckMetricsAddress = ":8083" + DefaultMachineSetMetricsAddress = ":8082" + DefaultMachineMetricsAddress = ":8081" +) + +var ( + // MachineCountDesc is a metric about machine object count in the cluster + MachineCountDesc = prometheus.NewDesc("mapi_machine_items", "Count of machine objects currently at the apiserver", nil, nil) + // MachineSetCountDesc Count of machineset object count at the apiserver + MachineSetCountDesc = prometheus.NewDesc("mapi_machineset_items", "Count of machinesets at the apiserver", nil, nil) + // MachineInfoDesc is a metric about machine object info in the cluster + MachineInfoDesc = prometheus.NewDesc("mapi_machine_created_timestamp_seconds", "Timestamp of the mapi managed Machine creation time", []string{"name", "namespace", "spec_provider_id", "node", "api_version", "phase"}, nil) + // MachineSetInfoDesc is a metric about machine object info in the cluster + MachineSetInfoDesc = prometheus.NewDesc("mapi_machineset_created_timestamp_seconds", "Timestamp of the mapi managed Machineset creation time", []string{"name", "namespace", "api_version"}, nil) + + // MachineSetStatusAvailableReplicasDesc is the information of the Machineset's status for available replicas. + MachineSetStatusAvailableReplicasDesc = prometheus.NewDesc("mapi_machine_set_status_replicas_available", "Information of the mapi managed Machineset's status for available replicas", []string{"name", "namespace"}, nil) + + // MachineSetStatusReadyReplicasDesc is the information of the Machineset's status for ready replicas. + MachineSetStatusReadyReplicasDesc = prometheus.NewDesc("mapi_machine_set_status_replicas_ready", "Information of the mapi managed Machineset's status for ready replicas", []string{"name", "namespace"}, nil) + + // MachineSetStatusReplicasDesc is the information of the Machineset's status for replicas. + MachineSetStatusReplicasDesc = prometheus.NewDesc("mapi_machine_set_status_replicas", "Information of the mapi managed Machineset's status for replicas", []string{"name", "namespace"}, nil) + + // MachineCollectorUp is a Prometheus metric, which reports reflects successful collection and reporting of all the metrics + MachineCollectorUp = prometheus.NewGaugeVec(prometheus.GaugeOpts{ + Name: "mapi_mao_collector_up", + Help: "Machine API Operator metrics are being collected and reported successfully", + }, []string{"kind"}) + + failedInstanceCreateCount = prometheus.NewCounterVec( + prometheus.CounterOpts{ + Name: "mapi_instance_create_failed", + Help: "Number of times provider instance create has failed.", + }, []string{"name", "namespace", "reason"}, + ) + + failedInstanceUpdateCount = prometheus.NewCounterVec( + prometheus.CounterOpts{ + Name: "mapi_instance_update_failed", + Help: "Number of times provider instance update has failed.", + }, []string{"name", "namespace", "reason"}, + ) + + failedInstanceDeleteCount = prometheus.NewCounterVec( + prometheus.CounterOpts{ + Name: "mapi_instance_delete_failed", + Help: "Number of times provider instance delete has failed.", + }, []string{"name", "namespace", "reason"}, + ) +) + +func init() { + prometheus.MustRegister(MachineCollectorUp) + metrics.Registry.MustRegister( + failedInstanceCreateCount, + failedInstanceUpdateCount, + failedInstanceDeleteCount, + ) +} + +// MachineCollector is implementing prometheus.Collector interface. +type MachineCollector struct { + machineLister machinelisters.MachineLister + machineSetLister machinelisters.MachineSetLister + namespace string +} + +// MachineLabels is the group of labels that are applied to the machine metrics +type MachineLabels struct { + Name string + Namespace string + Reason string +} + +func NewMachineCollector(machineInformer machineinformers.MachineInformer, machinesetInformer machineinformers.MachineSetInformer, namespace string) *MachineCollector { + return &MachineCollector{ + machineLister: machineInformer.Lister(), + machineSetLister: machinesetInformer.Lister(), + namespace: namespace, + } +} + +// Collect is method required to implement the prometheus.Collector(prometheus/client_golang/prometheus/collector.go) interface. +func (mc *MachineCollector) Collect(ch chan<- prometheus.Metric) { + mc.collectMachineMetrics(ch) + mc.collectMachineSetMetrics(ch) +} + +// Describe implements the prometheus.Collector interface. +func (mc MachineCollector) Describe(ch chan<- *prometheus.Desc) { + ch <- MachineCountDesc + ch <- MachineSetCountDesc +} + +// Collect implements the prometheus.Collector interface. +func (mc MachineCollector) collectMachineMetrics(ch chan<- prometheus.Metric) { + machineList, err := mc.listMachines() + if err != nil { + MachineCollectorUp.With(prometheus.Labels{"kind": "mapi_machine_items"}).Set(float64(0)) + return + } + MachineCollectorUp.With(prometheus.Labels{"kind": "mapi_machine_items"}).Set(float64(1)) + + for _, machine := range machineList { + nodeName := "" + if machine.Status.NodeRef != nil { + nodeName = machine.Status.NodeRef.Name + } + + ch <- prometheus.MustNewConstMetric( + MachineInfoDesc, + prometheus.GaugeValue, + float64(machine.ObjectMeta.GetCreationTimestamp().Time.Unix()), + machine.ObjectMeta.Name, + machine.ObjectMeta.Namespace, + stringPointerDeref(machine.Spec.ProviderID), + nodeName, + machine.TypeMeta.APIVersion, + stringPointerDeref(machine.Status.Phase), + ) + } + + ch <- prometheus.MustNewConstMetric(MachineCountDesc, prometheus.GaugeValue, float64(len(machineList))) + klog.V(4).Infof("collectmachineMetrics exit") +} + +func stringPointerDeref(stringPointer *string) string { + if stringPointer != nil { + return *stringPointer + } + return "" +} + +// collectMachineSetMetrics is method to collect machineSet related metrics. +func (mc MachineCollector) collectMachineSetMetrics(ch chan<- prometheus.Metric) { + machineSetList, err := mc.listMachineSets() + if err != nil { + MachineCollectorUp.With(prometheus.Labels{"kind": "mapi_machineset_items"}).Set(float64(0)) + return + } + MachineCollectorUp.With(prometheus.Labels{"kind": "mapi_machineset_items"}).Set(float64(1)) + ch <- prometheus.MustNewConstMetric(MachineSetCountDesc, prometheus.GaugeValue, float64(len(machineSetList))) + + for _, machineSet := range machineSetList { + + ch <- prometheus.MustNewConstMetric( + MachineSetInfoDesc, + prometheus.GaugeValue, + float64(machineSet.GetCreationTimestamp().Time.Unix()), + machineSet.Name, machineSet.Namespace, machineSet.TypeMeta.APIVersion, + ) + ch <- prometheus.MustNewConstMetric( + MachineSetStatusAvailableReplicasDesc, + prometheus.GaugeValue, + float64(machineSet.Status.AvailableReplicas), + machineSet.Name, machineSet.Namespace, + ) + ch <- prometheus.MustNewConstMetric( + MachineSetStatusReadyReplicasDesc, + prometheus.GaugeValue, + float64(machineSet.Status.ReadyReplicas), + machineSet.Name, machineSet.Namespace, + ) + ch <- prometheus.MustNewConstMetric( + MachineSetStatusReplicasDesc, + prometheus.GaugeValue, + float64(machineSet.Status.Replicas), + machineSet.Name, machineSet.Namespace, + ) + } +} + +func (mc MachineCollector) listMachines() ([]*mapiv1beta1.Machine, error) { + return mc.machineLister.Machines(mc.namespace).List(labels.Everything()) +} + +func (mc MachineCollector) listMachineSets() ([]*mapiv1beta1.MachineSet, error) { + return mc.machineSetLister.MachineSets(mc.namespace).List(labels.Everything()) +} + +func RegisterFailedInstanceCreate(labels *MachineLabels) { + failedInstanceCreateCount.With(prometheus.Labels{ + "name": labels.Name, + "namespace": labels.Namespace, + "reason": labels.Reason, + }).Inc() +} + +func RegisterFailedInstanceUpdate(labels *MachineLabels) { + failedInstanceCreateCount.With(prometheus.Labels{ + "name": labels.Name, + "namespace": labels.Namespace, + "reason": labels.Reason, + }).Inc() +} + +func RegisterFailedInstanceDelete(labels *MachineLabels) { + failedInstanceDeleteCount.With(prometheus.Labels{ + "name": labels.Name, + "namespace": labels.Namespace, + "reason": labels.Reason, + }).Inc() +} diff --git a/vendor/modules.txt b/vendor/modules.txt index 855bf5b9f6..3fcc1f3327 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -85,7 +85,7 @@ github.com/gogo/protobuf/proto github.com/gogo/protobuf/sortkeys # github.com/golang/groupcache v0.0.0-20191002201903-404acd9df4cc github.com/golang/groupcache/lru -# github.com/golang/mock v1.2.0 +# github.com/golang/mock v1.3.1 github.com/golang/mock/gomock github.com/golang/mock/mockgen github.com/golang/mock/mockgen/model @@ -192,10 +192,20 @@ github.com/openshift/api/config/v1 github.com/openshift/client-go/config/clientset/versioned github.com/openshift/client-go/config/clientset/versioned/scheme github.com/openshift/client-go/config/clientset/versioned/typed/config/v1 -# github.com/openshift/machine-api-operator v0.2.1-0.20200611014855-9a69f85c32dd +# github.com/openshift/cluster-api-provider-gcp v0.0.1-0.20200701112720-3a7d727c9a10 +github.com/openshift/cluster-api-provider-gcp/pkg/apis/gcpprovider/v1beta1 +# github.com/openshift/machine-api-operator v0.2.1-0.20200701225707-950912b03628 github.com/openshift/machine-api-operator/pkg/apis/machine github.com/openshift/machine-api-operator/pkg/apis/machine/v1beta1 +github.com/openshift/machine-api-operator/pkg/apis/vsphereprovider/v1beta1 github.com/openshift/machine-api-operator/pkg/controller/machine +github.com/openshift/machine-api-operator/pkg/generated/clientset/versioned +github.com/openshift/machine-api-operator/pkg/generated/clientset/versioned/scheme +github.com/openshift/machine-api-operator/pkg/generated/clientset/versioned/typed/machine/v1beta1 +github.com/openshift/machine-api-operator/pkg/generated/informers/externalversions/internalinterfaces +github.com/openshift/machine-api-operator/pkg/generated/informers/externalversions/machine/v1beta1 +github.com/openshift/machine-api-operator/pkg/generated/listers/machine/v1beta1 +github.com/openshift/machine-api-operator/pkg/metrics github.com/openshift/machine-api-operator/pkg/util # github.com/peterbourgon/diskv v2.0.1+incompatible github.com/peterbourgon/diskv @@ -535,6 +545,8 @@ k8s.io/utils/exec k8s.io/utils/integer k8s.io/utils/pointer k8s.io/utils/trace +# sigs.k8s.io/cluster-api-provider-azure v0.0.0-00010101000000-000000000000 => github.com/openshift/cluster-api-provider-azure v0.1.0-alpha.3.0.20200618001858-af08a66b92de +sigs.k8s.io/cluster-api-provider-azure/pkg/apis/azureprovider/v1beta1 # sigs.k8s.io/controller-runtime v0.6.0 sigs.k8s.io/controller-runtime sigs.k8s.io/controller-runtime/pkg/builder diff --git a/vendor/sigs.k8s.io/cluster-api-provider-azure/LICENSE b/vendor/sigs.k8s.io/cluster-api-provider-azure/LICENSE new file mode 100644 index 0000000000..8dada3edaf --- /dev/null +++ b/vendor/sigs.k8s.io/cluster-api-provider-azure/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/sigs.k8s.io/cluster-api-provider-azure/pkg/apis/azureprovider/v1beta1/azuremachineproviderconfig_types.go b/vendor/sigs.k8s.io/cluster-api-provider-azure/pkg/apis/azureprovider/v1beta1/azuremachineproviderconfig_types.go new file mode 100644 index 0000000000..aeabe51fa5 --- /dev/null +++ b/vendor/sigs.k8s.io/cluster-api-provider-azure/pkg/apis/azureprovider/v1beta1/azuremachineproviderconfig_types.go @@ -0,0 +1,97 @@ +/* +Copyright 2018 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 v1beta1 + +import ( + corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// Annotation constants +const ( + // ClusterIDLabel is the label that a machineset must have to identify the + // cluster to which it belongs. + ClusterIDLabel = "machine.openshift.io/cluster-api-cluster" +) + +// +genclient +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// AzureMachineProviderSpec is the type that will be embedded in a Machine.Spec.ProviderSpec field +// for an Azure virtual machine. It is used by the Azure machine actuator to create a single Machine. +// Required parameters such as location that are not specified by this configuration, will be defaulted +// by the actuator. +// TODO: Update type +// +k8s:openapi-gen=true +type AzureMachineProviderSpec struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + // UserDataSecret contains a local reference to a secret that contains the + // UserData to apply to the instance + UserDataSecret *corev1.SecretReference `json:"userDataSecret,omitempty"` + + // CredentialsSecret is a reference to the secret with Azure credentials. + CredentialsSecret *corev1.SecretReference `json:"credentialsSecret,omitempty"` + + Location string `json:"location,omitempty"` + VMSize string `json:"vmSize,omitempty"` + Image Image `json:"image"` + OSDisk OSDisk `json:"osDisk"` + SSHPublicKey string `json:"sshPublicKey,omitempty"` + PublicIP bool `json:"publicIP"` + Tags map[string]string `json:"tags,omitempty"` + + // Network Security Group that needs to be attached to the machine's interface. + // No security group will be attached if empty. + SecurityGroup string `json:"securityGroup,omitempty"` + + // Application Security Groups that need to be attached to the machine's interface. + // No application security groups will be attached if zero-length. + ApplicationSecurityGroups []string `json:"applicationSecurityGroups,omitempty"` + + // Subnet to use for this instance + Subnet string `json:"subnet"` + + // PublicLoadBalancer to use for this instance + PublicLoadBalancer string `json:"publicLoadBalancer,omitempty"` + + // InternalLoadBalancerName to use for this instance + InternalLoadBalancer string `json:"internalLoadBalancer,omitempty"` + + // NatRule to set inbound NAT rule of the load balancer + NatRule *int `json:"natRule,omitempty"` + + // ManagedIdentity to set managed identity name + ManagedIdentity string `json:"managedIdentity,omitempty"` + + // Vnet to set virtual network name + Vnet string `json:"vnet,omitempty"` + + // Availability Zone for the virtual machine. + // If nil, the virtual machine should be deployed to no zone + Zone *string `json:"zone,omitempty"` + + NetworkResourceGroup string `json:"networkResourceGroup,omitempty"` + ResourceGroup string `json:"resourceGroup,omitempty"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +func init() { + SchemeBuilder.Register(&AzureMachineProviderSpec{}) +} diff --git a/vendor/sigs.k8s.io/cluster-api-provider-azure/pkg/apis/azureprovider/v1beta1/azuremachineproviderstatus_types.go b/vendor/sigs.k8s.io/cluster-api-provider-azure/pkg/apis/azureprovider/v1beta1/azuremachineproviderstatus_types.go new file mode 100644 index 0000000000..00eac86c56 --- /dev/null +++ b/vendor/sigs.k8s.io/cluster-api-provider-azure/pkg/apis/azureprovider/v1beta1/azuremachineproviderstatus_types.go @@ -0,0 +1,72 @@ +/* +Copyright 2019 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 v1beta1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// +genclient +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// AzureMachineProviderStatus is the type that will be embedded in a Machine.Status.ProviderStatus field. +// It contains Azure-specific status information. +// +k8s:openapi-gen=true +type AzureMachineProviderStatus struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + // VMID is the ID of the virtual machine created in Azure. + // +optional + VMID *string `json:"vmId,omitempty"` + + // VMState is the provisioning state of the Azure virtual machine. + // +optional + VMState *VMState `json:"vmState,omitempty"` + + // Conditions is a set of conditions associated with the Machine to indicate + // errors or other status. + // +optional + Conditions []AzureMachineProviderCondition `json:"conditions,omitempty"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +func init() { + SchemeBuilder.Register(&AzureMachineProviderStatus{}) +} + +// SubnetSpec configures an Azure subnet. +type SubnetSpec struct { + // ID defines a unique identifier to reference this resource. + ID string `json:"id,omitempty"` + + // Name defines a name for the subnet resource. + Name string `json:"name"` + + // VnetID defines the ID of the virtual network this subnet should be built in. + VnetID string `json:"vnetId"` + + // CidrBlock is the CIDR block to be used when the provider creates a managed Vnet. + CidrBlock string `json:"cidrBlock,omitempty"` + + // SecurityGroup defines the NSG (network security group) that should be attached to this subnet. + SecurityGroup SecurityGroup `json:"securityGroup"` + + // Tags is a collection of tags describing the resource. + // TODO: Uncomment once tagging is implemented. + //Tags tags.Map `json:"tags,omitempty"` +} diff --git a/vendor/sigs.k8s.io/cluster-api-provider-azure/pkg/apis/azureprovider/v1beta1/doc.go b/vendor/sigs.k8s.io/cluster-api-provider-azure/pkg/apis/azureprovider/v1beta1/doc.go new file mode 100644 index 0000000000..45bb25201e --- /dev/null +++ b/vendor/sigs.k8s.io/cluster-api-provider-azure/pkg/apis/azureprovider/v1beta1/doc.go @@ -0,0 +1,23 @@ +/* +Copyright 2018 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 v1beta1 contains API Schema definitions for the azureprovider v1beta1 API group +// +k8s:openapi-gen=true +// +k8s:deepcopy-gen=package,register +// +k8s:conversion-gen=sigs.k8s.io/cluster-api-provider-azure/pkg/apis/azureprovider +// +k8s:defaulter-gen=TypeMeta +// +groupName=azureproviderconfig.openshift.io +package v1beta1 diff --git a/vendor/sigs.k8s.io/cluster-api-provider-azure/pkg/apis/azureprovider/v1beta1/register.go b/vendor/sigs.k8s.io/cluster-api-provider-azure/pkg/apis/azureprovider/v1beta1/register.go new file mode 100644 index 0000000000..c7d4921dd8 --- /dev/null +++ b/vendor/sigs.k8s.io/cluster-api-provider-azure/pkg/apis/azureprovider/v1beta1/register.go @@ -0,0 +1,93 @@ +/* +Copyright 2018 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. +*/ + +// NOTE: Boilerplate only. Ignore this file. + +// Package v1beta1 contains API Schema definitions for the azureprovider v1beta1 API group +// +k8s:openapi-gen=true +// +k8s:deepcopy-gen=package,register +// +k8s:conversion-gen=sigs.k8s.io/cluster-api-provider-azure/pkg/apis/azureprovider +// +k8s:defaulter-gen=TypeMeta +// +groupName=azureproviderconfig.openshift.io +package v1beta1 + +import ( + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/schema" + "k8s.io/apimachinery/pkg/util/json" + "sigs.k8s.io/controller-runtime/pkg/scheme" + "sigs.k8s.io/yaml" +) + +var ( + // SchemeGroupVersion is group version used to register these objects + SchemeGroupVersion = schema.GroupVersion{Group: "azureproviderconfig.openshift.io", Version: "v1beta1"} + + // SchemeBuilder is used to add go types to the GroupVersionKind scheme + SchemeBuilder = &scheme.Builder{GroupVersion: SchemeGroupVersion} +) + +// MachineStatusFromProviderStatus unmarshals a raw extension into an Azure machine type +func MachineStatusFromProviderStatus(extension *runtime.RawExtension) (*AzureMachineProviderStatus, error) { + if extension == nil { + return &AzureMachineProviderStatus{}, nil + } + + status := new(AzureMachineProviderStatus) + if err := yaml.Unmarshal(extension.Raw, status); err != nil { + return nil, err + } + + return status, nil +} + +// EncodeMachineStatus marshals the machine status +func EncodeMachineStatus(status *AzureMachineProviderStatus) (*runtime.RawExtension, error) { + if status == nil { + return &runtime.RawExtension{}, nil + } + + var rawBytes []byte + var err error + + // TODO: use apimachinery conversion https://godoc.org/k8s.io/apimachinery/pkg/runtime#Convert_runtime_Object_To_runtime_RawExtension + if rawBytes, err = json.Marshal(status); err != nil { + return nil, err + } + + return &runtime.RawExtension{ + Raw: rawBytes, + }, nil +} + +// EncodeMachineSpec marshals the machine provider spec. +func EncodeMachineSpec(spec *AzureMachineProviderSpec) (*runtime.RawExtension, error) { + if spec == nil { + return &runtime.RawExtension{}, nil + } + + var rawBytes []byte + var err error + + // TODO: use apimachinery conversion https://godoc.org/k8s.io/apimachinery/pkg/runtime#Convert_runtime_Object_To_runtime_RawExtension + if rawBytes, err = json.Marshal(spec); err != nil { + return nil, err + } + + return &runtime.RawExtension{ + Raw: rawBytes, + }, nil +} diff --git a/vendor/sigs.k8s.io/cluster-api-provider-azure/pkg/apis/azureprovider/v1beta1/types.go b/vendor/sigs.k8s.io/cluster-api-provider-azure/pkg/apis/azureprovider/v1beta1/types.go new file mode 100644 index 0000000000..a0d943ebf3 --- /dev/null +++ b/vendor/sigs.k8s.io/cluster-api-provider-azure/pkg/apis/azureprovider/v1beta1/types.go @@ -0,0 +1,411 @@ +/* +Copyright 2019 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 v1beta1 + +import ( + "time" + + corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// TODO: Write type tests + +// AzureResourceReference is a reference to a specific Azure resource by ID +type AzureResourceReference struct { + // ID of resource + // +optional + ID *string `json:"id,omitempty"` + // TODO: Investigate if we should reference resources in other ways +} + +// TODO: Investigate resource filters + +// AzureMachineProviderConditionType is a valid value for AzureMachineProviderCondition.Type +type AzureMachineProviderConditionType string + +// Valid conditions for an Azure machine instance +const ( + // MachineCreated indicates whether the machine has been created or not. If not, + // it should include a reason and message for the failure. + MachineCreated AzureMachineProviderConditionType = "MachineCreated" +) + +// AzureMachineProviderCondition is a condition in a AzureMachineProviderStatus +type AzureMachineProviderCondition struct { + // Type is the type of the condition. + Type AzureMachineProviderConditionType `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"` + // LastTransitionTime is the last time the condition transitioned from one status to another. + // +optional + LastTransitionTime metav1.Time `json:"lastTransitionTime"` + // Reason is a unique, one-word, CamelCase reason for the condition's last transition. + // +optional + Reason string `json:"reason"` + // Message is a human-readable message indicating details about last transition. + // +optional + Message string `json:"message"` +} + +const ( + // ControlPlane machine label + ControlPlane string = "master" + // Node machine label + Node string = "worker" + // MachineRoleLabel machine label to determine the role + MachineRoleLabel = "machine.openshift.io/cluster-api-machine-role" +) + +// Network encapsulates Azure networking resources. +type Network struct { + // SecurityGroups is a map from the role/kind of the security group to its unique name, if any. + SecurityGroups map[SecurityGroupRole]*SecurityGroup `json:"securityGroups,omitempty"` + + // APIServerLB is the Kubernetes API server load balancer. + APIServerLB LoadBalancer `json:"apiServerLb,omitempty"` + + // APIServerIP is the Kubernetes API server public IP address. + APIServerIP PublicIP `json:"apiServerIp,omitempty"` +} + +// TODO: Implement tagging +/* +// Tags defines resource tags. +type Tags map[string]*string +*/ + +// Subnets is a slice of Subnet. +type Subnets []*SubnetSpec + +// TODO +// ToMap returns a map from id to subnet. +func (s Subnets) ToMap() map[string]*SubnetSpec { + res := make(map[string]*SubnetSpec) + for _, x := range s { + res[x.ID] = x + } + return res +} + +// SecurityGroupRole defines the unique role of a security group. +type SecurityGroupRole string + +var ( + // SecurityGroupBastion defines an SSH bastion role + SecurityGroupBastion = SecurityGroupRole("bastion") + + // SecurityGroupNode defines a Kubernetes workload node role + SecurityGroupNode = SecurityGroupRole(Node) + + // SecurityGroupControlPlane defines a Kubernetes control plane node role + SecurityGroupControlPlane = SecurityGroupRole(ControlPlane) +) + +// SecurityGroup defines an Azure security group. +type SecurityGroup struct { + ID string `json:"id"` + Name string `json:"name"` + IngressRules IngressRules `json:"ingressRule"` + // TODO: Uncomment once tagging is implemented. + //Tags *Tags `json:"tags"` +} + +/* +// TODO +// String returns a string representation of the security group. +func (s *SecurityGroup) String() string { + return fmt.Sprintf("id=%s/name=%s", s.ID, s.Name) +} +*/ + +// SecurityGroupProtocol defines the protocol type for a security group rule. +type SecurityGroupProtocol string + +var ( + // SecurityGroupProtocolAll is a wildcard for all IP protocols + SecurityGroupProtocolAll = SecurityGroupProtocol("*") + + // SecurityGroupProtocolTCP represents the TCP protocol in ingress rules + SecurityGroupProtocolTCP = SecurityGroupProtocol("Tcp") + + // SecurityGroupProtocolUDP represents the UDP protocol in ingress rules + SecurityGroupProtocolUDP = SecurityGroupProtocol("Udp") +) + +// TODO +// IngressRule defines an Azure ingress rule for security groups. +type IngressRule struct { + Description string `json:"description"` + Protocol SecurityGroupProtocol `json:"protocol"` + + // SourcePorts - The source port or range. Integer or range between 0 and 65535. Asterix '*' can also be used to match all ports. + SourcePorts *string `json:"sourcePorts,omitempty"` + + // DestinationPorts - The destination port or range. Integer or range between 0 and 65535. Asterix '*' can also be used to match all ports. + DestinationPorts *string `json:"destinationPorts,omitempty"` + + // Source - The CIDR or source IP range. Asterix '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. If this is an ingress rule, specifies where network traffic originates from. + Source *string `json:"source,omitempty"` + + // Destination - The destination address prefix. CIDR or destination IP range. Asterix '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. + Destination *string `json:"destination,omitempty"` +} + +// TODO +// String returns a string representation of the ingress rule. +/* +func (i *IngressRule) String() string { + return fmt.Sprintf("protocol=%s/range=[%d-%d]/description=%s", i.Protocol, i.FromPort, i.ToPort, i.Description) +} +*/ + +// TODO +// IngressRules is a slice of Azure ingress rules for security groups. +type IngressRules []*IngressRule + +// TODO +// Difference returns the difference between this slice and the other slice. +/* +func (i IngressRules) Difference(o IngressRules) (out IngressRules) { + for _, x := range i { + found := false + for _, y := range o { + sort.Strings(x.CidrBlocks) + sort.Strings(y.CidrBlocks) + sort.Strings(x.SourceSecurityGroupIDs) + sort.Strings(y.SourceSecurityGroupIDs) + if reflect.DeepEqual(x, y) { + found = true + break + } + } + + if !found { + out = append(out, x) + } + } + + return +} +*/ + +// PublicIP defines an Azure public IP address. +// TODO: Remove once load balancer is implemented. +type PublicIP struct { + ID string `json:"id,omitempty"` + Name string `json:"name,omitempty"` + IPAddress string `json:"ipAddress,omitempty"` + DNSName string `json:"dnsName,omitempty"` +} + +// TODO +// LoadBalancer defines an Azure load balancer. +type LoadBalancer struct { + ID string `json:"id,omitempty"` + Name string `json:"name,omitempty"` + SKU SKU `json:"sku,omitempty"` + FrontendIPConfig FrontendIPConfig `json:"frontendIpConfig,omitempty"` + BackendPool BackendPool `json:"backendPool,omitempty"` + // TODO: Uncomment once tagging is implemented. + //Tags Tags `json:"tags,omitempty"` + /* + // FrontendIPConfigurations - Object representing the frontend IPs to be used for the load balancer + FrontendIPConfigurations *[]FrontendIPConfiguration `json:"frontendIPConfigurations,omitempty"` + // BackendAddressPools - Collection of backend address pools used by a load balancer + BackendAddressPools *[]BackendAddressPool `json:"backendAddressPools,omitempty"` + // LoadBalancingRules - Object collection representing the load balancing rules Gets the provisioning + LoadBalancingRules *[]LoadBalancingRule `json:"loadBalancingRules,omitempty"` + // Probes - Collection of probe objects used in the load balancer + Probes *[]Probe `json:"probes,omitempty"` + // InboundNatRules - Collection of inbound NAT Rules used by a load balancer. Defining inbound NAT rules on your load balancer is mutually exclusive with defining an inbound NAT pool. Inbound NAT pools are referenced from virtual machine scale sets. NICs that are associated with individual virtual machines cannot reference an Inbound NAT pool. They have to reference individual inbound NAT rules. + InboundNatRules *[]InboundNatRule `json:"inboundNatRules,omitempty"` + // InboundNatPools - Defines an external port range for inbound NAT to a single backend port on NICs associated with a load balancer. Inbound NAT rules are created automatically for each NIC associated with the Load Balancer using an external port from this range. Defining an Inbound NAT pool on your Load Balancer is mutually exclusive with defining inbound Nat rules. Inbound NAT pools are referenced from virtual machine scale sets. NICs that are associated with individual virtual machines cannot reference an inbound NAT pool. They have to reference individual inbound NAT rules. + InboundNatPools *[]InboundNatPool `json:"inboundNatPools,omitempty"` + // OutboundRules - The outbound rules. + OutboundRules *[]OutboundRule `json:"outboundRules,omitempty"` + // ResourceGUID - The resource GUID property of the load balancer resource. + ResourceGUID *string `json:"resourceGuid,omitempty"` + // ProvisioningState - Gets the provisioning state of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + ProvisioningState *string `json:"provisioningState,omitempty"` + */ +} + +// LoadBalancerSKU enumerates the values for load balancer sku name. +type SKU string + +var ( + SKUBasic = SKU("Basic") + SKUStandard = SKU("Standard") +) + +type FrontendIPConfig struct { + /* + // FrontendIPConfigurationPropertiesFormat - Properties of the load balancer probe. + *FrontendIPConfigurationPropertiesFormat `json:"properties,omitempty"` + // Name - The name of the resource that is unique within a resource group. This name can be used to access the resource. + Name *string `json:"name,omitempty"` + // Etag - A unique read-only string that changes whenever the resource is updated. + Etag *string `json:"etag,omitempty"` + // Zones - A list of availability zones denoting the IP allocated for the resource needs to come from. + Zones *[]string `json:"zones,omitempty"` + // ID - Resource ID. + ID *string `json:"id,omitempty"` + */ +} + +type BackendPool struct { + Name string `json:"name,omitempty"` + ID string `json:"id,omitempty"` +} + +// TODO +// LoadBalancerProtocol defines listener protocols for a load balancer. +type LoadBalancerProtocol string + +// TODO +var ( + // LoadBalancerProtocolTCP defines the LB API string representing the TCP protocol + LoadBalancerProtocolTCP = LoadBalancerProtocol("TCP") + + // LoadBalancerProtocolSSL defines the LB API string representing the TLS protocol + LoadBalancerProtocolSSL = LoadBalancerProtocol("SSL") + + // LoadBalancerProtocolHTTP defines the LB API string representing the HTTP protocol at L7 + LoadBalancerProtocolHTTP = LoadBalancerProtocol("HTTP") + + // LoadBalancerProtocolHTTPS defines the LB API string representing the HTTP protocol at L7 + LoadBalancerProtocolHTTPS = LoadBalancerProtocol("HTTPS") +) + +// TODO +// LoadBalancerListener defines an Azure load balancer listener. +type LoadBalancerListener struct { + Protocol LoadBalancerProtocol `json:"protocol"` + Port int64 `json:"port"` + InstanceProtocol LoadBalancerProtocol `json:"instanceProtocol"` + InstancePort int64 `json:"instancePort"` +} + +// TODO +// LoadBalancerHealthCheck defines an Azure load balancer health check. +type LoadBalancerHealthCheck struct { + Target string `json:"target"` + Interval time.Duration `json:"interval"` + Timeout time.Duration `json:"timeout"` + HealthyThreshold int64 `json:"healthyThreshold"` + UnhealthyThreshold int64 `json:"unhealthyThreshold"` +} + +// VMState describes the state of an Azure virtual machine. +type VMState string + +var ( + // VMStateCreating ... + VMStateCreating = VMState("Creating") + // VMStateDeleting ... + VMStateDeleting = VMState("Deleting") + // VMStateFailed ... + VMStateFailed = VMState("Failed") + // VMStateMigrating ... + VMStateMigrating = VMState("Migrating") + // VMStateSucceeded ... + VMStateSucceeded = VMState("Succeeded") + // VMStateUpdating ... + VMStateUpdating = VMState("Updating") + + // VMStateStarting ... + VMStateStarting = VMState("Starting") + // VMStateRunning ... + VMStateRunning = VMState("Running") + // VMStateStopping ... + VMStateStopping = VMState("Stopping") + // VMStateStopped ... + VMStateStopped = VMState("Stopped") + // VMStateDeallocating ... + VMStateDeallocating = VMState("Deallocating") + // VMStateDeallocated ... + VMStateDeallocated = VMState("Deallocated") + + // VMStateUnknown ... + VMStateUnknown = VMState("Unknown") +) + +// VM describes an Azure virtual machine. +type VM struct { + ID string `json:"id,omitempty"` + Name string `json:"name,omitempty"` + + // Hardware profile + VMSize string `json:"vmSize,omitempty"` + + // Storage profile + Image Image `json:"image,omitempty"` + OSDisk OSDisk `json:"osDisk,omitempty"` + + StartupScript string `json:"startupScript,omitempty"` + + // State - The provisioning state, which only appears in the response. + State VMState `json:"vmState,omitempty"` + Identity VMIdentity `json:"identity,omitempty"` + + // TODO: Uncomment once tagging is implemented. + //Tags Tags `json:"tags,omitempty"` + + // HardwareProfile - Specifies the hardware settings for the virtual machine. + //HardwareProfile *HardwareProfile `json:"hardwareProfile,omitempty"` + + // StorageProfile - Specifies the storage settings for the virtual machine disks. + //StorageProfile *StorageProfile `json:"storageProfile,omitempty"` + + // AdditionalCapabilities - Specifies additional capabilities enabled or disabled on the virtual machine. + //AdditionalCapabilities *AdditionalCapabilities `json:"additionalCapabilities,omitempty"` + + // OsProfile - Specifies the operating system settings for the virtual machine. + //OsProfile *OSProfile `json:"osProfile,omitempty"` + // NetworkProfile - Specifies the network interfaces of the virtual machine. + //NetworkProfile *NetworkProfile `json:"networkProfile,omitempty"` + + //AvailabilitySet *SubResource `json:"availabilitySet,omitempty"` +} + +// Image is a mirror of azure sdk compute.ImageReference +type Image struct { + // Fields below refer to os images in marketplace + Publisher string `json:"publisher"` + Offer string `json:"offer"` + SKU string `json:"sku"` + Version string `json:"version"` + // ResourceID represents the location of OS Image in azure subscription + ResourceID string `json:"resourceID"` +} + +// VMIdentity defines the identity of the virtual machine, if configured. +type VMIdentity string + +type OSDisk struct { + OSType string `json:"osType"` + ManagedDisk ManagedDisk `json:"managedDisk"` + DiskSizeGB int32 `json:"diskSizeGB"` +} + +type ManagedDisk struct { + StorageAccountType string `json:"storageAccountType"` +} diff --git a/vendor/sigs.k8s.io/cluster-api-provider-azure/pkg/apis/azureprovider/v1beta1/zz_generated.deepcopy.go b/vendor/sigs.k8s.io/cluster-api-provider-azure/pkg/apis/azureprovider/v1beta1/zz_generated.deepcopy.go new file mode 100644 index 0000000000..44f8025f98 --- /dev/null +++ b/vendor/sigs.k8s.io/cluster-api-provider-azure/pkg/apis/azureprovider/v1beta1/zz_generated.deepcopy.go @@ -0,0 +1,493 @@ +// +build !ignore_autogenerated + +/* +Copyright 2019 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 main. DO NOT EDIT. + +package v1beta1 + +import ( + v1 "k8s.io/api/core/v1" + runtime "k8s.io/apimachinery/pkg/runtime" +) + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AzureMachineProviderCondition) DeepCopyInto(out *AzureMachineProviderCondition) { + *out = *in + in.LastProbeTime.DeepCopyInto(&out.LastProbeTime) + in.LastTransitionTime.DeepCopyInto(&out.LastTransitionTime) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureMachineProviderCondition. +func (in *AzureMachineProviderCondition) DeepCopy() *AzureMachineProviderCondition { + if in == nil { + return nil + } + out := new(AzureMachineProviderCondition) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AzureMachineProviderSpec) DeepCopyInto(out *AzureMachineProviderSpec) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + if in.UserDataSecret != nil { + in, out := &in.UserDataSecret, &out.UserDataSecret + *out = new(v1.SecretReference) + **out = **in + } + if in.CredentialsSecret != nil { + in, out := &in.CredentialsSecret, &out.CredentialsSecret + *out = new(v1.SecretReference) + **out = **in + } + out.Image = in.Image + out.OSDisk = in.OSDisk + if in.Tags != nil { + in, out := &in.Tags, &out.Tags + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.NatRule != nil { + in, out := &in.NatRule, &out.NatRule + *out = new(int) + **out = **in + } + if in.Zone != nil { + in, out := &in.Zone, &out.Zone + *out = new(string) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureMachineProviderSpec. +func (in *AzureMachineProviderSpec) DeepCopy() *AzureMachineProviderSpec { + if in == nil { + return nil + } + out := new(AzureMachineProviderSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *AzureMachineProviderSpec) 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 *AzureMachineProviderStatus) DeepCopyInto(out *AzureMachineProviderStatus) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + if in.VMID != nil { + in, out := &in.VMID, &out.VMID + *out = new(string) + **out = **in + } + if in.VMState != nil { + in, out := &in.VMState, &out.VMState + *out = new(VMState) + **out = **in + } + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make([]AzureMachineProviderCondition, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureMachineProviderStatus. +func (in *AzureMachineProviderStatus) DeepCopy() *AzureMachineProviderStatus { + if in == nil { + return nil + } + out := new(AzureMachineProviderStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *AzureMachineProviderStatus) 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 *AzureResourceReference) DeepCopyInto(out *AzureResourceReference) { + *out = *in + if in.ID != nil { + in, out := &in.ID, &out.ID + *out = new(string) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureResourceReference. +func (in *AzureResourceReference) DeepCopy() *AzureResourceReference { + if in == nil { + return nil + } + out := new(AzureResourceReference) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *BackendPool) DeepCopyInto(out *BackendPool) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BackendPool. +func (in *BackendPool) DeepCopy() *BackendPool { + if in == nil { + return nil + } + out := new(BackendPool) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *FrontendIPConfig) DeepCopyInto(out *FrontendIPConfig) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FrontendIPConfig. +func (in *FrontendIPConfig) DeepCopy() *FrontendIPConfig { + if in == nil { + return nil + } + out := new(FrontendIPConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Image) DeepCopyInto(out *Image) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Image. +func (in *Image) DeepCopy() *Image { + if in == nil { + return nil + } + out := new(Image) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *IngressRule) DeepCopyInto(out *IngressRule) { + *out = *in + if in.SourcePorts != nil { + in, out := &in.SourcePorts, &out.SourcePorts + *out = new(string) + **out = **in + } + if in.DestinationPorts != nil { + in, out := &in.DestinationPorts, &out.DestinationPorts + *out = new(string) + **out = **in + } + if in.Source != nil { + in, out := &in.Source, &out.Source + *out = new(string) + **out = **in + } + if in.Destination != nil { + in, out := &in.Destination, &out.Destination + *out = new(string) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IngressRule. +func (in *IngressRule) DeepCopy() *IngressRule { + if in == nil { + return nil + } + out := new(IngressRule) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in IngressRules) DeepCopyInto(out *IngressRules) { + { + in := &in + *out = make(IngressRules, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(IngressRule) + (*in).DeepCopyInto(*out) + } + } + return + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IngressRules. +func (in IngressRules) DeepCopy() IngressRules { + if in == nil { + return nil + } + out := new(IngressRules) + in.DeepCopyInto(out) + return *out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *LoadBalancer) DeepCopyInto(out *LoadBalancer) { + *out = *in + out.FrontendIPConfig = in.FrontendIPConfig + out.BackendPool = in.BackendPool + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LoadBalancer. +func (in *LoadBalancer) DeepCopy() *LoadBalancer { + if in == nil { + return nil + } + out := new(LoadBalancer) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *LoadBalancerHealthCheck) DeepCopyInto(out *LoadBalancerHealthCheck) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LoadBalancerHealthCheck. +func (in *LoadBalancerHealthCheck) DeepCopy() *LoadBalancerHealthCheck { + if in == nil { + return nil + } + out := new(LoadBalancerHealthCheck) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *LoadBalancerListener) DeepCopyInto(out *LoadBalancerListener) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LoadBalancerListener. +func (in *LoadBalancerListener) DeepCopy() *LoadBalancerListener { + if in == nil { + return nil + } + out := new(LoadBalancerListener) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ManagedDisk) DeepCopyInto(out *ManagedDisk) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ManagedDisk. +func (in *ManagedDisk) DeepCopy() *ManagedDisk { + if in == nil { + return nil + } + out := new(ManagedDisk) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Network) DeepCopyInto(out *Network) { + *out = *in + if in.SecurityGroups != nil { + in, out := &in.SecurityGroups, &out.SecurityGroups + *out = make(map[SecurityGroupRole]*SecurityGroup, len(*in)) + for key, val := range *in { + var outVal *SecurityGroup + if val == nil { + (*out)[key] = nil + } else { + in, out := &val, &outVal + *out = new(SecurityGroup) + (*in).DeepCopyInto(*out) + } + (*out)[key] = outVal + } + } + out.APIServerLB = in.APIServerLB + out.APIServerIP = in.APIServerIP + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Network. +func (in *Network) DeepCopy() *Network { + if in == nil { + return nil + } + out := new(Network) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *OSDisk) DeepCopyInto(out *OSDisk) { + *out = *in + out.ManagedDisk = in.ManagedDisk + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OSDisk. +func (in *OSDisk) DeepCopy() *OSDisk { + if in == nil { + return nil + } + out := new(OSDisk) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PublicIP) DeepCopyInto(out *PublicIP) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PublicIP. +func (in *PublicIP) DeepCopy() *PublicIP { + if in == nil { + return nil + } + out := new(PublicIP) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SecurityGroup) DeepCopyInto(out *SecurityGroup) { + *out = *in + if in.IngressRules != nil { + in, out := &in.IngressRules, &out.IngressRules + *out = make(IngressRules, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(IngressRule) + (*in).DeepCopyInto(*out) + } + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SecurityGroup. +func (in *SecurityGroup) DeepCopy() *SecurityGroup { + if in == nil { + return nil + } + out := new(SecurityGroup) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SubnetSpec) DeepCopyInto(out *SubnetSpec) { + *out = *in + in.SecurityGroup.DeepCopyInto(&out.SecurityGroup) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SubnetSpec. +func (in *SubnetSpec) DeepCopy() *SubnetSpec { + if in == nil { + return nil + } + out := new(SubnetSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in Subnets) DeepCopyInto(out *Subnets) { + { + in := &in + *out = make(Subnets, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(SubnetSpec) + (*in).DeepCopyInto(*out) + } + } + return + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Subnets. +func (in Subnets) DeepCopy() Subnets { + if in == nil { + return nil + } + out := new(Subnets) + in.DeepCopyInto(out) + return *out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VM) DeepCopyInto(out *VM) { + *out = *in + out.Image = in.Image + out.OSDisk = in.OSDisk + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VM. +func (in *VM) DeepCopy() *VM { + if in == nil { + return nil + } + out := new(VM) + in.DeepCopyInto(out) + return out +}