From 4c914319336b5e0a5839d02b0588f3d53c25490e Mon Sep 17 00:00:00 2001 From: Evan Cordell Date: Fri, 11 Jan 2019 18:44:29 -0500 Subject: [PATCH] fix(olm): always return a status on minKubeVersion checks --- go.sum | 39 +---- pkg/controller/operators/olm/operator_test.go | 142 +++++++++--------- pkg/controller/operators/olm/requirements.go | 27 ++-- 3 files changed, 89 insertions(+), 119 deletions(-) diff --git a/go.sum b/go.sum index e1ba848b62..e147cdfc52 100644 --- a/go.sum +++ b/go.sum @@ -1,7 +1,6 @@ bitbucket.org/ww/goautoneg v0.0.0-20120707110453-75cd24fc2f2c h1:t+Ra932MCC0eeyD/vigXqMbZTzgZjd4JOfBJWC6VSMI= bitbucket.org/ww/goautoneg v0.0.0-20120707110453-75cd24fc2f2c/go.mod h1:1vhO7Mn/FZMgOgDVGLy5X1mE6rq1HbkBdkF/yj8zkcg= cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/NYTimes/gziphandler v1.0.1 h1:iLrQrdwjDd52kHDA5op2UBJFjmOb9g+7scBan4RN8F0= github.com/NYTimes/gziphandler v1.0.1/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= @@ -15,10 +14,8 @@ github.com/asaskevich/govalidator v0.0.0-20180720115003-f9ffefc3facf h1:eg0MeVzs github.com/asaskevich/govalidator v0.0.0-20180720115003-f9ffefc3facf/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= 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/boltdb/bolt v1.3.1 h1:JQmyP4ZBrce+ZQu0dY660FMfatumYDLun9hBCUVIkF4= github.com/boltdb/bolt v1.3.1/go.mod h1:clJnj/oiGkjum5o1McbSZDSLxVThjynRyGBgiAx27Ps= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -github.com/coreos/bbolt v1.3.0 h1:HIgH5xUWXT914HCI671AxuTTqjj64UOFr7pHn48LUTI= github.com/coreos/bbolt v1.3.0/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= github.com/coreos/etcd v3.3.9+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/etcd v3.3.10+incompatible h1:KjVWqrZ5U0wa3CxY2AxlH6/UcB+PK2td1DcsYhA+HRs= @@ -28,14 +25,11 @@ github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3Ee github.com/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/go-systemd v0.0.0-20181031085051-9002847aa142 h1:3jFq2xL4ZajGK4aZY8jz+DAF0FHjI51BXjjSwCzS1Dk= github.com/coreos/go-systemd v0.0.0-20181031085051-9002847aa142/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= -github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f h1:lBNOc5arjvs8E5mO2tbpBpLoyyu8B6e44T7hJy6potg= github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/dgrijalva/jwt-go v3.2.0+incompatible h1:7qlOGliEKZXTDg6OTjfoBKDXWrumCAMpl/TFQ4/5kLM= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/docker/distribution v2.6.2+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= -github.com/docker/distribution v2.7.0+incompatible h1:neUDAlf3wX6Ml4HdqTrbcOHXtfRN0TFIwt6YFL7N9RU= github.com/docker/distribution v2.7.0+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= github.com/elazarl/go-bindata-assetfs v1.0.0 h1:G/bYguwHIzWq9ZoyUQqrjTmJbbYn3j3CKKpKinvZLFk= github.com/elazarl/go-bindata-assetfs v1.0.0/go.mod h1:v+YaWX3bdea5J/mo8dSETolEo7R71Vk1u8bnjau5yw4= @@ -46,7 +40,6 @@ github.com/emicklei/go-restful-swagger12 v0.0.0-20170926063155-7524189396c6/go.m github.com/evanphx/json-patch v3.0.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/evanphx/json-patch v4.1.0+incompatible h1:K1MDoo4AZ4wU0GIU/fPmtZg7VpzLjCxu+UwBD1FvwOc= github.com/evanphx/json-patch v4.1.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= -github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= @@ -101,45 +94,35 @@ 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/googleapis/gnostic v0.2.0 h1:l6N3VoaVzTncYYW+9yOz2LJJammFZGBO13sqgEhpy9g= github.com/googleapis/gnostic v0.2.0/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY= -github.com/gorilla/websocket v1.4.0 h1:WDFjx/TMzVgy9VdMMQi2K2Emtwi2QcUQsztZ/zLaH/Q= github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= github.com/gregjones/httpcache v0.0.0-20181110185634-c63ab54fda8f h1:ShTPMJQes6tubcjzGMODIVG5hlrCeImaBnZzKF2N8SM= github.com/gregjones/httpcache v0.0.0-20181110185634-c63ab54fda8f/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= -github.com/grpc-ecosystem/go-grpc-middleware v1.0.0 h1:BWIsLfhgKhV5g/oF34aRjniBHLTZe5DNekSjbAjIS6c= github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= -github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 h1:Ovs26xHkKqVztRpIrF/92BcuyuQ/YW4NSIpoGtfXNho= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= github.com/grpc-ecosystem/grpc-gateway v1.5.1/go.mod h1:RSKVYQBd5MCa4OVpNdGskqpgL2+G+NZTnrVHpWWfpdw= -github.com/grpc-ecosystem/grpc-gateway v1.6.3 h1:oQ+8y59SMDn8Ita1Sh4f94XCUVp8AB84sppXP8Qgiow= github.com/grpc-ecosystem/grpc-gateway v1.6.3/go.mod h1:RSKVYQBd5MCa4OVpNdGskqpgL2+G+NZTnrVHpWWfpdw= github.com/grpc-ecosystem/grpc-health-probe v0.2.0/go.mod h1:4GVx/bTCtZaSzhjbGueDY5YgBdsmKeVx+LErv/n0L6s= 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/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/imdario/mergo v0.3.6 h1:xTNEAn+kxVO7dTZGu0CegyqKZmoWFI0rF8UxjlB2d28= github.com/imdario/mergo v0.3.6/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= -github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= -github.com/jonboulle/clockwork v0.1.0 h1:VKV+ZcuP6l3yW9doeqz6ziZGgcynBVQO+obU0+0hcPo= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= github.com/json-iterator/go v1.1.5 h1:gL2yXlmiIo4+t+y32d4WGwOjKGYcGOuyrg46vadswDE= github.com/json-iterator/go v1.1.5/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/konsorten/go-windows-terminal-sequences v0.0.0-20180402223658-b729f2633dfe/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/konsorten/go-windows-terminal-sequences v1.0.1 h1:mweAR1A6xJ3oS2pRaGiHgQ4OO8tzTaLawm8vnODuwDk= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/mailru/easyjson v0.0.0-20180823135443-60711f1a8329 h1:2gxZ0XQIU/5z3Z3bUBu+FXuk2pFbkN6tcwi/pjyaDic= github.com/mailru/easyjson v0.0.0-20180823135443-60711f1a8329/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mattn/go-sqlite3 v1.9.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= -github.com/mattn/go-sqlite3 v1.10.0 h1:jbhqpg7tQe4SupckyijYiy0mJJ/pRyHvXf7JdWK860o= github.com/mattn/go-sqlite3 v1.10.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= -github.com/maxbrunsfeld/counterfeiter v0.0.0-20181017030959-1aadac120687 h1:fJasMUaV/LYZvzK4bUOj13rNXc4fhVzU0Vu1OlcGUd4= github.com/maxbrunsfeld/counterfeiter v0.0.0-20181017030959-1aadac120687/go.mod h1:aoVsckWnsNzazwF2kmD+bzgdr4GBlbK91zsdivQJ2eU= github.com/mitchellh/mapstructure v1.1.2 h1:fmNYVwqnSfB9mZU6OS2O6GsXM+wcskZDuKQzvN1EDeE= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= @@ -149,11 +132,8 @@ github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lN github.com/modern-go/reflect2 v1.0.1 h1:9f412s+6RmYXLWZSEzVVgPGK7C2PphHj5RJrvfx9AWI= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= -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/gomega v1.4.2-0.20180831124310-ae19f1b56d53 h1:W43ZAQzmBARaVM1WrnDDKjtfIkF6OyeElrMdKDQIYhY= github.com/onsi/gomega v1.4.2-0.20180831124310-ae19f1b56d53/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= -github.com/opencontainers/go-digest v1.0.0-rc1 h1:WzifXhOVOEOuFYOJAW6aQqW0TooG2iki3E3Ii+WN7gQ= github.com/opencontainers/go-digest v1.0.0-rc1/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= github.com/operator-framework/operator-lifecycle-manager v0.0.0-20181023032605-e838f7fb2186/go.mod h1:Ma5ZXd4S1vmMyewWlF7aO8CZiokR7Sd8dhSfkGkNU4U= github.com/operator-framework/operator-lifecycle-manager v0.0.0-20181218235825-c53c51a3572b/go.mod h1:c2QozxMttlmAql7kIIqCji72a1EMxmf6MmHEU2ppW/A= @@ -181,12 +161,10 @@ github.com/prometheus/procfs v0.0.0-20180725123919-05ee40e3a273/go.mod h1:c3At6R github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190104112138-b1a0a9a36d74 h1:d1Xoc24yp/pXmWl2leBiBA+Tptce6cQsA+MMx/nOOcY= github.com/prometheus/procfs v0.0.0-20190104112138-b1a0a9a36d74/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= -github.com/sclevine/spec v1.0.0 h1:ILQ08A/CHCz8GGqivOvI54Hy1U40wwcpkf7WtB1MQfY= github.com/sclevine/spec v1.0.0/go.mod h1:W4J29eT/Kzv7/b9IWLB055Z+qvVC9vt0Arko24q7p+U= github.com/sirupsen/logrus v1.1.1/go.mod h1:zrgwTnHtNr00buQ1vSptGe8m1f/BbgsPukg8qsT7A+A= github.com/sirupsen/logrus v1.2.0 h1:juTguoYk5qI21pwyTXY3B3Y5cOTH3ZUyZCg1v/mihuo= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= -github.com/soheilhy/cmux v0.1.4 h1:0HKaf1o97UwFjHH9o5XsHUOF+tqmdA7KEzXLpiyaw0E= github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= github.com/spf13/cobra v0.0.3 h1:ZlrZ4XsMRm04Fr5pSFxBgfND2EBVa1nLpiy1stUsX/8= github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= @@ -196,20 +174,14 @@ github.com/stevvooe/resumable v0.0.0-20180830230917-22b14a53ba50/go.mod h1:1pdIZ github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= -github.com/tmc/grpc-websocket-proxy v0.0.0-20171017195756-830351dc03c6 h1:lYIiVDtZnyTWlNwiAxLj0bbpTcx1BWCFhXjfsvmPdNc= github.com/tmc/grpc-websocket-proxy v0.0.0-20171017195756-830351dc03c6/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= -github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5 h1:LnC5Kc/wtumK+WB441p7ynQJzVuNRJiqddSIE3IlSEQ= github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/ugorji/go v1.1.1/go.mod h1:hnLbHMwcvSihnDhEfx2/BzKp2xb0Y+ErdfYcrs9tkJQ= github.com/ugorji/go/codec v0.0.0-20181022190402-e5e69e061d4f h1:y3Vj7GoDdcBkxFa2RUUFKM25TrBbWVDnjRDI0u975zQ= github.com/ugorji/go/codec v0.0.0-20181022190402-e5e69e061d4f/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= -github.com/xiang90/probing v0.0.0-20160813154853-07dd2e8dfe18 h1:MPPkRncZLN9Kh4MEFmbnK4h3BD7AUmskWv2+EeZJCCs= github.com/xiang90/probing v0.0.0-20160813154853-07dd2e8dfe18/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= -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/multierr v1.1.0 h1:HoEmRHQPVSqub6w2z2d2EOVs2fjyFRGyofhKuyDq0QI= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= -go.uber.org/zap v1.9.1 h1:XCJQEf3W6eZaVwhRBof6ImoYGJSITeKWsyeh3HFu/5o= go.uber.org/zap v1.9.1/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181015023909-0c41d7ab0a0e h1:IzypfodbhbnViNUO/MEh0FzCUooG97cIGfdggUrUSyU= @@ -225,7 +197,6 @@ golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAG golang.org/x/oauth2 v0.0.0-20181105165119-ca4130e427c7 h1:g9UOdtsRWEwHYUG2bDHMxKrvfSGE5epIX2HkaMHSMBY= golang.org/x/oauth2 v0.0.0-20181105165119-ca4130e427c7/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20181108010431-42b317875d0f h1:Bl/8QSvNqXvPGPGXa2z5xUTmV7VDcZyvRZ+QQXkXTZQ= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -240,9 +211,7 @@ golang.org/x/time v0.0.0-20181108054448-85acf8d2951c h1:fqgJT0MGcGpPgpWU7VRdRjuA golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20181011152555-a398e557df60/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20181207222222-4c874b978acb h1:YIXCxYolAiiPmVSqA4gVUVcHo8Mi1ivU7ANnK9a63JY= golang.org/x/tools v0.0.0-20181207222222-4c874b978acb/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -google.golang.org/appengine v1.1.0 h1:igQkv0AAhEIvTEpD5LIpAfav2eeVO9HBTjvKHVJPRSs= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20181016170114-94acd270e44e h1:I5s8aUkxqPjgAssfOv+dVr+4/7BC40WV6JhcVoORltI= @@ -250,16 +219,13 @@ google.golang.org/genproto v0.0.0-20181016170114-94acd270e44e/go.mod h1:JiN7NxoA google.golang.org/grpc v1.16.0 h1:dz5IJGuC2BB7qXR5AyHNwAUBhZscK2xVez7mznh72sY= google.golang.org/grpc v1.16.0/go.mod h1:0JHn/cJsOMiMfNA9+DeHDlAU7KAAB5GDlYFpa9MZMio= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= gopkg.in/natefinch/lumberjack.v2 v2.0.0-20170531160350-a96e63847dc3/go.mod h1:l0ndWWf7gzL7RNwBG7wST/UCcT4T24xpD6X8LsfU/+k= gopkg.in/natefinch/lumberjack.v2 v2.0.0 h1:1Lc07Kr7qY4U2YPouBjpCLxpiyxIVoxqXgkXLknAOE8= gopkg.in/natefinch/lumberjack.v2 v2.0.0/go.mod h1:l0ndWWf7gzL7RNwBG7wST/UCcT4T24xpD6X8LsfU/+k= -gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/yaml.v2 v2.2.1 h1:mUhvW9EsL+naU5Q3cakzfE91YhliOondGd6ZrsDBHQE= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= @@ -276,15 +242,12 @@ k8s.io/apimachinery v0.0.0-20181203235515-3d8ee2261517/go.mod h1:ccL7Eh7zubPUSh9 k8s.io/apiserver v0.0.0-20181026151315-13cfe3978170 h1:CqI85nZvPaV+7JFono0nAOGOx2brocqefcOhDPVhHKI= k8s.io/apiserver v0.0.0-20181026151315-13cfe3978170/go.mod h1:6bqaTSOSJavUIXUtfaR9Os9JtTCm8ZqH2SUl2S60C4w= k8s.io/client-go v0.0.0-20180718001006-59698c7d9724/go.mod h1:7vJpHMYJwNQCWgzmNV+VYUl1zCObLyodBc8nIyt8L5s= -k8s.io/client-go v8.0.0+incompatible h1:tTI4hRmb1DRMl4fG6Vclfdi6nTM82oIrTT7HfitmxC4= +k8s.io/client-go v8.0.0+incompatible h1:2pUaSg2x6iEHr8cia6zmWhoCXG1EDG9TCx9s//Aq7HY= k8s.io/client-go v8.0.0+incompatible/go.mod h1:7vJpHMYJwNQCWgzmNV+VYUl1zCObLyodBc8nIyt8L5s= -k8s.io/code-generator v0.0.0-20181203235156-f8cba74510f3 h1:f/Aa24HPnPEDWia884BCF94E1b29KYjOTVTHcBzvT2Q= k8s.io/code-generator v0.0.0-20181203235156-f8cba74510f3/go.mod h1:MYiN+ZJZ9HkETbgVZdWw2AsuAi9PZ4V80cwfuf2axe8= k8s.io/gengo v0.0.0-20181106084056-51747d6e00da/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= -k8s.io/gengo v0.0.0-20181113154421-fd15ee9cc2f7 h1:zjNgw2qqBQmKd0S59lGZBQqFxJqUZroVbDphfnVm5do= k8s.io/gengo v0.0.0-20181113154421-fd15ee9cc2f7/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= k8s.io/klog v0.0.0-20181102134211-b9b56d5dfc92/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= -k8s.io/klog v0.1.0 h1:I5HMfc/DtuVaGR1KPwUrTc476K8NCqNBldC7H4dYEzk= k8s.io/klog v0.1.0/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= k8s.io/kube-aggregator v0.0.0-20181204002017-122bac39d429 h1:wIDPKpRuwEfyt+ImBaP6wSEZeAR5gYJl/Mlg74L0hHI= k8s.io/kube-aggregator v0.0.0-20181204002017-122bac39d429/go.mod h1:8sbzT4QQKDEmSCIbfqjV0sd97GpUT7A4W626sBiYJmU= diff --git a/pkg/controller/operators/olm/operator_test.go b/pkg/controller/operators/olm/operator_test.go index d27071d429..17b1034bcc 100644 --- a/pkg/controller/operators/olm/operator_test.go +++ b/pkg/controller/operators/olm/operator_test.go @@ -479,7 +479,7 @@ func csv( Namespace: namespace, }, Spec: v1alpha1.ClusterServiceVersionSpec{ - MinKubeVersion: minKubeVersion, + MinKubeVersion: minKubeVersion, Replaces: replaces, InstallStrategy: installStrategy, InstallModes: []v1alpha1.InstallMode{ @@ -720,7 +720,7 @@ func TestTransitionCSV(t *testing.T) { csvs: []runtime.Object{ csv("csv1", namespace, - "0.0", + "0.0.0", "", installStrategy("csv1-dep1", nil, nil), []*v1beta1.CustomResourceDefinition{crd("c1", "v1")}, @@ -741,7 +741,7 @@ func TestTransitionCSV(t *testing.T) { csvs: []runtime.Object{ withAPIServices(csv("csv1", namespace, - "0.0", + "0.0.0", "", installStrategy("csv1-dep1", nil, nil), []*v1beta1.CustomResourceDefinition{}, @@ -762,7 +762,7 @@ func TestTransitionCSV(t *testing.T) { csvs: []runtime.Object{ csv("csv1", namespace, - "0.0", + "0.0.0", "", v1alpha1.NamedInstallStrategy{"deployment", json.RawMessage{}}, []*v1beta1.CustomResourceDefinition{crd("c1", "v1")}, @@ -786,7 +786,7 @@ func TestTransitionCSV(t *testing.T) { csvs: []runtime.Object{ csv("csv1", namespace, - "0.0", + "0.0.0", "", installStrategy("csv1-dep1", nil, @@ -831,7 +831,7 @@ func TestTransitionCSV(t *testing.T) { csvs: []runtime.Object{ csv("csv1", namespace, - "0.0", + "0.0.0", "", installStrategy("csv1-dep1", nil, nil), []*v1beta1.CustomResourceDefinition{crd("c1", "v1")}, @@ -856,7 +856,7 @@ func TestTransitionCSV(t *testing.T) { csvs: []runtime.Object{ withAPIServices(csv("csv1", namespace, - "0.0", + "0.0.0", "", installStrategy("csv1-dep1", nil, nil), []*v1beta1.CustomResourceDefinition{}, @@ -880,7 +880,7 @@ func TestTransitionCSV(t *testing.T) { csvs: []runtime.Object{ withAPIServices(csv("csv1", namespace, - "0.0", + "0.0.0", "", installStrategy("csv1-dep1", nil, nil), []*v1beta1.CustomResourceDefinition{}, @@ -905,7 +905,7 @@ func TestTransitionCSV(t *testing.T) { csvs: []runtime.Object{ withAPIServices(csv("csv1", namespace, - "0.0", + "0.0.0", "", installStrategy("csv1-dep1", nil, nil), []*v1beta1.CustomResourceDefinition{}, @@ -930,7 +930,7 @@ func TestTransitionCSV(t *testing.T) { csvs: []runtime.Object{ withAPIServices(csv("csv1", namespace, - "0.0", + "0.0.0", "", installStrategy("b1", nil, nil), []*v1beta1.CustomResourceDefinition{crd("c1", "v1")}, @@ -957,7 +957,7 @@ func TestTransitionCSV(t *testing.T) { csvs: []runtime.Object{ csv("csv1", namespace, - "0.0", + "0.0.0", "", installStrategy("csv1-dep1", nil, nil), []*v1beta1.CustomResourceDefinition{crd("c1", "v1")}, @@ -966,7 +966,7 @@ func TestTransitionCSV(t *testing.T) { ), csv("csv2", namespace, - "0.0", + "0.0.0", "", installStrategy("csv2-dep1", nil, nil), []*v1beta1.CustomResourceDefinition{crd("c1", "v1")}, @@ -997,7 +997,7 @@ func TestTransitionCSV(t *testing.T) { csvs: []runtime.Object{ withCertInfo(withAPIServices(csv("csv1", namespace, - "0.0", + "0.0.0", "", installStrategy("a1", nil, nil), []*v1beta1.CustomResourceDefinition{}, @@ -1006,7 +1006,7 @@ func TestTransitionCSV(t *testing.T) { ), apis("a1.v1.a1Kind"), nil), metav1.NewTime(time.Now().Add(24*time.Hour)), metav1.NewTime(time.Now())), withAPIServices(csv("csv2", namespace, - "0.0", + "0.0.0", "", installStrategy("a1", nil, nil), []*v1beta1.CustomResourceDefinition{}, @@ -1073,7 +1073,7 @@ func TestTransitionCSV(t *testing.T) { csvs: []runtime.Object{ csv("csv1", namespace, - "0.0", + "0.0.0", "", installStrategy("a1", nil, nil), []*v1beta1.CustomResourceDefinition{crd("c1", "v1")}, @@ -1097,7 +1097,7 @@ func TestTransitionCSV(t *testing.T) { csvs: []runtime.Object{ csv("csv1", namespace, - "0.0", + "0.0.0", "", installStrategy("a1", nil, nil), []*v1beta1.CustomResourceDefinition{crd("c1", "v1")}, @@ -1121,7 +1121,7 @@ func TestTransitionCSV(t *testing.T) { csvs: []runtime.Object{ csv("csv1", namespace, - "0.0", + "0.0.0", "", v1alpha1.NamedInstallStrategy{"deployment", json.RawMessage{}}, []*v1beta1.CustomResourceDefinition{crd("c1", "v1")}, @@ -1145,7 +1145,7 @@ func TestTransitionCSV(t *testing.T) { csvs: []runtime.Object{ csv("csv1", namespace, - "0.0", + "0.0.0", "", installStrategy("csv1-dep1", nil, nil), []*v1beta1.CustomResourceDefinition{crd("c1", "v1")}, @@ -1169,7 +1169,7 @@ func TestTransitionCSV(t *testing.T) { csvs: []runtime.Object{ withAPIServices(csv("csv1", namespace, - "0.0", + "0.0.0", "", installStrategy("csv1-dep1", nil, nil), []*v1beta1.CustomResourceDefinition{}, @@ -1191,7 +1191,7 @@ func TestTransitionCSV(t *testing.T) { csvs: []runtime.Object{ csv("csv1", namespace, - "0.0", + "0.0.0", "", installStrategy("csv1-dep1", nil, nil), []*v1beta1.CustomResourceDefinition{crd("c1", "v1")}, @@ -1215,7 +1215,7 @@ func TestTransitionCSV(t *testing.T) { csvs: []runtime.Object{ withAPIServices(csv("csv1", namespace, - "0.0", + "0.0.0", "", installStrategy("a1", nil, nil), []*v1beta1.CustomResourceDefinition{crd("c1", "v1")}, @@ -1239,7 +1239,7 @@ func TestTransitionCSV(t *testing.T) { csvs: []runtime.Object{ withCertInfo(withAPIServices(csv("csv1", namespace, - "0.0", + "0.0.0", "", installStrategy("a1", nil, nil), []*v1beta1.CustomResourceDefinition{crd("c1", "v1")}, @@ -1307,7 +1307,7 @@ func TestTransitionCSV(t *testing.T) { csvs: []runtime.Object{ withCertInfo(withAPIServices(csv("csv1", namespace, - "0.0", + "0.0.0", "", installStrategy("a1", nil, nil), []*v1beta1.CustomResourceDefinition{crd("c1", "v1")}, @@ -1375,7 +1375,7 @@ func TestTransitionCSV(t *testing.T) { csvs: []runtime.Object{ withCertInfo(withAPIServices(csv("csv1", namespace, - "0.0", + "0.0.0", "", installStrategy("a1", nil, nil), []*v1beta1.CustomResourceDefinition{crd("c1", "v1")}, @@ -1443,7 +1443,7 @@ func TestTransitionCSV(t *testing.T) { csvs: []runtime.Object{ withCertInfo(withAPIServices(csv("csv1", namespace, - "0.0", + "0.0.0", "", installStrategy("a1", nil, nil), []*v1beta1.CustomResourceDefinition{crd("c1", "v1")}, @@ -1511,7 +1511,7 @@ func TestTransitionCSV(t *testing.T) { csvs: []runtime.Object{ withCertInfo(withAPIServices(csv("csv1", namespace, - "0.0", + "0.0.0", "", installStrategy("a1", nil, nil), []*v1beta1.CustomResourceDefinition{crd("c1", "v1")}, @@ -1579,7 +1579,7 @@ func TestTransitionCSV(t *testing.T) { csvs: []runtime.Object{ withCertInfo(withAPIServices(csv("csv1", namespace, - "0.0", + "0.0.0", "", installStrategy("a1", nil, nil), []*v1beta1.CustomResourceDefinition{crd("c1", "v1")}, @@ -1647,7 +1647,7 @@ func TestTransitionCSV(t *testing.T) { csvs: []runtime.Object{ withCertInfo(withAPIServices(csv("csv1", namespace, - "0.0", + "0.0.0", "", installStrategy("a1", nil, nil), []*v1beta1.CustomResourceDefinition{crd("c1", "v1")}, @@ -1715,7 +1715,7 @@ func TestTransitionCSV(t *testing.T) { csvs: []runtime.Object{ withCertInfo(withAPIServices(csv("csv1", namespace, - "0.0", + "0.0.0", "", installStrategy("a1", nil, nil), []*v1beta1.CustomResourceDefinition{crd("c1", "v1")}, @@ -1783,7 +1783,7 @@ func TestTransitionCSV(t *testing.T) { csvs: []runtime.Object{ withConditionReason(csv("csv1", namespace, - "0.0", + "0.0.0", "", installStrategy("a1", nil, nil), []*v1beta1.CustomResourceDefinition{crd("c1", "v1")}, @@ -1812,7 +1812,7 @@ func TestTransitionCSV(t *testing.T) { csvs: []runtime.Object{ withInstallModes(withConditionReason(csv("csv1", namespace, - "0.0", + "0.0.0", "", installStrategy("a1", nil, nil), []*v1beta1.CustomResourceDefinition{crd("c1", "v1")}, @@ -1848,7 +1848,7 @@ func TestTransitionCSV(t *testing.T) { csvs: []runtime.Object{ csv("csv1", namespace, - "0.0", + "0.0.0", "", v1alpha1.NamedInstallStrategy{"deployment", json.RawMessage{}}, []*v1beta1.CustomResourceDefinition{crd("c1", "v1")}, @@ -1872,7 +1872,7 @@ func TestTransitionCSV(t *testing.T) { csvs: []runtime.Object{ csv("csv1", namespace, - "0.0", + "0.0.0", "", installStrategy("csv1-dep1", nil, nil), []*v1beta1.CustomResourceDefinition{crd("c1", "v1")}, @@ -1899,7 +1899,7 @@ func TestTransitionCSV(t *testing.T) { csvs: []runtime.Object{ withAPIServices(csv("csv1", namespace, - "0.0", + "0.0.0", "", installStrategy("a1", nil, nil), []*v1beta1.CustomResourceDefinition{crd("c1", "v1")}, @@ -1920,7 +1920,7 @@ func TestTransitionCSV(t *testing.T) { csvs: []runtime.Object{ csv("csv1", namespace, - "0.0", + "0.0.0", "", installStrategy("csv1-dep1", nil, nil), []*v1beta1.CustomResourceDefinition{crd("c1", "v1")}, @@ -1929,7 +1929,7 @@ func TestTransitionCSV(t *testing.T) { ), csv("csv2", namespace, - "0.0", + "0.0.0", "csv1", installStrategy("csv2-dep1", nil, nil), []*v1beta1.CustomResourceDefinition{crd("c1", "v1")}, @@ -1957,7 +1957,7 @@ func TestTransitionCSV(t *testing.T) { csvs: []runtime.Object{ csv("csv1", namespace, - "0.0", + "0.0.0", "", installStrategy("csv1-dep1", nil, nil), []*v1beta1.CustomResourceDefinition{crd("c1", "v1")}, @@ -1966,7 +1966,7 @@ func TestTransitionCSV(t *testing.T) { ), csv("csv2", namespace, - "0.0", + "0.0.0", "csv1", installStrategy("csv2-dep1", nil, nil), []*v1beta1.CustomResourceDefinition{crd("c1", "v1")}, @@ -1995,7 +1995,7 @@ func TestTransitionCSV(t *testing.T) { csvs: []runtime.Object{ csv("csv1", namespace, - "0.0", + "0.0.0", "", installStrategy("csv1-dep1", nil, nil), []*v1beta1.CustomResourceDefinition{crd("c1", "v1")}, @@ -2004,7 +2004,7 @@ func TestTransitionCSV(t *testing.T) { ), csv("csv2", namespace, - "0.0", + "0.0.0", "csv1", installStrategy("csv2-dep1", nil, nil), []*v1beta1.CustomResourceDefinition{crd("c1", "v1")}, @@ -2034,7 +2034,7 @@ func TestTransitionCSV(t *testing.T) { csvs: []runtime.Object{ csv("csv3", namespace, - "0.0", + "0.0.0", "csv2", installStrategy("csv3-dep1", nil, nil), []*v1beta1.CustomResourceDefinition{crd("c1", "v1")}, @@ -2043,7 +2043,7 @@ func TestTransitionCSV(t *testing.T) { ), csv("csv1", namespace, - "0.0", + "0.0.0", "", installStrategy("csv1-dep1", nil, nil), []*v1beta1.CustomResourceDefinition{crd("c1", "v1")}, @@ -2052,7 +2052,7 @@ func TestTransitionCSV(t *testing.T) { ), csv("csv2", namespace, - "0.0", + "0.0.0", "csv1", installStrategy("csv2-dep1", nil, nil), []*v1beta1.CustomResourceDefinition{crd("c1", "v1")}, @@ -2083,7 +2083,7 @@ func TestTransitionCSV(t *testing.T) { csvs: []runtime.Object{ csv("csv3", namespace, - "0.0", + "0.0.0", "csv2", installStrategy("csv3-dep1", nil, nil), []*v1beta1.CustomResourceDefinition{crd("c1", "v1")}, @@ -2092,7 +2092,7 @@ func TestTransitionCSV(t *testing.T) { ), csv("csv1", namespace, - "0.0", + "0.0.0", "", installStrategy("csv1-dep1", nil, nil), []*v1beta1.CustomResourceDefinition{crd("c1", "v1")}, @@ -2101,7 +2101,7 @@ func TestTransitionCSV(t *testing.T) { ), csv("csv2", namespace, - "0.0", + "0.0.0", "csv1", installStrategy("csv2-dep1", nil, nil), []*v1beta1.CustomResourceDefinition{crd("c1", "v1")}, @@ -2132,7 +2132,7 @@ func TestTransitionCSV(t *testing.T) { csvs: []runtime.Object{ csv("csv2", namespace, - "0.0", + "0.0.0", "csv1", installStrategy("csv2-dep1", nil, nil), []*v1beta1.CustomResourceDefinition{crd("c1", "v1")}, @@ -2141,7 +2141,7 @@ func TestTransitionCSV(t *testing.T) { ), csv("csv3", namespace, - "0.0", + "0.0.0", "csv2", installStrategy("csv3-dep1", nil, nil), []*v1beta1.CustomResourceDefinition{crd("c1", "v1")}, @@ -2171,7 +2171,7 @@ func TestTransitionCSV(t *testing.T) { csvs: []runtime.Object{ csv("csv2", namespace, - "0.0", + "0.0.0", "csv1", installStrategy("csv2-dep1", nil, nil), []*v1beta1.CustomResourceDefinition{crd("c1", "v1")}, @@ -2180,7 +2180,7 @@ func TestTransitionCSV(t *testing.T) { ), csv("csv3", namespace, - "0.0", + "0.0.0", "csv2", installStrategy("csv3-dep1", nil, nil), []*v1beta1.CustomResourceDefinition{crd("c1", "v1")}, @@ -2305,7 +2305,7 @@ func TestSyncOperatorGroups(t *testing.T) { crd := crd("c1.fake.api.group", "v1") operatorCSV := csv("csv1", operatorNamespace, - "0.0", + "0.0.0", "", installStrategy("csv1-dep1", permissions, nil), []*v1beta1.CustomResourceDefinition{crd}, @@ -2832,7 +2832,7 @@ func TestIsReplacing(t *testing.T) { }{ { name: "QueryErr", - in: csv("name", namespace, "0.0", "", installStrategy("dep", nil, nil), nil, nil, v1alpha1.CSVPhaseSucceeded), + in: csv("name", namespace, "0.0.0", "", installStrategy("dep", nil, nil), nil, nil, v1alpha1.CSVPhaseSucceeded), initial: initial{ csvs: []runtime.Object{}, }, @@ -2840,30 +2840,30 @@ func TestIsReplacing(t *testing.T) { }, { name: "CSVInCluster/NotReplacing", - in: csv("csv1", namespace, "0.0", "", installStrategy("dep", nil, nil), nil, nil, v1alpha1.CSVPhaseSucceeded), + in: csv("csv1", namespace, "0.0.0", "", installStrategy("dep", nil, nil), nil, nil, v1alpha1.CSVPhaseSucceeded), initial: initial{ csvs: []runtime.Object{ - csv("csv1", namespace, "0.0", "", installStrategy("dep", nil, nil), nil, nil, v1alpha1.CSVPhaseSucceeded), + csv("csv1", namespace, "0.0.0", "", installStrategy("dep", nil, nil), nil, nil, v1alpha1.CSVPhaseSucceeded), }, }, expected: nil, }, { name: "CSVInCluster/Replacing", - in: csv("csv2", namespace, "0.0", "csv1", installStrategy("dep", nil, nil), nil, nil, v1alpha1.CSVPhaseSucceeded), + in: csv("csv2", namespace, "0.0.0", "csv1", installStrategy("dep", nil, nil), nil, nil, v1alpha1.CSVPhaseSucceeded), initial: initial{ csvs: []runtime.Object{ - csv("csv1", namespace, "0.0", "", installStrategy("dep", nil, nil), nil, nil, v1alpha1.CSVPhaseSucceeded), + csv("csv1", namespace, "0.0.0", "", installStrategy("dep", nil, nil), nil, nil, v1alpha1.CSVPhaseSucceeded), }, }, - expected: csv("csv1", namespace, "0.0", "", installStrategy("dep", nil, nil), nil, nil, v1alpha1.CSVPhaseSucceeded), + expected: csv("csv1", namespace, "0.0.0", "", installStrategy("dep", nil, nil), nil, nil, v1alpha1.CSVPhaseSucceeded), }, { name: "CSVInCluster/ReplacingNotFound", - in: csv("csv2", namespace, "0.0", "csv1", installStrategy("dep", nil, nil), nil, nil, v1alpha1.CSVPhaseSucceeded), + in: csv("csv2", namespace, "0.0.0", "csv1", installStrategy("dep", nil, nil), nil, nil, v1alpha1.CSVPhaseSucceeded), initial: initial{ csvs: []runtime.Object{ - csv("csv3", namespace, "0.0", "", installStrategy("dep", nil, nil), nil, nil, v1alpha1.CSVPhaseSucceeded), + csv("csv3", namespace, "0.0.0", "", installStrategy("dep", nil, nil), nil, nil, v1alpha1.CSVPhaseSucceeded), }, }, expected: nil, @@ -2896,28 +2896,28 @@ func TestIsBeingReplaced(t *testing.T) { }{ { name: "QueryErr", - in: csv("name", namespace, "0.0", "", installStrategy("dep", nil, nil), nil, nil, v1alpha1.CSVPhaseSucceeded), + in: csv("name", namespace, "0.0.0", "", installStrategy("dep", nil, nil), nil, nil, v1alpha1.CSVPhaseSucceeded), expected: nil, }, { name: "CSVInCluster/NotReplacing", - in: csv("csv1", namespace, "0.0", "", installStrategy("dep", nil, nil), nil, nil, v1alpha1.CSVPhaseSucceeded), + in: csv("csv1", namespace, "0.0.0", "", installStrategy("dep", nil, nil), nil, nil, v1alpha1.CSVPhaseSucceeded), initial: initial{ csvs: map[string]*v1alpha1.ClusterServiceVersion{ - "csv2": csv("csv2", namespace, "0.0", "", installStrategy("dep", nil, nil), nil, nil, v1alpha1.CSVPhaseSucceeded), + "csv2": csv("csv2", namespace, "0.0.0", "", installStrategy("dep", nil, nil), nil, nil, v1alpha1.CSVPhaseSucceeded), }, }, expected: nil, }, { name: "CSVInCluster/Replacing", - in: csv("csv1", namespace, "0.0", "", installStrategy("dep", nil, nil), nil, nil, v1alpha1.CSVPhaseSucceeded), + in: csv("csv1", namespace, "0.0.0", "", installStrategy("dep", nil, nil), nil, nil, v1alpha1.CSVPhaseSucceeded), initial: initial{ csvs: map[string]*v1alpha1.ClusterServiceVersion{ - "csv2": csv("csv2", namespace, "0.0", "csv1", installStrategy("dep", nil, nil), nil, nil, v1alpha1.CSVPhaseSucceeded), + "csv2": csv("csv2", namespace, "0.0.0", "csv1", installStrategy("dep", nil, nil), nil, nil, v1alpha1.CSVPhaseSucceeded), }, }, - expected: csv("csv2", namespace, "0.0", "csv1", installStrategy("dep", nil, nil), nil, nil, v1alpha1.CSVPhaseSucceeded), + expected: csv("csv2", namespace, "0.0.0", "csv1", installStrategy("dep", nil, nil), nil, nil, v1alpha1.CSVPhaseSucceeded), }, } for _, tt := range tests { @@ -2944,28 +2944,28 @@ func TestCheckReplacement(t *testing.T) { }{ { name: "QueryErr", - in: csv("name", namespace, "0.0", "", installStrategy("dep", nil, nil), nil, nil, v1alpha1.CSVPhaseSucceeded), + in: csv("name", namespace, "0.0.0", "", installStrategy("dep", nil, nil), nil, nil, v1alpha1.CSVPhaseSucceeded), expected: nil, }, { name: "CSVInCluster/NotReplacing", - in: csv("csv1", namespace, "0.0", "", installStrategy("dep", nil, nil), nil, nil, v1alpha1.CSVPhaseSucceeded), + in: csv("csv1", namespace, "0.0.0", "", installStrategy("dep", nil, nil), nil, nil, v1alpha1.CSVPhaseSucceeded), initial: initial{ csvs: map[string]*v1alpha1.ClusterServiceVersion{ - "csv2": csv("csv2", namespace, "0.0", "", installStrategy("dep", nil, nil), nil, nil, v1alpha1.CSVPhaseSucceeded), + "csv2": csv("csv2", namespace, "0.0.0", "", installStrategy("dep", nil, nil), nil, nil, v1alpha1.CSVPhaseSucceeded), }, }, expected: nil, }, { name: "CSVInCluster/Replacing", - in: csv("csv1", namespace, "0.0", "", installStrategy("dep", nil, nil), nil, nil, v1alpha1.CSVPhaseSucceeded), + in: csv("csv1", namespace, "0.0.0", "", installStrategy("dep", nil, nil), nil, nil, v1alpha1.CSVPhaseSucceeded), initial: initial{ csvs: map[string]*v1alpha1.ClusterServiceVersion{ - "csv2": csv("csv2", namespace, "0.0", "csv1", installStrategy("dep", nil, nil), nil, nil, v1alpha1.CSVPhaseSucceeded), + "csv2": csv("csv2", namespace, "0.0.0", "csv1", installStrategy("dep", nil, nil), nil, nil, v1alpha1.CSVPhaseSucceeded), }, }, - expected: csv("csv2", namespace, "0.0", "csv1", installStrategy("dep", nil, nil), nil, nil, v1alpha1.CSVPhaseSucceeded), + expected: csv("csv2", namespace, "0.0.0", "csv1", installStrategy("dep", nil, nil), nil, nil, v1alpha1.CSVPhaseSucceeded), }, } for _, tt := range tests { diff --git a/pkg/controller/operators/olm/requirements.go b/pkg/controller/operators/olm/requirements.go index 99988b7908..936ce8555e 100644 --- a/pkg/controller/operators/olm/requirements.go +++ b/pkg/controller/operators/olm/requirements.go @@ -3,7 +3,7 @@ package olm import ( "encoding/json" "fmt" - "strconv" + "strings" "github.com/sirupsen/logrus" @@ -38,15 +38,16 @@ func (a *Operator) minKubeVersionStatus(name string, minKubeVersion string) (met status.Message = "Server version discovery error" met = false statuses = append(statuses, status) + return } - // copy necessary fields into comparable for semver - majorInt, err := strconv.ParseInt(serverVersionInfo.Major, 10, 64) - minorInt, err := strconv.ParseInt(serverVersionInfo.Minor, 10, 64) - - serverVersionComparable := semver.Version{ - Major: majorInt, - Minor: minorInt, + serverVersion, err := semver.NewVersion(strings.TrimPrefix(serverVersionInfo.String(), "v")) + if err != nil { + status.Status = v1alpha1.RequirementStatusReasonPresentNotSatisfied + status.Message = "Server version parsing error" + met = false + statuses = append(statuses, status) + return } csvVersionInfo, err := semver.NewVersion(minKubeVersion) @@ -55,15 +56,21 @@ func (a *Operator) minKubeVersionStatus(name string, minKubeVersion string) (met status.Message = "CSV version parsing error" met = false statuses = append(statuses, status) + return } - if csvVersionInfo.Compare(serverVersionComparable) < 0 { + if csvVersionInfo.Compare(*serverVersion) < 0 { status.Status = v1alpha1.RequirementStatusReasonPresentNotSatisfied status.Message = "CSV version requirement not met" met = false statuses = append(statuses, status) + return } + status.Status = v1alpha1.RequirementStatusReasonPresent + status.Message = fmt.Sprintf("CSV minKubeVersion (%s) less than server version (%s)", minKubeVersion, serverVersionInfo.String()) + met = true + statuses = append(statuses, status) return } @@ -347,7 +354,7 @@ func (a *Operator) requirementAndPermissionStatus(csv *v1alpha1.ClusterServiceVe } // Check kubernetes version requirement between CSV and server - minKubeMet, minKubeStatus := a.minKubeVersionStatus(csv.Spec.DisplayName, csv.Spec.MinKubeVersion) + minKubeMet, minKubeStatus := a.minKubeVersionStatus(csv.GetName(), csv.Spec.MinKubeVersion) reqMet, reqStatuses := a.requirementStatus(strategyDetailsDeployment, csv.GetAllCRDDescriptions(), csv.GetOwnedAPIServiceDescriptions(), csv.GetRequiredAPIServiceDescriptions(), csv.Spec.NativeAPIs) allReqStatuses := append(minKubeStatus, reqStatuses...)