diff --git a/go.mod b/go.mod index a7989bfa..2df4de20 100644 --- a/go.mod +++ b/go.mod @@ -12,6 +12,7 @@ require ( github.com/Microsoft/go-winio v0.4.14 // indirect github.com/blang/semver v3.5.1+incompatible github.com/containerd/containerd v1.3.0-beta.0.0.20190808172034-23faecfb66ab // indirect + github.com/coreos/bbolt v1.3.1-coreos.6 // indirect github.com/coreos/etcd v3.3.17+incompatible github.com/coreos/go-semver v0.3.0 github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f // indirect @@ -21,25 +22,40 @@ require ( github.com/ghodss/yaml v1.0.0 github.com/go-bindata/go-bindata v3.1.2+incompatible github.com/go-ini/ini v1.37.0 + github.com/golang/groupcache v0.0.0-20191027212112-611e8accdfc9 // indirect + github.com/gopherjs/gopherjs v0.0.0-20191106031601-ce3c9ade29de // indirect github.com/gorilla/mux v1.7.3 // indirect + github.com/grpc-ecosystem/go-grpc-middleware v1.1.0 // indirect + github.com/grpc-ecosystem/grpc-gateway v1.12.1 // indirect + github.com/hashicorp/golang-lru v0.5.3 // indirect + github.com/konsorten/go-windows-terminal-sequences v1.0.2 // indirect github.com/mattn/go-colorable v0.1.2 github.com/mcuadros/go-version v0.0.0-20180611085657-6d5863ca60fa github.com/morikuni/aec v0.0.0-20170113033406-39771216ff4c // indirect github.com/opencontainers/image-spec v1.0.1 // indirect github.com/pkg/errors v0.9.1 github.com/rancher/norman v0.0.0-20200517050325-f53cae161640 - github.com/rancher/types v0.0.0-20200609171939-d21f6b7b59e8 github.com/sirupsen/logrus v1.4.2 + github.com/smartystreets/assertions v1.0.1 // indirect + github.com/smartystreets/goconvey v1.6.4 // indirect github.com/stretchr/testify v1.4.0 github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5 // indirect github.com/urfave/cli v1.20.0 + go.uber.org/atomic v1.5.0 // indirect golang.org/x/crypto v0.0.0-20200220183623-bac4c82f6975 + golang.org/x/net v0.0.0-20191112182307-2180aed22343 // indirect golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e + golang.org/x/time v0.0.0-20191024005414-555d28b269f0 // indirect + golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2 // indirect + google.golang.org/appengine v1.6.5 // indirect + google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9 // indirect + gopkg.in/ini.v1 v1.51.0 // indirect gopkg.in/yaml.v2 v2.2.8 k8s.io/api v0.18.0 k8s.io/apimachinery v0.18.0 k8s.io/apiserver v0.18.0 k8s.io/client-go v12.0.0+incompatible + k8s.io/gengo v0.0.0-20200114144118-36b2048a9120 k8s.io/kubectl v0.18.0 sigs.k8s.io/yaml v1.2.0 ) diff --git a/go.sum b/go.sum index a309f1c2..d1f5e703 100644 --- a/go.sum +++ b/go.sum @@ -1,43 +1,16 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= -cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= -cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= -cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= -cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= -cloud.google.com/go v0.49.0/go.mod h1:hGvAdzcWNbyuxS3nWhD7H2cIJxjRRTRLQVB0bdputVY= -cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= -cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= -cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= -cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= -cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= -cloud.google.com/go/storage v1.3.0/go.mod h1:9IAwXhoyBJ7z9LcAwkj0/7NnPzYaPeZxxVp3zm+5IqA= -contrib.go.opencensus.io/exporter/ocagent v0.6.0/go.mod h1:zmKjrJcdo0aYcVS7bmEeSEBLPA9YJp5bjrofdU3pIXs= -dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= -github.com/Azure/azure-pipeline-go v0.2.1/go.mod h1:UGSo8XybXnIGZ3epmeBw7Jdz+HiUVpqIlpz/HKHylF4= -github.com/Azure/azure-pipeline-go v0.2.2/go.mod h1:4rQ/NZncSvGqNkkOsNpOU1tgoNuIlp9AfUH5G1tvCHc= -github.com/Azure/azure-sdk-for-go v23.2.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= -github.com/Azure/azure-sdk-for-go v36.1.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= -github.com/Azure/azure-storage-blob-go v0.8.0/go.mod h1:lPI3aLPpuLTeUwh1sViKXFxwl2B6teiRqI0deQUvsw0= 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 v11.2.8+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= github.com/Azure/go-autorest/autorest v0.9.0/go.mod h1:xyHB1BMZT0cuDHU7I0+g046+BFDTQ8rEZB0s4Yfa6bI= -github.com/Azure/go-autorest/autorest v0.9.3-0.20191028180845-3492b2aff503/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.8.1-0.20191028180845-3492b2aff503/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.1-0.20191028180845-3492b2aff503/go.mod h1:MgwOyqaIuKdG4TL/2ywSsIWKAfJfgHDo8ObuUk3t5sA= -github.com/Azure/go-autorest/autorest/validation v0.2.1-0.20191028180845-3492b2aff503/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= -github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= -github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= github.com/MakeNowJust/heredoc v0.0.0-20170808103936-bb23615498cd h1:sjQovDkwrZp8u+gxLtPgKGjk5hCxuy2hrRejBTA9xFU= github.com/MakeNowJust/heredoc v0.0.0-20170808103936-bb23615498cd/go.mod h1:64YHyfSL2R96J44Nlwm39UHepQbyR5q10x7iYa1ks2E= github.com/Masterminds/goutils v1.1.0 h1:zukEsf/1JZwCMgHiK3GZftabmxiCw4apj3a28RPBiVg= @@ -49,9 +22,6 @@ github.com/Masterminds/sprig/v3 v3.0.0/go.mod h1:NEUY/Qq8Gdm2xgYA+NwJM6wmfdRV9xk github.com/Microsoft/go-winio v0.4.14 h1:+hMXMk01us9KgxGb7ftKQt2Xpf5hH/yky+TDA+qxleU= github.com/Microsoft/go-winio v0.4.14/go.mod h1:qXqCSQ3Xa7+6tgxaGTIe4Kpcdsi+P8jBhyzoq1bpyYA= github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= -github.com/NYTimes/gziphandler v1.1.1/go.mod h1:n/CVRwUEOgIxrgPvAQhUUr9oeUtvrhMomdKFjzJNB0c= -github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= -github.com/OneOfOne/xxhash v1.2.6/go.mod h1:eZbhyaAYD41SGSSsnmcpxVoRiQ/MPUTjUdIIOT9Um7Q= github.com/PuerkitoBio/purell v1.0.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= github.com/PuerkitoBio/purell v1.1.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= github.com/PuerkitoBio/purell v1.1.1 h1:WEQqlqaGbrPkxLJWfBwQmfEAE1Z7ONdDLqrN38tNFfI= @@ -59,28 +29,16 @@ github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbt github.com/PuerkitoBio/urlesc v0.0.0-20160726150825-5bd2802263f2/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 h1:d+Bc7a5rLufV/sSk/8dngufqelfh6jnri85riMAaF/M= github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= -github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo= -github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= github.com/agnivade/levenshtein v1.0.1/go.mod h1:CURSv5d9Uaml+FovSIICkLbAUZ9S4RqaHDIsdSBg7lM= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= -github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= -github.com/aliyun/aliyun-oss-go-sdk v2.0.4+incompatible/go.mod h1:T/Aws4fEfogEE9v+HPhhw+CntffsBHJ8nXQCwKr0/g8= github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8= github.com/antihax/optional v0.0.0-20180407024304-ca021399b1a6/go.mod h1:V8iCPQYkqmusNa815XgQio277wI47sdRh1dUOLdyC6Q= -github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= -github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= -github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= -github.com/armon/go-metrics v0.3.0/go.mod h1:zXjbSimjXTd7vOpY8B0/2LpvNvDoXBuplAD+gJD3GYs= -github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= -github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/asaskevich/govalidator v0.0.0-20180720115003-f9ffefc3facf/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= -github.com/aws/aws-sdk-go v1.25.48/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= -github.com/baiyubin/aliyun-sts-go-sdk v0.0.0-20180326062324-cfa1a18b161f/go.mod h1:AuiFmCCPBSrqvVMvuqFuk0qogytodnVFVSN5CeJB8Gc= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= @@ -89,29 +47,17 @@ github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kB github.com/blang/semver v3.5.0+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk= github.com/blang/semver v3.5.1+incompatible h1:cQNTCjp13qL8KC3Nbxr/y2Bqb63oX6wdnnjpJbkM4JQ= github.com/blang/semver v3.5.1+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk= -github.com/bradfitz/gomemcache v0.0.0-20190913173617-a41fca850d0b/go.mod h1:H0wQNHz2YrLsuXOZozoeDmnHXkNCRmMW0gwFWDfEZDA= -github.com/brancz/gojsontoyaml v0.0.0-20190425155809-e8bd32d46b3d/go.mod h1:IyUJYN1gvWjtLF5ZuygmxbnsAyP3aJS6cHzIuZY50B0= -github.com/campoy/embedmd v1.0.0/go.mod h1:oxyr9RCiSXg0M3VJ3ks0UGfp98BpSSGr0kpiX3MzVl8= -github.com/cenkalti/backoff v0.0.0-20181003080854-62661b46c409/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/cespare/xxhash v0.0.0-20181017004759-096ff4a8a059/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= -github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= -github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= -github.com/cespare/xxhash/v2 v2.1.0/go.mod h1:dgIUBU3pDso/gPgZ1osOZ0iQf77oPR28Tjxl5dIMyVM= github.com/cespare/xxhash/v2 v2.1.1 h1:6MnRN8NT7+YBpUIWxHtefFZOKTAPgGjpQSxqLNn0+qY= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/chai2010/gettext-go v0.0.0-20160711120539-c6fed771bfd5/go.mod h1:/iP1qXHoty45bqomnu2LM+VVyAEdWN+vtSHGlQgyxbw= -github.com/circonus-labs/circonus-gometrics v2.3.1+incompatible/go.mod h1:nmEj6Dob7S7YxXgwXpfOuvO54S+tGdZdw9fuRZt25Ag= -github.com/circonus-labs/circonusllhist v0.1.3/go.mod h1:kMXHVDlOchFAehlya5ePtbp5jckzBHf4XRpQvBOLI+I= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= -github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= github.com/containerd/containerd v1.3.0-beta.0.0.20190808172034-23faecfb66ab h1:lLoKpH/jolCo6LOWonSg8psTvcGAF7qklWRhcfvVsqc= github.com/containerd/containerd v1.3.0-beta.0.0.20190808172034-23faecfb66ab/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= github.com/coreos/bbolt v1.3.1-coreos.6 h1:uTXKg9gY70s9jMAKdfljFQcuh4e/BXOM+V+d00KFj3A= github.com/coreos/bbolt v1.3.1-coreos.6/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= -github.com/coreos/etcd v3.3.15+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/etcd v3.3.17+incompatible h1:f/Z3EoDSx1yjaIjLQGo1diYUlQYSBrrAQ5vP8NjwXwo= github.com/coreos/etcd v3.3.17+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk= @@ -126,18 +72,14 @@ github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfc github.com/coreos/pkg v0.0.0-20180108230652-97fdf19511ea/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= 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/coreos/prometheus-operator v0.36.0 h1:ayzkQoqfbnEne+ZMOZl30ZzSymY6KFpzA58QLz+4wlw= -github.com/coreos/prometheus-operator v0.36.0/go.mod h1:b1ydz/Rg9TqDtHu2MDXKfiX/Hv0Bogy1iY82fRbhEFg= github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= -github.com/davecgh/go-spew v0.0.0-20151105211317-5215b55f46b2/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= 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/daviddengcn/go-colortext v0.0.0-20160507010035-511bcaf42ccd/go.mod h1:dv4zxwHi5C/8AeI+4gX4dCWOIvNi7I6JCSX0HvlKPgE= 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/dgryski/go-sip13 v0.0.0-20190329191031-25c5027a8c7b/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= github.com/docker/distribution v2.7.1+incompatible h1:a5mlkVzth6W5A4fOsS3D2EO5BUmsJpcB+cRlLU7cSug= github.com/docker/distribution v2.7.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= github.com/docker/docker v0.7.3-0.20190327010347-be7ac8be2ae0/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= @@ -153,21 +95,11 @@ github.com/docker/spdystream v0.0.0-20160310174837-449fdfce4d96/go.mod h1:Qh8CwZ github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE= github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= -github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs= -github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU= -github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I= -github.com/edsrzf/mmap-go v1.0.0/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M= -github.com/elastic/go-sysinfo v1.0.1/go.mod h1:O/D5m1VpYLwGjCYzEt63g3Z1uO3jXfwyzzjiW90t8cY= -github.com/elastic/go-sysinfo v1.1.1/go.mod h1:i1ZYdU10oLNfRzq4vq62BEwD2fH8KaWh6eh0ikPT9F0= -github.com/elastic/go-windows v1.0.0/go.mod h1:TsU0Nrp7/y3+VwE82FoZF8gC/XFg/Elz6CcloAxnPgU= -github.com/elastic/go-windows v1.0.1/go.mod h1:FoVvqWSun28vaDQPbj2Elfc0JahhPB7WQEGa3c814Ss= -github.com/elazarl/goproxy v0.0.0-20170405201442-c4fc26588b6e/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153 h1:yUdfgN0XgIJw7foRItutHYUIhlcKzcSf5vDpdhQAKTc= github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= github.com/emicklei/go-restful v2.9.5+incompatible h1:spTtZBk5DYEvbxMVutUuTyh1Ao2r4iyvLdACqsl/Ljk= github.com/emicklei/go-restful v2.9.5+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= -github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/evanphx/json-patch v4.2.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= @@ -175,11 +107,8 @@ github.com/evanphx/json-patch v4.5.0+incompatible h1:ouOWdg56aJriqS0huScTkVXPC5I github.com/evanphx/json-patch v4.5.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/exponent-io/jsonpath v0.0.0-20151013193312-d6023ce2651d h1:105gxyaGwCFad8crR9dcMQWvV9Hvulu6hwUh4tWPJnM= github.com/exponent-io/jsonpath v0.0.0-20151013193312-d6023ce2651d/go.mod h1:ZZMPRZwes7CROmyNKgQzC3XPs6L/G2EJLHddWejkmf4= -github.com/facette/natsort v0.0.0-20181210072756-2cd4dd1e2dcb/go.mod h1:bH6Xx7IW64qjjJq8M2u4dxNaBiDfKK+z/3eGDpXEQhc= github.com/fatih/camelcase v1.0.0/go.mod h1:yN2Sb0lFhZJUdVvtELVWefmrXpuZESvPmqwoZc+/fpc= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= -github.com/fatih/structtag v1.1.0/go.mod h1:mBJUNpUnHmRKrKlQQlmCrh5PuhftFbNv8Ys4/aAZl94= -github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g= 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 v0.0.0-20150909031657-73d445a93680/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= @@ -189,7 +118,6 @@ github.com/globalsign/mgo v0.0.0-20180905125535-1ca0a4f7cbcb/go.mod h1:xkRDCp4j0 github.com/globalsign/mgo v0.0.0-20181015135952-eeefdecb41b8/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q= github.com/go-bindata/go-bindata v3.1.2+incompatible h1:5vjJMVhowQdPzjE1LdxyFF7YFTXg5IgGVW4gBr5IbvE= github.com/go-bindata/go-bindata v3.1.2+incompatible/go.mod h1:xK8Dsgwmeed+BBsSy2XTopBn/8uK2HWuGSnA11C3Joo= -github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-ini/ini v1.37.0 h1:/FpMfveJbc7ExTTDgT5nL9Vw+aZdst/c2dOxC931U+M= github.com/go-ini/ini v1.37.0/go.mod h1:ByCAeIL28uOIIG0E3PJtZPDL8WnHpFKFOtgjp+3Ies8= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= @@ -199,89 +127,69 @@ github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas= github.com/go-openapi/analysis v0.0.0-20180825180245-b006789cd277/go.mod h1:k70tL6pCuVxPJOHXQ+wIac1FUrvNkHolPie/cLEU6hI= github.com/go-openapi/analysis v0.17.0/go.mod h1:IowGgpVeD0vNm45So8nr+IcQ3pxVtpRoBWb8PVZO0ik= -github.com/go-openapi/analysis v0.17.2/go.mod h1:IowGgpVeD0vNm45So8nr+IcQ3pxVtpRoBWb8PVZO0ik= github.com/go-openapi/analysis v0.18.0/go.mod h1:IowGgpVeD0vNm45So8nr+IcQ3pxVtpRoBWb8PVZO0ik= github.com/go-openapi/analysis v0.19.2/go.mod h1:3P1osvZa9jKjb8ed2TPng3f0i/UY9snX6gxi44djMjk= github.com/go-openapi/analysis v0.19.5/go.mod h1:hkEAkxagaIvIP7VTn8ygJNkd4kAYON2rCu0v0ObL0AU= github.com/go-openapi/errors v0.17.0/go.mod h1:LcZQpmvG4wyF5j4IhA73wkLFQg+QJXOQHVjmcZxhka0= -github.com/go-openapi/errors v0.17.2/go.mod h1:LcZQpmvG4wyF5j4IhA73wkLFQg+QJXOQHVjmcZxhka0= github.com/go-openapi/errors v0.18.0/go.mod h1:LcZQpmvG4wyF5j4IhA73wkLFQg+QJXOQHVjmcZxhka0= github.com/go-openapi/errors v0.19.2/go.mod h1:qX0BLWsyaKfvhluLejVpVNwNRdXZhEbTA4kxxpKBC94= 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.17.2/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/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.17.2/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/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= github.com/go-openapi/loads v0.17.0/go.mod h1:72tmFy5wsWx89uEVddd0RjRWPZm92WRLhf7AC+0+OOU= -github.com/go-openapi/loads v0.17.2/go.mod h1:72tmFy5wsWx89uEVddd0RjRWPZm92WRLhf7AC+0+OOU= github.com/go-openapi/loads v0.18.0/go.mod h1:72tmFy5wsWx89uEVddd0RjRWPZm92WRLhf7AC+0+OOU= github.com/go-openapi/loads v0.19.0/go.mod h1:72tmFy5wsWx89uEVddd0RjRWPZm92WRLhf7AC+0+OOU= github.com/go-openapi/loads v0.19.2/go.mod h1:QAskZPMX5V0C2gvfkGZzJlINuP7Hx/4+ix5jWFxsNPs= github.com/go-openapi/loads v0.19.4/go.mod h1:zZVHonKd8DXyxyw4yfnVjPzBjIQcLt0CCsn0N0ZrQsk= github.com/go-openapi/runtime v0.0.0-20180920151709-4f900dc2ade9/go.mod h1:6v9a6LTXWQCdL8k1AO3cvqx5OtZY/Y9wKTgaoP6YRfA= -github.com/go-openapi/runtime v0.18.0/go.mod h1:uI6pHuxWYTy94zZxgcwJkUWa9wbIlhteGfloI10GD4U= github.com/go-openapi/runtime v0.19.0/go.mod h1:OwNfisksmmaZse4+gpV3Ne9AyMOlP1lt4sK4FXt0O64= github.com/go-openapi/runtime v0.19.4/go.mod h1:X277bwSUBxVlCYR3r7xgZZGKVvBd/29gLDlFGtJ8NL4= 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.17.2/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/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= github.com/go-openapi/strfmt v0.17.0/go.mod h1:P82hnJI0CXkErkXi8IKjPbNBM6lV6+5pLP5l494TcyU= -github.com/go-openapi/strfmt v0.17.2/go.mod h1:P82hnJI0CXkErkXi8IKjPbNBM6lV6+5pLP5l494TcyU= github.com/go-openapi/strfmt v0.18.0/go.mod h1:P82hnJI0CXkErkXi8IKjPbNBM6lV6+5pLP5l494TcyU= github.com/go-openapi/strfmt v0.19.0/go.mod h1:+uW+93UVvGGq2qGaZxdDeJqSAqBqBdl+ZPMF/cC8nDY= -github.com/go-openapi/strfmt v0.19.2/go.mod h1:0yX7dbo8mKIvc3XSKp7MNfxw4JytCfCD6+bY1AVL9LU= github.com/go-openapi/strfmt v0.19.3/go.mod h1:0yX7dbo8mKIvc3XSKp7MNfxw4JytCfCD6+bY1AVL9LU= 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.17.2/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/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= -github.com/go-openapi/swag v0.19.4/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= -github.com/go-openapi/validate v0.17.2/go.mod h1:Uh4HdOzKt19xGIGm1qHf/ofbX1YQ4Y+MYsct2VUrAJ4= github.com/go-openapi/validate v0.18.0/go.mod h1:Uh4HdOzKt19xGIGm1qHf/ofbX1YQ4Y+MYsct2VUrAJ4= github.com/go-openapi/validate v0.19.2/go.mod h1:1tRCw7m3jtI8eNWEEliiAqUIcBztB2KDnRCRMUi7GTA= github.com/go-openapi/validate v0.19.5/go.mod h1:8DJv2CVJQ6kGNpFW6eV9N3JviE1C85nY1c2z52x1Gk4= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/gobuffalo/flect v0.1.5/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.0/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/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= -github.com/gogo/protobuf v1.2.2-0.20190730201129-28a6bbf47e48/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-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20191027212112-611e8accdfc9 h1:uHTyIjqVhYRhLbJ8nIiOJHkEZZ+5YoOsAbD3sk82NiE= github.com/golang/groupcache v0.0.0-20191027212112-611e8accdfc9/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -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/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= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golangplus/bytes v0.0.0-20160111154220-45c989fe5450/go.mod h1:Bk6SMAONeMXrxql8uvOKuAZSu8aM5RUGv+1C6IJaEho= github.com/golangplus/fmt v0.0.0-20150411045040-2a5d6d7d2995/go.mod h1:lJgMEyOkYFkPcDKwRXegd+iM6E7matEszMG5HhwytU8= github.com/golangplus/testing v0.0.0-20180327235837-af21d9c3145e/go.mod h1:0AA//k/eakGydO4jKRoRL2j92ZKSzTgj9tclaCrvXHk= @@ -293,36 +201,23 @@ github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMyw github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.4.0 h1:xsAVV57WRhGj6kEIi8ReJzQlHHqcBYCElAvkovg3B/4= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= -github.com/google/gofuzz v0.0.0-20161122191042-44d81051d367/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI= 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/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= -github.com/google/pprof v0.0.0-20190723021845-34ac40c74b70/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= -github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.1.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= -github.com/googleapis/gax-go v2.0.2+incompatible/go.mod h1:SFVmujtThgffbyetf+mdk2eWhX2bMyUtNHzFKcPA9HY= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= -github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= -github.com/googleapis/gnostic v0.0.0-20170426233943-68f4ded48ba9/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY= github.com/googleapis/gnostic v0.0.0-20170729233727-0c5108395e2d/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY= github.com/googleapis/gnostic v0.1.0/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY= github.com/googleapis/gnostic v0.3.1 h1:WeAefnSUHlBb0iJKwxFDZdbfGwkd7xRNuV+IpXMJhYk= github.com/googleapis/gnostic v0.3.1/go.mod h1:on+2t9HRStVgn95RSsFWFz+6Q0Snyqv1awfrALZdbtU= github.com/gophercloud/gophercloud v0.1.0/go.mod h1:vxM41WHh5uqHVBMZHzuwNOHh8XEoIEcSTewFxm1c5g8= -github.com/gophercloud/gophercloud v0.3.0/go.mod h1:vxM41WHh5uqHVBMZHzuwNOHh8XEoIEcSTewFxm1c5g8= -github.com/gophercloud/gophercloud v0.6.0/go.mod h1:GICNByuaEBibcjmjvI7QvYJSZEbGkcYwAR7EZK2WMqM= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gopherjs/gopherjs v0.0.0-20191106031601-ce3c9ade29de h1:F7WD09S8QB4LrkEpka0dFPLSotH11HRpCsLIbIcJ7sU= github.com/gopherjs/gopherjs v0.0.0-20191106031601-ce3c9ade29de/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= -github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= -github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= github.com/gorilla/mux v1.7.3 h1:gnP5JzjVOuiZD07fKKToCAOjS0yOpj/qPETTXCCS6hw= github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= @@ -330,50 +225,19 @@ github.com/gorilla/websocket v1.4.0 h1:WDFjx/TMzVgy9VdMMQi2K2Emtwi2QcUQsztZ/zLaH github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7 h1:pdN6V1QBWetyv/0+wjACpqVH+eVULgEjkurDLq3goeM= github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= -github.com/grpc-ecosystem/go-grpc-middleware v0.0.0-20190222133341-cfaf5686ec79/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= github.com/grpc-ecosystem/go-grpc-middleware v1.1.0 h1:THDBEeQ9xZ8JEaCLyLQqXMMdRqNr0QAUJTIkQAUtFjg= github.com/grpc-ecosystem/go-grpc-middleware v1.1.0/go.mod h1:f5nM7jw/oeRSadq3xCzHAvxcr8HZnzsqU6ILg/0NiiE= 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.3.0/go.mod h1:RSKVYQBd5MCa4OVpNdGskqpgL2+G+NZTnrVHpWWfpdw= -github.com/grpc-ecosystem/grpc-gateway v1.9.4/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/grpc-ecosystem/grpc-gateway v1.12.1 h1:zCy2xE9ablevUOrUZc3Dl72Dt+ya2FNAvC2yLYMHzi4= github.com/grpc-ecosystem/grpc-gateway v1.12.1/go.mod h1:8XEsbTttt/W+VvjtQhLACqCisSPWTxCZ7sBRjU6iH9c= -github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q= -github.com/hashicorp/consul/api v1.3.0/go.mod h1:MmDNSzIMUjNpY/mQ398R4bk2FnqQLoPndWW5VkKPlCE= -github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= -github.com/hashicorp/consul/sdk v0.3.0/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= -github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= -github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= -github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= -github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= -github.com/hashicorp/go-immutable-radix v1.1.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= -github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= -github.com/hashicorp/go-msgpack v0.5.5/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= -github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= -github.com/hashicorp/go-retryablehttp v0.5.3/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= -github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= -github.com/hashicorp/go-rootcerts v1.0.1/go.mod h1:pqUvnprVnM5bf7AOirdbb01K4ccR319Vf4pU3K5EGc8= -github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= -github.com/hashicorp/go-sockaddr v1.0.2/go.mod h1:rB4wwRAUzs07qva3c5SdrY/NEtAUjGlgmH/UkBUC97A= -github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= -github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= -github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= -github.com/hashicorp/go-version v1.1.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= -github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.3 h1:YPkqC67at8FYaadspW/6uE0COsBxS2656RLEr8Bppgk= github.com/hashicorp/golang-lru v0.5.3/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= -github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= -github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= -github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= -github.com/hashicorp/memberlist v0.1.5/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= -github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= -github.com/hashicorp/serf v0.8.5/go.mod h1:UpNcs7fFbpKIyZaUuSW6EPiH+eZC7OuyFD+wc1oal+k= github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/huandu/xstrings v1.2.0 h1:yPeWdRnmynF7p+lLYz0H2tthW9lqhMJrQV/U7yy4wX0= @@ -384,27 +248,17 @@ github.com/imdario/mergo v0.3.7 h1:Y+UAYTZ7gDEuOfhxKWy+dvb5dRQ6rJjFSdX2HZY1/gI= github.com/imdario/mergo v0.3.7/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/influxdata/influxdb v1.7.7/go.mod h1:qZna6X/4elxqT3yI9iZYdZrWWdeFOOprn86kgg4+IzY= -github.com/jessevdk/go-flags v0.0.0-20180331124232-1c38ed7ad0cc/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= -github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= -github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= -github.com/joeshaw/multierror v0.0.0-20140124173710-69b34d4ec901/go.mod h1:Z86h9688Y0wesXCyonoVr47MasHilkuLMqGhRZ4Hpak= 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/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= -github.com/json-iterator/go v0.0.0-20180612202835-f2b4162afba3/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.9 h1:9yzud/Ht36ygwatGx56VwCZtlI/2AD15T1X2sjSuGns= github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/jsonnet-bundler/jsonnet-bundler v0.2.0/go.mod h1:/by7P/OoohkI3q4CgSFqcoFsVY+IaNbzOVDknEsKDeU= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= -github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo= github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= -github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= @@ -418,15 +272,9 @@ github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/pty v1.1.5/go.mod h1:9r2w37qlBe7rQ6e1fg1S/9xpWHSnaqNdHD3WcMdbPDA= github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= -github.com/kylelemons/godebug v0.0.0-20160406211939-eadb3ce320cb/go.mod h1:B69LEHPfb2qLo0BaaOLcbitczOKLWTsrBG9LczfCD4k= -github.com/kylelemons/godebug v0.0.0-20170820004349-d65d576e9348/go.mod h1:B69LEHPfb2qLo0BaaOLcbitczOKLWTsrBG9LczfCD4k= -github.com/leanovate/gopter v0.2.4/go.mod h1:gNcbPWNEWRe4lm+bycKqxUYoH5uoVje5SkOJ3uoLer8= github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de h1:9TO3cAIGXtEhnIaL+V+BEER86oLrvS+kWobKpbJuye0= github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de/go.mod h1:zAbeS9B/r2mtpb6U+EI2rYA5OAXxsYw6wTamcNW+zcE= -github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= -github.com/lightstep/lightstep-tracer-go v0.18.0/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= github.com/lithammer/dedent v1.1.0/go.mod h1:jrXYCQtgg0nJiN+StA2KgR7w6CiQNv9Fd/Z9BP0jIOc= -github.com/lovoo/gcloud-opentracing v0.3.0/go.mod h1:ZFqk2y38kMDDikZPAK7ynTTGuyt17nSPdS3K5e+ZTBY= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= 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= @@ -442,170 +290,86 @@ github.com/matryer/moq v0.0.0-20190312154309-6cfb0558e1bd/go.mod h1:9ELz6aaclSIG github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.1.2 h1:/bC9yWikZXAL9uJdulbSfyVNIR3n3trXl+v8+1sx8mU= github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= -github.com/mattn/go-ieproxy v0.0.0-20190610004146-91bb50d98149/go.mod h1:31jz6HNzdxOmlERGGEc4v/dMssOfmp2p5bT/okiKFFc= -github.com/mattn/go-ieproxy v0.0.0-20190702010315-6dee0af9227d/go.mod h1:31jz6HNzdxOmlERGGEc4v/dMssOfmp2p5bT/okiKFFc= -github.com/mattn/go-ieproxy v0.0.0-20191113090002-7c0f6868bffe/go.mod h1:pYabZ6IHcRpFh7vIaLfK7rdcWgFEb3SFJ6/gNWuh88E= -github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= -github.com/mattn/go-isatty v0.0.6/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.8 h1:HLtExJ+uU2HOZ+wI0Tt5DtUDrx8yhUqDcp7fYERX4CE= github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= -github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= -github.com/mattn/go-runewidth v0.0.6/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= 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/mcuadros/go-version v0.0.0-20180611085657-6d5863ca60fa h1:XvNrttGMJfVrUqblGju4IkjYXwx6l5OAAyjaIsydzsk= github.com/mcuadros/go-version v0.0.0-20180611085657-6d5863ca60fa/go.mod h1:76rfSfYPWj01Z85hUf/ituArm797mNKcvINh1OlsZKo= -github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= -github.com/miekg/dns v1.1.15/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= -github.com/miekg/dns v1.1.22/go.mod h1:bPDLeHnStXmXAq1m/Ch/hvfNHr14JKNPMBo3VZKjuso= -github.com/minio/minio-go/v6 v6.0.44/go.mod h1:qD0lajrGW49lKZLtXKtCB4X/qkMf0a5tBvN2PaZg7Gg= -github.com/minio/sha256-simd v0.1.1/go.mod h1:B5e1o+1/KgNmWrSQK08Y6Z1Vb5pwIktudl0J58iy0KM= -github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= github.com/mitchellh/copystructure v1.0.0 h1:Laisrj+bAB6b/yJwB5Bt3ITZhGJdqmxquMKeZ+mmkFQ= github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw= -github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= -github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= github.com/mitchellh/go-wordwrap v1.0.0 h1:6GlHJ/LTGMrIJbwgdqdl2eEH8o+Exx/0m8ir9Gns0u4= github.com/mitchellh/go-wordwrap v1.0.0/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo= -github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg= -github.com/mitchellh/hashstructure v0.0.0-20170609045927-2bca23e0e452/go.mod h1:QjSHrPWS+BGUVBYkbTZWEnOh3G1DutKwClXU/ABz6AQ= -github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= -github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/reflectwalk v1.0.0 h1:9D+8oIskB4VJBN5SFlmc27fSlIBZaov1Wpk/IfikLNY= github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= 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/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= github.com/morikuni/aec v0.0.0-20170113033406-39771216ff4c h1:nXxl5PrvVm2L/wCy8dQu6DMTwH4oIuGN8GJDAlqDdVE= github.com/morikuni/aec v0.0.0-20170113033406-39771216ff4c/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc= -github.com/mozillazg/go-cos v0.13.0/go.mod h1:Zp6DvvXn0RUOXGJ2chmWt2bLEqRAnJnS3DnAZsJsoaE= -github.com/mozillazg/go-httpheader v0.2.1/go.mod h1:jJ8xECTlalr6ValeXYdOF8fFUISeBAdw6E61aqQma60= github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= -github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw= -github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= -github.com/oklog/ulid v0.0.0-20170117200651-66bb6560562f/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= -github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= -github.com/olekukonko/tablewriter v0.0.1/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= -github.com/olekukonko/tablewriter v0.0.2/go.mod h1:rSAaSIOAGT9odnlyGlUfAJaoc5w2fSBUmeGDbRWPxyQ= github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.8.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.10.1/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.10.3/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/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= -github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= -github.com/onsi/gomega v1.5.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= 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= github.com/onsi/gomega v1.8.1/go.mod h1:Ho0h+IUsWyvy1OpqCwxlQ/21gkhVunqlU8fDGcoTdcA= 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/opencontainers/image-spec v1.0.1 h1:JMemWkRwHx4Zj+fVxWoMCFm/8sYGGrUVojFA6h/TRcI= github.com/opencontainers/image-spec v1.0.1/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0= -github.com/openshift/prom-label-proxy v0.1.1-0.20191016113035-b8153a7f39f1/go.mod h1:p5MuxzsYP1JPsNGwtjtcgRHHlGziCJJfztff91nNixw= -github.com/opentracing-contrib/go-stdlib v0.0.0-20190519235532-cf7a6c988dc9/go.mod h1:PLldrQSroqzH70Xl+1DQcGnefIbqsKR7UDaiux3zV+w= -github.com/opentracing/basictracer-go v1.0.0/go.mod h1:QfBfYuafItcjQuMwinw9GhYKwFXS9KnPs5lxoYwgW74= -github.com/opentracing/opentracing-go v1.0.2/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= -github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJc5AZX7/PBEpw= -github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= -github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= 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= github.com/peterbourgon/diskv v2.0.1+incompatible h1:UBdAOUP5p4RWqPBg048CAvpKN+vxiaj6gdUUzhl4XmI= github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= -github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pmezard/go-difflib v0.0.0-20151028094244-d8ed2627bdf0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= github.com/pquerna/cachecontrol v0.0.0-20171018203845-0dec1b30a021/go.mod h1:prYjPmNq4d1NPVmpShWobRqXY3q7Vp+80DqgxxUrUIA= -github.com/prometheus/alertmanager v0.18.0/go.mod h1:WcxHBl40VSPuOaqWae6l6HpnEOVRIycEJ7i9iYkadEE= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= -github.com/prometheus/client_golang v0.9.2/go.mod h1:OsXs2jCmiKlQ1lTBmv21f2mNfw4xf/QclQDMrYNZzcM= -github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829/go.mod h1:p2iRAGwDERtqlqzRXnrOVns+ignqQo//hLXqYxZYVNs= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= -github.com/prometheus/client_golang v1.2.0/go.mod h1:XMU6Z2MjaRKVu/dC1qupJI9SiNkDYzz3xecMgSW/F+U= -github.com/prometheus/client_golang v1.2.1/go.mod h1:XMU6Z2MjaRKVu/dC1qupJI9SiNkDYzz3xecMgSW/F+U= github.com/prometheus/client_golang v1.4.0 h1:YVIb/fVcOTMSqtqZWSKnHpSLBxu8DKgxq8z6RuBZwqI= github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= -github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= 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/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= -github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= -github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt26CguLLsqA= github.com/prometheus/common v0.9.1 h1:KOMtN28tlbam3/7ZKEYKHhKoJZYYj3gMH4uc62x7X7U= github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= 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.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= -github.com/prometheus/procfs v0.0.0-20190425082905-87a4384529e0/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= 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/go.mod h1:4A/X28fw3Fc593LaREMrKMqOKvUAntwMDaekg4FpcdQ= -github.com/prometheus/procfs v0.0.6/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= github.com/prometheus/procfs v0.0.8 h1:+fpWZdT24pJBiqJdAwYBjPSk+5YmQzYNPYzQsdzLkt8= github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= -github.com/prometheus/prometheus v0.0.0-20180315085919-58e2a31db8de/go.mod h1:oAIUtOny2rjMX0OWN5vPR5/q/twIROJvdqnQKDdil/s= -github.com/prometheus/prometheus v1.8.2-0.20200107122003-4708915ac6ef/go.mod h1:7U90zPoLkWjEIQcy/rweQla82OCTUzxVHE51G3OhJbI= -github.com/prometheus/prometheus v2.3.2+incompatible/go.mod h1:oAIUtOny2rjMX0OWN5vPR5/q/twIROJvdqnQKDdil/s= github.com/rancher/lasso v0.0.0-20200515155337-a34e1e26ad91 h1:p4VVl0tr6YAeUILFMCn+0DKzbUOS0ah9biSsL7Sy6S4= github.com/rancher/lasso v0.0.0-20200515155337-a34e1e26ad91/go.mod h1:G6Vv2aj6xB2YjTVagmu4NkhBvbE8nBcGykHRENH6arI= github.com/rancher/norman v0.0.0-20200517050325-f53cae161640 h1:wZT4IWBeMfKewJ+ZSCuOFjHh+voTJWYQo7jTd/ZtE90= github.com/rancher/norman v0.0.0-20200517050325-f53cae161640/go.mod h1:92rz/7QN7DOeLQZlJY/8aFBOmF085igIVguR0wpxLas= -github.com/rancher/pkg v0.0.0-20190514055449-b30ab9de040e h1:j6+HqCET/NLPBtew2m5apL7jWw/PStQ7iGwXjgAqdvo= -github.com/rancher/pkg v0.0.0-20190514055449-b30ab9de040e/go.mod h1:XbYHTPaXuw8ZY9bylhYKQh/nJxDaTKk3YhAxPl4Qy/k= -github.com/rancher/types v0.0.0-20200609171939-d21f6b7b59e8 h1:X0m8Q5sCAZ3FobkfLn56PlB+pPnFdIxu87isK1lKEB4= -github.com/rancher/types v0.0.0-20200609171939-d21f6b7b59e8/go.mod h1:1f9IG3X8ZreqsCNnt60wcEpGC4p8k9qYp/UZflb1DYw= github.com/rancher/wrangler v0.6.2-0.20200515155908-1923f3f8ec3f h1:QPOlhiY3YCPLsEtOmPam+ghtqip/f/zsfz4F4PF70D8= github.com/rancher/wrangler v0.6.2-0.20200515155908-1923f3f8ec3f/go.mod h1:NmtmlLkchboIksYJuBemwcP4RBfv8FpeyhVoWXB9Wdc= -github.com/rancher/wrangler-api v0.6.1-0.20200515193802-dcf70881b087/go.mod h1:s95VCVHV19b+EUo7BAwwe6nhaDx2/lHu91hxxDHbZs0= -github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= -github.com/remyoudompheng/bigfft v0.0.0-20170806203942-52369c62f446/go.mod h1:uYEyJGbgTkfkS4+E/PavXkNJcbFIpEtjt2B0KDQ5+9M= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= -github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= -github.com/rs/cors v1.6.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= github.com/russross/blackfriday v1.5.2 h1:HyvC0ARfnZBqnXwABFeSZHpKvJHJJfPz81GNueLj0oo= github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= -github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= -github.com/ryanuber/columnize v2.1.0+incompatible/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= -github.com/samuel/go-zookeeper v0.0.0-20190810000440-0ceca61e4d75/go.mod h1:gi+0XIa01GRL2eRQVjQkKGqKF3SF9vZR/HnPullcV2E= -github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da/go.mod h1:gi+0XIa01GRL2eRQVjQkKGqKF3SF9vZR/HnPullcV2E= -github.com/santhosh-tekuri/jsonschema v1.2.4/go.mod h1:TEAUOeZSmIxTTuHatJzrvARHiuO9LYd+cIxzgEHCQI4= -github.com/satori/go.uuid v0.0.0-20160603004225-b111a074d5ef/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= -github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= -github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= -github.com/shurcooL/httpfs v0.0.0-20171119174359-809beceb2371/go.mod h1:ZY1cvUeJuFPAdZ/B6v7RHavJWZn2YPVFQ1OSXhCGOkg= -github.com/shurcooL/httpfs v0.0.0-20190707220628-8d4bc4ba7749/go.mod h1:ZY1cvUeJuFPAdZ/B6v7RHavJWZn2YPVFQ1OSXhCGOkg= -github.com/shurcooL/vfsgen v0.0.0-20180825020608-02ddb050ef6b/go.mod h1:TrYk7fJVaAttu97ZZKrO9UbRa8izdowaMIZcxYMbVaw= -github.com/shurcooL/vfsgen v0.0.0-20181202132449-6a9ea43bcacd/go.mod h1:TrYk7fJVaAttu97ZZKrO9UbRa8izdowaMIZcxYMbVaw= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= github.com/sirupsen/logrus v1.4.2 h1:SPIRibHv4MatM3XXNO2BJeFLZwZ2LvZgfQ5+UNI2im4= @@ -613,14 +377,10 @@ github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6Mwd github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/assertions v1.0.1 h1:voD4ITNjPL5jjBfgR/r8fPIIBrliWrWHeiJApdr3r4w= github.com/smartystreets/assertions v1.0.1/go.mod h1:kHHU4qYBaI3q23Pp3VPrmWhuIUrLW/7eUrw0BU5VaoM= -github.com/smartystreets/goconvey v0.0.0-20190330032615-68dc04aab96a/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/smartystreets/goconvey v1.6.4 h1:fv0U8FUIMPNf1L9lnHLvLhgicrIVChEkdzIKYqbNC9s= github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= -github.com/soheilhy/cmux v0.1.3/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= github.com/soheilhy/cmux v0.1.4 h1:0HKaf1o97UwFjHH9o5XsHUOF+tqmdA7KEzXLpiyaw0E= github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= -github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= -github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= github.com/spf13/cast v1.3.0 h1:oget//CVOEoFewqQxwr0Ej5yjygnqGkvggSE/gB35Q8= @@ -638,119 +398,71 @@ github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DM github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= 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/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= -github.com/thanos-io/thanos v0.10.1/go.mod h1:usT/TxtJQ7DzinTt+G9kinDQmRS5sxwu0unVKZ9vdcw= github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/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/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= -github.com/uber/jaeger-client-go v2.20.1+incompatible/go.mod h1:WVhlPFC8FDjOFMMWRy2pZqQJSXxYSwNYOkTr/Z6d3Kk= -github.com/uber/jaeger-lib v2.2.0+incompatible/go.mod h1:ComeNDZlWwrWnDv8aPp0Ba6+uUTzImX/AauajbLI56U= github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= github.com/urfave/cli v1.20.0 h1:fDqGv3UG/4jbVl/QkFwEdddtEDjh/5Ov6X+0B/3bPaw= github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= github.com/vektah/gqlparser v1.1.2/go.mod h1:1ycwN7Ij5njmMkPPAOaRFY4rET2Enx7IkVv3vaXspKw= -github.com/xiang90/probing v0.0.0-20160813154853-07dd2e8dfe18/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2 h1:eY9dn8+vbi4tKz5Qo6v2eYzo7kUS51QINcR5jNpbZS8= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= github.com/xlab/handysort v0.0.0-20150421192137-fb3537ed64a1/go.mod h1:QcJo0QPSfTONNIgpN5RA8prR7fF8nkF6cTWTcNerRO8= -github.com/xlab/treeprint v0.0.0-20180616005107-d6fb6747feb6/go.mod h1:ce1O1j6UtZfjr22oyGxGLbauSBp2YVXpARAosm7dHBg= github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= -go.elastic.co/apm v1.5.0/go.mod h1:OdB9sPtM6Vt7oz3VXt7+KR96i9li74qrxBGHTQygFvk= -go.elastic.co/apm/module/apmhttp v1.5.0/go.mod h1:1FbmNuyD3ddauwzgVwFB0fqY6KbZt3JkV187tGCYYhY= -go.elastic.co/apm/module/apmot v1.5.0/go.mod h1:d2KYwhJParTpyw2WnTNy8geNlHKKFX+4oK3YLlsesWE= -go.elastic.co/fastjson v1.0.0/go.mod h1:PmeUOMMtLHQr9ZS9J9owrAVg0FkaZDRZJEFTTGHtchs= go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738/go.mod h1:dnLIgRNXwCJa5e+c6mIZCrds/GIG4ncV9HhK5PX7jPg= go.mongodb.org/mongo-driver v1.0.3/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= go.mongodb.org/mongo-driver v1.1.1/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= go.mongodb.org/mongo-driver v1.1.2/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= -go.opencensus.io v0.20.1/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= -go.opencensus.io v0.20.2/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= -go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= -go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.uber.org/atomic v0.0.0-20181018215023-8dc6146f7569/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.5.0 h1:OI5t8sDa1Or+q8AeE+yKeB/SDYioSHAgcVljj9JIETY= go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= -go.uber.org/automaxprocs v1.2.0/go.mod h1:YfO3fm683kQpzETxlTGZhGIVmXAhaw3gxeBADbpZtnU= -go.uber.org/multierr v0.0.0-20180122172545-ddea229ff1df/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= 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.10.0 h1:ORx85nbTijNz8ljznvCMR1ZBIPKFn3jQrag10X2AsuM= go.uber.org/zap v1.10.0/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-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190211182817-74369b46fc67/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= 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-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190513172903-22d7a77e9e5f/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= 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-20190911031432-227b76d455e7/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190923035154-9ee001bba392/go.mod h1:/lpIB1dKB+9EgE3H3cr1v9wB50oz8l4C4h62xy7jSTY= -golang.org/x/crypto v0.0.0-20191112222119-e1110fd1c708/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= 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= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20190125153040-c74c464bbbf2/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20190312203227-4b39c73a6495/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= -golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= -golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= -golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= -golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= -golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/lint v0.0.0-20190930215403-16217165b5de h1:5hukYrvBGR8/eNkX5mdUezrA6JiaEZDtJb9Ei+1LlBs= golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= -golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= -golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= -golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= golang.org/x/net v0.0.0-20170114055629-f2499483f923/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= 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-20181023162649-9b4f9f5ad519/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/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= -golang.org/x/net v0.0.0-20190125091013-d26f9f9a57f3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= 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-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190522155817-f3200d17e092/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= 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-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -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= -golang.org/x/net v0.0.0-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191002035440-2ec189313ef0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191004110552-13f9640d40b9/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191112182307-2180aed22343 h1:00ohfJ4K98s3m6BGUoBd8nyfp4Yl0GoIKvw5abItTjI= @@ -767,45 +479,27 @@ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e h1:vcxGaoTs7kV8m5Np9uUNQin4BrLOthgV7252N8V+FwY= 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= -golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 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= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181122145206-62eef0e2fa9b/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190209173611-3b5209105503/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190310054646-10058d7d4faa/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190321052220-f7bb7a8bee54/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 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-20190425145619-16072639606e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/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/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190712062909-fae7ac547cb7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190922100055-0a153f010e69/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190924154521-2837fb4f24fe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191010194322-b09406accb47/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191022100944-742c48ecaeb7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191025021431-6c3a3bfe00ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191112214154-59a1497f0cea/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191113165036-4c7a9d0fe056/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200122134326-e047566fdf82 h1:ywK/j/KkyTHcdyYSZNXGjMwgmDSfjglYZ3vStQ/gSCU= golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/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/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.1-0.20180805044716-cb6730876b98/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= @@ -815,52 +509,27 @@ golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxb golang.org/x/time v0.0.0-20191024005414-555d28b269f0 h1:/5xXl8Y5W96D+TtHSlonuFqGHIWVuyCkGJLwGh9JJFs= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20181011042414-1f849cf54d09/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190118193359-16909d206f00/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190125232054-d66bd3c5d5a6/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190206041539-40960b6deb8e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= 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-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/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/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/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20190907020128-2ca718005c18/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20190918214516-5a1a30219888/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190920225731-5eefd052ad72/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191017205301-920acffc3e65/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191111182352-50fa39b762bc/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2 h1:EtTFh6h4SAKemS+CURDMTDIANuduG5zKEXShyy18bGA= golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -gonum.org/v1/gonum v0.0.0-20190331200053-3d26580ed485/go.mod h1:2ltnJ7xHfj0zHS40VVPYEAAMTa3ZGguvHGBSJeRWqE0= -gonum.org/v1/netlib v0.0.0-20190313105609-8cb42192e0e0/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw= -gonum.org/v1/netlib v0.0.0-20190331212654-76723241ea4e/go.mod h1:kS+toOQn6AQKjmKJ7gzohV1XkqsFehRA2FbsbkopSuQ= -google.golang.org/api v0.3.1/go.mod h1:6wY9I6uQWHQ8EM57III9mq/AjF+i8G65rmVagqKMtkk= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= -google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= -google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= -google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= -google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -870,28 +539,14 @@ google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCID google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190530194941-fb225487d101/go.mod h1:z3L6/3dTEVtUr6QSP8miRzeRqwQOioJ9I66odjN4I7s= -google.golang.org/genproto v0.0.0-20190716160619-c506a9f90610/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= google.golang.org/genproto v0.0.0-20190927181202-20e1ac93f88c/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= -google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9 h1:6XzpBoANz1NqMNfDXzc2QmHmbb1vyMsvRfoP5rM+K1I= google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= -google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= -google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= -google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= -google.golang.org/grpc v1.22.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= -google.golang.org/grpc v1.22.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.23.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.24.0/go.mod h1:XDChyiUovWa60DnaeDeZmSW86xtLtjtZbwvSiRnRtcA= -google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= google.golang.org/grpc v1.26.0 h1:2dTRdpdFEEhJYQD8EMLB61nnrzSCTbG38PhqdhvOltg= google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= @@ -900,14 +555,10 @@ gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8 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= gopkg.in/cheggaaa/pb.v1 v1.0.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= -gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= -gopkg.in/fsnotify/fsnotify.v1 v1.4.7/go.mod h1:Fyux9zXlo4rWoMSIzpn9fDAYjalPqJ/K1qJ27s+7ltE= -gopkg.in/inf.v0 v0.9.0/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= -gopkg.in/ini.v1 v1.42.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/ini.v1 v1.51.0 h1:AQvPpx3LzTDM0AjnIRlVFwFFGC+npRopjZxLJj6gdno= gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/natefinch/lumberjack.v2 v2.0.0/go.mod h1:l0ndWWf7gzL7RNwBG7wST/UCcT4T24xpD6X8LsfU/+k= @@ -916,7 +567,6 @@ gopkg.in/square/go-jose.v2 v2.2.2/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76 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.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= -gopkg.in/yaml.v2 v2.1.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= @@ -924,77 +574,42 @@ gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v3 v3.0.0-20190905181640-827449938966/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo= gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= -honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= -howett.net/plist v0.0.0-20181124034731-591f970eefbb/go.mod h1:vMygbs4qMhSZSc4lCUl2OEE+rDiIIJAIdR4m7MiMcm0= -k8s.io/api v0.0.0-20190813020757-36bff7324fb7/go.mod h1:3Iy+myeAORNCLgjd/Xu9ebwN7Vh59Bw0vh9jhoX+V58= -k8s.io/api v0.0.0-20190918155943-95b840bb6a1f/go.mod h1:uWuOHnjmNrtQomJrvEBg0c0HRNyQ+8KTEERVsK0PW48= -k8s.io/api v0.0.0-20191115095533-47f6de673b26/go.mod h1:iA/8arsvelvo4IDqIhX4IbjTEKBGgvsf2OraTuRtLFU= k8s.io/api v0.18.0 h1:lwYk8Vt7rsVTwjRU6pzEsa9YNhThbmbocQlKvNBB4EQ= k8s.io/api v0.18.0/go.mod h1:q2HRQkfDzHMBZL9l/y9rH63PkQl4vae0xRT+8prbrK8= -k8s.io/apiextensions-apiserver v0.0.0-20190918161926-8f644eb6e783/go.mod h1:xvae1SZB3E17UpV59AWc271W/Ph25N+bjPyR63X6tPY= k8s.io/apiextensions-apiserver v0.18.0/go.mod h1:18Cwn1Xws4xnWQNC00FLq1E350b9lUF+aOdIWDOZxgo= -k8s.io/apimachinery v0.0.0-20190809020650-423f5d784010/go.mod h1:Waf/xTS2FGRrgXCkO5FP3XxTOWh0qLf2QhL1qFZZ/R8= -k8s.io/apimachinery v0.0.0-20190913080033-27d36303b655/go.mod h1:nL6pwRT8NgfF8TT68DBI8uEePRt89cSvoXUVqbkWHq4= -k8s.io/apimachinery v0.0.0-20191115015347-3c7067801da2/go.mod h1:dXFS2zaQR8fyzuvRdJDHw2Aerij/yVGJSre0bZQSVJA= k8s.io/apimachinery v0.18.0 h1:fuPfYpk3cs1Okp/515pAf0dNhL66+8zk8RLbSX+EgAE= k8s.io/apimachinery v0.18.0/go.mod h1:9SnR/e11v5IbyPCGbvJViimtJ0SwHG4nfZFjU77ftcA= -k8s.io/apiserver v0.0.0-20190918160949-bfa5e2e684ad/go.mod h1:XPCXEwhjaFN29a8NldXA901ElnKeKLrLtREO9ZhFyhg= k8s.io/apiserver v0.18.0 h1:ELAWpGWC6XdbRLi5lwAbEbvksD7hkXxPdxaJsdpist4= k8s.io/apiserver v0.18.0/go.mod h1:3S2O6FeBBd6XTo0njUrLxiqk8GNy6wWOftjhJcXYnjw= k8s.io/cli-runtime v0.18.0 h1:jG8XpSqQ5TrV0N+EZ3PFz6+gqlCk71dkggWCCq9Mq34= k8s.io/cli-runtime v0.18.0/go.mod h1:1eXfmBsIJosjn9LjEBUd2WVPoPAY9XGTqTFcPMIBsUQ= k8s.io/client-go v0.18.0 h1:yqKw4cTUQraZK3fcVCMeSa+lqKwcjZ5wtcOIPnxQno4= k8s.io/client-go v0.18.0/go.mod h1:uQSYDYs4WhVZ9i6AIoEZuwUggLVEF64HOD37boKAtF8= -k8s.io/code-generator v0.0.0-20190912054826-cd179ad6a269/go.mod h1:V5BD6M4CyaN5m+VthcclXWsVcT1Hu+glwa1bi3MIsyE= k8s.io/code-generator v0.18.0/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 h1:I+lP0fNfsEdTDpHaL61bCAqTZLoiWjEEP304Mo5ZQgE= k8s.io/component-base v0.18.0/go.mod h1:u3BCg0z1uskkzrnAKFzulmYaEpZF7XC9Pf/uFyb1v2c= k8s.io/gengo v0.0.0-20190128074634-0689ccc1d7d6/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= -k8s.io/gengo v0.0.0-20190822140433-26a664648505/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= k8s.io/gengo v0.0.0-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/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= -k8s.io/klog v0.3.1/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= -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.0 h1:J+wa9FDQ3SbgyA8wQBNg2m2FMSm+mMQfs2A58500hs0= -k8s.io/kube-aggregator v0.18.0/go.mod h1:ateewQ5QbjMZF/dihEFXwaEwoA4v/mayRvzfmvb6eqI= -k8s.io/kube-openapi v0.0.0-20190709113604-33be087ad058/go.mod h1:nfDlWeOsu3pUf4yWGL+ERqohP4YsZcBJXWMK+gkzOA4= -k8s.io/kube-openapi v0.0.0-20190816220812-743ec37842bf/go.mod h1:1TqjTSzOxsLGIKfj0lK8EeCP7K1iUG65v09OM0/WG5E= -k8s.io/kube-openapi v0.0.0-20191107075043-30be4d16710a/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 h1:hu52Ndq/d099YW+3sS3VARxFz61Wheiq8K9S7oa82Dk= k8s.io/kubectl v0.18.0/go.mod h1:LOkWx9Z5DXMEg5KtOjHhRiC1fqJPLyCr3KtQgEolCkU= k8s.io/metrics v0.18.0/go.mod h1:8aYTW18koXqjLVKL7Ds05RPMX9ipJZI3mywYvBOxXd4= -k8s.io/utils v0.0.0-20190801114015-581e00157fb1/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= -k8s.io/utils v0.0.0-20191114200735-6ca3b61696b6/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= k8s.io/utils v0.0.0-20200324210504-a9aa75ae1b89 h1:d4vVOjXm687F1iLSP2q3lyPPuyvTUt3aVoBpi2DqRsU= k8s.io/utils v0.0.0-20200324210504-a9aa75ae1b89/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= -modernc.org/cc v1.0.0/go.mod h1:1Sk4//wdnYJiUIxnW8ddKpaOJCF37yAdqYnkxUpaYxw= -modernc.org/golex v1.0.0/go.mod h1:b/QX9oBD/LhixY6NDh+IdGv17hgB+51fET1i2kPSmvk= -modernc.org/mathutil v1.0.0/go.mod h1:wU0vUrJsVWBZ4P6e7xtFJEhFSNsfRLJ8H458uRjg03k= -modernc.org/strutil v1.0.0/go.mod h1:lstksw84oURvj9y3tn8lGvRxyRC1S2+g5uuIzNfIOBs= -modernc.org/xc v1.0.0/go.mod h1:mRNCo0bvLjGhHO9WsyuKVU4q0ceiDDDoEeWDJHrNx8I= -rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.7/go.mod h1:PHgbrJT7lCHcxMU+mDHEm+nx46H4zuuHZkDP6icnhu0= -sigs.k8s.io/controller-tools v0.2.4/go.mod h1:m/ztfQNocGYBgTTCmFdnK94uVvgxeZeE3LtJvd/jIzA= sigs.k8s.io/kustomize v2.0.3+incompatible h1:JUufWFNlI44MdtnjUqVnvh29rR37PQFzPbLXqhyOyX0= sigs.k8s.io/kustomize v2.0.3+incompatible/go.mod h1:MkjgH3RdOWrievjo6c9T245dYlB5QeXV4WCbnt/PEpU= -sigs.k8s.io/structured-merge-diff v0.0.0-20190525122527-15d366b2352e/go.mod h1:wWxsB5ozmmv/SG7nM11ayaAW51xMvak/t1r0CSlcokI= -sigs.k8s.io/structured-merge-diff v0.0.0-20190817042607-6149e4549fca h1:6dsH6AYQWbyZmtttJNe8Gq1cXOeS1BdV3eW37zHilAQ= -sigs.k8s.io/structured-merge-diff v0.0.0-20190817042607-6149e4549fca/go.mod h1:IIgPezJWb76P0hotTxzDbWsMYB8APh18qZnxkomBpxA= sigs.k8s.io/structured-merge-diff/v3 v3.0.0-20200116222232-67a7b8c61874/go.mod h1:PlARxl6Hbt/+BC80dRLi1qAmnMqwqDg62YvvVkZjemw= 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= diff --git a/vendor/github.com/rancher/norman/lifecycle/object.go b/vendor/github.com/rancher/norman/lifecycle/object.go deleted file mode 100644 index 25b12cb2..00000000 --- a/vendor/github.com/rancher/norman/lifecycle/object.go +++ /dev/null @@ -1,267 +0,0 @@ -package lifecycle - -import ( - "fmt" - "reflect" - - "github.com/rancher/norman/objectclient" - "github.com/rancher/norman/types/slice" - "k8s.io/apimachinery/pkg/api/meta" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" -) - -var ( - created = "lifecycle.cattle.io/create" - finalizerKey = "controller.cattle.io/" - ScopedFinalizerKey = "clusterscoped.controller.cattle.io/" -) - -type ObjectLifecycle interface { - Create(obj runtime.Object) (runtime.Object, error) - Finalize(obj runtime.Object) (runtime.Object, error) - Updated(obj runtime.Object) (runtime.Object, error) -} - -type ObjectLifecycleCondition interface { - HasCreate() bool - HasFinalize() bool -} - -type objectLifecycleAdapter struct { - name string - clusterScoped bool - lifecycle ObjectLifecycle - objectClient *objectclient.ObjectClient -} - -func NewObjectLifecycleAdapter(name string, clusterScoped bool, lifecycle ObjectLifecycle, objectClient *objectclient.ObjectClient) func(key string, obj interface{}) (interface{}, error) { - o := objectLifecycleAdapter{ - name: name, - clusterScoped: clusterScoped, - lifecycle: lifecycle, - objectClient: objectClient, - } - return o.sync -} - -func (o *objectLifecycleAdapter) sync(key string, in interface{}) (interface{}, error) { - if in == nil || reflect.ValueOf(in).IsNil() { - return nil, nil - } - - obj, ok := in.(runtime.Object) - if !ok { - return nil, nil - } - - if newObj, cont, err := o.finalize(obj); err != nil || !cont { - return nil, err - } else if newObj != nil { - obj = newObj - } - - if newObj, cont, err := o.create(obj); err != nil || !cont { - return nil, err - } else if newObj != nil { - obj = newObj - } - - return o.record(obj, o.lifecycle.Updated) -} - -func (o *objectLifecycleAdapter) update(name string, orig, obj runtime.Object) (runtime.Object, error) { - if obj != nil && orig != nil && !reflect.DeepEqual(orig, obj) { - newObj, err := o.objectClient.Update(name, obj) - if newObj != nil { - return newObj, err - } - return obj, err - } - if obj == nil { - return orig, nil - } - return obj, nil -} - -func (o *objectLifecycleAdapter) finalize(obj runtime.Object) (runtime.Object, bool, error) { - if !o.hasFinalize() { - return obj, true, nil - } - - metadata, err := meta.Accessor(obj) - if err != nil { - return obj, false, err - } - - // Check finalize - if metadata.GetDeletionTimestamp() == nil { - return nil, true, nil - } - - if !slice.ContainsString(metadata.GetFinalizers(), o.constructFinalizerKey()) { - return nil, false, nil - } - - newObj, err := o.record(obj, o.lifecycle.Finalize) - if err != nil { - return obj, false, err - } - - obj, err = o.removeFinalizer(o.constructFinalizerKey(), maybeDeepCopy(obj, newObj)) - return obj, false, err -} - -func maybeDeepCopy(old, newObj runtime.Object) runtime.Object { - if old == newObj { - return old.DeepCopyObject() - } - return newObj -} - -func (o *objectLifecycleAdapter) removeFinalizer(name string, obj runtime.Object) (runtime.Object, error) { - for i := 0; i < 3; i++ { - metadata, err := meta.Accessor(obj) - if err != nil { - return nil, err - } - - var finalizers []string - for _, finalizer := range metadata.GetFinalizers() { - if finalizer == name { - continue - } - finalizers = append(finalizers, finalizer) - } - metadata.SetFinalizers(finalizers) - - newObj, err := o.objectClient.Update(metadata.GetName(), obj) - if err == nil { - return newObj, nil - } - - obj, err = o.objectClient.GetNamespaced(metadata.GetNamespace(), metadata.GetName(), metav1.GetOptions{}) - if err != nil { - return nil, err - } - } - - return nil, fmt.Errorf("failed to remove finalizer on %s", name) -} - -func (o *objectLifecycleAdapter) createKey() string { - return created + "." + o.name -} - -func (o *objectLifecycleAdapter) constructFinalizerKey() string { - if o.clusterScoped { - return ScopedFinalizerKey + o.name - } - return finalizerKey + o.name -} - -func (o *objectLifecycleAdapter) hasFinalize() bool { - cond, ok := o.lifecycle.(ObjectLifecycleCondition) - return !ok || cond.HasFinalize() -} - -func (o *objectLifecycleAdapter) hasCreate() bool { - cond, ok := o.lifecycle.(ObjectLifecycleCondition) - return !ok || cond.HasCreate() -} - -func (o *objectLifecycleAdapter) record(obj runtime.Object, f func(runtime.Object) (runtime.Object, error)) (runtime.Object, error) { - metadata, err := meta.Accessor(obj) - if err != nil { - return obj, err - } - - origObj := obj - obj = origObj.DeepCopyObject() - if newObj, err := checkNil(obj, f); err != nil { - newObj, _ = o.update(metadata.GetName(), origObj, newObj) - return newObj, err - } else if newObj != nil { - return o.update(metadata.GetName(), origObj, newObj) - } - return obj, nil -} - -func checkNil(obj runtime.Object, f func(runtime.Object) (runtime.Object, error)) (runtime.Object, error) { - obj, err := f(obj) - if obj == nil || reflect.ValueOf(obj).IsNil() { - return nil, err - } - return obj, err -} - -func (o *objectLifecycleAdapter) create(obj runtime.Object) (runtime.Object, bool, error) { - metadata, err := meta.Accessor(obj) - if err != nil { - return obj, false, err - } - - if o.isInitialized(metadata) { - return nil, true, nil - } - - if o.hasFinalize() { - obj, err = o.addFinalizer(obj) - if err != nil { - return obj, false, err - } - } - - if !o.hasCreate() { - return obj, true, err - } - - obj, err = o.record(obj, o.lifecycle.Create) - if err != nil { - return obj, false, err - } - - obj, err = o.setInitialized(obj) - return obj, false, err -} - -func (o *objectLifecycleAdapter) isInitialized(metadata metav1.Object) bool { - initialized := o.createKey() - return metadata.GetAnnotations()[initialized] == "true" -} - -func (o *objectLifecycleAdapter) setInitialized(obj runtime.Object) (runtime.Object, error) { - metadata, err := meta.Accessor(obj) - if err != nil { - return nil, err - } - - initialized := o.createKey() - - if metadata.GetAnnotations() == nil { - metadata.SetAnnotations(map[string]string{}) - } - metadata.GetAnnotations()[initialized] = "true" - - return o.objectClient.Update(metadata.GetName(), obj) -} - -func (o *objectLifecycleAdapter) addFinalizer(obj runtime.Object) (runtime.Object, error) { - metadata, err := meta.Accessor(obj) - if err != nil { - return nil, err - } - - if slice.ContainsString(metadata.GetFinalizers(), o.constructFinalizerKey()) { - return obj, nil - } - - obj = obj.DeepCopyObject() - metadata, err = meta.Accessor(obj) - if err != nil { - return nil, err - } - - metadata.SetFinalizers(append(metadata.GetFinalizers(), o.constructFinalizerKey())) - return o.objectClient.Update(metadata.GetName(), obj) -} diff --git a/vendor/github.com/rancher/norman/resource/resource.go b/vendor/github.com/rancher/norman/resource/resource.go deleted file mode 100644 index 710adb61..00000000 --- a/vendor/github.com/rancher/norman/resource/resource.go +++ /dev/null @@ -1,61 +0,0 @@ -package resource - -import ( - "sync" - - "k8s.io/apimachinery/pkg/runtime/schema" -) - -//rancherTypes is a set of all types generated by rancher -//clusterScopedTypes is a set of all types that have been added by a clusterScoped handler -var ( - rancherTypes = struct { - sync.RWMutex - m map[schema.GroupVersionResource]bool - }{m: make(map[schema.GroupVersionResource]bool)} - - clusterScopedTypes = struct { - sync.RWMutex - m map[schema.GroupVersionResource]bool - }{m: make(map[schema.GroupVersionResource]bool)} -) - -//Get returns a copy of the set of rancherTypes -func Get() map[schema.GroupVersionResource]bool { - rancherTypes.RLock() - defer rancherTypes.RUnlock() - targetMap := make(map[schema.GroupVersionResource]bool, len(rancherTypes.m)) - for key, value := range rancherTypes.m { - targetMap[key] = value - } - return targetMap -} - -func GetClusterScopedTypes() map[schema.GroupVersionResource]bool { - clusterScopedTypes.Lock() - defer clusterScopedTypes.Unlock() - targetMap := make(map[schema.GroupVersionResource]bool, len(clusterScopedTypes.m)) - for key, value := range clusterScopedTypes.m { - targetMap[key] = value - } - return targetMap -} - -//Put adds an object to the set and panic on collision -func Put(key schema.GroupVersionResource) { - rancherTypes.Lock() - defer rancherTypes.Unlock() - _, exists := rancherTypes.m[key] - if exists { - //only used in an init function - panic("key exists in rancherTypes") - } - rancherTypes.m[key] = true -} - -//PutClusterScoped adds a object that contains a cluster scoped handler to the set -func PutClusterScoped(key schema.GroupVersionResource) { - clusterScopedTypes.Lock() - defer clusterScopedTypes.Unlock() - clusterScopedTypes.m[key] = true -} diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/alerting_types.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/alerting_types.go deleted file mode 100644 index 43132f81..00000000 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/alerting_types.go +++ /dev/null @@ -1,398 +0,0 @@ -package v3 - -import ( - "strings" - - "github.com/rancher/norman/types" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -type ClusterAlert struct { - types.Namespaced - - metav1.TypeMeta `json:",inline"` - // Standard object’s metadata. More info: - // https://github.com/kubernetes/community/blob/master/contributors/devel/api-conventions.md#metadata - metav1.ObjectMeta `json:"metadata,omitempty"` - - Spec ClusterAlertSpec `json:"spec"` - // Most recent observed status of the alert. More info: - // https://github.com/kubernetes/community/blob/master/contributors/devel/api-conventions.md#spec-and-status - Status AlertStatus `json:"status"` -} - -func (c *ClusterAlert) ObjClusterName() string { - return c.Spec.ObjClusterName() -} - -type ProjectAlert struct { - types.Namespaced - - metav1.TypeMeta `json:",inline"` - // Standard object’s metadata. More info: - // https://github.com/kubernetes/community/blob/master/contributors/devel/api-conventions.md#metadata - metav1.ObjectMeta `json:"metadata,omitempty"` - - Spec ProjectAlertSpec `json:"spec"` - // Most recent observed status of the alert. More info: - // https://github.com/kubernetes/community/blob/master/contributors/devel/api-conventions.md#spec-and-status - Status AlertStatus `json:"status"` -} - -func (p *ProjectAlert) ObjClusterName() string { - return p.Spec.ObjClusterName() -} - -type AlertCommonSpec struct { - DisplayName string `json:"displayName,omitempty" norman:"required"` - Description string `json:"description,omitempty"` - Severity string `json:"severity,omitempty" norman:"required,options=info|critical|warning,default=critical"` - Recipients []Recipient `json:"recipients,omitempty" norman:"required"` - InitialWaitSeconds int `json:"initialWaitSeconds,omitempty" norman:"required,default=180,min=0"` - RepeatIntervalSeconds int `json:"repeatIntervalSeconds,omitempty" norman:"required,default=3600,min=0"` -} - -type ClusterAlertSpec struct { - AlertCommonSpec - - ClusterName string `json:"clusterName" norman:"type=reference[cluster]"` - TargetNode *TargetNode `json:"targetNode,omitempty"` - TargetSystemService *TargetSystemService `json:"targetSystemService,omitempty"` - TargetEvent *TargetEvent `json:"targetEvent,omitempty"` -} - -func (c *ClusterAlertSpec) ObjClusterName() string { - return c.ClusterName -} - -type ProjectAlertSpec struct { - AlertCommonSpec - - ProjectName string `json:"projectName" norman:"type=reference[project]"` - TargetWorkload *TargetWorkload `json:"targetWorkload,omitempty"` - TargetPod *TargetPod `json:"targetPod,omitempty"` -} - -func (p *ProjectAlertSpec) ObjClusterName() string { - if parts := strings.SplitN(p.ProjectName, ":", 2); len(parts) == 2 { - return parts[0] - } - return "" -} - -type Recipient struct { - Recipient string `json:"recipient,omitempty"` - NotifierName string `json:"notifierName,omitempty" norman:"required,type=reference[notifier]"` - NotifierType string `json:"notifierType,omitempty" norman:"required,options=slack|email|pagerduty|webhook|wechat"` -} - -type TargetNode struct { - NodeName string `json:"nodeName,omitempty" norman:"type=reference[node]"` - Selector map[string]string `json:"selector,omitempty"` - Condition string `json:"condition,omitempty" norman:"required,options=notready|mem|cpu,default=notready"` - MemThreshold int `json:"memThreshold,omitempty" norman:"min=1,max=100,default=70"` - CPUThreshold int `json:"cpuThreshold,omitempty" norman:"min=1,default=70"` -} - -type TargetPod struct { - PodName string `json:"podName,omitempty" norman:"required,type=reference[/v3/projects/schemas/pod]"` - Condition string `json:"condition,omitempty" norman:"required,options=notrunning|notscheduled|restarts,default=notrunning"` - RestartTimes int `json:"restartTimes,omitempty" norman:"min=1,default=3"` - RestartIntervalSeconds int `json:"restartIntervalSeconds,omitempty" norman:"min=1,default=300"` -} - -type TargetEvent struct { - EventType string `json:"eventType,omitempty" norman:"required,options=Normal|Warning,default=Warning"` - ResourceKind string `json:"resourceKind,omitempty" norman:"required,options=Pod|Node|Deployment|StatefulSet|DaemonSet"` -} - -type TargetWorkload struct { - WorkloadID string `json:"workloadId,omitempty"` - Selector map[string]string `json:"selector,omitempty"` - AvailablePercentage int `json:"availablePercentage,omitempty" norman:"required,min=1,max=100,default=70"` -} - -type TargetSystemService struct { - Condition string `json:"condition,omitempty" norman:"required,options=etcd|controller-manager|scheduler,default=scheduler"` -} - -type AlertStatus struct { - AlertState string `json:"alertState,omitempty" norman:"options=active|inactive|alerting|muted,default=active"` -} - -type ClusterAlertGroup struct { - types.Namespaced - - metav1.TypeMeta `json:",inline"` - // Standard object’s metadata. More info: - // https://github.com/kubernetes/community/blob/master/contributors/devel/api-conventions.md#metadata - metav1.ObjectMeta `json:"metadata,omitempty"` - - Spec ClusterGroupSpec `json:"spec"` - // Most recent observed status of the alert. More info: - // https://github.com/kubernetes/community/blob/master/contributors/devel/api-conventions.md#spec-and-status - Status AlertStatus `json:"status"` -} - -func (c *ClusterAlertGroup) ObjClusterName() string { - return c.Spec.ObjClusterName() -} - -type ProjectAlertGroup struct { - types.Namespaced - - metav1.TypeMeta `json:",inline"` - // Standard object’s metadata. More info: - // https://github.com/kubernetes/community/blob/master/contributors/devel/api-conventions.md#metadata - metav1.ObjectMeta `json:"metadata,omitempty"` - - Spec ProjectGroupSpec `json:"spec"` - // Most recent observed status of the alert. More info: - // https://github.com/kubernetes/community/blob/master/contributors/devel/api-conventions.md#spec-and-status - Status AlertStatus `json:"status"` -} - -func (p *ProjectAlertGroup) ObjClusterName() string { - return p.Spec.ObjClusterName() -} - -type ClusterGroupSpec struct { - ClusterName string `json:"clusterName" norman:"type=reference[cluster]"` - Recipients []Recipient `json:"recipients,omitempty"` - CommonGroupField -} - -func (c *ClusterGroupSpec) ObjClusterName() string { - return c.ClusterName -} - -type ProjectGroupSpec struct { - ProjectName string `json:"projectName" norman:"type=reference[project]"` - Recipients []Recipient `json:"recipients,omitempty"` - CommonGroupField -} - -func (p *ProjectGroupSpec) ObjClusterName() string { - if parts := strings.SplitN(p.ProjectName, ":", 2); len(parts) == 2 { - return parts[0] - } - return "" -} - -type ClusterAlertRule struct { - types.Namespaced - - metav1.TypeMeta `json:",inline"` - // Standard object’s metadata. More info: - // https://github.com/kubernetes/community/blob/master/contributors/devel/api-conventions.md#metadata - metav1.ObjectMeta `json:"metadata,omitempty"` - - Spec ClusterAlertRuleSpec `json:"spec"` - // Most recent observed status of the alert. More info: - // https://github.com/kubernetes/community/blob/master/contributors/devel/api-conventions.md#spec-and-status - Status AlertStatus `json:"status"` -} - -func (c *ClusterAlertRule) ObjClusterName() string { - return c.Spec.ObjClusterName() -} - -type ClusterAlertRuleSpec struct { - CommonRuleField - ClusterName string `json:"clusterName" norman:"type=reference[cluster]"` - GroupName string `json:"groupName" norman:"type=reference[clusterAlertGroup]"` - NodeRule *NodeRule `json:"nodeRule,omitempty"` - EventRule *EventRule `json:"eventRule,omitempty"` - SystemServiceRule *SystemServiceRule `json:"systemServiceRule,omitempty"` - MetricRule *MetricRule `json:"metricRule,omitempty"` - ClusterScanRule *ClusterScanRule `json:"clusterScanRule,omitempty"` -} - -func (c *ClusterAlertRuleSpec) ObjClusterName() string { - return c.ClusterName -} - -type ProjectAlertRule struct { - types.Namespaced - - metav1.TypeMeta `json:",inline"` - // Standard object’s metadata. More info: - // https://github.com/kubernetes/community/blob/master/contributors/devel/api-conventions.md#metadata - metav1.ObjectMeta `json:"metadata,omitempty"` - - Spec ProjectAlertRuleSpec `json:"spec"` - // Most recent observed status of the alert. More info: - // https://github.com/kubernetes/community/blob/master/contributors/devel/api-conventions.md#spec-and-status - Status AlertStatus `json:"status"` -} - -func (p *ProjectAlertRule) ObjClusterName() string { - return p.Spec.ObjClusterName() -} - -type ProjectAlertRuleSpec struct { - CommonRuleField - ProjectName string `json:"projectName" norman:"type=reference[project]"` - GroupName string `json:"groupName" norman:"type=reference[projectAlertGroup]"` - PodRule *PodRule `json:"podRule,omitempty"` - WorkloadRule *WorkloadRule `json:"workloadRule,omitempty"` - MetricRule *MetricRule `json:"metricRule,omitempty"` -} - -func (p *ProjectAlertRuleSpec) ObjClusterName() string { - if parts := strings.SplitN(p.ProjectName, ":", 2); len(parts) == 2 { - return parts[0] - } - return "" -} - -type CommonGroupField struct { - DisplayName string `json:"displayName,omitempty" norman:"required"` - Description string `json:"description,omitempty"` - TimingField -} - -type CommonRuleField struct { - DisplayName string `json:"displayName,omitempty"` - Severity string `json:"severity,omitempty" norman:"required,options=info|critical|warning,default=critical"` - Inherited *bool `json:"inherited,omitempty" norman:"default=true"` - TimingField -} - -type ClusterScanRule struct { - ScanRunType ClusterScanRunType `json:"scanRunType,omitempty" norman:"required,options=manual|scheduled,default=scheduled"` - FailuresOnly bool `json:"failuresOnly,omitempty"` -} - -type MetricRule struct { - Expression string `json:"expression,omitempty" norman:"required"` - Description string `json:"description,omitempty"` - Duration string `json:"duration,omitempty" norman:"required"` - Comparison string `json:"comparison,omitempty" norman:"type=enum,options=equal|not-equal|greater-than|less-than|greater-or-equal|less-or-equal|has-value,default=equal"` - ThresholdValue float64 `json:"thresholdValue,omitempty" norman:"type=float"` -} - -type TimingField struct { - GroupWaitSeconds int `json:"groupWaitSeconds,omitempty" norman:"required,default=30,min=1"` - GroupIntervalSeconds int `json:"groupIntervalSeconds,omitempty" norman:"required,default=180,min=1"` - RepeatIntervalSeconds int `json:"repeatIntervalSeconds,omitempty" norman:"required,default=3600,min=1"` -} - -type NodeRule struct { - NodeName string `json:"nodeName,omitempty" norman:"type=reference[node]"` - Selector map[string]string `json:"selector,omitempty"` - Condition string `json:"condition,omitempty" norman:"required,options=notready|mem|cpu,default=notready"` - MemThreshold int `json:"memThreshold,omitempty" norman:"min=1,max=100,default=70"` - CPUThreshold int `json:"cpuThreshold,omitempty" norman:"min=1,default=70"` -} - -type PodRule struct { - PodName string `json:"podName,omitempty" norman:"required,type=reference[/v3/projects/schemas/pod]"` - Condition string `json:"condition,omitempty" norman:"required,options=notrunning|notscheduled|restarts,default=notrunning"` - RestartTimes int `json:"restartTimes,omitempty" norman:"min=1,default=3"` - RestartIntervalSeconds int `json:"restartIntervalSeconds,omitempty" norman:"min=1,default=300"` -} - -type EventRule struct { - EventType string `json:"eventType,omitempty" norman:"required,options=Normal|Warning,default=Warning"` - ResourceKind string `json:"resourceKind,omitempty" norman:"required,options=Pod|Node|Deployment|StatefulSet|DaemonSet"` -} - -type WorkloadRule struct { - WorkloadID string `json:"workloadId,omitempty"` - Selector map[string]string `json:"selector,omitempty"` - AvailablePercentage int `json:"availablePercentage,omitempty" norman:"required,min=1,max=100,default=70"` -} - -type SystemServiceRule struct { - Condition string `json:"condition,omitempty" norman:"required,options=etcd|controller-manager|scheduler,default=scheduler"` -} - -type Notifier struct { - types.Namespaced - - metav1.TypeMeta `json:",inline"` - // Standard object’s metadata. More info: - // https://github.com/kubernetes/community/blob/master/contributors/devel/api-conventions.md#metadata - metav1.ObjectMeta `json:"metadata,omitempty"` - - Spec NotifierSpec `json:"spec"` - // Most recent observed status of the notifier. More info: - // https://github.com/kubernetes/community/blob/master/contributors/devel/api-conventions.md#spec-and-status - Status NotifierStatus `json:"status"` -} - -func (n *Notifier) ObjClusterName() string { - return n.Spec.ObjClusterName() -} - -type NotifierSpec struct { - ClusterName string `json:"clusterName" norman:"type=reference[cluster]"` - - DisplayName string `json:"displayName,omitempty" norman:"required"` - Description string `json:"description,omitempty"` - SendResolved bool `json:"sendResolved,omitempty"` - SMTPConfig *SMTPConfig `json:"smtpConfig,omitempty"` - SlackConfig *SlackConfig `json:"slackConfig,omitempty"` - PagerdutyConfig *PagerdutyConfig `json:"pagerdutyConfig,omitempty"` - WebhookConfig *WebhookConfig `json:"webhookConfig,omitempty"` - WechatConfig *WechatConfig `json:"wechatConfig,omitempty"` -} - -func (n *NotifierSpec) ObjClusterName() string { - return n.ClusterName -} - -type Notification struct { - Message string `json:"message,omitempty"` - SMTPConfig *SMTPConfig `json:"smtpConfig,omitempty"` - SlackConfig *SlackConfig `json:"slackConfig,omitempty"` - PagerdutyConfig *PagerdutyConfig `json:"pagerdutyConfig,omitempty"` - WebhookConfig *WebhookConfig `json:"webhookConfig,omitempty"` - WechatConfig *WechatConfig `json:"wechatConfig,omitempty"` -} - -type SMTPConfig struct { - Host string `json:"host,omitempty" norman:"required,type=hostname"` - Port int `json:"port,omitempty" norman:"required,min=1,max=65535,default=587"` - Username string `json:"username,omitempty"` - Password string `json:"password,omitempty" norman:"type=password"` - Sender string `json:"sender,omitempty" norman:"required"` - DefaultRecipient string `json:"defaultRecipient,omitempty" norman:"required"` - TLS *bool `json:"tls,omitempty" norman:"required,default=true"` -} - -type SlackConfig struct { - DefaultRecipient string `json:"defaultRecipient,omitempty"` - URL string `json:"url,omitempty" norman:"required"` - *HTTPClientConfig -} - -type PagerdutyConfig struct { - ServiceKey string `json:"serviceKey,omitempty" norman:"required"` - *HTTPClientConfig -} - -type WebhookConfig struct { - URL string `json:"url,omitempty" norman:"required"` - *HTTPClientConfig -} - -type WechatConfig struct { - DefaultRecipient string `json:"defaultRecipient,omitempty" norman:"required"` - Secret string `json:"secret,omitempty" norman:"type=password,required"` - Agent string `json:"agent,omitempty" norman:"required"` - Corp string `json:"corp,omitempty" norman:"required"` - RecipientType string `json:"recipientType,omitempty" norman:"required,options=tag|party|user,default=party"` - APIURL string `json:"apiUrl,omitempty"` - *HTTPClientConfig -} - -type NotifierStatus struct { -} - -// HTTPClientConfig configures an HTTP client. -type HTTPClientConfig struct { - // HTTP proxy server to use to connect to the targets. - ProxyURL string `json:"proxyUrl,omitempty"` -} diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/authn_types.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/authn_types.go deleted file mode 100644 index 94fb8351..00000000 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/authn_types.go +++ /dev/null @@ -1,366 +0,0 @@ -package v3 - -import ( - "github.com/rancher/norman/condition" - v1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -const UserConditionInitialRolesPopulated condition.Cond = "InitialRolesPopulated" - -type Token struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - Token string `json:"token" norman:"writeOnly,noupdate"` - UserPrincipal Principal `json:"userPrincipal" norman:"type=reference[principal]"` - GroupPrincipals []Principal `json:"groupPrincipals" norman:"type=array[reference[principal]]"` - ProviderInfo map[string]string `json:"providerInfo,omitempty"` - UserID string `json:"userId" norman:"type=reference[user]"` - AuthProvider string `json:"authProvider"` - TTLMillis int64 `json:"ttl"` - LastUpdateTime string `json:"lastUpdateTime"` - IsDerived bool `json:"isDerived"` - Description string `json:"description"` - Expired bool `json:"expired"` - ExpiresAt string `json:"expiresAt"` - Current bool `json:"current"` - ClusterName string `json:"clusterName,omitempty" norman:"noupdate,type=reference[cluster]"` - Enabled *bool `json:"enabled,omitempty" norman:"default=true"` -} - -func (t *Token) ObjClusterName() string { - return t.ClusterName -} - -// +genclient -// +genclient:nonNamespaced -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -type User struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - DisplayName string `json:"displayName,omitempty"` - Description string `json:"description"` - Username string `json:"username,omitempty"` - Password string `json:"password,omitempty" norman:"writeOnly,noupdate"` - MustChangePassword bool `json:"mustChangePassword,omitempty"` - PrincipalIDs []string `json:"principalIds,omitempty" norman:"type=array[reference[principal]]"` - Me bool `json:"me,omitempty" norman:"nocreate,noupdate"` - Enabled *bool `json:"enabled,omitempty" norman:"default=true"` - Spec UserSpec `json:"spec,omitempty"` - Status UserStatus `json:"status"` -} - -type UserStatus struct { - Conditions []UserCondition `json:"conditions"` -} - -type UserCondition struct { - // Type of user condition. - Type string `json:"type"` - // Status of the condition, one of True, False, Unknown. - Status v1.ConditionStatus `json:"status"` - // The last time this condition was updated. - LastUpdateTime string `json:"lastUpdateTime,omitempty"` - // Last time the condition transitioned from one status to another. - LastTransitionTime string `json:"lastTransitionTime,omitempty"` - // The reason for the condition's last transition. - Reason string `json:"reason,omitempty"` - // Human-readable message indicating details about last transition - Message string `json:"message,omitempty"` -} - -type UserSpec struct{} - -// UserAttribute will have a CRD (and controller) generated for it, but will not be exposed in the API. -type UserAttribute struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - UserName string - GroupPrincipals map[string]Principals // the value is a []Principal, but code generator cannot handle slice as a value - LastRefresh string - NeedsRefresh bool -} - -type Principals struct { - Items []Principal -} - -type Group struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - DisplayName string `json:"displayName,omitempty"` -} - -type GroupMember struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - GroupName string `json:"groupName,omitempty" norman:"type=reference[group]"` - PrincipalID string `json:"principalId,omitempty" norman:"type=reference[principal]"` -} - -type Principal struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - DisplayName string `json:"displayName,omitempty"` - LoginName string `json:"loginName,omitempty"` - ProfilePicture string `json:"profilePicture,omitempty"` - ProfileURL string `json:"profileURL,omitempty"` - PrincipalType string `json:"principalType,omitempty"` - Me bool `json:"me,omitempty"` - MemberOf bool `json:"memberOf,omitempty"` - Provider string `json:"provider,omitempty"` - ExtraInfo map[string]string `json:"extraInfo,omitempty"` -} - -type SearchPrincipalsInput struct { - Name string `json:"name" norman:"type=string,required,notnullable"` - PrincipalType string `json:"principalType,omitempty" norman:"type=enum,options=user|group"` -} - -type ChangePasswordInput struct { - CurrentPassword string `json:"currentPassword" norman:"type=string,required"` - NewPassword string `json:"newPassword" norman:"type=string,required"` -} - -type SetPasswordInput struct { - NewPassword string `json:"newPassword" norman:"type=string,required"` -} - -type AuthConfig struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - Type string `json:"type" norman:"noupdate"` - Enabled bool `json:"enabled,omitempty"` - AccessMode string `json:"accessMode,omitempty" norman:"required,notnullable,type=enum,options=required|restricted|unrestricted"` - AllowedPrincipalIDs []string `json:"allowedPrincipalIds,omitempty" norman:"type=array[reference[principal]]"` -} - -type LocalConfig struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - AuthConfig `json:",inline" mapstructure:",squash"` -} - -type GithubConfig struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - AuthConfig `json:",inline" mapstructure:",squash"` - - Hostname string `json:"hostname,omitempty" norman:"default=github.com" norman:"required"` - TLS bool `json:"tls,omitempty" norman:"notnullable,default=true" norman:"required"` - ClientID string `json:"clientId,omitempty" norman:"required"` - ClientSecret string `json:"clientSecret,omitempty" norman:"required,type=password"` - - // AdditionalClientIDs is a map of clientID to client secrets - AdditionalClientIDs map[string]string `json:"additionalClientIds,omitempty" norman:"nocreate,noupdate"` - HostnameToClientID map[string]string `json:"hostnameToClientId,omitempty" norman:"nocreate,noupdate"` -} - -type GithubConfigTestOutput struct { - RedirectURL string `json:"redirectUrl"` -} - -type GithubConfigApplyInput struct { - GithubConfig GithubConfig `json:"githubConfig,omitempty"` - Code string `json:"code,omitempty"` - Enabled bool `json:"enabled,omitempty"` -} - -type GoogleOauthConfig struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - AuthConfig `json:",inline" mapstructure:",squash"` - - OauthCredential string `json:"oauthCredential,omitempty" norman:"required,type=password,notnullable"` - ServiceAccountCredential string `json:"serviceAccountCredential,omitempty" norman:"required,type=password,notnullable"` - AdminEmail string `json:"adminEmail,omitempty" norman:"required,notnullable"` - Hostname string `json:"hostname,omitempty" norman:"required,notnullable,noupdate"` - UserInfoEndpoint string `json:"userInfoEndpoint" norman:"default=https://openidconnect.googleapis.com/v1/userinfo,required,notnullable"` - NestedGroupMembershipEnabled bool `json:"nestedGroupMembershipEnabled" norman:"default=false"` -} - -type GoogleOauthConfigTestOutput struct { - RedirectURL string `json:"redirectUrl"` -} - -type GoogleOauthConfigApplyInput struct { - GoogleOauthConfig GoogleOauthConfig `json:"googleOauthConfig,omitempty"` - Code string `json:"code,omitempty"` - Enabled bool `json:"enabled,omitempty"` -} - -type AzureADConfig struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - AuthConfig `json:",inline" mapstructure:",squash"` - - Endpoint string `json:"endpoint,omitempty" norman:"default=https://login.microsoftonline.com/,required,notnullable"` - GraphEndpoint string `json:"graphEndpoint,omitempty" norman:"required,notnullable"` - TokenEndpoint string `json:"tokenEndpoint,omitempty" norman:"required,notnullable"` - AuthEndpoint string `json:"authEndpoint,omitempty" norman:"required,notnullable"` - TenantID string `json:"tenantId,omitempty" norman:"required,notnullable"` - ApplicationID string `json:"applicationId,omitempty" norman:"required,notnullable"` - ApplicationSecret string `json:"applicationSecret,omitempty" norman:"required,notnullable,type=password"` - RancherURL string `json:"rancherUrl,omitempty" norman:"required,notnullable"` -} - -type AzureADConfigTestOutput struct { - RedirectURL string `json:"redirectUrl"` -} - -type AzureADConfigApplyInput struct { - Config AzureADConfig `json:"config,omitempty"` - Code string `json:"code,omitempty"` -} - -type ActiveDirectoryConfig struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - AuthConfig `json:",inline" mapstructure:",squash"` - - Servers []string `json:"servers,omitempty" norman:"type=array[string],required"` - Port int64 `json:"port,omitempty" norman:"default=389"` - TLS bool `json:"tls,omitempty" norman:"default=false"` - Certificate string `json:"certificate,omitempty"` - DefaultLoginDomain string `json:"defaultLoginDomain,omitempty"` - ServiceAccountUsername string `json:"serviceAccountUsername,omitempty" norman:"required"` - ServiceAccountPassword string `json:"serviceAccountPassword,omitempty" norman:"type=password,required"` - UserDisabledBitMask int64 `json:"userDisabledBitMask,omitempty" norman:"default=2"` - UserSearchBase string `json:"userSearchBase,omitempty" norman:"required"` - UserSearchAttribute string `json:"userSearchAttribute,omitempty" norman:"default=sAMAccountName|sn|givenName,required"` - UserSearchFilter string `json:"userSearchFilter,omitempty"` - UserLoginAttribute string `json:"userLoginAttribute,omitempty" norman:"default=sAMAccountName,required"` - UserObjectClass string `json:"userObjectClass,omitempty" norman:"default=person,required"` - UserNameAttribute string `json:"userNameAttribute,omitempty" norman:"default=name,required"` - UserEnabledAttribute string `json:"userEnabledAttribute,omitempty" norman:"default=userAccountControl,required"` - GroupSearchBase string `json:"groupSearchBase,omitempty"` - GroupSearchAttribute string `json:"groupSearchAttribute,omitempty" norman:"default=sAMAccountName,required"` - GroupSearchFilter string `json:"groupSearchFilter,omitempty"` - GroupObjectClass string `json:"groupObjectClass,omitempty" norman:"default=group,required"` - GroupNameAttribute string `json:"groupNameAttribute,omitempty" norman:"default=name,required"` - GroupDNAttribute string `json:"groupDNAttribute,omitempty" norman:"default=distinguishedName,required"` - GroupMemberUserAttribute string `json:"groupMemberUserAttribute,omitempty" norman:"default=distinguishedName,required"` - GroupMemberMappingAttribute string `json:"groupMemberMappingAttribute,omitempty" norman:"default=member,required"` - ConnectionTimeout int64 `json:"connectionTimeout,omitempty" norman:"default=5000,notnullable,required"` - NestedGroupMembershipEnabled *bool `json:"nestedGroupMembershipEnabled,omitempty" norman:"default=false"` -} - -type ActiveDirectoryTestAndApplyInput struct { - ActiveDirectoryConfig ActiveDirectoryConfig `json:"activeDirectoryConfig,omitempty"` - Username string `json:"username"` - Password string `json:"password"` - Enabled bool `json:"enabled,omitempty"` -} - -type LdapFields struct { - Servers []string `json:"servers,omitempty" norman:"type=array[string],notnullable,required"` - Port int64 `json:"port,omitempty" norman:"default=389,notnullable,required"` - TLS bool `json:"tls,omitempty" norman:"default=false,notnullable,required"` - Certificate string `json:"certificate,omitempty"` - ServiceAccountDistinguishedName string `json:"serviceAccountDistinguishedName,omitempty" norman:"required"` - ServiceAccountPassword string `json:"serviceAccountPassword,omitempty" norman:"type=password,required"` - UserDisabledBitMask int64 `json:"userDisabledBitMask,omitempty"` - UserSearchBase string `json:"userSearchBase,omitempty" norman:"notnullable,required"` - UserSearchAttribute string `json:"userSearchAttribute,omitempty" norman:"default=uid|sn|givenName,notnullable,required"` - UserSearchFilter string `json:"userSearchFilter,omitempty"` - UserLoginAttribute string `json:"userLoginAttribute,omitempty" norman:"default=uid,notnullable,required"` - UserObjectClass string `json:"userObjectClass,omitempty" norman:"default=inetOrgPerson,notnullable,required"` - UserNameAttribute string `json:"userNameAttribute,omitempty" norman:"default=cn,notnullable,required"` - UserMemberAttribute string `json:"userMemberAttribute,omitempty" norman:"default=memberOf,notnullable,required"` - UserEnabledAttribute string `json:"userEnabledAttribute,omitempty"` - GroupSearchBase string `json:"groupSearchBase,omitempty"` - GroupSearchAttribute string `json:"groupSearchAttribute,omitempty" norman:"default=cn,notnullable,required"` - GroupSearchFilter string `json:"groupSearchFilter,omitempty"` - GroupObjectClass string `json:"groupObjectClass,omitempty" norman:"default=groupOfNames,notnullable,required"` - GroupNameAttribute string `json:"groupNameAttribute,omitempty" norman:"default=cn,notnullable,required"` - GroupDNAttribute string `json:"groupDNAttribute,omitempty" norman:"default=entryDN,notnullable"` - GroupMemberUserAttribute string `json:"groupMemberUserAttribute,omitempty" norman:"default=entryDN,notnullable"` - GroupMemberMappingAttribute string `json:"groupMemberMappingAttribute,omitempty" norman:"default=member,notnullable,required"` - ConnectionTimeout int64 `json:"connectionTimeout,omitempty" norman:"default=5000,notnullable,required"` - NestedGroupMembershipEnabled bool `json:"nestedGroupMembershipEnabled" norman:"default=false"` -} - -type LdapConfig struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - AuthConfig `json:",inline" mapstructure:",squash"` - LdapFields `json:",inline" mapstructure:",squash"` -} - -type LdapTestAndApplyInput struct { - LdapConfig `json:"ldapConfig,omitempty"` - Username string `json:"username"` - Password string `json:"password" norman:"type=password,required"` -} - -type OpenLdapConfig struct { - LdapConfig `json:",inline" mapstructure:",squash"` -} - -type OpenLdapTestAndApplyInput struct { - LdapTestAndApplyInput `json:",inline" mapstructure:",squash"` -} - -type FreeIpaConfig struct { - LdapConfig `json:",inline" mapstructure:",squash"` -} - -type FreeIpaTestAndApplyInput struct { - LdapTestAndApplyInput `json:",inline" mapstructure:",squash"` -} - -type SamlConfig struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - AuthConfig `json:",inline" mapstructure:",squash"` - - IDPMetadataContent string `json:"idpMetadataContent" norman:"required"` - SpCert string `json:"spCert" norman:"required"` - SpKey string `json:"spKey" norman:"required,type=password"` - GroupsField string `json:"groupsField" norman:"required"` - DisplayNameField string `json:"displayNameField" norman:"required"` - UserNameField string `json:"userNameField" norman:"required"` - UIDField string `json:"uidField" norman:"required"` - RancherAPIHost string `json:"rancherApiHost" norman:"required"` -} - -type SamlConfigTestInput struct { - FinalRedirectURL string `json:"finalRedirectUrl"` -} - -type SamlConfigTestOutput struct { - IdpRedirectURL string `json:"idpRedirectUrl"` -} - -type PingConfig struct { - SamlConfig `json:",inline" mapstructure:",squash"` -} - -type ADFSConfig struct { - SamlConfig `json:",inline" mapstructure:",squash"` -} - -type KeyCloakConfig struct { - SamlConfig `json:",inline" mapstructure:",squash"` -} - -type OKTAConfig struct { - SamlConfig `json:",inline" mapstructure:",squash"` -} - -type ShibbolethConfig struct { - SamlConfig `json:",inline" mapstructure:",squash"` - OpenLdapConfig LdapFields `json:"openLdapConfig" mapstructure:",squash"` -} - -type AuthSystemImages struct { - KubeAPIAuth string `json:"kubeAPIAuth,omitempty"` -} diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/authz_types.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/authz_types.go deleted file mode 100644 index aa2a915b..00000000 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/authz_types.go +++ /dev/null @@ -1,167 +0,0 @@ -package v3 - -import ( - "strings" - - "github.com/rancher/norman/condition" - "github.com/rancher/norman/types" - v1 "k8s.io/api/core/v1" - policyv1 "k8s.io/api/policy/v1beta1" - rbacv1 "k8s.io/api/rbac/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -var ( - NamespaceBackedResource condition.Cond = "BackingNamespaceCreated" - CreatorMadeOwner condition.Cond = "CreatorMadeOwner" - DefaultNetworkPolicyCreated condition.Cond = "DefaultNetworkPolicyCreated" - ProjectConditionInitialRolesPopulated condition.Cond = "InitialRolesPopulated" - ProjectConditionMonitoringEnabled condition.Cond = "MonitoringEnabled" - ProjectConditionMetricExpressionDeployed condition.Cond = "MetricExpressionDeployed" -) - -type Project struct { - types.Namespaced - - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - Spec ProjectSpec `json:"spec,omitempty"` - Status ProjectStatus `json:"status"` -} - -func (p *Project) ObjClusterName() string { - return p.Spec.ObjClusterName() -} - -type ProjectStatus struct { - Conditions []ProjectCondition `json:"conditions"` - PodSecurityPolicyTemplateName string `json:"podSecurityPolicyTemplateId"` - MonitoringStatus *MonitoringStatus `json:"monitoringStatus,omitempty" norman:"nocreate,noupdate"` -} - -type ProjectCondition struct { - // Type of project condition. - Type string `json:"type"` - // Status of the condition, one of True, False, Unknown. - Status v1.ConditionStatus `json:"status"` - // The last time this condition was updated. - LastUpdateTime string `json:"lastUpdateTime,omitempty"` - // Last time the condition transitioned from one status to another. - LastTransitionTime string `json:"lastTransitionTime,omitempty"` - // The reason for the condition's last transition. - Reason string `json:"reason,omitempty"` - // Human-readable message indicating details about last transition - Message string `json:"message,omitempty"` -} - -type ProjectSpec struct { - DisplayName string `json:"displayName,omitempty" norman:"required"` - Description string `json:"description"` - ClusterName string `json:"clusterName,omitempty" norman:"required,type=reference[cluster]"` - ResourceQuota *ProjectResourceQuota `json:"resourceQuota,omitempty"` - NamespaceDefaultResourceQuota *NamespaceResourceQuota `json:"namespaceDefaultResourceQuota,omitempty"` - ContainerDefaultResourceLimit *ContainerResourceLimit `json:"containerDefaultResourceLimit,omitempty"` - EnableProjectMonitoring bool `json:"enableProjectMonitoring" norman:"default=false"` -} - -func (p *ProjectSpec) ObjClusterName() string { - return p.ClusterName -} - -type GlobalRole struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - DisplayName string `json:"displayName,omitempty" norman:"required"` - Description string `json:"description"` - Rules []rbacv1.PolicyRule `json:"rules,omitempty"` - NewUserDefault bool `json:"newUserDefault,omitempty" norman:"required"` - Builtin bool `json:"builtin" norman:"nocreate,noupdate"` -} - -type GlobalRoleBinding struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - UserName string `json:"userName,omitempty" norman:"noupdate,type=reference[user]"` - GroupPrincipalName string `json:"groupPrincipalName,omitempty" norman:"noupdate,type=reference[principal]"` - GlobalRoleName string `json:"globalRoleName,omitempty" norman:"required,noupdate,type=reference[globalRole]"` -} - -type RoleTemplate struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - DisplayName string `json:"displayName,omitempty" norman:"required"` - Description string `json:"description"` - Rules []rbacv1.PolicyRule `json:"rules,omitempty"` - Builtin bool `json:"builtin" norman:"nocreate,noupdate"` - External bool `json:"external"` - Hidden bool `json:"hidden"` - Locked bool `json:"locked,omitempty" norman:"type=boolean"` - ClusterCreatorDefault bool `json:"clusterCreatorDefault,omitempty" norman:"required"` - ProjectCreatorDefault bool `json:"projectCreatorDefault,omitempty" norman:"required"` - Context string `json:"context" norman:"type=string,options=project|cluster"` - RoleTemplateNames []string `json:"roleTemplateNames,omitempty" norman:"type=array[reference[roleTemplate]]"` - Administrative bool `json:"administrative,omitempty"` -} - -type PodSecurityPolicyTemplate struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - Description string `json:"description"` - Spec policyv1.PodSecurityPolicySpec `json:"spec,omitempty"` -} - -type PodSecurityPolicyTemplateProjectBinding struct { - types.Namespaced - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - PodSecurityPolicyTemplateName string `json:"podSecurityPolicyTemplateId" norman:"required,type=reference[podSecurityPolicyTemplate]"` - TargetProjectName string `json:"targetProjectId" norman:"required,type=reference[project]"` -} - -type ProjectRoleTemplateBinding struct { - types.Namespaced - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - UserName string `json:"userName,omitempty" norman:"noupdate,type=reference[user]"` - UserPrincipalName string `json:"userPrincipalName,omitempty" norman:"noupdate,type=reference[principal]"` - GroupName string `json:"groupName,omitempty" norman:"noupdate,type=reference[group]"` - GroupPrincipalName string `json:"groupPrincipalName,omitempty" norman:"noupdate,type=reference[principal]"` - ProjectName string `json:"projectName,omitempty" norman:"required,noupdate,type=reference[project]"` - RoleTemplateName string `json:"roleTemplateName,omitempty" norman:"required,type=reference[roleTemplate]"` - ServiceAccount string `json:"serviceAccount,omitempty" norman:"nocreate,noupdate"` -} - -func (p *ProjectRoleTemplateBinding) ObjClusterName() string { - if parts := strings.SplitN(p.ProjectName, ":", 2); len(parts) == 2 { - return parts[0] - } - return "" -} - -type ClusterRoleTemplateBinding struct { - types.Namespaced - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - UserName string `json:"userName,omitempty" norman:"noupdate,type=reference[user]"` - UserPrincipalName string `json:"userPrincipalName,omitempty" norman:"noupdate,type=reference[principal]"` - GroupName string `json:"groupName,omitempty" norman:"noupdate,type=reference[group]"` - GroupPrincipalName string `json:"groupPrincipalName,omitempty" norman:"noupdate,type=reference[principal]"` - ClusterName string `json:"clusterName,omitempty" norman:"required,noupdate,type=reference[cluster]"` - RoleTemplateName string `json:"roleTemplateName,omitempty" norman:"required,type=reference[roleTemplate]"` -} - -func (c *ClusterRoleTemplateBinding) ObjClusterName() string { - return c.ClusterName -} - -type SetPodSecurityPolicyTemplateInput struct { - PodSecurityPolicyTemplateName string `json:"podSecurityPolicyTemplateId" norman:"required,type=reference[podSecurityPolicyTemplate]"` -} diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/backup_types.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/backup_types.go deleted file mode 100644 index 35bcc26d..00000000 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/backup_types.go +++ /dev/null @@ -1,88 +0,0 @@ -package v3 - -import ( - "github.com/rancher/norman/condition" - "github.com/rancher/norman/types" - v1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -const ( - BackupConditionCreated condition.Cond = "Created" - BackupConditionCompleted condition.Cond = "Completed" -) - -type BackupConfig struct { - // Enable or disable recurring backups in rancher - Enabled *bool `yaml:"enabled" json:"enabled,omitempty" norman:"default=true"` - // Backup interval in hours - IntervalHours int `yaml:"interval_hours" json:"intervalHours,omitempty" norman:"default=12"` - // Number of backups to keep - Retention int `yaml:"retention" json:"retention,omitempty" norman:"default=6"` - // s3 target - S3BackupConfig *S3BackupConfig `yaml:",omitempty" json:"s3BackupConfig"` - // replace special characters in snapshot names - SafeTimestamp bool `yaml:"safe_timestamp" json:"safeTimestamp,omitempty"` -} - -type S3BackupConfig struct { - // Access key ID - AccessKey string `yaml:"access_key" json:"accessKey,omitempty"` - // Secret access key - SecretKey string `yaml:"secret_key" json:"secretKey,omitempty" norman:"type=password" ` - // name of the bucket to use for backup - BucketName string `yaml:"bucket_name" json:"bucketName,omitempty"` - // AWS Region, AWS spcific - Region string `yaml:"region" json:"region,omitempty"` - // Endpoint is used if this is not an AWS API - Endpoint string `yaml:"endpoint" json:"endpoint"` - // CustomCA is used to connect to custom s3 endpoints - CustomCA string `yaml:"custom_ca" json:"customCa,omitempty"` - // Folder to place the files - Folder string `yaml:"folder" json:"folder,omitempty"` -} -type EtcdBackup struct { - types.Namespaced - - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - // backup spec - Spec EtcdBackupSpec `json:"spec"` - // backup status - Status EtcdBackupStatus `yaml:"status" json:"status,omitempty"` -} - -type EtcdBackupSpec struct { - // cluster ID - ClusterID string `json:"clusterId,omitempty" norman:"required,type=reference[cluster],noupdate"` - // manual backup flag - Manual bool `yaml:"manual" json:"manual,omitempty"` - // actual file name on the target - Filename string `yaml:"filename" json:"filename,omitempty" norman:"noupdate"` - // backupConfig - BackupConfig BackupConfig `yaml:",omitempty" json:"backupConfig,omitempty" norman:"noupdate"` -} - -type EtcdBackupStatus struct { - Conditions []EtcdBackupCondition `json:"conditions"` - // version of k8s in the backup pulled from rke config - KubernetesVersion string `yaml:"kubernetesVersion" json:"kubernetesVersion,omitempty" norman:"noupdate"` - // json + gzipped + base64 backup of the cluster object when the backup was created - ClusterObject string `yaml:"clusterObject" json:"clusterObject,omitempty" norman:"type=password,noupdate"` -} - -type EtcdBackupCondition struct { - // Type of condition. - Type string `json:"type"` - // Status of the condition, one of True, False, Unknown. - Status v1.ConditionStatus `json:"status"` - // The last time this condition was updated. - LastUpdateTime string `json:"lastUpdateTime,omitempty"` - // Last time the condition transitioned from one status to another. - LastTransitionTime string `json:"lastTransitionTime,omitempty"` - // The reason for the condition's last transition. - Reason string `json:"reason,omitempty"` - // Human-readable message indicating details about last transition - Message string `json:"message,omitempty"` -} diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/catalog_types.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/catalog_types.go deleted file mode 100644 index 7f47ab0a..00000000 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/catalog_types.go +++ /dev/null @@ -1,255 +0,0 @@ -package v3 - -import ( - "strings" - - "github.com/rancher/norman/condition" - "github.com/rancher/norman/types" - v1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -type Catalog struct { - metav1.TypeMeta `json:",inline"` - // Standard object’s metadata. More info: - // https://github.com/kubernetes/community/blob/master/contributors/devel/api-conventions.md#metadata - metav1.ObjectMeta `json:"metadata,omitempty"` - // Specification of the desired behavior of the the cluster. More info: - // https://github.com/kubernetes/community/blob/master/contributors/devel/api-conventions.md#spec-and-status - Spec CatalogSpec `json:"spec"` - Status CatalogStatus `json:"status"` -} - -type CatalogSpec struct { - Description string `json:"description"` - URL string `json:"url,omitempty" norman:"required"` - Branch string `json:"branch,omitempty"` - CatalogKind string `json:"catalogKind,omitempty"` - Username string `json:"username,omitempty"` - Password string `json:"password,omitempty" norman:"type=password"` - HelmVersion string `json:"helmVersion,omitempty" norman:"noupdate"` -} - -type CatalogStatus struct { - LastRefreshTimestamp string `json:"lastRefreshTimestamp,omitempty"` - Commit string `json:"commit,omitempty"` - // helmVersionCommits records hash of each helm template version - HelmVersionCommits map[string]VersionCommits `json:"helmVersionCommits,omitempty"` - Conditions []CatalogCondition `json:"conditions,omitempty"` -} - -var ( - CatalogConditionRefreshed condition.Cond = "Refreshed" - CatalogConditionUpgraded condition.Cond = "Upgraded" - CatalogConditionDiskCached condition.Cond = "DiskCached" - CatalogConditionProcessed condition.Cond = "Processed" -) - -type CatalogCondition struct { - // Type of cluster condition. - Type ClusterConditionType `json:"type"` - // Status of the condition, one of True, False, Unknown. - Status v1.ConditionStatus `json:"status"` - // The last time this condition was updated. - LastUpdateTime string `json:"lastUpdateTime,omitempty"` - // Last time the condition transitioned from one status to another. - LastTransitionTime string `json:"lastTransitionTime,omitempty"` - // The reason for the condition's last transition. - Reason string `json:"reason,omitempty"` - // Human-readable message indicating details about last transition - Message string `json:"message,omitempty"` -} - -type VersionCommits struct { - Value map[string]string `json:"Value,omitempty"` -} - -type Template struct { - metav1.TypeMeta `json:",inline"` - // Standard object’s metadata. More info: - // https://github.com/kubernetes/community/blob/master/contributors/devel/api-conventions.md#metadata - metav1.ObjectMeta `json:"metadata,omitempty"` - // Specification of the desired behavior of the the cluster. More info: - // https://github.com/kubernetes/community/blob/master/contributors/devel/api-conventions.md#spec-and-status - Spec TemplateSpec `json:"spec"` - Status TemplateStatus `json:"status"` -} - -type CatalogTemplate struct { - types.Namespaced - - metav1.TypeMeta `json:",inline"` - // Standard object’s metadata. More info: - // https://github.com/kubernetes/community/blob/master/contributors/devel/api-conventions.md#metadata - metav1.ObjectMeta `json:"metadata,omitempty"` - // Specification of the desired behavior of the the cluster. More info: - // https://github.com/kubernetes/community/blob/master/contributors/devel/api-conventions.md#spec-and-status - Template -} - -type TemplateSpec struct { - DisplayName string `json:"displayName"` - CatalogID string `json:"catalogId,omitempty" norman:"type=reference[catalog]"` - ProjectCatalogID string `json:"projectCatalogId,omitempty" norman:"type=reference[projectCatalog]"` - ClusterCatalogID string `json:"clusterCatalogId,omitempty" norman:"type=reference[clusterCatalog]"` - DefaultTemplateVersionID string `json:"defaultTemplateVersionId,omitempty" norman:"type=reference[templateVersion]"` - ProjectID string `json:"projectId,omitempty" norman:"required,type=reference[project]"` - ClusterID string `json:"clusterId,omitempty" norman:"required,type=reference[cluster]"` - - Description string `json:"description,omitempty"` - DefaultVersion string `json:"defaultVersion,omitempty" yaml:"default_version,omitempty"` - Path string `json:"path,omitempty"` - Maintainer string `json:"maintainer,omitempty"` - ProjectURL string `json:"projectURL,omitempty" yaml:"project_url,omitempty"` - UpgradeFrom string `json:"upgradeFrom,omitempty"` - FolderName string `json:"folderName,omitempty"` - Icon string `json:"icon,omitempty"` - IconFilename string `json:"iconFilename,omitempty"` - - // Deprecated: Do not use - Readme string `json:"readme,omitempty" norman:"nocreate,noupdate"` - - Categories []string `json:"categories,omitempty"` - Versions []TemplateVersionSpec `json:"versions,omitempty"` - - Category string `json:"category,omitempty"` -} - -type TemplateStatus struct { - HelmVersion string `json:"helmVersion,omitempty" norman:"noupdate,nocreate"` -} - -type TemplateVersion struct { - metav1.TypeMeta `json:",inline"` - // Standard object’s metadata. More info: - // https://github.com/kubernetes/community/blob/master/contributors/devel/api-conventions.md#metadata - metav1.ObjectMeta `json:"metadata,omitempty"` - // Specification of the desired behavior of the the cluster. More info: - // https://github.com/kubernetes/community/blob/master/contributors/devel/api-conventions.md#spec-and-status - Spec TemplateVersionSpec `json:"spec"` - Status TemplateVersionStatus `json:"status"` -} - -type CatalogTemplateVersion struct { - types.Namespaced - metav1.TypeMeta `json:",inline"` - // Standard object’s metadata. More info: - // https://github.com/kubernetes/community/blob/master/contributors/devel/api-conventions.md#metadata - metav1.ObjectMeta `json:"metadata,omitempty"` - // Specification of the desired behavior of the the cluster. More info: - // https://github.com/kubernetes/community/blob/master/contributors/devel/api-conventions.md#spec-and-status - TemplateVersion -} - -type TemplateVersionSpec struct { - ExternalID string `json:"externalId,omitempty"` - Version string `json:"version,omitempty"` - RancherVersion string `json:"rancherVersion,omitempty"` - RequiredNamespace string `json:"requiredNamespace,omitempty"` - KubeVersion string `json:"kubeVersion,omitempty"` - UpgradeVersionLinks map[string]string `json:"upgradeVersionLinks,omitempty"` - Digest string `json:"digest,omitempty"` - RancherMinVersion string `json:"rancherMinVersion,omitempty"` - RancherMaxVersion string `json:"rancherMaxVersion,omitempty"` - - // Deprecated: Do not use - Files map[string]string `json:"files,omitempty" norman:"nocreate,noupdate"` - // Deprecated: Do not use - Questions []Question `json:"questions,omitempty" norman:"nocreate,noupdate"` - // Deprecated: Do not use - Readme string `json:"readme,omitempty" norman:"nocreate,noupdate"` - // Deprecated: Do not use - AppReadme string `json:"appReadme,omitempty" norman:"nocreate,noupdate"` - - // for local cache rebuilt - VersionName string `json:"versionName,omitempty"` - VersionDir string `json:"versionDir,omitempty"` - VersionURLs []string `json:"versionUrls,omitempty"` -} - -type TemplateVersionStatus struct { - HelmVersion string `json:"helmVersion,omitempty" norman:"noupdate,nocreate"` -} - -type File struct { - Name string `json:"name,omitempty"` - Contents string `json:"contents,omitempty"` -} - -type Question struct { - Variable string `json:"variable,omitempty" yaml:"variable,omitempty"` - Label string `json:"label,omitempty" yaml:"label,omitempty"` - Description string `json:"description,omitempty" yaml:"description,omitempty"` - Type string `json:"type,omitempty" yaml:"type,omitempty"` - Required bool `json:"required,omitempty" yaml:"required,omitempty"` - Default string `json:"default,omitempty" yaml:"default,omitempty"` - Group string `json:"group,omitempty" yaml:"group,omitempty"` - MinLength int `json:"minLength,omitempty" yaml:"min_length,omitempty"` - MaxLength int `json:"maxLength,omitempty" yaml:"max_length,omitempty"` - Min int `json:"min,omitempty" yaml:"min,omitempty"` - Max int `json:"max,omitempty" yaml:"max,omitempty"` - Options []string `json:"options,omitempty" yaml:"options,omitempty"` - ValidChars string `json:"validChars,omitempty" yaml:"valid_chars,omitempty"` - InvalidChars string `json:"invalidChars,omitempty" yaml:"invalid_chars,omitempty"` - Subquestions []SubQuestion `json:"subquestions,omitempty" yaml:"subquestions,omitempty"` - ShowIf string `json:"showIf,omitempty" yaml:"show_if,omitempty"` - ShowSubquestionIf string `json:"showSubquestionIf,omitempty" yaml:"show_subquestion_if,omitempty"` - Satisfies string `json:"satisfies,omitempty" yaml:"satisfies,omitempty"` -} - -type SubQuestion struct { - Variable string `json:"variable,omitempty" yaml:"variable,omitempty"` - Label string `json:"label,omitempty" yaml:"label,omitempty"` - Description string `json:"description,omitempty" yaml:"description,omitempty"` - Type string `json:"type,omitempty" yaml:"type,omitempty"` - Required bool `json:"required,omitempty" yaml:"required,omitempty"` - Default string `json:"default,omitempty" yaml:"default,omitempty"` - Group string `json:"group,omitempty" yaml:"group,omitempty"` - MinLength int `json:"minLength,omitempty" yaml:"min_length,omitempty"` - MaxLength int `json:"maxLength,omitempty" yaml:"max_length,omitempty"` - Min int `json:"min,omitempty" yaml:"min,omitempty"` - Max int `json:"max,omitempty" yaml:"max,omitempty"` - Options []string `json:"options,omitempty" yaml:"options,omitempty"` - ValidChars string `json:"validChars,omitempty" yaml:"valid_chars,omitempty"` - InvalidChars string `json:"invalidChars,omitempty" yaml:"invalid_chars,omitempty"` - ShowIf string `json:"showIf,omitempty" yaml:"show_if,omitempty"` - Satisfies string `json:"satisfies,omitempty" yaml:"satisfies,omitempty"` -} - -// TemplateContent is deprecated -// -// Deprecated: Do not use -type TemplateContent struct { - metav1.TypeMeta `json:",inline"` - // Standard object’s metadata. More info: - // https://github.com/kubernetes/community/blob/master/contributors/devel/api-conventions.md#metadata - metav1.ObjectMeta `json:"metadata,omitempty"` - // Specification of the desired behavior of the the cluster. More info: - // https://github.com/kubernetes/community/blob/master/contributors/devel/api-conventions.md#spec-and-status - Data string `json:"data,omitempty"` -} - -type ProjectCatalog struct { - types.Namespaced - - Catalog `json:",inline" mapstructure:",squash"` - ProjectName string `json:"projectName,omitempty" norman:"type=reference[project]"` -} - -func (p *ProjectCatalog) ObjClusterName() string { - if parts := strings.SplitN(p.ProjectName, ":", 2); len(parts) == 2 { - return parts[0] - } - return "" -} - -type ClusterCatalog struct { - types.Namespaced - - Catalog `json:",inline" mapstructure:",squash"` - ClusterName string `json:"clusterName,omitempty" norman:"required,type=reference[cluster]"` -} - -type CatalogRefresh struct { - Catalogs []string `json:"catalogs"` -} diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/cluster_scan_types.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/cluster_scan_types.go deleted file mode 100644 index 37cb7de2..00000000 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/cluster_scan_types.go +++ /dev/null @@ -1,150 +0,0 @@ -package v3 - -import ( - "github.com/rancher/norman/condition" - "github.com/rancher/norman/types" - typescond "github.com/rancher/types/condition" - v1 "k8s.io/api/core/v1" - - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -type ClusterScanRunType string -type CisScanProfileType string - -const ( - ClusterScanConditionCreated condition.Cond = typescond.Created - ClusterScanConditionRunCompleted condition.Cond = typescond.RunCompleted - ClusterScanConditionCompleted condition.Cond = typescond.Completed - ClusterScanConditionFailed condition.Cond = typescond.Failed - ClusterScanConditionAlerted condition.Cond = typescond.Alerted - - ClusterScanTypeCis = "cis" - DefaultNamespaceForCis = "security-scan" - DefaultSonobuoyPodName = "security-scan-runner" - ConfigMapNameForUserConfig = "security-scan-cfg" - - SonobuoyCompletionAnnotation = "field.cattle.io/sonobuoyDone" - CisHelmChartOwner = "field.cattle.io/clusterScanOwner" - - ClusterScanRunTypeManual ClusterScanRunType = "manual" - ClusterScanRunTypeScheduled ClusterScanRunType = "scheduled" - - CisScanProfileTypePermissive CisScanProfileType = "permissive" - CisScanProfileTypeHardened CisScanProfileType = "hardened" - - DefaultScanOutputFileName string = "output.json" -) - -type CisScanConfig struct { - // IDs of the checks that need to be skipped in the final report - OverrideSkip []string `json:"overrideSkip"` - // Override the CIS benchmark version to use for the scan (instead of latest) - OverrideBenchmarkVersion string `json:"overrideBenchmarkVersion,omitempty"` - // scan profile to use - Profile CisScanProfileType `json:"profile,omitempty" norman:"required,options=permissive|hardened,default=permissive"` - // Internal flag for debugging master component of the scan - DebugMaster bool `json:"debugMaster"` - // Internal flag for debugging worker component of the scan - DebugWorker bool `json:"debugWorker"` -} - -type CisScanStatus struct { - Total int `json:"total"` - Pass int `json:"pass"` - Fail int `json:"fail"` - Skip int `json:"skip"` - NotApplicable int `json:"notApplicable"` -} - -type ClusterScanConfig struct { - CisScanConfig *CisScanConfig `json:"cisScanConfig"` -} - -type ClusterScanCondition struct { - // Type of condition. - Type string `json:"type"` - // Status of the condition, one of True, False, Unknown. - Status v1.ConditionStatus `json:"status"` - // The last time this condition was updated. - LastUpdateTime string `json:"lastUpdateTime,omitempty"` - // Last time the condition transitioned from one status to another. - LastTransitionTime string `json:"lastTransitionTime,omitempty"` - // The reason for the condition's last transition. - Reason string `json:"reason,omitempty"` - // Human-readable message indicating details about last transition - Message string `json:"message,omitempty"` -} - -type ClusterScanSpec struct { - ScanType string `json:"scanType"` - // cluster ID - ClusterID string `json:"clusterId,omitempty" norman:"required,type=reference[cluster]"` - // Run type - RunType ClusterScanRunType `json:"runType,omitempty"` - // scanConfig - ScanConfig ClusterScanConfig `yaml:",omitempty" json:"scanConfig,omitempty"` -} - -type ClusterScanStatus struct { - Conditions []ClusterScanCondition `json:"conditions"` - CisScanStatus *CisScanStatus `json:"cisScanStatus"` -} - -type ClusterScan struct { - types.Namespaced - - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - Spec ClusterScanSpec `json:"spec"` - Status ClusterScanStatus `yaml:"status" json:"status,omitempty"` -} - -type CisBenchmarkVersionInfo struct { - Managed bool `yaml:"managed" json:"managed"` - MinKubernetesVersion string `yaml:"min_kubernetes_version" json:"minKubernetesVersion"` - SkippedChecks map[string]string `yaml:"skipped_checks" json:"skippedChecks"` - NotApplicableChecks map[string]string `yaml:"not_applicable_checks" json:"notApplicableChecks"` -} - -type CisConfigParams struct { - BenchmarkVersion string `yaml:"benchmark_version" json:"benchmarkVersion"` -} - -type CisConfig struct { - types.Namespaced - - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - Params CisConfigParams `yaml:"params" json:"params,omitempty"` -} - -type CisBenchmarkVersion struct { - types.Namespaced - - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - Info CisBenchmarkVersionInfo `json:"info" yaml:"info"` -} - -type ScheduledClusterScanConfig struct { - // Cron Expression for Schedule - CronSchedule string `yaml:"cron_schedule" json:"cronSchedule,omitempty"` - // Number of past scans to keep - Retention int `yaml:"retention" json:"retention,omitempty"` -} - -type ScheduledClusterScan struct { - // Enable or disable scheduled scans - Enabled bool `yaml:"enabled" json:"enabled,omitempty" norman:"default=false"` - ScheduleConfig *ScheduledClusterScanConfig `yaml:"schedule_config" json:"scheduleConfig,omitempty"` - ScanConfig *ClusterScanConfig `yaml:"scan_config,omitempty" json:"scanConfig,omitempty"` -} - -type ScheduledClusterScanStatus struct { - Enabled bool `yaml:"enabled" json:"enabled,omitempty"` - LastRunTimestamp string `yaml:"last_run_timestamp" json:"lastRunTimestamp"` -} diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/cluster_template_types.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/cluster_template_types.go deleted file mode 100644 index e4aeef36..00000000 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/cluster_template_types.go +++ /dev/null @@ -1,50 +0,0 @@ -package v3 - -import ( - "github.com/rancher/norman/types" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -type ClusterTemplate struct { - types.Namespaced - - metav1.TypeMeta `json:",inline"` - // Standard object’s metadata. More info: - // https://github.com/kubernetes/community/blob/master/contributors/devel/api-conventions.md#metadata - metav1.ObjectMeta `json:"metadata,omitempty"` - - Spec ClusterTemplateSpec `json:"spec"` -} - -type ClusterTemplateSpec struct { - DisplayName string `json:"displayName" norman:"required"` - Description string `json:"description"` - DefaultRevisionName string `json:"defaultRevisionName,omitempty" norman:"type=reference[clusterTemplateRevision]"` - - Members []Member `json:"members,omitempty"` -} - -type ClusterTemplateRevision struct { - types.Namespaced - - metav1.TypeMeta `json:",inline"` - // Standard object’s metadata. More info: - // https://github.com/kubernetes/community/blob/master/contributors/devel/api-conventions.md#metadata - metav1.ObjectMeta `json:"metadata,omitempty"` - // Specification of the desired behavior of the the cluster. More info: - // https://github.com/kubernetes/community/blob/master/contributors/devel/api-conventions.md#spec-and-status - Spec ClusterTemplateRevisionSpec `json:"spec"` -} - -type ClusterTemplateRevisionSpec struct { - DisplayName string `json:"displayName" norman:"required"` - Enabled *bool `json:"enabled,omitempty" norman:"default=true"` - ClusterTemplateName string `json:"clusterTemplateName,omitempty" norman:"type=reference[clusterTemplate],required,noupdate"` - - Questions []Question `json:"questions,omitempty"` - ClusterConfig *ClusterSpecBase `json:"clusterConfig" norman:"required"` -} - -type ClusterTemplateQuestionsOutput struct { - Questions []Question `json:"questions,omitempty"` -} diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/cluster_types.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/cluster_types.go deleted file mode 100644 index 1a6607bb..00000000 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/cluster_types.go +++ /dev/null @@ -1,331 +0,0 @@ -package v3 - -import ( - "bytes" - "encoding/gob" - "strings" - - "github.com/rancher/norman/condition" - "github.com/rancher/norman/types" - "github.com/sirupsen/logrus" - v1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/version" -) - -func init() { - gob.Register(map[string]interface{}{}) - gob.Register([]interface{}{}) -} - -type ClusterConditionType string - -const ( - ClusterActionGenerateKubeconfig = "generateKubeconfig" - ClusterActionImportYaml = "importYaml" - ClusterActionExportYaml = "exportYaml" - ClusterActionViewMonitoring = "viewMonitoring" - ClusterActionEditMonitoring = "editMonitoring" - ClusterActionEnableMonitoring = "enableMonitoring" - ClusterActionDisableMonitoring = "disableMonitoring" - ClusterActionBackupEtcd = "backupEtcd" - ClusterActionRestoreFromEtcdBackup = "restoreFromEtcdBackup" - ClusterActionRotateCertificates = "rotateCertificates" - ClusterActionRunSecurityScan = "runSecurityScan" - ClusterActionSaveAsTemplate = "saveAsTemplate" - - // ClusterConditionReady Cluster ready to serve API (healthy when true, unhealthy when false) - ClusterConditionReady condition.Cond = "Ready" - ClusterConditionPending condition.Cond = "Pending" - ClusterConditionCertsGenerated condition.Cond = "CertsGenerated" - ClusterConditionEtcd condition.Cond = "etcd" - ClusterConditionProvisioned condition.Cond = "Provisioned" - ClusterConditionUpdated condition.Cond = "Updated" - ClusterConditionUpgraded condition.Cond = "Upgraded" - ClusterConditionWaiting condition.Cond = "Waiting" - ClusterConditionRemoved condition.Cond = "Removed" - // ClusterConditionNoDiskPressure true when all cluster nodes have sufficient disk - ClusterConditionNoDiskPressure condition.Cond = "NoDiskPressure" - // ClusterConditionNoMemoryPressure true when all cluster nodes have sufficient memory - ClusterConditionNoMemoryPressure condition.Cond = "NoMemoryPressure" - // ClusterConditionconditionDefaultProjectCreated true when default project has been created - ClusterConditionconditionDefaultProjectCreated condition.Cond = "DefaultProjectCreated" - // ClusterConditionconditionSystemProjectCreated true when system project has been created - ClusterConditionconditionSystemProjectCreated condition.Cond = "SystemProjectCreated" - // ClusterConditionDefaultNamespaceAssigned true when cluster's default namespace has been initially assigned - ClusterConditionDefaultNamespaceAssigned condition.Cond = "DefaultNamespaceAssigned" - // ClusterConditionSystemNamespacesAssigned true when cluster's system namespaces has been initially assigned to - // a system project - ClusterConditionSystemNamespacesAssigned condition.Cond = "SystemNamespacesAssigned" - ClusterConditionAddonDeploy condition.Cond = "AddonDeploy" - ClusterConditionSystemAccountCreated condition.Cond = "SystemAccountCreated" - ClusterConditionAgentDeployed condition.Cond = "AgentDeployed" - ClusterConditionGlobalAdminsSynced condition.Cond = "GlobalAdminsSynced" - ClusterConditionInitialRolesPopulated condition.Cond = "InitialRolesPopulated" - ClusterConditionServiceAccountMigrated condition.Cond = "ServiceAccountMigrated" - ClusterConditionPrometheusOperatorDeployed condition.Cond = "PrometheusOperatorDeployed" - ClusterConditionMonitoringEnabled condition.Cond = "MonitoringEnabled" - ClusterConditionAlertingEnabled condition.Cond = "AlertingEnabled" - - ClusterDriverImported = "imported" - ClusterDriverLocal = "local" - ClusterDriverRKE = "rancherKubernetesEngine" - ClusterDriverK3s = "k3s" - ClusterDriverK3os = "k3os" -) - -// +genclient -// +genclient:nonNamespaced -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -type Cluster struct { - metav1.TypeMeta `json:",inline"` - // Standard object’s metadata. More info: - // https://github.com/kubernetes/community/blob/master/contributors/devel/api-conventions.md#metadata - metav1.ObjectMeta `json:"metadata,omitempty"` - // Specification of the desired behavior of the the cluster. More info: - // https://github.com/kubernetes/community/blob/master/contributors/devel/api-conventions.md#spec-and-status - Spec ClusterSpec `json:"spec"` - // Most recent observed status of the cluster. More info: - // https://github.com/kubernetes/community/blob/master/contributors/devel/api-conventions.md#spec-and-status - Status ClusterStatus `json:"status"` -} - -type ClusterSpecBase struct { - DesiredAgentImage string `json:"desiredAgentImage"` - DesiredAuthImage string `json:"desiredAuthImage"` - AgentImageOverride string `json:"agentImageOverride"` - RancherKubernetesEngineConfig *RancherKubernetesEngineConfig `json:"rancherKubernetesEngineConfig,omitempty"` - DefaultPodSecurityPolicyTemplateName string `json:"defaultPodSecurityPolicyTemplateName,omitempty" norman:"type=reference[podSecurityPolicyTemplate]"` - DefaultClusterRoleForProjectMembers string `json:"defaultClusterRoleForProjectMembers,omitempty" norman:"type=reference[roleTemplate]"` - DockerRootDir string `json:"dockerRootDir,omitempty" norman:"default=/var/lib/docker"` - EnableNetworkPolicy *bool `json:"enableNetworkPolicy" norman:"default=false"` - EnableClusterAlerting bool `json:"enableClusterAlerting" norman:"default=false"` - EnableClusterMonitoring bool `json:"enableClusterMonitoring" norman:"default=false"` - WindowsPreferedCluster bool `json:"windowsPreferedCluster" norman:"noupdate"` - LocalClusterAuthEndpoint LocalClusterAuthEndpoint `json:"localClusterAuthEndpoint,omitempty"` - ScheduledClusterScan *ScheduledClusterScan `json:"scheduledClusterScan,omitempty"` -} - -type ClusterSpec struct { - ClusterSpecBase - DisplayName string `json:"displayName" norman:"required"` - Description string `json:"description"` - Internal bool `json:"internal" norman:"nocreate,noupdate"` - K3sConfig *K3sConfig `json:"k3sConfig,omitempty"` - ImportedConfig *ImportedConfig `json:"importedConfig,omitempty" norman:"nocreate,noupdate"` - GoogleKubernetesEngineConfig *MapStringInterface `json:"googleKubernetesEngineConfig,omitempty"` - AzureKubernetesServiceConfig *MapStringInterface `json:"azureKubernetesServiceConfig,omitempty"` - AmazonElasticContainerServiceConfig *MapStringInterface `json:"amazonElasticContainerServiceConfig,omitempty"` - GenericEngineConfig *MapStringInterface `json:"genericEngineConfig,omitempty"` - ClusterTemplateName string `json:"clusterTemplateName,omitempty" norman:"type=reference[clusterTemplate],nocreate,noupdate"` - ClusterTemplateRevisionName string `json:"clusterTemplateRevisionName,omitempty" norman:"type=reference[clusterTemplateRevision]"` - ClusterTemplateAnswers Answer `json:"answers,omitempty"` - ClusterTemplateQuestions []Question `json:"questions,omitempty" norman:"nocreate,noupdate"` -} - -type ImportedConfig struct { - KubeConfig string `json:"kubeConfig" norman:"type=password"` -} - -type ClusterStatus struct { - // Conditions represent the latest available observations of an object's current state: - // More info: https://github.com/kubernetes/community/blob/master/contributors/devel/api-conventions.md#typical-status-properties - Conditions []ClusterCondition `json:"conditions,omitempty"` - // Component statuses will represent cluster's components (etcd/controller/scheduler) health - // https://kubernetes.io/docs/api-reference/v1.8/#componentstatus-v1-core - Driver string `json:"driver"` - AgentImage string `json:"agentImage"` - AgentFeatures map[string]bool `json:"agentFeatures,omitempty"` - AuthImage string `json:"authImage"` - ComponentStatuses []ClusterComponentStatus `json:"componentStatuses,omitempty"` - APIEndpoint string `json:"apiEndpoint,omitempty"` - ServiceAccountToken string `json:"serviceAccountToken,omitempty"` - CACert string `json:"caCert,omitempty"` - Capacity v1.ResourceList `json:"capacity,omitempty"` - Allocatable v1.ResourceList `json:"allocatable,omitempty"` - AppliedSpec ClusterSpec `json:"appliedSpec,omitempty"` - FailedSpec *ClusterSpec `json:"failedSpec,omitempty"` - Requested v1.ResourceList `json:"requested,omitempty"` - Limits v1.ResourceList `json:"limits,omitempty"` - Version *version.Info `json:"version,omitempty"` - AppliedPodSecurityPolicyTemplateName string `json:"appliedPodSecurityPolicyTemplateId"` - AppliedEnableNetworkPolicy bool `json:"appliedEnableNetworkPolicy" norman:"nocreate,noupdate,default=false"` - Capabilities Capabilities `json:"capabilities,omitempty"` - MonitoringStatus *MonitoringStatus `json:"monitoringStatus,omitempty" norman:"nocreate,noupdate"` - NodeVersion int `json:"nodeVersion,omitempty"` - NodeCount int `json:"nodeCount,omitempty" norman:"nocreate,noupdate"` - IstioEnabled bool `json:"istioEnabled,omitempty" norman:"nocreate,noupdate,default=false"` - CertificatesExpiration map[string]CertExpiration `json:"certificatesExpiration,omitempty"` - ScheduledClusterScanStatus *ScheduledClusterScanStatus `json:"scheduledClusterScanStatus,omitempty"` - CurrentCisRunName string `json:"currentCisRunName,omitempty"` -} - -type ClusterComponentStatus struct { - Name string `json:"name"` - Conditions []v1.ComponentCondition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,2,rep,name=conditions"` -} - -type ClusterCondition struct { - // Type of cluster condition. - Type ClusterConditionType `json:"type"` - // Status of the condition, one of True, False, Unknown. - Status v1.ConditionStatus `json:"status"` - // The last time this condition was updated. - LastUpdateTime string `json:"lastUpdateTime,omitempty"` - // Last time the condition transitioned from one status to another. - LastTransitionTime string `json:"lastTransitionTime,omitempty"` - // The reason for the condition's last transition. - Reason string `json:"reason,omitempty"` - // Human-readable message indicating details about last transition - Message string `json:"message,omitempty"` -} - -type MapStringInterface map[string]interface{} - -func (m *MapStringInterface) DeepCopy() *MapStringInterface { - var buf bytes.Buffer - enc := gob.NewEncoder(&buf) - dec := gob.NewDecoder(&buf) - err := enc.Encode(m) - if err != nil { - logrus.Errorf("error while deep copying MapStringInterface %v", err) - return nil - } - - var copy MapStringInterface - err = dec.Decode(©) - if err != nil { - logrus.Errorf("error while deep copying MapStringInterface %v", err) - return nil - } - - return © -} - -type ClusterRegistrationToken struct { - types.Namespaced - - metav1.TypeMeta `json:",inline"` - // Standard object’s metadata. More info: - // https://github.com/kubernetes/community/blob/master/contributors/devel/api-conventions.md#metadata - metav1.ObjectMeta `json:"metadata,omitempty"` - // Specification of the desired behavior of the the cluster. More info: - // https://github.com/kubernetes/community/blob/master/contributors/devel/api-conventions.md#spec-and-status - Spec ClusterRegistrationTokenSpec `json:"spec"` - // Most recent observed status of the cluster. More info: - // https://github.com/kubernetes/community/blob/master/contributors/devel/api-conventions.md#spec-and-status - Status ClusterRegistrationTokenStatus `json:"status"` -} - -func (c *ClusterRegistrationToken) ObjClusterName() string { - return c.Spec.ObjClusterName() -} - -type ClusterRegistrationTokenSpec struct { - ClusterName string `json:"clusterName" norman:"required,type=reference[cluster]"` -} - -func (c *ClusterRegistrationTokenSpec) ObjClusterName() string { - return c.ClusterName -} - -type ClusterRegistrationTokenStatus struct { - InsecureCommand string `json:"insecureCommand"` - Command string `json:"command"` - WindowsNodeCommand string `json:"windowsNodeCommand"` - NodeCommand string `json:"nodeCommand"` - ManifestURL string `json:"manifestUrl"` - Token string `json:"token"` -} - -type GenerateKubeConfigOutput struct { - Config string `json:"config"` -} - -type ExportOutput struct { - YAMLOutput string `json:"yamlOutput"` -} - -type ImportClusterYamlInput struct { - YAML string `json:"yaml,omitempty"` - DefaultNamespace string `json:"defaultNamespace,omitempty"` - Namespace string `json:"namespace,omitempty"` - ProjectName string `json:"projectName,omitempty" norman:"type=reference[project]"` -} - -func (i *ImportClusterYamlInput) ObjClusterName() string { - if parts := strings.SplitN(i.ProjectName, ":", 2); len(parts) == 2 { - return parts[0] - } - return "" -} - -type ImportYamlOutput struct { - Message string `json:"message,omitempty"` -} - -type Capabilities struct { - LoadBalancerCapabilities LoadBalancerCapabilities `json:"loadBalancerCapabilities,omitempty"` - IngressCapabilities []IngressCapabilities `json:"ingressCapabilities,omitempty"` - NodePoolScalingSupported bool `json:"nodePoolScalingSupported,omitempty"` - NodePortRange string `json:"nodePortRange,omitempty"` - TaintSupport *bool `json:"taintSupport,omitempty"` - PspEnabled bool `json:"pspEnabled,omitempty"` -} - -type LoadBalancerCapabilities struct { - Enabled *bool `json:"enabled,omitempty"` - Provider string `json:"provider,omitempty"` - ProtocolsSupported []string `json:"protocolsSupported,omitempty"` - HealthCheckSupported bool `json:"healthCheckSupported,omitempty"` -} - -type IngressCapabilities struct { - IngressProvider string `json:"ingressProvider,omitempty"` - CustomDefaultBackend *bool `json:"customDefaultBackend,omitempty"` -} - -type MonitoringInput struct { - Version string `json:"version,omitempty"` - Answers map[string]string `json:"answers,omitempty"` -} - -type MonitoringOutput struct { - Version string `json:"version,omitempty"` - Answers map[string]string `json:"answers,omitempty"` -} - -type RestoreFromEtcdBackupInput struct { - EtcdBackupName string `json:"etcdBackupName,omitempty" norman:"type=reference[etcdBackup]"` - RestoreRkeConfig string `json:"restoreRkeConfig,omitempty"` -} - -type RotateCertificateInput struct { - CACertificates bool `json:"caCertificates,omitempty"` - Services []string `json:"services,omitempty" norman:"type=enum,options=etcd|kubelet|kube-apiserver|kube-proxy|kube-scheduler|kube-controller-manager"` -} - -type RotateCertificateOutput struct { - Message string `json:"message,omitempty"` -} - -type LocalClusterAuthEndpoint struct { - Enabled bool `json:"enabled"` - FQDN string `json:"fqdn,omitempty"` - CACerts string `json:"caCerts,omitempty"` -} - -type CertExpiration struct { - ExpirationDate string `json:"expirationDate,omitempty"` -} - -type SaveAsTemplateInput struct { - ClusterTemplateName string `json:"clusterTemplateName,omitempty"` - ClusterTemplateRevisionName string `json:"clusterTemplateRevisionName,omitempty"` -} - -type SaveAsTemplateOutput struct { - ClusterTemplateName string `json:"clusterTemplateName,omitempty"` - ClusterTemplateRevisionName string `json:"clusterTemplateRevisionName,omitempty"` -} diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/compose_types.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/compose_types.go deleted file mode 100644 index fd336116..00000000 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/compose_types.go +++ /dev/null @@ -1,45 +0,0 @@ -package v3 - -import ( - "github.com/rancher/norman/condition" - v1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -type ComposeConfig struct { - metav1.TypeMeta `json:",inline"` - // Standard object’s metadata. More info: - // https://github.com/kubernetes/community/blob/master/contributors/devel/api-conventions.md#metadata - metav1.ObjectMeta `json:"metadata,omitempty"` - // Specification of the desired behavior of the the cluster. More info: - // https://github.com/kubernetes/community/blob/master/contributors/devel/api-conventions.md#spec-and-status - Spec ComposeSpec `json:"spec,omitempty"` - Status ComposeStatus `json:"status,omitempty"` -} - -type ComposeSpec struct { - RancherCompose string `json:"rancherCompose,omitempty"` -} - -type ComposeStatus struct { - Conditions []ComposeCondition `json:"conditions,omitempty"` -} - -var ( - ComposeConditionExecuted condition.Cond = "Executed" -) - -type ComposeCondition struct { - // Type of cluster condition. - Type string `json:"type"` - // Status of the condition, one of True, False, Unknown. - Status v1.ConditionStatus `json:"status"` - // The last time this condition was updated. - LastUpdateTime string `json:"lastUpdateTime,omitempty"` - // Last time the condition transitioned from one status to another. - LastTransitionTime string `json:"lastTransitionTime,omitempty"` - // The reason for the condition's last transition. - Reason string `json:"reason,omitempty"` - // Human-readable message indicating details about last transition - Message string `json:"message,omitempty"` -} diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/eventratelimit.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/eventratelimit.go deleted file mode 100644 index fd0eb2cc..00000000 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/eventratelimit.go +++ /dev/null @@ -1,85 +0,0 @@ -/* -Copyright 2017 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 v3 - -import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - -// LimitType is the type of the limit (e.g., per-namespace) -type LimitType string - -const ( - // ServerLimitType is a type of limit where there is one bucket shared by - // all of the event queries received by the API Server. - ServerLimitType LimitType = "Server" - // NamespaceLimitType is a type of limit where there is one bucket used by - // each namespace - NamespaceLimitType LimitType = "Namespace" - // UserLimitType is a type of limit where there is one bucket used by each - // user - UserLimitType LimitType = "User" - // SourceAndObjectLimitType is a type of limit where there is one bucket used - // by each combination of source and involved object of the event. - SourceAndObjectLimitType LimitType = "SourceAndObject" -) - -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -// Configuration provides configuration for the EventRateLimit admission -// controller. -type Configuration struct { - metav1.TypeMeta `json:",inline"` - - // limits are the limits to place on event queries received. - // Limits can be placed on events received server-wide, per namespace, - // per user, and per source+object. - // At least one limit is required. - Limits []Limit `json:"limits"` -} - -// Limit is the configuration for a particular limit type -type Limit struct { - // type is the type of limit to which this configuration applies - Type LimitType `json:"type"` - - // qps is the number of event queries per second that are allowed for this - // type of limit. The qps and burst fields are used together to determine if - // a particular event query is accepted. The qps determines how many queries - // are accepted once the burst amount of queries has been exhausted. - QPS int32 `json:"qps"` - - // burst is the burst number of event queries that are allowed for this type - // of limit. The qps and burst fields are used together to determine if a - // particular event query is accepted. The burst determines the maximum size - // of the allowance granted for a particular bucket. For example, if the burst - // is 10 and the qps is 3, then the admission control will accept 10 queries - // before blocking any queries. Every second, 3 more queries will be allowed. - // If some of that allowance is not used, then it will roll over to the next - // second, until the maximum allowance of 10 is reached. - Burst int32 `json:"burst"` - - // cacheSize is the size of the LRU cache for this type of limit. If a bucket - // is evicted from the cache, then the allowance for that bucket is reset. If - // more queries are later received for an evicted bucket, then that bucket - // will re-enter the cache with a clean slate, giving that bucket a full - // allowance of burst queries. - // - // The default cache size is 4096. - // - // If limitType is 'server', then cacheSize is ignored. - // +optional - CacheSize int32 `json:"cacheSize,omitempty"` -} diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/global_types.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/global_types.go deleted file mode 100644 index 78370c34..00000000 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/global_types.go +++ /dev/null @@ -1,33 +0,0 @@ -package v3 - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -type Setting struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - Value string `json:"value" norman:"required"` - Default string `json:"default" norman:"nocreate,noupdate"` - Customized bool `json:"customized" norman:"nocreate,noupdate"` - Source string `json:"source" norman:"nocreate,noupdate,options=db|default|env"` -} - -type Feature struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - Spec FeatureSpec `json:"spec"` - Status FeatureStatus `json:"status"` -} - -type FeatureSpec struct { - Value *bool `json:"value" norman:"required"` -} - -type FeatureStatus struct { - Dynamic bool `json:"dynamic"` - Default bool `json:"default"` - Description string `json:"description"` -} diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/globaldns_types.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/globaldns_types.go deleted file mode 100644 index 6d2c6c5d..00000000 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/globaldns_types.go +++ /dev/null @@ -1,76 +0,0 @@ -package v3 - -import ( - "github.com/rancher/norman/types" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -type GlobalDns struct { - types.Namespaced - - metav1.TypeMeta `json:",inline"` - // Standard object’s metadata. More info: - // https://github.com/kubernetes/community/blob/master/contributors/devel/api-conventions.md#metadata - metav1.ObjectMeta `json:"metadata,omitempty"` - - Spec GlobalDNSSpec `json:"spec,omitempty"` - Status GlobalDNSStatus `json:"status,omitempty"` -} - -type GlobalDNSSpec struct { - FQDN string `json:"fqdn,omitempty" norman:"type=hostname,required"` - TTL int64 `json:"ttl,omitempty" norman:"default=300"` - ProjectNames []string `json:"projectNames" norman:"type=array[reference[project]],noupdate"` - MultiClusterAppName string `json:"multiClusterAppName,omitempty" norman:"type=reference[multiClusterApp]"` - ProviderName string `json:"providerName,omitempty" norman:"type=reference[globalDnsProvider],required"` - Members []Member `json:"members,omitempty"` -} - -type GlobalDNSStatus struct { - Endpoints []string `json:"endpoints,omitempty"` - ClusterEndpoints map[string][]string `json:"clusterEndpoints,omitempty"` -} - -type GlobalDNSProvider struct { - types.Namespaced - - metav1.TypeMeta `json:",inline"` - // Standard object’s metadata. More info: - // https://github.com/kubernetes/community/blob/master/contributors/devel/api-conventions.md#metadata - //ObjectMeta.Name = GlobalDNSProviderID - metav1.ObjectMeta `json:"metadata,omitempty"` - - Spec GlobalDNSProviderSpec `json:"spec,omitempty"` -} - -type GlobalDNSProviderSpec struct { - Route53ProviderConfig *Route53ProviderConfig `json:"route53ProviderConfig,omitempty"` - CloudflareProviderConfig *CloudflareProviderConfig `json:"cloudflareProviderConfig,omitempty"` - AlidnsProviderConfig *AlidnsProviderConfig `json:"alidnsProviderConfig,omitempty"` - Members []Member `json:"members,omitempty"` - RootDomain string `json:"rootDomain"` -} - -type Route53ProviderConfig struct { - AccessKey string `json:"accessKey" norman:"notnullable,required,minLength=1"` - SecretKey string `json:"secretKey" norman:"notnullable,required,minLength=1,type=password"` - CredentialsPath string `json:"credentialsPath" norman:"default=/.aws"` - RoleArn string `json:"roleArn,omitempty"` - Region string `json:"region" norman:"default=us-east-1"` - ZoneType string `json:"zoneType" norman:"default=public"` -} - -type CloudflareProviderConfig struct { - APIKey string `json:"apiKey" norman:"notnullable,required,minLength=1,type=password"` - APIEmail string `json:"apiEmail" norman:"notnullable,required,minLength=1"` - ProxySetting *bool `json:"proxySetting" norman:"default=true"` -} - -type UpdateGlobalDNSTargetsInput struct { - ProjectNames []string `json:"projectNames" norman:"type=array[reference[project]]"` -} - -type AlidnsProviderConfig struct { - AccessKey string `json:"accessKey" norman:"notnullable,required,minLength=1"` - SecretKey string `json:"secretKey" norman:"notnullable,required,minLength=1,type=password"` -} diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/k3s_types.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/k3s_types.go deleted file mode 100644 index a0ce858e..00000000 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/k3s_types.go +++ /dev/null @@ -1,20 +0,0 @@ -package v3 - -//K3sConfig provides desired configuration for k3s clusters -type K3sConfig struct { - // k3s Kubernetes version, unset the value indicates an unmanaged cluster - Version string `yaml:"kubernetes_version" json:"kubernetesVersion,omitempty"` - K3sUpgradeStrategy `yaml:"k3s_upgrade_strategy,omitempty" json:"k3supgradeStrategy,omitempty"` -} - -//K3sUpgradeStrategy provides configuration to the downstream system-upgrade-controller -type K3sUpgradeStrategy struct { - // How many controlplane nodes should be upgrade at time, defaults to 1 - ServerConcurrency int `yaml:"server_concurrency" json:"serverConcurrency,omitempty" norman:"min=1"` - // How many workers should be upgraded at a time - WorkerConcurrency int `yaml:"worker_concurrency" json:"workerConcurrency,omitempty" norman:"min=1"` - // Whether controlplane nodes should be drained - DrainServerNodes bool `yaml:"drain_server_nodes" json:"drainServerNodes,omitempty"` - // Whether worker nodes should be drained - DrainWorkerNodes bool `yaml:"drain_worker_nodes" json:"drainWorkerNodes,omitempty"` -} diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/kontainer_types.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/kontainer_types.go deleted file mode 100644 index 5d1587a9..00000000 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/kontainer_types.go +++ /dev/null @@ -1,42 +0,0 @@ -package v3 - -import ( - "github.com/rancher/norman/condition" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -type KontainerDriver struct { - metav1.TypeMeta `json:",inline"` - // Standard object’s metadata. More info: - // https://github.com/kubernetes/community/blob/master/contributors/devel/api-conventions.md#metadata - metav1.ObjectMeta `json:"metadata,omitempty"` - // Specification of the desired behavior of the the cluster. More info: - // https://github.com/kubernetes/community/blob/master/contributors/devel/api-conventions.md#spec-and-status - Spec KontainerDriverSpec `json:"spec"` - // Most recent observed status of the cluster. More info: - // https://github.com/kubernetes/community/blob/master/contributors/devel/api-conventions.md#spec-and-status - Status KontainerDriverStatus `json:"status"` -} - -type KontainerDriverStatus struct { - ActualURL string `json:"actualUrl"` - ExecutablePath string `json:"executablePath"` - Conditions []Condition `json:"conditions"` - DisplayName string `json:"displayName"` -} - -type KontainerDriverSpec struct { - URL string `json:"url" norman:"required"` - Checksum string `json:"checksum"` - BuiltIn bool `json:"builtIn" norman:"noupdate"` - Active bool `json:"active"` - UIURL string `json:"uiUrl"` - WhitelistDomains []string `json:"whitelistDomains,omitempty"` -} - -var ( - KontainerDriverConditionDownloaded condition.Cond = "Downloaded" - KontainerDriverConditionInstalled condition.Cond = "Installed" - KontainerDriverConditionActive condition.Cond = "Active" - KontainerDriverConditionInactive condition.Cond = "Inactive" -) diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/logging_types.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/logging_types.go deleted file mode 100644 index e17827e2..00000000 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/logging_types.go +++ /dev/null @@ -1,222 +0,0 @@ -package v3 - -import ( - "strings" - - "github.com/rancher/norman/condition" - "github.com/rancher/norman/types" - v1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -type ClusterLogging struct { - types.Namespaced - - metav1.TypeMeta `json:",inline"` - // Standard object’s metadata. More info: - // https://github.com/kubernetes/community/blob/master/contributors/devel/api-conventions.md#metadata - metav1.ObjectMeta `json:"metadata,omitempty"` - // Specification of the desired behavior of the the cluster. More info: - // https://github.com/kubernetes/community/blob/master/contributors/devel/api-conventions.md#spec-and-status - Spec ClusterLoggingSpec `json:"spec"` - // Most recent observed status of the cluster. More info: - // https://github.com/kubernetes/community/blob/master/contributors/devel/api-conventions.md#spec-and-status - Status ClusterLoggingStatus `json:"status"` -} - -func (c *ClusterLogging) ObjClusterName() string { - return c.Spec.ObjClusterName() -} - -type ProjectLogging struct { - types.Namespaced - - metav1.TypeMeta `json:",inline"` - // Standard object’s metadata. More info: - // https://github.com/kubernetes/community/blob/master/contributors/devel/api-conventions.md#metadata - metav1.ObjectMeta `json:"metadata,omitempty"` - // Specification of the desired behavior of the the cluster. More info: - // https://github.com/kubernetes/community/blob/master/contributors/devel/api-conventions.md#spec-and-status - Spec ProjectLoggingSpec `json:"spec"` - // Most recent observed status of the cluster. More info: - // https://github.com/kubernetes/community/blob/master/contributors/devel/api-conventions.md#spec-and-status - Status ProjectLoggingStatus `json:"status"` -} - -func (p *ProjectLogging) ObjClusterName() string { - return p.Spec.ObjClusterName() -} - -type LoggingCommonField struct { - DisplayName string `json:"displayName,omitempty"` - OutputFlushInterval int `json:"outputFlushInterval,omitempty" norman:"default=60"` - OutputTags map[string]string `json:"outputTags,omitempty"` - EnableJSONParsing bool `json:"enableJSONParsing,omitempty"` -} - -type LoggingTargets struct { - ElasticsearchConfig *ElasticsearchConfig `json:"elasticsearchConfig,omitempty"` - SplunkConfig *SplunkConfig `json:"splunkConfig,omitempty"` - KafkaConfig *KafkaConfig `json:"kafkaConfig,omitempty"` - SyslogConfig *SyslogConfig `json:"syslogConfig,omitempty"` - FluentForwarderConfig *FluentForwarderConfig `json:"fluentForwarderConfig,omitempty"` - CustomTargetConfig *CustomTargetConfig `json:"customTargetConfig,omitempty"` -} - -type ClusterLoggingSpec struct { - LoggingTargets - LoggingCommonField - ClusterName string `json:"clusterName" norman:"type=reference[cluster]"` - IncludeSystemComponent *bool `json:"includeSystemComponent,omitempty" norman:"default=true"` -} - -func (c *ClusterLoggingSpec) ObjClusterName() string { - return c.ClusterName -} - -type ProjectLoggingSpec struct { - LoggingTargets - LoggingCommonField - ProjectName string `json:"projectName" norman:"type=reference[project]"` -} - -func (p *ProjectLoggingSpec) ObjClusterName() string { - if parts := strings.SplitN(p.ProjectName, ":", 2); len(parts) == 2 { - return parts[0] - } - return "" -} - -type ClusterLoggingStatus struct { - Conditions []LoggingCondition `json:"conditions,omitempty"` - AppliedSpec ClusterLoggingSpec `json:"appliedSpec,omitempty"` - FailedSpec *ClusterLoggingSpec `json:"failedSpec,omitempty"` -} - -type ProjectLoggingStatus struct { - Conditions []LoggingCondition `json:"conditions,omitempty"` - AppliedSpec ProjectLoggingSpec `json:"appliedSpec,omitempty"` -} - -var ( - LoggingConditionProvisioned condition.Cond = "Provisioned" - LoggingConditionUpdated condition.Cond = "Updated" -) - -type LoggingCondition struct { - // Type of cluster condition. - Type condition.Cond `json:"type"` - // Status of the condition, one of True, False, Unknown. - Status v1.ConditionStatus `json:"status"` - // The last time this condition was updated. - LastUpdateTime string `json:"lastUpdateTime,omitempty"` - // Last time the condition transitioned from one status to another. - LastTransitionTime string `json:"lastTransitionTime,omitempty"` - // The reason for the condition's last transition. - Reason string `json:"reason,omitempty"` - // Human-readable message indicating details about last transition - Message string `json:"message,omitempty"` -} - -type ElasticsearchConfig struct { - Endpoint string `json:"endpoint,omitempty" norman:"required"` - IndexPrefix string `json:"indexPrefix,omitempty" norman:"required"` - DateFormat string `json:"dateFormat,omitempty" norman:"required,type=enum,options=YYYY-MM-DD|YYYY-MM|YYYY,default=YYYY-MM-DD"` - AuthUserName string `json:"authUsername,omitempty"` - AuthPassword string `json:"authPassword,omitempty" norman:"type=password"` - Certificate string `json:"certificate,omitempty"` - ClientCert string `json:"clientCert,omitempty"` - ClientKey string `json:"clientKey,omitempty"` - ClientKeyPass string `json:"clientKeyPass,omitempty"` - SSLVerify bool `json:"sslVerify,omitempty"` - SSLVersion string `json:"sslVersion,omitempty" norman:"type=enum,options=SSLv23|TLSv1|TLSv1_1|TLSv1_2,default=TLSv1_2"` -} - -type SplunkConfig struct { - Endpoint string `json:"endpoint,omitempty" norman:"required"` - Source string `json:"source,omitempty"` - Token string `json:"token,omitempty" norman:"required,type=password"` - Certificate string `json:"certificate,omitempty"` - ClientCert string `json:"clientCert,omitempty"` - ClientKey string `json:"clientKey,omitempty"` - ClientKeyPass string `json:"clientKeyPass,omitempty"` - SSLVerify bool `json:"sslVerify,omitempty"` - Index string `json:"index,omitempty"` -} - -type KafkaConfig struct { - ZookeeperEndpoint string `json:"zookeeperEndpoint,omitempty"` - BrokerEndpoints []string `json:"brokerEndpoints,omitempty"` - Topic string `json:"topic,omitempty" norman:"required"` - Certificate string `json:"certificate,omitempty"` - ClientCert string `json:"clientCert,omitempty"` - ClientKey string `json:"clientKey,omitempty"` - SaslUsername string `json:"saslUsername,omitempty"` - SaslPassword string `json:"saslPassword,omitempty" norman:"type=password"` - SaslScramMechanism string `json:"saslScramMechanism,omitempty" norman:"type=enum,options=sha256|sha512"` - SaslType string `json:"saslType,omitempty" norman:"type=enum,options=plain|scram"` -} - -type SyslogConfig struct { - Endpoint string `json:"endpoint,omitempty" norman:"required"` - Severity string `json:"severity,omitempty" norman:"default=notice,type=enum,options=emerg|alert|crit|err|warning|notice|info|debug"` - Program string `json:"program,omitempty"` - Protocol string `json:"protocol,omitempty" norman:"default=udp,type=enum,options=udp|tcp"` - Token string `json:"token,omitempty" norman:"type=password"` - EnableTLS bool `json:"enableTls,omitempty" norman:"default=false"` - Certificate string `json:"certificate,omitempty"` - ClientCert string `json:"clientCert,omitempty"` - ClientKey string `json:"clientKey,omitempty"` - SSLVerify bool `json:"sslVerify,omitempty"` -} - -type FluentForwarderConfig struct { - EnableTLS bool `json:"enableTls,omitempty" norman:"default=false"` - Certificate string `json:"certificate,omitempty"` - ClientCert string `json:"clientCert,omitempty"` - ClientKey string `json:"clientKey,omitempty"` - ClientKeyPass string `json:"clientKeyPass,omitempty"` - SSLVerify bool `json:"sslVerify,omitempty"` - Compress *bool `json:"compress,omitempty" norman:"default=true"` - FluentServers []FluentServer `json:"fluentServers,omitempty" norman:"required"` -} - -type FluentServer struct { - Endpoint string `json:"endpoint,omitempty" norman:"required"` - Hostname string `json:"hostname,omitempty"` - Weight int `json:"weight,omitempty" norman:"default=100"` - Standby bool `json:"standby,omitempty" norman:"default=false"` - Username string `json:"username,omitempty"` - Password string `json:"password,omitempty" norman:"type=password"` - SharedKey string `json:"sharedKey,omitempty" norman:"type=password"` -} - -type CustomTargetConfig struct { - Content string `json:"content,omitempty"` - Certificate string `json:"certificate,omitempty"` - ClientCert string `json:"clientCert,omitempty"` - ClientKey string `json:"clientKey,omitempty"` -} - -type ClusterTestInput struct { - ClusterName string `json:"clusterId" norman:"required,type=reference[cluster]"` - LoggingTargets - OutputTags map[string]string `json:"outputTags,omitempty"` -} - -func (c *ClusterTestInput) ObjClusterName() string { - return c.ClusterName -} - -type ProjectTestInput struct { - ProjectName string `json:"projectId" norman:"required,type=reference[project]"` - LoggingTargets - OutputTags map[string]string `json:"outputTags,omitempty"` -} - -func (p *ProjectTestInput) ObjClusterName() string { - if parts := strings.SplitN(p.ProjectName, ":", 2); len(parts) == 2 { - return parts[0] - } - return "" -} diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/machine_types.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/machine_types.go deleted file mode 100644 index dd0fe423..00000000 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/machine_types.go +++ /dev/null @@ -1,355 +0,0 @@ -package v3 - -import ( - "time" - - "github.com/rancher/norman/condition" - "github.com/rancher/norman/types" - v1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -type NodeTemplate struct { - types.Namespaced - - metav1.TypeMeta `json:",inline"` - // Standard object’s metadata. More info: - // https://github.com/kubernetes/community/blob/master/contributors/devel/api-conventions.md#metadata - metav1.ObjectMeta `json:"metadata,omitempty"` - // Specification of the desired behavior of the the cluster. More info: - // https://github.com/kubernetes/community/blob/master/contributors/devel/api-conventions.md#spec-and-status - Spec NodeTemplateSpec `json:"spec"` - // Most recent observed status of the cluster. More info: - // https://github.com/kubernetes/community/blob/master/contributors/devel/api-conventions.md#spec-and-status - Status NodeTemplateStatus `json:"status"` -} - -type NodeTemplateStatus struct { - Conditions []NodeTemplateCondition `json:"conditions"` -} - -type NodeTemplateCondition struct { - // Type of cluster condition. - Type string `json:"type"` - // Status of the condition, one of True, False, Unknown. - Status v1.ConditionStatus `json:"status"` - // The last time this condition was updated. - LastUpdateTime string `json:"lastUpdateTime,omitempty"` - // Last time the condition transitioned from one status to another. - LastTransitionTime string `json:"lastTransitionTime,omitempty"` - // The reason for the condition's last transition. - Reason string `json:"reason,omitempty"` -} - -type NodeTemplateSpec struct { - DisplayName string `json:"displayName"` - Description string `json:"description"` - Driver string `json:"driver" norman:"nocreate,noupdate"` - CloudCredentialName string `json:"cloudCredentialName" norman:"type=reference[cloudCredential]"` - NodeTaints []v1.Taint `json:"nodeTaints,omitempty"` - NodeCommonParams `json:",inline"` -} - -type Node struct { - types.Namespaced - - metav1.TypeMeta `json:",inline"` - // Standard object’s metadata. More info: - // https://github.com/kubernetes/community/blob/master/contributors/devel/api-conventions.md#metadata - metav1.ObjectMeta `json:"metadata,omitempty"` - // Specification of the desired behavior of the the cluster. More info: - // https://github.com/kubernetes/community/blob/master/contributors/devel/api-conventions.md#spec-and-status - Spec NodeSpec `json:"spec"` - // Most recent observed status of the cluster. More info: - // https://github.com/kubernetes/community/blob/master/contributors/devel/api-conventions.md#spec-and-status - Status NodeStatus `json:"status"` -} - -func (in *Node) ObjClusterName() string { - return in.Namespace -} - -type MetadataUpdate struct { - Labels MapDelta `json:"labels,omitempty"` - Annotations MapDelta `json:"annotations,omitempty"` -} - -type MapDelta struct { - Add map[string]string `json:"add,omitempty"` - Delete map[string]bool `json:"delete,omitempty"` -} - -type NodeStatus struct { - Conditions []NodeCondition `json:"conditions,omitempty"` - InternalNodeStatus v1.NodeStatus `json:"internalNodeStatus,omitempty"` - NodeName string `json:"nodeName,omitempty"` - Requested v1.ResourceList `json:"requested,omitempty"` - Limits v1.ResourceList `json:"limits,omitempty"` - NodeTemplateSpec *NodeTemplateSpec `json:"nodeTemplateSpec,omitempty"` - NodeConfig *RKEConfigNode `json:"rkeNode,omitempty"` - NodeAnnotations map[string]string `json:"nodeAnnotations,omitempty"` - NodeLabels map[string]string `json:"nodeLabels,omitempty"` - NodeTaints []v1.Taint `json:"nodeTaints,omitempty"` - DockerInfo *DockerInfo `json:"dockerInfo,omitempty"` - NodePlan *NodePlan `json:"nodePlan,omitempty"` - AppliedNodeVersion int `json:"appliedNodeVersion,omitempty"` -} - -type DockerInfo struct { - ID string - Driver string - Debug bool - LoggingDriver string - CgroupDriver string - KernelVersion string - OperatingSystem string - OSType string - Architecture string - IndexServerAddress string - InitBinary string - DockerRootDir string - SecurityOptions []string - HTTPProxy string - HTTPSProxy string - NoProxy string - Name string - Labels []string - ExperimentalBuild bool - ServerVersion string -} - -var ( - NodeConditionInitialized condition.Cond = "Initialized" - NodeConditionProvisioned condition.Cond = "Provisioned" - NodeConditionUpdated condition.Cond = "Updated" - NodeConditionRegistered condition.Cond = "Registered" - NodeConditionRemoved condition.Cond = "Removed" - NodeConditionConfigSaved condition.Cond = "Saved" - NodeConditionReady condition.Cond = "Ready" - NodeConditionDrained condition.Cond = "Drained" - NodeConditionUpgraded condition.Cond = "Upgraded" -) - -type NodeCondition struct { - // Type of cluster condition. - Type condition.Cond `json:"type"` - // Status of the condition, one of True, False, Unknown. - Status v1.ConditionStatus `json:"status"` - // The last time this condition was updated. - LastUpdateTime string `json:"lastUpdateTime,omitempty"` - // Last time the condition transitioned from one status to another. - LastTransitionTime string `json:"lastTransitionTime,omitempty"` - // The reason for the condition's last transition. - Reason string `json:"reason,omitempty"` - // Human-readable message indicating details about last transition - Message string `json:"message,omitempty"` -} - -var ( - NodePoolConditionUpdated condition.Cond = "Updated" -) - -type NodePool struct { - types.Namespaced - - metav1.TypeMeta `json:",inline"` - // Standard object’s metadata. More info: - // https://github.com/kubernetes/community/blob/master/contributors/devel/api-conventions.md#metadata - metav1.ObjectMeta `json:"metadata,omitempty"` - - Spec NodePoolSpec `json:"spec"` - Status NodePoolStatus `json:"status"` -} - -func (n *NodePool) ObjClusterName() string { - return n.Spec.ObjClusterName() -} - -type NodePoolSpec struct { - Etcd bool `json:"etcd"` - ControlPlane bool `json:"controlPlane"` - Worker bool `json:"worker"` - NodeTemplateName string `json:"nodeTemplateName,omitempty" norman:"type=reference[nodeTemplate],required,notnullable"` - - HostnamePrefix string `json:"hostnamePrefix" norman:"required,notnullable"` - Quantity int `json:"quantity" norman:"required,default=1"` - NodeLabels map[string]string `json:"nodeLabels"` - NodeAnnotations map[string]string `json:"nodeAnnotations"` - NodeTaints []v1.Taint `json:"nodeTaints,omitempty"` - - DisplayName string `json:"displayName"` - ClusterName string `json:"clusterName,omitempty" norman:"type=reference[cluster],noupdate,required"` - - DeleteNotReadyAfterSecs time.Duration `json:"deleteNotReadyAfterSecs" norman:"default=0,max=31540000,min=0"` -} - -func (n *NodePoolSpec) ObjClusterName() string { - return n.ClusterName -} - -type NodePoolStatus struct { - Conditions []Condition `json:"conditions"` -} - -type CustomConfig struct { - // IP or FQDN that is fully resolvable and used for SSH communication - Address string `yaml:"address" json:"address,omitempty"` - // Optional - Internal address that will be used for components communication - InternalAddress string `yaml:"internal_address" json:"internalAddress,omitempty"` - // SSH user that will be used by RKE - User string `yaml:"user" json:"user,omitempty"` - // Optional - Docker socket on the node that will be used in tunneling - DockerSocket string `yaml:"docker_socket" json:"dockerSocket,omitempty"` - // SSH Private Key - SSHKey string `yaml:"ssh_key" json:"sshKey,omitempty" norman:"type=password"` - // SSH Certificate - SSHCert string `yaml:"ssh_cert" json:"sshCert,omitempty"` - Label map[string]string `yaml:"label" json:"label,omitempty"` - Taints []string `yaml:"taints" json:"taints,omitempty"` -} - -type NodeSpec struct { - // Common fields. They aren't in a shared struct because the annotations are different - - Etcd bool `json:"etcd" norman:"noupdate"` - ControlPlane bool `json:"controlPlane" norman:"noupdate"` - Worker bool `json:"worker" norman:"noupdate"` - NodeTemplateName string `json:"nodeTemplateName,omitempty" norman:"type=reference[nodeTemplate],noupdate"` - - NodePoolName string `json:"nodePoolName" norman:"type=reference[nodePool],nocreate,noupdate"` - CustomConfig *CustomConfig `json:"customConfig"` - Imported bool `json:"imported"` - Description string `json:"description,omitempty"` - DisplayName string `json:"displayName"` - RequestedHostname string `json:"requestedHostname,omitempty" norman:"type=hostname,nullable,noupdate,required"` - InternalNodeSpec v1.NodeSpec `json:"internalNodeSpec"` - DesiredNodeTaints []v1.Taint `json:"desiredNodeTaints"` - UpdateTaintsFromAPI *bool `json:"updateTaintsFromAPI,omitempty"` - DesiredNodeUnschedulable string `json:"desiredNodeUnschedulable,omitempty"` - NodeDrainInput *NodeDrainInput `json:"nodeDrainInput,omitempty"` - MetadataUpdate MetadataUpdate `json:"metadataUpdate,omitempty"` -} - -type NodePlan struct { - Plan *RKEConfigNodePlan `json:"plan,omitempty"` - Version int `json:"version,omitempty"` - // current default in rancher-agent is 2m (120s) - AgentCheckInterval int `json:"agentCheckInterval,omitempty" norman:"min=1,max=1800,default=120"` -} - -type NodeCommonParams struct { - AuthCertificateAuthority string `json:"authCertificateAuthority,omitempty"` - AuthKey string `json:"authKey,omitempty"` - EngineInstallURL string `json:"engineInstallURL,omitempty"` - DockerVersion string `json:"dockerVersion,omitempty"` - EngineOpt map[string]string `json:"engineOpt,omitempty"` - EngineInsecureRegistry []string `json:"engineInsecureRegistry,omitempty"` - EngineRegistryMirror []string `json:"engineRegistryMirror,omitempty"` - EngineLabel map[string]string `json:"engineLabel,omitempty"` - EngineStorageDriver string `json:"engineStorageDriver,omitempty"` - EngineEnv map[string]string `json:"engineEnv,omitempty"` - UseInternalIPAddress *bool `json:"useInternalIpAddress,omitempty" norman:"default=true,noupdate"` -} - -type NodeDriver struct { - metav1.TypeMeta `json:",inline"` - // Standard object’s metadata. More info: - // https://github.com/kubernetes/community/blob/master/contributors/devel/api-conventions.md#metadata - metav1.ObjectMeta `json:"metadata,omitempty"` - // Specification of the desired behavior of the the cluster. More info: - // https://github.com/kubernetes/community/blob/master/contributors/devel/api-conventions.md#spec-and-status - Spec NodeDriverSpec `json:"spec"` - // Most recent observed status of the cluster. More info: - // https://github.com/kubernetes/community/blob/master/contributors/devel/api-conventions.md#spec-and-status - Status NodeDriverStatus `json:"status"` -} - -type NodeDriverStatus struct { - Conditions []Condition `json:"conditions"` - AppliedURL string `json:"appliedURL"` - AppliedChecksum string `json:"appliedChecksum"` - AppliedDockerMachineVersion string `json:"appliedDockerMachineVersion"` -} - -var ( - NodeDriverConditionDownloaded condition.Cond = "Downloaded" - NodeDriverConditionInstalled condition.Cond = "Installed" - NodeDriverConditionActive condition.Cond = "Active" - NodeDriverConditionInactive condition.Cond = "Inactive" -) - -type Condition struct { - // Type of cluster condition. - Type string `json:"type"` - // Status of the condition, one of True, False, Unknown. - Status v1.ConditionStatus `json:"status"` - // The last time this condition was updated. - LastUpdateTime string `json:"lastUpdateTime,omitempty"` - // Last time the condition transitioned from one status to another. - LastTransitionTime string `json:"lastTransitionTime,omitempty"` - // The reason for the condition's last transition. - Reason string `json:"reason,omitempty"` - // Human-readable message indicating details about last transition - Message string `json:"message,omitempty"` -} - -type NodeDriverSpec struct { - DisplayName string `json:"displayName"` - Description string `json:"description"` - URL string `json:"url" norman:"required"` - ExternalID string `json:"externalId"` - Builtin bool `json:"builtin"` - Active bool `json:"active"` - Checksum string `json:"checksum"` - UIURL string `json:"uiUrl"` - WhitelistDomains []string `json:"whitelistDomains,omitempty"` -} - -type PublicEndpoint struct { - NodeName string `json:"nodeName,omitempty" norman:"type=reference[/v3/schemas/node],nocreate,noupdate"` - Addresses []string `json:"addresses,omitempty" norman:"nocreate,noupdate"` - Port int32 `json:"port,omitempty" norman:"nocreate,noupdate"` - Protocol string `json:"protocol,omitempty" norman:"nocreate,noupdate"` - // for node port service endpoint - ServiceName string `json:"serviceName,omitempty" norman:"type=reference[service],nocreate,noupdate"` - // for host port endpoint - PodName string `json:"podName,omitempty" norman:"type=reference[pod],nocreate,noupdate"` - // for ingress endpoint. ServiceName, podName, ingressName are mutually exclusive - IngressName string `json:"ingressName,omitempty" norman:"type=reference[ingress],nocreate,noupdate"` - // Hostname/path are set for Ingress endpoints - Hostname string `json:"hostname,omitempty" norman:"nocreate,noupdate"` - Path string `json:"path,omitempty" norman:"nocreate,noupdate"` - // True when endpoint is exposed on every node - AllNodes bool `json:"allNodes" norman:"nocreate,noupdate"` -} - -type NodeDrainInput struct { - // Drain node even if there are pods not managed by a ReplicationController, Job, or DaemonSet - // Drain will not proceed without Force set to true if there are such pods - Force bool `yaml:"force" json:"force,omitempty"` - // If there are DaemonSet-managed pods, drain will not proceed without IgnoreDaemonSets set to true - // (even when set to true, kubectl won't delete pods - so setting default to true) - IgnoreDaemonSets *bool `yaml:"ignore_daemonsets" json:"ignoreDaemonSets,omitempty" norman:"default=true"` - // Continue even if there are pods using emptyDir - DeleteLocalData bool `yaml:"delete_local_data" json:"deleteLocalData,omitempty"` - //Period of time in seconds given to each pod to terminate gracefully. - // If negative, the default value specified in the pod will be used - GracePeriod int `yaml:"grace_period" json:"gracePeriod,omitempty" norman:"default=-1"` - // Time to wait (in seconds) before giving up for one try - Timeout int `yaml:"timeout" json:"timeout" norman:"min=1,max=10800,default=120"` -} - -type CloudCredential struct { - types.Namespaced - - metav1.TypeMeta `json:",inline"` - - metav1.ObjectMeta `json:"metadata,omitempty"` - - Spec CloudCredentialSpec `json:"spec"` -} - -type CloudCredentialSpec struct { - DisplayName string `json:"displayName"` - Description string `json:"description,omitempty"` -} diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/monitoring_types.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/monitoring_types.go deleted file mode 100644 index 858c4874..00000000 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/monitoring_types.go +++ /dev/null @@ -1,215 +0,0 @@ -package v3 - -import ( - "strings" - - "github.com/rancher/norman/condition" - "github.com/rancher/norman/types" - v1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -type MonitoringStatus struct { - GrafanaEndpoint string `json:"grafanaEndpoint,omitempty"` - Conditions []MonitoringCondition `json:"conditions,omitempty"` -} - -type MonitoringCondition struct { - // Type of cluster condition. - Type ClusterConditionType `json:"type"` - // Status of the condition, one of True, False, Unknown. - Status v1.ConditionStatus `json:"status"` - // The last time this condition was updated. - LastUpdateTime string `json:"lastUpdateTime,omitempty"` - // Last time the condition transitioned from one status to another. - LastTransitionTime string `json:"lastTransitionTime,omitempty"` - // The reason for the condition's last transition. - Reason string `json:"reason,omitempty"` - // Human-readable message indicating details about last transition - Message string `json:"message,omitempty"` -} - -const ( - MonitoringConditionGrafanaDeployed condition.Cond = "GrafanaDeployed" - MonitoringConditionPrometheusDeployed condition.Cond = "PrometheusDeployed" - MonitoringConditionAlertmaanagerDeployed condition.Cond = "AlertmanagerDeployed" - MonitoringConditionNodeExporterDeployed condition.Cond = "NodeExporterDeployed" - MonitoringConditionKubeStateExporterDeployed condition.Cond = "KubeStateExporterDeployed" - MonitoringConditionMetricExpressionDeployed condition.Cond = "MetricExpressionDeployed" -) - -type ClusterMonitorGraph struct { - types.Namespaced - - metav1.TypeMeta `json:",inline"` - // Standard object’s metadata. More info: - // https://github.com/kubernetes/community/blob/master/contributors/devel/api-conventions.md#metadata - metav1.ObjectMeta `json:"metadata,omitempty"` - - Spec ClusterMonitorGraphSpec `json:"spec"` -} - -func (c *ClusterMonitorGraph) ObjClusterName() string { - return c.Spec.ObjClusterName() -} - -type ProjectMonitorGraph struct { - types.Namespaced - - metav1.TypeMeta `json:",inline"` - // Standard object’s metadata. More info: - // https://github.com/kubernetes/community/blob/master/contributors/devel/api-conventions.md#metadata - metav1.ObjectMeta `json:"metadata,omitempty"` - - Spec ProjectMonitorGraphSpec `json:"spec"` -} - -func (p *ProjectMonitorGraph) ObjClusterName() string { - return p.Spec.ObjClusterName() -} - -type ClusterMonitorGraphSpec struct { - ClusterName string `json:"clusterName" norman:"type=reference[cluster]"` - ResourceType string `json:"resourceType,omitempty" norman:"type=enum,options=node|cluster|etcd|apiserver|scheduler|controllermanager|fluentd|istiocluster|istioproject"` - DisplayResourceType string `json:"displayResourceType,omitempty" norman:"type=enum,options=node|cluster|etcd|kube-component|rancher-component"` - CommonMonitorGraphSpec -} - -func (c *ClusterMonitorGraphSpec) ObjClusterName() string { - return c.ClusterName -} - -type ProjectMonitorGraphSpec struct { - ProjectName string `json:"projectName" norman:"type=reference[project]"` - ResourceType string `json:"resourceType,omitempty" norman:"type=enum,options=workload|pod|container"` - DisplayResourceType string `json:"displayResourceType,omitempty" norman:"type=enum,options=workload|pod|container"` - CommonMonitorGraphSpec -} - -func (p *ProjectMonitorGraphSpec) ObjClusterName() string { - if parts := strings.SplitN(p.ProjectName, ":", 2); len(parts) == 2 { - return parts[0] - } - return "" -} - -type CommonMonitorGraphSpec struct { - Description string `json:"description,omitempty"` - MetricsSelector map[string]string `json:"metricsSelector,omitempty"` - DetailsMetricsSelector map[string]string `json:"detailsMetricsSelector,omitempty"` - YAxis YAxis `json:"yAxis,omitempty"` - Priority int `json:"priority,omitempty"` - GraphType string `json:"graphType,omitempty" norman:"type=enum,options=graph|singlestat"` -} - -type YAxis struct { - Unit string `json:"unit,omitempty"` -} - -type MonitorMetric struct { - types.Namespaced - - metav1.TypeMeta `json:",inline"` - // Standard object’s metadata. More info: - // https://github.com/kubernetes/community/blob/master/contributors/devel/api-conventions.md#metadata - metav1.ObjectMeta `json:"metadata,omitempty"` - - Spec MonitorMetricSpec `json:"spec"` -} - -type MonitorMetricSpec struct { - Expression string `json:"expression,omitempty" norman:"required"` - LegendFormat string `json:"legendFormat,omitempty"` - Description string `json:"description,omitempty"` -} - -type QueryGraphInput struct { - From string `json:"from,omitempty"` - To string `json:"to,omitempty"` - Interval string `json:"interval,omitempty"` - MetricParams map[string]string `json:"metricParams,omitempty"` - Filters map[string]string `json:"filters,omitempty"` - IsDetails bool `json:"isDetails,omitempty"` -} - -type QueryClusterGraphOutput struct { - Type string `json:"type,omitempty"` - Data []QueryClusterGraph `json:"data,omitempty"` -} - -type QueryClusterGraph struct { - GraphName string `json:"graphID" norman:"type=reference[clusterMonitorGraph]"` - Series []*TimeSeries `json:"series" norman:"type=array[reference[timeSeries]]"` -} - -type QueryProjectGraphOutput struct { - Type string `json:"type,omitempty"` - Data []QueryProjectGraph `json:"data,omitempty"` -} - -type QueryProjectGraph struct { - GraphName string `json:"graphID" norman:"type=reference[projectMonitorGraph]"` - Series []*TimeSeries `json:"series" norman:"type=array[reference[timeSeries]]"` -} - -type QueryClusterMetricInput struct { - ClusterName string `json:"clusterId" norman:"type=reference[cluster]"` - CommonQueryMetricInput -} - -func (q *QueryClusterMetricInput) ObjClusterName() string { - return q.ClusterName -} - -type QueryProjectMetricInput struct { - ProjectName string `json:"projectId" norman:"type=reference[project]"` - CommonQueryMetricInput -} - -func (q *QueryProjectMetricInput) ObjClusterName() string { - if parts := strings.SplitN(q.ProjectName, ":", 2); len(parts) == 2 { - return parts[0] - } - return "" -} - -type CommonQueryMetricInput struct { - From string `json:"from,omitempty"` - To string `json:"to,omitempty"` - Interval string `json:"interval,omitempty"` - Expr string `json:"expr,omitempty" norman:"required"` -} - -type QueryMetricOutput struct { - Type string `json:"type,omitempty"` - Series []*TimeSeries `json:"series" norman:"type=array[reference[timeSeries]]"` -} - -type TimeSeries struct { - Name string `json:"name"` - Points [][]float64 `json:"points" norman:"type=array[array[float]]"` -} - -type MetricNamesOutput struct { - Type string `json:"type,omitempty"` - Names []string `json:"names" norman:"type=array[string]"` -} - -type ClusterMetricNamesInput struct { - ClusterName string `json:"clusterId" norman:"type=reference[cluster]"` -} - -func (c *ClusterMetricNamesInput) ObjClusterName() string { - return c.ClusterName -} - -type ProjectMetricNamesInput struct { - ProjectName string `json:"projectId" norman:"type=reference[project]"` -} - -func (p *ProjectMetricNamesInput) ObjClusterName() string { - if parts := strings.SplitN(p.ProjectName, ":", 2); len(parts) == 2 { - return parts[0] - } - return "" -} diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/multi_cluster_app.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/multi_cluster_app.go deleted file mode 100644 index 6e9dffe7..00000000 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/multi_cluster_app.go +++ /dev/null @@ -1,105 +0,0 @@ -package v3 - -import ( - "strings" - - "github.com/rancher/norman/condition" - "github.com/rancher/norman/types" - v3 "github.com/rancher/types/apis/project.cattle.io/v3" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -var ( - MultiClusterAppConditionInstalled condition.Cond = "Installed" - MultiClusterAppConditionDeployed condition.Cond = "Deployed" -) - -type MultiClusterApp struct { - types.Namespaced - metav1.TypeMeta `json:",inline"` - // Standard object’s metadata. More info: - // https://github.com/kubernetes/community/blob/master/contributors/devel/api-conventions.md#metadata - metav1.ObjectMeta `json:"metadata,omitempty"` - // Specification of the desired behavior of the the cluster. More info: - // https://github.com/kubernetes/community/blob/master/contributors/devel/api-conventions.md#spec-and-status - - Spec MultiClusterAppSpec `json:"spec"` - Status MultiClusterAppStatus `json:"status"` -} - -type MultiClusterAppSpec struct { - TemplateVersionName string `json:"templateVersionName,omitempty" norman:"type=reference[templateVersion],required"` - Answers []Answer `json:"answers,omitempty"` - Wait bool `json:"wait,omitempty"` - Timeout int `json:"timeout,omitempty" norman:"min=1,default=300"` - Targets []Target `json:"targets,omitempty" norman:"required,noupdate"` - Members []Member `json:"members,omitempty"` - Roles []string `json:"roles,omitempty" norman:"type=array[reference[roleTemplate]],required"` - RevisionHistoryLimit int `json:"revisionHistoryLimit,omitempty" norman:"default=10"` - UpgradeStrategy UpgradeStrategy `json:"upgradeStrategy,omitempty"` -} - -type MultiClusterAppStatus struct { - Conditions []v3.AppCondition `json:"conditions,omitempty"` - RevisionName string `json:"revisionName,omitempty" norman:"type=reference[multiClusterAppRevision],required"` - HelmVersion string `json:"helmVersion,omitempty" norman:"nocreate,noupdate"` -} - -type Target struct { - ProjectName string `json:"projectName,omitempty" norman:"type=reference[project],required"` - AppName string `json:"appName,omitempty" norman:"type=reference[v3/projects/schemas/app]"` - State string `json:"state,omitempty"` - Healthstate string `json:"healthState,omitempty"` -} - -func (t *Target) ObjClusterName() string { - if parts := strings.SplitN(t.ProjectName, ":", 2); len(parts) == 2 { - return parts[0] - } - return "" -} - -type Answer struct { - ProjectName string `json:"projectName,omitempty" norman:"type=reference[project]"` - ClusterName string `json:"clusterName,omitempty" norman:"type=reference[cluster]"` - Values map[string]string `json:"values,omitempty" norman:"required"` -} - -func (a *Answer) ObjClusterName() string { - return a.ClusterName -} - -type Member struct { - UserName string `json:"userName,omitempty" norman:"type=reference[user]"` - UserPrincipalName string `json:"userPrincipalName,omitempty" norman:"type=reference[principal]"` - DisplayName string `json:"displayName,omitempty"` - GroupPrincipalName string `json:"groupPrincipalName,omitempty" norman:"type=reference[principal]"` - AccessType string `json:"accessType,omitempty" norman:"type=enum,options=owner|member|read-only"` -} - -type UpgradeStrategy struct { - RollingUpdate *RollingUpdate `json:"rollingUpdate,omitempty"` -} - -type RollingUpdate struct { - BatchSize int `json:"batchSize,omitempty"` - Interval int `json:"interval,omitempty"` -} - -type MultiClusterAppRevision struct { - types.Namespaced - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - TemplateVersionName string `json:"templateVersionName,omitempty" norman:"type=reference[templateVersion]"` - Answers []Answer `json:"answers,omitempty"` -} - -type MultiClusterAppRollbackInput struct { - RevisionName string `json:"revisionName,omitempty" norman:"type=reference[multiClusterAppRevision]"` -} - -type UpdateMultiClusterAppTargetsInput struct { - Projects []string `json:"projects" norman:"type=array[reference[project]],required"` - Answers []Answer `json:"answers"` -} diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/network_policy_types.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/network_policy_types.go deleted file mode 100644 index 345b5076..00000000 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/network_policy_types.go +++ /dev/null @@ -1,32 +0,0 @@ -package v3 - -import ( - "strings" - - "github.com/rancher/norman/types" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -type ProjectNetworkPolicySpec struct { - ProjectName string `json:"projectName,omitempty" norman:"required,type=reference[project]"` - Description string `json:"description"` -} - -func (p *ProjectNetworkPolicySpec) ObjClusterName() string { - if parts := strings.SplitN(p.ProjectName, ":", 2); len(parts) == 2 { - return parts[0] - } - return "" -} - -type ProjectNetworkPolicyStatus struct { -} - -type ProjectNetworkPolicy struct { - types.Namespaced - - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - Spec ProjectNetworkPolicySpec `json:"spec"` - Status *ProjectNetworkPolicyStatus `json:"status"` -} diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/resource_quota_types.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/resource_quota_types.go deleted file mode 100644 index 1a3545b5..00000000 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/resource_quota_types.go +++ /dev/null @@ -1,33 +0,0 @@ -package v3 - -type ProjectResourceQuota struct { - Limit ResourceQuotaLimit `json:"limit,omitempty"` - UsedLimit ResourceQuotaLimit `json:"usedLimit,omitempty"` -} - -type NamespaceResourceQuota struct { - Limit ResourceQuotaLimit `json:"limit,omitempty"` -} - -type ResourceQuotaLimit struct { - Pods string `json:"pods,omitempty"` - Services string `json:"services,omitempty"` - ReplicationControllers string `json:"replicationControllers,omitempty"` - Secrets string `json:"secrets,omitempty"` - ConfigMaps string `json:"configMaps,omitempty"` - PersistentVolumeClaims string `json:"persistentVolumeClaims,omitempty"` - ServicesNodePorts string `json:"servicesNodePorts,omitempty"` - ServicesLoadBalancers string `json:"servicesLoadBalancers,omitempty"` - RequestsCPU string `json:"requestsCpu,omitempty"` - RequestsMemory string `json:"requestsMemory,omitempty"` - RequestsStorage string `json:"requestsStorage,omitempty"` - LimitsCPU string `json:"limitsCpu,omitempty"` - LimitsMemory string `json:"limitsMemory,omitempty"` -} - -type ContainerResourceLimit struct { - RequestsCPU string `json:"requestsCpu,omitempty"` - RequestsMemory string `json:"requestsMemory,omitempty"` - LimitsCPU string `json:"limitsCpu,omitempty"` - LimitsMemory string `json:"limitsMemory,omitempty"` -} diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/rke_types.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/rke_types.go deleted file mode 100644 index 8aa65264..00000000 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/rke_types.go +++ /dev/null @@ -1,883 +0,0 @@ -package v3 - -import ( - "github.com/rancher/norman/types" - v1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - apiserverv1alpha1 "k8s.io/apiserver/pkg/apis/apiserver/v1alpha1" - auditv1 "k8s.io/apiserver/pkg/apis/audit/v1" - apiserverconfig "k8s.io/apiserver/pkg/apis/config" -) - -type RancherKubernetesEngineConfig struct { - // Kubernetes nodes - Nodes []RKEConfigNode `yaml:"nodes" json:"nodes,omitempty"` - // Kubernetes components - Services RKEConfigServices `yaml:"services" json:"services,omitempty"` - // Network configuration used in the kubernetes cluster (flannel, calico) - Network NetworkConfig `yaml:"network" json:"network,omitempty"` - // Authentication configuration used in the cluster (default: x509) - Authentication AuthnConfig `yaml:"authentication" json:"authentication,omitempty"` - // YAML manifest for user provided addons to be deployed on the cluster - Addons string `yaml:"addons" json:"addons,omitempty"` - // List of urls or paths for addons - AddonsInclude []string `yaml:"addons_include" json:"addonsInclude,omitempty"` - // List of images used internally for proxy, cert downlaod and kubedns - SystemImages RKESystemImages `yaml:"system_images" json:"systemImages,omitempty"` - // SSH Private Key Path - SSHKeyPath string `yaml:"ssh_key_path" json:"sshKeyPath,omitempty" norman:"nocreate,noupdate"` - // SSH Certificate Path - SSHCertPath string `yaml:"ssh_cert_path" json:"sshCertPath,omitempty" norman:"nocreate,noupdate"` - // SSH Agent Auth enable - SSHAgentAuth bool `yaml:"ssh_agent_auth" json:"sshAgentAuth"` - // Authorization mode configuration used in the cluster - Authorization AuthzConfig `yaml:"authorization" json:"authorization,omitempty"` - // Enable/disable strict docker version checking - IgnoreDockerVersion *bool `yaml:"ignore_docker_version" json:"ignoreDockerVersion" norman:"default=true"` - // Kubernetes version to use (if kubernetes image is specifed, image version takes precedence) - Version string `yaml:"kubernetes_version" json:"kubernetesVersion,omitempty"` - // List of private registries and their credentials - PrivateRegistries []PrivateRegistry `yaml:"private_registries" json:"privateRegistries,omitempty"` - // Ingress controller used in the cluster - Ingress IngressConfig `yaml:"ingress" json:"ingress,omitempty"` - // Cluster Name used in the kube config - ClusterName string `yaml:"cluster_name" json:"clusterName,omitempty"` - // Cloud Provider options - CloudProvider CloudProvider `yaml:"cloud_provider" json:"cloudProvider,omitempty"` - // kubernetes directory path - PrefixPath string `yaml:"prefix_path" json:"prefixPath,omitempty"` - // Timeout in seconds for status check on addon deployment jobs - AddonJobTimeout int `yaml:"addon_job_timeout" json:"addonJobTimeout,omitempty" norman:"default=30"` - // Bastion/Jump Host configuration - BastionHost BastionHost `yaml:"bastion_host" json:"bastionHost,omitempty"` - // Monitoring Config - Monitoring MonitoringConfig `yaml:"monitoring" json:"monitoring,omitempty"` - // RestoreCluster flag - Restore RestoreConfig `yaml:"restore" json:"restore,omitempty"` - // Rotating Certificates Option - RotateCertificates *RotateCertificates `yaml:"rotate_certificates,omitempty" json:"rotateCertificates,omitempty"` - // DNS Config - DNS *DNSConfig `yaml:"dns" json:"dns,omitempty"` - // Upgrade Strategy for the cluster - UpgradeStrategy *NodeUpgradeStrategy `yaml:"upgrade_strategy,omitempty" json:"upgradeStrategy,omitempty"` -} - -func (r *RancherKubernetesEngineConfig) ObjClusterName() string { - return r.ClusterName -} - -type NodeUpgradeStrategy struct { - // MaxUnavailableWorker input can be a number of nodes or a percentage of nodes (example, max_unavailable_worker: 2 OR max_unavailable_worker: 20%) - MaxUnavailableWorker string `yaml:"max_unavailable_worker" json:"maxUnavailableWorker,omitempty" norman:"min=1,default=10%"` - // MaxUnavailableControlplane input can be a number of nodes or a percentage of nodes - MaxUnavailableControlplane string `yaml:"max_unavailable_controlplane" json:"maxUnavailableControlplane,omitempty" norman:"min=1,default=1"` - Drain bool `yaml:"drain" json:"drain,omitempty"` - DrainInput *NodeDrainInput `yaml:"node_drain_input" json:"nodeDrainInput,omitempty"` -} - -type BastionHost struct { - // Address of Bastion Host - Address string `yaml:"address" json:"address,omitempty"` - // SSH Port of Bastion Host - Port string `yaml:"port" json:"port,omitempty"` - // ssh User to Bastion Host - User string `yaml:"user" json:"user,omitempty"` - // SSH Agent Auth enable - SSHAgentAuth bool `yaml:"ssh_agent_auth,omitempty" json:"sshAgentAuth,omitempty"` - // SSH Private Key - SSHKey string `yaml:"ssh_key" json:"sshKey,omitempty" norman:"type=password"` - // SSH Private Key Path - SSHKeyPath string `yaml:"ssh_key_path" json:"sshKeyPath,omitempty"` - // SSH Certificate - SSHCert string `yaml:"ssh_cert" json:"sshCert,omitempty"` - // SSH Certificate Path - SSHCertPath string `yaml:"ssh_cert_path" json:"sshCertPath,omitempty"` -} - -type PrivateRegistry struct { - // URL for the registry - URL string `yaml:"url" json:"url,omitempty"` - // User name for registry acces - User string `yaml:"user" json:"user,omitempty"` - // Password for registry access - Password string `yaml:"password" json:"password,omitempty" norman:"type=password"` - // Default registry - IsDefault bool `yaml:"is_default" json:"isDefault,omitempty"` -} - -type RKESystemImages struct { - // etcd image - Etcd string `yaml:"etcd" json:"etcd,omitempty"` - // Alpine image - Alpine string `yaml:"alpine" json:"alpine,omitempty"` - // rke-nginx-proxy image - NginxProxy string `yaml:"nginx_proxy" json:"nginxProxy,omitempty"` - // rke-cert-deployer image - CertDownloader string `yaml:"cert_downloader" json:"certDownloader,omitempty"` - // rke-service-sidekick image - KubernetesServicesSidecar string `yaml:"kubernetes_services_sidecar" json:"kubernetesServicesSidecar,omitempty"` - // KubeDNS image - KubeDNS string `yaml:"kubedns" json:"kubedns,omitempty"` - // DNSMasq image - DNSmasq string `yaml:"dnsmasq" json:"dnsmasq,omitempty"` - // KubeDNS side car image - KubeDNSSidecar string `yaml:"kubedns_sidecar" json:"kubednsSidecar,omitempty"` - // KubeDNS autoscaler image - KubeDNSAutoscaler string `yaml:"kubedns_autoscaler" json:"kubednsAutoscaler,omitempty"` - // CoreDNS image - CoreDNS string `yaml:"coredns" json:"coredns,omitempty"` - // CoreDNS autoscaler image - CoreDNSAutoscaler string `yaml:"coredns_autoscaler" json:"corednsAutoscaler,omitempty"` - // Nodelocal image - Nodelocal string `yaml:"nodelocal" json:"nodelocal,omitempty"` - // Kubernetes image - Kubernetes string `yaml:"kubernetes" json:"kubernetes,omitempty"` - // Flannel image - Flannel string `yaml:"flannel" json:"flannel,omitempty"` - // Flannel CNI image - FlannelCNI string `yaml:"flannel_cni" json:"flannelCni,omitempty"` - // Calico Node image - CalicoNode string `yaml:"calico_node" json:"calicoNode,omitempty"` - // Calico CNI image - CalicoCNI string `yaml:"calico_cni" json:"calicoCni,omitempty"` - // Calico Controllers image - CalicoControllers string `yaml:"calico_controllers" json:"calicoControllers,omitempty"` - // Calicoctl image - CalicoCtl string `yaml:"calico_ctl" json:"calicoCtl,omitempty"` - //CalicoFlexVol image - CalicoFlexVol string `yaml:"calico_flexvol" json:"calicoFlexVol,omitempty"` - // Canal Node Image - CanalNode string `yaml:"canal_node" json:"canalNode,omitempty"` - // Canal CNI image - CanalCNI string `yaml:"canal_cni" json:"canalCni,omitempty"` - //CanalFlannel image - CanalFlannel string `yaml:"canal_flannel" json:"canalFlannel,omitempty"` - //CanalFlexVol image - CanalFlexVol string `yaml:"canal_flexvol" json:"canalFlexVol,omitempty"` - //Weave Node image - WeaveNode string `yaml:"weave_node" json:"weaveNode,omitempty"` - // Weave CNI image - WeaveCNI string `yaml:"weave_cni" json:"weaveCni,omitempty"` - // Pod infra container image - PodInfraContainer string `yaml:"pod_infra_container" json:"podInfraContainer,omitempty"` - // Ingress Controller image - Ingress string `yaml:"ingress" json:"ingress,omitempty"` - // Ingress Controller Backend image - IngressBackend string `yaml:"ingress_backend" json:"ingressBackend,omitempty"` - // Metrics Server image - MetricsServer string `yaml:"metrics_server" json:"metricsServer,omitempty"` - // Pod infra container image for Windows - WindowsPodInfraContainer string `yaml:"windows_pod_infra_container" json:"windowsPodInfraContainer,omitempty"` -} - -type RKEConfigNode struct { - // Name of the host provisioned via docker machine - NodeName string `yaml:"nodeName,omitempty" json:"nodeName,omitempty" norman:"type=reference[node]"` - // IP or FQDN that is fully resolvable and used for SSH communication - Address string `yaml:"address" json:"address,omitempty"` - // Port used for SSH communication - Port string `yaml:"port" json:"port,omitempty"` - // Optional - Internal address that will be used for components communication - InternalAddress string `yaml:"internal_address" json:"internalAddress,omitempty"` - // Node role in kubernetes cluster (controlplane, worker, or etcd) - Role []string `yaml:"role" json:"role,omitempty" norman:"type=array[enum],options=etcd|worker|controlplane"` - // Optional - Hostname of the node - HostnameOverride string `yaml:"hostname_override" json:"hostnameOverride,omitempty"` - // SSH usesr that will be used by RKE - User string `yaml:"user" json:"user,omitempty"` - // Optional - Docker socket on the node that will be used in tunneling - DockerSocket string `yaml:"docker_socket" json:"dockerSocket,omitempty"` - // SSH Agent Auth enable - SSHAgentAuth bool `yaml:"ssh_agent_auth,omitempty" json:"sshAgentAuth,omitempty"` - // SSH Private Key - SSHKey string `yaml:"ssh_key" json:"sshKey,omitempty" norman:"type=password"` - // SSH Private Key Path - SSHKeyPath string `yaml:"ssh_key_path" json:"sshKeyPath,omitempty"` - // SSH Certificate - SSHCert string `yaml:"ssh_cert" json:"sshCert,omitempty"` - // SSH Certificate Path - SSHCertPath string `yaml:"ssh_cert_path" json:"sshCertPath,omitempty"` - // Node Labels - Labels map[string]string `yaml:"labels" json:"labels,omitempty"` - // Node Taints - Taints []RKETaint `yaml:"taints" json:"taints,omitempty"` -} - -type RkeK8sSystemImage struct { - types.Namespaced - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - SystemImages RKESystemImages `yaml:"system_images" json:"systemImages,omitempty"` -} - -type RkeK8sServiceOption struct { - types.Namespaced - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - ServiceOptions KubernetesServicesOptions `yaml:"service_options" json:"serviceOptions,omitempty"` -} - -type RkeAddon struct { - types.Namespaced - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - Template string `yaml:"template" json:"template,omitempty"` -} - -type K8sVersionInfo struct { - MinRKEVersion string `yaml:"min_rke_version" json:"minRKEVersion,omitempty"` - MaxRKEVersion string `yaml:"max_rke_version" json:"maxRKEVersion,omitempty"` - DeprecateRKEVersion string `yaml:"deprecate_rke_version" json:"deprecateRKEVersion,omitempty"` - - MinRancherVersion string `yaml:"min_rancher_version" json:"minRancherVersion,omitempty"` - MaxRancherVersion string `yaml:"max_rancher_version" json:"maxRancherVersion,omitempty"` - DeprecateRancherVersion string `yaml:"deprecate_rancher_version" json:"deprecateRancherVersion,omitempty"` -} - -type RKEConfigServices struct { - // Etcd Service - Etcd ETCDService `yaml:"etcd" json:"etcd,omitempty"` - // KubeAPI Service - KubeAPI KubeAPIService `yaml:"kube-api" json:"kubeApi,omitempty"` - // KubeController Service - KubeController KubeControllerService `yaml:"kube-controller" json:"kubeController,omitempty"` - // Scheduler Service - Scheduler SchedulerService `yaml:"scheduler" json:"scheduler,omitempty"` - // Kubelet Service - Kubelet KubeletService `yaml:"kubelet" json:"kubelet,omitempty"` - // KubeProxy Service - Kubeproxy KubeproxyService `yaml:"kubeproxy" json:"kubeproxy,omitempty"` -} - -type ETCDService struct { - // Base service properties - BaseService `yaml:",inline" json:",inline"` - // List of etcd urls - ExternalURLs []string `yaml:"external_urls" json:"externalUrls,omitempty"` - // External CA certificate - CACert string `yaml:"ca_cert" json:"caCert,omitempty"` - // External Client certificate - Cert string `yaml:"cert" json:"cert,omitempty"` - // External Client key - Key string `yaml:"key" json:"key,omitempty"` - // External etcd prefix - Path string `yaml:"path" json:"path,omitempty"` - // UID to run etcd container as - UID int `yaml:"uid" json:"uid,omitempty"` - // GID to run etcd container as - GID int `yaml:"gid" json:"gid,omitempty"` - - // Etcd Recurring snapshot Service, used by rke only - Snapshot *bool `yaml:"snapshot" json:"snapshot,omitempty" norman:"default=false"` - // Etcd snapshot Retention period - Retention string `yaml:"retention" json:"retention,omitempty" norman:"default=72h"` - // Etcd snapshot Creation period - Creation string `yaml:"creation" json:"creation,omitempty" norman:"default=12h"` - // Backup backend for etcd snapshots - BackupConfig *BackupConfig `yaml:"backup_config" json:"backupConfig,omitempty"` -} - -type KubeAPIService struct { - // Base service properties - BaseService `yaml:",inline" json:",inline"` - // Virtual IP range that will be used by Kubernetes services - ServiceClusterIPRange string `yaml:"service_cluster_ip_range" json:"serviceClusterIpRange,omitempty"` - // Port range for services defined with NodePort type - ServiceNodePortRange string `yaml:"service_node_port_range" json:"serviceNodePortRange,omitempty" norman:"default=30000-32767"` - // Enabled/Disable PodSecurityPolicy - PodSecurityPolicy bool `yaml:"pod_security_policy" json:"podSecurityPolicy,omitempty"` - // Enable/Disable AlwaysPullImages admissions plugin - AlwaysPullImages bool `yaml:"always_pull_images" json:"alwaysPullImages,omitempty"` - // Secrets encryption provider config - SecretsEncryptionConfig *SecretsEncryptionConfig `yaml:"secrets_encryption_config" json:"secretsEncryptionConfig,omitempty"` - // Audit Log Configuration - AuditLog *AuditLog `yaml:"audit_log" json:"auditLog,omitempty"` - // AdmissionConfiguration - AdmissionConfiguration *apiserverv1alpha1.AdmissionConfiguration `yaml:"admission_configuration" json:"admissionConfiguration,omitempty" norman:"type=map[json]"` - // Event Rate Limit configuration - EventRateLimit *EventRateLimit `yaml:"event_rate_limit" json:"eventRateLimit,omitempty"` -} - -type EventRateLimit struct { - Enabled bool `yaml:"enabled" json:"enabled,omitempty"` - Configuration *Configuration `yaml:"configuration" json:"configuration,omitempty" norman:"type=map[json]"` -} - -type AuditLog struct { - Enabled bool `yaml:"enabled" json:"enabled,omitempty"` - Configuration *AuditLogConfig `yaml:"configuration" json:"configuration,omitempty"` -} - -type AuditLogConfig struct { - MaxAge int `yaml:"max_age" json:"maxAge,omitempty"` - MaxBackup int `yaml:"max_backup" json:"maxBackup,omitempty"` - MaxSize int `yaml:"max_size" json:"maxSize,omitempty"` - Path string `yaml:"path" json:"path,omitempty"` - Format string `yaml:"format" json:"format,omitempty"` - Policy *auditv1.Policy `yaml:"policy" json:"policy,omitempty" norman:"type=map[json]"` -} - -type KubeControllerService struct { - // Base service properties - BaseService `yaml:",inline" json:",inline"` - // CIDR Range for Pods in cluster - ClusterCIDR string `yaml:"cluster_cidr" json:"clusterCidr,omitempty"` - // Virtual IP range that will be used by Kubernetes services - ServiceClusterIPRange string `yaml:"service_cluster_ip_range" json:"serviceClusterIpRange,omitempty"` -} - -type KubeletService struct { - // Base service properties - BaseService `yaml:",inline" json:",inline"` - // Domain of the cluster (default: "cluster.local") - ClusterDomain string `yaml:"cluster_domain" json:"clusterDomain,omitempty"` - // The image whose network/ipc namespaces containers in each pod will use - InfraContainerImage string `yaml:"infra_container_image" json:"infraContainerImage,omitempty"` - // Cluster DNS service ip - ClusterDNSServer string `yaml:"cluster_dns_server" json:"clusterDnsServer,omitempty"` - // Fail if swap is enabled - FailSwapOn bool `yaml:"fail_swap_on" json:"failSwapOn,omitempty"` - // Generate per node kubelet serving certificates created using kube-ca - GenerateServingCertificate bool `yaml:"generate_serving_certificate" json:"generateServingCertificate,omitempty"` -} - -type KubeproxyService struct { - // Base service properties - BaseService `yaml:",inline" json:",inline"` -} - -type SchedulerService struct { - // Base service properties - BaseService `yaml:",inline" json:",inline"` -} - -type BaseService struct { - // Docker image of the service - Image string `yaml:"image" json:"image,omitempty"` - // Extra arguments that are added to the services - ExtraArgs map[string]string `yaml:"extra_args" json:"extraArgs,omitempty"` - // Extra binds added to the nodes - ExtraBinds []string `yaml:"extra_binds" json:"extraBinds,omitempty"` - // this is to provide extra env variable to the docker container running kubernetes service - ExtraEnv []string `yaml:"extra_env" json:"extraEnv,omitempty"` -} - -type NetworkConfig struct { - // Network Plugin That will be used in kubernetes cluster - Plugin string `yaml:"plugin" json:"plugin,omitempty" norman:"default=canal"` - // Plugin options to configure network properties - Options map[string]string `yaml:"options" json:"options,omitempty"` - // Set MTU for CNI provider - MTU int `yaml:"mtu" json:"mtu,omitempty"` - // CalicoNetworkProvider - CalicoNetworkProvider *CalicoNetworkProvider `yaml:"calico_network_provider,omitempty" json:"calicoNetworkProvider,omitempty"` - // CanalNetworkProvider - CanalNetworkProvider *CanalNetworkProvider `yaml:"canal_network_provider,omitempty" json:"canalNetworkProvider,omitempty"` - // FlannelNetworkProvider - FlannelNetworkProvider *FlannelNetworkProvider `yaml:"flannel_network_provider,omitempty" json:"flannelNetworkProvider,omitempty"` - // WeaveNetworkProvider - WeaveNetworkProvider *WeaveNetworkProvider `yaml:"weave_network_provider,omitempty" json:"weaveNetworkProvider,omitempty"` - // NodeSelector key pair - NodeSelector map[string]string `yaml:"node_selector" json:"nodeSelector,omitempty"` - // Network plugin daemonset upgrade strategy - UpdateStrategy *DaemonSetUpdateStrategy `yaml:"update_strategy" json:"updateStrategy,omitempty"` -} - -type AuthWebhookConfig struct { - // ConfigFile is a multiline string that represent a custom webhook config file - ConfigFile string `yaml:"config_file" json:"configFile,omitempty"` - // CacheTimeout controls how long to cache authentication decisions - CacheTimeout string `yaml:"cache_timeout" json:"cacheTimeout,omitempty"` -} - -type AuthnConfig struct { - // Authentication strategy that will be used in kubernetes cluster - Strategy string `yaml:"strategy" json:"strategy,omitempty" norman:"default=x509"` - // List of additional hostnames and IPs to include in the api server PKI cert - SANs []string `yaml:"sans" json:"sans,omitempty"` - // Webhook configuration options - Webhook *AuthWebhookConfig `yaml:"webhook" json:"webhook,omitempty"` -} - -type AuthzConfig struct { - // Authorization mode used by kubernetes - Mode string `yaml:"mode" json:"mode,omitempty"` - // Authorization mode options - Options map[string]string `yaml:"options" json:"options,omitempty"` -} - -type IngressConfig struct { - // Ingress controller type used by kubernetes - Provider string `yaml:"provider" json:"provider,omitempty" norman:"default=nginx"` - // Ingress controller options - Options map[string]string `yaml:"options" json:"options,omitempty"` - // NodeSelector key pair - NodeSelector map[string]string `yaml:"node_selector" json:"nodeSelector,omitempty"` - // Ingress controller extra arguments - ExtraArgs map[string]string `yaml:"extra_args" json:"extraArgs,omitempty"` - // DNS Policy - DNSPolicy string `yaml:"dns_policy" json:"dnsPolicy,omitempty"` - // Extra Env vars - ExtraEnvs []ExtraEnv `yaml:"extra_envs" json:"extraEnvs,omitempty" norman:"type=array[json]"` - // Extra volumes - ExtraVolumes []ExtraVolume `yaml:"extra_volumes" json:"extraVolumes,omitempty" norman:"type=array[json]"` - // Extra volume mounts - ExtraVolumeMounts []ExtraVolumeMount `yaml:"extra_volume_mounts" json:"extraVolumeMounts,omitempty" norman:"type=array[json]"` - // nginx daemonset upgrade strategy - UpdateStrategy *DaemonSetUpdateStrategy `yaml:"update_strategy" json:"updateStrategy,omitempty"` -} - -type ExtraEnv struct { - v1.EnvVar -} - -type ExtraVolume struct { - v1.Volume -} - -type ExtraVolumeMount struct { - v1.VolumeMount -} - -type RKEPlan struct { - // List of node Plans - Nodes []RKEConfigNodePlan `json:"nodes,omitempty"` -} - -type RKEConfigNodePlan struct { - // Node address - Address string `json:"address,omitempty"` - // map of named processes that should run on the node - Processes map[string]Process `json:"processes,omitempty"` - // List of portchecks that should be open on the node - PortChecks []PortCheck `json:"portChecks,omitempty"` - // List of files to deploy on the node - Files []File `json:"files,omitempty"` - // Node Annotations - Annotations map[string]string `json:"annotations,omitempty"` - // Node Labels - Labels map[string]string `json:"labels,omitempty"` - // Node Taints - Taints []RKETaint `json:"taints,omitempty"` -} - -type Process struct { - // Process name, this should be the container name - Name string `json:"name,omitempty"` - // Process Entrypoint command - Command []string `json:"command,omitempty"` - // Process args - Args []string `json:"args,omitempty"` - // Environment variables list - Env []string `json:"env,omitempty"` - // Process docker image - Image string `json:"image,omitempty"` - //AuthConfig for image private registry - ImageRegistryAuthConfig string `json:"imageRegistryAuthConfig,omitempty"` - // Process docker image VolumesFrom - VolumesFrom []string `json:"volumesFrom,omitempty"` - // Process docker container bind mounts - Binds []string `json:"binds,omitempty"` - // Process docker container netwotk mode - NetworkMode string `json:"networkMode,omitempty"` - // Process container restart policy - RestartPolicy string `json:"restartPolicy,omitempty"` - // Process container pid mode - PidMode string `json:"pidMode,omitempty"` - // Run process in privileged container - Privileged bool `json:"privileged,omitempty"` - // Process healthcheck - HealthCheck HealthCheck `json:"healthCheck,omitempty"` - // Process docker container Labels - Labels map[string]string `json:"labels,omitempty"` - // Process docker publish container's port to host - Publish []string `json:"publish,omitempty"` - // docker will run the container with this user - User string `json:"user,omitempty"` -} - -type HealthCheck struct { - // Healthcheck URL - URL string `json:"url,omitempty"` -} - -type PortCheck struct { - // Portcheck address to check. - Address string `json:"address,omitempty"` - // Port number - Port int `json:"port,omitempty"` - // Port Protocol - Protocol string `json:"protocol,omitempty"` -} - -type CloudProvider struct { - // Name of the Cloud Provider - Name string `yaml:"name" json:"name,omitempty"` - // AWSCloudProvider - AWSCloudProvider *AWSCloudProvider `yaml:"awsCloudProvider,omitempty" json:"awsCloudProvider,omitempty"` - // AzureCloudProvider - AzureCloudProvider *AzureCloudProvider `yaml:"azureCloudProvider,omitempty" json:"azureCloudProvider,omitempty"` - // OpenstackCloudProvider - OpenstackCloudProvider *OpenstackCloudProvider `yaml:"openstackCloudProvider,omitempty" json:"openstackCloudProvider,omitempty"` - // VsphereCloudProvider - VsphereCloudProvider *VsphereCloudProvider `yaml:"vsphereCloudProvider,omitempty" json:"vsphereCloudProvider,omitempty"` - // CustomCloudProvider is a multiline string that represent a custom cloud config file - CustomCloudProvider string `yaml:"customCloudProvider,omitempty" json:"customCloudProvider,omitempty"` -} - -type CalicoNetworkProvider struct { - // Cloud provider type used with calico - CloudProvider string `json:"cloudProvider"` -} - -type FlannelNetworkProvider struct { - // Alternate cloud interface for flannel - Iface string `json:"iface"` -} - -type CanalNetworkProvider struct { - FlannelNetworkProvider `yaml:",inline" json:",inline"` -} - -type WeaveNetworkProvider struct { - Password string `yaml:"password,omitempty" json:"password,omitempty" norman:"type=password"` -} - -type KubernetesServicesOptions struct { - // Additional options passed to Etcd - Etcd map[string]string `json:"etcd"` - // Additional options passed to KubeAPI - KubeAPI map[string]string `json:"kubeapi"` - // Additional options passed to Kubelet - Kubelet map[string]string `json:"kubelet"` - // Additional options passed to Kubeproxy - Kubeproxy map[string]string `json:"kubeproxy"` - // Additional options passed to KubeController - KubeController map[string]string `json:"kubeController"` - // Additional options passed to Scheduler - Scheduler map[string]string `json:"scheduler"` -} - -// VsphereCloudProvider options -type VsphereCloudProvider struct { - Global GlobalVsphereOpts `json:"global,omitempty" yaml:"global,omitempty" ini:"Global,omitempty"` - VirtualCenter map[string]VirtualCenterConfig `json:"virtualCenter,omitempty" yaml:"virtual_center,omitempty" ini:"VirtualCenter,omitempty"` - Network NetworkVshpereOpts `json:"network,omitempty" yaml:"network,omitempty" ini:"Network,omitempty"` - Disk DiskVsphereOpts `json:"disk,omitempty" yaml:"disk,omitempty" ini:"Disk,omitempty"` - Workspace WorkspaceVsphereOpts `json:"workspace,omitempty" yaml:"workspace,omitempty" ini:"Workspace,omitempty"` -} - -type GlobalVsphereOpts struct { - User string `json:"user,omitempty" yaml:"user,omitempty" ini:"user,omitempty"` - Password string `json:"password,omitempty" yaml:"password,omitempty" ini:"password,omitempty" norman:"type=password"` - VCenterIP string `json:"server,omitempty" yaml:"server,omitempty" ini:"server,omitempty"` - VCenterPort string `json:"port,omitempty" yaml:"port,omitempty" ini:"port,omitempty"` - InsecureFlag bool `json:"insecure-flag,omitempty" yaml:"insecure-flag,omitempty" ini:"insecure-flag,omitempty"` - Datacenter string `json:"datacenter,omitempty" yaml:"datacenter,omitempty" ini:"datacenter,omitempty"` - Datacenters string `json:"datacenters,omitempty" yaml:"datacenters,omitempty" ini:"datacenters,omitempty"` - DefaultDatastore string `json:"datastore,omitempty" yaml:"datastore,omitempty" ini:"datastore,omitempty"` - WorkingDir string `json:"working-dir,omitempty" yaml:"working-dir,omitempty" ini:"working-dir,omitempty"` - RoundTripperCount int `json:"soap-roundtrip-count,omitempty" yaml:"soap-roundtrip-count,omitempty" ini:"soap-roundtrip-count,omitempty"` - VMUUID string `json:"vm-uuid,omitempty" yaml:"vm-uuid,omitempty" ini:"vm-uuid,omitempty"` - VMName string `json:"vm-name,omitempty" yaml:"vm-name,omitempty" ini:"vm-name,omitempty"` -} - -type VirtualCenterConfig struct { - User string `json:"user,omitempty" yaml:"user,omitempty" ini:"user,omitempty"` - Password string `json:"password,omitempty" yaml:"password,omitempty" ini:"password,omitempty" norman:"type=password"` - VCenterPort string `json:"port,omitempty" yaml:"port,omitempty" ini:"port,omitempty"` - Datacenters string `json:"datacenters,omitempty" yaml:"datacenters,omitempty" ini:"datacenters,omitempty"` - RoundTripperCount int `json:"soap-roundtrip-count,omitempty" yaml:"soap-roundtrip-count,omitempty" ini:"soap-roundtrip-count,omitempty"` -} - -type NetworkVshpereOpts struct { - PublicNetwork string `json:"public-network,omitempty" yaml:"public-network,omitempty" ini:"public-network,omitempty"` -} - -type DiskVsphereOpts struct { - SCSIControllerType string `json:"scsicontrollertype,omitempty" yaml:"scsicontrollertype,omitempty" ini:"scsicontrollertype,omitempty"` -} - -type WorkspaceVsphereOpts struct { - VCenterIP string `json:"server,omitempty" yaml:"server,omitempty" ini:"server,omitempty"` - Datacenter string `json:"datacenter,omitempty" yaml:"datacenter,omitempty" ini:"datacenter,omitempty"` - Folder string `json:"folder,omitempty" yaml:"folder,omitempty" ini:"folder,omitempty"` - DefaultDatastore string `json:"default-datastore,omitempty" yaml:"default-datastore,omitempty" ini:"default-datastore,omitempty"` - ResourcePoolPath string `json:"resourcepool-path,omitempty" yaml:"resourcepool-path,omitempty" ini:"resourcepool-path,omitempty"` -} - -// OpenstackCloudProvider options -type OpenstackCloudProvider struct { - Global GlobalOpenstackOpts `json:"global" yaml:"global" ini:"Global,omitempty"` - LoadBalancer LoadBalancerOpenstackOpts `json:"loadBalancer" yaml:"load_balancer" ini:"LoadBalancer,omitempty"` - BlockStorage BlockStorageOpenstackOpts `json:"blockStorage" yaml:"block_storage" ini:"BlockStorage,omitempty"` - Route RouteOpenstackOpts `json:"route" yaml:"route" ini:"Route,omitempty"` - Metadata MetadataOpenstackOpts `json:"metadata" yaml:"metadata" ini:"Metadata,omitempty"` -} - -type GlobalOpenstackOpts struct { - AuthURL string `json:"auth-url" yaml:"auth-url" ini:"auth-url,omitempty"` - Username string `json:"username" yaml:"username" ini:"username,omitempty"` - UserID string `json:"user-id" yaml:"user-id" ini:"user-id,omitempty"` - Password string `json:"password" yaml:"password" ini:"password,omitempty" norman:"type=password"` - TenantID string `json:"tenant-id" yaml:"tenant-id" ini:"tenant-id,omitempty"` - TenantName string `json:"tenant-name" yaml:"tenant-name" ini:"tenant-name,omitempty"` - TrustID string `json:"trust-id" yaml:"trust-id" ini:"trust-id,omitempty"` - DomainID string `json:"domain-id" yaml:"domain-id" ini:"domain-id,omitempty"` - DomainName string `json:"domain-name" yaml:"domain-name" ini:"domain-name,omitempty"` - Region string `json:"region" yaml:"region" ini:"region,omitempty"` - CAFile string `json:"ca-file" yaml:"ca-file" ini:"ca-file,omitempty"` -} - -type LoadBalancerOpenstackOpts struct { - LBVersion string `json:"lb-version" yaml:"lb-version" ini:"lb-version,omitempty"` // overrides autodetection. Only support v2. - UseOctavia bool `json:"use-octavia" yaml:"use-octavia" ini:"use-octavia,omitempty"` // uses Octavia V2 service catalog endpoint - SubnetID string `json:"subnet-id" yaml:"subnet-id" ini:"subnet-id,omitempty"` // overrides autodetection. - FloatingNetworkID string `json:"floating-network-id" yaml:"floating-network-id" ini:"floating-network-id,omitempty"` // If specified, will create floating ip for loadbalancer, or do not create floating ip. - LBMethod string `json:"lb-method" yaml:"lb-method" ini:"lb-method,omitempty"` // default to ROUND_ROBIN. - LBProvider string `json:"lb-provider" yaml:"lb-provider" ini:"lb-provider,omitempty"` - CreateMonitor bool `json:"create-monitor" yaml:"create-monitor" ini:"create-monitor,omitempty"` - MonitorDelay string `json:"monitor-delay" yaml:"monitor-delay" ini:"monitor-delay,omitempty"` - MonitorTimeout string `json:"monitor-timeout" yaml:"monitor-timeout" ini:"monitor-timeout,omitempty"` - MonitorMaxRetries int `json:"monitor-max-retries" yaml:"monitor-max-retries" ini:"monitor-max-retries,omitempty"` - ManageSecurityGroups bool `json:"manage-security-groups" yaml:"manage-security-groups" ini:"manage-security-groups,omitempty"` -} - -type BlockStorageOpenstackOpts struct { - BSVersion string `json:"bs-version" yaml:"bs-version" ini:"bs-version,omitempty"` // overrides autodetection. v1 or v2. Defaults to auto - TrustDevicePath bool `json:"trust-device-path" yaml:"trust-device-path" ini:"trust-device-path,omitempty"` // See Issue #33128 - IgnoreVolumeAZ bool `json:"ignore-volume-az" yaml:"ignore-volume-az" ini:"ignore-volume-az,omitempty"` -} - -type RouteOpenstackOpts struct { - RouterID string `json:"router-id" yaml:"router-id" ini:"router-id,omitempty"` // required -} - -type MetadataOpenstackOpts struct { - SearchOrder string `json:"search-order" yaml:"search-order" ini:"search-order,omitempty"` - RequestTimeout int `json:"request-timeout" yaml:"request-timeout" ini:"request-timeout,omitempty"` -} - -// AzureCloudProvider options -type AzureCloudProvider struct { - // The cloud environment identifier. Takes values from https://github.com/Azure/go-autorest/blob/ec5f4903f77ed9927ac95b19ab8e44ada64c1356/autorest/azure/environments.go#L13 - Cloud string `json:"cloud" yaml:"cloud"` - // The AAD Tenant ID for the Subscription that the cluster is deployed in - TenantID string `json:"tenantId" yaml:"tenantId"` - // The ID of the Azure Subscription that the cluster is deployed in - SubscriptionID string `json:"subscriptionId" yaml:"subscriptionId"` - // The name of the resource group that the cluster is deployed in - ResourceGroup string `json:"resourceGroup" yaml:"resourceGroup"` - // The location of the resource group that the cluster is deployed in - Location string `json:"location" yaml:"location"` - // The name of the VNet that the cluster is deployed in - VnetName string `json:"vnetName" yaml:"vnetName"` - // The name of the resource group that the Vnet is deployed in - VnetResourceGroup string `json:"vnetResourceGroup" yaml:"vnetResourceGroup"` - // The name of the subnet that the cluster is deployed in - SubnetName string `json:"subnetName" yaml:"subnetName"` - // The name of the security group attached to the cluster's subnet - SecurityGroupName string `json:"securityGroupName" yaml:"securityGroupName"` - // (Optional in 1.6) The name of the route table attached to the subnet that the cluster is deployed in - RouteTableName string `json:"routeTableName" yaml:"routeTableName"` - // (Optional) The name of the availability set that should be used as the load balancer backend - // If this is set, the Azure cloudprovider will only add nodes from that availability set to the load - // balancer backend pool. If this is not set, and multiple agent pools (availability sets) are used, then - // the cloudprovider will try to add all nodes to a single backend pool which is forbidden. - // In other words, if you use multiple agent pools (availability sets), you MUST set this field. - PrimaryAvailabilitySetName string `json:"primaryAvailabilitySetName" yaml:"primaryAvailabilitySetName"` - // The type of azure nodes. Candidate valudes are: vmss and standard. - // If not set, it will be default to standard. - VMType string `json:"vmType" yaml:"vmType"` - // The name of the scale set that should be used as the load balancer backend. - // If this is set, the Azure cloudprovider will only add nodes from that scale set to the load - // balancer backend pool. If this is not set, and multiple agent pools (scale sets) are used, then - // the cloudprovider will try to add all nodes to a single backend pool which is forbidden. - // In other words, if you use multiple agent pools (scale sets), you MUST set this field. - PrimaryScaleSetName string `json:"primaryScaleSetName" yaml:"primaryScaleSetName"` - // The ClientID for an AAD application with RBAC access to talk to Azure RM APIs - // This's used for service principal authentication: https://github.com/Azure/aks-engine/blob/master/docs/topics/service-principals.md - AADClientID string `json:"aadClientId" yaml:"aadClientId"` - // The ClientSecret for an AAD application with RBAC access to talk to Azure RM APIs - // This's used for service principal authentication: https://github.com/Azure/aks-engine/blob/master/docs/topics/service-principals.md - AADClientSecret string `json:"aadClientSecret" yaml:"aadClientSecret" norman:"type=password"` - // The path of a client certificate for an AAD application with RBAC access to talk to Azure RM APIs - // This's used for client certificate authentication: https://docs.microsoft.com/en-us/azure/active-directory/develop/active-directory-protocols-oauth-service-to-service - AADClientCertPath string `json:"aadClientCertPath" yaml:"aadClientCertPath"` - // The password of the client certificate for an AAD application with RBAC access to talk to Azure RM APIs - // This's used for client certificate authentication: https://docs.microsoft.com/en-us/azure/active-directory/develop/active-directory-protocols-oauth-service-to-service - AADClientCertPassword string `json:"aadClientCertPassword" yaml:"aadClientCertPassword" norman:"type=password"` - // Enable exponential backoff to manage resource request retries - CloudProviderBackoff bool `json:"cloudProviderBackoff" yaml:"cloudProviderBackoff"` - // Backoff retry limit - CloudProviderBackoffRetries int `json:"cloudProviderBackoffRetries" yaml:"cloudProviderBackoffRetries"` - // Backoff exponent - CloudProviderBackoffExponent int `json:"cloudProviderBackoffExponent" yaml:"cloudProviderBackoffExponent"` - // Backoff duration - CloudProviderBackoffDuration int `json:"cloudProviderBackoffDuration" yaml:"cloudProviderBackoffDuration"` - // Backoff jitter - CloudProviderBackoffJitter int `json:"cloudProviderBackoffJitter" yaml:"cloudProviderBackoffJitter"` - // Enable rate limiting - CloudProviderRateLimit bool `json:"cloudProviderRateLimit" yaml:"cloudProviderRateLimit"` - // Rate limit QPS - CloudProviderRateLimitQPS int `json:"cloudProviderRateLimitQPS" yaml:"cloudProviderRateLimitQPS"` - // Rate limit Bucket Size - CloudProviderRateLimitBucket int `json:"cloudProviderRateLimitBucket" yaml:"cloudProviderRateLimitBucket"` - // Use instance metadata service where possible - UseInstanceMetadata bool `json:"useInstanceMetadata" yaml:"useInstanceMetadata"` - // Use managed service identity for the virtual machine to access Azure ARM APIs - // This's used for managed identity authentication: https://docs.microsoft.com/en-us/azure/active-directory/managed-service-identity/overview - // For user-assigned managed identity, need to set the below UserAssignedIdentityID - UseManagedIdentityExtension bool `json:"useManagedIdentityExtension" yaml:"useManagedIdentityExtension"` - // The Client ID of the user assigned MSI which is assigned to the underlying VMs - // This's used for managed identity authentication: https://docs.microsoft.com/en-us/azure/active-directory/managed-service-identity/overview - UserAssignedIdentityID string `json:"userAssignedIdentityID,omitempty" yaml:"userAssignedIdentityID,omitempty"` - // Maximum allowed LoadBalancer Rule Count is the limit enforced by Azure Load balancer, default(0) to 148 - MaximumLoadBalancerRuleCount int `json:"maximumLoadBalancerRuleCount" yaml:"maximumLoadBalancerRuleCount"` - // Sku of Load Balancer and Public IP: `basic` or `standard`, default(blank) to `basic` - LoadBalancerSku string `json:"loadBalancerSku,omitempty" yaml:"loadBalancerSku,omitempty"` - // Excludes master nodes (labeled with `node-role.kubernetes.io/master`) from the backend pool of Azure standard loadbalancer, default(nil) to `true` - // If want adding the master nodes to ALB, this should be set to `false` and remove the `node-role.kubernetes.io/master` label from master nodes - ExcludeMasterFromStandardLB *bool `json:"excludeMasterFromStandardLB,omitempty" yaml:"excludeMasterFromStandardLB,omitempty"` -} - -// AWSCloudProvider options -type AWSCloudProvider struct { - Global GlobalAwsOpts `json:"global" yaml:"global" ini:"Global,omitempty"` - ServiceOverride map[string]ServiceOverride `json:"serviceOverride,omitempty" yaml:"service_override,omitempty" ini:"ServiceOverride,omitempty"` -} - -type ServiceOverride struct { - Service string `json:"service" yaml:"service" ini:"Service,omitempty"` - Region string `json:"region" yaml:"region" ini:"Region,omitempty"` - URL string `json:"url" yaml:"url" ini:"URL,omitempty"` - SigningRegion string `json:"signing-region" yaml:"signing-region" ini:"SigningRegion,omitempty"` - SigningMethod string `json:"signing-method" yaml:"signing-method" ini:"SigningMethod,omitempty"` - SigningName string `json:"signing-name" yaml:"signing-name" ini:"SigningName,omitempty"` -} - -type GlobalAwsOpts struct { - // TODO: Is there any use for this? We can get it from the instance metadata service - // Maybe if we're not running on AWS, e.g. bootstrap; for now it is not very useful - Zone string `json:"zone" yaml:"zone" ini:"Zone,omitempty"` - - // The AWS VPC flag enables the possibility to run the master components - // on a different aws account, on a different cloud provider or on-premises. - // If the flag is set also the KubernetesClusterTag must be provided - VPC string `json:"vpc" yaml:"vpc" ini:"VPC,omitempty"` - // SubnetID enables using a specific subnet to use for ELB's - SubnetID string `json:"subnet-id" yaml:"subnet-id" ini:"SubnetID,omitempty"` - // RouteTableID enables using a specific RouteTable - RouteTableID string `json:"routetable-id" yaml:"routetable-id" ini:"RouteTableID,omitempty"` - - // RoleARN is the IAM role to assume when interaction with AWS APIs. - RoleARN string `json:"role-arn" yaml:"role-arn" ini:"RoleARN,omitempty"` - - // KubernetesClusterTag is the legacy cluster id we'll use to identify our cluster resources - KubernetesClusterTag string `json:"kubernetes-cluster-tag" yaml:"kubernetes-cluster-tag" ini:"KubernetesClusterTag,omitempty"` - // KubernetesClusterID is the cluster id we'll use to identify our cluster resources - KubernetesClusterID string `json:"kubernetes-cluster-id" yaml:"kubernetes-cluster-id" ini:"KubernetesClusterID,omitempty"` - - //The aws provider creates an inbound rule per load balancer on the node security - //group. However, this can run into the AWS security group rule limit of 50 if - //many LoadBalancers are created. - // - //This flag disables the automatic ingress creation. It requires that the user - //has setup a rule that allows inbound traffic on kubelet ports from the - //local VPC subnet (so load balancers can access it). E.g. 10.82.0.0/16 30000-32000. - DisableSecurityGroupIngress bool `json:"disable-security-group-ingress" yaml:"disable-security-group-ingress" ini:"DisableSecurityGroupIngress,omitempty"` - - //AWS has a hard limit of 500 security groups. For large clusters creating a security group for each ELB - //can cause the max number of security groups to be reached. If this is set instead of creating a new - //Security group for each ELB this security group will be used instead. - ElbSecurityGroup string `json:"elb-security-group" yaml:"elb-security-group" ini:"ElbSecurityGroup,omitempty"` - - //During the instantiation of an new AWS cloud provider, the detected region - //is validated against a known set of regions. - // - //In a non-standard, AWS like environment (e.g. Eucalyptus), this check may - //be undesirable. Setting this to true will disable the check and provide - //a warning that the check was skipped. Please note that this is an - //experimental feature and work-in-progress for the moment. If you find - //yourself in an non-AWS cloud and open an issue, please indicate that in the - //issue body. - DisableStrictZoneCheck bool `json:"disable-strict-zone-check" yaml:"disable-strict-zone-check" ini:"DisableStrictZoneCheck,omitempty"` -} - -type MonitoringConfig struct { - // Monitoring server provider - Provider string `yaml:"provider" json:"provider,omitempty" norman:"default=metrics-server"` - // Metrics server options - Options map[string]string `yaml:"options" json:"options,omitempty"` - // NodeSelector key pair - NodeSelector map[string]string `yaml:"node_selector" json:"nodeSelector,omitempty"` - // Update strategy - UpdateStrategy *DeploymentStrategy `yaml:"update_strategy" json:"updateStrategy,omitempty"` - // Number of monitoring addon pods - Replicas *int32 `yaml:"replicas" json:"replicas,omitempty" norman:"default=1"` -} - -type RestoreConfig struct { - Restore bool `yaml:"restore" json:"restore,omitempty"` - SnapshotName string `yaml:"snapshot_name" json:"snapshotName,omitempty"` -} -type RotateCertificates struct { - // Rotate CA Certificates - CACertificates bool `json:"caCertificates,omitempty"` - // Services to rotate their certs - Services []string `json:"services,omitempty" norman:"type=enum,options=etcd|kubelet|kube-apiserver|kube-proxy|kube-scheduler|kube-controller-manager"` -} - -type DNSConfig struct { - // DNS provider - Provider string `yaml:"provider" json:"provider,omitempty"` - // Upstream nameservers - UpstreamNameservers []string `yaml:"upstreamnameservers" json:"upstreamnameservers,omitempty"` - // ReverseCIDRs - ReverseCIDRs []string `yaml:"reversecidrs" json:"reversecidrs,omitempty"` - // Stubdomains - StubDomains map[string][]string `yaml:"stubdomains" json:"stubdomains,omitempty"` - // NodeSelector key pair - NodeSelector map[string]string `yaml:"node_selector" json:"nodeSelector,omitempty"` - // Nodelocal DNS - Nodelocal *Nodelocal `yaml:"nodelocal" json:"nodelocal,omitempy"` - // Update strategy - UpdateStrategy *DeploymentStrategy `yaml:"update_strategy" json:"updateStrategy,omitempty"` - // Autoscaler fields to determine number of dns replicas - LinearAutoscalerParams *LinearAutoscalerParams `yaml:"linear_autoscaler_params" json:"linearAutoscalerParams,omitempty"` -} - -type Nodelocal struct { - // link-local IP for nodelocal DNS - IPAddress string `yaml:"ip_address" json:"ipAddress,omitempy"` - // Nodelocal DNS daemonset upgrade strategy - UpdateStrategy *DaemonSetUpdateStrategy `yaml:"update_strategy" json:"updateStrategy,omitempty"` - // NodeSelector key pair - NodeSelector map[string]string `yaml:"node_selector" json:"nodeSelector,omitempty"` -} - -// LinearAutoscalerParams contains fields expected by the cluster-proportional-autoscaler https://github.com/kubernetes-incubator/cluster-proportional-autoscaler/blob/0c61e63fc81449abdd52315aa27179a17e5d1580/pkg/autoscaler/controller/linearcontroller/linear_controller.go#L50 -type LinearAutoscalerParams struct { - CoresPerReplica float64 `yaml:"cores_per_replica" json:"coresPerReplica,omitempty" norman:"default=128"` - NodesPerReplica float64 `yaml:"nodes_per_replica" json:"nodesPerReplica,omitempty" norman:"default=4"` - Min int `yaml:"min" json:"min,omitempty" norman:"default=1"` - Max int `yaml:"max" json:"max,omitempty"` - PreventSinglePointFailure bool `yaml:"prevent_single_point_failure" json:"preventSinglePointFailure,omitempty" norman:"default=true"` -} - -type RKETaint struct { - Key string `json:"key,omitempty" yaml:"key"` - Value string `json:"value,omitempty" yaml:"value"` - Effect v1.TaintEffect `json:"effect,omitempty" yaml:"effect"` - TimeAdded *metav1.Time `json:"timeAdded,omitempty" yaml:"timeAdded,omitempty"` -} - -type SecretsEncryptionConfig struct { - // Enable/disable secrets encryption provider config - Enabled bool `yaml:"enabled" json:"enabled,omitempty"` - // Custom Encryption Provider configuration object - CustomConfig *apiserverconfig.EncryptionConfiguration `yaml:"custom_config" json:"customConfig,omitempty" norman:"type=map[json]"` -} diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/schema_types.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/schema_types.go deleted file mode 100644 index a7783d73..00000000 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/schema_types.go +++ /dev/null @@ -1,77 +0,0 @@ -package v3 - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -type DynamicSchema struct { - metav1.TypeMeta `json:",inline"` - // Standard object’s metadata. More info: - // https://github.com/kubernetes/community/blob/master/contributors/devel/api-conventions.md#metadata - metav1.ObjectMeta `json:"metadata,omitempty"` - // Specification of the desired behavior of the the cluster. More info: - // https://github.com/kubernetes/community/blob/master/contributors/devel/api-conventions.md#spec-and-status - Spec DynamicSchemaSpec `json:"spec"` - // Most recent observed status of the cluster. More info: - // https://github.com/kubernetes/community/blob/master/contributors/devel/api-conventions.md#spec-and-status - Status DynamicSchemaStatus `json:"status"` -} - -type DynamicSchemaSpec struct { - SchemaName string `json:"schemaName,omitempty"` - Embed bool `json:"embed,omitempty"` - EmbedType string `json:"embedType,omitempty"` - PluralName string `json:"pluralName,omitempty"` - ResourceMethods []string `json:"resourceMethods,omitempty"` - ResourceFields map[string]Field `json:"resourceFields,omitempty"` - ResourceActions map[string]Action `json:"resourceActions,omitempty"` - CollectionMethods []string `json:"collectionMethods,omitempty"` - CollectionFields map[string]Field `json:"collectionFields,omitempty"` - CollectionActions map[string]Action `json:"collectionActions,omitempty"` - CollectionFilters map[string]Filter `json:"collectionFilters,omitempty"` - IncludeableLinks []string `json:"includeableLinks,omitempty"` - DynamicSchemaVersion string `json:"dynamicSchemaVersion,omitempty"` -} - -type DynamicSchemaStatus struct { - Fake string `json:"fake,omitempty"` -} - -type Field struct { - Type string `json:"type,omitempty"` - Default Values `json:"default,omitempty"` - Unique bool `json:"unique,omitempty"` - Nullable bool `json:"nullable,omitempty"` - Create bool `json:"create,omitempty"` - Required bool `json:"required,omitempty"` - Update bool `json:"update,omitempty"` - MinLength int64 `json:"minLength,omitempty"` - MaxLength int64 `json:"maxLength,omitempty"` - Min int64 `json:"min,omitempty"` - Max int64 `json:"max,omitempty"` - Options []string `json:"options,omitempty"` - ValidChars string `json:"validChars,omitempty"` - InvalidChars string `json:"invalidChars,omitempty"` - Description string `json:"description,omitempty"` - DynamicField bool `json:"dynamicField,omitempty"` -} - -type Values struct { - StringValue string `json:"stringValue"` - IntValue int `json:"intValue"` - BoolValue bool `json:"boolValue"` - StringSliceValue []string `json:"stringSliceValue"` -} - -type Action struct { - Input string `json:"input,omitempty"` - Output string `json:"output,omitempty"` -} - -type Filter struct { - Modifiers []string `json:"modifiers,omitempty"` -} - -type ListOpts struct { - Filters map[string]string `json:"filters,omitempty"` -} diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/tools_system_images.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/tools_system_images.go deleted file mode 100644 index 045b7397..00000000 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/tools_system_images.go +++ /dev/null @@ -1,29 +0,0 @@ -package v3 - -import ( - projectv3 "github.com/rancher/types/apis/project.cattle.io/v3" - "github.com/rancher/types/image" -) - -var ( - m = image.Mirror - - ToolsSystemImages = struct { - PipelineSystemImages projectv3.PipelineSystemImages - AuthSystemImages AuthSystemImages - }{ - PipelineSystemImages: projectv3.PipelineSystemImages{ - Jenkins: m("rancher/pipeline-jenkins-server:v0.1.4"), - JenkinsJnlp: m("jenkins/jnlp-slave:3.35-4"), - AlpineGit: m("rancher/pipeline-tools:v0.1.14"), - PluginsDocker: m("plugins/docker:18.09"), - Minio: m("minio/minio:RELEASE.2019-09-25T18-25-51Z"), - Registry: m("registry:2"), - RegistryProxy: m("rancher/pipeline-tools:v0.1.14"), - KubeApply: m("rancher/pipeline-tools:v0.1.14"), - }, - AuthSystemImages: AuthSystemImages{ - KubeAPIAuth: m("rancher/kube-api-auth:v0.1.4"), - }, - } -) diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/update_strategy_types.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/update_strategy_types.go deleted file mode 100644 index 0f019b70..00000000 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/update_strategy_types.go +++ /dev/null @@ -1,38 +0,0 @@ -package v3 - -import ( - appsv1 "k8s.io/api/apps/v1" -) - -/* All fields in this file are copied over from apps/v1. Referencing k8s fields caused problems because of the "Type" field in -DeploymentStrategy and DaemonSetUpdateStrategy*/ - -// DeploymentStrategy describes how to replace existing pods with new ones. -type DeploymentStrategy struct { - // Type of deployment. Can be "Recreate" or "RollingUpdate". Default is RollingUpdate. - // +optional - Strategy appsv1.DeploymentStrategyType `json:"strategy,omitempty" protobuf:"bytes,1,opt,name=type,casttype=DeploymentStrategyType"` - - // Rolling update config params. Present only if DeploymentStrategyType = - // RollingUpdate. - //--- - // TODO: Update this to follow our convention for oneOf, whatever we decide it - // to be. - // +optional - RollingUpdate *appsv1.RollingUpdateDeployment `json:"rollingUpdate,omitempty" protobuf:"bytes,2,opt,name=rollingUpdate"` -} - -// DaemonSetUpdateStrategy is a struct used to control the update strategy for a DaemonSet. -type DaemonSetUpdateStrategy struct { - // Type of daemon set update. Can be "RollingUpdate" or "OnDelete". Default is RollingUpdate. - // +optional - Strategy appsv1.DaemonSetUpdateStrategyType `json:"strategy,omitempty" protobuf:"bytes,1,opt,name=type"` - - // Rolling update config params. Present only if type = "RollingUpdate". - //--- - // TODO: Update this to follow our convention for oneOf, whatever we decide it - // to be. Same as Deployment `strategy.rollingUpdate`. - // See https://github.com/kubernetes/kubernetes/issues/35345 - // +optional - RollingUpdate *appsv1.RollingUpdateDaemonSet `json:"rollingUpdate,omitempty" protobuf:"bytes,2,opt,name=rollingUpdate"` -} diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/user_types.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/user_types.go deleted file mode 100644 index c8aadb9d..00000000 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/user_types.go +++ /dev/null @@ -1,15 +0,0 @@ -package v3 - -import ( - "github.com/rancher/norman/types" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -type Preference struct { - types.Namespaced - - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - Value string `json:"value" norman:"required"` -} diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/windows_types.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/windows_types.go deleted file mode 100644 index 2ce56120..00000000 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/windows_types.go +++ /dev/null @@ -1,16 +0,0 @@ -package v3 - -type WindowsSystemImages struct { - // Windows nginx-proxy image - NginxProxy string `yaml:"nginx_proxy" json:"nginxProxy,omitempty"` - // Kubernetes binaries image - KubernetesBinaries string `yaml:"kubernetes_binaries" json:"kubernetesBinaries,omitempty"` - // Kubelet pause image - KubeletPause string `yaml:"kubelet_pause" json:"kubeletPause,omitempty"` - // Flannel CNI binaries image - FlannelCNIBinaries string `yaml:"flannel_cni_binaries" json:"flannelCniBinaries,omitempty"` - // Calico CNI binaries image - CalicoCNIBinaries string `yaml:"calico_cni_binaries" json:"calicoCniBinaries,omitempty"` - // Canal CNI binaries image - CanalCNIBinaries string `yaml:"canal_cni_binaries" json:"canalCniBinaries,omitempty"` -} diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_auth_config_controller.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_auth_config_controller.go deleted file mode 100644 index 90f64ff7..00000000 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_auth_config_controller.go +++ /dev/null @@ -1,320 +0,0 @@ -package v3 - -import ( - "context" - "time" - - "github.com/rancher/norman/controller" - "github.com/rancher/norman/objectclient" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/apimachinery/pkg/types" - "k8s.io/apimachinery/pkg/watch" - "k8s.io/client-go/tools/cache" -) - -var ( - AuthConfigGroupVersionKind = schema.GroupVersionKind{ - Version: Version, - Group: GroupName, - Kind: "AuthConfig", - } - AuthConfigResource = metav1.APIResource{ - Name: "authconfigs", - SingularName: "authconfig", - Namespaced: false, - Kind: AuthConfigGroupVersionKind.Kind, - } - - AuthConfigGroupVersionResource = schema.GroupVersionResource{ - Group: GroupName, - Version: Version, - Resource: "authconfigs", - } -) - -func init() { - resource.Put(AuthConfigGroupVersionResource) -} - -func NewAuthConfig(namespace, name string, obj AuthConfig) *AuthConfig { - obj.APIVersion, obj.Kind = AuthConfigGroupVersionKind.ToAPIVersionAndKind() - obj.Name = name - obj.Namespace = namespace - return &obj -} - -type AuthConfigList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []AuthConfig `json:"items"` -} - -type AuthConfigHandlerFunc func(key string, obj *AuthConfig) (runtime.Object, error) - -type AuthConfigChangeHandlerFunc func(obj *AuthConfig) (runtime.Object, error) - -type AuthConfigLister interface { - List(namespace string, selector labels.Selector) (ret []*AuthConfig, err error) - Get(namespace, name string) (*AuthConfig, error) -} - -type AuthConfigController interface { - Generic() controller.GenericController - Informer() cache.SharedIndexInformer - Lister() AuthConfigLister - AddHandler(ctx context.Context, name string, handler AuthConfigHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync AuthConfigHandlerFunc) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, handler AuthConfigHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, handler AuthConfigHandlerFunc) - Enqueue(namespace, name string) - EnqueueAfter(namespace, name string, after time.Duration) -} - -type AuthConfigInterface interface { - ObjectClient() *objectclient.ObjectClient - Create(*AuthConfig) (*AuthConfig, error) - GetNamespaced(namespace, name string, opts metav1.GetOptions) (*AuthConfig, error) - Get(name string, opts metav1.GetOptions) (*AuthConfig, error) - Update(*AuthConfig) (*AuthConfig, error) - Delete(name string, options *metav1.DeleteOptions) error - DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error - List(opts metav1.ListOptions) (*AuthConfigList, error) - ListNamespaced(namespace string, opts metav1.ListOptions) (*AuthConfigList, error) - Watch(opts metav1.ListOptions) (watch.Interface, error) - DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error - Controller() AuthConfigController - AddHandler(ctx context.Context, name string, sync AuthConfigHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync AuthConfigHandlerFunc) - AddLifecycle(ctx context.Context, name string, lifecycle AuthConfigLifecycle) - AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle AuthConfigLifecycle) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync AuthConfigHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync AuthConfigHandlerFunc) - AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle AuthConfigLifecycle) - AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle AuthConfigLifecycle) -} - -type authConfigLister struct { - controller *authConfigController -} - -func (l *authConfigLister) List(namespace string, selector labels.Selector) (ret []*AuthConfig, err error) { - err = cache.ListAllByNamespace(l.controller.Informer().GetIndexer(), namespace, selector, func(obj interface{}) { - ret = append(ret, obj.(*AuthConfig)) - }) - return -} - -func (l *authConfigLister) Get(namespace, name string) (*AuthConfig, error) { - var key string - if namespace != "" { - key = namespace + "/" + name - } else { - key = name - } - obj, exists, err := l.controller.Informer().GetIndexer().GetByKey(key) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(schema.GroupResource{ - Group: AuthConfigGroupVersionKind.Group, - Resource: AuthConfigGroupVersionResource.Resource, - }, key) - } - return obj.(*AuthConfig), nil -} - -type authConfigController struct { - controller.GenericController -} - -func (c *authConfigController) Generic() controller.GenericController { - return c.GenericController -} - -func (c *authConfigController) Lister() AuthConfigLister { - return &authConfigLister{ - controller: c, - } -} - -func (c *authConfigController) AddHandler(ctx context.Context, name string, handler AuthConfigHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*AuthConfig); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *authConfigController) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, handler AuthConfigHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*AuthConfig); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *authConfigController) AddClusterScopedHandler(ctx context.Context, name, cluster string, handler AuthConfigHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*AuthConfig); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *authConfigController) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, cluster string, handler AuthConfigHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*AuthConfig); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -type authConfigFactory struct { -} - -func (c authConfigFactory) Object() runtime.Object { - return &AuthConfig{} -} - -func (c authConfigFactory) List() runtime.Object { - return &AuthConfigList{} -} - -func (s *authConfigClient) Controller() AuthConfigController { - genericController := controller.NewGenericController(AuthConfigGroupVersionKind.Kind+"Controller", - s.client.controllerFactory.ForResourceKind(AuthConfigGroupVersionResource, AuthConfigGroupVersionKind.Kind, false)) - - return &authConfigController{ - GenericController: genericController, - } -} - -type authConfigClient struct { - client *Client - ns string - objectClient *objectclient.ObjectClient - controller AuthConfigController -} - -func (s *authConfigClient) ObjectClient() *objectclient.ObjectClient { - return s.objectClient -} - -func (s *authConfigClient) Create(o *AuthConfig) (*AuthConfig, error) { - obj, err := s.objectClient.Create(o) - return obj.(*AuthConfig), err -} - -func (s *authConfigClient) Get(name string, opts metav1.GetOptions) (*AuthConfig, error) { - obj, err := s.objectClient.Get(name, opts) - return obj.(*AuthConfig), err -} - -func (s *authConfigClient) GetNamespaced(namespace, name string, opts metav1.GetOptions) (*AuthConfig, error) { - obj, err := s.objectClient.GetNamespaced(namespace, name, opts) - return obj.(*AuthConfig), err -} - -func (s *authConfigClient) Update(o *AuthConfig) (*AuthConfig, error) { - obj, err := s.objectClient.Update(o.Name, o) - return obj.(*AuthConfig), err -} - -func (s *authConfigClient) UpdateStatus(o *AuthConfig) (*AuthConfig, error) { - obj, err := s.objectClient.UpdateStatus(o.Name, o) - return obj.(*AuthConfig), err -} - -func (s *authConfigClient) Delete(name string, options *metav1.DeleteOptions) error { - return s.objectClient.Delete(name, options) -} - -func (s *authConfigClient) DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error { - return s.objectClient.DeleteNamespaced(namespace, name, options) -} - -func (s *authConfigClient) List(opts metav1.ListOptions) (*AuthConfigList, error) { - obj, err := s.objectClient.List(opts) - return obj.(*AuthConfigList), err -} - -func (s *authConfigClient) ListNamespaced(namespace string, opts metav1.ListOptions) (*AuthConfigList, error) { - obj, err := s.objectClient.ListNamespaced(namespace, opts) - return obj.(*AuthConfigList), err -} - -func (s *authConfigClient) Watch(opts metav1.ListOptions) (watch.Interface, error) { - return s.objectClient.Watch(opts) -} - -// Patch applies the patch and returns the patched deployment. -func (s *authConfigClient) Patch(o *AuthConfig, patchType types.PatchType, data []byte, subresources ...string) (*AuthConfig, error) { - obj, err := s.objectClient.Patch(o.Name, o, patchType, data, subresources...) - return obj.(*AuthConfig), err -} - -func (s *authConfigClient) DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error { - return s.objectClient.DeleteCollection(deleteOpts, listOpts) -} - -func (s *authConfigClient) AddHandler(ctx context.Context, name string, sync AuthConfigHandlerFunc) { - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *authConfigClient) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync AuthConfigHandlerFunc) { - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *authConfigClient) AddLifecycle(ctx context.Context, name string, lifecycle AuthConfigLifecycle) { - sync := NewAuthConfigLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *authConfigClient) AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle AuthConfigLifecycle) { - sync := NewAuthConfigLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *authConfigClient) AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync AuthConfigHandlerFunc) { - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *authConfigClient) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync AuthConfigHandlerFunc) { - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} - -func (s *authConfigClient) AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle AuthConfigLifecycle) { - sync := NewAuthConfigLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *authConfigClient) AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle AuthConfigLifecycle) { - sync := NewAuthConfigLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_auth_config_lifecycle_adapter.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_auth_config_lifecycle_adapter.go deleted file mode 100644 index 6f941782..00000000 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_auth_config_lifecycle_adapter.go +++ /dev/null @@ -1,66 +0,0 @@ -package v3 - -import ( - "github.com/rancher/norman/lifecycle" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/runtime" -) - -type AuthConfigLifecycle interface { - Create(obj *AuthConfig) (runtime.Object, error) - Remove(obj *AuthConfig) (runtime.Object, error) - Updated(obj *AuthConfig) (runtime.Object, error) -} - -type authConfigLifecycleAdapter struct { - lifecycle AuthConfigLifecycle -} - -func (w *authConfigLifecycleAdapter) HasCreate() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasCreate() -} - -func (w *authConfigLifecycleAdapter) HasFinalize() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasFinalize() -} - -func (w *authConfigLifecycleAdapter) Create(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Create(obj.(*AuthConfig)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *authConfigLifecycleAdapter) Finalize(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Remove(obj.(*AuthConfig)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *authConfigLifecycleAdapter) Updated(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Updated(obj.(*AuthConfig)) - if o == nil { - return nil, err - } - return o, err -} - -func NewAuthConfigLifecycleAdapter(name string, clusterScoped bool, client AuthConfigInterface, l AuthConfigLifecycle) AuthConfigHandlerFunc { - if clusterScoped { - resource.PutClusterScoped(AuthConfigGroupVersionResource) - } - adapter := &authConfigLifecycleAdapter{lifecycle: l} - syncFn := lifecycle.NewObjectLifecycleAdapter(name, clusterScoped, adapter, client.ObjectClient()) - return func(key string, obj *AuthConfig) (runtime.Object, error) { - newObj, err := syncFn(key, obj) - if o, ok := newObj.(runtime.Object); ok { - return o, err - } - return nil, err - } -} diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_catalog_controller.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_catalog_controller.go deleted file mode 100644 index bee22148..00000000 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_catalog_controller.go +++ /dev/null @@ -1,320 +0,0 @@ -package v3 - -import ( - "context" - "time" - - "github.com/rancher/norman/controller" - "github.com/rancher/norman/objectclient" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/apimachinery/pkg/types" - "k8s.io/apimachinery/pkg/watch" - "k8s.io/client-go/tools/cache" -) - -var ( - CatalogGroupVersionKind = schema.GroupVersionKind{ - Version: Version, - Group: GroupName, - Kind: "Catalog", - } - CatalogResource = metav1.APIResource{ - Name: "catalogs", - SingularName: "catalog", - Namespaced: false, - Kind: CatalogGroupVersionKind.Kind, - } - - CatalogGroupVersionResource = schema.GroupVersionResource{ - Group: GroupName, - Version: Version, - Resource: "catalogs", - } -) - -func init() { - resource.Put(CatalogGroupVersionResource) -} - -func NewCatalog(namespace, name string, obj Catalog) *Catalog { - obj.APIVersion, obj.Kind = CatalogGroupVersionKind.ToAPIVersionAndKind() - obj.Name = name - obj.Namespace = namespace - return &obj -} - -type CatalogList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []Catalog `json:"items"` -} - -type CatalogHandlerFunc func(key string, obj *Catalog) (runtime.Object, error) - -type CatalogChangeHandlerFunc func(obj *Catalog) (runtime.Object, error) - -type CatalogLister interface { - List(namespace string, selector labels.Selector) (ret []*Catalog, err error) - Get(namespace, name string) (*Catalog, error) -} - -type CatalogController interface { - Generic() controller.GenericController - Informer() cache.SharedIndexInformer - Lister() CatalogLister - AddHandler(ctx context.Context, name string, handler CatalogHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync CatalogHandlerFunc) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, handler CatalogHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, handler CatalogHandlerFunc) - Enqueue(namespace, name string) - EnqueueAfter(namespace, name string, after time.Duration) -} - -type CatalogInterface interface { - ObjectClient() *objectclient.ObjectClient - Create(*Catalog) (*Catalog, error) - GetNamespaced(namespace, name string, opts metav1.GetOptions) (*Catalog, error) - Get(name string, opts metav1.GetOptions) (*Catalog, error) - Update(*Catalog) (*Catalog, error) - Delete(name string, options *metav1.DeleteOptions) error - DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error - List(opts metav1.ListOptions) (*CatalogList, error) - ListNamespaced(namespace string, opts metav1.ListOptions) (*CatalogList, error) - Watch(opts metav1.ListOptions) (watch.Interface, error) - DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error - Controller() CatalogController - AddHandler(ctx context.Context, name string, sync CatalogHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync CatalogHandlerFunc) - AddLifecycle(ctx context.Context, name string, lifecycle CatalogLifecycle) - AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle CatalogLifecycle) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync CatalogHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync CatalogHandlerFunc) - AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle CatalogLifecycle) - AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle CatalogLifecycle) -} - -type catalogLister struct { - controller *catalogController -} - -func (l *catalogLister) List(namespace string, selector labels.Selector) (ret []*Catalog, err error) { - err = cache.ListAllByNamespace(l.controller.Informer().GetIndexer(), namespace, selector, func(obj interface{}) { - ret = append(ret, obj.(*Catalog)) - }) - return -} - -func (l *catalogLister) Get(namespace, name string) (*Catalog, error) { - var key string - if namespace != "" { - key = namespace + "/" + name - } else { - key = name - } - obj, exists, err := l.controller.Informer().GetIndexer().GetByKey(key) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(schema.GroupResource{ - Group: CatalogGroupVersionKind.Group, - Resource: CatalogGroupVersionResource.Resource, - }, key) - } - return obj.(*Catalog), nil -} - -type catalogController struct { - controller.GenericController -} - -func (c *catalogController) Generic() controller.GenericController { - return c.GenericController -} - -func (c *catalogController) Lister() CatalogLister { - return &catalogLister{ - controller: c, - } -} - -func (c *catalogController) AddHandler(ctx context.Context, name string, handler CatalogHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*Catalog); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *catalogController) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, handler CatalogHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*Catalog); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *catalogController) AddClusterScopedHandler(ctx context.Context, name, cluster string, handler CatalogHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*Catalog); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *catalogController) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, cluster string, handler CatalogHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*Catalog); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -type catalogFactory struct { -} - -func (c catalogFactory) Object() runtime.Object { - return &Catalog{} -} - -func (c catalogFactory) List() runtime.Object { - return &CatalogList{} -} - -func (s *catalogClient) Controller() CatalogController { - genericController := controller.NewGenericController(CatalogGroupVersionKind.Kind+"Controller", - s.client.controllerFactory.ForResourceKind(CatalogGroupVersionResource, CatalogGroupVersionKind.Kind, false)) - - return &catalogController{ - GenericController: genericController, - } -} - -type catalogClient struct { - client *Client - ns string - objectClient *objectclient.ObjectClient - controller CatalogController -} - -func (s *catalogClient) ObjectClient() *objectclient.ObjectClient { - return s.objectClient -} - -func (s *catalogClient) Create(o *Catalog) (*Catalog, error) { - obj, err := s.objectClient.Create(o) - return obj.(*Catalog), err -} - -func (s *catalogClient) Get(name string, opts metav1.GetOptions) (*Catalog, error) { - obj, err := s.objectClient.Get(name, opts) - return obj.(*Catalog), err -} - -func (s *catalogClient) GetNamespaced(namespace, name string, opts metav1.GetOptions) (*Catalog, error) { - obj, err := s.objectClient.GetNamespaced(namespace, name, opts) - return obj.(*Catalog), err -} - -func (s *catalogClient) Update(o *Catalog) (*Catalog, error) { - obj, err := s.objectClient.Update(o.Name, o) - return obj.(*Catalog), err -} - -func (s *catalogClient) UpdateStatus(o *Catalog) (*Catalog, error) { - obj, err := s.objectClient.UpdateStatus(o.Name, o) - return obj.(*Catalog), err -} - -func (s *catalogClient) Delete(name string, options *metav1.DeleteOptions) error { - return s.objectClient.Delete(name, options) -} - -func (s *catalogClient) DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error { - return s.objectClient.DeleteNamespaced(namespace, name, options) -} - -func (s *catalogClient) List(opts metav1.ListOptions) (*CatalogList, error) { - obj, err := s.objectClient.List(opts) - return obj.(*CatalogList), err -} - -func (s *catalogClient) ListNamespaced(namespace string, opts metav1.ListOptions) (*CatalogList, error) { - obj, err := s.objectClient.ListNamespaced(namespace, opts) - return obj.(*CatalogList), err -} - -func (s *catalogClient) Watch(opts metav1.ListOptions) (watch.Interface, error) { - return s.objectClient.Watch(opts) -} - -// Patch applies the patch and returns the patched deployment. -func (s *catalogClient) Patch(o *Catalog, patchType types.PatchType, data []byte, subresources ...string) (*Catalog, error) { - obj, err := s.objectClient.Patch(o.Name, o, patchType, data, subresources...) - return obj.(*Catalog), err -} - -func (s *catalogClient) DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error { - return s.objectClient.DeleteCollection(deleteOpts, listOpts) -} - -func (s *catalogClient) AddHandler(ctx context.Context, name string, sync CatalogHandlerFunc) { - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *catalogClient) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync CatalogHandlerFunc) { - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *catalogClient) AddLifecycle(ctx context.Context, name string, lifecycle CatalogLifecycle) { - sync := NewCatalogLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *catalogClient) AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle CatalogLifecycle) { - sync := NewCatalogLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *catalogClient) AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync CatalogHandlerFunc) { - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *catalogClient) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync CatalogHandlerFunc) { - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} - -func (s *catalogClient) AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle CatalogLifecycle) { - sync := NewCatalogLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *catalogClient) AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle CatalogLifecycle) { - sync := NewCatalogLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_catalog_lifecycle_adapter.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_catalog_lifecycle_adapter.go deleted file mode 100644 index 6704e439..00000000 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_catalog_lifecycle_adapter.go +++ /dev/null @@ -1,66 +0,0 @@ -package v3 - -import ( - "github.com/rancher/norman/lifecycle" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/runtime" -) - -type CatalogLifecycle interface { - Create(obj *Catalog) (runtime.Object, error) - Remove(obj *Catalog) (runtime.Object, error) - Updated(obj *Catalog) (runtime.Object, error) -} - -type catalogLifecycleAdapter struct { - lifecycle CatalogLifecycle -} - -func (w *catalogLifecycleAdapter) HasCreate() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasCreate() -} - -func (w *catalogLifecycleAdapter) HasFinalize() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasFinalize() -} - -func (w *catalogLifecycleAdapter) Create(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Create(obj.(*Catalog)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *catalogLifecycleAdapter) Finalize(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Remove(obj.(*Catalog)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *catalogLifecycleAdapter) Updated(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Updated(obj.(*Catalog)) - if o == nil { - return nil, err - } - return o, err -} - -func NewCatalogLifecycleAdapter(name string, clusterScoped bool, client CatalogInterface, l CatalogLifecycle) CatalogHandlerFunc { - if clusterScoped { - resource.PutClusterScoped(CatalogGroupVersionResource) - } - adapter := &catalogLifecycleAdapter{lifecycle: l} - syncFn := lifecycle.NewObjectLifecycleAdapter(name, clusterScoped, adapter, client.ObjectClient()) - return func(key string, obj *Catalog) (runtime.Object, error) { - newObj, err := syncFn(key, obj) - if o, ok := newObj.(runtime.Object); ok { - return o, err - } - return nil, err - } -} diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_catalog_template_controller.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_catalog_template_controller.go deleted file mode 100644 index 59f69b43..00000000 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_catalog_template_controller.go +++ /dev/null @@ -1,321 +0,0 @@ -package v3 - -import ( - "context" - "time" - - "github.com/rancher/norman/controller" - "github.com/rancher/norman/objectclient" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/apimachinery/pkg/types" - "k8s.io/apimachinery/pkg/watch" - "k8s.io/client-go/tools/cache" -) - -var ( - CatalogTemplateGroupVersionKind = schema.GroupVersionKind{ - Version: Version, - Group: GroupName, - Kind: "CatalogTemplate", - } - CatalogTemplateResource = metav1.APIResource{ - Name: "catalogtemplates", - SingularName: "catalogtemplate", - Namespaced: true, - - Kind: CatalogTemplateGroupVersionKind.Kind, - } - - CatalogTemplateGroupVersionResource = schema.GroupVersionResource{ - Group: GroupName, - Version: Version, - Resource: "catalogtemplates", - } -) - -func init() { - resource.Put(CatalogTemplateGroupVersionResource) -} - -func NewCatalogTemplate(namespace, name string, obj CatalogTemplate) *CatalogTemplate { - obj.APIVersion, obj.Kind = CatalogTemplateGroupVersionKind.ToAPIVersionAndKind() - obj.Name = name - obj.Namespace = namespace - return &obj -} - -type CatalogTemplateList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []CatalogTemplate `json:"items"` -} - -type CatalogTemplateHandlerFunc func(key string, obj *CatalogTemplate) (runtime.Object, error) - -type CatalogTemplateChangeHandlerFunc func(obj *CatalogTemplate) (runtime.Object, error) - -type CatalogTemplateLister interface { - List(namespace string, selector labels.Selector) (ret []*CatalogTemplate, err error) - Get(namespace, name string) (*CatalogTemplate, error) -} - -type CatalogTemplateController interface { - Generic() controller.GenericController - Informer() cache.SharedIndexInformer - Lister() CatalogTemplateLister - AddHandler(ctx context.Context, name string, handler CatalogTemplateHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync CatalogTemplateHandlerFunc) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, handler CatalogTemplateHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, handler CatalogTemplateHandlerFunc) - Enqueue(namespace, name string) - EnqueueAfter(namespace, name string, after time.Duration) -} - -type CatalogTemplateInterface interface { - ObjectClient() *objectclient.ObjectClient - Create(*CatalogTemplate) (*CatalogTemplate, error) - GetNamespaced(namespace, name string, opts metav1.GetOptions) (*CatalogTemplate, error) - Get(name string, opts metav1.GetOptions) (*CatalogTemplate, error) - Update(*CatalogTemplate) (*CatalogTemplate, error) - Delete(name string, options *metav1.DeleteOptions) error - DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error - List(opts metav1.ListOptions) (*CatalogTemplateList, error) - ListNamespaced(namespace string, opts metav1.ListOptions) (*CatalogTemplateList, error) - Watch(opts metav1.ListOptions) (watch.Interface, error) - DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error - Controller() CatalogTemplateController - AddHandler(ctx context.Context, name string, sync CatalogTemplateHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync CatalogTemplateHandlerFunc) - AddLifecycle(ctx context.Context, name string, lifecycle CatalogTemplateLifecycle) - AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle CatalogTemplateLifecycle) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync CatalogTemplateHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync CatalogTemplateHandlerFunc) - AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle CatalogTemplateLifecycle) - AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle CatalogTemplateLifecycle) -} - -type catalogTemplateLister struct { - controller *catalogTemplateController -} - -func (l *catalogTemplateLister) List(namespace string, selector labels.Selector) (ret []*CatalogTemplate, err error) { - err = cache.ListAllByNamespace(l.controller.Informer().GetIndexer(), namespace, selector, func(obj interface{}) { - ret = append(ret, obj.(*CatalogTemplate)) - }) - return -} - -func (l *catalogTemplateLister) Get(namespace, name string) (*CatalogTemplate, error) { - var key string - if namespace != "" { - key = namespace + "/" + name - } else { - key = name - } - obj, exists, err := l.controller.Informer().GetIndexer().GetByKey(key) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(schema.GroupResource{ - Group: CatalogTemplateGroupVersionKind.Group, - Resource: CatalogTemplateGroupVersionResource.Resource, - }, key) - } - return obj.(*CatalogTemplate), nil -} - -type catalogTemplateController struct { - controller.GenericController -} - -func (c *catalogTemplateController) Generic() controller.GenericController { - return c.GenericController -} - -func (c *catalogTemplateController) Lister() CatalogTemplateLister { - return &catalogTemplateLister{ - controller: c, - } -} - -func (c *catalogTemplateController) AddHandler(ctx context.Context, name string, handler CatalogTemplateHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*CatalogTemplate); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *catalogTemplateController) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, handler CatalogTemplateHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*CatalogTemplate); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *catalogTemplateController) AddClusterScopedHandler(ctx context.Context, name, cluster string, handler CatalogTemplateHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*CatalogTemplate); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *catalogTemplateController) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, cluster string, handler CatalogTemplateHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*CatalogTemplate); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -type catalogTemplateFactory struct { -} - -func (c catalogTemplateFactory) Object() runtime.Object { - return &CatalogTemplate{} -} - -func (c catalogTemplateFactory) List() runtime.Object { - return &CatalogTemplateList{} -} - -func (s *catalogTemplateClient) Controller() CatalogTemplateController { - genericController := controller.NewGenericController(CatalogTemplateGroupVersionKind.Kind+"Controller", - s.client.controllerFactory.ForResourceKind(CatalogTemplateGroupVersionResource, CatalogTemplateGroupVersionKind.Kind, true)) - - return &catalogTemplateController{ - GenericController: genericController, - } -} - -type catalogTemplateClient struct { - client *Client - ns string - objectClient *objectclient.ObjectClient - controller CatalogTemplateController -} - -func (s *catalogTemplateClient) ObjectClient() *objectclient.ObjectClient { - return s.objectClient -} - -func (s *catalogTemplateClient) Create(o *CatalogTemplate) (*CatalogTemplate, error) { - obj, err := s.objectClient.Create(o) - return obj.(*CatalogTemplate), err -} - -func (s *catalogTemplateClient) Get(name string, opts metav1.GetOptions) (*CatalogTemplate, error) { - obj, err := s.objectClient.Get(name, opts) - return obj.(*CatalogTemplate), err -} - -func (s *catalogTemplateClient) GetNamespaced(namespace, name string, opts metav1.GetOptions) (*CatalogTemplate, error) { - obj, err := s.objectClient.GetNamespaced(namespace, name, opts) - return obj.(*CatalogTemplate), err -} - -func (s *catalogTemplateClient) Update(o *CatalogTemplate) (*CatalogTemplate, error) { - obj, err := s.objectClient.Update(o.Name, o) - return obj.(*CatalogTemplate), err -} - -func (s *catalogTemplateClient) UpdateStatus(o *CatalogTemplate) (*CatalogTemplate, error) { - obj, err := s.objectClient.UpdateStatus(o.Name, o) - return obj.(*CatalogTemplate), err -} - -func (s *catalogTemplateClient) Delete(name string, options *metav1.DeleteOptions) error { - return s.objectClient.Delete(name, options) -} - -func (s *catalogTemplateClient) DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error { - return s.objectClient.DeleteNamespaced(namespace, name, options) -} - -func (s *catalogTemplateClient) List(opts metav1.ListOptions) (*CatalogTemplateList, error) { - obj, err := s.objectClient.List(opts) - return obj.(*CatalogTemplateList), err -} - -func (s *catalogTemplateClient) ListNamespaced(namespace string, opts metav1.ListOptions) (*CatalogTemplateList, error) { - obj, err := s.objectClient.ListNamespaced(namespace, opts) - return obj.(*CatalogTemplateList), err -} - -func (s *catalogTemplateClient) Watch(opts metav1.ListOptions) (watch.Interface, error) { - return s.objectClient.Watch(opts) -} - -// Patch applies the patch and returns the patched deployment. -func (s *catalogTemplateClient) Patch(o *CatalogTemplate, patchType types.PatchType, data []byte, subresources ...string) (*CatalogTemplate, error) { - obj, err := s.objectClient.Patch(o.Name, o, patchType, data, subresources...) - return obj.(*CatalogTemplate), err -} - -func (s *catalogTemplateClient) DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error { - return s.objectClient.DeleteCollection(deleteOpts, listOpts) -} - -func (s *catalogTemplateClient) AddHandler(ctx context.Context, name string, sync CatalogTemplateHandlerFunc) { - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *catalogTemplateClient) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync CatalogTemplateHandlerFunc) { - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *catalogTemplateClient) AddLifecycle(ctx context.Context, name string, lifecycle CatalogTemplateLifecycle) { - sync := NewCatalogTemplateLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *catalogTemplateClient) AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle CatalogTemplateLifecycle) { - sync := NewCatalogTemplateLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *catalogTemplateClient) AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync CatalogTemplateHandlerFunc) { - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *catalogTemplateClient) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync CatalogTemplateHandlerFunc) { - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} - -func (s *catalogTemplateClient) AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle CatalogTemplateLifecycle) { - sync := NewCatalogTemplateLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *catalogTemplateClient) AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle CatalogTemplateLifecycle) { - sync := NewCatalogTemplateLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_catalog_template_lifecycle_adapter.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_catalog_template_lifecycle_adapter.go deleted file mode 100644 index c7510f33..00000000 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_catalog_template_lifecycle_adapter.go +++ /dev/null @@ -1,66 +0,0 @@ -package v3 - -import ( - "github.com/rancher/norman/lifecycle" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/runtime" -) - -type CatalogTemplateLifecycle interface { - Create(obj *CatalogTemplate) (runtime.Object, error) - Remove(obj *CatalogTemplate) (runtime.Object, error) - Updated(obj *CatalogTemplate) (runtime.Object, error) -} - -type catalogTemplateLifecycleAdapter struct { - lifecycle CatalogTemplateLifecycle -} - -func (w *catalogTemplateLifecycleAdapter) HasCreate() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasCreate() -} - -func (w *catalogTemplateLifecycleAdapter) HasFinalize() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasFinalize() -} - -func (w *catalogTemplateLifecycleAdapter) Create(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Create(obj.(*CatalogTemplate)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *catalogTemplateLifecycleAdapter) Finalize(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Remove(obj.(*CatalogTemplate)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *catalogTemplateLifecycleAdapter) Updated(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Updated(obj.(*CatalogTemplate)) - if o == nil { - return nil, err - } - return o, err -} - -func NewCatalogTemplateLifecycleAdapter(name string, clusterScoped bool, client CatalogTemplateInterface, l CatalogTemplateLifecycle) CatalogTemplateHandlerFunc { - if clusterScoped { - resource.PutClusterScoped(CatalogTemplateGroupVersionResource) - } - adapter := &catalogTemplateLifecycleAdapter{lifecycle: l} - syncFn := lifecycle.NewObjectLifecycleAdapter(name, clusterScoped, adapter, client.ObjectClient()) - return func(key string, obj *CatalogTemplate) (runtime.Object, error) { - newObj, err := syncFn(key, obj) - if o, ok := newObj.(runtime.Object); ok { - return o, err - } - return nil, err - } -} diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_catalog_template_version_controller.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_catalog_template_version_controller.go deleted file mode 100644 index 3cb8283c..00000000 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_catalog_template_version_controller.go +++ /dev/null @@ -1,321 +0,0 @@ -package v3 - -import ( - "context" - "time" - - "github.com/rancher/norman/controller" - "github.com/rancher/norman/objectclient" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/apimachinery/pkg/types" - "k8s.io/apimachinery/pkg/watch" - "k8s.io/client-go/tools/cache" -) - -var ( - CatalogTemplateVersionGroupVersionKind = schema.GroupVersionKind{ - Version: Version, - Group: GroupName, - Kind: "CatalogTemplateVersion", - } - CatalogTemplateVersionResource = metav1.APIResource{ - Name: "catalogtemplateversions", - SingularName: "catalogtemplateversion", - Namespaced: true, - - Kind: CatalogTemplateVersionGroupVersionKind.Kind, - } - - CatalogTemplateVersionGroupVersionResource = schema.GroupVersionResource{ - Group: GroupName, - Version: Version, - Resource: "catalogtemplateversions", - } -) - -func init() { - resource.Put(CatalogTemplateVersionGroupVersionResource) -} - -func NewCatalogTemplateVersion(namespace, name string, obj CatalogTemplateVersion) *CatalogTemplateVersion { - obj.APIVersion, obj.Kind = CatalogTemplateVersionGroupVersionKind.ToAPIVersionAndKind() - obj.Name = name - obj.Namespace = namespace - return &obj -} - -type CatalogTemplateVersionList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []CatalogTemplateVersion `json:"items"` -} - -type CatalogTemplateVersionHandlerFunc func(key string, obj *CatalogTemplateVersion) (runtime.Object, error) - -type CatalogTemplateVersionChangeHandlerFunc func(obj *CatalogTemplateVersion) (runtime.Object, error) - -type CatalogTemplateVersionLister interface { - List(namespace string, selector labels.Selector) (ret []*CatalogTemplateVersion, err error) - Get(namespace, name string) (*CatalogTemplateVersion, error) -} - -type CatalogTemplateVersionController interface { - Generic() controller.GenericController - Informer() cache.SharedIndexInformer - Lister() CatalogTemplateVersionLister - AddHandler(ctx context.Context, name string, handler CatalogTemplateVersionHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync CatalogTemplateVersionHandlerFunc) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, handler CatalogTemplateVersionHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, handler CatalogTemplateVersionHandlerFunc) - Enqueue(namespace, name string) - EnqueueAfter(namespace, name string, after time.Duration) -} - -type CatalogTemplateVersionInterface interface { - ObjectClient() *objectclient.ObjectClient - Create(*CatalogTemplateVersion) (*CatalogTemplateVersion, error) - GetNamespaced(namespace, name string, opts metav1.GetOptions) (*CatalogTemplateVersion, error) - Get(name string, opts metav1.GetOptions) (*CatalogTemplateVersion, error) - Update(*CatalogTemplateVersion) (*CatalogTemplateVersion, error) - Delete(name string, options *metav1.DeleteOptions) error - DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error - List(opts metav1.ListOptions) (*CatalogTemplateVersionList, error) - ListNamespaced(namespace string, opts metav1.ListOptions) (*CatalogTemplateVersionList, error) - Watch(opts metav1.ListOptions) (watch.Interface, error) - DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error - Controller() CatalogTemplateVersionController - AddHandler(ctx context.Context, name string, sync CatalogTemplateVersionHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync CatalogTemplateVersionHandlerFunc) - AddLifecycle(ctx context.Context, name string, lifecycle CatalogTemplateVersionLifecycle) - AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle CatalogTemplateVersionLifecycle) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync CatalogTemplateVersionHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync CatalogTemplateVersionHandlerFunc) - AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle CatalogTemplateVersionLifecycle) - AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle CatalogTemplateVersionLifecycle) -} - -type catalogTemplateVersionLister struct { - controller *catalogTemplateVersionController -} - -func (l *catalogTemplateVersionLister) List(namespace string, selector labels.Selector) (ret []*CatalogTemplateVersion, err error) { - err = cache.ListAllByNamespace(l.controller.Informer().GetIndexer(), namespace, selector, func(obj interface{}) { - ret = append(ret, obj.(*CatalogTemplateVersion)) - }) - return -} - -func (l *catalogTemplateVersionLister) Get(namespace, name string) (*CatalogTemplateVersion, error) { - var key string - if namespace != "" { - key = namespace + "/" + name - } else { - key = name - } - obj, exists, err := l.controller.Informer().GetIndexer().GetByKey(key) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(schema.GroupResource{ - Group: CatalogTemplateVersionGroupVersionKind.Group, - Resource: CatalogTemplateVersionGroupVersionResource.Resource, - }, key) - } - return obj.(*CatalogTemplateVersion), nil -} - -type catalogTemplateVersionController struct { - controller.GenericController -} - -func (c *catalogTemplateVersionController) Generic() controller.GenericController { - return c.GenericController -} - -func (c *catalogTemplateVersionController) Lister() CatalogTemplateVersionLister { - return &catalogTemplateVersionLister{ - controller: c, - } -} - -func (c *catalogTemplateVersionController) AddHandler(ctx context.Context, name string, handler CatalogTemplateVersionHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*CatalogTemplateVersion); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *catalogTemplateVersionController) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, handler CatalogTemplateVersionHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*CatalogTemplateVersion); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *catalogTemplateVersionController) AddClusterScopedHandler(ctx context.Context, name, cluster string, handler CatalogTemplateVersionHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*CatalogTemplateVersion); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *catalogTemplateVersionController) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, cluster string, handler CatalogTemplateVersionHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*CatalogTemplateVersion); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -type catalogTemplateVersionFactory struct { -} - -func (c catalogTemplateVersionFactory) Object() runtime.Object { - return &CatalogTemplateVersion{} -} - -func (c catalogTemplateVersionFactory) List() runtime.Object { - return &CatalogTemplateVersionList{} -} - -func (s *catalogTemplateVersionClient) Controller() CatalogTemplateVersionController { - genericController := controller.NewGenericController(CatalogTemplateVersionGroupVersionKind.Kind+"Controller", - s.client.controllerFactory.ForResourceKind(CatalogTemplateVersionGroupVersionResource, CatalogTemplateVersionGroupVersionKind.Kind, true)) - - return &catalogTemplateVersionController{ - GenericController: genericController, - } -} - -type catalogTemplateVersionClient struct { - client *Client - ns string - objectClient *objectclient.ObjectClient - controller CatalogTemplateVersionController -} - -func (s *catalogTemplateVersionClient) ObjectClient() *objectclient.ObjectClient { - return s.objectClient -} - -func (s *catalogTemplateVersionClient) Create(o *CatalogTemplateVersion) (*CatalogTemplateVersion, error) { - obj, err := s.objectClient.Create(o) - return obj.(*CatalogTemplateVersion), err -} - -func (s *catalogTemplateVersionClient) Get(name string, opts metav1.GetOptions) (*CatalogTemplateVersion, error) { - obj, err := s.objectClient.Get(name, opts) - return obj.(*CatalogTemplateVersion), err -} - -func (s *catalogTemplateVersionClient) GetNamespaced(namespace, name string, opts metav1.GetOptions) (*CatalogTemplateVersion, error) { - obj, err := s.objectClient.GetNamespaced(namespace, name, opts) - return obj.(*CatalogTemplateVersion), err -} - -func (s *catalogTemplateVersionClient) Update(o *CatalogTemplateVersion) (*CatalogTemplateVersion, error) { - obj, err := s.objectClient.Update(o.Name, o) - return obj.(*CatalogTemplateVersion), err -} - -func (s *catalogTemplateVersionClient) UpdateStatus(o *CatalogTemplateVersion) (*CatalogTemplateVersion, error) { - obj, err := s.objectClient.UpdateStatus(o.Name, o) - return obj.(*CatalogTemplateVersion), err -} - -func (s *catalogTemplateVersionClient) Delete(name string, options *metav1.DeleteOptions) error { - return s.objectClient.Delete(name, options) -} - -func (s *catalogTemplateVersionClient) DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error { - return s.objectClient.DeleteNamespaced(namespace, name, options) -} - -func (s *catalogTemplateVersionClient) List(opts metav1.ListOptions) (*CatalogTemplateVersionList, error) { - obj, err := s.objectClient.List(opts) - return obj.(*CatalogTemplateVersionList), err -} - -func (s *catalogTemplateVersionClient) ListNamespaced(namespace string, opts metav1.ListOptions) (*CatalogTemplateVersionList, error) { - obj, err := s.objectClient.ListNamespaced(namespace, opts) - return obj.(*CatalogTemplateVersionList), err -} - -func (s *catalogTemplateVersionClient) Watch(opts metav1.ListOptions) (watch.Interface, error) { - return s.objectClient.Watch(opts) -} - -// Patch applies the patch and returns the patched deployment. -func (s *catalogTemplateVersionClient) Patch(o *CatalogTemplateVersion, patchType types.PatchType, data []byte, subresources ...string) (*CatalogTemplateVersion, error) { - obj, err := s.objectClient.Patch(o.Name, o, patchType, data, subresources...) - return obj.(*CatalogTemplateVersion), err -} - -func (s *catalogTemplateVersionClient) DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error { - return s.objectClient.DeleteCollection(deleteOpts, listOpts) -} - -func (s *catalogTemplateVersionClient) AddHandler(ctx context.Context, name string, sync CatalogTemplateVersionHandlerFunc) { - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *catalogTemplateVersionClient) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync CatalogTemplateVersionHandlerFunc) { - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *catalogTemplateVersionClient) AddLifecycle(ctx context.Context, name string, lifecycle CatalogTemplateVersionLifecycle) { - sync := NewCatalogTemplateVersionLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *catalogTemplateVersionClient) AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle CatalogTemplateVersionLifecycle) { - sync := NewCatalogTemplateVersionLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *catalogTemplateVersionClient) AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync CatalogTemplateVersionHandlerFunc) { - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *catalogTemplateVersionClient) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync CatalogTemplateVersionHandlerFunc) { - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} - -func (s *catalogTemplateVersionClient) AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle CatalogTemplateVersionLifecycle) { - sync := NewCatalogTemplateVersionLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *catalogTemplateVersionClient) AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle CatalogTemplateVersionLifecycle) { - sync := NewCatalogTemplateVersionLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_catalog_template_version_lifecycle_adapter.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_catalog_template_version_lifecycle_adapter.go deleted file mode 100644 index d1abf2a0..00000000 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_catalog_template_version_lifecycle_adapter.go +++ /dev/null @@ -1,66 +0,0 @@ -package v3 - -import ( - "github.com/rancher/norman/lifecycle" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/runtime" -) - -type CatalogTemplateVersionLifecycle interface { - Create(obj *CatalogTemplateVersion) (runtime.Object, error) - Remove(obj *CatalogTemplateVersion) (runtime.Object, error) - Updated(obj *CatalogTemplateVersion) (runtime.Object, error) -} - -type catalogTemplateVersionLifecycleAdapter struct { - lifecycle CatalogTemplateVersionLifecycle -} - -func (w *catalogTemplateVersionLifecycleAdapter) HasCreate() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasCreate() -} - -func (w *catalogTemplateVersionLifecycleAdapter) HasFinalize() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasFinalize() -} - -func (w *catalogTemplateVersionLifecycleAdapter) Create(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Create(obj.(*CatalogTemplateVersion)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *catalogTemplateVersionLifecycleAdapter) Finalize(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Remove(obj.(*CatalogTemplateVersion)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *catalogTemplateVersionLifecycleAdapter) Updated(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Updated(obj.(*CatalogTemplateVersion)) - if o == nil { - return nil, err - } - return o, err -} - -func NewCatalogTemplateVersionLifecycleAdapter(name string, clusterScoped bool, client CatalogTemplateVersionInterface, l CatalogTemplateVersionLifecycle) CatalogTemplateVersionHandlerFunc { - if clusterScoped { - resource.PutClusterScoped(CatalogTemplateVersionGroupVersionResource) - } - adapter := &catalogTemplateVersionLifecycleAdapter{lifecycle: l} - syncFn := lifecycle.NewObjectLifecycleAdapter(name, clusterScoped, adapter, client.ObjectClient()) - return func(key string, obj *CatalogTemplateVersion) (runtime.Object, error) { - newObj, err := syncFn(key, obj) - if o, ok := newObj.(runtime.Object); ok { - return o, err - } - return nil, err - } -} diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_cis_benchmark_version_controller.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_cis_benchmark_version_controller.go deleted file mode 100644 index e7eafcde..00000000 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_cis_benchmark_version_controller.go +++ /dev/null @@ -1,321 +0,0 @@ -package v3 - -import ( - "context" - "time" - - "github.com/rancher/norman/controller" - "github.com/rancher/norman/objectclient" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/apimachinery/pkg/types" - "k8s.io/apimachinery/pkg/watch" - "k8s.io/client-go/tools/cache" -) - -var ( - CisBenchmarkVersionGroupVersionKind = schema.GroupVersionKind{ - Version: Version, - Group: GroupName, - Kind: "CisBenchmarkVersion", - } - CisBenchmarkVersionResource = metav1.APIResource{ - Name: "cisbenchmarkversions", - SingularName: "cisbenchmarkversion", - Namespaced: true, - - Kind: CisBenchmarkVersionGroupVersionKind.Kind, - } - - CisBenchmarkVersionGroupVersionResource = schema.GroupVersionResource{ - Group: GroupName, - Version: Version, - Resource: "cisbenchmarkversions", - } -) - -func init() { - resource.Put(CisBenchmarkVersionGroupVersionResource) -} - -func NewCisBenchmarkVersion(namespace, name string, obj CisBenchmarkVersion) *CisBenchmarkVersion { - obj.APIVersion, obj.Kind = CisBenchmarkVersionGroupVersionKind.ToAPIVersionAndKind() - obj.Name = name - obj.Namespace = namespace - return &obj -} - -type CisBenchmarkVersionList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []CisBenchmarkVersion `json:"items"` -} - -type CisBenchmarkVersionHandlerFunc func(key string, obj *CisBenchmarkVersion) (runtime.Object, error) - -type CisBenchmarkVersionChangeHandlerFunc func(obj *CisBenchmarkVersion) (runtime.Object, error) - -type CisBenchmarkVersionLister interface { - List(namespace string, selector labels.Selector) (ret []*CisBenchmarkVersion, err error) - Get(namespace, name string) (*CisBenchmarkVersion, error) -} - -type CisBenchmarkVersionController interface { - Generic() controller.GenericController - Informer() cache.SharedIndexInformer - Lister() CisBenchmarkVersionLister - AddHandler(ctx context.Context, name string, handler CisBenchmarkVersionHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync CisBenchmarkVersionHandlerFunc) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, handler CisBenchmarkVersionHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, handler CisBenchmarkVersionHandlerFunc) - Enqueue(namespace, name string) - EnqueueAfter(namespace, name string, after time.Duration) -} - -type CisBenchmarkVersionInterface interface { - ObjectClient() *objectclient.ObjectClient - Create(*CisBenchmarkVersion) (*CisBenchmarkVersion, error) - GetNamespaced(namespace, name string, opts metav1.GetOptions) (*CisBenchmarkVersion, error) - Get(name string, opts metav1.GetOptions) (*CisBenchmarkVersion, error) - Update(*CisBenchmarkVersion) (*CisBenchmarkVersion, error) - Delete(name string, options *metav1.DeleteOptions) error - DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error - List(opts metav1.ListOptions) (*CisBenchmarkVersionList, error) - ListNamespaced(namespace string, opts metav1.ListOptions) (*CisBenchmarkVersionList, error) - Watch(opts metav1.ListOptions) (watch.Interface, error) - DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error - Controller() CisBenchmarkVersionController - AddHandler(ctx context.Context, name string, sync CisBenchmarkVersionHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync CisBenchmarkVersionHandlerFunc) - AddLifecycle(ctx context.Context, name string, lifecycle CisBenchmarkVersionLifecycle) - AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle CisBenchmarkVersionLifecycle) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync CisBenchmarkVersionHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync CisBenchmarkVersionHandlerFunc) - AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle CisBenchmarkVersionLifecycle) - AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle CisBenchmarkVersionLifecycle) -} - -type cisBenchmarkVersionLister struct { - controller *cisBenchmarkVersionController -} - -func (l *cisBenchmarkVersionLister) List(namespace string, selector labels.Selector) (ret []*CisBenchmarkVersion, err error) { - err = cache.ListAllByNamespace(l.controller.Informer().GetIndexer(), namespace, selector, func(obj interface{}) { - ret = append(ret, obj.(*CisBenchmarkVersion)) - }) - return -} - -func (l *cisBenchmarkVersionLister) Get(namespace, name string) (*CisBenchmarkVersion, error) { - var key string - if namespace != "" { - key = namespace + "/" + name - } else { - key = name - } - obj, exists, err := l.controller.Informer().GetIndexer().GetByKey(key) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(schema.GroupResource{ - Group: CisBenchmarkVersionGroupVersionKind.Group, - Resource: CisBenchmarkVersionGroupVersionResource.Resource, - }, key) - } - return obj.(*CisBenchmarkVersion), nil -} - -type cisBenchmarkVersionController struct { - controller.GenericController -} - -func (c *cisBenchmarkVersionController) Generic() controller.GenericController { - return c.GenericController -} - -func (c *cisBenchmarkVersionController) Lister() CisBenchmarkVersionLister { - return &cisBenchmarkVersionLister{ - controller: c, - } -} - -func (c *cisBenchmarkVersionController) AddHandler(ctx context.Context, name string, handler CisBenchmarkVersionHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*CisBenchmarkVersion); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *cisBenchmarkVersionController) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, handler CisBenchmarkVersionHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*CisBenchmarkVersion); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *cisBenchmarkVersionController) AddClusterScopedHandler(ctx context.Context, name, cluster string, handler CisBenchmarkVersionHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*CisBenchmarkVersion); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *cisBenchmarkVersionController) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, cluster string, handler CisBenchmarkVersionHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*CisBenchmarkVersion); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -type cisBenchmarkVersionFactory struct { -} - -func (c cisBenchmarkVersionFactory) Object() runtime.Object { - return &CisBenchmarkVersion{} -} - -func (c cisBenchmarkVersionFactory) List() runtime.Object { - return &CisBenchmarkVersionList{} -} - -func (s *cisBenchmarkVersionClient) Controller() CisBenchmarkVersionController { - genericController := controller.NewGenericController(CisBenchmarkVersionGroupVersionKind.Kind+"Controller", - s.client.controllerFactory.ForResourceKind(CisBenchmarkVersionGroupVersionResource, CisBenchmarkVersionGroupVersionKind.Kind, true)) - - return &cisBenchmarkVersionController{ - GenericController: genericController, - } -} - -type cisBenchmarkVersionClient struct { - client *Client - ns string - objectClient *objectclient.ObjectClient - controller CisBenchmarkVersionController -} - -func (s *cisBenchmarkVersionClient) ObjectClient() *objectclient.ObjectClient { - return s.objectClient -} - -func (s *cisBenchmarkVersionClient) Create(o *CisBenchmarkVersion) (*CisBenchmarkVersion, error) { - obj, err := s.objectClient.Create(o) - return obj.(*CisBenchmarkVersion), err -} - -func (s *cisBenchmarkVersionClient) Get(name string, opts metav1.GetOptions) (*CisBenchmarkVersion, error) { - obj, err := s.objectClient.Get(name, opts) - return obj.(*CisBenchmarkVersion), err -} - -func (s *cisBenchmarkVersionClient) GetNamespaced(namespace, name string, opts metav1.GetOptions) (*CisBenchmarkVersion, error) { - obj, err := s.objectClient.GetNamespaced(namespace, name, opts) - return obj.(*CisBenchmarkVersion), err -} - -func (s *cisBenchmarkVersionClient) Update(o *CisBenchmarkVersion) (*CisBenchmarkVersion, error) { - obj, err := s.objectClient.Update(o.Name, o) - return obj.(*CisBenchmarkVersion), err -} - -func (s *cisBenchmarkVersionClient) UpdateStatus(o *CisBenchmarkVersion) (*CisBenchmarkVersion, error) { - obj, err := s.objectClient.UpdateStatus(o.Name, o) - return obj.(*CisBenchmarkVersion), err -} - -func (s *cisBenchmarkVersionClient) Delete(name string, options *metav1.DeleteOptions) error { - return s.objectClient.Delete(name, options) -} - -func (s *cisBenchmarkVersionClient) DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error { - return s.objectClient.DeleteNamespaced(namespace, name, options) -} - -func (s *cisBenchmarkVersionClient) List(opts metav1.ListOptions) (*CisBenchmarkVersionList, error) { - obj, err := s.objectClient.List(opts) - return obj.(*CisBenchmarkVersionList), err -} - -func (s *cisBenchmarkVersionClient) ListNamespaced(namespace string, opts metav1.ListOptions) (*CisBenchmarkVersionList, error) { - obj, err := s.objectClient.ListNamespaced(namespace, opts) - return obj.(*CisBenchmarkVersionList), err -} - -func (s *cisBenchmarkVersionClient) Watch(opts metav1.ListOptions) (watch.Interface, error) { - return s.objectClient.Watch(opts) -} - -// Patch applies the patch and returns the patched deployment. -func (s *cisBenchmarkVersionClient) Patch(o *CisBenchmarkVersion, patchType types.PatchType, data []byte, subresources ...string) (*CisBenchmarkVersion, error) { - obj, err := s.objectClient.Patch(o.Name, o, patchType, data, subresources...) - return obj.(*CisBenchmarkVersion), err -} - -func (s *cisBenchmarkVersionClient) DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error { - return s.objectClient.DeleteCollection(deleteOpts, listOpts) -} - -func (s *cisBenchmarkVersionClient) AddHandler(ctx context.Context, name string, sync CisBenchmarkVersionHandlerFunc) { - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *cisBenchmarkVersionClient) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync CisBenchmarkVersionHandlerFunc) { - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *cisBenchmarkVersionClient) AddLifecycle(ctx context.Context, name string, lifecycle CisBenchmarkVersionLifecycle) { - sync := NewCisBenchmarkVersionLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *cisBenchmarkVersionClient) AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle CisBenchmarkVersionLifecycle) { - sync := NewCisBenchmarkVersionLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *cisBenchmarkVersionClient) AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync CisBenchmarkVersionHandlerFunc) { - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *cisBenchmarkVersionClient) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync CisBenchmarkVersionHandlerFunc) { - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} - -func (s *cisBenchmarkVersionClient) AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle CisBenchmarkVersionLifecycle) { - sync := NewCisBenchmarkVersionLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *cisBenchmarkVersionClient) AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle CisBenchmarkVersionLifecycle) { - sync := NewCisBenchmarkVersionLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_cis_benchmark_version_lifecycle_adapter.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_cis_benchmark_version_lifecycle_adapter.go deleted file mode 100644 index 01c5d293..00000000 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_cis_benchmark_version_lifecycle_adapter.go +++ /dev/null @@ -1,66 +0,0 @@ -package v3 - -import ( - "github.com/rancher/norman/lifecycle" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/runtime" -) - -type CisBenchmarkVersionLifecycle interface { - Create(obj *CisBenchmarkVersion) (runtime.Object, error) - Remove(obj *CisBenchmarkVersion) (runtime.Object, error) - Updated(obj *CisBenchmarkVersion) (runtime.Object, error) -} - -type cisBenchmarkVersionLifecycleAdapter struct { - lifecycle CisBenchmarkVersionLifecycle -} - -func (w *cisBenchmarkVersionLifecycleAdapter) HasCreate() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasCreate() -} - -func (w *cisBenchmarkVersionLifecycleAdapter) HasFinalize() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasFinalize() -} - -func (w *cisBenchmarkVersionLifecycleAdapter) Create(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Create(obj.(*CisBenchmarkVersion)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *cisBenchmarkVersionLifecycleAdapter) Finalize(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Remove(obj.(*CisBenchmarkVersion)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *cisBenchmarkVersionLifecycleAdapter) Updated(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Updated(obj.(*CisBenchmarkVersion)) - if o == nil { - return nil, err - } - return o, err -} - -func NewCisBenchmarkVersionLifecycleAdapter(name string, clusterScoped bool, client CisBenchmarkVersionInterface, l CisBenchmarkVersionLifecycle) CisBenchmarkVersionHandlerFunc { - if clusterScoped { - resource.PutClusterScoped(CisBenchmarkVersionGroupVersionResource) - } - adapter := &cisBenchmarkVersionLifecycleAdapter{lifecycle: l} - syncFn := lifecycle.NewObjectLifecycleAdapter(name, clusterScoped, adapter, client.ObjectClient()) - return func(key string, obj *CisBenchmarkVersion) (runtime.Object, error) { - newObj, err := syncFn(key, obj) - if o, ok := newObj.(runtime.Object); ok { - return o, err - } - return nil, err - } -} diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_cis_config_controller.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_cis_config_controller.go deleted file mode 100644 index e3be34f8..00000000 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_cis_config_controller.go +++ /dev/null @@ -1,321 +0,0 @@ -package v3 - -import ( - "context" - "time" - - "github.com/rancher/norman/controller" - "github.com/rancher/norman/objectclient" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/apimachinery/pkg/types" - "k8s.io/apimachinery/pkg/watch" - "k8s.io/client-go/tools/cache" -) - -var ( - CisConfigGroupVersionKind = schema.GroupVersionKind{ - Version: Version, - Group: GroupName, - Kind: "CisConfig", - } - CisConfigResource = metav1.APIResource{ - Name: "cisconfigs", - SingularName: "cisconfig", - Namespaced: true, - - Kind: CisConfigGroupVersionKind.Kind, - } - - CisConfigGroupVersionResource = schema.GroupVersionResource{ - Group: GroupName, - Version: Version, - Resource: "cisconfigs", - } -) - -func init() { - resource.Put(CisConfigGroupVersionResource) -} - -func NewCisConfig(namespace, name string, obj CisConfig) *CisConfig { - obj.APIVersion, obj.Kind = CisConfigGroupVersionKind.ToAPIVersionAndKind() - obj.Name = name - obj.Namespace = namespace - return &obj -} - -type CisConfigList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []CisConfig `json:"items"` -} - -type CisConfigHandlerFunc func(key string, obj *CisConfig) (runtime.Object, error) - -type CisConfigChangeHandlerFunc func(obj *CisConfig) (runtime.Object, error) - -type CisConfigLister interface { - List(namespace string, selector labels.Selector) (ret []*CisConfig, err error) - Get(namespace, name string) (*CisConfig, error) -} - -type CisConfigController interface { - Generic() controller.GenericController - Informer() cache.SharedIndexInformer - Lister() CisConfigLister - AddHandler(ctx context.Context, name string, handler CisConfigHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync CisConfigHandlerFunc) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, handler CisConfigHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, handler CisConfigHandlerFunc) - Enqueue(namespace, name string) - EnqueueAfter(namespace, name string, after time.Duration) -} - -type CisConfigInterface interface { - ObjectClient() *objectclient.ObjectClient - Create(*CisConfig) (*CisConfig, error) - GetNamespaced(namespace, name string, opts metav1.GetOptions) (*CisConfig, error) - Get(name string, opts metav1.GetOptions) (*CisConfig, error) - Update(*CisConfig) (*CisConfig, error) - Delete(name string, options *metav1.DeleteOptions) error - DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error - List(opts metav1.ListOptions) (*CisConfigList, error) - ListNamespaced(namespace string, opts metav1.ListOptions) (*CisConfigList, error) - Watch(opts metav1.ListOptions) (watch.Interface, error) - DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error - Controller() CisConfigController - AddHandler(ctx context.Context, name string, sync CisConfigHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync CisConfigHandlerFunc) - AddLifecycle(ctx context.Context, name string, lifecycle CisConfigLifecycle) - AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle CisConfigLifecycle) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync CisConfigHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync CisConfigHandlerFunc) - AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle CisConfigLifecycle) - AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle CisConfigLifecycle) -} - -type cisConfigLister struct { - controller *cisConfigController -} - -func (l *cisConfigLister) List(namespace string, selector labels.Selector) (ret []*CisConfig, err error) { - err = cache.ListAllByNamespace(l.controller.Informer().GetIndexer(), namespace, selector, func(obj interface{}) { - ret = append(ret, obj.(*CisConfig)) - }) - return -} - -func (l *cisConfigLister) Get(namespace, name string) (*CisConfig, error) { - var key string - if namespace != "" { - key = namespace + "/" + name - } else { - key = name - } - obj, exists, err := l.controller.Informer().GetIndexer().GetByKey(key) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(schema.GroupResource{ - Group: CisConfigGroupVersionKind.Group, - Resource: CisConfigGroupVersionResource.Resource, - }, key) - } - return obj.(*CisConfig), nil -} - -type cisConfigController struct { - controller.GenericController -} - -func (c *cisConfigController) Generic() controller.GenericController { - return c.GenericController -} - -func (c *cisConfigController) Lister() CisConfigLister { - return &cisConfigLister{ - controller: c, - } -} - -func (c *cisConfigController) AddHandler(ctx context.Context, name string, handler CisConfigHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*CisConfig); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *cisConfigController) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, handler CisConfigHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*CisConfig); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *cisConfigController) AddClusterScopedHandler(ctx context.Context, name, cluster string, handler CisConfigHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*CisConfig); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *cisConfigController) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, cluster string, handler CisConfigHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*CisConfig); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -type cisConfigFactory struct { -} - -func (c cisConfigFactory) Object() runtime.Object { - return &CisConfig{} -} - -func (c cisConfigFactory) List() runtime.Object { - return &CisConfigList{} -} - -func (s *cisConfigClient) Controller() CisConfigController { - genericController := controller.NewGenericController(CisConfigGroupVersionKind.Kind+"Controller", - s.client.controllerFactory.ForResourceKind(CisConfigGroupVersionResource, CisConfigGroupVersionKind.Kind, true)) - - return &cisConfigController{ - GenericController: genericController, - } -} - -type cisConfigClient struct { - client *Client - ns string - objectClient *objectclient.ObjectClient - controller CisConfigController -} - -func (s *cisConfigClient) ObjectClient() *objectclient.ObjectClient { - return s.objectClient -} - -func (s *cisConfigClient) Create(o *CisConfig) (*CisConfig, error) { - obj, err := s.objectClient.Create(o) - return obj.(*CisConfig), err -} - -func (s *cisConfigClient) Get(name string, opts metav1.GetOptions) (*CisConfig, error) { - obj, err := s.objectClient.Get(name, opts) - return obj.(*CisConfig), err -} - -func (s *cisConfigClient) GetNamespaced(namespace, name string, opts metav1.GetOptions) (*CisConfig, error) { - obj, err := s.objectClient.GetNamespaced(namespace, name, opts) - return obj.(*CisConfig), err -} - -func (s *cisConfigClient) Update(o *CisConfig) (*CisConfig, error) { - obj, err := s.objectClient.Update(o.Name, o) - return obj.(*CisConfig), err -} - -func (s *cisConfigClient) UpdateStatus(o *CisConfig) (*CisConfig, error) { - obj, err := s.objectClient.UpdateStatus(o.Name, o) - return obj.(*CisConfig), err -} - -func (s *cisConfigClient) Delete(name string, options *metav1.DeleteOptions) error { - return s.objectClient.Delete(name, options) -} - -func (s *cisConfigClient) DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error { - return s.objectClient.DeleteNamespaced(namespace, name, options) -} - -func (s *cisConfigClient) List(opts metav1.ListOptions) (*CisConfigList, error) { - obj, err := s.objectClient.List(opts) - return obj.(*CisConfigList), err -} - -func (s *cisConfigClient) ListNamespaced(namespace string, opts metav1.ListOptions) (*CisConfigList, error) { - obj, err := s.objectClient.ListNamespaced(namespace, opts) - return obj.(*CisConfigList), err -} - -func (s *cisConfigClient) Watch(opts metav1.ListOptions) (watch.Interface, error) { - return s.objectClient.Watch(opts) -} - -// Patch applies the patch and returns the patched deployment. -func (s *cisConfigClient) Patch(o *CisConfig, patchType types.PatchType, data []byte, subresources ...string) (*CisConfig, error) { - obj, err := s.objectClient.Patch(o.Name, o, patchType, data, subresources...) - return obj.(*CisConfig), err -} - -func (s *cisConfigClient) DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error { - return s.objectClient.DeleteCollection(deleteOpts, listOpts) -} - -func (s *cisConfigClient) AddHandler(ctx context.Context, name string, sync CisConfigHandlerFunc) { - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *cisConfigClient) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync CisConfigHandlerFunc) { - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *cisConfigClient) AddLifecycle(ctx context.Context, name string, lifecycle CisConfigLifecycle) { - sync := NewCisConfigLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *cisConfigClient) AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle CisConfigLifecycle) { - sync := NewCisConfigLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *cisConfigClient) AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync CisConfigHandlerFunc) { - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *cisConfigClient) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync CisConfigHandlerFunc) { - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} - -func (s *cisConfigClient) AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle CisConfigLifecycle) { - sync := NewCisConfigLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *cisConfigClient) AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle CisConfigLifecycle) { - sync := NewCisConfigLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_cis_config_lifecycle_adapter.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_cis_config_lifecycle_adapter.go deleted file mode 100644 index 08e8ae27..00000000 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_cis_config_lifecycle_adapter.go +++ /dev/null @@ -1,66 +0,0 @@ -package v3 - -import ( - "github.com/rancher/norman/lifecycle" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/runtime" -) - -type CisConfigLifecycle interface { - Create(obj *CisConfig) (runtime.Object, error) - Remove(obj *CisConfig) (runtime.Object, error) - Updated(obj *CisConfig) (runtime.Object, error) -} - -type cisConfigLifecycleAdapter struct { - lifecycle CisConfigLifecycle -} - -func (w *cisConfigLifecycleAdapter) HasCreate() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasCreate() -} - -func (w *cisConfigLifecycleAdapter) HasFinalize() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasFinalize() -} - -func (w *cisConfigLifecycleAdapter) Create(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Create(obj.(*CisConfig)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *cisConfigLifecycleAdapter) Finalize(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Remove(obj.(*CisConfig)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *cisConfigLifecycleAdapter) Updated(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Updated(obj.(*CisConfig)) - if o == nil { - return nil, err - } - return o, err -} - -func NewCisConfigLifecycleAdapter(name string, clusterScoped bool, client CisConfigInterface, l CisConfigLifecycle) CisConfigHandlerFunc { - if clusterScoped { - resource.PutClusterScoped(CisConfigGroupVersionResource) - } - adapter := &cisConfigLifecycleAdapter{lifecycle: l} - syncFn := lifecycle.NewObjectLifecycleAdapter(name, clusterScoped, adapter, client.ObjectClient()) - return func(key string, obj *CisConfig) (runtime.Object, error) { - newObj, err := syncFn(key, obj) - if o, ok := newObj.(runtime.Object); ok { - return o, err - } - return nil, err - } -} diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_cloud_credential_controller.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_cloud_credential_controller.go deleted file mode 100644 index 8bec06a9..00000000 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_cloud_credential_controller.go +++ /dev/null @@ -1,321 +0,0 @@ -package v3 - -import ( - "context" - "time" - - "github.com/rancher/norman/controller" - "github.com/rancher/norman/objectclient" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/apimachinery/pkg/types" - "k8s.io/apimachinery/pkg/watch" - "k8s.io/client-go/tools/cache" -) - -var ( - CloudCredentialGroupVersionKind = schema.GroupVersionKind{ - Version: Version, - Group: GroupName, - Kind: "CloudCredential", - } - CloudCredentialResource = metav1.APIResource{ - Name: "cloudcredentials", - SingularName: "cloudcredential", - Namespaced: true, - - Kind: CloudCredentialGroupVersionKind.Kind, - } - - CloudCredentialGroupVersionResource = schema.GroupVersionResource{ - Group: GroupName, - Version: Version, - Resource: "cloudcredentials", - } -) - -func init() { - resource.Put(CloudCredentialGroupVersionResource) -} - -func NewCloudCredential(namespace, name string, obj CloudCredential) *CloudCredential { - obj.APIVersion, obj.Kind = CloudCredentialGroupVersionKind.ToAPIVersionAndKind() - obj.Name = name - obj.Namespace = namespace - return &obj -} - -type CloudCredentialList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []CloudCredential `json:"items"` -} - -type CloudCredentialHandlerFunc func(key string, obj *CloudCredential) (runtime.Object, error) - -type CloudCredentialChangeHandlerFunc func(obj *CloudCredential) (runtime.Object, error) - -type CloudCredentialLister interface { - List(namespace string, selector labels.Selector) (ret []*CloudCredential, err error) - Get(namespace, name string) (*CloudCredential, error) -} - -type CloudCredentialController interface { - Generic() controller.GenericController - Informer() cache.SharedIndexInformer - Lister() CloudCredentialLister - AddHandler(ctx context.Context, name string, handler CloudCredentialHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync CloudCredentialHandlerFunc) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, handler CloudCredentialHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, handler CloudCredentialHandlerFunc) - Enqueue(namespace, name string) - EnqueueAfter(namespace, name string, after time.Duration) -} - -type CloudCredentialInterface interface { - ObjectClient() *objectclient.ObjectClient - Create(*CloudCredential) (*CloudCredential, error) - GetNamespaced(namespace, name string, opts metav1.GetOptions) (*CloudCredential, error) - Get(name string, opts metav1.GetOptions) (*CloudCredential, error) - Update(*CloudCredential) (*CloudCredential, error) - Delete(name string, options *metav1.DeleteOptions) error - DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error - List(opts metav1.ListOptions) (*CloudCredentialList, error) - ListNamespaced(namespace string, opts metav1.ListOptions) (*CloudCredentialList, error) - Watch(opts metav1.ListOptions) (watch.Interface, error) - DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error - Controller() CloudCredentialController - AddHandler(ctx context.Context, name string, sync CloudCredentialHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync CloudCredentialHandlerFunc) - AddLifecycle(ctx context.Context, name string, lifecycle CloudCredentialLifecycle) - AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle CloudCredentialLifecycle) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync CloudCredentialHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync CloudCredentialHandlerFunc) - AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle CloudCredentialLifecycle) - AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle CloudCredentialLifecycle) -} - -type cloudCredentialLister struct { - controller *cloudCredentialController -} - -func (l *cloudCredentialLister) List(namespace string, selector labels.Selector) (ret []*CloudCredential, err error) { - err = cache.ListAllByNamespace(l.controller.Informer().GetIndexer(), namespace, selector, func(obj interface{}) { - ret = append(ret, obj.(*CloudCredential)) - }) - return -} - -func (l *cloudCredentialLister) Get(namespace, name string) (*CloudCredential, error) { - var key string - if namespace != "" { - key = namespace + "/" + name - } else { - key = name - } - obj, exists, err := l.controller.Informer().GetIndexer().GetByKey(key) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(schema.GroupResource{ - Group: CloudCredentialGroupVersionKind.Group, - Resource: CloudCredentialGroupVersionResource.Resource, - }, key) - } - return obj.(*CloudCredential), nil -} - -type cloudCredentialController struct { - controller.GenericController -} - -func (c *cloudCredentialController) Generic() controller.GenericController { - return c.GenericController -} - -func (c *cloudCredentialController) Lister() CloudCredentialLister { - return &cloudCredentialLister{ - controller: c, - } -} - -func (c *cloudCredentialController) AddHandler(ctx context.Context, name string, handler CloudCredentialHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*CloudCredential); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *cloudCredentialController) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, handler CloudCredentialHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*CloudCredential); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *cloudCredentialController) AddClusterScopedHandler(ctx context.Context, name, cluster string, handler CloudCredentialHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*CloudCredential); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *cloudCredentialController) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, cluster string, handler CloudCredentialHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*CloudCredential); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -type cloudCredentialFactory struct { -} - -func (c cloudCredentialFactory) Object() runtime.Object { - return &CloudCredential{} -} - -func (c cloudCredentialFactory) List() runtime.Object { - return &CloudCredentialList{} -} - -func (s *cloudCredentialClient) Controller() CloudCredentialController { - genericController := controller.NewGenericController(CloudCredentialGroupVersionKind.Kind+"Controller", - s.client.controllerFactory.ForResourceKind(CloudCredentialGroupVersionResource, CloudCredentialGroupVersionKind.Kind, true)) - - return &cloudCredentialController{ - GenericController: genericController, - } -} - -type cloudCredentialClient struct { - client *Client - ns string - objectClient *objectclient.ObjectClient - controller CloudCredentialController -} - -func (s *cloudCredentialClient) ObjectClient() *objectclient.ObjectClient { - return s.objectClient -} - -func (s *cloudCredentialClient) Create(o *CloudCredential) (*CloudCredential, error) { - obj, err := s.objectClient.Create(o) - return obj.(*CloudCredential), err -} - -func (s *cloudCredentialClient) Get(name string, opts metav1.GetOptions) (*CloudCredential, error) { - obj, err := s.objectClient.Get(name, opts) - return obj.(*CloudCredential), err -} - -func (s *cloudCredentialClient) GetNamespaced(namespace, name string, opts metav1.GetOptions) (*CloudCredential, error) { - obj, err := s.objectClient.GetNamespaced(namespace, name, opts) - return obj.(*CloudCredential), err -} - -func (s *cloudCredentialClient) Update(o *CloudCredential) (*CloudCredential, error) { - obj, err := s.objectClient.Update(o.Name, o) - return obj.(*CloudCredential), err -} - -func (s *cloudCredentialClient) UpdateStatus(o *CloudCredential) (*CloudCredential, error) { - obj, err := s.objectClient.UpdateStatus(o.Name, o) - return obj.(*CloudCredential), err -} - -func (s *cloudCredentialClient) Delete(name string, options *metav1.DeleteOptions) error { - return s.objectClient.Delete(name, options) -} - -func (s *cloudCredentialClient) DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error { - return s.objectClient.DeleteNamespaced(namespace, name, options) -} - -func (s *cloudCredentialClient) List(opts metav1.ListOptions) (*CloudCredentialList, error) { - obj, err := s.objectClient.List(opts) - return obj.(*CloudCredentialList), err -} - -func (s *cloudCredentialClient) ListNamespaced(namespace string, opts metav1.ListOptions) (*CloudCredentialList, error) { - obj, err := s.objectClient.ListNamespaced(namespace, opts) - return obj.(*CloudCredentialList), err -} - -func (s *cloudCredentialClient) Watch(opts metav1.ListOptions) (watch.Interface, error) { - return s.objectClient.Watch(opts) -} - -// Patch applies the patch and returns the patched deployment. -func (s *cloudCredentialClient) Patch(o *CloudCredential, patchType types.PatchType, data []byte, subresources ...string) (*CloudCredential, error) { - obj, err := s.objectClient.Patch(o.Name, o, patchType, data, subresources...) - return obj.(*CloudCredential), err -} - -func (s *cloudCredentialClient) DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error { - return s.objectClient.DeleteCollection(deleteOpts, listOpts) -} - -func (s *cloudCredentialClient) AddHandler(ctx context.Context, name string, sync CloudCredentialHandlerFunc) { - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *cloudCredentialClient) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync CloudCredentialHandlerFunc) { - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *cloudCredentialClient) AddLifecycle(ctx context.Context, name string, lifecycle CloudCredentialLifecycle) { - sync := NewCloudCredentialLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *cloudCredentialClient) AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle CloudCredentialLifecycle) { - sync := NewCloudCredentialLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *cloudCredentialClient) AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync CloudCredentialHandlerFunc) { - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *cloudCredentialClient) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync CloudCredentialHandlerFunc) { - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} - -func (s *cloudCredentialClient) AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle CloudCredentialLifecycle) { - sync := NewCloudCredentialLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *cloudCredentialClient) AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle CloudCredentialLifecycle) { - sync := NewCloudCredentialLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_cloud_credential_lifecycle_adapter.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_cloud_credential_lifecycle_adapter.go deleted file mode 100644 index 1290ebcd..00000000 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_cloud_credential_lifecycle_adapter.go +++ /dev/null @@ -1,66 +0,0 @@ -package v3 - -import ( - "github.com/rancher/norman/lifecycle" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/runtime" -) - -type CloudCredentialLifecycle interface { - Create(obj *CloudCredential) (runtime.Object, error) - Remove(obj *CloudCredential) (runtime.Object, error) - Updated(obj *CloudCredential) (runtime.Object, error) -} - -type cloudCredentialLifecycleAdapter struct { - lifecycle CloudCredentialLifecycle -} - -func (w *cloudCredentialLifecycleAdapter) HasCreate() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasCreate() -} - -func (w *cloudCredentialLifecycleAdapter) HasFinalize() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasFinalize() -} - -func (w *cloudCredentialLifecycleAdapter) Create(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Create(obj.(*CloudCredential)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *cloudCredentialLifecycleAdapter) Finalize(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Remove(obj.(*CloudCredential)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *cloudCredentialLifecycleAdapter) Updated(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Updated(obj.(*CloudCredential)) - if o == nil { - return nil, err - } - return o, err -} - -func NewCloudCredentialLifecycleAdapter(name string, clusterScoped bool, client CloudCredentialInterface, l CloudCredentialLifecycle) CloudCredentialHandlerFunc { - if clusterScoped { - resource.PutClusterScoped(CloudCredentialGroupVersionResource) - } - adapter := &cloudCredentialLifecycleAdapter{lifecycle: l} - syncFn := lifecycle.NewObjectLifecycleAdapter(name, clusterScoped, adapter, client.ObjectClient()) - return func(key string, obj *CloudCredential) (runtime.Object, error) { - newObj, err := syncFn(key, obj) - if o, ok := newObj.(runtime.Object); ok { - return o, err - } - return nil, err - } -} diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_cluster_alert_controller.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_cluster_alert_controller.go deleted file mode 100644 index 74a589dc..00000000 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_cluster_alert_controller.go +++ /dev/null @@ -1,321 +0,0 @@ -package v3 - -import ( - "context" - "time" - - "github.com/rancher/norman/controller" - "github.com/rancher/norman/objectclient" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/apimachinery/pkg/types" - "k8s.io/apimachinery/pkg/watch" - "k8s.io/client-go/tools/cache" -) - -var ( - ClusterAlertGroupVersionKind = schema.GroupVersionKind{ - Version: Version, - Group: GroupName, - Kind: "ClusterAlert", - } - ClusterAlertResource = metav1.APIResource{ - Name: "clusteralerts", - SingularName: "clusteralert", - Namespaced: true, - - Kind: ClusterAlertGroupVersionKind.Kind, - } - - ClusterAlertGroupVersionResource = schema.GroupVersionResource{ - Group: GroupName, - Version: Version, - Resource: "clusteralerts", - } -) - -func init() { - resource.Put(ClusterAlertGroupVersionResource) -} - -func NewClusterAlert(namespace, name string, obj ClusterAlert) *ClusterAlert { - obj.APIVersion, obj.Kind = ClusterAlertGroupVersionKind.ToAPIVersionAndKind() - obj.Name = name - obj.Namespace = namespace - return &obj -} - -type ClusterAlertList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []ClusterAlert `json:"items"` -} - -type ClusterAlertHandlerFunc func(key string, obj *ClusterAlert) (runtime.Object, error) - -type ClusterAlertChangeHandlerFunc func(obj *ClusterAlert) (runtime.Object, error) - -type ClusterAlertLister interface { - List(namespace string, selector labels.Selector) (ret []*ClusterAlert, err error) - Get(namespace, name string) (*ClusterAlert, error) -} - -type ClusterAlertController interface { - Generic() controller.GenericController - Informer() cache.SharedIndexInformer - Lister() ClusterAlertLister - AddHandler(ctx context.Context, name string, handler ClusterAlertHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync ClusterAlertHandlerFunc) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, handler ClusterAlertHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, handler ClusterAlertHandlerFunc) - Enqueue(namespace, name string) - EnqueueAfter(namespace, name string, after time.Duration) -} - -type ClusterAlertInterface interface { - ObjectClient() *objectclient.ObjectClient - Create(*ClusterAlert) (*ClusterAlert, error) - GetNamespaced(namespace, name string, opts metav1.GetOptions) (*ClusterAlert, error) - Get(name string, opts metav1.GetOptions) (*ClusterAlert, error) - Update(*ClusterAlert) (*ClusterAlert, error) - Delete(name string, options *metav1.DeleteOptions) error - DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error - List(opts metav1.ListOptions) (*ClusterAlertList, error) - ListNamespaced(namespace string, opts metav1.ListOptions) (*ClusterAlertList, error) - Watch(opts metav1.ListOptions) (watch.Interface, error) - DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error - Controller() ClusterAlertController - AddHandler(ctx context.Context, name string, sync ClusterAlertHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync ClusterAlertHandlerFunc) - AddLifecycle(ctx context.Context, name string, lifecycle ClusterAlertLifecycle) - AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle ClusterAlertLifecycle) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync ClusterAlertHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync ClusterAlertHandlerFunc) - AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle ClusterAlertLifecycle) - AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle ClusterAlertLifecycle) -} - -type clusterAlertLister struct { - controller *clusterAlertController -} - -func (l *clusterAlertLister) List(namespace string, selector labels.Selector) (ret []*ClusterAlert, err error) { - err = cache.ListAllByNamespace(l.controller.Informer().GetIndexer(), namespace, selector, func(obj interface{}) { - ret = append(ret, obj.(*ClusterAlert)) - }) - return -} - -func (l *clusterAlertLister) Get(namespace, name string) (*ClusterAlert, error) { - var key string - if namespace != "" { - key = namespace + "/" + name - } else { - key = name - } - obj, exists, err := l.controller.Informer().GetIndexer().GetByKey(key) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(schema.GroupResource{ - Group: ClusterAlertGroupVersionKind.Group, - Resource: ClusterAlertGroupVersionResource.Resource, - }, key) - } - return obj.(*ClusterAlert), nil -} - -type clusterAlertController struct { - controller.GenericController -} - -func (c *clusterAlertController) Generic() controller.GenericController { - return c.GenericController -} - -func (c *clusterAlertController) Lister() ClusterAlertLister { - return &clusterAlertLister{ - controller: c, - } -} - -func (c *clusterAlertController) AddHandler(ctx context.Context, name string, handler ClusterAlertHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*ClusterAlert); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *clusterAlertController) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, handler ClusterAlertHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*ClusterAlert); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *clusterAlertController) AddClusterScopedHandler(ctx context.Context, name, cluster string, handler ClusterAlertHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*ClusterAlert); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *clusterAlertController) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, cluster string, handler ClusterAlertHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*ClusterAlert); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -type clusterAlertFactory struct { -} - -func (c clusterAlertFactory) Object() runtime.Object { - return &ClusterAlert{} -} - -func (c clusterAlertFactory) List() runtime.Object { - return &ClusterAlertList{} -} - -func (s *clusterAlertClient) Controller() ClusterAlertController { - genericController := controller.NewGenericController(ClusterAlertGroupVersionKind.Kind+"Controller", - s.client.controllerFactory.ForResourceKind(ClusterAlertGroupVersionResource, ClusterAlertGroupVersionKind.Kind, true)) - - return &clusterAlertController{ - GenericController: genericController, - } -} - -type clusterAlertClient struct { - client *Client - ns string - objectClient *objectclient.ObjectClient - controller ClusterAlertController -} - -func (s *clusterAlertClient) ObjectClient() *objectclient.ObjectClient { - return s.objectClient -} - -func (s *clusterAlertClient) Create(o *ClusterAlert) (*ClusterAlert, error) { - obj, err := s.objectClient.Create(o) - return obj.(*ClusterAlert), err -} - -func (s *clusterAlertClient) Get(name string, opts metav1.GetOptions) (*ClusterAlert, error) { - obj, err := s.objectClient.Get(name, opts) - return obj.(*ClusterAlert), err -} - -func (s *clusterAlertClient) GetNamespaced(namespace, name string, opts metav1.GetOptions) (*ClusterAlert, error) { - obj, err := s.objectClient.GetNamespaced(namespace, name, opts) - return obj.(*ClusterAlert), err -} - -func (s *clusterAlertClient) Update(o *ClusterAlert) (*ClusterAlert, error) { - obj, err := s.objectClient.Update(o.Name, o) - return obj.(*ClusterAlert), err -} - -func (s *clusterAlertClient) UpdateStatus(o *ClusterAlert) (*ClusterAlert, error) { - obj, err := s.objectClient.UpdateStatus(o.Name, o) - return obj.(*ClusterAlert), err -} - -func (s *clusterAlertClient) Delete(name string, options *metav1.DeleteOptions) error { - return s.objectClient.Delete(name, options) -} - -func (s *clusterAlertClient) DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error { - return s.objectClient.DeleteNamespaced(namespace, name, options) -} - -func (s *clusterAlertClient) List(opts metav1.ListOptions) (*ClusterAlertList, error) { - obj, err := s.objectClient.List(opts) - return obj.(*ClusterAlertList), err -} - -func (s *clusterAlertClient) ListNamespaced(namespace string, opts metav1.ListOptions) (*ClusterAlertList, error) { - obj, err := s.objectClient.ListNamespaced(namespace, opts) - return obj.(*ClusterAlertList), err -} - -func (s *clusterAlertClient) Watch(opts metav1.ListOptions) (watch.Interface, error) { - return s.objectClient.Watch(opts) -} - -// Patch applies the patch and returns the patched deployment. -func (s *clusterAlertClient) Patch(o *ClusterAlert, patchType types.PatchType, data []byte, subresources ...string) (*ClusterAlert, error) { - obj, err := s.objectClient.Patch(o.Name, o, patchType, data, subresources...) - return obj.(*ClusterAlert), err -} - -func (s *clusterAlertClient) DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error { - return s.objectClient.DeleteCollection(deleteOpts, listOpts) -} - -func (s *clusterAlertClient) AddHandler(ctx context.Context, name string, sync ClusterAlertHandlerFunc) { - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *clusterAlertClient) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync ClusterAlertHandlerFunc) { - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *clusterAlertClient) AddLifecycle(ctx context.Context, name string, lifecycle ClusterAlertLifecycle) { - sync := NewClusterAlertLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *clusterAlertClient) AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle ClusterAlertLifecycle) { - sync := NewClusterAlertLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *clusterAlertClient) AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync ClusterAlertHandlerFunc) { - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *clusterAlertClient) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync ClusterAlertHandlerFunc) { - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} - -func (s *clusterAlertClient) AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle ClusterAlertLifecycle) { - sync := NewClusterAlertLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *clusterAlertClient) AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle ClusterAlertLifecycle) { - sync := NewClusterAlertLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_cluster_alert_group_controller.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_cluster_alert_group_controller.go deleted file mode 100644 index f0b1b773..00000000 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_cluster_alert_group_controller.go +++ /dev/null @@ -1,321 +0,0 @@ -package v3 - -import ( - "context" - "time" - - "github.com/rancher/norman/controller" - "github.com/rancher/norman/objectclient" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/apimachinery/pkg/types" - "k8s.io/apimachinery/pkg/watch" - "k8s.io/client-go/tools/cache" -) - -var ( - ClusterAlertGroupGroupVersionKind = schema.GroupVersionKind{ - Version: Version, - Group: GroupName, - Kind: "ClusterAlertGroup", - } - ClusterAlertGroupResource = metav1.APIResource{ - Name: "clusteralertgroups", - SingularName: "clusteralertgroup", - Namespaced: true, - - Kind: ClusterAlertGroupGroupVersionKind.Kind, - } - - ClusterAlertGroupGroupVersionResource = schema.GroupVersionResource{ - Group: GroupName, - Version: Version, - Resource: "clusteralertgroups", - } -) - -func init() { - resource.Put(ClusterAlertGroupGroupVersionResource) -} - -func NewClusterAlertGroup(namespace, name string, obj ClusterAlertGroup) *ClusterAlertGroup { - obj.APIVersion, obj.Kind = ClusterAlertGroupGroupVersionKind.ToAPIVersionAndKind() - obj.Name = name - obj.Namespace = namespace - return &obj -} - -type ClusterAlertGroupList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []ClusterAlertGroup `json:"items"` -} - -type ClusterAlertGroupHandlerFunc func(key string, obj *ClusterAlertGroup) (runtime.Object, error) - -type ClusterAlertGroupChangeHandlerFunc func(obj *ClusterAlertGroup) (runtime.Object, error) - -type ClusterAlertGroupLister interface { - List(namespace string, selector labels.Selector) (ret []*ClusterAlertGroup, err error) - Get(namespace, name string) (*ClusterAlertGroup, error) -} - -type ClusterAlertGroupController interface { - Generic() controller.GenericController - Informer() cache.SharedIndexInformer - Lister() ClusterAlertGroupLister - AddHandler(ctx context.Context, name string, handler ClusterAlertGroupHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync ClusterAlertGroupHandlerFunc) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, handler ClusterAlertGroupHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, handler ClusterAlertGroupHandlerFunc) - Enqueue(namespace, name string) - EnqueueAfter(namespace, name string, after time.Duration) -} - -type ClusterAlertGroupInterface interface { - ObjectClient() *objectclient.ObjectClient - Create(*ClusterAlertGroup) (*ClusterAlertGroup, error) - GetNamespaced(namespace, name string, opts metav1.GetOptions) (*ClusterAlertGroup, error) - Get(name string, opts metav1.GetOptions) (*ClusterAlertGroup, error) - Update(*ClusterAlertGroup) (*ClusterAlertGroup, error) - Delete(name string, options *metav1.DeleteOptions) error - DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error - List(opts metav1.ListOptions) (*ClusterAlertGroupList, error) - ListNamespaced(namespace string, opts metav1.ListOptions) (*ClusterAlertGroupList, error) - Watch(opts metav1.ListOptions) (watch.Interface, error) - DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error - Controller() ClusterAlertGroupController - AddHandler(ctx context.Context, name string, sync ClusterAlertGroupHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync ClusterAlertGroupHandlerFunc) - AddLifecycle(ctx context.Context, name string, lifecycle ClusterAlertGroupLifecycle) - AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle ClusterAlertGroupLifecycle) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync ClusterAlertGroupHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync ClusterAlertGroupHandlerFunc) - AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle ClusterAlertGroupLifecycle) - AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle ClusterAlertGroupLifecycle) -} - -type clusterAlertGroupLister struct { - controller *clusterAlertGroupController -} - -func (l *clusterAlertGroupLister) List(namespace string, selector labels.Selector) (ret []*ClusterAlertGroup, err error) { - err = cache.ListAllByNamespace(l.controller.Informer().GetIndexer(), namespace, selector, func(obj interface{}) { - ret = append(ret, obj.(*ClusterAlertGroup)) - }) - return -} - -func (l *clusterAlertGroupLister) Get(namespace, name string) (*ClusterAlertGroup, error) { - var key string - if namespace != "" { - key = namespace + "/" + name - } else { - key = name - } - obj, exists, err := l.controller.Informer().GetIndexer().GetByKey(key) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(schema.GroupResource{ - Group: ClusterAlertGroupGroupVersionKind.Group, - Resource: ClusterAlertGroupGroupVersionResource.Resource, - }, key) - } - return obj.(*ClusterAlertGroup), nil -} - -type clusterAlertGroupController struct { - controller.GenericController -} - -func (c *clusterAlertGroupController) Generic() controller.GenericController { - return c.GenericController -} - -func (c *clusterAlertGroupController) Lister() ClusterAlertGroupLister { - return &clusterAlertGroupLister{ - controller: c, - } -} - -func (c *clusterAlertGroupController) AddHandler(ctx context.Context, name string, handler ClusterAlertGroupHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*ClusterAlertGroup); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *clusterAlertGroupController) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, handler ClusterAlertGroupHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*ClusterAlertGroup); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *clusterAlertGroupController) AddClusterScopedHandler(ctx context.Context, name, cluster string, handler ClusterAlertGroupHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*ClusterAlertGroup); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *clusterAlertGroupController) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, cluster string, handler ClusterAlertGroupHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*ClusterAlertGroup); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -type clusterAlertGroupFactory struct { -} - -func (c clusterAlertGroupFactory) Object() runtime.Object { - return &ClusterAlertGroup{} -} - -func (c clusterAlertGroupFactory) List() runtime.Object { - return &ClusterAlertGroupList{} -} - -func (s *clusterAlertGroupClient) Controller() ClusterAlertGroupController { - genericController := controller.NewGenericController(ClusterAlertGroupGroupVersionKind.Kind+"Controller", - s.client.controllerFactory.ForResourceKind(ClusterAlertGroupGroupVersionResource, ClusterAlertGroupGroupVersionKind.Kind, true)) - - return &clusterAlertGroupController{ - GenericController: genericController, - } -} - -type clusterAlertGroupClient struct { - client *Client - ns string - objectClient *objectclient.ObjectClient - controller ClusterAlertGroupController -} - -func (s *clusterAlertGroupClient) ObjectClient() *objectclient.ObjectClient { - return s.objectClient -} - -func (s *clusterAlertGroupClient) Create(o *ClusterAlertGroup) (*ClusterAlertGroup, error) { - obj, err := s.objectClient.Create(o) - return obj.(*ClusterAlertGroup), err -} - -func (s *clusterAlertGroupClient) Get(name string, opts metav1.GetOptions) (*ClusterAlertGroup, error) { - obj, err := s.objectClient.Get(name, opts) - return obj.(*ClusterAlertGroup), err -} - -func (s *clusterAlertGroupClient) GetNamespaced(namespace, name string, opts metav1.GetOptions) (*ClusterAlertGroup, error) { - obj, err := s.objectClient.GetNamespaced(namespace, name, opts) - return obj.(*ClusterAlertGroup), err -} - -func (s *clusterAlertGroupClient) Update(o *ClusterAlertGroup) (*ClusterAlertGroup, error) { - obj, err := s.objectClient.Update(o.Name, o) - return obj.(*ClusterAlertGroup), err -} - -func (s *clusterAlertGroupClient) UpdateStatus(o *ClusterAlertGroup) (*ClusterAlertGroup, error) { - obj, err := s.objectClient.UpdateStatus(o.Name, o) - return obj.(*ClusterAlertGroup), err -} - -func (s *clusterAlertGroupClient) Delete(name string, options *metav1.DeleteOptions) error { - return s.objectClient.Delete(name, options) -} - -func (s *clusterAlertGroupClient) DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error { - return s.objectClient.DeleteNamespaced(namespace, name, options) -} - -func (s *clusterAlertGroupClient) List(opts metav1.ListOptions) (*ClusterAlertGroupList, error) { - obj, err := s.objectClient.List(opts) - return obj.(*ClusterAlertGroupList), err -} - -func (s *clusterAlertGroupClient) ListNamespaced(namespace string, opts metav1.ListOptions) (*ClusterAlertGroupList, error) { - obj, err := s.objectClient.ListNamespaced(namespace, opts) - return obj.(*ClusterAlertGroupList), err -} - -func (s *clusterAlertGroupClient) Watch(opts metav1.ListOptions) (watch.Interface, error) { - return s.objectClient.Watch(opts) -} - -// Patch applies the patch and returns the patched deployment. -func (s *clusterAlertGroupClient) Patch(o *ClusterAlertGroup, patchType types.PatchType, data []byte, subresources ...string) (*ClusterAlertGroup, error) { - obj, err := s.objectClient.Patch(o.Name, o, patchType, data, subresources...) - return obj.(*ClusterAlertGroup), err -} - -func (s *clusterAlertGroupClient) DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error { - return s.objectClient.DeleteCollection(deleteOpts, listOpts) -} - -func (s *clusterAlertGroupClient) AddHandler(ctx context.Context, name string, sync ClusterAlertGroupHandlerFunc) { - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *clusterAlertGroupClient) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync ClusterAlertGroupHandlerFunc) { - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *clusterAlertGroupClient) AddLifecycle(ctx context.Context, name string, lifecycle ClusterAlertGroupLifecycle) { - sync := NewClusterAlertGroupLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *clusterAlertGroupClient) AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle ClusterAlertGroupLifecycle) { - sync := NewClusterAlertGroupLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *clusterAlertGroupClient) AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync ClusterAlertGroupHandlerFunc) { - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *clusterAlertGroupClient) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync ClusterAlertGroupHandlerFunc) { - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} - -func (s *clusterAlertGroupClient) AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle ClusterAlertGroupLifecycle) { - sync := NewClusterAlertGroupLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *clusterAlertGroupClient) AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle ClusterAlertGroupLifecycle) { - sync := NewClusterAlertGroupLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_cluster_alert_group_lifecycle_adapter.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_cluster_alert_group_lifecycle_adapter.go deleted file mode 100644 index 708d1afe..00000000 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_cluster_alert_group_lifecycle_adapter.go +++ /dev/null @@ -1,66 +0,0 @@ -package v3 - -import ( - "github.com/rancher/norman/lifecycle" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/runtime" -) - -type ClusterAlertGroupLifecycle interface { - Create(obj *ClusterAlertGroup) (runtime.Object, error) - Remove(obj *ClusterAlertGroup) (runtime.Object, error) - Updated(obj *ClusterAlertGroup) (runtime.Object, error) -} - -type clusterAlertGroupLifecycleAdapter struct { - lifecycle ClusterAlertGroupLifecycle -} - -func (w *clusterAlertGroupLifecycleAdapter) HasCreate() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasCreate() -} - -func (w *clusterAlertGroupLifecycleAdapter) HasFinalize() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasFinalize() -} - -func (w *clusterAlertGroupLifecycleAdapter) Create(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Create(obj.(*ClusterAlertGroup)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *clusterAlertGroupLifecycleAdapter) Finalize(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Remove(obj.(*ClusterAlertGroup)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *clusterAlertGroupLifecycleAdapter) Updated(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Updated(obj.(*ClusterAlertGroup)) - if o == nil { - return nil, err - } - return o, err -} - -func NewClusterAlertGroupLifecycleAdapter(name string, clusterScoped bool, client ClusterAlertGroupInterface, l ClusterAlertGroupLifecycle) ClusterAlertGroupHandlerFunc { - if clusterScoped { - resource.PutClusterScoped(ClusterAlertGroupGroupVersionResource) - } - adapter := &clusterAlertGroupLifecycleAdapter{lifecycle: l} - syncFn := lifecycle.NewObjectLifecycleAdapter(name, clusterScoped, adapter, client.ObjectClient()) - return func(key string, obj *ClusterAlertGroup) (runtime.Object, error) { - newObj, err := syncFn(key, obj) - if o, ok := newObj.(runtime.Object); ok { - return o, err - } - return nil, err - } -} diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_cluster_alert_lifecycle_adapter.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_cluster_alert_lifecycle_adapter.go deleted file mode 100644 index 0c40e776..00000000 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_cluster_alert_lifecycle_adapter.go +++ /dev/null @@ -1,66 +0,0 @@ -package v3 - -import ( - "github.com/rancher/norman/lifecycle" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/runtime" -) - -type ClusterAlertLifecycle interface { - Create(obj *ClusterAlert) (runtime.Object, error) - Remove(obj *ClusterAlert) (runtime.Object, error) - Updated(obj *ClusterAlert) (runtime.Object, error) -} - -type clusterAlertLifecycleAdapter struct { - lifecycle ClusterAlertLifecycle -} - -func (w *clusterAlertLifecycleAdapter) HasCreate() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasCreate() -} - -func (w *clusterAlertLifecycleAdapter) HasFinalize() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasFinalize() -} - -func (w *clusterAlertLifecycleAdapter) Create(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Create(obj.(*ClusterAlert)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *clusterAlertLifecycleAdapter) Finalize(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Remove(obj.(*ClusterAlert)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *clusterAlertLifecycleAdapter) Updated(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Updated(obj.(*ClusterAlert)) - if o == nil { - return nil, err - } - return o, err -} - -func NewClusterAlertLifecycleAdapter(name string, clusterScoped bool, client ClusterAlertInterface, l ClusterAlertLifecycle) ClusterAlertHandlerFunc { - if clusterScoped { - resource.PutClusterScoped(ClusterAlertGroupVersionResource) - } - adapter := &clusterAlertLifecycleAdapter{lifecycle: l} - syncFn := lifecycle.NewObjectLifecycleAdapter(name, clusterScoped, adapter, client.ObjectClient()) - return func(key string, obj *ClusterAlert) (runtime.Object, error) { - newObj, err := syncFn(key, obj) - if o, ok := newObj.(runtime.Object); ok { - return o, err - } - return nil, err - } -} diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_cluster_alert_rule_controller.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_cluster_alert_rule_controller.go deleted file mode 100644 index 439c2fdd..00000000 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_cluster_alert_rule_controller.go +++ /dev/null @@ -1,321 +0,0 @@ -package v3 - -import ( - "context" - "time" - - "github.com/rancher/norman/controller" - "github.com/rancher/norman/objectclient" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/apimachinery/pkg/types" - "k8s.io/apimachinery/pkg/watch" - "k8s.io/client-go/tools/cache" -) - -var ( - ClusterAlertRuleGroupVersionKind = schema.GroupVersionKind{ - Version: Version, - Group: GroupName, - Kind: "ClusterAlertRule", - } - ClusterAlertRuleResource = metav1.APIResource{ - Name: "clusteralertrules", - SingularName: "clusteralertrule", - Namespaced: true, - - Kind: ClusterAlertRuleGroupVersionKind.Kind, - } - - ClusterAlertRuleGroupVersionResource = schema.GroupVersionResource{ - Group: GroupName, - Version: Version, - Resource: "clusteralertrules", - } -) - -func init() { - resource.Put(ClusterAlertRuleGroupVersionResource) -} - -func NewClusterAlertRule(namespace, name string, obj ClusterAlertRule) *ClusterAlertRule { - obj.APIVersion, obj.Kind = ClusterAlertRuleGroupVersionKind.ToAPIVersionAndKind() - obj.Name = name - obj.Namespace = namespace - return &obj -} - -type ClusterAlertRuleList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []ClusterAlertRule `json:"items"` -} - -type ClusterAlertRuleHandlerFunc func(key string, obj *ClusterAlertRule) (runtime.Object, error) - -type ClusterAlertRuleChangeHandlerFunc func(obj *ClusterAlertRule) (runtime.Object, error) - -type ClusterAlertRuleLister interface { - List(namespace string, selector labels.Selector) (ret []*ClusterAlertRule, err error) - Get(namespace, name string) (*ClusterAlertRule, error) -} - -type ClusterAlertRuleController interface { - Generic() controller.GenericController - Informer() cache.SharedIndexInformer - Lister() ClusterAlertRuleLister - AddHandler(ctx context.Context, name string, handler ClusterAlertRuleHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync ClusterAlertRuleHandlerFunc) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, handler ClusterAlertRuleHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, handler ClusterAlertRuleHandlerFunc) - Enqueue(namespace, name string) - EnqueueAfter(namespace, name string, after time.Duration) -} - -type ClusterAlertRuleInterface interface { - ObjectClient() *objectclient.ObjectClient - Create(*ClusterAlertRule) (*ClusterAlertRule, error) - GetNamespaced(namespace, name string, opts metav1.GetOptions) (*ClusterAlertRule, error) - Get(name string, opts metav1.GetOptions) (*ClusterAlertRule, error) - Update(*ClusterAlertRule) (*ClusterAlertRule, error) - Delete(name string, options *metav1.DeleteOptions) error - DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error - List(opts metav1.ListOptions) (*ClusterAlertRuleList, error) - ListNamespaced(namespace string, opts metav1.ListOptions) (*ClusterAlertRuleList, error) - Watch(opts metav1.ListOptions) (watch.Interface, error) - DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error - Controller() ClusterAlertRuleController - AddHandler(ctx context.Context, name string, sync ClusterAlertRuleHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync ClusterAlertRuleHandlerFunc) - AddLifecycle(ctx context.Context, name string, lifecycle ClusterAlertRuleLifecycle) - AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle ClusterAlertRuleLifecycle) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync ClusterAlertRuleHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync ClusterAlertRuleHandlerFunc) - AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle ClusterAlertRuleLifecycle) - AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle ClusterAlertRuleLifecycle) -} - -type clusterAlertRuleLister struct { - controller *clusterAlertRuleController -} - -func (l *clusterAlertRuleLister) List(namespace string, selector labels.Selector) (ret []*ClusterAlertRule, err error) { - err = cache.ListAllByNamespace(l.controller.Informer().GetIndexer(), namespace, selector, func(obj interface{}) { - ret = append(ret, obj.(*ClusterAlertRule)) - }) - return -} - -func (l *clusterAlertRuleLister) Get(namespace, name string) (*ClusterAlertRule, error) { - var key string - if namespace != "" { - key = namespace + "/" + name - } else { - key = name - } - obj, exists, err := l.controller.Informer().GetIndexer().GetByKey(key) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(schema.GroupResource{ - Group: ClusterAlertRuleGroupVersionKind.Group, - Resource: ClusterAlertRuleGroupVersionResource.Resource, - }, key) - } - return obj.(*ClusterAlertRule), nil -} - -type clusterAlertRuleController struct { - controller.GenericController -} - -func (c *clusterAlertRuleController) Generic() controller.GenericController { - return c.GenericController -} - -func (c *clusterAlertRuleController) Lister() ClusterAlertRuleLister { - return &clusterAlertRuleLister{ - controller: c, - } -} - -func (c *clusterAlertRuleController) AddHandler(ctx context.Context, name string, handler ClusterAlertRuleHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*ClusterAlertRule); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *clusterAlertRuleController) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, handler ClusterAlertRuleHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*ClusterAlertRule); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *clusterAlertRuleController) AddClusterScopedHandler(ctx context.Context, name, cluster string, handler ClusterAlertRuleHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*ClusterAlertRule); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *clusterAlertRuleController) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, cluster string, handler ClusterAlertRuleHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*ClusterAlertRule); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -type clusterAlertRuleFactory struct { -} - -func (c clusterAlertRuleFactory) Object() runtime.Object { - return &ClusterAlertRule{} -} - -func (c clusterAlertRuleFactory) List() runtime.Object { - return &ClusterAlertRuleList{} -} - -func (s *clusterAlertRuleClient) Controller() ClusterAlertRuleController { - genericController := controller.NewGenericController(ClusterAlertRuleGroupVersionKind.Kind+"Controller", - s.client.controllerFactory.ForResourceKind(ClusterAlertRuleGroupVersionResource, ClusterAlertRuleGroupVersionKind.Kind, true)) - - return &clusterAlertRuleController{ - GenericController: genericController, - } -} - -type clusterAlertRuleClient struct { - client *Client - ns string - objectClient *objectclient.ObjectClient - controller ClusterAlertRuleController -} - -func (s *clusterAlertRuleClient) ObjectClient() *objectclient.ObjectClient { - return s.objectClient -} - -func (s *clusterAlertRuleClient) Create(o *ClusterAlertRule) (*ClusterAlertRule, error) { - obj, err := s.objectClient.Create(o) - return obj.(*ClusterAlertRule), err -} - -func (s *clusterAlertRuleClient) Get(name string, opts metav1.GetOptions) (*ClusterAlertRule, error) { - obj, err := s.objectClient.Get(name, opts) - return obj.(*ClusterAlertRule), err -} - -func (s *clusterAlertRuleClient) GetNamespaced(namespace, name string, opts metav1.GetOptions) (*ClusterAlertRule, error) { - obj, err := s.objectClient.GetNamespaced(namespace, name, opts) - return obj.(*ClusterAlertRule), err -} - -func (s *clusterAlertRuleClient) Update(o *ClusterAlertRule) (*ClusterAlertRule, error) { - obj, err := s.objectClient.Update(o.Name, o) - return obj.(*ClusterAlertRule), err -} - -func (s *clusterAlertRuleClient) UpdateStatus(o *ClusterAlertRule) (*ClusterAlertRule, error) { - obj, err := s.objectClient.UpdateStatus(o.Name, o) - return obj.(*ClusterAlertRule), err -} - -func (s *clusterAlertRuleClient) Delete(name string, options *metav1.DeleteOptions) error { - return s.objectClient.Delete(name, options) -} - -func (s *clusterAlertRuleClient) DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error { - return s.objectClient.DeleteNamespaced(namespace, name, options) -} - -func (s *clusterAlertRuleClient) List(opts metav1.ListOptions) (*ClusterAlertRuleList, error) { - obj, err := s.objectClient.List(opts) - return obj.(*ClusterAlertRuleList), err -} - -func (s *clusterAlertRuleClient) ListNamespaced(namespace string, opts metav1.ListOptions) (*ClusterAlertRuleList, error) { - obj, err := s.objectClient.ListNamespaced(namespace, opts) - return obj.(*ClusterAlertRuleList), err -} - -func (s *clusterAlertRuleClient) Watch(opts metav1.ListOptions) (watch.Interface, error) { - return s.objectClient.Watch(opts) -} - -// Patch applies the patch and returns the patched deployment. -func (s *clusterAlertRuleClient) Patch(o *ClusterAlertRule, patchType types.PatchType, data []byte, subresources ...string) (*ClusterAlertRule, error) { - obj, err := s.objectClient.Patch(o.Name, o, patchType, data, subresources...) - return obj.(*ClusterAlertRule), err -} - -func (s *clusterAlertRuleClient) DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error { - return s.objectClient.DeleteCollection(deleteOpts, listOpts) -} - -func (s *clusterAlertRuleClient) AddHandler(ctx context.Context, name string, sync ClusterAlertRuleHandlerFunc) { - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *clusterAlertRuleClient) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync ClusterAlertRuleHandlerFunc) { - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *clusterAlertRuleClient) AddLifecycle(ctx context.Context, name string, lifecycle ClusterAlertRuleLifecycle) { - sync := NewClusterAlertRuleLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *clusterAlertRuleClient) AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle ClusterAlertRuleLifecycle) { - sync := NewClusterAlertRuleLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *clusterAlertRuleClient) AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync ClusterAlertRuleHandlerFunc) { - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *clusterAlertRuleClient) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync ClusterAlertRuleHandlerFunc) { - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} - -func (s *clusterAlertRuleClient) AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle ClusterAlertRuleLifecycle) { - sync := NewClusterAlertRuleLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *clusterAlertRuleClient) AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle ClusterAlertRuleLifecycle) { - sync := NewClusterAlertRuleLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_cluster_alert_rule_lifecycle_adapter.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_cluster_alert_rule_lifecycle_adapter.go deleted file mode 100644 index a8762448..00000000 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_cluster_alert_rule_lifecycle_adapter.go +++ /dev/null @@ -1,66 +0,0 @@ -package v3 - -import ( - "github.com/rancher/norman/lifecycle" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/runtime" -) - -type ClusterAlertRuleLifecycle interface { - Create(obj *ClusterAlertRule) (runtime.Object, error) - Remove(obj *ClusterAlertRule) (runtime.Object, error) - Updated(obj *ClusterAlertRule) (runtime.Object, error) -} - -type clusterAlertRuleLifecycleAdapter struct { - lifecycle ClusterAlertRuleLifecycle -} - -func (w *clusterAlertRuleLifecycleAdapter) HasCreate() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasCreate() -} - -func (w *clusterAlertRuleLifecycleAdapter) HasFinalize() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasFinalize() -} - -func (w *clusterAlertRuleLifecycleAdapter) Create(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Create(obj.(*ClusterAlertRule)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *clusterAlertRuleLifecycleAdapter) Finalize(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Remove(obj.(*ClusterAlertRule)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *clusterAlertRuleLifecycleAdapter) Updated(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Updated(obj.(*ClusterAlertRule)) - if o == nil { - return nil, err - } - return o, err -} - -func NewClusterAlertRuleLifecycleAdapter(name string, clusterScoped bool, client ClusterAlertRuleInterface, l ClusterAlertRuleLifecycle) ClusterAlertRuleHandlerFunc { - if clusterScoped { - resource.PutClusterScoped(ClusterAlertRuleGroupVersionResource) - } - adapter := &clusterAlertRuleLifecycleAdapter{lifecycle: l} - syncFn := lifecycle.NewObjectLifecycleAdapter(name, clusterScoped, adapter, client.ObjectClient()) - return func(key string, obj *ClusterAlertRule) (runtime.Object, error) { - newObj, err := syncFn(key, obj) - if o, ok := newObj.(runtime.Object); ok { - return o, err - } - return nil, err - } -} diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_cluster_catalog_controller.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_cluster_catalog_controller.go deleted file mode 100644 index d793e9ca..00000000 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_cluster_catalog_controller.go +++ /dev/null @@ -1,321 +0,0 @@ -package v3 - -import ( - "context" - "time" - - "github.com/rancher/norman/controller" - "github.com/rancher/norman/objectclient" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/apimachinery/pkg/types" - "k8s.io/apimachinery/pkg/watch" - "k8s.io/client-go/tools/cache" -) - -var ( - ClusterCatalogGroupVersionKind = schema.GroupVersionKind{ - Version: Version, - Group: GroupName, - Kind: "ClusterCatalog", - } - ClusterCatalogResource = metav1.APIResource{ - Name: "clustercatalogs", - SingularName: "clustercatalog", - Namespaced: true, - - Kind: ClusterCatalogGroupVersionKind.Kind, - } - - ClusterCatalogGroupVersionResource = schema.GroupVersionResource{ - Group: GroupName, - Version: Version, - Resource: "clustercatalogs", - } -) - -func init() { - resource.Put(ClusterCatalogGroupVersionResource) -} - -func NewClusterCatalog(namespace, name string, obj ClusterCatalog) *ClusterCatalog { - obj.APIVersion, obj.Kind = ClusterCatalogGroupVersionKind.ToAPIVersionAndKind() - obj.Name = name - obj.Namespace = namespace - return &obj -} - -type ClusterCatalogList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []ClusterCatalog `json:"items"` -} - -type ClusterCatalogHandlerFunc func(key string, obj *ClusterCatalog) (runtime.Object, error) - -type ClusterCatalogChangeHandlerFunc func(obj *ClusterCatalog) (runtime.Object, error) - -type ClusterCatalogLister interface { - List(namespace string, selector labels.Selector) (ret []*ClusterCatalog, err error) - Get(namespace, name string) (*ClusterCatalog, error) -} - -type ClusterCatalogController interface { - Generic() controller.GenericController - Informer() cache.SharedIndexInformer - Lister() ClusterCatalogLister - AddHandler(ctx context.Context, name string, handler ClusterCatalogHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync ClusterCatalogHandlerFunc) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, handler ClusterCatalogHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, handler ClusterCatalogHandlerFunc) - Enqueue(namespace, name string) - EnqueueAfter(namespace, name string, after time.Duration) -} - -type ClusterCatalogInterface interface { - ObjectClient() *objectclient.ObjectClient - Create(*ClusterCatalog) (*ClusterCatalog, error) - GetNamespaced(namespace, name string, opts metav1.GetOptions) (*ClusterCatalog, error) - Get(name string, opts metav1.GetOptions) (*ClusterCatalog, error) - Update(*ClusterCatalog) (*ClusterCatalog, error) - Delete(name string, options *metav1.DeleteOptions) error - DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error - List(opts metav1.ListOptions) (*ClusterCatalogList, error) - ListNamespaced(namespace string, opts metav1.ListOptions) (*ClusterCatalogList, error) - Watch(opts metav1.ListOptions) (watch.Interface, error) - DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error - Controller() ClusterCatalogController - AddHandler(ctx context.Context, name string, sync ClusterCatalogHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync ClusterCatalogHandlerFunc) - AddLifecycle(ctx context.Context, name string, lifecycle ClusterCatalogLifecycle) - AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle ClusterCatalogLifecycle) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync ClusterCatalogHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync ClusterCatalogHandlerFunc) - AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle ClusterCatalogLifecycle) - AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle ClusterCatalogLifecycle) -} - -type clusterCatalogLister struct { - controller *clusterCatalogController -} - -func (l *clusterCatalogLister) List(namespace string, selector labels.Selector) (ret []*ClusterCatalog, err error) { - err = cache.ListAllByNamespace(l.controller.Informer().GetIndexer(), namespace, selector, func(obj interface{}) { - ret = append(ret, obj.(*ClusterCatalog)) - }) - return -} - -func (l *clusterCatalogLister) Get(namespace, name string) (*ClusterCatalog, error) { - var key string - if namespace != "" { - key = namespace + "/" + name - } else { - key = name - } - obj, exists, err := l.controller.Informer().GetIndexer().GetByKey(key) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(schema.GroupResource{ - Group: ClusterCatalogGroupVersionKind.Group, - Resource: ClusterCatalogGroupVersionResource.Resource, - }, key) - } - return obj.(*ClusterCatalog), nil -} - -type clusterCatalogController struct { - controller.GenericController -} - -func (c *clusterCatalogController) Generic() controller.GenericController { - return c.GenericController -} - -func (c *clusterCatalogController) Lister() ClusterCatalogLister { - return &clusterCatalogLister{ - controller: c, - } -} - -func (c *clusterCatalogController) AddHandler(ctx context.Context, name string, handler ClusterCatalogHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*ClusterCatalog); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *clusterCatalogController) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, handler ClusterCatalogHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*ClusterCatalog); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *clusterCatalogController) AddClusterScopedHandler(ctx context.Context, name, cluster string, handler ClusterCatalogHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*ClusterCatalog); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *clusterCatalogController) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, cluster string, handler ClusterCatalogHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*ClusterCatalog); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -type clusterCatalogFactory struct { -} - -func (c clusterCatalogFactory) Object() runtime.Object { - return &ClusterCatalog{} -} - -func (c clusterCatalogFactory) List() runtime.Object { - return &ClusterCatalogList{} -} - -func (s *clusterCatalogClient) Controller() ClusterCatalogController { - genericController := controller.NewGenericController(ClusterCatalogGroupVersionKind.Kind+"Controller", - s.client.controllerFactory.ForResourceKind(ClusterCatalogGroupVersionResource, ClusterCatalogGroupVersionKind.Kind, true)) - - return &clusterCatalogController{ - GenericController: genericController, - } -} - -type clusterCatalogClient struct { - client *Client - ns string - objectClient *objectclient.ObjectClient - controller ClusterCatalogController -} - -func (s *clusterCatalogClient) ObjectClient() *objectclient.ObjectClient { - return s.objectClient -} - -func (s *clusterCatalogClient) Create(o *ClusterCatalog) (*ClusterCatalog, error) { - obj, err := s.objectClient.Create(o) - return obj.(*ClusterCatalog), err -} - -func (s *clusterCatalogClient) Get(name string, opts metav1.GetOptions) (*ClusterCatalog, error) { - obj, err := s.objectClient.Get(name, opts) - return obj.(*ClusterCatalog), err -} - -func (s *clusterCatalogClient) GetNamespaced(namespace, name string, opts metav1.GetOptions) (*ClusterCatalog, error) { - obj, err := s.objectClient.GetNamespaced(namespace, name, opts) - return obj.(*ClusterCatalog), err -} - -func (s *clusterCatalogClient) Update(o *ClusterCatalog) (*ClusterCatalog, error) { - obj, err := s.objectClient.Update(o.Name, o) - return obj.(*ClusterCatalog), err -} - -func (s *clusterCatalogClient) UpdateStatus(o *ClusterCatalog) (*ClusterCatalog, error) { - obj, err := s.objectClient.UpdateStatus(o.Name, o) - return obj.(*ClusterCatalog), err -} - -func (s *clusterCatalogClient) Delete(name string, options *metav1.DeleteOptions) error { - return s.objectClient.Delete(name, options) -} - -func (s *clusterCatalogClient) DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error { - return s.objectClient.DeleteNamespaced(namespace, name, options) -} - -func (s *clusterCatalogClient) List(opts metav1.ListOptions) (*ClusterCatalogList, error) { - obj, err := s.objectClient.List(opts) - return obj.(*ClusterCatalogList), err -} - -func (s *clusterCatalogClient) ListNamespaced(namespace string, opts metav1.ListOptions) (*ClusterCatalogList, error) { - obj, err := s.objectClient.ListNamespaced(namespace, opts) - return obj.(*ClusterCatalogList), err -} - -func (s *clusterCatalogClient) Watch(opts metav1.ListOptions) (watch.Interface, error) { - return s.objectClient.Watch(opts) -} - -// Patch applies the patch and returns the patched deployment. -func (s *clusterCatalogClient) Patch(o *ClusterCatalog, patchType types.PatchType, data []byte, subresources ...string) (*ClusterCatalog, error) { - obj, err := s.objectClient.Patch(o.Name, o, patchType, data, subresources...) - return obj.(*ClusterCatalog), err -} - -func (s *clusterCatalogClient) DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error { - return s.objectClient.DeleteCollection(deleteOpts, listOpts) -} - -func (s *clusterCatalogClient) AddHandler(ctx context.Context, name string, sync ClusterCatalogHandlerFunc) { - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *clusterCatalogClient) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync ClusterCatalogHandlerFunc) { - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *clusterCatalogClient) AddLifecycle(ctx context.Context, name string, lifecycle ClusterCatalogLifecycle) { - sync := NewClusterCatalogLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *clusterCatalogClient) AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle ClusterCatalogLifecycle) { - sync := NewClusterCatalogLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *clusterCatalogClient) AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync ClusterCatalogHandlerFunc) { - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *clusterCatalogClient) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync ClusterCatalogHandlerFunc) { - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} - -func (s *clusterCatalogClient) AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle ClusterCatalogLifecycle) { - sync := NewClusterCatalogLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *clusterCatalogClient) AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle ClusterCatalogLifecycle) { - sync := NewClusterCatalogLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_cluster_catalog_lifecycle_adapter.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_cluster_catalog_lifecycle_adapter.go deleted file mode 100644 index c18dca6e..00000000 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_cluster_catalog_lifecycle_adapter.go +++ /dev/null @@ -1,66 +0,0 @@ -package v3 - -import ( - "github.com/rancher/norman/lifecycle" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/runtime" -) - -type ClusterCatalogLifecycle interface { - Create(obj *ClusterCatalog) (runtime.Object, error) - Remove(obj *ClusterCatalog) (runtime.Object, error) - Updated(obj *ClusterCatalog) (runtime.Object, error) -} - -type clusterCatalogLifecycleAdapter struct { - lifecycle ClusterCatalogLifecycle -} - -func (w *clusterCatalogLifecycleAdapter) HasCreate() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasCreate() -} - -func (w *clusterCatalogLifecycleAdapter) HasFinalize() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasFinalize() -} - -func (w *clusterCatalogLifecycleAdapter) Create(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Create(obj.(*ClusterCatalog)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *clusterCatalogLifecycleAdapter) Finalize(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Remove(obj.(*ClusterCatalog)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *clusterCatalogLifecycleAdapter) Updated(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Updated(obj.(*ClusterCatalog)) - if o == nil { - return nil, err - } - return o, err -} - -func NewClusterCatalogLifecycleAdapter(name string, clusterScoped bool, client ClusterCatalogInterface, l ClusterCatalogLifecycle) ClusterCatalogHandlerFunc { - if clusterScoped { - resource.PutClusterScoped(ClusterCatalogGroupVersionResource) - } - adapter := &clusterCatalogLifecycleAdapter{lifecycle: l} - syncFn := lifecycle.NewObjectLifecycleAdapter(name, clusterScoped, adapter, client.ObjectClient()) - return func(key string, obj *ClusterCatalog) (runtime.Object, error) { - newObj, err := syncFn(key, obj) - if o, ok := newObj.(runtime.Object); ok { - return o, err - } - return nil, err - } -} diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_cluster_controller.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_cluster_controller.go deleted file mode 100644 index c6034149..00000000 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_cluster_controller.go +++ /dev/null @@ -1,320 +0,0 @@ -package v3 - -import ( - "context" - "time" - - "github.com/rancher/norman/controller" - "github.com/rancher/norman/objectclient" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/apimachinery/pkg/types" - "k8s.io/apimachinery/pkg/watch" - "k8s.io/client-go/tools/cache" -) - -var ( - ClusterGroupVersionKind = schema.GroupVersionKind{ - Version: Version, - Group: GroupName, - Kind: "Cluster", - } - ClusterResource = metav1.APIResource{ - Name: "clusters", - SingularName: "cluster", - Namespaced: false, - Kind: ClusterGroupVersionKind.Kind, - } - - ClusterGroupVersionResource = schema.GroupVersionResource{ - Group: GroupName, - Version: Version, - Resource: "clusters", - } -) - -func init() { - resource.Put(ClusterGroupVersionResource) -} - -func NewCluster(namespace, name string, obj Cluster) *Cluster { - obj.APIVersion, obj.Kind = ClusterGroupVersionKind.ToAPIVersionAndKind() - obj.Name = name - obj.Namespace = namespace - return &obj -} - -type ClusterList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []Cluster `json:"items"` -} - -type ClusterHandlerFunc func(key string, obj *Cluster) (runtime.Object, error) - -type ClusterChangeHandlerFunc func(obj *Cluster) (runtime.Object, error) - -type ClusterLister interface { - List(namespace string, selector labels.Selector) (ret []*Cluster, err error) - Get(namespace, name string) (*Cluster, error) -} - -type ClusterController interface { - Generic() controller.GenericController - Informer() cache.SharedIndexInformer - Lister() ClusterLister - AddHandler(ctx context.Context, name string, handler ClusterHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync ClusterHandlerFunc) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, handler ClusterHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, handler ClusterHandlerFunc) - Enqueue(namespace, name string) - EnqueueAfter(namespace, name string, after time.Duration) -} - -type ClusterInterface interface { - ObjectClient() *objectclient.ObjectClient - Create(*Cluster) (*Cluster, error) - GetNamespaced(namespace, name string, opts metav1.GetOptions) (*Cluster, error) - Get(name string, opts metav1.GetOptions) (*Cluster, error) - Update(*Cluster) (*Cluster, error) - Delete(name string, options *metav1.DeleteOptions) error - DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error - List(opts metav1.ListOptions) (*ClusterList, error) - ListNamespaced(namespace string, opts metav1.ListOptions) (*ClusterList, error) - Watch(opts metav1.ListOptions) (watch.Interface, error) - DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error - Controller() ClusterController - AddHandler(ctx context.Context, name string, sync ClusterHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync ClusterHandlerFunc) - AddLifecycle(ctx context.Context, name string, lifecycle ClusterLifecycle) - AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle ClusterLifecycle) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync ClusterHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync ClusterHandlerFunc) - AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle ClusterLifecycle) - AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle ClusterLifecycle) -} - -type clusterLister struct { - controller *clusterController -} - -func (l *clusterLister) List(namespace string, selector labels.Selector) (ret []*Cluster, err error) { - err = cache.ListAllByNamespace(l.controller.Informer().GetIndexer(), namespace, selector, func(obj interface{}) { - ret = append(ret, obj.(*Cluster)) - }) - return -} - -func (l *clusterLister) Get(namespace, name string) (*Cluster, error) { - var key string - if namespace != "" { - key = namespace + "/" + name - } else { - key = name - } - obj, exists, err := l.controller.Informer().GetIndexer().GetByKey(key) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(schema.GroupResource{ - Group: ClusterGroupVersionKind.Group, - Resource: ClusterGroupVersionResource.Resource, - }, key) - } - return obj.(*Cluster), nil -} - -type clusterController struct { - controller.GenericController -} - -func (c *clusterController) Generic() controller.GenericController { - return c.GenericController -} - -func (c *clusterController) Lister() ClusterLister { - return &clusterLister{ - controller: c, - } -} - -func (c *clusterController) AddHandler(ctx context.Context, name string, handler ClusterHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*Cluster); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *clusterController) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, handler ClusterHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*Cluster); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *clusterController) AddClusterScopedHandler(ctx context.Context, name, cluster string, handler ClusterHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*Cluster); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *clusterController) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, cluster string, handler ClusterHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*Cluster); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -type clusterFactory struct { -} - -func (c clusterFactory) Object() runtime.Object { - return &Cluster{} -} - -func (c clusterFactory) List() runtime.Object { - return &ClusterList{} -} - -func (s *clusterClient) Controller() ClusterController { - genericController := controller.NewGenericController(ClusterGroupVersionKind.Kind+"Controller", - s.client.controllerFactory.ForResourceKind(ClusterGroupVersionResource, ClusterGroupVersionKind.Kind, false)) - - return &clusterController{ - GenericController: genericController, - } -} - -type clusterClient struct { - client *Client - ns string - objectClient *objectclient.ObjectClient - controller ClusterController -} - -func (s *clusterClient) ObjectClient() *objectclient.ObjectClient { - return s.objectClient -} - -func (s *clusterClient) Create(o *Cluster) (*Cluster, error) { - obj, err := s.objectClient.Create(o) - return obj.(*Cluster), err -} - -func (s *clusterClient) Get(name string, opts metav1.GetOptions) (*Cluster, error) { - obj, err := s.objectClient.Get(name, opts) - return obj.(*Cluster), err -} - -func (s *clusterClient) GetNamespaced(namespace, name string, opts metav1.GetOptions) (*Cluster, error) { - obj, err := s.objectClient.GetNamespaced(namespace, name, opts) - return obj.(*Cluster), err -} - -func (s *clusterClient) Update(o *Cluster) (*Cluster, error) { - obj, err := s.objectClient.Update(o.Name, o) - return obj.(*Cluster), err -} - -func (s *clusterClient) UpdateStatus(o *Cluster) (*Cluster, error) { - obj, err := s.objectClient.UpdateStatus(o.Name, o) - return obj.(*Cluster), err -} - -func (s *clusterClient) Delete(name string, options *metav1.DeleteOptions) error { - return s.objectClient.Delete(name, options) -} - -func (s *clusterClient) DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error { - return s.objectClient.DeleteNamespaced(namespace, name, options) -} - -func (s *clusterClient) List(opts metav1.ListOptions) (*ClusterList, error) { - obj, err := s.objectClient.List(opts) - return obj.(*ClusterList), err -} - -func (s *clusterClient) ListNamespaced(namespace string, opts metav1.ListOptions) (*ClusterList, error) { - obj, err := s.objectClient.ListNamespaced(namespace, opts) - return obj.(*ClusterList), err -} - -func (s *clusterClient) Watch(opts metav1.ListOptions) (watch.Interface, error) { - return s.objectClient.Watch(opts) -} - -// Patch applies the patch and returns the patched deployment. -func (s *clusterClient) Patch(o *Cluster, patchType types.PatchType, data []byte, subresources ...string) (*Cluster, error) { - obj, err := s.objectClient.Patch(o.Name, o, patchType, data, subresources...) - return obj.(*Cluster), err -} - -func (s *clusterClient) DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error { - return s.objectClient.DeleteCollection(deleteOpts, listOpts) -} - -func (s *clusterClient) AddHandler(ctx context.Context, name string, sync ClusterHandlerFunc) { - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *clusterClient) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync ClusterHandlerFunc) { - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *clusterClient) AddLifecycle(ctx context.Context, name string, lifecycle ClusterLifecycle) { - sync := NewClusterLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *clusterClient) AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle ClusterLifecycle) { - sync := NewClusterLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *clusterClient) AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync ClusterHandlerFunc) { - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *clusterClient) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync ClusterHandlerFunc) { - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} - -func (s *clusterClient) AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle ClusterLifecycle) { - sync := NewClusterLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *clusterClient) AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle ClusterLifecycle) { - sync := NewClusterLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_cluster_lifecycle_adapter.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_cluster_lifecycle_adapter.go deleted file mode 100644 index 93177eb0..00000000 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_cluster_lifecycle_adapter.go +++ /dev/null @@ -1,66 +0,0 @@ -package v3 - -import ( - "github.com/rancher/norman/lifecycle" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/runtime" -) - -type ClusterLifecycle interface { - Create(obj *Cluster) (runtime.Object, error) - Remove(obj *Cluster) (runtime.Object, error) - Updated(obj *Cluster) (runtime.Object, error) -} - -type clusterLifecycleAdapter struct { - lifecycle ClusterLifecycle -} - -func (w *clusterLifecycleAdapter) HasCreate() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasCreate() -} - -func (w *clusterLifecycleAdapter) HasFinalize() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasFinalize() -} - -func (w *clusterLifecycleAdapter) Create(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Create(obj.(*Cluster)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *clusterLifecycleAdapter) Finalize(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Remove(obj.(*Cluster)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *clusterLifecycleAdapter) Updated(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Updated(obj.(*Cluster)) - if o == nil { - return nil, err - } - return o, err -} - -func NewClusterLifecycleAdapter(name string, clusterScoped bool, client ClusterInterface, l ClusterLifecycle) ClusterHandlerFunc { - if clusterScoped { - resource.PutClusterScoped(ClusterGroupVersionResource) - } - adapter := &clusterLifecycleAdapter{lifecycle: l} - syncFn := lifecycle.NewObjectLifecycleAdapter(name, clusterScoped, adapter, client.ObjectClient()) - return func(key string, obj *Cluster) (runtime.Object, error) { - newObj, err := syncFn(key, obj) - if o, ok := newObj.(runtime.Object); ok { - return o, err - } - return nil, err - } -} diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_cluster_logging_controller.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_cluster_logging_controller.go deleted file mode 100644 index 6fe1b8ac..00000000 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_cluster_logging_controller.go +++ /dev/null @@ -1,321 +0,0 @@ -package v3 - -import ( - "context" - "time" - - "github.com/rancher/norman/controller" - "github.com/rancher/norman/objectclient" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/apimachinery/pkg/types" - "k8s.io/apimachinery/pkg/watch" - "k8s.io/client-go/tools/cache" -) - -var ( - ClusterLoggingGroupVersionKind = schema.GroupVersionKind{ - Version: Version, - Group: GroupName, - Kind: "ClusterLogging", - } - ClusterLoggingResource = metav1.APIResource{ - Name: "clusterloggings", - SingularName: "clusterlogging", - Namespaced: true, - - Kind: ClusterLoggingGroupVersionKind.Kind, - } - - ClusterLoggingGroupVersionResource = schema.GroupVersionResource{ - Group: GroupName, - Version: Version, - Resource: "clusterloggings", - } -) - -func init() { - resource.Put(ClusterLoggingGroupVersionResource) -} - -func NewClusterLogging(namespace, name string, obj ClusterLogging) *ClusterLogging { - obj.APIVersion, obj.Kind = ClusterLoggingGroupVersionKind.ToAPIVersionAndKind() - obj.Name = name - obj.Namespace = namespace - return &obj -} - -type ClusterLoggingList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []ClusterLogging `json:"items"` -} - -type ClusterLoggingHandlerFunc func(key string, obj *ClusterLogging) (runtime.Object, error) - -type ClusterLoggingChangeHandlerFunc func(obj *ClusterLogging) (runtime.Object, error) - -type ClusterLoggingLister interface { - List(namespace string, selector labels.Selector) (ret []*ClusterLogging, err error) - Get(namespace, name string) (*ClusterLogging, error) -} - -type ClusterLoggingController interface { - Generic() controller.GenericController - Informer() cache.SharedIndexInformer - Lister() ClusterLoggingLister - AddHandler(ctx context.Context, name string, handler ClusterLoggingHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync ClusterLoggingHandlerFunc) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, handler ClusterLoggingHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, handler ClusterLoggingHandlerFunc) - Enqueue(namespace, name string) - EnqueueAfter(namespace, name string, after time.Duration) -} - -type ClusterLoggingInterface interface { - ObjectClient() *objectclient.ObjectClient - Create(*ClusterLogging) (*ClusterLogging, error) - GetNamespaced(namespace, name string, opts metav1.GetOptions) (*ClusterLogging, error) - Get(name string, opts metav1.GetOptions) (*ClusterLogging, error) - Update(*ClusterLogging) (*ClusterLogging, error) - Delete(name string, options *metav1.DeleteOptions) error - DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error - List(opts metav1.ListOptions) (*ClusterLoggingList, error) - ListNamespaced(namespace string, opts metav1.ListOptions) (*ClusterLoggingList, error) - Watch(opts metav1.ListOptions) (watch.Interface, error) - DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error - Controller() ClusterLoggingController - AddHandler(ctx context.Context, name string, sync ClusterLoggingHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync ClusterLoggingHandlerFunc) - AddLifecycle(ctx context.Context, name string, lifecycle ClusterLoggingLifecycle) - AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle ClusterLoggingLifecycle) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync ClusterLoggingHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync ClusterLoggingHandlerFunc) - AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle ClusterLoggingLifecycle) - AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle ClusterLoggingLifecycle) -} - -type clusterLoggingLister struct { - controller *clusterLoggingController -} - -func (l *clusterLoggingLister) List(namespace string, selector labels.Selector) (ret []*ClusterLogging, err error) { - err = cache.ListAllByNamespace(l.controller.Informer().GetIndexer(), namespace, selector, func(obj interface{}) { - ret = append(ret, obj.(*ClusterLogging)) - }) - return -} - -func (l *clusterLoggingLister) Get(namespace, name string) (*ClusterLogging, error) { - var key string - if namespace != "" { - key = namespace + "/" + name - } else { - key = name - } - obj, exists, err := l.controller.Informer().GetIndexer().GetByKey(key) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(schema.GroupResource{ - Group: ClusterLoggingGroupVersionKind.Group, - Resource: ClusterLoggingGroupVersionResource.Resource, - }, key) - } - return obj.(*ClusterLogging), nil -} - -type clusterLoggingController struct { - controller.GenericController -} - -func (c *clusterLoggingController) Generic() controller.GenericController { - return c.GenericController -} - -func (c *clusterLoggingController) Lister() ClusterLoggingLister { - return &clusterLoggingLister{ - controller: c, - } -} - -func (c *clusterLoggingController) AddHandler(ctx context.Context, name string, handler ClusterLoggingHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*ClusterLogging); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *clusterLoggingController) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, handler ClusterLoggingHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*ClusterLogging); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *clusterLoggingController) AddClusterScopedHandler(ctx context.Context, name, cluster string, handler ClusterLoggingHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*ClusterLogging); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *clusterLoggingController) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, cluster string, handler ClusterLoggingHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*ClusterLogging); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -type clusterLoggingFactory struct { -} - -func (c clusterLoggingFactory) Object() runtime.Object { - return &ClusterLogging{} -} - -func (c clusterLoggingFactory) List() runtime.Object { - return &ClusterLoggingList{} -} - -func (s *clusterLoggingClient) Controller() ClusterLoggingController { - genericController := controller.NewGenericController(ClusterLoggingGroupVersionKind.Kind+"Controller", - s.client.controllerFactory.ForResourceKind(ClusterLoggingGroupVersionResource, ClusterLoggingGroupVersionKind.Kind, true)) - - return &clusterLoggingController{ - GenericController: genericController, - } -} - -type clusterLoggingClient struct { - client *Client - ns string - objectClient *objectclient.ObjectClient - controller ClusterLoggingController -} - -func (s *clusterLoggingClient) ObjectClient() *objectclient.ObjectClient { - return s.objectClient -} - -func (s *clusterLoggingClient) Create(o *ClusterLogging) (*ClusterLogging, error) { - obj, err := s.objectClient.Create(o) - return obj.(*ClusterLogging), err -} - -func (s *clusterLoggingClient) Get(name string, opts metav1.GetOptions) (*ClusterLogging, error) { - obj, err := s.objectClient.Get(name, opts) - return obj.(*ClusterLogging), err -} - -func (s *clusterLoggingClient) GetNamespaced(namespace, name string, opts metav1.GetOptions) (*ClusterLogging, error) { - obj, err := s.objectClient.GetNamespaced(namespace, name, opts) - return obj.(*ClusterLogging), err -} - -func (s *clusterLoggingClient) Update(o *ClusterLogging) (*ClusterLogging, error) { - obj, err := s.objectClient.Update(o.Name, o) - return obj.(*ClusterLogging), err -} - -func (s *clusterLoggingClient) UpdateStatus(o *ClusterLogging) (*ClusterLogging, error) { - obj, err := s.objectClient.UpdateStatus(o.Name, o) - return obj.(*ClusterLogging), err -} - -func (s *clusterLoggingClient) Delete(name string, options *metav1.DeleteOptions) error { - return s.objectClient.Delete(name, options) -} - -func (s *clusterLoggingClient) DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error { - return s.objectClient.DeleteNamespaced(namespace, name, options) -} - -func (s *clusterLoggingClient) List(opts metav1.ListOptions) (*ClusterLoggingList, error) { - obj, err := s.objectClient.List(opts) - return obj.(*ClusterLoggingList), err -} - -func (s *clusterLoggingClient) ListNamespaced(namespace string, opts metav1.ListOptions) (*ClusterLoggingList, error) { - obj, err := s.objectClient.ListNamespaced(namespace, opts) - return obj.(*ClusterLoggingList), err -} - -func (s *clusterLoggingClient) Watch(opts metav1.ListOptions) (watch.Interface, error) { - return s.objectClient.Watch(opts) -} - -// Patch applies the patch and returns the patched deployment. -func (s *clusterLoggingClient) Patch(o *ClusterLogging, patchType types.PatchType, data []byte, subresources ...string) (*ClusterLogging, error) { - obj, err := s.objectClient.Patch(o.Name, o, patchType, data, subresources...) - return obj.(*ClusterLogging), err -} - -func (s *clusterLoggingClient) DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error { - return s.objectClient.DeleteCollection(deleteOpts, listOpts) -} - -func (s *clusterLoggingClient) AddHandler(ctx context.Context, name string, sync ClusterLoggingHandlerFunc) { - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *clusterLoggingClient) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync ClusterLoggingHandlerFunc) { - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *clusterLoggingClient) AddLifecycle(ctx context.Context, name string, lifecycle ClusterLoggingLifecycle) { - sync := NewClusterLoggingLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *clusterLoggingClient) AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle ClusterLoggingLifecycle) { - sync := NewClusterLoggingLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *clusterLoggingClient) AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync ClusterLoggingHandlerFunc) { - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *clusterLoggingClient) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync ClusterLoggingHandlerFunc) { - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} - -func (s *clusterLoggingClient) AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle ClusterLoggingLifecycle) { - sync := NewClusterLoggingLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *clusterLoggingClient) AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle ClusterLoggingLifecycle) { - sync := NewClusterLoggingLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_cluster_logging_lifecycle_adapter.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_cluster_logging_lifecycle_adapter.go deleted file mode 100644 index ae3c474e..00000000 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_cluster_logging_lifecycle_adapter.go +++ /dev/null @@ -1,66 +0,0 @@ -package v3 - -import ( - "github.com/rancher/norman/lifecycle" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/runtime" -) - -type ClusterLoggingLifecycle interface { - Create(obj *ClusterLogging) (runtime.Object, error) - Remove(obj *ClusterLogging) (runtime.Object, error) - Updated(obj *ClusterLogging) (runtime.Object, error) -} - -type clusterLoggingLifecycleAdapter struct { - lifecycle ClusterLoggingLifecycle -} - -func (w *clusterLoggingLifecycleAdapter) HasCreate() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasCreate() -} - -func (w *clusterLoggingLifecycleAdapter) HasFinalize() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasFinalize() -} - -func (w *clusterLoggingLifecycleAdapter) Create(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Create(obj.(*ClusterLogging)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *clusterLoggingLifecycleAdapter) Finalize(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Remove(obj.(*ClusterLogging)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *clusterLoggingLifecycleAdapter) Updated(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Updated(obj.(*ClusterLogging)) - if o == nil { - return nil, err - } - return o, err -} - -func NewClusterLoggingLifecycleAdapter(name string, clusterScoped bool, client ClusterLoggingInterface, l ClusterLoggingLifecycle) ClusterLoggingHandlerFunc { - if clusterScoped { - resource.PutClusterScoped(ClusterLoggingGroupVersionResource) - } - adapter := &clusterLoggingLifecycleAdapter{lifecycle: l} - syncFn := lifecycle.NewObjectLifecycleAdapter(name, clusterScoped, adapter, client.ObjectClient()) - return func(key string, obj *ClusterLogging) (runtime.Object, error) { - newObj, err := syncFn(key, obj) - if o, ok := newObj.(runtime.Object); ok { - return o, err - } - return nil, err - } -} diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_cluster_monitor_graph_controller.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_cluster_monitor_graph_controller.go deleted file mode 100644 index ddbe56a1..00000000 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_cluster_monitor_graph_controller.go +++ /dev/null @@ -1,321 +0,0 @@ -package v3 - -import ( - "context" - "time" - - "github.com/rancher/norman/controller" - "github.com/rancher/norman/objectclient" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/apimachinery/pkg/types" - "k8s.io/apimachinery/pkg/watch" - "k8s.io/client-go/tools/cache" -) - -var ( - ClusterMonitorGraphGroupVersionKind = schema.GroupVersionKind{ - Version: Version, - Group: GroupName, - Kind: "ClusterMonitorGraph", - } - ClusterMonitorGraphResource = metav1.APIResource{ - Name: "clustermonitorgraphs", - SingularName: "clustermonitorgraph", - Namespaced: true, - - Kind: ClusterMonitorGraphGroupVersionKind.Kind, - } - - ClusterMonitorGraphGroupVersionResource = schema.GroupVersionResource{ - Group: GroupName, - Version: Version, - Resource: "clustermonitorgraphs", - } -) - -func init() { - resource.Put(ClusterMonitorGraphGroupVersionResource) -} - -func NewClusterMonitorGraph(namespace, name string, obj ClusterMonitorGraph) *ClusterMonitorGraph { - obj.APIVersion, obj.Kind = ClusterMonitorGraphGroupVersionKind.ToAPIVersionAndKind() - obj.Name = name - obj.Namespace = namespace - return &obj -} - -type ClusterMonitorGraphList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []ClusterMonitorGraph `json:"items"` -} - -type ClusterMonitorGraphHandlerFunc func(key string, obj *ClusterMonitorGraph) (runtime.Object, error) - -type ClusterMonitorGraphChangeHandlerFunc func(obj *ClusterMonitorGraph) (runtime.Object, error) - -type ClusterMonitorGraphLister interface { - List(namespace string, selector labels.Selector) (ret []*ClusterMonitorGraph, err error) - Get(namespace, name string) (*ClusterMonitorGraph, error) -} - -type ClusterMonitorGraphController interface { - Generic() controller.GenericController - Informer() cache.SharedIndexInformer - Lister() ClusterMonitorGraphLister - AddHandler(ctx context.Context, name string, handler ClusterMonitorGraphHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync ClusterMonitorGraphHandlerFunc) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, handler ClusterMonitorGraphHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, handler ClusterMonitorGraphHandlerFunc) - Enqueue(namespace, name string) - EnqueueAfter(namespace, name string, after time.Duration) -} - -type ClusterMonitorGraphInterface interface { - ObjectClient() *objectclient.ObjectClient - Create(*ClusterMonitorGraph) (*ClusterMonitorGraph, error) - GetNamespaced(namespace, name string, opts metav1.GetOptions) (*ClusterMonitorGraph, error) - Get(name string, opts metav1.GetOptions) (*ClusterMonitorGraph, error) - Update(*ClusterMonitorGraph) (*ClusterMonitorGraph, error) - Delete(name string, options *metav1.DeleteOptions) error - DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error - List(opts metav1.ListOptions) (*ClusterMonitorGraphList, error) - ListNamespaced(namespace string, opts metav1.ListOptions) (*ClusterMonitorGraphList, error) - Watch(opts metav1.ListOptions) (watch.Interface, error) - DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error - Controller() ClusterMonitorGraphController - AddHandler(ctx context.Context, name string, sync ClusterMonitorGraphHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync ClusterMonitorGraphHandlerFunc) - AddLifecycle(ctx context.Context, name string, lifecycle ClusterMonitorGraphLifecycle) - AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle ClusterMonitorGraphLifecycle) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync ClusterMonitorGraphHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync ClusterMonitorGraphHandlerFunc) - AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle ClusterMonitorGraphLifecycle) - AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle ClusterMonitorGraphLifecycle) -} - -type clusterMonitorGraphLister struct { - controller *clusterMonitorGraphController -} - -func (l *clusterMonitorGraphLister) List(namespace string, selector labels.Selector) (ret []*ClusterMonitorGraph, err error) { - err = cache.ListAllByNamespace(l.controller.Informer().GetIndexer(), namespace, selector, func(obj interface{}) { - ret = append(ret, obj.(*ClusterMonitorGraph)) - }) - return -} - -func (l *clusterMonitorGraphLister) Get(namespace, name string) (*ClusterMonitorGraph, error) { - var key string - if namespace != "" { - key = namespace + "/" + name - } else { - key = name - } - obj, exists, err := l.controller.Informer().GetIndexer().GetByKey(key) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(schema.GroupResource{ - Group: ClusterMonitorGraphGroupVersionKind.Group, - Resource: ClusterMonitorGraphGroupVersionResource.Resource, - }, key) - } - return obj.(*ClusterMonitorGraph), nil -} - -type clusterMonitorGraphController struct { - controller.GenericController -} - -func (c *clusterMonitorGraphController) Generic() controller.GenericController { - return c.GenericController -} - -func (c *clusterMonitorGraphController) Lister() ClusterMonitorGraphLister { - return &clusterMonitorGraphLister{ - controller: c, - } -} - -func (c *clusterMonitorGraphController) AddHandler(ctx context.Context, name string, handler ClusterMonitorGraphHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*ClusterMonitorGraph); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *clusterMonitorGraphController) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, handler ClusterMonitorGraphHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*ClusterMonitorGraph); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *clusterMonitorGraphController) AddClusterScopedHandler(ctx context.Context, name, cluster string, handler ClusterMonitorGraphHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*ClusterMonitorGraph); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *clusterMonitorGraphController) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, cluster string, handler ClusterMonitorGraphHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*ClusterMonitorGraph); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -type clusterMonitorGraphFactory struct { -} - -func (c clusterMonitorGraphFactory) Object() runtime.Object { - return &ClusterMonitorGraph{} -} - -func (c clusterMonitorGraphFactory) List() runtime.Object { - return &ClusterMonitorGraphList{} -} - -func (s *clusterMonitorGraphClient) Controller() ClusterMonitorGraphController { - genericController := controller.NewGenericController(ClusterMonitorGraphGroupVersionKind.Kind+"Controller", - s.client.controllerFactory.ForResourceKind(ClusterMonitorGraphGroupVersionResource, ClusterMonitorGraphGroupVersionKind.Kind, true)) - - return &clusterMonitorGraphController{ - GenericController: genericController, - } -} - -type clusterMonitorGraphClient struct { - client *Client - ns string - objectClient *objectclient.ObjectClient - controller ClusterMonitorGraphController -} - -func (s *clusterMonitorGraphClient) ObjectClient() *objectclient.ObjectClient { - return s.objectClient -} - -func (s *clusterMonitorGraphClient) Create(o *ClusterMonitorGraph) (*ClusterMonitorGraph, error) { - obj, err := s.objectClient.Create(o) - return obj.(*ClusterMonitorGraph), err -} - -func (s *clusterMonitorGraphClient) Get(name string, opts metav1.GetOptions) (*ClusterMonitorGraph, error) { - obj, err := s.objectClient.Get(name, opts) - return obj.(*ClusterMonitorGraph), err -} - -func (s *clusterMonitorGraphClient) GetNamespaced(namespace, name string, opts metav1.GetOptions) (*ClusterMonitorGraph, error) { - obj, err := s.objectClient.GetNamespaced(namespace, name, opts) - return obj.(*ClusterMonitorGraph), err -} - -func (s *clusterMonitorGraphClient) Update(o *ClusterMonitorGraph) (*ClusterMonitorGraph, error) { - obj, err := s.objectClient.Update(o.Name, o) - return obj.(*ClusterMonitorGraph), err -} - -func (s *clusterMonitorGraphClient) UpdateStatus(o *ClusterMonitorGraph) (*ClusterMonitorGraph, error) { - obj, err := s.objectClient.UpdateStatus(o.Name, o) - return obj.(*ClusterMonitorGraph), err -} - -func (s *clusterMonitorGraphClient) Delete(name string, options *metav1.DeleteOptions) error { - return s.objectClient.Delete(name, options) -} - -func (s *clusterMonitorGraphClient) DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error { - return s.objectClient.DeleteNamespaced(namespace, name, options) -} - -func (s *clusterMonitorGraphClient) List(opts metav1.ListOptions) (*ClusterMonitorGraphList, error) { - obj, err := s.objectClient.List(opts) - return obj.(*ClusterMonitorGraphList), err -} - -func (s *clusterMonitorGraphClient) ListNamespaced(namespace string, opts metav1.ListOptions) (*ClusterMonitorGraphList, error) { - obj, err := s.objectClient.ListNamespaced(namespace, opts) - return obj.(*ClusterMonitorGraphList), err -} - -func (s *clusterMonitorGraphClient) Watch(opts metav1.ListOptions) (watch.Interface, error) { - return s.objectClient.Watch(opts) -} - -// Patch applies the patch and returns the patched deployment. -func (s *clusterMonitorGraphClient) Patch(o *ClusterMonitorGraph, patchType types.PatchType, data []byte, subresources ...string) (*ClusterMonitorGraph, error) { - obj, err := s.objectClient.Patch(o.Name, o, patchType, data, subresources...) - return obj.(*ClusterMonitorGraph), err -} - -func (s *clusterMonitorGraphClient) DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error { - return s.objectClient.DeleteCollection(deleteOpts, listOpts) -} - -func (s *clusterMonitorGraphClient) AddHandler(ctx context.Context, name string, sync ClusterMonitorGraphHandlerFunc) { - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *clusterMonitorGraphClient) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync ClusterMonitorGraphHandlerFunc) { - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *clusterMonitorGraphClient) AddLifecycle(ctx context.Context, name string, lifecycle ClusterMonitorGraphLifecycle) { - sync := NewClusterMonitorGraphLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *clusterMonitorGraphClient) AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle ClusterMonitorGraphLifecycle) { - sync := NewClusterMonitorGraphLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *clusterMonitorGraphClient) AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync ClusterMonitorGraphHandlerFunc) { - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *clusterMonitorGraphClient) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync ClusterMonitorGraphHandlerFunc) { - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} - -func (s *clusterMonitorGraphClient) AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle ClusterMonitorGraphLifecycle) { - sync := NewClusterMonitorGraphLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *clusterMonitorGraphClient) AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle ClusterMonitorGraphLifecycle) { - sync := NewClusterMonitorGraphLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_cluster_monitor_graph_lifecycle_adapter.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_cluster_monitor_graph_lifecycle_adapter.go deleted file mode 100644 index d236dd76..00000000 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_cluster_monitor_graph_lifecycle_adapter.go +++ /dev/null @@ -1,66 +0,0 @@ -package v3 - -import ( - "github.com/rancher/norman/lifecycle" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/runtime" -) - -type ClusterMonitorGraphLifecycle interface { - Create(obj *ClusterMonitorGraph) (runtime.Object, error) - Remove(obj *ClusterMonitorGraph) (runtime.Object, error) - Updated(obj *ClusterMonitorGraph) (runtime.Object, error) -} - -type clusterMonitorGraphLifecycleAdapter struct { - lifecycle ClusterMonitorGraphLifecycle -} - -func (w *clusterMonitorGraphLifecycleAdapter) HasCreate() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasCreate() -} - -func (w *clusterMonitorGraphLifecycleAdapter) HasFinalize() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasFinalize() -} - -func (w *clusterMonitorGraphLifecycleAdapter) Create(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Create(obj.(*ClusterMonitorGraph)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *clusterMonitorGraphLifecycleAdapter) Finalize(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Remove(obj.(*ClusterMonitorGraph)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *clusterMonitorGraphLifecycleAdapter) Updated(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Updated(obj.(*ClusterMonitorGraph)) - if o == nil { - return nil, err - } - return o, err -} - -func NewClusterMonitorGraphLifecycleAdapter(name string, clusterScoped bool, client ClusterMonitorGraphInterface, l ClusterMonitorGraphLifecycle) ClusterMonitorGraphHandlerFunc { - if clusterScoped { - resource.PutClusterScoped(ClusterMonitorGraphGroupVersionResource) - } - adapter := &clusterMonitorGraphLifecycleAdapter{lifecycle: l} - syncFn := lifecycle.NewObjectLifecycleAdapter(name, clusterScoped, adapter, client.ObjectClient()) - return func(key string, obj *ClusterMonitorGraph) (runtime.Object, error) { - newObj, err := syncFn(key, obj) - if o, ok := newObj.(runtime.Object); ok { - return o, err - } - return nil, err - } -} diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_cluster_registration_token_controller.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_cluster_registration_token_controller.go deleted file mode 100644 index 47117d00..00000000 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_cluster_registration_token_controller.go +++ /dev/null @@ -1,321 +0,0 @@ -package v3 - -import ( - "context" - "time" - - "github.com/rancher/norman/controller" - "github.com/rancher/norman/objectclient" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/apimachinery/pkg/types" - "k8s.io/apimachinery/pkg/watch" - "k8s.io/client-go/tools/cache" -) - -var ( - ClusterRegistrationTokenGroupVersionKind = schema.GroupVersionKind{ - Version: Version, - Group: GroupName, - Kind: "ClusterRegistrationToken", - } - ClusterRegistrationTokenResource = metav1.APIResource{ - Name: "clusterregistrationtokens", - SingularName: "clusterregistrationtoken", - Namespaced: true, - - Kind: ClusterRegistrationTokenGroupVersionKind.Kind, - } - - ClusterRegistrationTokenGroupVersionResource = schema.GroupVersionResource{ - Group: GroupName, - Version: Version, - Resource: "clusterregistrationtokens", - } -) - -func init() { - resource.Put(ClusterRegistrationTokenGroupVersionResource) -} - -func NewClusterRegistrationToken(namespace, name string, obj ClusterRegistrationToken) *ClusterRegistrationToken { - obj.APIVersion, obj.Kind = ClusterRegistrationTokenGroupVersionKind.ToAPIVersionAndKind() - obj.Name = name - obj.Namespace = namespace - return &obj -} - -type ClusterRegistrationTokenList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []ClusterRegistrationToken `json:"items"` -} - -type ClusterRegistrationTokenHandlerFunc func(key string, obj *ClusterRegistrationToken) (runtime.Object, error) - -type ClusterRegistrationTokenChangeHandlerFunc func(obj *ClusterRegistrationToken) (runtime.Object, error) - -type ClusterRegistrationTokenLister interface { - List(namespace string, selector labels.Selector) (ret []*ClusterRegistrationToken, err error) - Get(namespace, name string) (*ClusterRegistrationToken, error) -} - -type ClusterRegistrationTokenController interface { - Generic() controller.GenericController - Informer() cache.SharedIndexInformer - Lister() ClusterRegistrationTokenLister - AddHandler(ctx context.Context, name string, handler ClusterRegistrationTokenHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync ClusterRegistrationTokenHandlerFunc) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, handler ClusterRegistrationTokenHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, handler ClusterRegistrationTokenHandlerFunc) - Enqueue(namespace, name string) - EnqueueAfter(namespace, name string, after time.Duration) -} - -type ClusterRegistrationTokenInterface interface { - ObjectClient() *objectclient.ObjectClient - Create(*ClusterRegistrationToken) (*ClusterRegistrationToken, error) - GetNamespaced(namespace, name string, opts metav1.GetOptions) (*ClusterRegistrationToken, error) - Get(name string, opts metav1.GetOptions) (*ClusterRegistrationToken, error) - Update(*ClusterRegistrationToken) (*ClusterRegistrationToken, error) - Delete(name string, options *metav1.DeleteOptions) error - DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error - List(opts metav1.ListOptions) (*ClusterRegistrationTokenList, error) - ListNamespaced(namespace string, opts metav1.ListOptions) (*ClusterRegistrationTokenList, error) - Watch(opts metav1.ListOptions) (watch.Interface, error) - DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error - Controller() ClusterRegistrationTokenController - AddHandler(ctx context.Context, name string, sync ClusterRegistrationTokenHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync ClusterRegistrationTokenHandlerFunc) - AddLifecycle(ctx context.Context, name string, lifecycle ClusterRegistrationTokenLifecycle) - AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle ClusterRegistrationTokenLifecycle) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync ClusterRegistrationTokenHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync ClusterRegistrationTokenHandlerFunc) - AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle ClusterRegistrationTokenLifecycle) - AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle ClusterRegistrationTokenLifecycle) -} - -type clusterRegistrationTokenLister struct { - controller *clusterRegistrationTokenController -} - -func (l *clusterRegistrationTokenLister) List(namespace string, selector labels.Selector) (ret []*ClusterRegistrationToken, err error) { - err = cache.ListAllByNamespace(l.controller.Informer().GetIndexer(), namespace, selector, func(obj interface{}) { - ret = append(ret, obj.(*ClusterRegistrationToken)) - }) - return -} - -func (l *clusterRegistrationTokenLister) Get(namespace, name string) (*ClusterRegistrationToken, error) { - var key string - if namespace != "" { - key = namespace + "/" + name - } else { - key = name - } - obj, exists, err := l.controller.Informer().GetIndexer().GetByKey(key) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(schema.GroupResource{ - Group: ClusterRegistrationTokenGroupVersionKind.Group, - Resource: ClusterRegistrationTokenGroupVersionResource.Resource, - }, key) - } - return obj.(*ClusterRegistrationToken), nil -} - -type clusterRegistrationTokenController struct { - controller.GenericController -} - -func (c *clusterRegistrationTokenController) Generic() controller.GenericController { - return c.GenericController -} - -func (c *clusterRegistrationTokenController) Lister() ClusterRegistrationTokenLister { - return &clusterRegistrationTokenLister{ - controller: c, - } -} - -func (c *clusterRegistrationTokenController) AddHandler(ctx context.Context, name string, handler ClusterRegistrationTokenHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*ClusterRegistrationToken); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *clusterRegistrationTokenController) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, handler ClusterRegistrationTokenHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*ClusterRegistrationToken); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *clusterRegistrationTokenController) AddClusterScopedHandler(ctx context.Context, name, cluster string, handler ClusterRegistrationTokenHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*ClusterRegistrationToken); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *clusterRegistrationTokenController) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, cluster string, handler ClusterRegistrationTokenHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*ClusterRegistrationToken); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -type clusterRegistrationTokenFactory struct { -} - -func (c clusterRegistrationTokenFactory) Object() runtime.Object { - return &ClusterRegistrationToken{} -} - -func (c clusterRegistrationTokenFactory) List() runtime.Object { - return &ClusterRegistrationTokenList{} -} - -func (s *clusterRegistrationTokenClient) Controller() ClusterRegistrationTokenController { - genericController := controller.NewGenericController(ClusterRegistrationTokenGroupVersionKind.Kind+"Controller", - s.client.controllerFactory.ForResourceKind(ClusterRegistrationTokenGroupVersionResource, ClusterRegistrationTokenGroupVersionKind.Kind, true)) - - return &clusterRegistrationTokenController{ - GenericController: genericController, - } -} - -type clusterRegistrationTokenClient struct { - client *Client - ns string - objectClient *objectclient.ObjectClient - controller ClusterRegistrationTokenController -} - -func (s *clusterRegistrationTokenClient) ObjectClient() *objectclient.ObjectClient { - return s.objectClient -} - -func (s *clusterRegistrationTokenClient) Create(o *ClusterRegistrationToken) (*ClusterRegistrationToken, error) { - obj, err := s.objectClient.Create(o) - return obj.(*ClusterRegistrationToken), err -} - -func (s *clusterRegistrationTokenClient) Get(name string, opts metav1.GetOptions) (*ClusterRegistrationToken, error) { - obj, err := s.objectClient.Get(name, opts) - return obj.(*ClusterRegistrationToken), err -} - -func (s *clusterRegistrationTokenClient) GetNamespaced(namespace, name string, opts metav1.GetOptions) (*ClusterRegistrationToken, error) { - obj, err := s.objectClient.GetNamespaced(namespace, name, opts) - return obj.(*ClusterRegistrationToken), err -} - -func (s *clusterRegistrationTokenClient) Update(o *ClusterRegistrationToken) (*ClusterRegistrationToken, error) { - obj, err := s.objectClient.Update(o.Name, o) - return obj.(*ClusterRegistrationToken), err -} - -func (s *clusterRegistrationTokenClient) UpdateStatus(o *ClusterRegistrationToken) (*ClusterRegistrationToken, error) { - obj, err := s.objectClient.UpdateStatus(o.Name, o) - return obj.(*ClusterRegistrationToken), err -} - -func (s *clusterRegistrationTokenClient) Delete(name string, options *metav1.DeleteOptions) error { - return s.objectClient.Delete(name, options) -} - -func (s *clusterRegistrationTokenClient) DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error { - return s.objectClient.DeleteNamespaced(namespace, name, options) -} - -func (s *clusterRegistrationTokenClient) List(opts metav1.ListOptions) (*ClusterRegistrationTokenList, error) { - obj, err := s.objectClient.List(opts) - return obj.(*ClusterRegistrationTokenList), err -} - -func (s *clusterRegistrationTokenClient) ListNamespaced(namespace string, opts metav1.ListOptions) (*ClusterRegistrationTokenList, error) { - obj, err := s.objectClient.ListNamespaced(namespace, opts) - return obj.(*ClusterRegistrationTokenList), err -} - -func (s *clusterRegistrationTokenClient) Watch(opts metav1.ListOptions) (watch.Interface, error) { - return s.objectClient.Watch(opts) -} - -// Patch applies the patch and returns the patched deployment. -func (s *clusterRegistrationTokenClient) Patch(o *ClusterRegistrationToken, patchType types.PatchType, data []byte, subresources ...string) (*ClusterRegistrationToken, error) { - obj, err := s.objectClient.Patch(o.Name, o, patchType, data, subresources...) - return obj.(*ClusterRegistrationToken), err -} - -func (s *clusterRegistrationTokenClient) DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error { - return s.objectClient.DeleteCollection(deleteOpts, listOpts) -} - -func (s *clusterRegistrationTokenClient) AddHandler(ctx context.Context, name string, sync ClusterRegistrationTokenHandlerFunc) { - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *clusterRegistrationTokenClient) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync ClusterRegistrationTokenHandlerFunc) { - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *clusterRegistrationTokenClient) AddLifecycle(ctx context.Context, name string, lifecycle ClusterRegistrationTokenLifecycle) { - sync := NewClusterRegistrationTokenLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *clusterRegistrationTokenClient) AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle ClusterRegistrationTokenLifecycle) { - sync := NewClusterRegistrationTokenLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *clusterRegistrationTokenClient) AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync ClusterRegistrationTokenHandlerFunc) { - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *clusterRegistrationTokenClient) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync ClusterRegistrationTokenHandlerFunc) { - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} - -func (s *clusterRegistrationTokenClient) AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle ClusterRegistrationTokenLifecycle) { - sync := NewClusterRegistrationTokenLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *clusterRegistrationTokenClient) AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle ClusterRegistrationTokenLifecycle) { - sync := NewClusterRegistrationTokenLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_cluster_registration_token_lifecycle_adapter.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_cluster_registration_token_lifecycle_adapter.go deleted file mode 100644 index d8572e83..00000000 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_cluster_registration_token_lifecycle_adapter.go +++ /dev/null @@ -1,66 +0,0 @@ -package v3 - -import ( - "github.com/rancher/norman/lifecycle" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/runtime" -) - -type ClusterRegistrationTokenLifecycle interface { - Create(obj *ClusterRegistrationToken) (runtime.Object, error) - Remove(obj *ClusterRegistrationToken) (runtime.Object, error) - Updated(obj *ClusterRegistrationToken) (runtime.Object, error) -} - -type clusterRegistrationTokenLifecycleAdapter struct { - lifecycle ClusterRegistrationTokenLifecycle -} - -func (w *clusterRegistrationTokenLifecycleAdapter) HasCreate() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasCreate() -} - -func (w *clusterRegistrationTokenLifecycleAdapter) HasFinalize() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasFinalize() -} - -func (w *clusterRegistrationTokenLifecycleAdapter) Create(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Create(obj.(*ClusterRegistrationToken)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *clusterRegistrationTokenLifecycleAdapter) Finalize(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Remove(obj.(*ClusterRegistrationToken)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *clusterRegistrationTokenLifecycleAdapter) Updated(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Updated(obj.(*ClusterRegistrationToken)) - if o == nil { - return nil, err - } - return o, err -} - -func NewClusterRegistrationTokenLifecycleAdapter(name string, clusterScoped bool, client ClusterRegistrationTokenInterface, l ClusterRegistrationTokenLifecycle) ClusterRegistrationTokenHandlerFunc { - if clusterScoped { - resource.PutClusterScoped(ClusterRegistrationTokenGroupVersionResource) - } - adapter := &clusterRegistrationTokenLifecycleAdapter{lifecycle: l} - syncFn := lifecycle.NewObjectLifecycleAdapter(name, clusterScoped, adapter, client.ObjectClient()) - return func(key string, obj *ClusterRegistrationToken) (runtime.Object, error) { - newObj, err := syncFn(key, obj) - if o, ok := newObj.(runtime.Object); ok { - return o, err - } - return nil, err - } -} diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_cluster_role_template_binding_controller.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_cluster_role_template_binding_controller.go deleted file mode 100644 index 27628ec6..00000000 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_cluster_role_template_binding_controller.go +++ /dev/null @@ -1,321 +0,0 @@ -package v3 - -import ( - "context" - "time" - - "github.com/rancher/norman/controller" - "github.com/rancher/norman/objectclient" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/apimachinery/pkg/types" - "k8s.io/apimachinery/pkg/watch" - "k8s.io/client-go/tools/cache" -) - -var ( - ClusterRoleTemplateBindingGroupVersionKind = schema.GroupVersionKind{ - Version: Version, - Group: GroupName, - Kind: "ClusterRoleTemplateBinding", - } - ClusterRoleTemplateBindingResource = metav1.APIResource{ - Name: "clusterroletemplatebindings", - SingularName: "clusterroletemplatebinding", - Namespaced: true, - - Kind: ClusterRoleTemplateBindingGroupVersionKind.Kind, - } - - ClusterRoleTemplateBindingGroupVersionResource = schema.GroupVersionResource{ - Group: GroupName, - Version: Version, - Resource: "clusterroletemplatebindings", - } -) - -func init() { - resource.Put(ClusterRoleTemplateBindingGroupVersionResource) -} - -func NewClusterRoleTemplateBinding(namespace, name string, obj ClusterRoleTemplateBinding) *ClusterRoleTemplateBinding { - obj.APIVersion, obj.Kind = ClusterRoleTemplateBindingGroupVersionKind.ToAPIVersionAndKind() - obj.Name = name - obj.Namespace = namespace - return &obj -} - -type ClusterRoleTemplateBindingList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []ClusterRoleTemplateBinding `json:"items"` -} - -type ClusterRoleTemplateBindingHandlerFunc func(key string, obj *ClusterRoleTemplateBinding) (runtime.Object, error) - -type ClusterRoleTemplateBindingChangeHandlerFunc func(obj *ClusterRoleTemplateBinding) (runtime.Object, error) - -type ClusterRoleTemplateBindingLister interface { - List(namespace string, selector labels.Selector) (ret []*ClusterRoleTemplateBinding, err error) - Get(namespace, name string) (*ClusterRoleTemplateBinding, error) -} - -type ClusterRoleTemplateBindingController interface { - Generic() controller.GenericController - Informer() cache.SharedIndexInformer - Lister() ClusterRoleTemplateBindingLister - AddHandler(ctx context.Context, name string, handler ClusterRoleTemplateBindingHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync ClusterRoleTemplateBindingHandlerFunc) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, handler ClusterRoleTemplateBindingHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, handler ClusterRoleTemplateBindingHandlerFunc) - Enqueue(namespace, name string) - EnqueueAfter(namespace, name string, after time.Duration) -} - -type ClusterRoleTemplateBindingInterface interface { - ObjectClient() *objectclient.ObjectClient - Create(*ClusterRoleTemplateBinding) (*ClusterRoleTemplateBinding, error) - GetNamespaced(namespace, name string, opts metav1.GetOptions) (*ClusterRoleTemplateBinding, error) - Get(name string, opts metav1.GetOptions) (*ClusterRoleTemplateBinding, error) - Update(*ClusterRoleTemplateBinding) (*ClusterRoleTemplateBinding, error) - Delete(name string, options *metav1.DeleteOptions) error - DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error - List(opts metav1.ListOptions) (*ClusterRoleTemplateBindingList, error) - ListNamespaced(namespace string, opts metav1.ListOptions) (*ClusterRoleTemplateBindingList, error) - Watch(opts metav1.ListOptions) (watch.Interface, error) - DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error - Controller() ClusterRoleTemplateBindingController - AddHandler(ctx context.Context, name string, sync ClusterRoleTemplateBindingHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync ClusterRoleTemplateBindingHandlerFunc) - AddLifecycle(ctx context.Context, name string, lifecycle ClusterRoleTemplateBindingLifecycle) - AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle ClusterRoleTemplateBindingLifecycle) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync ClusterRoleTemplateBindingHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync ClusterRoleTemplateBindingHandlerFunc) - AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle ClusterRoleTemplateBindingLifecycle) - AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle ClusterRoleTemplateBindingLifecycle) -} - -type clusterRoleTemplateBindingLister struct { - controller *clusterRoleTemplateBindingController -} - -func (l *clusterRoleTemplateBindingLister) List(namespace string, selector labels.Selector) (ret []*ClusterRoleTemplateBinding, err error) { - err = cache.ListAllByNamespace(l.controller.Informer().GetIndexer(), namespace, selector, func(obj interface{}) { - ret = append(ret, obj.(*ClusterRoleTemplateBinding)) - }) - return -} - -func (l *clusterRoleTemplateBindingLister) Get(namespace, name string) (*ClusterRoleTemplateBinding, error) { - var key string - if namespace != "" { - key = namespace + "/" + name - } else { - key = name - } - obj, exists, err := l.controller.Informer().GetIndexer().GetByKey(key) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(schema.GroupResource{ - Group: ClusterRoleTemplateBindingGroupVersionKind.Group, - Resource: ClusterRoleTemplateBindingGroupVersionResource.Resource, - }, key) - } - return obj.(*ClusterRoleTemplateBinding), nil -} - -type clusterRoleTemplateBindingController struct { - controller.GenericController -} - -func (c *clusterRoleTemplateBindingController) Generic() controller.GenericController { - return c.GenericController -} - -func (c *clusterRoleTemplateBindingController) Lister() ClusterRoleTemplateBindingLister { - return &clusterRoleTemplateBindingLister{ - controller: c, - } -} - -func (c *clusterRoleTemplateBindingController) AddHandler(ctx context.Context, name string, handler ClusterRoleTemplateBindingHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*ClusterRoleTemplateBinding); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *clusterRoleTemplateBindingController) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, handler ClusterRoleTemplateBindingHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*ClusterRoleTemplateBinding); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *clusterRoleTemplateBindingController) AddClusterScopedHandler(ctx context.Context, name, cluster string, handler ClusterRoleTemplateBindingHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*ClusterRoleTemplateBinding); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *clusterRoleTemplateBindingController) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, cluster string, handler ClusterRoleTemplateBindingHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*ClusterRoleTemplateBinding); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -type clusterRoleTemplateBindingFactory struct { -} - -func (c clusterRoleTemplateBindingFactory) Object() runtime.Object { - return &ClusterRoleTemplateBinding{} -} - -func (c clusterRoleTemplateBindingFactory) List() runtime.Object { - return &ClusterRoleTemplateBindingList{} -} - -func (s *clusterRoleTemplateBindingClient) Controller() ClusterRoleTemplateBindingController { - genericController := controller.NewGenericController(ClusterRoleTemplateBindingGroupVersionKind.Kind+"Controller", - s.client.controllerFactory.ForResourceKind(ClusterRoleTemplateBindingGroupVersionResource, ClusterRoleTemplateBindingGroupVersionKind.Kind, true)) - - return &clusterRoleTemplateBindingController{ - GenericController: genericController, - } -} - -type clusterRoleTemplateBindingClient struct { - client *Client - ns string - objectClient *objectclient.ObjectClient - controller ClusterRoleTemplateBindingController -} - -func (s *clusterRoleTemplateBindingClient) ObjectClient() *objectclient.ObjectClient { - return s.objectClient -} - -func (s *clusterRoleTemplateBindingClient) Create(o *ClusterRoleTemplateBinding) (*ClusterRoleTemplateBinding, error) { - obj, err := s.objectClient.Create(o) - return obj.(*ClusterRoleTemplateBinding), err -} - -func (s *clusterRoleTemplateBindingClient) Get(name string, opts metav1.GetOptions) (*ClusterRoleTemplateBinding, error) { - obj, err := s.objectClient.Get(name, opts) - return obj.(*ClusterRoleTemplateBinding), err -} - -func (s *clusterRoleTemplateBindingClient) GetNamespaced(namespace, name string, opts metav1.GetOptions) (*ClusterRoleTemplateBinding, error) { - obj, err := s.objectClient.GetNamespaced(namespace, name, opts) - return obj.(*ClusterRoleTemplateBinding), err -} - -func (s *clusterRoleTemplateBindingClient) Update(o *ClusterRoleTemplateBinding) (*ClusterRoleTemplateBinding, error) { - obj, err := s.objectClient.Update(o.Name, o) - return obj.(*ClusterRoleTemplateBinding), err -} - -func (s *clusterRoleTemplateBindingClient) UpdateStatus(o *ClusterRoleTemplateBinding) (*ClusterRoleTemplateBinding, error) { - obj, err := s.objectClient.UpdateStatus(o.Name, o) - return obj.(*ClusterRoleTemplateBinding), err -} - -func (s *clusterRoleTemplateBindingClient) Delete(name string, options *metav1.DeleteOptions) error { - return s.objectClient.Delete(name, options) -} - -func (s *clusterRoleTemplateBindingClient) DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error { - return s.objectClient.DeleteNamespaced(namespace, name, options) -} - -func (s *clusterRoleTemplateBindingClient) List(opts metav1.ListOptions) (*ClusterRoleTemplateBindingList, error) { - obj, err := s.objectClient.List(opts) - return obj.(*ClusterRoleTemplateBindingList), err -} - -func (s *clusterRoleTemplateBindingClient) ListNamespaced(namespace string, opts metav1.ListOptions) (*ClusterRoleTemplateBindingList, error) { - obj, err := s.objectClient.ListNamespaced(namespace, opts) - return obj.(*ClusterRoleTemplateBindingList), err -} - -func (s *clusterRoleTemplateBindingClient) Watch(opts metav1.ListOptions) (watch.Interface, error) { - return s.objectClient.Watch(opts) -} - -// Patch applies the patch and returns the patched deployment. -func (s *clusterRoleTemplateBindingClient) Patch(o *ClusterRoleTemplateBinding, patchType types.PatchType, data []byte, subresources ...string) (*ClusterRoleTemplateBinding, error) { - obj, err := s.objectClient.Patch(o.Name, o, patchType, data, subresources...) - return obj.(*ClusterRoleTemplateBinding), err -} - -func (s *clusterRoleTemplateBindingClient) DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error { - return s.objectClient.DeleteCollection(deleteOpts, listOpts) -} - -func (s *clusterRoleTemplateBindingClient) AddHandler(ctx context.Context, name string, sync ClusterRoleTemplateBindingHandlerFunc) { - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *clusterRoleTemplateBindingClient) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync ClusterRoleTemplateBindingHandlerFunc) { - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *clusterRoleTemplateBindingClient) AddLifecycle(ctx context.Context, name string, lifecycle ClusterRoleTemplateBindingLifecycle) { - sync := NewClusterRoleTemplateBindingLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *clusterRoleTemplateBindingClient) AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle ClusterRoleTemplateBindingLifecycle) { - sync := NewClusterRoleTemplateBindingLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *clusterRoleTemplateBindingClient) AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync ClusterRoleTemplateBindingHandlerFunc) { - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *clusterRoleTemplateBindingClient) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync ClusterRoleTemplateBindingHandlerFunc) { - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} - -func (s *clusterRoleTemplateBindingClient) AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle ClusterRoleTemplateBindingLifecycle) { - sync := NewClusterRoleTemplateBindingLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *clusterRoleTemplateBindingClient) AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle ClusterRoleTemplateBindingLifecycle) { - sync := NewClusterRoleTemplateBindingLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_cluster_role_template_binding_lifecycle_adapter.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_cluster_role_template_binding_lifecycle_adapter.go deleted file mode 100644 index 37bc691d..00000000 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_cluster_role_template_binding_lifecycle_adapter.go +++ /dev/null @@ -1,66 +0,0 @@ -package v3 - -import ( - "github.com/rancher/norman/lifecycle" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/runtime" -) - -type ClusterRoleTemplateBindingLifecycle interface { - Create(obj *ClusterRoleTemplateBinding) (runtime.Object, error) - Remove(obj *ClusterRoleTemplateBinding) (runtime.Object, error) - Updated(obj *ClusterRoleTemplateBinding) (runtime.Object, error) -} - -type clusterRoleTemplateBindingLifecycleAdapter struct { - lifecycle ClusterRoleTemplateBindingLifecycle -} - -func (w *clusterRoleTemplateBindingLifecycleAdapter) HasCreate() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasCreate() -} - -func (w *clusterRoleTemplateBindingLifecycleAdapter) HasFinalize() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasFinalize() -} - -func (w *clusterRoleTemplateBindingLifecycleAdapter) Create(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Create(obj.(*ClusterRoleTemplateBinding)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *clusterRoleTemplateBindingLifecycleAdapter) Finalize(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Remove(obj.(*ClusterRoleTemplateBinding)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *clusterRoleTemplateBindingLifecycleAdapter) Updated(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Updated(obj.(*ClusterRoleTemplateBinding)) - if o == nil { - return nil, err - } - return o, err -} - -func NewClusterRoleTemplateBindingLifecycleAdapter(name string, clusterScoped bool, client ClusterRoleTemplateBindingInterface, l ClusterRoleTemplateBindingLifecycle) ClusterRoleTemplateBindingHandlerFunc { - if clusterScoped { - resource.PutClusterScoped(ClusterRoleTemplateBindingGroupVersionResource) - } - adapter := &clusterRoleTemplateBindingLifecycleAdapter{lifecycle: l} - syncFn := lifecycle.NewObjectLifecycleAdapter(name, clusterScoped, adapter, client.ObjectClient()) - return func(key string, obj *ClusterRoleTemplateBinding) (runtime.Object, error) { - newObj, err := syncFn(key, obj) - if o, ok := newObj.(runtime.Object); ok { - return o, err - } - return nil, err - } -} diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_cluster_scan_controller.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_cluster_scan_controller.go deleted file mode 100644 index 5f11149f..00000000 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_cluster_scan_controller.go +++ /dev/null @@ -1,321 +0,0 @@ -package v3 - -import ( - "context" - "time" - - "github.com/rancher/norman/controller" - "github.com/rancher/norman/objectclient" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/apimachinery/pkg/types" - "k8s.io/apimachinery/pkg/watch" - "k8s.io/client-go/tools/cache" -) - -var ( - ClusterScanGroupVersionKind = schema.GroupVersionKind{ - Version: Version, - Group: GroupName, - Kind: "ClusterScan", - } - ClusterScanResource = metav1.APIResource{ - Name: "clusterscans", - SingularName: "clusterscan", - Namespaced: true, - - Kind: ClusterScanGroupVersionKind.Kind, - } - - ClusterScanGroupVersionResource = schema.GroupVersionResource{ - Group: GroupName, - Version: Version, - Resource: "clusterscans", - } -) - -func init() { - resource.Put(ClusterScanGroupVersionResource) -} - -func NewClusterScan(namespace, name string, obj ClusterScan) *ClusterScan { - obj.APIVersion, obj.Kind = ClusterScanGroupVersionKind.ToAPIVersionAndKind() - obj.Name = name - obj.Namespace = namespace - return &obj -} - -type ClusterScanList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []ClusterScan `json:"items"` -} - -type ClusterScanHandlerFunc func(key string, obj *ClusterScan) (runtime.Object, error) - -type ClusterScanChangeHandlerFunc func(obj *ClusterScan) (runtime.Object, error) - -type ClusterScanLister interface { - List(namespace string, selector labels.Selector) (ret []*ClusterScan, err error) - Get(namespace, name string) (*ClusterScan, error) -} - -type ClusterScanController interface { - Generic() controller.GenericController - Informer() cache.SharedIndexInformer - Lister() ClusterScanLister - AddHandler(ctx context.Context, name string, handler ClusterScanHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync ClusterScanHandlerFunc) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, handler ClusterScanHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, handler ClusterScanHandlerFunc) - Enqueue(namespace, name string) - EnqueueAfter(namespace, name string, after time.Duration) -} - -type ClusterScanInterface interface { - ObjectClient() *objectclient.ObjectClient - Create(*ClusterScan) (*ClusterScan, error) - GetNamespaced(namespace, name string, opts metav1.GetOptions) (*ClusterScan, error) - Get(name string, opts metav1.GetOptions) (*ClusterScan, error) - Update(*ClusterScan) (*ClusterScan, error) - Delete(name string, options *metav1.DeleteOptions) error - DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error - List(opts metav1.ListOptions) (*ClusterScanList, error) - ListNamespaced(namespace string, opts metav1.ListOptions) (*ClusterScanList, error) - Watch(opts metav1.ListOptions) (watch.Interface, error) - DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error - Controller() ClusterScanController - AddHandler(ctx context.Context, name string, sync ClusterScanHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync ClusterScanHandlerFunc) - AddLifecycle(ctx context.Context, name string, lifecycle ClusterScanLifecycle) - AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle ClusterScanLifecycle) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync ClusterScanHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync ClusterScanHandlerFunc) - AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle ClusterScanLifecycle) - AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle ClusterScanLifecycle) -} - -type clusterScanLister struct { - controller *clusterScanController -} - -func (l *clusterScanLister) List(namespace string, selector labels.Selector) (ret []*ClusterScan, err error) { - err = cache.ListAllByNamespace(l.controller.Informer().GetIndexer(), namespace, selector, func(obj interface{}) { - ret = append(ret, obj.(*ClusterScan)) - }) - return -} - -func (l *clusterScanLister) Get(namespace, name string) (*ClusterScan, error) { - var key string - if namespace != "" { - key = namespace + "/" + name - } else { - key = name - } - obj, exists, err := l.controller.Informer().GetIndexer().GetByKey(key) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(schema.GroupResource{ - Group: ClusterScanGroupVersionKind.Group, - Resource: ClusterScanGroupVersionResource.Resource, - }, key) - } - return obj.(*ClusterScan), nil -} - -type clusterScanController struct { - controller.GenericController -} - -func (c *clusterScanController) Generic() controller.GenericController { - return c.GenericController -} - -func (c *clusterScanController) Lister() ClusterScanLister { - return &clusterScanLister{ - controller: c, - } -} - -func (c *clusterScanController) AddHandler(ctx context.Context, name string, handler ClusterScanHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*ClusterScan); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *clusterScanController) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, handler ClusterScanHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*ClusterScan); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *clusterScanController) AddClusterScopedHandler(ctx context.Context, name, cluster string, handler ClusterScanHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*ClusterScan); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *clusterScanController) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, cluster string, handler ClusterScanHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*ClusterScan); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -type clusterScanFactory struct { -} - -func (c clusterScanFactory) Object() runtime.Object { - return &ClusterScan{} -} - -func (c clusterScanFactory) List() runtime.Object { - return &ClusterScanList{} -} - -func (s *clusterScanClient) Controller() ClusterScanController { - genericController := controller.NewGenericController(ClusterScanGroupVersionKind.Kind+"Controller", - s.client.controllerFactory.ForResourceKind(ClusterScanGroupVersionResource, ClusterScanGroupVersionKind.Kind, true)) - - return &clusterScanController{ - GenericController: genericController, - } -} - -type clusterScanClient struct { - client *Client - ns string - objectClient *objectclient.ObjectClient - controller ClusterScanController -} - -func (s *clusterScanClient) ObjectClient() *objectclient.ObjectClient { - return s.objectClient -} - -func (s *clusterScanClient) Create(o *ClusterScan) (*ClusterScan, error) { - obj, err := s.objectClient.Create(o) - return obj.(*ClusterScan), err -} - -func (s *clusterScanClient) Get(name string, opts metav1.GetOptions) (*ClusterScan, error) { - obj, err := s.objectClient.Get(name, opts) - return obj.(*ClusterScan), err -} - -func (s *clusterScanClient) GetNamespaced(namespace, name string, opts metav1.GetOptions) (*ClusterScan, error) { - obj, err := s.objectClient.GetNamespaced(namespace, name, opts) - return obj.(*ClusterScan), err -} - -func (s *clusterScanClient) Update(o *ClusterScan) (*ClusterScan, error) { - obj, err := s.objectClient.Update(o.Name, o) - return obj.(*ClusterScan), err -} - -func (s *clusterScanClient) UpdateStatus(o *ClusterScan) (*ClusterScan, error) { - obj, err := s.objectClient.UpdateStatus(o.Name, o) - return obj.(*ClusterScan), err -} - -func (s *clusterScanClient) Delete(name string, options *metav1.DeleteOptions) error { - return s.objectClient.Delete(name, options) -} - -func (s *clusterScanClient) DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error { - return s.objectClient.DeleteNamespaced(namespace, name, options) -} - -func (s *clusterScanClient) List(opts metav1.ListOptions) (*ClusterScanList, error) { - obj, err := s.objectClient.List(opts) - return obj.(*ClusterScanList), err -} - -func (s *clusterScanClient) ListNamespaced(namespace string, opts metav1.ListOptions) (*ClusterScanList, error) { - obj, err := s.objectClient.ListNamespaced(namespace, opts) - return obj.(*ClusterScanList), err -} - -func (s *clusterScanClient) Watch(opts metav1.ListOptions) (watch.Interface, error) { - return s.objectClient.Watch(opts) -} - -// Patch applies the patch and returns the patched deployment. -func (s *clusterScanClient) Patch(o *ClusterScan, patchType types.PatchType, data []byte, subresources ...string) (*ClusterScan, error) { - obj, err := s.objectClient.Patch(o.Name, o, patchType, data, subresources...) - return obj.(*ClusterScan), err -} - -func (s *clusterScanClient) DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error { - return s.objectClient.DeleteCollection(deleteOpts, listOpts) -} - -func (s *clusterScanClient) AddHandler(ctx context.Context, name string, sync ClusterScanHandlerFunc) { - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *clusterScanClient) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync ClusterScanHandlerFunc) { - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *clusterScanClient) AddLifecycle(ctx context.Context, name string, lifecycle ClusterScanLifecycle) { - sync := NewClusterScanLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *clusterScanClient) AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle ClusterScanLifecycle) { - sync := NewClusterScanLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *clusterScanClient) AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync ClusterScanHandlerFunc) { - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *clusterScanClient) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync ClusterScanHandlerFunc) { - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} - -func (s *clusterScanClient) AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle ClusterScanLifecycle) { - sync := NewClusterScanLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *clusterScanClient) AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle ClusterScanLifecycle) { - sync := NewClusterScanLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_cluster_scan_lifecycle_adapter.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_cluster_scan_lifecycle_adapter.go deleted file mode 100644 index 83569806..00000000 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_cluster_scan_lifecycle_adapter.go +++ /dev/null @@ -1,66 +0,0 @@ -package v3 - -import ( - "github.com/rancher/norman/lifecycle" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/runtime" -) - -type ClusterScanLifecycle interface { - Create(obj *ClusterScan) (runtime.Object, error) - Remove(obj *ClusterScan) (runtime.Object, error) - Updated(obj *ClusterScan) (runtime.Object, error) -} - -type clusterScanLifecycleAdapter struct { - lifecycle ClusterScanLifecycle -} - -func (w *clusterScanLifecycleAdapter) HasCreate() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasCreate() -} - -func (w *clusterScanLifecycleAdapter) HasFinalize() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasFinalize() -} - -func (w *clusterScanLifecycleAdapter) Create(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Create(obj.(*ClusterScan)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *clusterScanLifecycleAdapter) Finalize(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Remove(obj.(*ClusterScan)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *clusterScanLifecycleAdapter) Updated(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Updated(obj.(*ClusterScan)) - if o == nil { - return nil, err - } - return o, err -} - -func NewClusterScanLifecycleAdapter(name string, clusterScoped bool, client ClusterScanInterface, l ClusterScanLifecycle) ClusterScanHandlerFunc { - if clusterScoped { - resource.PutClusterScoped(ClusterScanGroupVersionResource) - } - adapter := &clusterScanLifecycleAdapter{lifecycle: l} - syncFn := lifecycle.NewObjectLifecycleAdapter(name, clusterScoped, adapter, client.ObjectClient()) - return func(key string, obj *ClusterScan) (runtime.Object, error) { - newObj, err := syncFn(key, obj) - if o, ok := newObj.(runtime.Object); ok { - return o, err - } - return nil, err - } -} diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_cluster_template_controller.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_cluster_template_controller.go deleted file mode 100644 index 40b237a2..00000000 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_cluster_template_controller.go +++ /dev/null @@ -1,321 +0,0 @@ -package v3 - -import ( - "context" - "time" - - "github.com/rancher/norman/controller" - "github.com/rancher/norman/objectclient" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/apimachinery/pkg/types" - "k8s.io/apimachinery/pkg/watch" - "k8s.io/client-go/tools/cache" -) - -var ( - ClusterTemplateGroupVersionKind = schema.GroupVersionKind{ - Version: Version, - Group: GroupName, - Kind: "ClusterTemplate", - } - ClusterTemplateResource = metav1.APIResource{ - Name: "clustertemplates", - SingularName: "clustertemplate", - Namespaced: true, - - Kind: ClusterTemplateGroupVersionKind.Kind, - } - - ClusterTemplateGroupVersionResource = schema.GroupVersionResource{ - Group: GroupName, - Version: Version, - Resource: "clustertemplates", - } -) - -func init() { - resource.Put(ClusterTemplateGroupVersionResource) -} - -func NewClusterTemplate(namespace, name string, obj ClusterTemplate) *ClusterTemplate { - obj.APIVersion, obj.Kind = ClusterTemplateGroupVersionKind.ToAPIVersionAndKind() - obj.Name = name - obj.Namespace = namespace - return &obj -} - -type ClusterTemplateList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []ClusterTemplate `json:"items"` -} - -type ClusterTemplateHandlerFunc func(key string, obj *ClusterTemplate) (runtime.Object, error) - -type ClusterTemplateChangeHandlerFunc func(obj *ClusterTemplate) (runtime.Object, error) - -type ClusterTemplateLister interface { - List(namespace string, selector labels.Selector) (ret []*ClusterTemplate, err error) - Get(namespace, name string) (*ClusterTemplate, error) -} - -type ClusterTemplateController interface { - Generic() controller.GenericController - Informer() cache.SharedIndexInformer - Lister() ClusterTemplateLister - AddHandler(ctx context.Context, name string, handler ClusterTemplateHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync ClusterTemplateHandlerFunc) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, handler ClusterTemplateHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, handler ClusterTemplateHandlerFunc) - Enqueue(namespace, name string) - EnqueueAfter(namespace, name string, after time.Duration) -} - -type ClusterTemplateInterface interface { - ObjectClient() *objectclient.ObjectClient - Create(*ClusterTemplate) (*ClusterTemplate, error) - GetNamespaced(namespace, name string, opts metav1.GetOptions) (*ClusterTemplate, error) - Get(name string, opts metav1.GetOptions) (*ClusterTemplate, error) - Update(*ClusterTemplate) (*ClusterTemplate, error) - Delete(name string, options *metav1.DeleteOptions) error - DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error - List(opts metav1.ListOptions) (*ClusterTemplateList, error) - ListNamespaced(namespace string, opts metav1.ListOptions) (*ClusterTemplateList, error) - Watch(opts metav1.ListOptions) (watch.Interface, error) - DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error - Controller() ClusterTemplateController - AddHandler(ctx context.Context, name string, sync ClusterTemplateHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync ClusterTemplateHandlerFunc) - AddLifecycle(ctx context.Context, name string, lifecycle ClusterTemplateLifecycle) - AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle ClusterTemplateLifecycle) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync ClusterTemplateHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync ClusterTemplateHandlerFunc) - AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle ClusterTemplateLifecycle) - AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle ClusterTemplateLifecycle) -} - -type clusterTemplateLister struct { - controller *clusterTemplateController -} - -func (l *clusterTemplateLister) List(namespace string, selector labels.Selector) (ret []*ClusterTemplate, err error) { - err = cache.ListAllByNamespace(l.controller.Informer().GetIndexer(), namespace, selector, func(obj interface{}) { - ret = append(ret, obj.(*ClusterTemplate)) - }) - return -} - -func (l *clusterTemplateLister) Get(namespace, name string) (*ClusterTemplate, error) { - var key string - if namespace != "" { - key = namespace + "/" + name - } else { - key = name - } - obj, exists, err := l.controller.Informer().GetIndexer().GetByKey(key) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(schema.GroupResource{ - Group: ClusterTemplateGroupVersionKind.Group, - Resource: ClusterTemplateGroupVersionResource.Resource, - }, key) - } - return obj.(*ClusterTemplate), nil -} - -type clusterTemplateController struct { - controller.GenericController -} - -func (c *clusterTemplateController) Generic() controller.GenericController { - return c.GenericController -} - -func (c *clusterTemplateController) Lister() ClusterTemplateLister { - return &clusterTemplateLister{ - controller: c, - } -} - -func (c *clusterTemplateController) AddHandler(ctx context.Context, name string, handler ClusterTemplateHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*ClusterTemplate); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *clusterTemplateController) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, handler ClusterTemplateHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*ClusterTemplate); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *clusterTemplateController) AddClusterScopedHandler(ctx context.Context, name, cluster string, handler ClusterTemplateHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*ClusterTemplate); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *clusterTemplateController) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, cluster string, handler ClusterTemplateHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*ClusterTemplate); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -type clusterTemplateFactory struct { -} - -func (c clusterTemplateFactory) Object() runtime.Object { - return &ClusterTemplate{} -} - -func (c clusterTemplateFactory) List() runtime.Object { - return &ClusterTemplateList{} -} - -func (s *clusterTemplateClient) Controller() ClusterTemplateController { - genericController := controller.NewGenericController(ClusterTemplateGroupVersionKind.Kind+"Controller", - s.client.controllerFactory.ForResourceKind(ClusterTemplateGroupVersionResource, ClusterTemplateGroupVersionKind.Kind, true)) - - return &clusterTemplateController{ - GenericController: genericController, - } -} - -type clusterTemplateClient struct { - client *Client - ns string - objectClient *objectclient.ObjectClient - controller ClusterTemplateController -} - -func (s *clusterTemplateClient) ObjectClient() *objectclient.ObjectClient { - return s.objectClient -} - -func (s *clusterTemplateClient) Create(o *ClusterTemplate) (*ClusterTemplate, error) { - obj, err := s.objectClient.Create(o) - return obj.(*ClusterTemplate), err -} - -func (s *clusterTemplateClient) Get(name string, opts metav1.GetOptions) (*ClusterTemplate, error) { - obj, err := s.objectClient.Get(name, opts) - return obj.(*ClusterTemplate), err -} - -func (s *clusterTemplateClient) GetNamespaced(namespace, name string, opts metav1.GetOptions) (*ClusterTemplate, error) { - obj, err := s.objectClient.GetNamespaced(namespace, name, opts) - return obj.(*ClusterTemplate), err -} - -func (s *clusterTemplateClient) Update(o *ClusterTemplate) (*ClusterTemplate, error) { - obj, err := s.objectClient.Update(o.Name, o) - return obj.(*ClusterTemplate), err -} - -func (s *clusterTemplateClient) UpdateStatus(o *ClusterTemplate) (*ClusterTemplate, error) { - obj, err := s.objectClient.UpdateStatus(o.Name, o) - return obj.(*ClusterTemplate), err -} - -func (s *clusterTemplateClient) Delete(name string, options *metav1.DeleteOptions) error { - return s.objectClient.Delete(name, options) -} - -func (s *clusterTemplateClient) DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error { - return s.objectClient.DeleteNamespaced(namespace, name, options) -} - -func (s *clusterTemplateClient) List(opts metav1.ListOptions) (*ClusterTemplateList, error) { - obj, err := s.objectClient.List(opts) - return obj.(*ClusterTemplateList), err -} - -func (s *clusterTemplateClient) ListNamespaced(namespace string, opts metav1.ListOptions) (*ClusterTemplateList, error) { - obj, err := s.objectClient.ListNamespaced(namespace, opts) - return obj.(*ClusterTemplateList), err -} - -func (s *clusterTemplateClient) Watch(opts metav1.ListOptions) (watch.Interface, error) { - return s.objectClient.Watch(opts) -} - -// Patch applies the patch and returns the patched deployment. -func (s *clusterTemplateClient) Patch(o *ClusterTemplate, patchType types.PatchType, data []byte, subresources ...string) (*ClusterTemplate, error) { - obj, err := s.objectClient.Patch(o.Name, o, patchType, data, subresources...) - return obj.(*ClusterTemplate), err -} - -func (s *clusterTemplateClient) DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error { - return s.objectClient.DeleteCollection(deleteOpts, listOpts) -} - -func (s *clusterTemplateClient) AddHandler(ctx context.Context, name string, sync ClusterTemplateHandlerFunc) { - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *clusterTemplateClient) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync ClusterTemplateHandlerFunc) { - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *clusterTemplateClient) AddLifecycle(ctx context.Context, name string, lifecycle ClusterTemplateLifecycle) { - sync := NewClusterTemplateLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *clusterTemplateClient) AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle ClusterTemplateLifecycle) { - sync := NewClusterTemplateLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *clusterTemplateClient) AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync ClusterTemplateHandlerFunc) { - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *clusterTemplateClient) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync ClusterTemplateHandlerFunc) { - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} - -func (s *clusterTemplateClient) AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle ClusterTemplateLifecycle) { - sync := NewClusterTemplateLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *clusterTemplateClient) AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle ClusterTemplateLifecycle) { - sync := NewClusterTemplateLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_cluster_template_lifecycle_adapter.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_cluster_template_lifecycle_adapter.go deleted file mode 100644 index ffb3fcdc..00000000 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_cluster_template_lifecycle_adapter.go +++ /dev/null @@ -1,66 +0,0 @@ -package v3 - -import ( - "github.com/rancher/norman/lifecycle" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/runtime" -) - -type ClusterTemplateLifecycle interface { - Create(obj *ClusterTemplate) (runtime.Object, error) - Remove(obj *ClusterTemplate) (runtime.Object, error) - Updated(obj *ClusterTemplate) (runtime.Object, error) -} - -type clusterTemplateLifecycleAdapter struct { - lifecycle ClusterTemplateLifecycle -} - -func (w *clusterTemplateLifecycleAdapter) HasCreate() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasCreate() -} - -func (w *clusterTemplateLifecycleAdapter) HasFinalize() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasFinalize() -} - -func (w *clusterTemplateLifecycleAdapter) Create(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Create(obj.(*ClusterTemplate)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *clusterTemplateLifecycleAdapter) Finalize(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Remove(obj.(*ClusterTemplate)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *clusterTemplateLifecycleAdapter) Updated(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Updated(obj.(*ClusterTemplate)) - if o == nil { - return nil, err - } - return o, err -} - -func NewClusterTemplateLifecycleAdapter(name string, clusterScoped bool, client ClusterTemplateInterface, l ClusterTemplateLifecycle) ClusterTemplateHandlerFunc { - if clusterScoped { - resource.PutClusterScoped(ClusterTemplateGroupVersionResource) - } - adapter := &clusterTemplateLifecycleAdapter{lifecycle: l} - syncFn := lifecycle.NewObjectLifecycleAdapter(name, clusterScoped, adapter, client.ObjectClient()) - return func(key string, obj *ClusterTemplate) (runtime.Object, error) { - newObj, err := syncFn(key, obj) - if o, ok := newObj.(runtime.Object); ok { - return o, err - } - return nil, err - } -} diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_cluster_template_revision_controller.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_cluster_template_revision_controller.go deleted file mode 100644 index 4ee8828f..00000000 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_cluster_template_revision_controller.go +++ /dev/null @@ -1,321 +0,0 @@ -package v3 - -import ( - "context" - "time" - - "github.com/rancher/norman/controller" - "github.com/rancher/norman/objectclient" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/apimachinery/pkg/types" - "k8s.io/apimachinery/pkg/watch" - "k8s.io/client-go/tools/cache" -) - -var ( - ClusterTemplateRevisionGroupVersionKind = schema.GroupVersionKind{ - Version: Version, - Group: GroupName, - Kind: "ClusterTemplateRevision", - } - ClusterTemplateRevisionResource = metav1.APIResource{ - Name: "clustertemplaterevisions", - SingularName: "clustertemplaterevision", - Namespaced: true, - - Kind: ClusterTemplateRevisionGroupVersionKind.Kind, - } - - ClusterTemplateRevisionGroupVersionResource = schema.GroupVersionResource{ - Group: GroupName, - Version: Version, - Resource: "clustertemplaterevisions", - } -) - -func init() { - resource.Put(ClusterTemplateRevisionGroupVersionResource) -} - -func NewClusterTemplateRevision(namespace, name string, obj ClusterTemplateRevision) *ClusterTemplateRevision { - obj.APIVersion, obj.Kind = ClusterTemplateRevisionGroupVersionKind.ToAPIVersionAndKind() - obj.Name = name - obj.Namespace = namespace - return &obj -} - -type ClusterTemplateRevisionList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []ClusterTemplateRevision `json:"items"` -} - -type ClusterTemplateRevisionHandlerFunc func(key string, obj *ClusterTemplateRevision) (runtime.Object, error) - -type ClusterTemplateRevisionChangeHandlerFunc func(obj *ClusterTemplateRevision) (runtime.Object, error) - -type ClusterTemplateRevisionLister interface { - List(namespace string, selector labels.Selector) (ret []*ClusterTemplateRevision, err error) - Get(namespace, name string) (*ClusterTemplateRevision, error) -} - -type ClusterTemplateRevisionController interface { - Generic() controller.GenericController - Informer() cache.SharedIndexInformer - Lister() ClusterTemplateRevisionLister - AddHandler(ctx context.Context, name string, handler ClusterTemplateRevisionHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync ClusterTemplateRevisionHandlerFunc) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, handler ClusterTemplateRevisionHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, handler ClusterTemplateRevisionHandlerFunc) - Enqueue(namespace, name string) - EnqueueAfter(namespace, name string, after time.Duration) -} - -type ClusterTemplateRevisionInterface interface { - ObjectClient() *objectclient.ObjectClient - Create(*ClusterTemplateRevision) (*ClusterTemplateRevision, error) - GetNamespaced(namespace, name string, opts metav1.GetOptions) (*ClusterTemplateRevision, error) - Get(name string, opts metav1.GetOptions) (*ClusterTemplateRevision, error) - Update(*ClusterTemplateRevision) (*ClusterTemplateRevision, error) - Delete(name string, options *metav1.DeleteOptions) error - DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error - List(opts metav1.ListOptions) (*ClusterTemplateRevisionList, error) - ListNamespaced(namespace string, opts metav1.ListOptions) (*ClusterTemplateRevisionList, error) - Watch(opts metav1.ListOptions) (watch.Interface, error) - DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error - Controller() ClusterTemplateRevisionController - AddHandler(ctx context.Context, name string, sync ClusterTemplateRevisionHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync ClusterTemplateRevisionHandlerFunc) - AddLifecycle(ctx context.Context, name string, lifecycle ClusterTemplateRevisionLifecycle) - AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle ClusterTemplateRevisionLifecycle) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync ClusterTemplateRevisionHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync ClusterTemplateRevisionHandlerFunc) - AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle ClusterTemplateRevisionLifecycle) - AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle ClusterTemplateRevisionLifecycle) -} - -type clusterTemplateRevisionLister struct { - controller *clusterTemplateRevisionController -} - -func (l *clusterTemplateRevisionLister) List(namespace string, selector labels.Selector) (ret []*ClusterTemplateRevision, err error) { - err = cache.ListAllByNamespace(l.controller.Informer().GetIndexer(), namespace, selector, func(obj interface{}) { - ret = append(ret, obj.(*ClusterTemplateRevision)) - }) - return -} - -func (l *clusterTemplateRevisionLister) Get(namespace, name string) (*ClusterTemplateRevision, error) { - var key string - if namespace != "" { - key = namespace + "/" + name - } else { - key = name - } - obj, exists, err := l.controller.Informer().GetIndexer().GetByKey(key) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(schema.GroupResource{ - Group: ClusterTemplateRevisionGroupVersionKind.Group, - Resource: ClusterTemplateRevisionGroupVersionResource.Resource, - }, key) - } - return obj.(*ClusterTemplateRevision), nil -} - -type clusterTemplateRevisionController struct { - controller.GenericController -} - -func (c *clusterTemplateRevisionController) Generic() controller.GenericController { - return c.GenericController -} - -func (c *clusterTemplateRevisionController) Lister() ClusterTemplateRevisionLister { - return &clusterTemplateRevisionLister{ - controller: c, - } -} - -func (c *clusterTemplateRevisionController) AddHandler(ctx context.Context, name string, handler ClusterTemplateRevisionHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*ClusterTemplateRevision); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *clusterTemplateRevisionController) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, handler ClusterTemplateRevisionHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*ClusterTemplateRevision); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *clusterTemplateRevisionController) AddClusterScopedHandler(ctx context.Context, name, cluster string, handler ClusterTemplateRevisionHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*ClusterTemplateRevision); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *clusterTemplateRevisionController) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, cluster string, handler ClusterTemplateRevisionHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*ClusterTemplateRevision); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -type clusterTemplateRevisionFactory struct { -} - -func (c clusterTemplateRevisionFactory) Object() runtime.Object { - return &ClusterTemplateRevision{} -} - -func (c clusterTemplateRevisionFactory) List() runtime.Object { - return &ClusterTemplateRevisionList{} -} - -func (s *clusterTemplateRevisionClient) Controller() ClusterTemplateRevisionController { - genericController := controller.NewGenericController(ClusterTemplateRevisionGroupVersionKind.Kind+"Controller", - s.client.controllerFactory.ForResourceKind(ClusterTemplateRevisionGroupVersionResource, ClusterTemplateRevisionGroupVersionKind.Kind, true)) - - return &clusterTemplateRevisionController{ - GenericController: genericController, - } -} - -type clusterTemplateRevisionClient struct { - client *Client - ns string - objectClient *objectclient.ObjectClient - controller ClusterTemplateRevisionController -} - -func (s *clusterTemplateRevisionClient) ObjectClient() *objectclient.ObjectClient { - return s.objectClient -} - -func (s *clusterTemplateRevisionClient) Create(o *ClusterTemplateRevision) (*ClusterTemplateRevision, error) { - obj, err := s.objectClient.Create(o) - return obj.(*ClusterTemplateRevision), err -} - -func (s *clusterTemplateRevisionClient) Get(name string, opts metav1.GetOptions) (*ClusterTemplateRevision, error) { - obj, err := s.objectClient.Get(name, opts) - return obj.(*ClusterTemplateRevision), err -} - -func (s *clusterTemplateRevisionClient) GetNamespaced(namespace, name string, opts metav1.GetOptions) (*ClusterTemplateRevision, error) { - obj, err := s.objectClient.GetNamespaced(namespace, name, opts) - return obj.(*ClusterTemplateRevision), err -} - -func (s *clusterTemplateRevisionClient) Update(o *ClusterTemplateRevision) (*ClusterTemplateRevision, error) { - obj, err := s.objectClient.Update(o.Name, o) - return obj.(*ClusterTemplateRevision), err -} - -func (s *clusterTemplateRevisionClient) UpdateStatus(o *ClusterTemplateRevision) (*ClusterTemplateRevision, error) { - obj, err := s.objectClient.UpdateStatus(o.Name, o) - return obj.(*ClusterTemplateRevision), err -} - -func (s *clusterTemplateRevisionClient) Delete(name string, options *metav1.DeleteOptions) error { - return s.objectClient.Delete(name, options) -} - -func (s *clusterTemplateRevisionClient) DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error { - return s.objectClient.DeleteNamespaced(namespace, name, options) -} - -func (s *clusterTemplateRevisionClient) List(opts metav1.ListOptions) (*ClusterTemplateRevisionList, error) { - obj, err := s.objectClient.List(opts) - return obj.(*ClusterTemplateRevisionList), err -} - -func (s *clusterTemplateRevisionClient) ListNamespaced(namespace string, opts metav1.ListOptions) (*ClusterTemplateRevisionList, error) { - obj, err := s.objectClient.ListNamespaced(namespace, opts) - return obj.(*ClusterTemplateRevisionList), err -} - -func (s *clusterTemplateRevisionClient) Watch(opts metav1.ListOptions) (watch.Interface, error) { - return s.objectClient.Watch(opts) -} - -// Patch applies the patch and returns the patched deployment. -func (s *clusterTemplateRevisionClient) Patch(o *ClusterTemplateRevision, patchType types.PatchType, data []byte, subresources ...string) (*ClusterTemplateRevision, error) { - obj, err := s.objectClient.Patch(o.Name, o, patchType, data, subresources...) - return obj.(*ClusterTemplateRevision), err -} - -func (s *clusterTemplateRevisionClient) DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error { - return s.objectClient.DeleteCollection(deleteOpts, listOpts) -} - -func (s *clusterTemplateRevisionClient) AddHandler(ctx context.Context, name string, sync ClusterTemplateRevisionHandlerFunc) { - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *clusterTemplateRevisionClient) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync ClusterTemplateRevisionHandlerFunc) { - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *clusterTemplateRevisionClient) AddLifecycle(ctx context.Context, name string, lifecycle ClusterTemplateRevisionLifecycle) { - sync := NewClusterTemplateRevisionLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *clusterTemplateRevisionClient) AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle ClusterTemplateRevisionLifecycle) { - sync := NewClusterTemplateRevisionLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *clusterTemplateRevisionClient) AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync ClusterTemplateRevisionHandlerFunc) { - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *clusterTemplateRevisionClient) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync ClusterTemplateRevisionHandlerFunc) { - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} - -func (s *clusterTemplateRevisionClient) AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle ClusterTemplateRevisionLifecycle) { - sync := NewClusterTemplateRevisionLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *clusterTemplateRevisionClient) AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle ClusterTemplateRevisionLifecycle) { - sync := NewClusterTemplateRevisionLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_cluster_template_revision_lifecycle_adapter.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_cluster_template_revision_lifecycle_adapter.go deleted file mode 100644 index cdd8ad3a..00000000 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_cluster_template_revision_lifecycle_adapter.go +++ /dev/null @@ -1,66 +0,0 @@ -package v3 - -import ( - "github.com/rancher/norman/lifecycle" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/runtime" -) - -type ClusterTemplateRevisionLifecycle interface { - Create(obj *ClusterTemplateRevision) (runtime.Object, error) - Remove(obj *ClusterTemplateRevision) (runtime.Object, error) - Updated(obj *ClusterTemplateRevision) (runtime.Object, error) -} - -type clusterTemplateRevisionLifecycleAdapter struct { - lifecycle ClusterTemplateRevisionLifecycle -} - -func (w *clusterTemplateRevisionLifecycleAdapter) HasCreate() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasCreate() -} - -func (w *clusterTemplateRevisionLifecycleAdapter) HasFinalize() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasFinalize() -} - -func (w *clusterTemplateRevisionLifecycleAdapter) Create(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Create(obj.(*ClusterTemplateRevision)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *clusterTemplateRevisionLifecycleAdapter) Finalize(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Remove(obj.(*ClusterTemplateRevision)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *clusterTemplateRevisionLifecycleAdapter) Updated(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Updated(obj.(*ClusterTemplateRevision)) - if o == nil { - return nil, err - } - return o, err -} - -func NewClusterTemplateRevisionLifecycleAdapter(name string, clusterScoped bool, client ClusterTemplateRevisionInterface, l ClusterTemplateRevisionLifecycle) ClusterTemplateRevisionHandlerFunc { - if clusterScoped { - resource.PutClusterScoped(ClusterTemplateRevisionGroupVersionResource) - } - adapter := &clusterTemplateRevisionLifecycleAdapter{lifecycle: l} - syncFn := lifecycle.NewObjectLifecycleAdapter(name, clusterScoped, adapter, client.ObjectClient()) - return func(key string, obj *ClusterTemplateRevision) (runtime.Object, error) { - newObj, err := syncFn(key, obj) - if o, ok := newObj.(runtime.Object); ok { - return o, err - } - return nil, err - } -} diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_compose_config_controller.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_compose_config_controller.go deleted file mode 100644 index 4b14844a..00000000 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_compose_config_controller.go +++ /dev/null @@ -1,320 +0,0 @@ -package v3 - -import ( - "context" - "time" - - "github.com/rancher/norman/controller" - "github.com/rancher/norman/objectclient" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/apimachinery/pkg/types" - "k8s.io/apimachinery/pkg/watch" - "k8s.io/client-go/tools/cache" -) - -var ( - ComposeConfigGroupVersionKind = schema.GroupVersionKind{ - Version: Version, - Group: GroupName, - Kind: "ComposeConfig", - } - ComposeConfigResource = metav1.APIResource{ - Name: "composeconfigs", - SingularName: "composeconfig", - Namespaced: false, - Kind: ComposeConfigGroupVersionKind.Kind, - } - - ComposeConfigGroupVersionResource = schema.GroupVersionResource{ - Group: GroupName, - Version: Version, - Resource: "composeconfigs", - } -) - -func init() { - resource.Put(ComposeConfigGroupVersionResource) -} - -func NewComposeConfig(namespace, name string, obj ComposeConfig) *ComposeConfig { - obj.APIVersion, obj.Kind = ComposeConfigGroupVersionKind.ToAPIVersionAndKind() - obj.Name = name - obj.Namespace = namespace - return &obj -} - -type ComposeConfigList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []ComposeConfig `json:"items"` -} - -type ComposeConfigHandlerFunc func(key string, obj *ComposeConfig) (runtime.Object, error) - -type ComposeConfigChangeHandlerFunc func(obj *ComposeConfig) (runtime.Object, error) - -type ComposeConfigLister interface { - List(namespace string, selector labels.Selector) (ret []*ComposeConfig, err error) - Get(namespace, name string) (*ComposeConfig, error) -} - -type ComposeConfigController interface { - Generic() controller.GenericController - Informer() cache.SharedIndexInformer - Lister() ComposeConfigLister - AddHandler(ctx context.Context, name string, handler ComposeConfigHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync ComposeConfigHandlerFunc) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, handler ComposeConfigHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, handler ComposeConfigHandlerFunc) - Enqueue(namespace, name string) - EnqueueAfter(namespace, name string, after time.Duration) -} - -type ComposeConfigInterface interface { - ObjectClient() *objectclient.ObjectClient - Create(*ComposeConfig) (*ComposeConfig, error) - GetNamespaced(namespace, name string, opts metav1.GetOptions) (*ComposeConfig, error) - Get(name string, opts metav1.GetOptions) (*ComposeConfig, error) - Update(*ComposeConfig) (*ComposeConfig, error) - Delete(name string, options *metav1.DeleteOptions) error - DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error - List(opts metav1.ListOptions) (*ComposeConfigList, error) - ListNamespaced(namespace string, opts metav1.ListOptions) (*ComposeConfigList, error) - Watch(opts metav1.ListOptions) (watch.Interface, error) - DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error - Controller() ComposeConfigController - AddHandler(ctx context.Context, name string, sync ComposeConfigHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync ComposeConfigHandlerFunc) - AddLifecycle(ctx context.Context, name string, lifecycle ComposeConfigLifecycle) - AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle ComposeConfigLifecycle) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync ComposeConfigHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync ComposeConfigHandlerFunc) - AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle ComposeConfigLifecycle) - AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle ComposeConfigLifecycle) -} - -type composeConfigLister struct { - controller *composeConfigController -} - -func (l *composeConfigLister) List(namespace string, selector labels.Selector) (ret []*ComposeConfig, err error) { - err = cache.ListAllByNamespace(l.controller.Informer().GetIndexer(), namespace, selector, func(obj interface{}) { - ret = append(ret, obj.(*ComposeConfig)) - }) - return -} - -func (l *composeConfigLister) Get(namespace, name string) (*ComposeConfig, error) { - var key string - if namespace != "" { - key = namespace + "/" + name - } else { - key = name - } - obj, exists, err := l.controller.Informer().GetIndexer().GetByKey(key) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(schema.GroupResource{ - Group: ComposeConfigGroupVersionKind.Group, - Resource: ComposeConfigGroupVersionResource.Resource, - }, key) - } - return obj.(*ComposeConfig), nil -} - -type composeConfigController struct { - controller.GenericController -} - -func (c *composeConfigController) Generic() controller.GenericController { - return c.GenericController -} - -func (c *composeConfigController) Lister() ComposeConfigLister { - return &composeConfigLister{ - controller: c, - } -} - -func (c *composeConfigController) AddHandler(ctx context.Context, name string, handler ComposeConfigHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*ComposeConfig); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *composeConfigController) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, handler ComposeConfigHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*ComposeConfig); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *composeConfigController) AddClusterScopedHandler(ctx context.Context, name, cluster string, handler ComposeConfigHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*ComposeConfig); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *composeConfigController) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, cluster string, handler ComposeConfigHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*ComposeConfig); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -type composeConfigFactory struct { -} - -func (c composeConfigFactory) Object() runtime.Object { - return &ComposeConfig{} -} - -func (c composeConfigFactory) List() runtime.Object { - return &ComposeConfigList{} -} - -func (s *composeConfigClient) Controller() ComposeConfigController { - genericController := controller.NewGenericController(ComposeConfigGroupVersionKind.Kind+"Controller", - s.client.controllerFactory.ForResourceKind(ComposeConfigGroupVersionResource, ComposeConfigGroupVersionKind.Kind, false)) - - return &composeConfigController{ - GenericController: genericController, - } -} - -type composeConfigClient struct { - client *Client - ns string - objectClient *objectclient.ObjectClient - controller ComposeConfigController -} - -func (s *composeConfigClient) ObjectClient() *objectclient.ObjectClient { - return s.objectClient -} - -func (s *composeConfigClient) Create(o *ComposeConfig) (*ComposeConfig, error) { - obj, err := s.objectClient.Create(o) - return obj.(*ComposeConfig), err -} - -func (s *composeConfigClient) Get(name string, opts metav1.GetOptions) (*ComposeConfig, error) { - obj, err := s.objectClient.Get(name, opts) - return obj.(*ComposeConfig), err -} - -func (s *composeConfigClient) GetNamespaced(namespace, name string, opts metav1.GetOptions) (*ComposeConfig, error) { - obj, err := s.objectClient.GetNamespaced(namespace, name, opts) - return obj.(*ComposeConfig), err -} - -func (s *composeConfigClient) Update(o *ComposeConfig) (*ComposeConfig, error) { - obj, err := s.objectClient.Update(o.Name, o) - return obj.(*ComposeConfig), err -} - -func (s *composeConfigClient) UpdateStatus(o *ComposeConfig) (*ComposeConfig, error) { - obj, err := s.objectClient.UpdateStatus(o.Name, o) - return obj.(*ComposeConfig), err -} - -func (s *composeConfigClient) Delete(name string, options *metav1.DeleteOptions) error { - return s.objectClient.Delete(name, options) -} - -func (s *composeConfigClient) DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error { - return s.objectClient.DeleteNamespaced(namespace, name, options) -} - -func (s *composeConfigClient) List(opts metav1.ListOptions) (*ComposeConfigList, error) { - obj, err := s.objectClient.List(opts) - return obj.(*ComposeConfigList), err -} - -func (s *composeConfigClient) ListNamespaced(namespace string, opts metav1.ListOptions) (*ComposeConfigList, error) { - obj, err := s.objectClient.ListNamespaced(namespace, opts) - return obj.(*ComposeConfigList), err -} - -func (s *composeConfigClient) Watch(opts metav1.ListOptions) (watch.Interface, error) { - return s.objectClient.Watch(opts) -} - -// Patch applies the patch and returns the patched deployment. -func (s *composeConfigClient) Patch(o *ComposeConfig, patchType types.PatchType, data []byte, subresources ...string) (*ComposeConfig, error) { - obj, err := s.objectClient.Patch(o.Name, o, patchType, data, subresources...) - return obj.(*ComposeConfig), err -} - -func (s *composeConfigClient) DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error { - return s.objectClient.DeleteCollection(deleteOpts, listOpts) -} - -func (s *composeConfigClient) AddHandler(ctx context.Context, name string, sync ComposeConfigHandlerFunc) { - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *composeConfigClient) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync ComposeConfigHandlerFunc) { - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *composeConfigClient) AddLifecycle(ctx context.Context, name string, lifecycle ComposeConfigLifecycle) { - sync := NewComposeConfigLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *composeConfigClient) AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle ComposeConfigLifecycle) { - sync := NewComposeConfigLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *composeConfigClient) AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync ComposeConfigHandlerFunc) { - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *composeConfigClient) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync ComposeConfigHandlerFunc) { - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} - -func (s *composeConfigClient) AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle ComposeConfigLifecycle) { - sync := NewComposeConfigLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *composeConfigClient) AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle ComposeConfigLifecycle) { - sync := NewComposeConfigLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_compose_config_lifecycle_adapter.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_compose_config_lifecycle_adapter.go deleted file mode 100644 index c16f2b1c..00000000 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_compose_config_lifecycle_adapter.go +++ /dev/null @@ -1,66 +0,0 @@ -package v3 - -import ( - "github.com/rancher/norman/lifecycle" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/runtime" -) - -type ComposeConfigLifecycle interface { - Create(obj *ComposeConfig) (runtime.Object, error) - Remove(obj *ComposeConfig) (runtime.Object, error) - Updated(obj *ComposeConfig) (runtime.Object, error) -} - -type composeConfigLifecycleAdapter struct { - lifecycle ComposeConfigLifecycle -} - -func (w *composeConfigLifecycleAdapter) HasCreate() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasCreate() -} - -func (w *composeConfigLifecycleAdapter) HasFinalize() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasFinalize() -} - -func (w *composeConfigLifecycleAdapter) Create(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Create(obj.(*ComposeConfig)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *composeConfigLifecycleAdapter) Finalize(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Remove(obj.(*ComposeConfig)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *composeConfigLifecycleAdapter) Updated(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Updated(obj.(*ComposeConfig)) - if o == nil { - return nil, err - } - return o, err -} - -func NewComposeConfigLifecycleAdapter(name string, clusterScoped bool, client ComposeConfigInterface, l ComposeConfigLifecycle) ComposeConfigHandlerFunc { - if clusterScoped { - resource.PutClusterScoped(ComposeConfigGroupVersionResource) - } - adapter := &composeConfigLifecycleAdapter{lifecycle: l} - syncFn := lifecycle.NewObjectLifecycleAdapter(name, clusterScoped, adapter, client.ObjectClient()) - return func(key string, obj *ComposeConfig) (runtime.Object, error) { - newObj, err := syncFn(key, obj) - if o, ok := newObj.(runtime.Object); ok { - return o, err - } - return nil, err - } -} diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_deepcopy.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_deepcopy.go deleted file mode 100644 index 9dc993e1..00000000 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_deepcopy.go +++ /dev/null @@ -1,10457 +0,0 @@ -package v3 - -import ( - projectcattleiov3 "github.com/rancher/types/apis/project.cattle.io/v3" - appsv1 "k8s.io/api/apps/v1" - corev1 "k8s.io/api/core/v1" - rbacv1 "k8s.io/api/rbac/v1" - runtime "k8s.io/apimachinery/pkg/runtime" - version "k8s.io/apimachinery/pkg/version" - v1alpha1 "k8s.io/apiserver/pkg/apis/apiserver/v1alpha1" - v1 "k8s.io/apiserver/pkg/apis/audit/v1" - config "k8s.io/apiserver/pkg/apis/config" -) - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ADFSConfig) DeepCopyInto(out *ADFSConfig) { - *out = *in - in.SamlConfig.DeepCopyInto(&out.SamlConfig) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ADFSConfig. -func (in *ADFSConfig) DeepCopy() *ADFSConfig { - if in == nil { - return nil - } - out := new(ADFSConfig) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ADFSConfig) 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 *AWSCloudProvider) DeepCopyInto(out *AWSCloudProvider) { - *out = *in - out.Global = in.Global - if in.ServiceOverride != nil { - in, out := &in.ServiceOverride, &out.ServiceOverride - *out = make(map[string]ServiceOverride, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AWSCloudProvider. -func (in *AWSCloudProvider) DeepCopy() *AWSCloudProvider { - if in == nil { - return nil - } - out := new(AWSCloudProvider) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Action) DeepCopyInto(out *Action) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Action. -func (in *Action) DeepCopy() *Action { - if in == nil { - return nil - } - out := new(Action) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ActiveDirectoryConfig) DeepCopyInto(out *ActiveDirectoryConfig) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.AuthConfig.DeepCopyInto(&out.AuthConfig) - if in.Servers != nil { - in, out := &in.Servers, &out.Servers - *out = make([]string, len(*in)) - copy(*out, *in) - } - if in.NestedGroupMembershipEnabled != nil { - in, out := &in.NestedGroupMembershipEnabled, &out.NestedGroupMembershipEnabled - *out = new(bool) - **out = **in - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ActiveDirectoryConfig. -func (in *ActiveDirectoryConfig) DeepCopy() *ActiveDirectoryConfig { - if in == nil { - return nil - } - out := new(ActiveDirectoryConfig) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ActiveDirectoryConfig) 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 *ActiveDirectoryTestAndApplyInput) DeepCopyInto(out *ActiveDirectoryTestAndApplyInput) { - *out = *in - in.ActiveDirectoryConfig.DeepCopyInto(&out.ActiveDirectoryConfig) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ActiveDirectoryTestAndApplyInput. -func (in *ActiveDirectoryTestAndApplyInput) DeepCopy() *ActiveDirectoryTestAndApplyInput { - if in == nil { - return nil - } - out := new(ActiveDirectoryTestAndApplyInput) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AlertCommonSpec) DeepCopyInto(out *AlertCommonSpec) { - *out = *in - if in.Recipients != nil { - in, out := &in.Recipients, &out.Recipients - *out = make([]Recipient, len(*in)) - copy(*out, *in) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AlertCommonSpec. -func (in *AlertCommonSpec) DeepCopy() *AlertCommonSpec { - if in == nil { - return nil - } - out := new(AlertCommonSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AlertStatus) DeepCopyInto(out *AlertStatus) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AlertStatus. -func (in *AlertStatus) DeepCopy() *AlertStatus { - if in == nil { - return nil - } - out := new(AlertStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AlidnsProviderConfig) DeepCopyInto(out *AlidnsProviderConfig) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AlidnsProviderConfig. -func (in *AlidnsProviderConfig) DeepCopy() *AlidnsProviderConfig { - if in == nil { - return nil - } - out := new(AlidnsProviderConfig) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Answer) DeepCopyInto(out *Answer) { - *out = *in - if in.Values != nil { - in, out := &in.Values, &out.Values - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Answer. -func (in *Answer) DeepCopy() *Answer { - if in == nil { - return nil - } - out := new(Answer) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AuditLog) DeepCopyInto(out *AuditLog) { - *out = *in - if in.Configuration != nil { - in, out := &in.Configuration, &out.Configuration - *out = new(AuditLogConfig) - (*in).DeepCopyInto(*out) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AuditLog. -func (in *AuditLog) DeepCopy() *AuditLog { - if in == nil { - return nil - } - out := new(AuditLog) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AuditLogConfig) DeepCopyInto(out *AuditLogConfig) { - *out = *in - if in.Policy != nil { - in, out := &in.Policy, &out.Policy - *out = new(v1.Policy) - (*in).DeepCopyInto(*out) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AuditLogConfig. -func (in *AuditLogConfig) DeepCopy() *AuditLogConfig { - if in == nil { - return nil - } - out := new(AuditLogConfig) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AuthConfig) DeepCopyInto(out *AuthConfig) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - if in.AllowedPrincipalIDs != nil { - in, out := &in.AllowedPrincipalIDs, &out.AllowedPrincipalIDs - *out = make([]string, len(*in)) - copy(*out, *in) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AuthConfig. -func (in *AuthConfig) DeepCopy() *AuthConfig { - if in == nil { - return nil - } - out := new(AuthConfig) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *AuthConfig) 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 *AuthConfigList) DeepCopyInto(out *AuthConfigList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]AuthConfig, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AuthConfigList. -func (in *AuthConfigList) DeepCopy() *AuthConfigList { - if in == nil { - return nil - } - out := new(AuthConfigList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *AuthConfigList) 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 *AuthSystemImages) DeepCopyInto(out *AuthSystemImages) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AuthSystemImages. -func (in *AuthSystemImages) DeepCopy() *AuthSystemImages { - if in == nil { - return nil - } - out := new(AuthSystemImages) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AuthWebhookConfig) DeepCopyInto(out *AuthWebhookConfig) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AuthWebhookConfig. -func (in *AuthWebhookConfig) DeepCopy() *AuthWebhookConfig { - if in == nil { - return nil - } - out := new(AuthWebhookConfig) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AuthnConfig) DeepCopyInto(out *AuthnConfig) { - *out = *in - if in.SANs != nil { - in, out := &in.SANs, &out.SANs - *out = make([]string, len(*in)) - copy(*out, *in) - } - if in.Webhook != nil { - in, out := &in.Webhook, &out.Webhook - *out = new(AuthWebhookConfig) - **out = **in - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AuthnConfig. -func (in *AuthnConfig) DeepCopy() *AuthnConfig { - if in == nil { - return nil - } - out := new(AuthnConfig) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AuthzConfig) DeepCopyInto(out *AuthzConfig) { - *out = *in - if in.Options != nil { - in, out := &in.Options, &out.Options - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AuthzConfig. -func (in *AuthzConfig) DeepCopy() *AuthzConfig { - if in == nil { - return nil - } - out := new(AuthzConfig) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AzureADConfig) DeepCopyInto(out *AzureADConfig) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.AuthConfig.DeepCopyInto(&out.AuthConfig) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureADConfig. -func (in *AzureADConfig) DeepCopy() *AzureADConfig { - if in == nil { - return nil - } - out := new(AzureADConfig) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *AzureADConfig) 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 *AzureADConfigApplyInput) DeepCopyInto(out *AzureADConfigApplyInput) { - *out = *in - in.Config.DeepCopyInto(&out.Config) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureADConfigApplyInput. -func (in *AzureADConfigApplyInput) DeepCopy() *AzureADConfigApplyInput { - if in == nil { - return nil - } - out := new(AzureADConfigApplyInput) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AzureADConfigTestOutput) DeepCopyInto(out *AzureADConfigTestOutput) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureADConfigTestOutput. -func (in *AzureADConfigTestOutput) DeepCopy() *AzureADConfigTestOutput { - if in == nil { - return nil - } - out := new(AzureADConfigTestOutput) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AzureCloudProvider) DeepCopyInto(out *AzureCloudProvider) { - *out = *in - if in.ExcludeMasterFromStandardLB != nil { - in, out := &in.ExcludeMasterFromStandardLB, &out.ExcludeMasterFromStandardLB - *out = new(bool) - **out = **in - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureCloudProvider. -func (in *AzureCloudProvider) DeepCopy() *AzureCloudProvider { - if in == nil { - return nil - } - out := new(AzureCloudProvider) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *BackupConfig) DeepCopyInto(out *BackupConfig) { - *out = *in - if in.Enabled != nil { - in, out := &in.Enabled, &out.Enabled - *out = new(bool) - **out = **in - } - if in.S3BackupConfig != nil { - in, out := &in.S3BackupConfig, &out.S3BackupConfig - *out = new(S3BackupConfig) - **out = **in - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BackupConfig. -func (in *BackupConfig) DeepCopy() *BackupConfig { - if in == nil { - return nil - } - out := new(BackupConfig) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *BaseService) DeepCopyInto(out *BaseService) { - *out = *in - if in.ExtraArgs != nil { - in, out := &in.ExtraArgs, &out.ExtraArgs - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - if in.ExtraBinds != nil { - in, out := &in.ExtraBinds, &out.ExtraBinds - *out = make([]string, len(*in)) - copy(*out, *in) - } - if in.ExtraEnv != nil { - in, out := &in.ExtraEnv, &out.ExtraEnv - *out = make([]string, len(*in)) - copy(*out, *in) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BaseService. -func (in *BaseService) DeepCopy() *BaseService { - if in == nil { - return nil - } - out := new(BaseService) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *BastionHost) DeepCopyInto(out *BastionHost) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BastionHost. -func (in *BastionHost) DeepCopy() *BastionHost { - if in == nil { - return nil - } - out := new(BastionHost) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *BlockStorageOpenstackOpts) DeepCopyInto(out *BlockStorageOpenstackOpts) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BlockStorageOpenstackOpts. -func (in *BlockStorageOpenstackOpts) DeepCopy() *BlockStorageOpenstackOpts { - if in == nil { - return nil - } - out := new(BlockStorageOpenstackOpts) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *CalicoNetworkProvider) DeepCopyInto(out *CalicoNetworkProvider) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CalicoNetworkProvider. -func (in *CalicoNetworkProvider) DeepCopy() *CalicoNetworkProvider { - if in == nil { - return nil - } - out := new(CalicoNetworkProvider) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *CanalNetworkProvider) DeepCopyInto(out *CanalNetworkProvider) { - *out = *in - out.FlannelNetworkProvider = in.FlannelNetworkProvider - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CanalNetworkProvider. -func (in *CanalNetworkProvider) DeepCopy() *CanalNetworkProvider { - if in == nil { - return nil - } - out := new(CanalNetworkProvider) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Capabilities) DeepCopyInto(out *Capabilities) { - *out = *in - in.LoadBalancerCapabilities.DeepCopyInto(&out.LoadBalancerCapabilities) - if in.IngressCapabilities != nil { - in, out := &in.IngressCapabilities, &out.IngressCapabilities - *out = make([]IngressCapabilities, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.TaintSupport != nil { - in, out := &in.TaintSupport, &out.TaintSupport - *out = new(bool) - **out = **in - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Capabilities. -func (in *Capabilities) DeepCopy() *Capabilities { - if in == nil { - return nil - } - out := new(Capabilities) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Catalog) DeepCopyInto(out *Catalog) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - out.Spec = in.Spec - in.Status.DeepCopyInto(&out.Status) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Catalog. -func (in *Catalog) DeepCopy() *Catalog { - if in == nil { - return nil - } - out := new(Catalog) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *Catalog) 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 *CatalogCondition) DeepCopyInto(out *CatalogCondition) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CatalogCondition. -func (in *CatalogCondition) DeepCopy() *CatalogCondition { - if in == nil { - return nil - } - out := new(CatalogCondition) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *CatalogList) DeepCopyInto(out *CatalogList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]Catalog, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CatalogList. -func (in *CatalogList) DeepCopy() *CatalogList { - if in == nil { - return nil - } - out := new(CatalogList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *CatalogList) 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 *CatalogRefresh) DeepCopyInto(out *CatalogRefresh) { - *out = *in - if in.Catalogs != nil { - in, out := &in.Catalogs, &out.Catalogs - *out = make([]string, len(*in)) - copy(*out, *in) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CatalogRefresh. -func (in *CatalogRefresh) DeepCopy() *CatalogRefresh { - if in == nil { - return nil - } - out := new(CatalogRefresh) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *CatalogSpec) DeepCopyInto(out *CatalogSpec) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CatalogSpec. -func (in *CatalogSpec) DeepCopy() *CatalogSpec { - if in == nil { - return nil - } - out := new(CatalogSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *CatalogStatus) DeepCopyInto(out *CatalogStatus) { - *out = *in - if in.HelmVersionCommits != nil { - in, out := &in.HelmVersionCommits, &out.HelmVersionCommits - *out = make(map[string]VersionCommits, len(*in)) - for key, val := range *in { - (*out)[key] = *val.DeepCopy() - } - } - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make([]CatalogCondition, len(*in)) - copy(*out, *in) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CatalogStatus. -func (in *CatalogStatus) DeepCopy() *CatalogStatus { - if in == nil { - return nil - } - out := new(CatalogStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *CatalogTemplate) DeepCopyInto(out *CatalogTemplate) { - *out = *in - out.Namespaced = in.Namespaced - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Template.DeepCopyInto(&out.Template) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CatalogTemplate. -func (in *CatalogTemplate) DeepCopy() *CatalogTemplate { - if in == nil { - return nil - } - out := new(CatalogTemplate) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *CatalogTemplate) 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 *CatalogTemplateList) DeepCopyInto(out *CatalogTemplateList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]CatalogTemplate, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CatalogTemplateList. -func (in *CatalogTemplateList) DeepCopy() *CatalogTemplateList { - if in == nil { - return nil - } - out := new(CatalogTemplateList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *CatalogTemplateList) 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 *CatalogTemplateVersion) DeepCopyInto(out *CatalogTemplateVersion) { - *out = *in - out.Namespaced = in.Namespaced - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.TemplateVersion.DeepCopyInto(&out.TemplateVersion) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CatalogTemplateVersion. -func (in *CatalogTemplateVersion) DeepCopy() *CatalogTemplateVersion { - if in == nil { - return nil - } - out := new(CatalogTemplateVersion) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *CatalogTemplateVersion) 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 *CatalogTemplateVersionList) DeepCopyInto(out *CatalogTemplateVersionList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]CatalogTemplateVersion, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CatalogTemplateVersionList. -func (in *CatalogTemplateVersionList) DeepCopy() *CatalogTemplateVersionList { - if in == nil { - return nil - } - out := new(CatalogTemplateVersionList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *CatalogTemplateVersionList) 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 *CertExpiration) DeepCopyInto(out *CertExpiration) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CertExpiration. -func (in *CertExpiration) DeepCopy() *CertExpiration { - if in == nil { - return nil - } - out := new(CertExpiration) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ChangePasswordInput) DeepCopyInto(out *ChangePasswordInput) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ChangePasswordInput. -func (in *ChangePasswordInput) DeepCopy() *ChangePasswordInput { - if in == nil { - return nil - } - out := new(ChangePasswordInput) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *CisBenchmarkVersion) DeepCopyInto(out *CisBenchmarkVersion) { - *out = *in - out.Namespaced = in.Namespaced - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Info.DeepCopyInto(&out.Info) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CisBenchmarkVersion. -func (in *CisBenchmarkVersion) DeepCopy() *CisBenchmarkVersion { - if in == nil { - return nil - } - out := new(CisBenchmarkVersion) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *CisBenchmarkVersion) 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 *CisBenchmarkVersionInfo) DeepCopyInto(out *CisBenchmarkVersionInfo) { - *out = *in - if in.SkippedChecks != nil { - in, out := &in.SkippedChecks, &out.SkippedChecks - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - if in.NotApplicableChecks != nil { - in, out := &in.NotApplicableChecks, &out.NotApplicableChecks - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CisBenchmarkVersionInfo. -func (in *CisBenchmarkVersionInfo) DeepCopy() *CisBenchmarkVersionInfo { - if in == nil { - return nil - } - out := new(CisBenchmarkVersionInfo) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *CisBenchmarkVersionList) DeepCopyInto(out *CisBenchmarkVersionList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]CisBenchmarkVersion, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CisBenchmarkVersionList. -func (in *CisBenchmarkVersionList) DeepCopy() *CisBenchmarkVersionList { - if in == nil { - return nil - } - out := new(CisBenchmarkVersionList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *CisBenchmarkVersionList) 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 *CisConfig) DeepCopyInto(out *CisConfig) { - *out = *in - out.Namespaced = in.Namespaced - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - out.Params = in.Params - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CisConfig. -func (in *CisConfig) DeepCopy() *CisConfig { - if in == nil { - return nil - } - out := new(CisConfig) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *CisConfig) 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 *CisConfigList) DeepCopyInto(out *CisConfigList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]CisConfig, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CisConfigList. -func (in *CisConfigList) DeepCopy() *CisConfigList { - if in == nil { - return nil - } - out := new(CisConfigList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *CisConfigList) 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 *CisConfigParams) DeepCopyInto(out *CisConfigParams) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CisConfigParams. -func (in *CisConfigParams) DeepCopy() *CisConfigParams { - if in == nil { - return nil - } - out := new(CisConfigParams) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *CisScanConfig) DeepCopyInto(out *CisScanConfig) { - *out = *in - if in.OverrideSkip != nil { - in, out := &in.OverrideSkip, &out.OverrideSkip - *out = make([]string, len(*in)) - copy(*out, *in) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CisScanConfig. -func (in *CisScanConfig) DeepCopy() *CisScanConfig { - if in == nil { - return nil - } - out := new(CisScanConfig) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *CisScanStatus) DeepCopyInto(out *CisScanStatus) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CisScanStatus. -func (in *CisScanStatus) DeepCopy() *CisScanStatus { - if in == nil { - return nil - } - out := new(CisScanStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *CloudCredential) DeepCopyInto(out *CloudCredential) { - *out = *in - out.Namespaced = in.Namespaced - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - out.Spec = in.Spec - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CloudCredential. -func (in *CloudCredential) DeepCopy() *CloudCredential { - if in == nil { - return nil - } - out := new(CloudCredential) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *CloudCredential) 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 *CloudCredentialList) DeepCopyInto(out *CloudCredentialList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]CloudCredential, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CloudCredentialList. -func (in *CloudCredentialList) DeepCopy() *CloudCredentialList { - if in == nil { - return nil - } - out := new(CloudCredentialList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *CloudCredentialList) 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 *CloudCredentialSpec) DeepCopyInto(out *CloudCredentialSpec) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CloudCredentialSpec. -func (in *CloudCredentialSpec) DeepCopy() *CloudCredentialSpec { - if in == nil { - return nil - } - out := new(CloudCredentialSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *CloudProvider) DeepCopyInto(out *CloudProvider) { - *out = *in - if in.AWSCloudProvider != nil { - in, out := &in.AWSCloudProvider, &out.AWSCloudProvider - *out = new(AWSCloudProvider) - (*in).DeepCopyInto(*out) - } - if in.AzureCloudProvider != nil { - in, out := &in.AzureCloudProvider, &out.AzureCloudProvider - *out = new(AzureCloudProvider) - (*in).DeepCopyInto(*out) - } - if in.OpenstackCloudProvider != nil { - in, out := &in.OpenstackCloudProvider, &out.OpenstackCloudProvider - *out = new(OpenstackCloudProvider) - **out = **in - } - if in.VsphereCloudProvider != nil { - in, out := &in.VsphereCloudProvider, &out.VsphereCloudProvider - *out = new(VsphereCloudProvider) - (*in).DeepCopyInto(*out) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CloudProvider. -func (in *CloudProvider) DeepCopy() *CloudProvider { - if in == nil { - return nil - } - out := new(CloudProvider) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *CloudflareProviderConfig) DeepCopyInto(out *CloudflareProviderConfig) { - *out = *in - if in.ProxySetting != nil { - in, out := &in.ProxySetting, &out.ProxySetting - *out = new(bool) - **out = **in - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CloudflareProviderConfig. -func (in *CloudflareProviderConfig) DeepCopy() *CloudflareProviderConfig { - if in == nil { - return nil - } - out := new(CloudflareProviderConfig) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Cluster) DeepCopyInto(out *Cluster) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) - in.Status.DeepCopyInto(&out.Status) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Cluster. -func (in *Cluster) DeepCopy() *Cluster { - if in == nil { - return nil - } - out := new(Cluster) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *Cluster) 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 *ClusterAlert) DeepCopyInto(out *ClusterAlert) { - *out = *in - out.Namespaced = in.Namespaced - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) - out.Status = in.Status - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterAlert. -func (in *ClusterAlert) DeepCopy() *ClusterAlert { - if in == nil { - return nil - } - out := new(ClusterAlert) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ClusterAlert) 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 *ClusterAlertGroup) DeepCopyInto(out *ClusterAlertGroup) { - *out = *in - out.Namespaced = in.Namespaced - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) - out.Status = in.Status - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterAlertGroup. -func (in *ClusterAlertGroup) DeepCopy() *ClusterAlertGroup { - if in == nil { - return nil - } - out := new(ClusterAlertGroup) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ClusterAlertGroup) 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 *ClusterAlertGroupList) DeepCopyInto(out *ClusterAlertGroupList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]ClusterAlertGroup, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterAlertGroupList. -func (in *ClusterAlertGroupList) DeepCopy() *ClusterAlertGroupList { - if in == nil { - return nil - } - out := new(ClusterAlertGroupList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ClusterAlertGroupList) 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 *ClusterAlertList) DeepCopyInto(out *ClusterAlertList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]ClusterAlert, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterAlertList. -func (in *ClusterAlertList) DeepCopy() *ClusterAlertList { - if in == nil { - return nil - } - out := new(ClusterAlertList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ClusterAlertList) 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 *ClusterAlertRule) DeepCopyInto(out *ClusterAlertRule) { - *out = *in - out.Namespaced = in.Namespaced - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) - out.Status = in.Status - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterAlertRule. -func (in *ClusterAlertRule) DeepCopy() *ClusterAlertRule { - if in == nil { - return nil - } - out := new(ClusterAlertRule) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ClusterAlertRule) 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 *ClusterAlertRuleList) DeepCopyInto(out *ClusterAlertRuleList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]ClusterAlertRule, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterAlertRuleList. -func (in *ClusterAlertRuleList) DeepCopy() *ClusterAlertRuleList { - if in == nil { - return nil - } - out := new(ClusterAlertRuleList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ClusterAlertRuleList) 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 *ClusterAlertRuleSpec) DeepCopyInto(out *ClusterAlertRuleSpec) { - *out = *in - in.CommonRuleField.DeepCopyInto(&out.CommonRuleField) - if in.NodeRule != nil { - in, out := &in.NodeRule, &out.NodeRule - *out = new(NodeRule) - (*in).DeepCopyInto(*out) - } - if in.EventRule != nil { - in, out := &in.EventRule, &out.EventRule - *out = new(EventRule) - **out = **in - } - if in.SystemServiceRule != nil { - in, out := &in.SystemServiceRule, &out.SystemServiceRule - *out = new(SystemServiceRule) - **out = **in - } - if in.MetricRule != nil { - in, out := &in.MetricRule, &out.MetricRule - *out = new(MetricRule) - **out = **in - } - if in.ClusterScanRule != nil { - in, out := &in.ClusterScanRule, &out.ClusterScanRule - *out = new(ClusterScanRule) - **out = **in - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterAlertRuleSpec. -func (in *ClusterAlertRuleSpec) DeepCopy() *ClusterAlertRuleSpec { - if in == nil { - return nil - } - out := new(ClusterAlertRuleSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ClusterAlertSpec) DeepCopyInto(out *ClusterAlertSpec) { - *out = *in - in.AlertCommonSpec.DeepCopyInto(&out.AlertCommonSpec) - if in.TargetNode != nil { - in, out := &in.TargetNode, &out.TargetNode - *out = new(TargetNode) - (*in).DeepCopyInto(*out) - } - if in.TargetSystemService != nil { - in, out := &in.TargetSystemService, &out.TargetSystemService - *out = new(TargetSystemService) - **out = **in - } - if in.TargetEvent != nil { - in, out := &in.TargetEvent, &out.TargetEvent - *out = new(TargetEvent) - **out = **in - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterAlertSpec. -func (in *ClusterAlertSpec) DeepCopy() *ClusterAlertSpec { - if in == nil { - return nil - } - out := new(ClusterAlertSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ClusterCatalog) DeepCopyInto(out *ClusterCatalog) { - *out = *in - out.Namespaced = in.Namespaced - in.Catalog.DeepCopyInto(&out.Catalog) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterCatalog. -func (in *ClusterCatalog) DeepCopy() *ClusterCatalog { - if in == nil { - return nil - } - out := new(ClusterCatalog) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ClusterCatalog) 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 *ClusterCatalogList) DeepCopyInto(out *ClusterCatalogList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]ClusterCatalog, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterCatalogList. -func (in *ClusterCatalogList) DeepCopy() *ClusterCatalogList { - if in == nil { - return nil - } - out := new(ClusterCatalogList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ClusterCatalogList) 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 *ClusterComponentStatus) DeepCopyInto(out *ClusterComponentStatus) { - *out = *in - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make([]corev1.ComponentCondition, len(*in)) - copy(*out, *in) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterComponentStatus. -func (in *ClusterComponentStatus) DeepCopy() *ClusterComponentStatus { - if in == nil { - return nil - } - out := new(ClusterComponentStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ClusterCondition) DeepCopyInto(out *ClusterCondition) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterCondition. -func (in *ClusterCondition) DeepCopy() *ClusterCondition { - if in == nil { - return nil - } - out := new(ClusterCondition) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ClusterGroupSpec) DeepCopyInto(out *ClusterGroupSpec) { - *out = *in - if in.Recipients != nil { - in, out := &in.Recipients, &out.Recipients - *out = make([]Recipient, len(*in)) - copy(*out, *in) - } - out.CommonGroupField = in.CommonGroupField - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterGroupSpec. -func (in *ClusterGroupSpec) DeepCopy() *ClusterGroupSpec { - if in == nil { - return nil - } - out := new(ClusterGroupSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ClusterList) DeepCopyInto(out *ClusterList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]Cluster, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterList. -func (in *ClusterList) DeepCopy() *ClusterList { - if in == nil { - return nil - } - out := new(ClusterList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ClusterList) 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 *ClusterLogging) DeepCopyInto(out *ClusterLogging) { - *out = *in - out.Namespaced = in.Namespaced - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) - in.Status.DeepCopyInto(&out.Status) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterLogging. -func (in *ClusterLogging) DeepCopy() *ClusterLogging { - if in == nil { - return nil - } - out := new(ClusterLogging) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ClusterLogging) 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 *ClusterLoggingList) DeepCopyInto(out *ClusterLoggingList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]ClusterLogging, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterLoggingList. -func (in *ClusterLoggingList) DeepCopy() *ClusterLoggingList { - if in == nil { - return nil - } - out := new(ClusterLoggingList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ClusterLoggingList) 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 *ClusterLoggingSpec) DeepCopyInto(out *ClusterLoggingSpec) { - *out = *in - in.LoggingTargets.DeepCopyInto(&out.LoggingTargets) - in.LoggingCommonField.DeepCopyInto(&out.LoggingCommonField) - if in.IncludeSystemComponent != nil { - in, out := &in.IncludeSystemComponent, &out.IncludeSystemComponent - *out = new(bool) - **out = **in - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterLoggingSpec. -func (in *ClusterLoggingSpec) DeepCopy() *ClusterLoggingSpec { - if in == nil { - return nil - } - out := new(ClusterLoggingSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ClusterLoggingStatus) DeepCopyInto(out *ClusterLoggingStatus) { - *out = *in - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make([]LoggingCondition, len(*in)) - copy(*out, *in) - } - in.AppliedSpec.DeepCopyInto(&out.AppliedSpec) - if in.FailedSpec != nil { - in, out := &in.FailedSpec, &out.FailedSpec - *out = new(ClusterLoggingSpec) - (*in).DeepCopyInto(*out) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterLoggingStatus. -func (in *ClusterLoggingStatus) DeepCopy() *ClusterLoggingStatus { - if in == nil { - return nil - } - out := new(ClusterLoggingStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ClusterMetricNamesInput) DeepCopyInto(out *ClusterMetricNamesInput) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterMetricNamesInput. -func (in *ClusterMetricNamesInput) DeepCopy() *ClusterMetricNamesInput { - if in == nil { - return nil - } - out := new(ClusterMetricNamesInput) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ClusterMonitorGraph) DeepCopyInto(out *ClusterMonitorGraph) { - *out = *in - out.Namespaced = in.Namespaced - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterMonitorGraph. -func (in *ClusterMonitorGraph) DeepCopy() *ClusterMonitorGraph { - if in == nil { - return nil - } - out := new(ClusterMonitorGraph) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ClusterMonitorGraph) 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 *ClusterMonitorGraphList) DeepCopyInto(out *ClusterMonitorGraphList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]ClusterMonitorGraph, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterMonitorGraphList. -func (in *ClusterMonitorGraphList) DeepCopy() *ClusterMonitorGraphList { - if in == nil { - return nil - } - out := new(ClusterMonitorGraphList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ClusterMonitorGraphList) 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 *ClusterMonitorGraphSpec) DeepCopyInto(out *ClusterMonitorGraphSpec) { - *out = *in - in.CommonMonitorGraphSpec.DeepCopyInto(&out.CommonMonitorGraphSpec) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterMonitorGraphSpec. -func (in *ClusterMonitorGraphSpec) DeepCopy() *ClusterMonitorGraphSpec { - if in == nil { - return nil - } - out := new(ClusterMonitorGraphSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ClusterRegistrationToken) DeepCopyInto(out *ClusterRegistrationToken) { - *out = *in - out.Namespaced = in.Namespaced - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - out.Spec = in.Spec - out.Status = in.Status - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterRegistrationToken. -func (in *ClusterRegistrationToken) DeepCopy() *ClusterRegistrationToken { - if in == nil { - return nil - } - out := new(ClusterRegistrationToken) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ClusterRegistrationToken) 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 *ClusterRegistrationTokenList) DeepCopyInto(out *ClusterRegistrationTokenList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]ClusterRegistrationToken, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterRegistrationTokenList. -func (in *ClusterRegistrationTokenList) DeepCopy() *ClusterRegistrationTokenList { - if in == nil { - return nil - } - out := new(ClusterRegistrationTokenList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ClusterRegistrationTokenList) 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 *ClusterRegistrationTokenSpec) DeepCopyInto(out *ClusterRegistrationTokenSpec) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterRegistrationTokenSpec. -func (in *ClusterRegistrationTokenSpec) DeepCopy() *ClusterRegistrationTokenSpec { - if in == nil { - return nil - } - out := new(ClusterRegistrationTokenSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ClusterRegistrationTokenStatus) DeepCopyInto(out *ClusterRegistrationTokenStatus) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterRegistrationTokenStatus. -func (in *ClusterRegistrationTokenStatus) DeepCopy() *ClusterRegistrationTokenStatus { - if in == nil { - return nil - } - out := new(ClusterRegistrationTokenStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ClusterRoleTemplateBinding) DeepCopyInto(out *ClusterRoleTemplateBinding) { - *out = *in - out.Namespaced = in.Namespaced - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterRoleTemplateBinding. -func (in *ClusterRoleTemplateBinding) DeepCopy() *ClusterRoleTemplateBinding { - if in == nil { - return nil - } - out := new(ClusterRoleTemplateBinding) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ClusterRoleTemplateBinding) 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 *ClusterRoleTemplateBindingList) DeepCopyInto(out *ClusterRoleTemplateBindingList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]ClusterRoleTemplateBinding, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterRoleTemplateBindingList. -func (in *ClusterRoleTemplateBindingList) DeepCopy() *ClusterRoleTemplateBindingList { - if in == nil { - return nil - } - out := new(ClusterRoleTemplateBindingList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ClusterRoleTemplateBindingList) 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 *ClusterScan) DeepCopyInto(out *ClusterScan) { - *out = *in - out.Namespaced = in.Namespaced - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) - in.Status.DeepCopyInto(&out.Status) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterScan. -func (in *ClusterScan) DeepCopy() *ClusterScan { - if in == nil { - return nil - } - out := new(ClusterScan) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ClusterScan) 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 *ClusterScanCondition) DeepCopyInto(out *ClusterScanCondition) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterScanCondition. -func (in *ClusterScanCondition) DeepCopy() *ClusterScanCondition { - if in == nil { - return nil - } - out := new(ClusterScanCondition) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ClusterScanConfig) DeepCopyInto(out *ClusterScanConfig) { - *out = *in - if in.CisScanConfig != nil { - in, out := &in.CisScanConfig, &out.CisScanConfig - *out = new(CisScanConfig) - (*in).DeepCopyInto(*out) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterScanConfig. -func (in *ClusterScanConfig) DeepCopy() *ClusterScanConfig { - if in == nil { - return nil - } - out := new(ClusterScanConfig) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ClusterScanList) DeepCopyInto(out *ClusterScanList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]ClusterScan, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterScanList. -func (in *ClusterScanList) DeepCopy() *ClusterScanList { - if in == nil { - return nil - } - out := new(ClusterScanList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ClusterScanList) 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 *ClusterScanRule) DeepCopyInto(out *ClusterScanRule) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterScanRule. -func (in *ClusterScanRule) DeepCopy() *ClusterScanRule { - if in == nil { - return nil - } - out := new(ClusterScanRule) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ClusterScanSpec) DeepCopyInto(out *ClusterScanSpec) { - *out = *in - in.ScanConfig.DeepCopyInto(&out.ScanConfig) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterScanSpec. -func (in *ClusterScanSpec) DeepCopy() *ClusterScanSpec { - if in == nil { - return nil - } - out := new(ClusterScanSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ClusterScanStatus) DeepCopyInto(out *ClusterScanStatus) { - *out = *in - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make([]ClusterScanCondition, len(*in)) - copy(*out, *in) - } - if in.CisScanStatus != nil { - in, out := &in.CisScanStatus, &out.CisScanStatus - *out = new(CisScanStatus) - **out = **in - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterScanStatus. -func (in *ClusterScanStatus) DeepCopy() *ClusterScanStatus { - if in == nil { - return nil - } - out := new(ClusterScanStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ClusterSpec) DeepCopyInto(out *ClusterSpec) { - *out = *in - in.ClusterSpecBase.DeepCopyInto(&out.ClusterSpecBase) - if in.K3sConfig != nil { - in, out := &in.K3sConfig, &out.K3sConfig - *out = new(K3sConfig) - **out = **in - } - if in.ImportedConfig != nil { - in, out := &in.ImportedConfig, &out.ImportedConfig - *out = new(ImportedConfig) - **out = **in - } - if in.GoogleKubernetesEngineConfig != nil { - in, out := &in.GoogleKubernetesEngineConfig, &out.GoogleKubernetesEngineConfig - *out = (*in).DeepCopy() - } - if in.AzureKubernetesServiceConfig != nil { - in, out := &in.AzureKubernetesServiceConfig, &out.AzureKubernetesServiceConfig - *out = (*in).DeepCopy() - } - if in.AmazonElasticContainerServiceConfig != nil { - in, out := &in.AmazonElasticContainerServiceConfig, &out.AmazonElasticContainerServiceConfig - *out = (*in).DeepCopy() - } - if in.GenericEngineConfig != nil { - in, out := &in.GenericEngineConfig, &out.GenericEngineConfig - *out = (*in).DeepCopy() - } - in.ClusterTemplateAnswers.DeepCopyInto(&out.ClusterTemplateAnswers) - if in.ClusterTemplateQuestions != nil { - in, out := &in.ClusterTemplateQuestions, &out.ClusterTemplateQuestions - *out = make([]Question, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterSpec. -func (in *ClusterSpec) DeepCopy() *ClusterSpec { - if in == nil { - return nil - } - out := new(ClusterSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ClusterSpecBase) DeepCopyInto(out *ClusterSpecBase) { - *out = *in - if in.RancherKubernetesEngineConfig != nil { - in, out := &in.RancherKubernetesEngineConfig, &out.RancherKubernetesEngineConfig - *out = new(RancherKubernetesEngineConfig) - (*in).DeepCopyInto(*out) - } - if in.EnableNetworkPolicy != nil { - in, out := &in.EnableNetworkPolicy, &out.EnableNetworkPolicy - *out = new(bool) - **out = **in - } - out.LocalClusterAuthEndpoint = in.LocalClusterAuthEndpoint - if in.ScheduledClusterScan != nil { - in, out := &in.ScheduledClusterScan, &out.ScheduledClusterScan - *out = new(ScheduledClusterScan) - (*in).DeepCopyInto(*out) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterSpecBase. -func (in *ClusterSpecBase) DeepCopy() *ClusterSpecBase { - if in == nil { - return nil - } - out := new(ClusterSpecBase) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ClusterStatus) DeepCopyInto(out *ClusterStatus) { - *out = *in - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make([]ClusterCondition, len(*in)) - copy(*out, *in) - } - if in.AgentFeatures != nil { - in, out := &in.AgentFeatures, &out.AgentFeatures - *out = make(map[string]bool, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - if in.ComponentStatuses != nil { - in, out := &in.ComponentStatuses, &out.ComponentStatuses - *out = make([]ClusterComponentStatus, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.Capacity != nil { - in, out := &in.Capacity, &out.Capacity - *out = make(corev1.ResourceList, len(*in)) - for key, val := range *in { - (*out)[key] = val.DeepCopy() - } - } - if in.Allocatable != nil { - in, out := &in.Allocatable, &out.Allocatable - *out = make(corev1.ResourceList, len(*in)) - for key, val := range *in { - (*out)[key] = val.DeepCopy() - } - } - in.AppliedSpec.DeepCopyInto(&out.AppliedSpec) - if in.FailedSpec != nil { - in, out := &in.FailedSpec, &out.FailedSpec - *out = new(ClusterSpec) - (*in).DeepCopyInto(*out) - } - if in.Requested != nil { - in, out := &in.Requested, &out.Requested - *out = make(corev1.ResourceList, len(*in)) - for key, val := range *in { - (*out)[key] = val.DeepCopy() - } - } - if in.Limits != nil { - in, out := &in.Limits, &out.Limits - *out = make(corev1.ResourceList, len(*in)) - for key, val := range *in { - (*out)[key] = val.DeepCopy() - } - } - if in.Version != nil { - in, out := &in.Version, &out.Version - *out = new(version.Info) - **out = **in - } - in.Capabilities.DeepCopyInto(&out.Capabilities) - if in.MonitoringStatus != nil { - in, out := &in.MonitoringStatus, &out.MonitoringStatus - *out = new(MonitoringStatus) - (*in).DeepCopyInto(*out) - } - if in.CertificatesExpiration != nil { - in, out := &in.CertificatesExpiration, &out.CertificatesExpiration - *out = make(map[string]CertExpiration, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - if in.ScheduledClusterScanStatus != nil { - in, out := &in.ScheduledClusterScanStatus, &out.ScheduledClusterScanStatus - *out = new(ScheduledClusterScanStatus) - **out = **in - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterStatus. -func (in *ClusterStatus) DeepCopy() *ClusterStatus { - if in == nil { - return nil - } - out := new(ClusterStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ClusterTemplate) DeepCopyInto(out *ClusterTemplate) { - *out = *in - out.Namespaced = in.Namespaced - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterTemplate. -func (in *ClusterTemplate) DeepCopy() *ClusterTemplate { - if in == nil { - return nil - } - out := new(ClusterTemplate) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ClusterTemplate) 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 *ClusterTemplateList) DeepCopyInto(out *ClusterTemplateList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]ClusterTemplate, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterTemplateList. -func (in *ClusterTemplateList) DeepCopy() *ClusterTemplateList { - if in == nil { - return nil - } - out := new(ClusterTemplateList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ClusterTemplateList) 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 *ClusterTemplateQuestionsOutput) DeepCopyInto(out *ClusterTemplateQuestionsOutput) { - *out = *in - if in.Questions != nil { - in, out := &in.Questions, &out.Questions - *out = make([]Question, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterTemplateQuestionsOutput. -func (in *ClusterTemplateQuestionsOutput) DeepCopy() *ClusterTemplateQuestionsOutput { - if in == nil { - return nil - } - out := new(ClusterTemplateQuestionsOutput) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ClusterTemplateRevision) DeepCopyInto(out *ClusterTemplateRevision) { - *out = *in - out.Namespaced = in.Namespaced - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterTemplateRevision. -func (in *ClusterTemplateRevision) DeepCopy() *ClusterTemplateRevision { - if in == nil { - return nil - } - out := new(ClusterTemplateRevision) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ClusterTemplateRevision) 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 *ClusterTemplateRevisionList) DeepCopyInto(out *ClusterTemplateRevisionList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]ClusterTemplateRevision, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterTemplateRevisionList. -func (in *ClusterTemplateRevisionList) DeepCopy() *ClusterTemplateRevisionList { - if in == nil { - return nil - } - out := new(ClusterTemplateRevisionList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ClusterTemplateRevisionList) 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 *ClusterTemplateRevisionSpec) DeepCopyInto(out *ClusterTemplateRevisionSpec) { - *out = *in - if in.Enabled != nil { - in, out := &in.Enabled, &out.Enabled - *out = new(bool) - **out = **in - } - if in.Questions != nil { - in, out := &in.Questions, &out.Questions - *out = make([]Question, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.ClusterConfig != nil { - in, out := &in.ClusterConfig, &out.ClusterConfig - *out = new(ClusterSpecBase) - (*in).DeepCopyInto(*out) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterTemplateRevisionSpec. -func (in *ClusterTemplateRevisionSpec) DeepCopy() *ClusterTemplateRevisionSpec { - if in == nil { - return nil - } - out := new(ClusterTemplateRevisionSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ClusterTemplateSpec) DeepCopyInto(out *ClusterTemplateSpec) { - *out = *in - if in.Members != nil { - in, out := &in.Members, &out.Members - *out = make([]Member, len(*in)) - copy(*out, *in) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterTemplateSpec. -func (in *ClusterTemplateSpec) DeepCopy() *ClusterTemplateSpec { - if in == nil { - return nil - } - out := new(ClusterTemplateSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ClusterTestInput) DeepCopyInto(out *ClusterTestInput) { - *out = *in - in.LoggingTargets.DeepCopyInto(&out.LoggingTargets) - if in.OutputTags != nil { - in, out := &in.OutputTags, &out.OutputTags - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterTestInput. -func (in *ClusterTestInput) DeepCopy() *ClusterTestInput { - if in == nil { - return nil - } - out := new(ClusterTestInput) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *CommonGroupField) DeepCopyInto(out *CommonGroupField) { - *out = *in - out.TimingField = in.TimingField - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CommonGroupField. -func (in *CommonGroupField) DeepCopy() *CommonGroupField { - if in == nil { - return nil - } - out := new(CommonGroupField) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *CommonMonitorGraphSpec) DeepCopyInto(out *CommonMonitorGraphSpec) { - *out = *in - if in.MetricsSelector != nil { - in, out := &in.MetricsSelector, &out.MetricsSelector - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - if in.DetailsMetricsSelector != nil { - in, out := &in.DetailsMetricsSelector, &out.DetailsMetricsSelector - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - out.YAxis = in.YAxis - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CommonMonitorGraphSpec. -func (in *CommonMonitorGraphSpec) DeepCopy() *CommonMonitorGraphSpec { - if in == nil { - return nil - } - out := new(CommonMonitorGraphSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *CommonQueryMetricInput) DeepCopyInto(out *CommonQueryMetricInput) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CommonQueryMetricInput. -func (in *CommonQueryMetricInput) DeepCopy() *CommonQueryMetricInput { - if in == nil { - return nil - } - out := new(CommonQueryMetricInput) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *CommonRuleField) DeepCopyInto(out *CommonRuleField) { - *out = *in - if in.Inherited != nil { - in, out := &in.Inherited, &out.Inherited - *out = new(bool) - **out = **in - } - out.TimingField = in.TimingField - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CommonRuleField. -func (in *CommonRuleField) DeepCopy() *CommonRuleField { - if in == nil { - return nil - } - out := new(CommonRuleField) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ComposeCondition) DeepCopyInto(out *ComposeCondition) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ComposeCondition. -func (in *ComposeCondition) DeepCopy() *ComposeCondition { - if in == nil { - return nil - } - out := new(ComposeCondition) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ComposeConfig) DeepCopyInto(out *ComposeConfig) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - out.Spec = in.Spec - in.Status.DeepCopyInto(&out.Status) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ComposeConfig. -func (in *ComposeConfig) DeepCopy() *ComposeConfig { - if in == nil { - return nil - } - out := new(ComposeConfig) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ComposeConfig) 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 *ComposeConfigList) DeepCopyInto(out *ComposeConfigList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]ComposeConfig, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ComposeConfigList. -func (in *ComposeConfigList) DeepCopy() *ComposeConfigList { - if in == nil { - return nil - } - out := new(ComposeConfigList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ComposeConfigList) 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 *ComposeSpec) DeepCopyInto(out *ComposeSpec) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ComposeSpec. -func (in *ComposeSpec) DeepCopy() *ComposeSpec { - if in == nil { - return nil - } - out := new(ComposeSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ComposeStatus) DeepCopyInto(out *ComposeStatus) { - *out = *in - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make([]ComposeCondition, len(*in)) - copy(*out, *in) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ComposeStatus. -func (in *ComposeStatus) DeepCopy() *ComposeStatus { - if in == nil { - return nil - } - out := new(ComposeStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Condition) DeepCopyInto(out *Condition) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Condition. -func (in *Condition) DeepCopy() *Condition { - if in == nil { - return nil - } - out := new(Condition) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Configuration) DeepCopyInto(out *Configuration) { - *out = *in - out.TypeMeta = in.TypeMeta - if in.Limits != nil { - in, out := &in.Limits, &out.Limits - *out = make([]Limit, len(*in)) - copy(*out, *in) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Configuration. -func (in *Configuration) DeepCopy() *Configuration { - if in == nil { - return nil - } - out := new(Configuration) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *Configuration) 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 *ContainerResourceLimit) DeepCopyInto(out *ContainerResourceLimit) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ContainerResourceLimit. -func (in *ContainerResourceLimit) DeepCopy() *ContainerResourceLimit { - if in == nil { - return nil - } - out := new(ContainerResourceLimit) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *CustomConfig) DeepCopyInto(out *CustomConfig) { - *out = *in - if in.Label != nil { - in, out := &in.Label, &out.Label - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - if in.Taints != nil { - in, out := &in.Taints, &out.Taints - *out = make([]string, len(*in)) - copy(*out, *in) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CustomConfig. -func (in *CustomConfig) DeepCopy() *CustomConfig { - if in == nil { - return nil - } - out := new(CustomConfig) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *CustomTargetConfig) DeepCopyInto(out *CustomTargetConfig) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CustomTargetConfig. -func (in *CustomTargetConfig) DeepCopy() *CustomTargetConfig { - if in == nil { - return nil - } - out := new(CustomTargetConfig) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *DNSConfig) DeepCopyInto(out *DNSConfig) { - *out = *in - if in.UpstreamNameservers != nil { - in, out := &in.UpstreamNameservers, &out.UpstreamNameservers - *out = make([]string, len(*in)) - copy(*out, *in) - } - if in.ReverseCIDRs != nil { - in, out := &in.ReverseCIDRs, &out.ReverseCIDRs - *out = make([]string, len(*in)) - copy(*out, *in) - } - if in.StubDomains != nil { - in, out := &in.StubDomains, &out.StubDomains - *out = make(map[string][]string, len(*in)) - for key, val := range *in { - var outVal []string - if val == nil { - (*out)[key] = nil - } else { - in, out := &val, &outVal - *out = make([]string, len(*in)) - copy(*out, *in) - } - (*out)[key] = outVal - } - } - if in.NodeSelector != nil { - in, out := &in.NodeSelector, &out.NodeSelector - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - if in.Nodelocal != nil { - in, out := &in.Nodelocal, &out.Nodelocal - *out = new(Nodelocal) - (*in).DeepCopyInto(*out) - } - if in.UpdateStrategy != nil { - in, out := &in.UpdateStrategy, &out.UpdateStrategy - *out = new(DeploymentStrategy) - (*in).DeepCopyInto(*out) - } - if in.LinearAutoscalerParams != nil { - in, out := &in.LinearAutoscalerParams, &out.LinearAutoscalerParams - *out = new(LinearAutoscalerParams) - **out = **in - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DNSConfig. -func (in *DNSConfig) DeepCopy() *DNSConfig { - if in == nil { - return nil - } - out := new(DNSConfig) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *DaemonSetUpdateStrategy) DeepCopyInto(out *DaemonSetUpdateStrategy) { - *out = *in - if in.RollingUpdate != nil { - in, out := &in.RollingUpdate, &out.RollingUpdate - *out = new(appsv1.RollingUpdateDaemonSet) - (*in).DeepCopyInto(*out) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DaemonSetUpdateStrategy. -func (in *DaemonSetUpdateStrategy) DeepCopy() *DaemonSetUpdateStrategy { - if in == nil { - return nil - } - out := new(DaemonSetUpdateStrategy) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *DeploymentStrategy) DeepCopyInto(out *DeploymentStrategy) { - *out = *in - if in.RollingUpdate != nil { - in, out := &in.RollingUpdate, &out.RollingUpdate - *out = new(appsv1.RollingUpdateDeployment) - (*in).DeepCopyInto(*out) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DeploymentStrategy. -func (in *DeploymentStrategy) DeepCopy() *DeploymentStrategy { - if in == nil { - return nil - } - out := new(DeploymentStrategy) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *DiskVsphereOpts) DeepCopyInto(out *DiskVsphereOpts) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DiskVsphereOpts. -func (in *DiskVsphereOpts) DeepCopy() *DiskVsphereOpts { - if in == nil { - return nil - } - out := new(DiskVsphereOpts) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *DockerInfo) DeepCopyInto(out *DockerInfo) { - *out = *in - if in.SecurityOptions != nil { - in, out := &in.SecurityOptions, &out.SecurityOptions - *out = make([]string, len(*in)) - copy(*out, *in) - } - if in.Labels != nil { - in, out := &in.Labels, &out.Labels - *out = make([]string, len(*in)) - copy(*out, *in) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DockerInfo. -func (in *DockerInfo) DeepCopy() *DockerInfo { - if in == nil { - return nil - } - out := new(DockerInfo) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *DynamicSchema) DeepCopyInto(out *DynamicSchema) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) - out.Status = in.Status - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DynamicSchema. -func (in *DynamicSchema) DeepCopy() *DynamicSchema { - if in == nil { - return nil - } - out := new(DynamicSchema) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *DynamicSchema) 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 *DynamicSchemaList) DeepCopyInto(out *DynamicSchemaList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]DynamicSchema, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DynamicSchemaList. -func (in *DynamicSchemaList) DeepCopy() *DynamicSchemaList { - if in == nil { - return nil - } - out := new(DynamicSchemaList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *DynamicSchemaList) 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 *DynamicSchemaSpec) DeepCopyInto(out *DynamicSchemaSpec) { - *out = *in - if in.ResourceMethods != nil { - in, out := &in.ResourceMethods, &out.ResourceMethods - *out = make([]string, len(*in)) - copy(*out, *in) - } - if in.ResourceFields != nil { - in, out := &in.ResourceFields, &out.ResourceFields - *out = make(map[string]Field, len(*in)) - for key, val := range *in { - (*out)[key] = *val.DeepCopy() - } - } - if in.ResourceActions != nil { - in, out := &in.ResourceActions, &out.ResourceActions - *out = make(map[string]Action, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - if in.CollectionMethods != nil { - in, out := &in.CollectionMethods, &out.CollectionMethods - *out = make([]string, len(*in)) - copy(*out, *in) - } - if in.CollectionFields != nil { - in, out := &in.CollectionFields, &out.CollectionFields - *out = make(map[string]Field, len(*in)) - for key, val := range *in { - (*out)[key] = *val.DeepCopy() - } - } - if in.CollectionActions != nil { - in, out := &in.CollectionActions, &out.CollectionActions - *out = make(map[string]Action, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - if in.CollectionFilters != nil { - in, out := &in.CollectionFilters, &out.CollectionFilters - *out = make(map[string]Filter, len(*in)) - for key, val := range *in { - (*out)[key] = *val.DeepCopy() - } - } - if in.IncludeableLinks != nil { - in, out := &in.IncludeableLinks, &out.IncludeableLinks - *out = make([]string, len(*in)) - copy(*out, *in) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DynamicSchemaSpec. -func (in *DynamicSchemaSpec) DeepCopy() *DynamicSchemaSpec { - if in == nil { - return nil - } - out := new(DynamicSchemaSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *DynamicSchemaStatus) DeepCopyInto(out *DynamicSchemaStatus) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DynamicSchemaStatus. -func (in *DynamicSchemaStatus) DeepCopy() *DynamicSchemaStatus { - if in == nil { - return nil - } - out := new(DynamicSchemaStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ETCDService) DeepCopyInto(out *ETCDService) { - *out = *in - in.BaseService.DeepCopyInto(&out.BaseService) - if in.ExternalURLs != nil { - in, out := &in.ExternalURLs, &out.ExternalURLs - *out = make([]string, len(*in)) - copy(*out, *in) - } - if in.Snapshot != nil { - in, out := &in.Snapshot, &out.Snapshot - *out = new(bool) - **out = **in - } - if in.BackupConfig != nil { - in, out := &in.BackupConfig, &out.BackupConfig - *out = new(BackupConfig) - (*in).DeepCopyInto(*out) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ETCDService. -func (in *ETCDService) DeepCopy() *ETCDService { - if in == nil { - return nil - } - out := new(ETCDService) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ElasticsearchConfig) DeepCopyInto(out *ElasticsearchConfig) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ElasticsearchConfig. -func (in *ElasticsearchConfig) DeepCopy() *ElasticsearchConfig { - if in == nil { - return nil - } - out := new(ElasticsearchConfig) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *EtcdBackup) DeepCopyInto(out *EtcdBackup) { - *out = *in - out.Namespaced = in.Namespaced - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) - in.Status.DeepCopyInto(&out.Status) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EtcdBackup. -func (in *EtcdBackup) DeepCopy() *EtcdBackup { - if in == nil { - return nil - } - out := new(EtcdBackup) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *EtcdBackup) 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 *EtcdBackupCondition) DeepCopyInto(out *EtcdBackupCondition) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EtcdBackupCondition. -func (in *EtcdBackupCondition) DeepCopy() *EtcdBackupCondition { - if in == nil { - return nil - } - out := new(EtcdBackupCondition) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *EtcdBackupList) DeepCopyInto(out *EtcdBackupList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]EtcdBackup, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EtcdBackupList. -func (in *EtcdBackupList) DeepCopy() *EtcdBackupList { - if in == nil { - return nil - } - out := new(EtcdBackupList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *EtcdBackupList) 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 *EtcdBackupSpec) DeepCopyInto(out *EtcdBackupSpec) { - *out = *in - in.BackupConfig.DeepCopyInto(&out.BackupConfig) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EtcdBackupSpec. -func (in *EtcdBackupSpec) DeepCopy() *EtcdBackupSpec { - if in == nil { - return nil - } - out := new(EtcdBackupSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *EtcdBackupStatus) DeepCopyInto(out *EtcdBackupStatus) { - *out = *in - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make([]EtcdBackupCondition, len(*in)) - copy(*out, *in) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EtcdBackupStatus. -func (in *EtcdBackupStatus) DeepCopy() *EtcdBackupStatus { - if in == nil { - return nil - } - out := new(EtcdBackupStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *EventRateLimit) DeepCopyInto(out *EventRateLimit) { - *out = *in - if in.Configuration != nil { - in, out := &in.Configuration, &out.Configuration - *out = new(Configuration) - (*in).DeepCopyInto(*out) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EventRateLimit. -func (in *EventRateLimit) DeepCopy() *EventRateLimit { - if in == nil { - return nil - } - out := new(EventRateLimit) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *EventRule) DeepCopyInto(out *EventRule) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EventRule. -func (in *EventRule) DeepCopy() *EventRule { - if in == nil { - return nil - } - out := new(EventRule) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ExportOutput) DeepCopyInto(out *ExportOutput) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExportOutput. -func (in *ExportOutput) DeepCopy() *ExportOutput { - if in == nil { - return nil - } - out := new(ExportOutput) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ExtraEnv) DeepCopyInto(out *ExtraEnv) { - *out = *in - in.EnvVar.DeepCopyInto(&out.EnvVar) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExtraEnv. -func (in *ExtraEnv) DeepCopy() *ExtraEnv { - if in == nil { - return nil - } - out := new(ExtraEnv) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ExtraVolume) DeepCopyInto(out *ExtraVolume) { - *out = *in - in.Volume.DeepCopyInto(&out.Volume) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExtraVolume. -func (in *ExtraVolume) DeepCopy() *ExtraVolume { - if in == nil { - return nil - } - out := new(ExtraVolume) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ExtraVolumeMount) DeepCopyInto(out *ExtraVolumeMount) { - *out = *in - in.VolumeMount.DeepCopyInto(&out.VolumeMount) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExtraVolumeMount. -func (in *ExtraVolumeMount) DeepCopy() *ExtraVolumeMount { - if in == nil { - return nil - } - out := new(ExtraVolumeMount) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Feature) DeepCopyInto(out *Feature) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) - out.Status = in.Status - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Feature. -func (in *Feature) DeepCopy() *Feature { - if in == nil { - return nil - } - out := new(Feature) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *Feature) 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 *FeatureList) DeepCopyInto(out *FeatureList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]Feature, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FeatureList. -func (in *FeatureList) DeepCopy() *FeatureList { - if in == nil { - return nil - } - out := new(FeatureList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *FeatureList) 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 *FeatureSpec) DeepCopyInto(out *FeatureSpec) { - *out = *in - if in.Value != nil { - in, out := &in.Value, &out.Value - *out = new(bool) - **out = **in - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FeatureSpec. -func (in *FeatureSpec) DeepCopy() *FeatureSpec { - if in == nil { - return nil - } - out := new(FeatureSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *FeatureStatus) DeepCopyInto(out *FeatureStatus) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FeatureStatus. -func (in *FeatureStatus) DeepCopy() *FeatureStatus { - if in == nil { - return nil - } - out := new(FeatureStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Field) DeepCopyInto(out *Field) { - *out = *in - in.Default.DeepCopyInto(&out.Default) - if in.Options != nil { - in, out := &in.Options, &out.Options - *out = make([]string, len(*in)) - copy(*out, *in) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Field. -func (in *Field) DeepCopy() *Field { - if in == nil { - return nil - } - out := new(Field) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *File) DeepCopyInto(out *File) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new File. -func (in *File) DeepCopy() *File { - if in == nil { - return nil - } - out := new(File) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Filter) DeepCopyInto(out *Filter) { - *out = *in - if in.Modifiers != nil { - in, out := &in.Modifiers, &out.Modifiers - *out = make([]string, len(*in)) - copy(*out, *in) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Filter. -func (in *Filter) DeepCopy() *Filter { - if in == nil { - return nil - } - out := new(Filter) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *FlannelNetworkProvider) DeepCopyInto(out *FlannelNetworkProvider) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FlannelNetworkProvider. -func (in *FlannelNetworkProvider) DeepCopy() *FlannelNetworkProvider { - if in == nil { - return nil - } - out := new(FlannelNetworkProvider) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *FluentForwarderConfig) DeepCopyInto(out *FluentForwarderConfig) { - *out = *in - if in.Compress != nil { - in, out := &in.Compress, &out.Compress - *out = new(bool) - **out = **in - } - if in.FluentServers != nil { - in, out := &in.FluentServers, &out.FluentServers - *out = make([]FluentServer, len(*in)) - copy(*out, *in) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FluentForwarderConfig. -func (in *FluentForwarderConfig) DeepCopy() *FluentForwarderConfig { - if in == nil { - return nil - } - out := new(FluentForwarderConfig) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *FluentServer) DeepCopyInto(out *FluentServer) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FluentServer. -func (in *FluentServer) DeepCopy() *FluentServer { - if in == nil { - return nil - } - out := new(FluentServer) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *FreeIpaConfig) DeepCopyInto(out *FreeIpaConfig) { - *out = *in - in.LdapConfig.DeepCopyInto(&out.LdapConfig) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FreeIpaConfig. -func (in *FreeIpaConfig) DeepCopy() *FreeIpaConfig { - if in == nil { - return nil - } - out := new(FreeIpaConfig) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *FreeIpaConfig) 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 *FreeIpaTestAndApplyInput) DeepCopyInto(out *FreeIpaTestAndApplyInput) { - *out = *in - in.LdapTestAndApplyInput.DeepCopyInto(&out.LdapTestAndApplyInput) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FreeIpaTestAndApplyInput. -func (in *FreeIpaTestAndApplyInput) DeepCopy() *FreeIpaTestAndApplyInput { - if in == nil { - return nil - } - out := new(FreeIpaTestAndApplyInput) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *FreeIpaTestAndApplyInput) 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 *GenerateKubeConfigOutput) DeepCopyInto(out *GenerateKubeConfigOutput) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GenerateKubeConfigOutput. -func (in *GenerateKubeConfigOutput) DeepCopy() *GenerateKubeConfigOutput { - if in == nil { - return nil - } - out := new(GenerateKubeConfigOutput) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *GithubConfig) DeepCopyInto(out *GithubConfig) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.AuthConfig.DeepCopyInto(&out.AuthConfig) - if in.AdditionalClientIDs != nil { - in, out := &in.AdditionalClientIDs, &out.AdditionalClientIDs - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - if in.HostnameToClientID != nil { - in, out := &in.HostnameToClientID, &out.HostnameToClientID - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GithubConfig. -func (in *GithubConfig) DeepCopy() *GithubConfig { - if in == nil { - return nil - } - out := new(GithubConfig) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *GithubConfig) 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 *GithubConfigApplyInput) DeepCopyInto(out *GithubConfigApplyInput) { - *out = *in - in.GithubConfig.DeepCopyInto(&out.GithubConfig) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GithubConfigApplyInput. -func (in *GithubConfigApplyInput) DeepCopy() *GithubConfigApplyInput { - if in == nil { - return nil - } - out := new(GithubConfigApplyInput) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *GithubConfigTestOutput) DeepCopyInto(out *GithubConfigTestOutput) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GithubConfigTestOutput. -func (in *GithubConfigTestOutput) DeepCopy() *GithubConfigTestOutput { - if in == nil { - return nil - } - out := new(GithubConfigTestOutput) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *GlobalAwsOpts) DeepCopyInto(out *GlobalAwsOpts) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GlobalAwsOpts. -func (in *GlobalAwsOpts) DeepCopy() *GlobalAwsOpts { - if in == nil { - return nil - } - out := new(GlobalAwsOpts) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *GlobalDNSProvider) DeepCopyInto(out *GlobalDNSProvider) { - *out = *in - out.Namespaced = in.Namespaced - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GlobalDNSProvider. -func (in *GlobalDNSProvider) DeepCopy() *GlobalDNSProvider { - if in == nil { - return nil - } - out := new(GlobalDNSProvider) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *GlobalDNSProvider) 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 *GlobalDNSProviderList) DeepCopyInto(out *GlobalDNSProviderList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]GlobalDNSProvider, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GlobalDNSProviderList. -func (in *GlobalDNSProviderList) DeepCopy() *GlobalDNSProviderList { - if in == nil { - return nil - } - out := new(GlobalDNSProviderList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *GlobalDNSProviderList) 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 *GlobalDNSProviderSpec) DeepCopyInto(out *GlobalDNSProviderSpec) { - *out = *in - if in.Route53ProviderConfig != nil { - in, out := &in.Route53ProviderConfig, &out.Route53ProviderConfig - *out = new(Route53ProviderConfig) - **out = **in - } - if in.CloudflareProviderConfig != nil { - in, out := &in.CloudflareProviderConfig, &out.CloudflareProviderConfig - *out = new(CloudflareProviderConfig) - (*in).DeepCopyInto(*out) - } - if in.AlidnsProviderConfig != nil { - in, out := &in.AlidnsProviderConfig, &out.AlidnsProviderConfig - *out = new(AlidnsProviderConfig) - **out = **in - } - if in.Members != nil { - in, out := &in.Members, &out.Members - *out = make([]Member, len(*in)) - copy(*out, *in) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GlobalDNSProviderSpec. -func (in *GlobalDNSProviderSpec) DeepCopy() *GlobalDNSProviderSpec { - if in == nil { - return nil - } - out := new(GlobalDNSProviderSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *GlobalDNSSpec) DeepCopyInto(out *GlobalDNSSpec) { - *out = *in - if in.ProjectNames != nil { - in, out := &in.ProjectNames, &out.ProjectNames - *out = make([]string, len(*in)) - copy(*out, *in) - } - if in.Members != nil { - in, out := &in.Members, &out.Members - *out = make([]Member, len(*in)) - copy(*out, *in) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GlobalDNSSpec. -func (in *GlobalDNSSpec) DeepCopy() *GlobalDNSSpec { - if in == nil { - return nil - } - out := new(GlobalDNSSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *GlobalDNSStatus) DeepCopyInto(out *GlobalDNSStatus) { - *out = *in - if in.Endpoints != nil { - in, out := &in.Endpoints, &out.Endpoints - *out = make([]string, len(*in)) - copy(*out, *in) - } - if in.ClusterEndpoints != nil { - in, out := &in.ClusterEndpoints, &out.ClusterEndpoints - *out = make(map[string][]string, len(*in)) - for key, val := range *in { - var outVal []string - if val == nil { - (*out)[key] = nil - } else { - in, out := &val, &outVal - *out = make([]string, len(*in)) - copy(*out, *in) - } - (*out)[key] = outVal - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GlobalDNSStatus. -func (in *GlobalDNSStatus) DeepCopy() *GlobalDNSStatus { - if in == nil { - return nil - } - out := new(GlobalDNSStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *GlobalDns) DeepCopyInto(out *GlobalDns) { - *out = *in - out.Namespaced = in.Namespaced - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) - in.Status.DeepCopyInto(&out.Status) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GlobalDns. -func (in *GlobalDns) DeepCopy() *GlobalDns { - if in == nil { - return nil - } - out := new(GlobalDns) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *GlobalDns) 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 *GlobalDnsList) DeepCopyInto(out *GlobalDnsList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]GlobalDns, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GlobalDnsList. -func (in *GlobalDnsList) DeepCopy() *GlobalDnsList { - if in == nil { - return nil - } - out := new(GlobalDnsList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *GlobalDnsList) 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 *GlobalOpenstackOpts) DeepCopyInto(out *GlobalOpenstackOpts) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GlobalOpenstackOpts. -func (in *GlobalOpenstackOpts) DeepCopy() *GlobalOpenstackOpts { - if in == nil { - return nil - } - out := new(GlobalOpenstackOpts) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *GlobalRole) DeepCopyInto(out *GlobalRole) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - if in.Rules != nil { - in, out := &in.Rules, &out.Rules - *out = make([]rbacv1.PolicyRule, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GlobalRole. -func (in *GlobalRole) DeepCopy() *GlobalRole { - if in == nil { - return nil - } - out := new(GlobalRole) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *GlobalRole) 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 *GlobalRoleBinding) DeepCopyInto(out *GlobalRoleBinding) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GlobalRoleBinding. -func (in *GlobalRoleBinding) DeepCopy() *GlobalRoleBinding { - if in == nil { - return nil - } - out := new(GlobalRoleBinding) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *GlobalRoleBinding) 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 *GlobalRoleBindingList) DeepCopyInto(out *GlobalRoleBindingList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]GlobalRoleBinding, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GlobalRoleBindingList. -func (in *GlobalRoleBindingList) DeepCopy() *GlobalRoleBindingList { - if in == nil { - return nil - } - out := new(GlobalRoleBindingList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *GlobalRoleBindingList) 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 *GlobalRoleList) DeepCopyInto(out *GlobalRoleList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]GlobalRole, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GlobalRoleList. -func (in *GlobalRoleList) DeepCopy() *GlobalRoleList { - if in == nil { - return nil - } - out := new(GlobalRoleList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *GlobalRoleList) 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 *GlobalVsphereOpts) DeepCopyInto(out *GlobalVsphereOpts) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GlobalVsphereOpts. -func (in *GlobalVsphereOpts) DeepCopy() *GlobalVsphereOpts { - if in == nil { - return nil - } - out := new(GlobalVsphereOpts) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *GoogleOauthConfig) DeepCopyInto(out *GoogleOauthConfig) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.AuthConfig.DeepCopyInto(&out.AuthConfig) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GoogleOauthConfig. -func (in *GoogleOauthConfig) DeepCopy() *GoogleOauthConfig { - if in == nil { - return nil - } - out := new(GoogleOauthConfig) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *GoogleOauthConfig) 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 *GoogleOauthConfigApplyInput) DeepCopyInto(out *GoogleOauthConfigApplyInput) { - *out = *in - in.GoogleOauthConfig.DeepCopyInto(&out.GoogleOauthConfig) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GoogleOauthConfigApplyInput. -func (in *GoogleOauthConfigApplyInput) DeepCopy() *GoogleOauthConfigApplyInput { - if in == nil { - return nil - } - out := new(GoogleOauthConfigApplyInput) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *GoogleOauthConfigTestOutput) DeepCopyInto(out *GoogleOauthConfigTestOutput) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GoogleOauthConfigTestOutput. -func (in *GoogleOauthConfigTestOutput) DeepCopy() *GoogleOauthConfigTestOutput { - if in == nil { - return nil - } - out := new(GoogleOauthConfigTestOutput) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Group) DeepCopyInto(out *Group) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Group. -func (in *Group) DeepCopy() *Group { - if in == nil { - return nil - } - out := new(Group) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *Group) 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 *GroupList) DeepCopyInto(out *GroupList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]Group, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GroupList. -func (in *GroupList) DeepCopy() *GroupList { - if in == nil { - return nil - } - out := new(GroupList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *GroupList) 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 *GroupMember) DeepCopyInto(out *GroupMember) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GroupMember. -func (in *GroupMember) DeepCopy() *GroupMember { - if in == nil { - return nil - } - out := new(GroupMember) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *GroupMember) 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 *GroupMemberList) DeepCopyInto(out *GroupMemberList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]GroupMember, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GroupMemberList. -func (in *GroupMemberList) DeepCopy() *GroupMemberList { - if in == nil { - return nil - } - out := new(GroupMemberList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *GroupMemberList) 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 *HTTPClientConfig) DeepCopyInto(out *HTTPClientConfig) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HTTPClientConfig. -func (in *HTTPClientConfig) DeepCopy() *HTTPClientConfig { - if in == nil { - return nil - } - out := new(HTTPClientConfig) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *HealthCheck) DeepCopyInto(out *HealthCheck) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HealthCheck. -func (in *HealthCheck) DeepCopy() *HealthCheck { - if in == nil { - return nil - } - out := new(HealthCheck) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ImportClusterYamlInput) DeepCopyInto(out *ImportClusterYamlInput) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ImportClusterYamlInput. -func (in *ImportClusterYamlInput) DeepCopy() *ImportClusterYamlInput { - if in == nil { - return nil - } - out := new(ImportClusterYamlInput) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ImportYamlOutput) DeepCopyInto(out *ImportYamlOutput) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ImportYamlOutput. -func (in *ImportYamlOutput) DeepCopy() *ImportYamlOutput { - if in == nil { - return nil - } - out := new(ImportYamlOutput) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ImportedConfig) DeepCopyInto(out *ImportedConfig) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ImportedConfig. -func (in *ImportedConfig) DeepCopy() *ImportedConfig { - if in == nil { - return nil - } - out := new(ImportedConfig) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *IngressCapabilities) DeepCopyInto(out *IngressCapabilities) { - *out = *in - if in.CustomDefaultBackend != nil { - in, out := &in.CustomDefaultBackend, &out.CustomDefaultBackend - *out = new(bool) - **out = **in - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IngressCapabilities. -func (in *IngressCapabilities) DeepCopy() *IngressCapabilities { - if in == nil { - return nil - } - out := new(IngressCapabilities) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *IngressConfig) DeepCopyInto(out *IngressConfig) { - *out = *in - if in.Options != nil { - in, out := &in.Options, &out.Options - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - if in.NodeSelector != nil { - in, out := &in.NodeSelector, &out.NodeSelector - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - if in.ExtraArgs != nil { - in, out := &in.ExtraArgs, &out.ExtraArgs - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - if in.ExtraEnvs != nil { - in, out := &in.ExtraEnvs, &out.ExtraEnvs - *out = make([]ExtraEnv, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.ExtraVolumes != nil { - in, out := &in.ExtraVolumes, &out.ExtraVolumes - *out = make([]ExtraVolume, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.ExtraVolumeMounts != nil { - in, out := &in.ExtraVolumeMounts, &out.ExtraVolumeMounts - *out = make([]ExtraVolumeMount, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.UpdateStrategy != nil { - in, out := &in.UpdateStrategy, &out.UpdateStrategy - *out = new(DaemonSetUpdateStrategy) - (*in).DeepCopyInto(*out) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IngressConfig. -func (in *IngressConfig) DeepCopy() *IngressConfig { - if in == nil { - return nil - } - out := new(IngressConfig) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *K3sConfig) DeepCopyInto(out *K3sConfig) { - *out = *in - out.K3sUpgradeStrategy = in.K3sUpgradeStrategy - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new K3sConfig. -func (in *K3sConfig) DeepCopy() *K3sConfig { - if in == nil { - return nil - } - out := new(K3sConfig) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *K3sUpgradeStrategy) DeepCopyInto(out *K3sUpgradeStrategy) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new K3sUpgradeStrategy. -func (in *K3sUpgradeStrategy) DeepCopy() *K3sUpgradeStrategy { - if in == nil { - return nil - } - out := new(K3sUpgradeStrategy) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *K8sVersionInfo) DeepCopyInto(out *K8sVersionInfo) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new K8sVersionInfo. -func (in *K8sVersionInfo) DeepCopy() *K8sVersionInfo { - if in == nil { - return nil - } - out := new(K8sVersionInfo) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *KafkaConfig) DeepCopyInto(out *KafkaConfig) { - *out = *in - if in.BrokerEndpoints != nil { - in, out := &in.BrokerEndpoints, &out.BrokerEndpoints - *out = make([]string, len(*in)) - copy(*out, *in) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KafkaConfig. -func (in *KafkaConfig) DeepCopy() *KafkaConfig { - if in == nil { - return nil - } - out := new(KafkaConfig) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *KeyCloakConfig) DeepCopyInto(out *KeyCloakConfig) { - *out = *in - in.SamlConfig.DeepCopyInto(&out.SamlConfig) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KeyCloakConfig. -func (in *KeyCloakConfig) DeepCopy() *KeyCloakConfig { - if in == nil { - return nil - } - out := new(KeyCloakConfig) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *KeyCloakConfig) 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 *KontainerDriver) DeepCopyInto(out *KontainerDriver) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) - in.Status.DeepCopyInto(&out.Status) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KontainerDriver. -func (in *KontainerDriver) DeepCopy() *KontainerDriver { - if in == nil { - return nil - } - out := new(KontainerDriver) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *KontainerDriver) 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 *KontainerDriverList) DeepCopyInto(out *KontainerDriverList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]KontainerDriver, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KontainerDriverList. -func (in *KontainerDriverList) DeepCopy() *KontainerDriverList { - if in == nil { - return nil - } - out := new(KontainerDriverList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *KontainerDriverList) 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 *KontainerDriverSpec) DeepCopyInto(out *KontainerDriverSpec) { - *out = *in - if in.WhitelistDomains != nil { - in, out := &in.WhitelistDomains, &out.WhitelistDomains - *out = make([]string, len(*in)) - copy(*out, *in) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KontainerDriverSpec. -func (in *KontainerDriverSpec) DeepCopy() *KontainerDriverSpec { - if in == nil { - return nil - } - out := new(KontainerDriverSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *KontainerDriverStatus) DeepCopyInto(out *KontainerDriverStatus) { - *out = *in - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make([]Condition, len(*in)) - copy(*out, *in) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KontainerDriverStatus. -func (in *KontainerDriverStatus) DeepCopy() *KontainerDriverStatus { - if in == nil { - return nil - } - out := new(KontainerDriverStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *KubeAPIService) DeepCopyInto(out *KubeAPIService) { - *out = *in - in.BaseService.DeepCopyInto(&out.BaseService) - if in.SecretsEncryptionConfig != nil { - in, out := &in.SecretsEncryptionConfig, &out.SecretsEncryptionConfig - *out = new(SecretsEncryptionConfig) - (*in).DeepCopyInto(*out) - } - if in.AuditLog != nil { - in, out := &in.AuditLog, &out.AuditLog - *out = new(AuditLog) - (*in).DeepCopyInto(*out) - } - if in.AdmissionConfiguration != nil { - in, out := &in.AdmissionConfiguration, &out.AdmissionConfiguration - *out = new(v1alpha1.AdmissionConfiguration) - (*in).DeepCopyInto(*out) - } - if in.EventRateLimit != nil { - in, out := &in.EventRateLimit, &out.EventRateLimit - *out = new(EventRateLimit) - (*in).DeepCopyInto(*out) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KubeAPIService. -func (in *KubeAPIService) DeepCopy() *KubeAPIService { - if in == nil { - return nil - } - out := new(KubeAPIService) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *KubeControllerService) DeepCopyInto(out *KubeControllerService) { - *out = *in - in.BaseService.DeepCopyInto(&out.BaseService) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KubeControllerService. -func (in *KubeControllerService) DeepCopy() *KubeControllerService { - if in == nil { - return nil - } - out := new(KubeControllerService) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *KubeletService) DeepCopyInto(out *KubeletService) { - *out = *in - in.BaseService.DeepCopyInto(&out.BaseService) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KubeletService. -func (in *KubeletService) DeepCopy() *KubeletService { - if in == nil { - return nil - } - out := new(KubeletService) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *KubeproxyService) DeepCopyInto(out *KubeproxyService) { - *out = *in - in.BaseService.DeepCopyInto(&out.BaseService) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KubeproxyService. -func (in *KubeproxyService) DeepCopy() *KubeproxyService { - if in == nil { - return nil - } - out := new(KubeproxyService) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *KubernetesServicesOptions) DeepCopyInto(out *KubernetesServicesOptions) { - *out = *in - if in.Etcd != nil { - in, out := &in.Etcd, &out.Etcd - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - if in.KubeAPI != nil { - in, out := &in.KubeAPI, &out.KubeAPI - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - if in.Kubelet != nil { - in, out := &in.Kubelet, &out.Kubelet - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - if in.Kubeproxy != nil { - in, out := &in.Kubeproxy, &out.Kubeproxy - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - if in.KubeController != nil { - in, out := &in.KubeController, &out.KubeController - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - if in.Scheduler != nil { - in, out := &in.Scheduler, &out.Scheduler - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KubernetesServicesOptions. -func (in *KubernetesServicesOptions) DeepCopy() *KubernetesServicesOptions { - if in == nil { - return nil - } - out := new(KubernetesServicesOptions) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *LdapConfig) DeepCopyInto(out *LdapConfig) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.AuthConfig.DeepCopyInto(&out.AuthConfig) - in.LdapFields.DeepCopyInto(&out.LdapFields) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LdapConfig. -func (in *LdapConfig) DeepCopy() *LdapConfig { - if in == nil { - return nil - } - out := new(LdapConfig) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *LdapConfig) 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 *LdapConfigList) DeepCopyInto(out *LdapConfigList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]LdapConfig, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LdapConfigList. -func (in *LdapConfigList) DeepCopy() *LdapConfigList { - if in == nil { - return nil - } - out := new(LdapConfigList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *LdapConfigList) 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 *LdapFields) DeepCopyInto(out *LdapFields) { - *out = *in - if in.Servers != nil { - in, out := &in.Servers, &out.Servers - *out = make([]string, len(*in)) - copy(*out, *in) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LdapFields. -func (in *LdapFields) DeepCopy() *LdapFields { - if in == nil { - return nil - } - out := new(LdapFields) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *LdapTestAndApplyInput) DeepCopyInto(out *LdapTestAndApplyInput) { - *out = *in - in.LdapConfig.DeepCopyInto(&out.LdapConfig) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LdapTestAndApplyInput. -func (in *LdapTestAndApplyInput) DeepCopy() *LdapTestAndApplyInput { - if in == nil { - return nil - } - out := new(LdapTestAndApplyInput) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *LdapTestAndApplyInput) 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 *Limit) DeepCopyInto(out *Limit) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Limit. -func (in *Limit) DeepCopy() *Limit { - if in == nil { - return nil - } - out := new(Limit) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *LinearAutoscalerParams) DeepCopyInto(out *LinearAutoscalerParams) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LinearAutoscalerParams. -func (in *LinearAutoscalerParams) DeepCopy() *LinearAutoscalerParams { - if in == nil { - return nil - } - out := new(LinearAutoscalerParams) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ListOpts) DeepCopyInto(out *ListOpts) { - *out = *in - if in.Filters != nil { - in, out := &in.Filters, &out.Filters - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ListOpts. -func (in *ListOpts) DeepCopy() *ListOpts { - if in == nil { - return nil - } - out := new(ListOpts) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *LoadBalancerCapabilities) DeepCopyInto(out *LoadBalancerCapabilities) { - *out = *in - if in.Enabled != nil { - in, out := &in.Enabled, &out.Enabled - *out = new(bool) - **out = **in - } - if in.ProtocolsSupported != nil { - in, out := &in.ProtocolsSupported, &out.ProtocolsSupported - *out = make([]string, len(*in)) - copy(*out, *in) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LoadBalancerCapabilities. -func (in *LoadBalancerCapabilities) DeepCopy() *LoadBalancerCapabilities { - if in == nil { - return nil - } - out := new(LoadBalancerCapabilities) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *LoadBalancerOpenstackOpts) DeepCopyInto(out *LoadBalancerOpenstackOpts) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LoadBalancerOpenstackOpts. -func (in *LoadBalancerOpenstackOpts) DeepCopy() *LoadBalancerOpenstackOpts { - if in == nil { - return nil - } - out := new(LoadBalancerOpenstackOpts) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *LocalClusterAuthEndpoint) DeepCopyInto(out *LocalClusterAuthEndpoint) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LocalClusterAuthEndpoint. -func (in *LocalClusterAuthEndpoint) DeepCopy() *LocalClusterAuthEndpoint { - if in == nil { - return nil - } - out := new(LocalClusterAuthEndpoint) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *LocalConfig) DeepCopyInto(out *LocalConfig) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.AuthConfig.DeepCopyInto(&out.AuthConfig) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LocalConfig. -func (in *LocalConfig) DeepCopy() *LocalConfig { - if in == nil { - return nil - } - out := new(LocalConfig) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *LocalConfig) 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 *LoggingCommonField) DeepCopyInto(out *LoggingCommonField) { - *out = *in - if in.OutputTags != nil { - in, out := &in.OutputTags, &out.OutputTags - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LoggingCommonField. -func (in *LoggingCommonField) DeepCopy() *LoggingCommonField { - if in == nil { - return nil - } - out := new(LoggingCommonField) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *LoggingCondition) DeepCopyInto(out *LoggingCondition) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LoggingCondition. -func (in *LoggingCondition) DeepCopy() *LoggingCondition { - if in == nil { - return nil - } - out := new(LoggingCondition) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *LoggingTargets) DeepCopyInto(out *LoggingTargets) { - *out = *in - if in.ElasticsearchConfig != nil { - in, out := &in.ElasticsearchConfig, &out.ElasticsearchConfig - *out = new(ElasticsearchConfig) - **out = **in - } - if in.SplunkConfig != nil { - in, out := &in.SplunkConfig, &out.SplunkConfig - *out = new(SplunkConfig) - **out = **in - } - if in.KafkaConfig != nil { - in, out := &in.KafkaConfig, &out.KafkaConfig - *out = new(KafkaConfig) - (*in).DeepCopyInto(*out) - } - if in.SyslogConfig != nil { - in, out := &in.SyslogConfig, &out.SyslogConfig - *out = new(SyslogConfig) - **out = **in - } - if in.FluentForwarderConfig != nil { - in, out := &in.FluentForwarderConfig, &out.FluentForwarderConfig - *out = new(FluentForwarderConfig) - (*in).DeepCopyInto(*out) - } - if in.CustomTargetConfig != nil { - in, out := &in.CustomTargetConfig, &out.CustomTargetConfig - *out = new(CustomTargetConfig) - **out = **in - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LoggingTargets. -func (in *LoggingTargets) DeepCopy() *LoggingTargets { - if in == nil { - return nil - } - out := new(LoggingTargets) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *MapDelta) DeepCopyInto(out *MapDelta) { - *out = *in - if in.Add != nil { - in, out := &in.Add, &out.Add - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - if in.Delete != nil { - in, out := &in.Delete, &out.Delete - *out = make(map[string]bool, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MapDelta. -func (in *MapDelta) DeepCopy() *MapDelta { - if in == nil { - return nil - } - out := new(MapDelta) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in MapStringInterface) DeepCopyInto(out *MapStringInterface) { - { - in := &in - clone := in.DeepCopy() - *out = *clone - return - } -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Member) DeepCopyInto(out *Member) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Member. -func (in *Member) DeepCopy() *Member { - if in == nil { - return nil - } - out := new(Member) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *MetadataOpenstackOpts) DeepCopyInto(out *MetadataOpenstackOpts) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MetadataOpenstackOpts. -func (in *MetadataOpenstackOpts) DeepCopy() *MetadataOpenstackOpts { - if in == nil { - return nil - } - out := new(MetadataOpenstackOpts) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *MetadataUpdate) DeepCopyInto(out *MetadataUpdate) { - *out = *in - in.Labels.DeepCopyInto(&out.Labels) - in.Annotations.DeepCopyInto(&out.Annotations) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MetadataUpdate. -func (in *MetadataUpdate) DeepCopy() *MetadataUpdate { - if in == nil { - return nil - } - out := new(MetadataUpdate) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *MetricNamesOutput) DeepCopyInto(out *MetricNamesOutput) { - *out = *in - if in.Names != nil { - in, out := &in.Names, &out.Names - *out = make([]string, len(*in)) - copy(*out, *in) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MetricNamesOutput. -func (in *MetricNamesOutput) DeepCopy() *MetricNamesOutput { - if in == nil { - return nil - } - out := new(MetricNamesOutput) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *MetricRule) DeepCopyInto(out *MetricRule) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MetricRule. -func (in *MetricRule) DeepCopy() *MetricRule { - if in == nil { - return nil - } - out := new(MetricRule) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *MonitorMetric) DeepCopyInto(out *MonitorMetric) { - *out = *in - out.Namespaced = in.Namespaced - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - out.Spec = in.Spec - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MonitorMetric. -func (in *MonitorMetric) DeepCopy() *MonitorMetric { - if in == nil { - return nil - } - out := new(MonitorMetric) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *MonitorMetric) 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 *MonitorMetricList) DeepCopyInto(out *MonitorMetricList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]MonitorMetric, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MonitorMetricList. -func (in *MonitorMetricList) DeepCopy() *MonitorMetricList { - if in == nil { - return nil - } - out := new(MonitorMetricList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *MonitorMetricList) 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 *MonitorMetricSpec) DeepCopyInto(out *MonitorMetricSpec) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MonitorMetricSpec. -func (in *MonitorMetricSpec) DeepCopy() *MonitorMetricSpec { - if in == nil { - return nil - } - out := new(MonitorMetricSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *MonitoringCondition) DeepCopyInto(out *MonitoringCondition) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MonitoringCondition. -func (in *MonitoringCondition) DeepCopy() *MonitoringCondition { - if in == nil { - return nil - } - out := new(MonitoringCondition) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *MonitoringConfig) DeepCopyInto(out *MonitoringConfig) { - *out = *in - if in.Options != nil { - in, out := &in.Options, &out.Options - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - if in.NodeSelector != nil { - in, out := &in.NodeSelector, &out.NodeSelector - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - if in.UpdateStrategy != nil { - in, out := &in.UpdateStrategy, &out.UpdateStrategy - *out = new(DeploymentStrategy) - (*in).DeepCopyInto(*out) - } - if in.Replicas != nil { - in, out := &in.Replicas, &out.Replicas - *out = new(int32) - **out = **in - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MonitoringConfig. -func (in *MonitoringConfig) DeepCopy() *MonitoringConfig { - if in == nil { - return nil - } - out := new(MonitoringConfig) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *MonitoringInput) DeepCopyInto(out *MonitoringInput) { - *out = *in - if in.Answers != nil { - in, out := &in.Answers, &out.Answers - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MonitoringInput. -func (in *MonitoringInput) DeepCopy() *MonitoringInput { - if in == nil { - return nil - } - out := new(MonitoringInput) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *MonitoringOutput) DeepCopyInto(out *MonitoringOutput) { - *out = *in - if in.Answers != nil { - in, out := &in.Answers, &out.Answers - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MonitoringOutput. -func (in *MonitoringOutput) DeepCopy() *MonitoringOutput { - if in == nil { - return nil - } - out := new(MonitoringOutput) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *MonitoringStatus) DeepCopyInto(out *MonitoringStatus) { - *out = *in - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make([]MonitoringCondition, len(*in)) - copy(*out, *in) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MonitoringStatus. -func (in *MonitoringStatus) DeepCopy() *MonitoringStatus { - if in == nil { - return nil - } - out := new(MonitoringStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *MultiClusterApp) DeepCopyInto(out *MultiClusterApp) { - *out = *in - out.Namespaced = in.Namespaced - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) - in.Status.DeepCopyInto(&out.Status) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MultiClusterApp. -func (in *MultiClusterApp) DeepCopy() *MultiClusterApp { - if in == nil { - return nil - } - out := new(MultiClusterApp) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *MultiClusterApp) 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 *MultiClusterAppList) DeepCopyInto(out *MultiClusterAppList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]MultiClusterApp, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MultiClusterAppList. -func (in *MultiClusterAppList) DeepCopy() *MultiClusterAppList { - if in == nil { - return nil - } - out := new(MultiClusterAppList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *MultiClusterAppList) 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 *MultiClusterAppRevision) DeepCopyInto(out *MultiClusterAppRevision) { - *out = *in - out.Namespaced = in.Namespaced - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - if in.Answers != nil { - in, out := &in.Answers, &out.Answers - *out = make([]Answer, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MultiClusterAppRevision. -func (in *MultiClusterAppRevision) DeepCopy() *MultiClusterAppRevision { - if in == nil { - return nil - } - out := new(MultiClusterAppRevision) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *MultiClusterAppRevision) 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 *MultiClusterAppRevisionList) DeepCopyInto(out *MultiClusterAppRevisionList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]MultiClusterAppRevision, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MultiClusterAppRevisionList. -func (in *MultiClusterAppRevisionList) DeepCopy() *MultiClusterAppRevisionList { - if in == nil { - return nil - } - out := new(MultiClusterAppRevisionList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *MultiClusterAppRevisionList) 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 *MultiClusterAppRollbackInput) DeepCopyInto(out *MultiClusterAppRollbackInput) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MultiClusterAppRollbackInput. -func (in *MultiClusterAppRollbackInput) DeepCopy() *MultiClusterAppRollbackInput { - if in == nil { - return nil - } - out := new(MultiClusterAppRollbackInput) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *MultiClusterAppSpec) DeepCopyInto(out *MultiClusterAppSpec) { - *out = *in - if in.Answers != nil { - in, out := &in.Answers, &out.Answers - *out = make([]Answer, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.Targets != nil { - in, out := &in.Targets, &out.Targets - *out = make([]Target, len(*in)) - copy(*out, *in) - } - if in.Members != nil { - in, out := &in.Members, &out.Members - *out = make([]Member, len(*in)) - copy(*out, *in) - } - if in.Roles != nil { - in, out := &in.Roles, &out.Roles - *out = make([]string, len(*in)) - copy(*out, *in) - } - in.UpgradeStrategy.DeepCopyInto(&out.UpgradeStrategy) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MultiClusterAppSpec. -func (in *MultiClusterAppSpec) DeepCopy() *MultiClusterAppSpec { - if in == nil { - return nil - } - out := new(MultiClusterAppSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *MultiClusterAppStatus) DeepCopyInto(out *MultiClusterAppStatus) { - *out = *in - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make([]projectcattleiov3.AppCondition, len(*in)) - copy(*out, *in) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MultiClusterAppStatus. -func (in *MultiClusterAppStatus) DeepCopy() *MultiClusterAppStatus { - if in == nil { - return nil - } - out := new(MultiClusterAppStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *NamespaceResourceQuota) DeepCopyInto(out *NamespaceResourceQuota) { - *out = *in - out.Limit = in.Limit - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NamespaceResourceQuota. -func (in *NamespaceResourceQuota) DeepCopy() *NamespaceResourceQuota { - if in == nil { - return nil - } - out := new(NamespaceResourceQuota) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *NetworkConfig) DeepCopyInto(out *NetworkConfig) { - *out = *in - if in.Options != nil { - in, out := &in.Options, &out.Options - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - if in.CalicoNetworkProvider != nil { - in, out := &in.CalicoNetworkProvider, &out.CalicoNetworkProvider - *out = new(CalicoNetworkProvider) - **out = **in - } - if in.CanalNetworkProvider != nil { - in, out := &in.CanalNetworkProvider, &out.CanalNetworkProvider - *out = new(CanalNetworkProvider) - **out = **in - } - if in.FlannelNetworkProvider != nil { - in, out := &in.FlannelNetworkProvider, &out.FlannelNetworkProvider - *out = new(FlannelNetworkProvider) - **out = **in - } - if in.WeaveNetworkProvider != nil { - in, out := &in.WeaveNetworkProvider, &out.WeaveNetworkProvider - *out = new(WeaveNetworkProvider) - **out = **in - } - if in.NodeSelector != nil { - in, out := &in.NodeSelector, &out.NodeSelector - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - if in.UpdateStrategy != nil { - in, out := &in.UpdateStrategy, &out.UpdateStrategy - *out = new(DaemonSetUpdateStrategy) - (*in).DeepCopyInto(*out) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NetworkConfig. -func (in *NetworkConfig) DeepCopy() *NetworkConfig { - if in == nil { - return nil - } - out := new(NetworkConfig) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *NetworkVshpereOpts) DeepCopyInto(out *NetworkVshpereOpts) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NetworkVshpereOpts. -func (in *NetworkVshpereOpts) DeepCopy() *NetworkVshpereOpts { - if in == nil { - return nil - } - out := new(NetworkVshpereOpts) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Node) DeepCopyInto(out *Node) { - *out = *in - out.Namespaced = in.Namespaced - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) - in.Status.DeepCopyInto(&out.Status) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Node. -func (in *Node) DeepCopy() *Node { - if in == nil { - return nil - } - out := new(Node) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *Node) 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 *NodeCommonParams) DeepCopyInto(out *NodeCommonParams) { - *out = *in - if in.EngineOpt != nil { - in, out := &in.EngineOpt, &out.EngineOpt - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - if in.EngineInsecureRegistry != nil { - in, out := &in.EngineInsecureRegistry, &out.EngineInsecureRegistry - *out = make([]string, len(*in)) - copy(*out, *in) - } - if in.EngineRegistryMirror != nil { - in, out := &in.EngineRegistryMirror, &out.EngineRegistryMirror - *out = make([]string, len(*in)) - copy(*out, *in) - } - if in.EngineLabel != nil { - in, out := &in.EngineLabel, &out.EngineLabel - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - if in.EngineEnv != nil { - in, out := &in.EngineEnv, &out.EngineEnv - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - if in.UseInternalIPAddress != nil { - in, out := &in.UseInternalIPAddress, &out.UseInternalIPAddress - *out = new(bool) - **out = **in - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeCommonParams. -func (in *NodeCommonParams) DeepCopy() *NodeCommonParams { - if in == nil { - return nil - } - out := new(NodeCommonParams) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *NodeCondition) DeepCopyInto(out *NodeCondition) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeCondition. -func (in *NodeCondition) DeepCopy() *NodeCondition { - if in == nil { - return nil - } - out := new(NodeCondition) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *NodeDrainInput) DeepCopyInto(out *NodeDrainInput) { - *out = *in - if in.IgnoreDaemonSets != nil { - in, out := &in.IgnoreDaemonSets, &out.IgnoreDaemonSets - *out = new(bool) - **out = **in - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeDrainInput. -func (in *NodeDrainInput) DeepCopy() *NodeDrainInput { - if in == nil { - return nil - } - out := new(NodeDrainInput) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *NodeDriver) DeepCopyInto(out *NodeDriver) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) - in.Status.DeepCopyInto(&out.Status) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeDriver. -func (in *NodeDriver) DeepCopy() *NodeDriver { - if in == nil { - return nil - } - out := new(NodeDriver) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *NodeDriver) 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 *NodeDriverList) DeepCopyInto(out *NodeDriverList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]NodeDriver, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeDriverList. -func (in *NodeDriverList) DeepCopy() *NodeDriverList { - if in == nil { - return nil - } - out := new(NodeDriverList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *NodeDriverList) 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 *NodeDriverSpec) DeepCopyInto(out *NodeDriverSpec) { - *out = *in - if in.WhitelistDomains != nil { - in, out := &in.WhitelistDomains, &out.WhitelistDomains - *out = make([]string, len(*in)) - copy(*out, *in) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeDriverSpec. -func (in *NodeDriverSpec) DeepCopy() *NodeDriverSpec { - if in == nil { - return nil - } - out := new(NodeDriverSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *NodeDriverStatus) DeepCopyInto(out *NodeDriverStatus) { - *out = *in - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make([]Condition, len(*in)) - copy(*out, *in) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeDriverStatus. -func (in *NodeDriverStatus) DeepCopy() *NodeDriverStatus { - if in == nil { - return nil - } - out := new(NodeDriverStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *NodeList) DeepCopyInto(out *NodeList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]Node, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeList. -func (in *NodeList) DeepCopy() *NodeList { - if in == nil { - return nil - } - out := new(NodeList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *NodeList) 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 *NodePlan) DeepCopyInto(out *NodePlan) { - *out = *in - if in.Plan != nil { - in, out := &in.Plan, &out.Plan - *out = new(RKEConfigNodePlan) - (*in).DeepCopyInto(*out) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodePlan. -func (in *NodePlan) DeepCopy() *NodePlan { - if in == nil { - return nil - } - out := new(NodePlan) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *NodePool) DeepCopyInto(out *NodePool) { - *out = *in - out.Namespaced = in.Namespaced - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) - in.Status.DeepCopyInto(&out.Status) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodePool. -func (in *NodePool) DeepCopy() *NodePool { - if in == nil { - return nil - } - out := new(NodePool) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *NodePool) 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 *NodePoolList) DeepCopyInto(out *NodePoolList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]NodePool, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodePoolList. -func (in *NodePoolList) DeepCopy() *NodePoolList { - if in == nil { - return nil - } - out := new(NodePoolList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *NodePoolList) 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 *NodePoolSpec) DeepCopyInto(out *NodePoolSpec) { - *out = *in - if in.NodeLabels != nil { - in, out := &in.NodeLabels, &out.NodeLabels - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - if in.NodeAnnotations != nil { - in, out := &in.NodeAnnotations, &out.NodeAnnotations - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - if in.NodeTaints != nil { - in, out := &in.NodeTaints, &out.NodeTaints - *out = make([]corev1.Taint, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodePoolSpec. -func (in *NodePoolSpec) DeepCopy() *NodePoolSpec { - if in == nil { - return nil - } - out := new(NodePoolSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *NodePoolStatus) DeepCopyInto(out *NodePoolStatus) { - *out = *in - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make([]Condition, len(*in)) - copy(*out, *in) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodePoolStatus. -func (in *NodePoolStatus) DeepCopy() *NodePoolStatus { - if in == nil { - return nil - } - out := new(NodePoolStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *NodeRule) DeepCopyInto(out *NodeRule) { - *out = *in - if in.Selector != nil { - in, out := &in.Selector, &out.Selector - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeRule. -func (in *NodeRule) DeepCopy() *NodeRule { - if in == nil { - return nil - } - out := new(NodeRule) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *NodeSpec) DeepCopyInto(out *NodeSpec) { - *out = *in - if in.CustomConfig != nil { - in, out := &in.CustomConfig, &out.CustomConfig - *out = new(CustomConfig) - (*in).DeepCopyInto(*out) - } - in.InternalNodeSpec.DeepCopyInto(&out.InternalNodeSpec) - if in.DesiredNodeTaints != nil { - in, out := &in.DesiredNodeTaints, &out.DesiredNodeTaints - *out = make([]corev1.Taint, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.UpdateTaintsFromAPI != nil { - in, out := &in.UpdateTaintsFromAPI, &out.UpdateTaintsFromAPI - *out = new(bool) - **out = **in - } - if in.NodeDrainInput != nil { - in, out := &in.NodeDrainInput, &out.NodeDrainInput - *out = new(NodeDrainInput) - (*in).DeepCopyInto(*out) - } - in.MetadataUpdate.DeepCopyInto(&out.MetadataUpdate) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeSpec. -func (in *NodeSpec) DeepCopy() *NodeSpec { - if in == nil { - return nil - } - out := new(NodeSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *NodeStatus) DeepCopyInto(out *NodeStatus) { - *out = *in - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make([]NodeCondition, len(*in)) - copy(*out, *in) - } - in.InternalNodeStatus.DeepCopyInto(&out.InternalNodeStatus) - if in.Requested != nil { - in, out := &in.Requested, &out.Requested - *out = make(corev1.ResourceList, len(*in)) - for key, val := range *in { - (*out)[key] = val.DeepCopy() - } - } - if in.Limits != nil { - in, out := &in.Limits, &out.Limits - *out = make(corev1.ResourceList, len(*in)) - for key, val := range *in { - (*out)[key] = val.DeepCopy() - } - } - if in.NodeTemplateSpec != nil { - in, out := &in.NodeTemplateSpec, &out.NodeTemplateSpec - *out = new(NodeTemplateSpec) - (*in).DeepCopyInto(*out) - } - if in.NodeConfig != nil { - in, out := &in.NodeConfig, &out.NodeConfig - *out = new(RKEConfigNode) - (*in).DeepCopyInto(*out) - } - if in.NodeAnnotations != nil { - in, out := &in.NodeAnnotations, &out.NodeAnnotations - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - if in.NodeLabels != nil { - in, out := &in.NodeLabels, &out.NodeLabels - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - if in.NodeTaints != nil { - in, out := &in.NodeTaints, &out.NodeTaints - *out = make([]corev1.Taint, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.DockerInfo != nil { - in, out := &in.DockerInfo, &out.DockerInfo - *out = new(DockerInfo) - (*in).DeepCopyInto(*out) - } - if in.NodePlan != nil { - in, out := &in.NodePlan, &out.NodePlan - *out = new(NodePlan) - (*in).DeepCopyInto(*out) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeStatus. -func (in *NodeStatus) DeepCopy() *NodeStatus { - if in == nil { - return nil - } - out := new(NodeStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *NodeTemplate) DeepCopyInto(out *NodeTemplate) { - *out = *in - out.Namespaced = in.Namespaced - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) - in.Status.DeepCopyInto(&out.Status) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeTemplate. -func (in *NodeTemplate) DeepCopy() *NodeTemplate { - if in == nil { - return nil - } - out := new(NodeTemplate) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *NodeTemplate) 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 *NodeTemplateCondition) DeepCopyInto(out *NodeTemplateCondition) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeTemplateCondition. -func (in *NodeTemplateCondition) DeepCopy() *NodeTemplateCondition { - if in == nil { - return nil - } - out := new(NodeTemplateCondition) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *NodeTemplateList) DeepCopyInto(out *NodeTemplateList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]NodeTemplate, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeTemplateList. -func (in *NodeTemplateList) DeepCopy() *NodeTemplateList { - if in == nil { - return nil - } - out := new(NodeTemplateList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *NodeTemplateList) 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 *NodeTemplateSpec) DeepCopyInto(out *NodeTemplateSpec) { - *out = *in - if in.NodeTaints != nil { - in, out := &in.NodeTaints, &out.NodeTaints - *out = make([]corev1.Taint, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - in.NodeCommonParams.DeepCopyInto(&out.NodeCommonParams) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeTemplateSpec. -func (in *NodeTemplateSpec) DeepCopy() *NodeTemplateSpec { - if in == nil { - return nil - } - out := new(NodeTemplateSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *NodeTemplateStatus) DeepCopyInto(out *NodeTemplateStatus) { - *out = *in - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make([]NodeTemplateCondition, len(*in)) - copy(*out, *in) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeTemplateStatus. -func (in *NodeTemplateStatus) DeepCopy() *NodeTemplateStatus { - if in == nil { - return nil - } - out := new(NodeTemplateStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *NodeUpgradeStrategy) DeepCopyInto(out *NodeUpgradeStrategy) { - *out = *in - if in.DrainInput != nil { - in, out := &in.DrainInput, &out.DrainInput - *out = new(NodeDrainInput) - (*in).DeepCopyInto(*out) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeUpgradeStrategy. -func (in *NodeUpgradeStrategy) DeepCopy() *NodeUpgradeStrategy { - if in == nil { - return nil - } - out := new(NodeUpgradeStrategy) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Nodelocal) DeepCopyInto(out *Nodelocal) { - *out = *in - if in.UpdateStrategy != nil { - in, out := &in.UpdateStrategy, &out.UpdateStrategy - *out = new(DaemonSetUpdateStrategy) - (*in).DeepCopyInto(*out) - } - if in.NodeSelector != nil { - in, out := &in.NodeSelector, &out.NodeSelector - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Nodelocal. -func (in *Nodelocal) DeepCopy() *Nodelocal { - if in == nil { - return nil - } - out := new(Nodelocal) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Notification) DeepCopyInto(out *Notification) { - *out = *in - if in.SMTPConfig != nil { - in, out := &in.SMTPConfig, &out.SMTPConfig - *out = new(SMTPConfig) - (*in).DeepCopyInto(*out) - } - if in.SlackConfig != nil { - in, out := &in.SlackConfig, &out.SlackConfig - *out = new(SlackConfig) - (*in).DeepCopyInto(*out) - } - if in.PagerdutyConfig != nil { - in, out := &in.PagerdutyConfig, &out.PagerdutyConfig - *out = new(PagerdutyConfig) - (*in).DeepCopyInto(*out) - } - if in.WebhookConfig != nil { - in, out := &in.WebhookConfig, &out.WebhookConfig - *out = new(WebhookConfig) - (*in).DeepCopyInto(*out) - } - if in.WechatConfig != nil { - in, out := &in.WechatConfig, &out.WechatConfig - *out = new(WechatConfig) - (*in).DeepCopyInto(*out) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Notification. -func (in *Notification) DeepCopy() *Notification { - if in == nil { - return nil - } - out := new(Notification) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Notifier) DeepCopyInto(out *Notifier) { - *out = *in - out.Namespaced = in.Namespaced - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) - out.Status = in.Status - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Notifier. -func (in *Notifier) DeepCopy() *Notifier { - if in == nil { - return nil - } - out := new(Notifier) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *Notifier) 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 *NotifierList) DeepCopyInto(out *NotifierList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]Notifier, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NotifierList. -func (in *NotifierList) DeepCopy() *NotifierList { - if in == nil { - return nil - } - out := new(NotifierList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *NotifierList) 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 *NotifierSpec) DeepCopyInto(out *NotifierSpec) { - *out = *in - if in.SMTPConfig != nil { - in, out := &in.SMTPConfig, &out.SMTPConfig - *out = new(SMTPConfig) - (*in).DeepCopyInto(*out) - } - if in.SlackConfig != nil { - in, out := &in.SlackConfig, &out.SlackConfig - *out = new(SlackConfig) - (*in).DeepCopyInto(*out) - } - if in.PagerdutyConfig != nil { - in, out := &in.PagerdutyConfig, &out.PagerdutyConfig - *out = new(PagerdutyConfig) - (*in).DeepCopyInto(*out) - } - if in.WebhookConfig != nil { - in, out := &in.WebhookConfig, &out.WebhookConfig - *out = new(WebhookConfig) - (*in).DeepCopyInto(*out) - } - if in.WechatConfig != nil { - in, out := &in.WechatConfig, &out.WechatConfig - *out = new(WechatConfig) - (*in).DeepCopyInto(*out) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NotifierSpec. -func (in *NotifierSpec) DeepCopy() *NotifierSpec { - if in == nil { - return nil - } - out := new(NotifierSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *NotifierStatus) DeepCopyInto(out *NotifierStatus) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NotifierStatus. -func (in *NotifierStatus) DeepCopy() *NotifierStatus { - if in == nil { - return nil - } - out := new(NotifierStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *OKTAConfig) DeepCopyInto(out *OKTAConfig) { - *out = *in - in.SamlConfig.DeepCopyInto(&out.SamlConfig) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OKTAConfig. -func (in *OKTAConfig) DeepCopy() *OKTAConfig { - if in == nil { - return nil - } - out := new(OKTAConfig) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *OKTAConfig) 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 *OpenLdapConfig) DeepCopyInto(out *OpenLdapConfig) { - *out = *in - in.LdapConfig.DeepCopyInto(&out.LdapConfig) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OpenLdapConfig. -func (in *OpenLdapConfig) DeepCopy() *OpenLdapConfig { - if in == nil { - return nil - } - out := new(OpenLdapConfig) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *OpenLdapConfig) 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 *OpenLdapTestAndApplyInput) DeepCopyInto(out *OpenLdapTestAndApplyInput) { - *out = *in - in.LdapTestAndApplyInput.DeepCopyInto(&out.LdapTestAndApplyInput) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OpenLdapTestAndApplyInput. -func (in *OpenLdapTestAndApplyInput) DeepCopy() *OpenLdapTestAndApplyInput { - if in == nil { - return nil - } - out := new(OpenLdapTestAndApplyInput) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *OpenLdapTestAndApplyInput) 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 *OpenstackCloudProvider) DeepCopyInto(out *OpenstackCloudProvider) { - *out = *in - out.Global = in.Global - out.LoadBalancer = in.LoadBalancer - out.BlockStorage = in.BlockStorage - out.Route = in.Route - out.Metadata = in.Metadata - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OpenstackCloudProvider. -func (in *OpenstackCloudProvider) DeepCopy() *OpenstackCloudProvider { - if in == nil { - return nil - } - out := new(OpenstackCloudProvider) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *PagerdutyConfig) DeepCopyInto(out *PagerdutyConfig) { - *out = *in - if in.HTTPClientConfig != nil { - in, out := &in.HTTPClientConfig, &out.HTTPClientConfig - *out = new(HTTPClientConfig) - **out = **in - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PagerdutyConfig. -func (in *PagerdutyConfig) DeepCopy() *PagerdutyConfig { - if in == nil { - return nil - } - out := new(PagerdutyConfig) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *PingConfig) DeepCopyInto(out *PingConfig) { - *out = *in - in.SamlConfig.DeepCopyInto(&out.SamlConfig) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PingConfig. -func (in *PingConfig) DeepCopy() *PingConfig { - if in == nil { - return nil - } - out := new(PingConfig) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *PingConfig) 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 *PodRule) DeepCopyInto(out *PodRule) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodRule. -func (in *PodRule) DeepCopy() *PodRule { - if in == nil { - return nil - } - out := new(PodRule) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *PodSecurityPolicyTemplate) DeepCopyInto(out *PodSecurityPolicyTemplate) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodSecurityPolicyTemplate. -func (in *PodSecurityPolicyTemplate) DeepCopy() *PodSecurityPolicyTemplate { - if in == nil { - return nil - } - out := new(PodSecurityPolicyTemplate) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *PodSecurityPolicyTemplate) 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 *PodSecurityPolicyTemplateList) DeepCopyInto(out *PodSecurityPolicyTemplateList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]PodSecurityPolicyTemplate, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodSecurityPolicyTemplateList. -func (in *PodSecurityPolicyTemplateList) DeepCopy() *PodSecurityPolicyTemplateList { - if in == nil { - return nil - } - out := new(PodSecurityPolicyTemplateList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *PodSecurityPolicyTemplateList) 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 *PodSecurityPolicyTemplateProjectBinding) DeepCopyInto(out *PodSecurityPolicyTemplateProjectBinding) { - *out = *in - out.Namespaced = in.Namespaced - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodSecurityPolicyTemplateProjectBinding. -func (in *PodSecurityPolicyTemplateProjectBinding) DeepCopy() *PodSecurityPolicyTemplateProjectBinding { - if in == nil { - return nil - } - out := new(PodSecurityPolicyTemplateProjectBinding) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *PodSecurityPolicyTemplateProjectBinding) 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 *PodSecurityPolicyTemplateProjectBindingList) DeepCopyInto(out *PodSecurityPolicyTemplateProjectBindingList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]PodSecurityPolicyTemplateProjectBinding, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodSecurityPolicyTemplateProjectBindingList. -func (in *PodSecurityPolicyTemplateProjectBindingList) DeepCopy() *PodSecurityPolicyTemplateProjectBindingList { - if in == nil { - return nil - } - out := new(PodSecurityPolicyTemplateProjectBindingList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *PodSecurityPolicyTemplateProjectBindingList) 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 *PortCheck) DeepCopyInto(out *PortCheck) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PortCheck. -func (in *PortCheck) DeepCopy() *PortCheck { - if in == nil { - return nil - } - out := new(PortCheck) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Preference) DeepCopyInto(out *Preference) { - *out = *in - out.Namespaced = in.Namespaced - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Preference. -func (in *Preference) DeepCopy() *Preference { - if in == nil { - return nil - } - out := new(Preference) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *Preference) 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 *PreferenceList) DeepCopyInto(out *PreferenceList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]Preference, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PreferenceList. -func (in *PreferenceList) DeepCopy() *PreferenceList { - if in == nil { - return nil - } - out := new(PreferenceList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *PreferenceList) 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 *Principal) DeepCopyInto(out *Principal) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - if in.ExtraInfo != nil { - in, out := &in.ExtraInfo, &out.ExtraInfo - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Principal. -func (in *Principal) DeepCopy() *Principal { - if in == nil { - return nil - } - out := new(Principal) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *Principal) 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 *PrincipalList) DeepCopyInto(out *PrincipalList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]Principal, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PrincipalList. -func (in *PrincipalList) DeepCopy() *PrincipalList { - if in == nil { - return nil - } - out := new(PrincipalList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *PrincipalList) 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 *Principals) DeepCopyInto(out *Principals) { - *out = *in - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]Principal, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Principals. -func (in *Principals) DeepCopy() *Principals { - if in == nil { - return nil - } - out := new(Principals) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *PrivateRegistry) DeepCopyInto(out *PrivateRegistry) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PrivateRegistry. -func (in *PrivateRegistry) DeepCopy() *PrivateRegistry { - if in == nil { - return nil - } - out := new(PrivateRegistry) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Process) DeepCopyInto(out *Process) { - *out = *in - if in.Command != nil { - in, out := &in.Command, &out.Command - *out = make([]string, len(*in)) - copy(*out, *in) - } - if in.Args != nil { - in, out := &in.Args, &out.Args - *out = make([]string, len(*in)) - copy(*out, *in) - } - if in.Env != nil { - in, out := &in.Env, &out.Env - *out = make([]string, len(*in)) - copy(*out, *in) - } - if in.VolumesFrom != nil { - in, out := &in.VolumesFrom, &out.VolumesFrom - *out = make([]string, len(*in)) - copy(*out, *in) - } - if in.Binds != nil { - in, out := &in.Binds, &out.Binds - *out = make([]string, len(*in)) - copy(*out, *in) - } - out.HealthCheck = in.HealthCheck - 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.Publish != nil { - in, out := &in.Publish, &out.Publish - *out = make([]string, len(*in)) - copy(*out, *in) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Process. -func (in *Process) DeepCopy() *Process { - if in == nil { - return nil - } - out := new(Process) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Project) DeepCopyInto(out *Project) { - *out = *in - out.Namespaced = in.Namespaced - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) - in.Status.DeepCopyInto(&out.Status) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Project. -func (in *Project) DeepCopy() *Project { - if in == nil { - return nil - } - out := new(Project) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *Project) 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 *ProjectAlert) DeepCopyInto(out *ProjectAlert) { - *out = *in - out.Namespaced = in.Namespaced - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) - out.Status = in.Status - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProjectAlert. -func (in *ProjectAlert) DeepCopy() *ProjectAlert { - if in == nil { - return nil - } - out := new(ProjectAlert) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ProjectAlert) 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 *ProjectAlertGroup) DeepCopyInto(out *ProjectAlertGroup) { - *out = *in - out.Namespaced = in.Namespaced - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) - out.Status = in.Status - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProjectAlertGroup. -func (in *ProjectAlertGroup) DeepCopy() *ProjectAlertGroup { - if in == nil { - return nil - } - out := new(ProjectAlertGroup) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ProjectAlertGroup) 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 *ProjectAlertGroupList) DeepCopyInto(out *ProjectAlertGroupList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]ProjectAlertGroup, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProjectAlertGroupList. -func (in *ProjectAlertGroupList) DeepCopy() *ProjectAlertGroupList { - if in == nil { - return nil - } - out := new(ProjectAlertGroupList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ProjectAlertGroupList) 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 *ProjectAlertList) DeepCopyInto(out *ProjectAlertList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]ProjectAlert, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProjectAlertList. -func (in *ProjectAlertList) DeepCopy() *ProjectAlertList { - if in == nil { - return nil - } - out := new(ProjectAlertList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ProjectAlertList) 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 *ProjectAlertRule) DeepCopyInto(out *ProjectAlertRule) { - *out = *in - out.Namespaced = in.Namespaced - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) - out.Status = in.Status - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProjectAlertRule. -func (in *ProjectAlertRule) DeepCopy() *ProjectAlertRule { - if in == nil { - return nil - } - out := new(ProjectAlertRule) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ProjectAlertRule) 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 *ProjectAlertRuleList) DeepCopyInto(out *ProjectAlertRuleList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]ProjectAlertRule, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProjectAlertRuleList. -func (in *ProjectAlertRuleList) DeepCopy() *ProjectAlertRuleList { - if in == nil { - return nil - } - out := new(ProjectAlertRuleList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ProjectAlertRuleList) 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 *ProjectAlertRuleSpec) DeepCopyInto(out *ProjectAlertRuleSpec) { - *out = *in - in.CommonRuleField.DeepCopyInto(&out.CommonRuleField) - if in.PodRule != nil { - in, out := &in.PodRule, &out.PodRule - *out = new(PodRule) - **out = **in - } - if in.WorkloadRule != nil { - in, out := &in.WorkloadRule, &out.WorkloadRule - *out = new(WorkloadRule) - (*in).DeepCopyInto(*out) - } - if in.MetricRule != nil { - in, out := &in.MetricRule, &out.MetricRule - *out = new(MetricRule) - **out = **in - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProjectAlertRuleSpec. -func (in *ProjectAlertRuleSpec) DeepCopy() *ProjectAlertRuleSpec { - if in == nil { - return nil - } - out := new(ProjectAlertRuleSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ProjectAlertSpec) DeepCopyInto(out *ProjectAlertSpec) { - *out = *in - in.AlertCommonSpec.DeepCopyInto(&out.AlertCommonSpec) - if in.TargetWorkload != nil { - in, out := &in.TargetWorkload, &out.TargetWorkload - *out = new(TargetWorkload) - (*in).DeepCopyInto(*out) - } - if in.TargetPod != nil { - in, out := &in.TargetPod, &out.TargetPod - *out = new(TargetPod) - **out = **in - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProjectAlertSpec. -func (in *ProjectAlertSpec) DeepCopy() *ProjectAlertSpec { - if in == nil { - return nil - } - out := new(ProjectAlertSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ProjectCatalog) DeepCopyInto(out *ProjectCatalog) { - *out = *in - out.Namespaced = in.Namespaced - in.Catalog.DeepCopyInto(&out.Catalog) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProjectCatalog. -func (in *ProjectCatalog) DeepCopy() *ProjectCatalog { - if in == nil { - return nil - } - out := new(ProjectCatalog) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ProjectCatalog) 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 *ProjectCatalogList) DeepCopyInto(out *ProjectCatalogList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]ProjectCatalog, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProjectCatalogList. -func (in *ProjectCatalogList) DeepCopy() *ProjectCatalogList { - if in == nil { - return nil - } - out := new(ProjectCatalogList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ProjectCatalogList) 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 *ProjectCondition) DeepCopyInto(out *ProjectCondition) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProjectCondition. -func (in *ProjectCondition) DeepCopy() *ProjectCondition { - if in == nil { - return nil - } - out := new(ProjectCondition) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ProjectGroupSpec) DeepCopyInto(out *ProjectGroupSpec) { - *out = *in - if in.Recipients != nil { - in, out := &in.Recipients, &out.Recipients - *out = make([]Recipient, len(*in)) - copy(*out, *in) - } - out.CommonGroupField = in.CommonGroupField - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProjectGroupSpec. -func (in *ProjectGroupSpec) DeepCopy() *ProjectGroupSpec { - if in == nil { - return nil - } - out := new(ProjectGroupSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ProjectList) DeepCopyInto(out *ProjectList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]Project, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProjectList. -func (in *ProjectList) DeepCopy() *ProjectList { - if in == nil { - return nil - } - out := new(ProjectList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ProjectList) 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 *ProjectLogging) DeepCopyInto(out *ProjectLogging) { - *out = *in - out.Namespaced = in.Namespaced - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) - in.Status.DeepCopyInto(&out.Status) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProjectLogging. -func (in *ProjectLogging) DeepCopy() *ProjectLogging { - if in == nil { - return nil - } - out := new(ProjectLogging) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ProjectLogging) 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 *ProjectLoggingList) DeepCopyInto(out *ProjectLoggingList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]ProjectLogging, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProjectLoggingList. -func (in *ProjectLoggingList) DeepCopy() *ProjectLoggingList { - if in == nil { - return nil - } - out := new(ProjectLoggingList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ProjectLoggingList) 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 *ProjectLoggingSpec) DeepCopyInto(out *ProjectLoggingSpec) { - *out = *in - in.LoggingTargets.DeepCopyInto(&out.LoggingTargets) - in.LoggingCommonField.DeepCopyInto(&out.LoggingCommonField) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProjectLoggingSpec. -func (in *ProjectLoggingSpec) DeepCopy() *ProjectLoggingSpec { - if in == nil { - return nil - } - out := new(ProjectLoggingSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ProjectLoggingStatus) DeepCopyInto(out *ProjectLoggingStatus) { - *out = *in - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make([]LoggingCondition, len(*in)) - copy(*out, *in) - } - in.AppliedSpec.DeepCopyInto(&out.AppliedSpec) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProjectLoggingStatus. -func (in *ProjectLoggingStatus) DeepCopy() *ProjectLoggingStatus { - if in == nil { - return nil - } - out := new(ProjectLoggingStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ProjectMetricNamesInput) DeepCopyInto(out *ProjectMetricNamesInput) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProjectMetricNamesInput. -func (in *ProjectMetricNamesInput) DeepCopy() *ProjectMetricNamesInput { - if in == nil { - return nil - } - out := new(ProjectMetricNamesInput) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ProjectMonitorGraph) DeepCopyInto(out *ProjectMonitorGraph) { - *out = *in - out.Namespaced = in.Namespaced - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProjectMonitorGraph. -func (in *ProjectMonitorGraph) DeepCopy() *ProjectMonitorGraph { - if in == nil { - return nil - } - out := new(ProjectMonitorGraph) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ProjectMonitorGraph) 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 *ProjectMonitorGraphList) DeepCopyInto(out *ProjectMonitorGraphList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]ProjectMonitorGraph, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProjectMonitorGraphList. -func (in *ProjectMonitorGraphList) DeepCopy() *ProjectMonitorGraphList { - if in == nil { - return nil - } - out := new(ProjectMonitorGraphList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ProjectMonitorGraphList) 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 *ProjectMonitorGraphSpec) DeepCopyInto(out *ProjectMonitorGraphSpec) { - *out = *in - in.CommonMonitorGraphSpec.DeepCopyInto(&out.CommonMonitorGraphSpec) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProjectMonitorGraphSpec. -func (in *ProjectMonitorGraphSpec) DeepCopy() *ProjectMonitorGraphSpec { - if in == nil { - return nil - } - out := new(ProjectMonitorGraphSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ProjectNetworkPolicy) DeepCopyInto(out *ProjectNetworkPolicy) { - *out = *in - out.Namespaced = in.Namespaced - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - out.Spec = in.Spec - if in.Status != nil { - in, out := &in.Status, &out.Status - *out = new(ProjectNetworkPolicyStatus) - **out = **in - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProjectNetworkPolicy. -func (in *ProjectNetworkPolicy) DeepCopy() *ProjectNetworkPolicy { - if in == nil { - return nil - } - out := new(ProjectNetworkPolicy) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ProjectNetworkPolicy) 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 *ProjectNetworkPolicyList) DeepCopyInto(out *ProjectNetworkPolicyList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]ProjectNetworkPolicy, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProjectNetworkPolicyList. -func (in *ProjectNetworkPolicyList) DeepCopy() *ProjectNetworkPolicyList { - if in == nil { - return nil - } - out := new(ProjectNetworkPolicyList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ProjectNetworkPolicyList) 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 *ProjectNetworkPolicySpec) DeepCopyInto(out *ProjectNetworkPolicySpec) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProjectNetworkPolicySpec. -func (in *ProjectNetworkPolicySpec) DeepCopy() *ProjectNetworkPolicySpec { - if in == nil { - return nil - } - out := new(ProjectNetworkPolicySpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ProjectNetworkPolicyStatus) DeepCopyInto(out *ProjectNetworkPolicyStatus) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProjectNetworkPolicyStatus. -func (in *ProjectNetworkPolicyStatus) DeepCopy() *ProjectNetworkPolicyStatus { - if in == nil { - return nil - } - out := new(ProjectNetworkPolicyStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ProjectResourceQuota) DeepCopyInto(out *ProjectResourceQuota) { - *out = *in - out.Limit = in.Limit - out.UsedLimit = in.UsedLimit - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProjectResourceQuota. -func (in *ProjectResourceQuota) DeepCopy() *ProjectResourceQuota { - if in == nil { - return nil - } - out := new(ProjectResourceQuota) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ProjectRoleTemplateBinding) DeepCopyInto(out *ProjectRoleTemplateBinding) { - *out = *in - out.Namespaced = in.Namespaced - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProjectRoleTemplateBinding. -func (in *ProjectRoleTemplateBinding) DeepCopy() *ProjectRoleTemplateBinding { - if in == nil { - return nil - } - out := new(ProjectRoleTemplateBinding) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ProjectRoleTemplateBinding) 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 *ProjectRoleTemplateBindingList) DeepCopyInto(out *ProjectRoleTemplateBindingList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]ProjectRoleTemplateBinding, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProjectRoleTemplateBindingList. -func (in *ProjectRoleTemplateBindingList) DeepCopy() *ProjectRoleTemplateBindingList { - if in == nil { - return nil - } - out := new(ProjectRoleTemplateBindingList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ProjectRoleTemplateBindingList) 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 *ProjectSpec) DeepCopyInto(out *ProjectSpec) { - *out = *in - if in.ResourceQuota != nil { - in, out := &in.ResourceQuota, &out.ResourceQuota - *out = new(ProjectResourceQuota) - **out = **in - } - if in.NamespaceDefaultResourceQuota != nil { - in, out := &in.NamespaceDefaultResourceQuota, &out.NamespaceDefaultResourceQuota - *out = new(NamespaceResourceQuota) - **out = **in - } - if in.ContainerDefaultResourceLimit != nil { - in, out := &in.ContainerDefaultResourceLimit, &out.ContainerDefaultResourceLimit - *out = new(ContainerResourceLimit) - **out = **in - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProjectSpec. -func (in *ProjectSpec) DeepCopy() *ProjectSpec { - if in == nil { - return nil - } - out := new(ProjectSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ProjectStatus) DeepCopyInto(out *ProjectStatus) { - *out = *in - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make([]ProjectCondition, len(*in)) - copy(*out, *in) - } - if in.MonitoringStatus != nil { - in, out := &in.MonitoringStatus, &out.MonitoringStatus - *out = new(MonitoringStatus) - (*in).DeepCopyInto(*out) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProjectStatus. -func (in *ProjectStatus) DeepCopy() *ProjectStatus { - if in == nil { - return nil - } - out := new(ProjectStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ProjectTestInput) DeepCopyInto(out *ProjectTestInput) { - *out = *in - in.LoggingTargets.DeepCopyInto(&out.LoggingTargets) - if in.OutputTags != nil { - in, out := &in.OutputTags, &out.OutputTags - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProjectTestInput. -func (in *ProjectTestInput) DeepCopy() *ProjectTestInput { - if in == nil { - return nil - } - out := new(ProjectTestInput) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *PublicEndpoint) DeepCopyInto(out *PublicEndpoint) { - *out = *in - if in.Addresses != nil { - in, out := &in.Addresses, &out.Addresses - *out = make([]string, len(*in)) - copy(*out, *in) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PublicEndpoint. -func (in *PublicEndpoint) DeepCopy() *PublicEndpoint { - if in == nil { - return nil - } - out := new(PublicEndpoint) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *QueryClusterGraph) DeepCopyInto(out *QueryClusterGraph) { - *out = *in - if in.Series != nil { - in, out := &in.Series, &out.Series - *out = make([]*TimeSeries, len(*in)) - for i := range *in { - if (*in)[i] != nil { - in, out := &(*in)[i], &(*out)[i] - *out = new(TimeSeries) - (*in).DeepCopyInto(*out) - } - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new QueryClusterGraph. -func (in *QueryClusterGraph) DeepCopy() *QueryClusterGraph { - if in == nil { - return nil - } - out := new(QueryClusterGraph) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *QueryClusterGraphOutput) DeepCopyInto(out *QueryClusterGraphOutput) { - *out = *in - if in.Data != nil { - in, out := &in.Data, &out.Data - *out = make([]QueryClusterGraph, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new QueryClusterGraphOutput. -func (in *QueryClusterGraphOutput) DeepCopy() *QueryClusterGraphOutput { - if in == nil { - return nil - } - out := new(QueryClusterGraphOutput) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *QueryClusterMetricInput) DeepCopyInto(out *QueryClusterMetricInput) { - *out = *in - out.CommonQueryMetricInput = in.CommonQueryMetricInput - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new QueryClusterMetricInput. -func (in *QueryClusterMetricInput) DeepCopy() *QueryClusterMetricInput { - if in == nil { - return nil - } - out := new(QueryClusterMetricInput) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *QueryGraphInput) DeepCopyInto(out *QueryGraphInput) { - *out = *in - if in.MetricParams != nil { - in, out := &in.MetricParams, &out.MetricParams - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - if in.Filters != nil { - in, out := &in.Filters, &out.Filters - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new QueryGraphInput. -func (in *QueryGraphInput) DeepCopy() *QueryGraphInput { - if in == nil { - return nil - } - out := new(QueryGraphInput) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *QueryMetricOutput) DeepCopyInto(out *QueryMetricOutput) { - *out = *in - if in.Series != nil { - in, out := &in.Series, &out.Series - *out = make([]*TimeSeries, len(*in)) - for i := range *in { - if (*in)[i] != nil { - in, out := &(*in)[i], &(*out)[i] - *out = new(TimeSeries) - (*in).DeepCopyInto(*out) - } - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new QueryMetricOutput. -func (in *QueryMetricOutput) DeepCopy() *QueryMetricOutput { - if in == nil { - return nil - } - out := new(QueryMetricOutput) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *QueryProjectGraph) DeepCopyInto(out *QueryProjectGraph) { - *out = *in - if in.Series != nil { - in, out := &in.Series, &out.Series - *out = make([]*TimeSeries, len(*in)) - for i := range *in { - if (*in)[i] != nil { - in, out := &(*in)[i], &(*out)[i] - *out = new(TimeSeries) - (*in).DeepCopyInto(*out) - } - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new QueryProjectGraph. -func (in *QueryProjectGraph) DeepCopy() *QueryProjectGraph { - if in == nil { - return nil - } - out := new(QueryProjectGraph) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *QueryProjectGraphOutput) DeepCopyInto(out *QueryProjectGraphOutput) { - *out = *in - if in.Data != nil { - in, out := &in.Data, &out.Data - *out = make([]QueryProjectGraph, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new QueryProjectGraphOutput. -func (in *QueryProjectGraphOutput) DeepCopy() *QueryProjectGraphOutput { - if in == nil { - return nil - } - out := new(QueryProjectGraphOutput) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *QueryProjectMetricInput) DeepCopyInto(out *QueryProjectMetricInput) { - *out = *in - out.CommonQueryMetricInput = in.CommonQueryMetricInput - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new QueryProjectMetricInput. -func (in *QueryProjectMetricInput) DeepCopy() *QueryProjectMetricInput { - if in == nil { - return nil - } - out := new(QueryProjectMetricInput) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Question) DeepCopyInto(out *Question) { - *out = *in - if in.Options != nil { - in, out := &in.Options, &out.Options - *out = make([]string, len(*in)) - copy(*out, *in) - } - if in.Subquestions != nil { - in, out := &in.Subquestions, &out.Subquestions - *out = make([]SubQuestion, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Question. -func (in *Question) DeepCopy() *Question { - if in == nil { - return nil - } - out := new(Question) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *RKEConfigNode) DeepCopyInto(out *RKEConfigNode) { - *out = *in - if in.Role != nil { - in, out := &in.Role, &out.Role - *out = make([]string, len(*in)) - copy(*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 - } - } - if in.Taints != nil { - in, out := &in.Taints, &out.Taints - *out = make([]RKETaint, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RKEConfigNode. -func (in *RKEConfigNode) DeepCopy() *RKEConfigNode { - if in == nil { - return nil - } - out := new(RKEConfigNode) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *RKEConfigNodePlan) DeepCopyInto(out *RKEConfigNodePlan) { - *out = *in - if in.Processes != nil { - in, out := &in.Processes, &out.Processes - *out = make(map[string]Process, len(*in)) - for key, val := range *in { - (*out)[key] = *val.DeepCopy() - } - } - if in.PortChecks != nil { - in, out := &in.PortChecks, &out.PortChecks - *out = make([]PortCheck, len(*in)) - copy(*out, *in) - } - if in.Files != nil { - in, out := &in.Files, &out.Files - *out = make([]File, len(*in)) - copy(*out, *in) - } - if in.Annotations != nil { - in, out := &in.Annotations, &out.Annotations - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - 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.Taints != nil { - in, out := &in.Taints, &out.Taints - *out = make([]RKETaint, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RKEConfigNodePlan. -func (in *RKEConfigNodePlan) DeepCopy() *RKEConfigNodePlan { - if in == nil { - return nil - } - out := new(RKEConfigNodePlan) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *RKEConfigServices) DeepCopyInto(out *RKEConfigServices) { - *out = *in - in.Etcd.DeepCopyInto(&out.Etcd) - in.KubeAPI.DeepCopyInto(&out.KubeAPI) - in.KubeController.DeepCopyInto(&out.KubeController) - in.Scheduler.DeepCopyInto(&out.Scheduler) - in.Kubelet.DeepCopyInto(&out.Kubelet) - in.Kubeproxy.DeepCopyInto(&out.Kubeproxy) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RKEConfigServices. -func (in *RKEConfigServices) DeepCopy() *RKEConfigServices { - if in == nil { - return nil - } - out := new(RKEConfigServices) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *RKEPlan) DeepCopyInto(out *RKEPlan) { - *out = *in - if in.Nodes != nil { - in, out := &in.Nodes, &out.Nodes - *out = make([]RKEConfigNodePlan, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RKEPlan. -func (in *RKEPlan) DeepCopy() *RKEPlan { - if in == nil { - return nil - } - out := new(RKEPlan) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *RKESystemImages) DeepCopyInto(out *RKESystemImages) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RKESystemImages. -func (in *RKESystemImages) DeepCopy() *RKESystemImages { - if in == nil { - return nil - } - out := new(RKESystemImages) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *RKETaint) DeepCopyInto(out *RKETaint) { - *out = *in - if in.TimeAdded != nil { - in, out := &in.TimeAdded, &out.TimeAdded - *out = (*in).DeepCopy() - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RKETaint. -func (in *RKETaint) DeepCopy() *RKETaint { - if in == nil { - return nil - } - out := new(RKETaint) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *RancherKubernetesEngineConfig) DeepCopyInto(out *RancherKubernetesEngineConfig) { - *out = *in - if in.Nodes != nil { - in, out := &in.Nodes, &out.Nodes - *out = make([]RKEConfigNode, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - in.Services.DeepCopyInto(&out.Services) - in.Network.DeepCopyInto(&out.Network) - in.Authentication.DeepCopyInto(&out.Authentication) - if in.AddonsInclude != nil { - in, out := &in.AddonsInclude, &out.AddonsInclude - *out = make([]string, len(*in)) - copy(*out, *in) - } - out.SystemImages = in.SystemImages - in.Authorization.DeepCopyInto(&out.Authorization) - if in.IgnoreDockerVersion != nil { - in, out := &in.IgnoreDockerVersion, &out.IgnoreDockerVersion - *out = new(bool) - **out = **in - } - if in.PrivateRegistries != nil { - in, out := &in.PrivateRegistries, &out.PrivateRegistries - *out = make([]PrivateRegistry, len(*in)) - copy(*out, *in) - } - in.Ingress.DeepCopyInto(&out.Ingress) - in.CloudProvider.DeepCopyInto(&out.CloudProvider) - out.BastionHost = in.BastionHost - in.Monitoring.DeepCopyInto(&out.Monitoring) - out.Restore = in.Restore - if in.RotateCertificates != nil { - in, out := &in.RotateCertificates, &out.RotateCertificates - *out = new(RotateCertificates) - (*in).DeepCopyInto(*out) - } - if in.DNS != nil { - in, out := &in.DNS, &out.DNS - *out = new(DNSConfig) - (*in).DeepCopyInto(*out) - } - if in.UpgradeStrategy != nil { - in, out := &in.UpgradeStrategy, &out.UpgradeStrategy - *out = new(NodeUpgradeStrategy) - (*in).DeepCopyInto(*out) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RancherKubernetesEngineConfig. -func (in *RancherKubernetesEngineConfig) DeepCopy() *RancherKubernetesEngineConfig { - if in == nil { - return nil - } - out := new(RancherKubernetesEngineConfig) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Recipient) DeepCopyInto(out *Recipient) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Recipient. -func (in *Recipient) DeepCopy() *Recipient { - if in == nil { - return nil - } - out := new(Recipient) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ResourceQuotaLimit) DeepCopyInto(out *ResourceQuotaLimit) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceQuotaLimit. -func (in *ResourceQuotaLimit) DeepCopy() *ResourceQuotaLimit { - if in == nil { - return nil - } - out := new(ResourceQuotaLimit) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *RestoreConfig) DeepCopyInto(out *RestoreConfig) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RestoreConfig. -func (in *RestoreConfig) DeepCopy() *RestoreConfig { - if in == nil { - return nil - } - out := new(RestoreConfig) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *RestoreFromEtcdBackupInput) DeepCopyInto(out *RestoreFromEtcdBackupInput) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RestoreFromEtcdBackupInput. -func (in *RestoreFromEtcdBackupInput) DeepCopy() *RestoreFromEtcdBackupInput { - if in == nil { - return nil - } - out := new(RestoreFromEtcdBackupInput) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *RkeAddon) DeepCopyInto(out *RkeAddon) { - *out = *in - out.Namespaced = in.Namespaced - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RkeAddon. -func (in *RkeAddon) DeepCopy() *RkeAddon { - if in == nil { - return nil - } - out := new(RkeAddon) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *RkeAddon) 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 *RkeAddonList) DeepCopyInto(out *RkeAddonList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]RkeAddon, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RkeAddonList. -func (in *RkeAddonList) DeepCopy() *RkeAddonList { - if in == nil { - return nil - } - out := new(RkeAddonList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *RkeAddonList) 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 *RkeK8sServiceOption) DeepCopyInto(out *RkeK8sServiceOption) { - *out = *in - out.Namespaced = in.Namespaced - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.ServiceOptions.DeepCopyInto(&out.ServiceOptions) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RkeK8sServiceOption. -func (in *RkeK8sServiceOption) DeepCopy() *RkeK8sServiceOption { - if in == nil { - return nil - } - out := new(RkeK8sServiceOption) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *RkeK8sServiceOption) 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 *RkeK8sServiceOptionList) DeepCopyInto(out *RkeK8sServiceOptionList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]RkeK8sServiceOption, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RkeK8sServiceOptionList. -func (in *RkeK8sServiceOptionList) DeepCopy() *RkeK8sServiceOptionList { - if in == nil { - return nil - } - out := new(RkeK8sServiceOptionList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *RkeK8sServiceOptionList) 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 *RkeK8sSystemImage) DeepCopyInto(out *RkeK8sSystemImage) { - *out = *in - out.Namespaced = in.Namespaced - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - out.SystemImages = in.SystemImages - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RkeK8sSystemImage. -func (in *RkeK8sSystemImage) DeepCopy() *RkeK8sSystemImage { - if in == nil { - return nil - } - out := new(RkeK8sSystemImage) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *RkeK8sSystemImage) 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 *RkeK8sSystemImageList) DeepCopyInto(out *RkeK8sSystemImageList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]RkeK8sSystemImage, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RkeK8sSystemImageList. -func (in *RkeK8sSystemImageList) DeepCopy() *RkeK8sSystemImageList { - if in == nil { - return nil - } - out := new(RkeK8sSystemImageList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *RkeK8sSystemImageList) 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 *RoleTemplate) DeepCopyInto(out *RoleTemplate) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - if in.Rules != nil { - in, out := &in.Rules, &out.Rules - *out = make([]rbacv1.PolicyRule, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.RoleTemplateNames != nil { - in, out := &in.RoleTemplateNames, &out.RoleTemplateNames - *out = make([]string, len(*in)) - copy(*out, *in) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RoleTemplate. -func (in *RoleTemplate) DeepCopy() *RoleTemplate { - if in == nil { - return nil - } - out := new(RoleTemplate) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *RoleTemplate) 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 *RoleTemplateList) DeepCopyInto(out *RoleTemplateList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]RoleTemplate, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RoleTemplateList. -func (in *RoleTemplateList) DeepCopy() *RoleTemplateList { - if in == nil { - return nil - } - out := new(RoleTemplateList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *RoleTemplateList) 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 *RollingUpdate) DeepCopyInto(out *RollingUpdate) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RollingUpdate. -func (in *RollingUpdate) DeepCopy() *RollingUpdate { - if in == nil { - return nil - } - out := new(RollingUpdate) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *RotateCertificateInput) DeepCopyInto(out *RotateCertificateInput) { - *out = *in - if in.Services != nil { - in, out := &in.Services, &out.Services - *out = make([]string, len(*in)) - copy(*out, *in) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RotateCertificateInput. -func (in *RotateCertificateInput) DeepCopy() *RotateCertificateInput { - if in == nil { - return nil - } - out := new(RotateCertificateInput) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *RotateCertificateOutput) DeepCopyInto(out *RotateCertificateOutput) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RotateCertificateOutput. -func (in *RotateCertificateOutput) DeepCopy() *RotateCertificateOutput { - if in == nil { - return nil - } - out := new(RotateCertificateOutput) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *RotateCertificates) DeepCopyInto(out *RotateCertificates) { - *out = *in - if in.Services != nil { - in, out := &in.Services, &out.Services - *out = make([]string, len(*in)) - copy(*out, *in) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RotateCertificates. -func (in *RotateCertificates) DeepCopy() *RotateCertificates { - if in == nil { - return nil - } - out := new(RotateCertificates) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Route53ProviderConfig) DeepCopyInto(out *Route53ProviderConfig) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Route53ProviderConfig. -func (in *Route53ProviderConfig) DeepCopy() *Route53ProviderConfig { - if in == nil { - return nil - } - out := new(Route53ProviderConfig) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *RouteOpenstackOpts) DeepCopyInto(out *RouteOpenstackOpts) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RouteOpenstackOpts. -func (in *RouteOpenstackOpts) DeepCopy() *RouteOpenstackOpts { - if in == nil { - return nil - } - out := new(RouteOpenstackOpts) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *S3BackupConfig) DeepCopyInto(out *S3BackupConfig) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new S3BackupConfig. -func (in *S3BackupConfig) DeepCopy() *S3BackupConfig { - if in == nil { - return nil - } - out := new(S3BackupConfig) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *SMTPConfig) DeepCopyInto(out *SMTPConfig) { - *out = *in - if in.TLS != nil { - in, out := &in.TLS, &out.TLS - *out = new(bool) - **out = **in - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SMTPConfig. -func (in *SMTPConfig) DeepCopy() *SMTPConfig { - if in == nil { - return nil - } - out := new(SMTPConfig) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *SamlConfig) DeepCopyInto(out *SamlConfig) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.AuthConfig.DeepCopyInto(&out.AuthConfig) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SamlConfig. -func (in *SamlConfig) DeepCopy() *SamlConfig { - if in == nil { - return nil - } - out := new(SamlConfig) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *SamlConfig) 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 *SamlConfigTestInput) DeepCopyInto(out *SamlConfigTestInput) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SamlConfigTestInput. -func (in *SamlConfigTestInput) DeepCopy() *SamlConfigTestInput { - if in == nil { - return nil - } - out := new(SamlConfigTestInput) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *SamlConfigTestOutput) DeepCopyInto(out *SamlConfigTestOutput) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SamlConfigTestOutput. -func (in *SamlConfigTestOutput) DeepCopy() *SamlConfigTestOutput { - if in == nil { - return nil - } - out := new(SamlConfigTestOutput) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *SaveAsTemplateInput) DeepCopyInto(out *SaveAsTemplateInput) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SaveAsTemplateInput. -func (in *SaveAsTemplateInput) DeepCopy() *SaveAsTemplateInput { - if in == nil { - return nil - } - out := new(SaveAsTemplateInput) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *SaveAsTemplateOutput) DeepCopyInto(out *SaveAsTemplateOutput) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SaveAsTemplateOutput. -func (in *SaveAsTemplateOutput) DeepCopy() *SaveAsTemplateOutput { - if in == nil { - return nil - } - out := new(SaveAsTemplateOutput) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ScheduledClusterScan) DeepCopyInto(out *ScheduledClusterScan) { - *out = *in - if in.ScheduleConfig != nil { - in, out := &in.ScheduleConfig, &out.ScheduleConfig - *out = new(ScheduledClusterScanConfig) - **out = **in - } - if in.ScanConfig != nil { - in, out := &in.ScanConfig, &out.ScanConfig - *out = new(ClusterScanConfig) - (*in).DeepCopyInto(*out) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ScheduledClusterScan. -func (in *ScheduledClusterScan) DeepCopy() *ScheduledClusterScan { - if in == nil { - return nil - } - out := new(ScheduledClusterScan) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ScheduledClusterScanConfig) DeepCopyInto(out *ScheduledClusterScanConfig) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ScheduledClusterScanConfig. -func (in *ScheduledClusterScanConfig) DeepCopy() *ScheduledClusterScanConfig { - if in == nil { - return nil - } - out := new(ScheduledClusterScanConfig) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ScheduledClusterScanStatus) DeepCopyInto(out *ScheduledClusterScanStatus) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ScheduledClusterScanStatus. -func (in *ScheduledClusterScanStatus) DeepCopy() *ScheduledClusterScanStatus { - if in == nil { - return nil - } - out := new(ScheduledClusterScanStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *SchedulerService) DeepCopyInto(out *SchedulerService) { - *out = *in - in.BaseService.DeepCopyInto(&out.BaseService) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SchedulerService. -func (in *SchedulerService) DeepCopy() *SchedulerService { - if in == nil { - return nil - } - out := new(SchedulerService) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *SearchPrincipalsInput) DeepCopyInto(out *SearchPrincipalsInput) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SearchPrincipalsInput. -func (in *SearchPrincipalsInput) DeepCopy() *SearchPrincipalsInput { - if in == nil { - return nil - } - out := new(SearchPrincipalsInput) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *SecretsEncryptionConfig) DeepCopyInto(out *SecretsEncryptionConfig) { - *out = *in - if in.CustomConfig != nil { - in, out := &in.CustomConfig, &out.CustomConfig - *out = new(config.EncryptionConfiguration) - (*in).DeepCopyInto(*out) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SecretsEncryptionConfig. -func (in *SecretsEncryptionConfig) DeepCopy() *SecretsEncryptionConfig { - if in == nil { - return nil - } - out := new(SecretsEncryptionConfig) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ServiceOverride) DeepCopyInto(out *ServiceOverride) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceOverride. -func (in *ServiceOverride) DeepCopy() *ServiceOverride { - if in == nil { - return nil - } - out := new(ServiceOverride) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *SetPasswordInput) DeepCopyInto(out *SetPasswordInput) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SetPasswordInput. -func (in *SetPasswordInput) DeepCopy() *SetPasswordInput { - if in == nil { - return nil - } - out := new(SetPasswordInput) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *SetPodSecurityPolicyTemplateInput) DeepCopyInto(out *SetPodSecurityPolicyTemplateInput) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SetPodSecurityPolicyTemplateInput. -func (in *SetPodSecurityPolicyTemplateInput) DeepCopy() *SetPodSecurityPolicyTemplateInput { - if in == nil { - return nil - } - out := new(SetPodSecurityPolicyTemplateInput) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Setting) DeepCopyInto(out *Setting) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Setting. -func (in *Setting) DeepCopy() *Setting { - if in == nil { - return nil - } - out := new(Setting) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *Setting) 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 *SettingList) DeepCopyInto(out *SettingList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]Setting, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SettingList. -func (in *SettingList) DeepCopy() *SettingList { - if in == nil { - return nil - } - out := new(SettingList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *SettingList) 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 *ShibbolethConfig) DeepCopyInto(out *ShibbolethConfig) { - *out = *in - in.SamlConfig.DeepCopyInto(&out.SamlConfig) - in.OpenLdapConfig.DeepCopyInto(&out.OpenLdapConfig) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ShibbolethConfig. -func (in *ShibbolethConfig) DeepCopy() *ShibbolethConfig { - if in == nil { - return nil - } - out := new(ShibbolethConfig) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ShibbolethConfig) 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 *SlackConfig) DeepCopyInto(out *SlackConfig) { - *out = *in - if in.HTTPClientConfig != nil { - in, out := &in.HTTPClientConfig, &out.HTTPClientConfig - *out = new(HTTPClientConfig) - **out = **in - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SlackConfig. -func (in *SlackConfig) DeepCopy() *SlackConfig { - if in == nil { - return nil - } - out := new(SlackConfig) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *SplunkConfig) DeepCopyInto(out *SplunkConfig) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SplunkConfig. -func (in *SplunkConfig) DeepCopy() *SplunkConfig { - if in == nil { - return nil - } - out := new(SplunkConfig) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *SubQuestion) DeepCopyInto(out *SubQuestion) { - *out = *in - if in.Options != nil { - in, out := &in.Options, &out.Options - *out = make([]string, len(*in)) - copy(*out, *in) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SubQuestion. -func (in *SubQuestion) DeepCopy() *SubQuestion { - if in == nil { - return nil - } - out := new(SubQuestion) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *SyslogConfig) DeepCopyInto(out *SyslogConfig) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SyslogConfig. -func (in *SyslogConfig) DeepCopy() *SyslogConfig { - if in == nil { - return nil - } - out := new(SyslogConfig) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *SystemServiceRule) DeepCopyInto(out *SystemServiceRule) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SystemServiceRule. -func (in *SystemServiceRule) DeepCopy() *SystemServiceRule { - if in == nil { - return nil - } - out := new(SystemServiceRule) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Target) DeepCopyInto(out *Target) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Target. -func (in *Target) DeepCopy() *Target { - if in == nil { - return nil - } - out := new(Target) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *TargetEvent) DeepCopyInto(out *TargetEvent) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TargetEvent. -func (in *TargetEvent) DeepCopy() *TargetEvent { - if in == nil { - return nil - } - out := new(TargetEvent) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *TargetNode) DeepCopyInto(out *TargetNode) { - *out = *in - if in.Selector != nil { - in, out := &in.Selector, &out.Selector - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TargetNode. -func (in *TargetNode) DeepCopy() *TargetNode { - if in == nil { - return nil - } - out := new(TargetNode) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *TargetPod) DeepCopyInto(out *TargetPod) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TargetPod. -func (in *TargetPod) DeepCopy() *TargetPod { - if in == nil { - return nil - } - out := new(TargetPod) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *TargetSystemService) DeepCopyInto(out *TargetSystemService) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TargetSystemService. -func (in *TargetSystemService) DeepCopy() *TargetSystemService { - if in == nil { - return nil - } - out := new(TargetSystemService) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *TargetWorkload) DeepCopyInto(out *TargetWorkload) { - *out = *in - if in.Selector != nil { - in, out := &in.Selector, &out.Selector - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TargetWorkload. -func (in *TargetWorkload) DeepCopy() *TargetWorkload { - if in == nil { - return nil - } - out := new(TargetWorkload) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Template) DeepCopyInto(out *Template) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) - out.Status = in.Status - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Template. -func (in *Template) DeepCopy() *Template { - if in == nil { - return nil - } - out := new(Template) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *Template) 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 *TemplateContent) DeepCopyInto(out *TemplateContent) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TemplateContent. -func (in *TemplateContent) DeepCopy() *TemplateContent { - if in == nil { - return nil - } - out := new(TemplateContent) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *TemplateContent) 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 *TemplateContentList) DeepCopyInto(out *TemplateContentList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]TemplateContent, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TemplateContentList. -func (in *TemplateContentList) DeepCopy() *TemplateContentList { - if in == nil { - return nil - } - out := new(TemplateContentList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *TemplateContentList) 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 *TemplateList) DeepCopyInto(out *TemplateList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]Template, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TemplateList. -func (in *TemplateList) DeepCopy() *TemplateList { - if in == nil { - return nil - } - out := new(TemplateList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *TemplateList) 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 *TemplateSpec) DeepCopyInto(out *TemplateSpec) { - *out = *in - if in.Categories != nil { - in, out := &in.Categories, &out.Categories - *out = make([]string, len(*in)) - copy(*out, *in) - } - if in.Versions != nil { - in, out := &in.Versions, &out.Versions - *out = make([]TemplateVersionSpec, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TemplateSpec. -func (in *TemplateSpec) DeepCopy() *TemplateSpec { - if in == nil { - return nil - } - out := new(TemplateSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *TemplateStatus) DeepCopyInto(out *TemplateStatus) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TemplateStatus. -func (in *TemplateStatus) DeepCopy() *TemplateStatus { - if in == nil { - return nil - } - out := new(TemplateStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *TemplateVersion) DeepCopyInto(out *TemplateVersion) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) - out.Status = in.Status - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TemplateVersion. -func (in *TemplateVersion) DeepCopy() *TemplateVersion { - if in == nil { - return nil - } - out := new(TemplateVersion) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *TemplateVersion) 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 *TemplateVersionList) DeepCopyInto(out *TemplateVersionList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]TemplateVersion, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TemplateVersionList. -func (in *TemplateVersionList) DeepCopy() *TemplateVersionList { - if in == nil { - return nil - } - out := new(TemplateVersionList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *TemplateVersionList) 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 *TemplateVersionSpec) DeepCopyInto(out *TemplateVersionSpec) { - *out = *in - if in.UpgradeVersionLinks != nil { - in, out := &in.UpgradeVersionLinks, &out.UpgradeVersionLinks - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - if in.Files != nil { - in, out := &in.Files, &out.Files - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - if in.Questions != nil { - in, out := &in.Questions, &out.Questions - *out = make([]Question, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.VersionURLs != nil { - in, out := &in.VersionURLs, &out.VersionURLs - *out = make([]string, len(*in)) - copy(*out, *in) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TemplateVersionSpec. -func (in *TemplateVersionSpec) DeepCopy() *TemplateVersionSpec { - if in == nil { - return nil - } - out := new(TemplateVersionSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *TemplateVersionStatus) DeepCopyInto(out *TemplateVersionStatus) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TemplateVersionStatus. -func (in *TemplateVersionStatus) DeepCopy() *TemplateVersionStatus { - if in == nil { - return nil - } - out := new(TemplateVersionStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *TimeSeries) DeepCopyInto(out *TimeSeries) { - *out = *in - if in.Points != nil { - in, out := &in.Points, &out.Points - *out = make([][]float64, len(*in)) - for i := range *in { - if (*in)[i] != nil { - in, out := &(*in)[i], &(*out)[i] - *out = make([]float64, len(*in)) - copy(*out, *in) - } - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TimeSeries. -func (in *TimeSeries) DeepCopy() *TimeSeries { - if in == nil { - return nil - } - out := new(TimeSeries) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *TimingField) DeepCopyInto(out *TimingField) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TimingField. -func (in *TimingField) DeepCopy() *TimingField { - if in == nil { - return nil - } - out := new(TimingField) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Token) DeepCopyInto(out *Token) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.UserPrincipal.DeepCopyInto(&out.UserPrincipal) - if in.GroupPrincipals != nil { - in, out := &in.GroupPrincipals, &out.GroupPrincipals - *out = make([]Principal, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.ProviderInfo != nil { - in, out := &in.ProviderInfo, &out.ProviderInfo - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - if in.Enabled != nil { - in, out := &in.Enabled, &out.Enabled - *out = new(bool) - **out = **in - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Token. -func (in *Token) DeepCopy() *Token { - if in == nil { - return nil - } - out := new(Token) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *Token) 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 *TokenList) DeepCopyInto(out *TokenList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]Token, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TokenList. -func (in *TokenList) DeepCopy() *TokenList { - if in == nil { - return nil - } - out := new(TokenList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *TokenList) 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 *UpdateGlobalDNSTargetsInput) DeepCopyInto(out *UpdateGlobalDNSTargetsInput) { - *out = *in - if in.ProjectNames != nil { - in, out := &in.ProjectNames, &out.ProjectNames - *out = make([]string, len(*in)) - copy(*out, *in) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UpdateGlobalDNSTargetsInput. -func (in *UpdateGlobalDNSTargetsInput) DeepCopy() *UpdateGlobalDNSTargetsInput { - if in == nil { - return nil - } - out := new(UpdateGlobalDNSTargetsInput) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *UpdateMultiClusterAppTargetsInput) DeepCopyInto(out *UpdateMultiClusterAppTargetsInput) { - *out = *in - if in.Projects != nil { - in, out := &in.Projects, &out.Projects - *out = make([]string, len(*in)) - copy(*out, *in) - } - if in.Answers != nil { - in, out := &in.Answers, &out.Answers - *out = make([]Answer, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UpdateMultiClusterAppTargetsInput. -func (in *UpdateMultiClusterAppTargetsInput) DeepCopy() *UpdateMultiClusterAppTargetsInput { - if in == nil { - return nil - } - out := new(UpdateMultiClusterAppTargetsInput) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *UpgradeStrategy) DeepCopyInto(out *UpgradeStrategy) { - *out = *in - if in.RollingUpdate != nil { - in, out := &in.RollingUpdate, &out.RollingUpdate - *out = new(RollingUpdate) - **out = **in - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UpgradeStrategy. -func (in *UpgradeStrategy) DeepCopy() *UpgradeStrategy { - if in == nil { - return nil - } - out := new(UpgradeStrategy) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *User) DeepCopyInto(out *User) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - if in.PrincipalIDs != nil { - in, out := &in.PrincipalIDs, &out.PrincipalIDs - *out = make([]string, len(*in)) - copy(*out, *in) - } - if in.Enabled != nil { - in, out := &in.Enabled, &out.Enabled - *out = new(bool) - **out = **in - } - out.Spec = in.Spec - in.Status.DeepCopyInto(&out.Status) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new User. -func (in *User) DeepCopy() *User { - if in == nil { - return nil - } - out := new(User) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *User) 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 *UserAttribute) DeepCopyInto(out *UserAttribute) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - if in.GroupPrincipals != nil { - in, out := &in.GroupPrincipals, &out.GroupPrincipals - *out = make(map[string]Principals, len(*in)) - for key, val := range *in { - (*out)[key] = *val.DeepCopy() - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UserAttribute. -func (in *UserAttribute) DeepCopy() *UserAttribute { - if in == nil { - return nil - } - out := new(UserAttribute) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *UserAttribute) 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 *UserAttributeList) DeepCopyInto(out *UserAttributeList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]UserAttribute, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UserAttributeList. -func (in *UserAttributeList) DeepCopy() *UserAttributeList { - if in == nil { - return nil - } - out := new(UserAttributeList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *UserAttributeList) 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 *UserCondition) DeepCopyInto(out *UserCondition) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UserCondition. -func (in *UserCondition) DeepCopy() *UserCondition { - if in == nil { - return nil - } - out := new(UserCondition) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *UserList) DeepCopyInto(out *UserList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]User, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UserList. -func (in *UserList) DeepCopy() *UserList { - if in == nil { - return nil - } - out := new(UserList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *UserList) 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 *UserSpec) DeepCopyInto(out *UserSpec) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UserSpec. -func (in *UserSpec) DeepCopy() *UserSpec { - if in == nil { - return nil - } - out := new(UserSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *UserStatus) DeepCopyInto(out *UserStatus) { - *out = *in - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make([]UserCondition, len(*in)) - copy(*out, *in) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UserStatus. -func (in *UserStatus) DeepCopy() *UserStatus { - if in == nil { - return nil - } - out := new(UserStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Values) DeepCopyInto(out *Values) { - *out = *in - if in.StringSliceValue != nil { - in, out := &in.StringSliceValue, &out.StringSliceValue - *out = make([]string, len(*in)) - copy(*out, *in) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Values. -func (in *Values) DeepCopy() *Values { - if in == nil { - return nil - } - out := new(Values) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *VersionCommits) DeepCopyInto(out *VersionCommits) { - *out = *in - if in.Value != nil { - in, out := &in.Value, &out.Value - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VersionCommits. -func (in *VersionCommits) DeepCopy() *VersionCommits { - if in == nil { - return nil - } - out := new(VersionCommits) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *VirtualCenterConfig) DeepCopyInto(out *VirtualCenterConfig) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualCenterConfig. -func (in *VirtualCenterConfig) DeepCopy() *VirtualCenterConfig { - if in == nil { - return nil - } - out := new(VirtualCenterConfig) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *VsphereCloudProvider) DeepCopyInto(out *VsphereCloudProvider) { - *out = *in - out.Global = in.Global - if in.VirtualCenter != nil { - in, out := &in.VirtualCenter, &out.VirtualCenter - *out = make(map[string]VirtualCenterConfig, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - out.Network = in.Network - out.Disk = in.Disk - out.Workspace = in.Workspace - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VsphereCloudProvider. -func (in *VsphereCloudProvider) DeepCopy() *VsphereCloudProvider { - if in == nil { - return nil - } - out := new(VsphereCloudProvider) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *WeaveNetworkProvider) DeepCopyInto(out *WeaveNetworkProvider) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WeaveNetworkProvider. -func (in *WeaveNetworkProvider) DeepCopy() *WeaveNetworkProvider { - if in == nil { - return nil - } - out := new(WeaveNetworkProvider) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *WebhookConfig) DeepCopyInto(out *WebhookConfig) { - *out = *in - if in.HTTPClientConfig != nil { - in, out := &in.HTTPClientConfig, &out.HTTPClientConfig - *out = new(HTTPClientConfig) - **out = **in - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WebhookConfig. -func (in *WebhookConfig) DeepCopy() *WebhookConfig { - if in == nil { - return nil - } - out := new(WebhookConfig) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *WechatConfig) DeepCopyInto(out *WechatConfig) { - *out = *in - if in.HTTPClientConfig != nil { - in, out := &in.HTTPClientConfig, &out.HTTPClientConfig - *out = new(HTTPClientConfig) - **out = **in - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WechatConfig. -func (in *WechatConfig) DeepCopy() *WechatConfig { - if in == nil { - return nil - } - out := new(WechatConfig) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *WindowsSystemImages) DeepCopyInto(out *WindowsSystemImages) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WindowsSystemImages. -func (in *WindowsSystemImages) DeepCopy() *WindowsSystemImages { - if in == nil { - return nil - } - out := new(WindowsSystemImages) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *WorkloadRule) DeepCopyInto(out *WorkloadRule) { - *out = *in - if in.Selector != nil { - in, out := &in.Selector, &out.Selector - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkloadRule. -func (in *WorkloadRule) DeepCopy() *WorkloadRule { - if in == nil { - return nil - } - out := new(WorkloadRule) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *WorkspaceVsphereOpts) DeepCopyInto(out *WorkspaceVsphereOpts) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkspaceVsphereOpts. -func (in *WorkspaceVsphereOpts) DeepCopy() *WorkspaceVsphereOpts { - if in == nil { - return nil - } - out := new(WorkspaceVsphereOpts) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *YAxis) DeepCopyInto(out *YAxis) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new YAxis. -func (in *YAxis) DeepCopy() *YAxis { - if in == nil { - return nil - } - out := new(YAxis) - in.DeepCopyInto(out) - return out -} diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_dynamic_schema_controller.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_dynamic_schema_controller.go deleted file mode 100644 index 75f082ae..00000000 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_dynamic_schema_controller.go +++ /dev/null @@ -1,320 +0,0 @@ -package v3 - -import ( - "context" - "time" - - "github.com/rancher/norman/controller" - "github.com/rancher/norman/objectclient" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/apimachinery/pkg/types" - "k8s.io/apimachinery/pkg/watch" - "k8s.io/client-go/tools/cache" -) - -var ( - DynamicSchemaGroupVersionKind = schema.GroupVersionKind{ - Version: Version, - Group: GroupName, - Kind: "DynamicSchema", - } - DynamicSchemaResource = metav1.APIResource{ - Name: "dynamicschemas", - SingularName: "dynamicschema", - Namespaced: false, - Kind: DynamicSchemaGroupVersionKind.Kind, - } - - DynamicSchemaGroupVersionResource = schema.GroupVersionResource{ - Group: GroupName, - Version: Version, - Resource: "dynamicschemas", - } -) - -func init() { - resource.Put(DynamicSchemaGroupVersionResource) -} - -func NewDynamicSchema(namespace, name string, obj DynamicSchema) *DynamicSchema { - obj.APIVersion, obj.Kind = DynamicSchemaGroupVersionKind.ToAPIVersionAndKind() - obj.Name = name - obj.Namespace = namespace - return &obj -} - -type DynamicSchemaList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []DynamicSchema `json:"items"` -} - -type DynamicSchemaHandlerFunc func(key string, obj *DynamicSchema) (runtime.Object, error) - -type DynamicSchemaChangeHandlerFunc func(obj *DynamicSchema) (runtime.Object, error) - -type DynamicSchemaLister interface { - List(namespace string, selector labels.Selector) (ret []*DynamicSchema, err error) - Get(namespace, name string) (*DynamicSchema, error) -} - -type DynamicSchemaController interface { - Generic() controller.GenericController - Informer() cache.SharedIndexInformer - Lister() DynamicSchemaLister - AddHandler(ctx context.Context, name string, handler DynamicSchemaHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync DynamicSchemaHandlerFunc) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, handler DynamicSchemaHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, handler DynamicSchemaHandlerFunc) - Enqueue(namespace, name string) - EnqueueAfter(namespace, name string, after time.Duration) -} - -type DynamicSchemaInterface interface { - ObjectClient() *objectclient.ObjectClient - Create(*DynamicSchema) (*DynamicSchema, error) - GetNamespaced(namespace, name string, opts metav1.GetOptions) (*DynamicSchema, error) - Get(name string, opts metav1.GetOptions) (*DynamicSchema, error) - Update(*DynamicSchema) (*DynamicSchema, error) - Delete(name string, options *metav1.DeleteOptions) error - DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error - List(opts metav1.ListOptions) (*DynamicSchemaList, error) - ListNamespaced(namespace string, opts metav1.ListOptions) (*DynamicSchemaList, error) - Watch(opts metav1.ListOptions) (watch.Interface, error) - DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error - Controller() DynamicSchemaController - AddHandler(ctx context.Context, name string, sync DynamicSchemaHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync DynamicSchemaHandlerFunc) - AddLifecycle(ctx context.Context, name string, lifecycle DynamicSchemaLifecycle) - AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle DynamicSchemaLifecycle) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync DynamicSchemaHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync DynamicSchemaHandlerFunc) - AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle DynamicSchemaLifecycle) - AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle DynamicSchemaLifecycle) -} - -type dynamicSchemaLister struct { - controller *dynamicSchemaController -} - -func (l *dynamicSchemaLister) List(namespace string, selector labels.Selector) (ret []*DynamicSchema, err error) { - err = cache.ListAllByNamespace(l.controller.Informer().GetIndexer(), namespace, selector, func(obj interface{}) { - ret = append(ret, obj.(*DynamicSchema)) - }) - return -} - -func (l *dynamicSchemaLister) Get(namespace, name string) (*DynamicSchema, error) { - var key string - if namespace != "" { - key = namespace + "/" + name - } else { - key = name - } - obj, exists, err := l.controller.Informer().GetIndexer().GetByKey(key) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(schema.GroupResource{ - Group: DynamicSchemaGroupVersionKind.Group, - Resource: DynamicSchemaGroupVersionResource.Resource, - }, key) - } - return obj.(*DynamicSchema), nil -} - -type dynamicSchemaController struct { - controller.GenericController -} - -func (c *dynamicSchemaController) Generic() controller.GenericController { - return c.GenericController -} - -func (c *dynamicSchemaController) Lister() DynamicSchemaLister { - return &dynamicSchemaLister{ - controller: c, - } -} - -func (c *dynamicSchemaController) AddHandler(ctx context.Context, name string, handler DynamicSchemaHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*DynamicSchema); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *dynamicSchemaController) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, handler DynamicSchemaHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*DynamicSchema); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *dynamicSchemaController) AddClusterScopedHandler(ctx context.Context, name, cluster string, handler DynamicSchemaHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*DynamicSchema); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *dynamicSchemaController) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, cluster string, handler DynamicSchemaHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*DynamicSchema); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -type dynamicSchemaFactory struct { -} - -func (c dynamicSchemaFactory) Object() runtime.Object { - return &DynamicSchema{} -} - -func (c dynamicSchemaFactory) List() runtime.Object { - return &DynamicSchemaList{} -} - -func (s *dynamicSchemaClient) Controller() DynamicSchemaController { - genericController := controller.NewGenericController(DynamicSchemaGroupVersionKind.Kind+"Controller", - s.client.controllerFactory.ForResourceKind(DynamicSchemaGroupVersionResource, DynamicSchemaGroupVersionKind.Kind, false)) - - return &dynamicSchemaController{ - GenericController: genericController, - } -} - -type dynamicSchemaClient struct { - client *Client - ns string - objectClient *objectclient.ObjectClient - controller DynamicSchemaController -} - -func (s *dynamicSchemaClient) ObjectClient() *objectclient.ObjectClient { - return s.objectClient -} - -func (s *dynamicSchemaClient) Create(o *DynamicSchema) (*DynamicSchema, error) { - obj, err := s.objectClient.Create(o) - return obj.(*DynamicSchema), err -} - -func (s *dynamicSchemaClient) Get(name string, opts metav1.GetOptions) (*DynamicSchema, error) { - obj, err := s.objectClient.Get(name, opts) - return obj.(*DynamicSchema), err -} - -func (s *dynamicSchemaClient) GetNamespaced(namespace, name string, opts metav1.GetOptions) (*DynamicSchema, error) { - obj, err := s.objectClient.GetNamespaced(namespace, name, opts) - return obj.(*DynamicSchema), err -} - -func (s *dynamicSchemaClient) Update(o *DynamicSchema) (*DynamicSchema, error) { - obj, err := s.objectClient.Update(o.Name, o) - return obj.(*DynamicSchema), err -} - -func (s *dynamicSchemaClient) UpdateStatus(o *DynamicSchema) (*DynamicSchema, error) { - obj, err := s.objectClient.UpdateStatus(o.Name, o) - return obj.(*DynamicSchema), err -} - -func (s *dynamicSchemaClient) Delete(name string, options *metav1.DeleteOptions) error { - return s.objectClient.Delete(name, options) -} - -func (s *dynamicSchemaClient) DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error { - return s.objectClient.DeleteNamespaced(namespace, name, options) -} - -func (s *dynamicSchemaClient) List(opts metav1.ListOptions) (*DynamicSchemaList, error) { - obj, err := s.objectClient.List(opts) - return obj.(*DynamicSchemaList), err -} - -func (s *dynamicSchemaClient) ListNamespaced(namespace string, opts metav1.ListOptions) (*DynamicSchemaList, error) { - obj, err := s.objectClient.ListNamespaced(namespace, opts) - return obj.(*DynamicSchemaList), err -} - -func (s *dynamicSchemaClient) Watch(opts metav1.ListOptions) (watch.Interface, error) { - return s.objectClient.Watch(opts) -} - -// Patch applies the patch and returns the patched deployment. -func (s *dynamicSchemaClient) Patch(o *DynamicSchema, patchType types.PatchType, data []byte, subresources ...string) (*DynamicSchema, error) { - obj, err := s.objectClient.Patch(o.Name, o, patchType, data, subresources...) - return obj.(*DynamicSchema), err -} - -func (s *dynamicSchemaClient) DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error { - return s.objectClient.DeleteCollection(deleteOpts, listOpts) -} - -func (s *dynamicSchemaClient) AddHandler(ctx context.Context, name string, sync DynamicSchemaHandlerFunc) { - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *dynamicSchemaClient) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync DynamicSchemaHandlerFunc) { - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *dynamicSchemaClient) AddLifecycle(ctx context.Context, name string, lifecycle DynamicSchemaLifecycle) { - sync := NewDynamicSchemaLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *dynamicSchemaClient) AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle DynamicSchemaLifecycle) { - sync := NewDynamicSchemaLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *dynamicSchemaClient) AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync DynamicSchemaHandlerFunc) { - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *dynamicSchemaClient) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync DynamicSchemaHandlerFunc) { - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} - -func (s *dynamicSchemaClient) AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle DynamicSchemaLifecycle) { - sync := NewDynamicSchemaLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *dynamicSchemaClient) AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle DynamicSchemaLifecycle) { - sync := NewDynamicSchemaLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_dynamic_schema_lifecycle_adapter.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_dynamic_schema_lifecycle_adapter.go deleted file mode 100644 index dc1f5cbc..00000000 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_dynamic_schema_lifecycle_adapter.go +++ /dev/null @@ -1,66 +0,0 @@ -package v3 - -import ( - "github.com/rancher/norman/lifecycle" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/runtime" -) - -type DynamicSchemaLifecycle interface { - Create(obj *DynamicSchema) (runtime.Object, error) - Remove(obj *DynamicSchema) (runtime.Object, error) - Updated(obj *DynamicSchema) (runtime.Object, error) -} - -type dynamicSchemaLifecycleAdapter struct { - lifecycle DynamicSchemaLifecycle -} - -func (w *dynamicSchemaLifecycleAdapter) HasCreate() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasCreate() -} - -func (w *dynamicSchemaLifecycleAdapter) HasFinalize() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasFinalize() -} - -func (w *dynamicSchemaLifecycleAdapter) Create(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Create(obj.(*DynamicSchema)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *dynamicSchemaLifecycleAdapter) Finalize(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Remove(obj.(*DynamicSchema)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *dynamicSchemaLifecycleAdapter) Updated(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Updated(obj.(*DynamicSchema)) - if o == nil { - return nil, err - } - return o, err -} - -func NewDynamicSchemaLifecycleAdapter(name string, clusterScoped bool, client DynamicSchemaInterface, l DynamicSchemaLifecycle) DynamicSchemaHandlerFunc { - if clusterScoped { - resource.PutClusterScoped(DynamicSchemaGroupVersionResource) - } - adapter := &dynamicSchemaLifecycleAdapter{lifecycle: l} - syncFn := lifecycle.NewObjectLifecycleAdapter(name, clusterScoped, adapter, client.ObjectClient()) - return func(key string, obj *DynamicSchema) (runtime.Object, error) { - newObj, err := syncFn(key, obj) - if o, ok := newObj.(runtime.Object); ok { - return o, err - } - return nil, err - } -} diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_etcd_backup_controller.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_etcd_backup_controller.go deleted file mode 100644 index a1f1b51a..00000000 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_etcd_backup_controller.go +++ /dev/null @@ -1,321 +0,0 @@ -package v3 - -import ( - "context" - "time" - - "github.com/rancher/norman/controller" - "github.com/rancher/norman/objectclient" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/apimachinery/pkg/types" - "k8s.io/apimachinery/pkg/watch" - "k8s.io/client-go/tools/cache" -) - -var ( - EtcdBackupGroupVersionKind = schema.GroupVersionKind{ - Version: Version, - Group: GroupName, - Kind: "EtcdBackup", - } - EtcdBackupResource = metav1.APIResource{ - Name: "etcdbackups", - SingularName: "etcdbackup", - Namespaced: true, - - Kind: EtcdBackupGroupVersionKind.Kind, - } - - EtcdBackupGroupVersionResource = schema.GroupVersionResource{ - Group: GroupName, - Version: Version, - Resource: "etcdbackups", - } -) - -func init() { - resource.Put(EtcdBackupGroupVersionResource) -} - -func NewEtcdBackup(namespace, name string, obj EtcdBackup) *EtcdBackup { - obj.APIVersion, obj.Kind = EtcdBackupGroupVersionKind.ToAPIVersionAndKind() - obj.Name = name - obj.Namespace = namespace - return &obj -} - -type EtcdBackupList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []EtcdBackup `json:"items"` -} - -type EtcdBackupHandlerFunc func(key string, obj *EtcdBackup) (runtime.Object, error) - -type EtcdBackupChangeHandlerFunc func(obj *EtcdBackup) (runtime.Object, error) - -type EtcdBackupLister interface { - List(namespace string, selector labels.Selector) (ret []*EtcdBackup, err error) - Get(namespace, name string) (*EtcdBackup, error) -} - -type EtcdBackupController interface { - Generic() controller.GenericController - Informer() cache.SharedIndexInformer - Lister() EtcdBackupLister - AddHandler(ctx context.Context, name string, handler EtcdBackupHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync EtcdBackupHandlerFunc) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, handler EtcdBackupHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, handler EtcdBackupHandlerFunc) - Enqueue(namespace, name string) - EnqueueAfter(namespace, name string, after time.Duration) -} - -type EtcdBackupInterface interface { - ObjectClient() *objectclient.ObjectClient - Create(*EtcdBackup) (*EtcdBackup, error) - GetNamespaced(namespace, name string, opts metav1.GetOptions) (*EtcdBackup, error) - Get(name string, opts metav1.GetOptions) (*EtcdBackup, error) - Update(*EtcdBackup) (*EtcdBackup, error) - Delete(name string, options *metav1.DeleteOptions) error - DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error - List(opts metav1.ListOptions) (*EtcdBackupList, error) - ListNamespaced(namespace string, opts metav1.ListOptions) (*EtcdBackupList, error) - Watch(opts metav1.ListOptions) (watch.Interface, error) - DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error - Controller() EtcdBackupController - AddHandler(ctx context.Context, name string, sync EtcdBackupHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync EtcdBackupHandlerFunc) - AddLifecycle(ctx context.Context, name string, lifecycle EtcdBackupLifecycle) - AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle EtcdBackupLifecycle) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync EtcdBackupHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync EtcdBackupHandlerFunc) - AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle EtcdBackupLifecycle) - AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle EtcdBackupLifecycle) -} - -type etcdBackupLister struct { - controller *etcdBackupController -} - -func (l *etcdBackupLister) List(namespace string, selector labels.Selector) (ret []*EtcdBackup, err error) { - err = cache.ListAllByNamespace(l.controller.Informer().GetIndexer(), namespace, selector, func(obj interface{}) { - ret = append(ret, obj.(*EtcdBackup)) - }) - return -} - -func (l *etcdBackupLister) Get(namespace, name string) (*EtcdBackup, error) { - var key string - if namespace != "" { - key = namespace + "/" + name - } else { - key = name - } - obj, exists, err := l.controller.Informer().GetIndexer().GetByKey(key) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(schema.GroupResource{ - Group: EtcdBackupGroupVersionKind.Group, - Resource: EtcdBackupGroupVersionResource.Resource, - }, key) - } - return obj.(*EtcdBackup), nil -} - -type etcdBackupController struct { - controller.GenericController -} - -func (c *etcdBackupController) Generic() controller.GenericController { - return c.GenericController -} - -func (c *etcdBackupController) Lister() EtcdBackupLister { - return &etcdBackupLister{ - controller: c, - } -} - -func (c *etcdBackupController) AddHandler(ctx context.Context, name string, handler EtcdBackupHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*EtcdBackup); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *etcdBackupController) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, handler EtcdBackupHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*EtcdBackup); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *etcdBackupController) AddClusterScopedHandler(ctx context.Context, name, cluster string, handler EtcdBackupHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*EtcdBackup); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *etcdBackupController) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, cluster string, handler EtcdBackupHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*EtcdBackup); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -type etcdBackupFactory struct { -} - -func (c etcdBackupFactory) Object() runtime.Object { - return &EtcdBackup{} -} - -func (c etcdBackupFactory) List() runtime.Object { - return &EtcdBackupList{} -} - -func (s *etcdBackupClient) Controller() EtcdBackupController { - genericController := controller.NewGenericController(EtcdBackupGroupVersionKind.Kind+"Controller", - s.client.controllerFactory.ForResourceKind(EtcdBackupGroupVersionResource, EtcdBackupGroupVersionKind.Kind, true)) - - return &etcdBackupController{ - GenericController: genericController, - } -} - -type etcdBackupClient struct { - client *Client - ns string - objectClient *objectclient.ObjectClient - controller EtcdBackupController -} - -func (s *etcdBackupClient) ObjectClient() *objectclient.ObjectClient { - return s.objectClient -} - -func (s *etcdBackupClient) Create(o *EtcdBackup) (*EtcdBackup, error) { - obj, err := s.objectClient.Create(o) - return obj.(*EtcdBackup), err -} - -func (s *etcdBackupClient) Get(name string, opts metav1.GetOptions) (*EtcdBackup, error) { - obj, err := s.objectClient.Get(name, opts) - return obj.(*EtcdBackup), err -} - -func (s *etcdBackupClient) GetNamespaced(namespace, name string, opts metav1.GetOptions) (*EtcdBackup, error) { - obj, err := s.objectClient.GetNamespaced(namespace, name, opts) - return obj.(*EtcdBackup), err -} - -func (s *etcdBackupClient) Update(o *EtcdBackup) (*EtcdBackup, error) { - obj, err := s.objectClient.Update(o.Name, o) - return obj.(*EtcdBackup), err -} - -func (s *etcdBackupClient) UpdateStatus(o *EtcdBackup) (*EtcdBackup, error) { - obj, err := s.objectClient.UpdateStatus(o.Name, o) - return obj.(*EtcdBackup), err -} - -func (s *etcdBackupClient) Delete(name string, options *metav1.DeleteOptions) error { - return s.objectClient.Delete(name, options) -} - -func (s *etcdBackupClient) DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error { - return s.objectClient.DeleteNamespaced(namespace, name, options) -} - -func (s *etcdBackupClient) List(opts metav1.ListOptions) (*EtcdBackupList, error) { - obj, err := s.objectClient.List(opts) - return obj.(*EtcdBackupList), err -} - -func (s *etcdBackupClient) ListNamespaced(namespace string, opts metav1.ListOptions) (*EtcdBackupList, error) { - obj, err := s.objectClient.ListNamespaced(namespace, opts) - return obj.(*EtcdBackupList), err -} - -func (s *etcdBackupClient) Watch(opts metav1.ListOptions) (watch.Interface, error) { - return s.objectClient.Watch(opts) -} - -// Patch applies the patch and returns the patched deployment. -func (s *etcdBackupClient) Patch(o *EtcdBackup, patchType types.PatchType, data []byte, subresources ...string) (*EtcdBackup, error) { - obj, err := s.objectClient.Patch(o.Name, o, patchType, data, subresources...) - return obj.(*EtcdBackup), err -} - -func (s *etcdBackupClient) DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error { - return s.objectClient.DeleteCollection(deleteOpts, listOpts) -} - -func (s *etcdBackupClient) AddHandler(ctx context.Context, name string, sync EtcdBackupHandlerFunc) { - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *etcdBackupClient) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync EtcdBackupHandlerFunc) { - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *etcdBackupClient) AddLifecycle(ctx context.Context, name string, lifecycle EtcdBackupLifecycle) { - sync := NewEtcdBackupLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *etcdBackupClient) AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle EtcdBackupLifecycle) { - sync := NewEtcdBackupLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *etcdBackupClient) AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync EtcdBackupHandlerFunc) { - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *etcdBackupClient) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync EtcdBackupHandlerFunc) { - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} - -func (s *etcdBackupClient) AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle EtcdBackupLifecycle) { - sync := NewEtcdBackupLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *etcdBackupClient) AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle EtcdBackupLifecycle) { - sync := NewEtcdBackupLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_etcd_backup_lifecycle_adapter.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_etcd_backup_lifecycle_adapter.go deleted file mode 100644 index 84e46e8b..00000000 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_etcd_backup_lifecycle_adapter.go +++ /dev/null @@ -1,66 +0,0 @@ -package v3 - -import ( - "github.com/rancher/norman/lifecycle" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/runtime" -) - -type EtcdBackupLifecycle interface { - Create(obj *EtcdBackup) (runtime.Object, error) - Remove(obj *EtcdBackup) (runtime.Object, error) - Updated(obj *EtcdBackup) (runtime.Object, error) -} - -type etcdBackupLifecycleAdapter struct { - lifecycle EtcdBackupLifecycle -} - -func (w *etcdBackupLifecycleAdapter) HasCreate() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasCreate() -} - -func (w *etcdBackupLifecycleAdapter) HasFinalize() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasFinalize() -} - -func (w *etcdBackupLifecycleAdapter) Create(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Create(obj.(*EtcdBackup)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *etcdBackupLifecycleAdapter) Finalize(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Remove(obj.(*EtcdBackup)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *etcdBackupLifecycleAdapter) Updated(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Updated(obj.(*EtcdBackup)) - if o == nil { - return nil, err - } - return o, err -} - -func NewEtcdBackupLifecycleAdapter(name string, clusterScoped bool, client EtcdBackupInterface, l EtcdBackupLifecycle) EtcdBackupHandlerFunc { - if clusterScoped { - resource.PutClusterScoped(EtcdBackupGroupVersionResource) - } - adapter := &etcdBackupLifecycleAdapter{lifecycle: l} - syncFn := lifecycle.NewObjectLifecycleAdapter(name, clusterScoped, adapter, client.ObjectClient()) - return func(key string, obj *EtcdBackup) (runtime.Object, error) { - newObj, err := syncFn(key, obj) - if o, ok := newObj.(runtime.Object); ok { - return o, err - } - return nil, err - } -} diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_feature_controller.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_feature_controller.go deleted file mode 100644 index 4ecbe377..00000000 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_feature_controller.go +++ /dev/null @@ -1,320 +0,0 @@ -package v3 - -import ( - "context" - "time" - - "github.com/rancher/norman/controller" - "github.com/rancher/norman/objectclient" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/apimachinery/pkg/types" - "k8s.io/apimachinery/pkg/watch" - "k8s.io/client-go/tools/cache" -) - -var ( - FeatureGroupVersionKind = schema.GroupVersionKind{ - Version: Version, - Group: GroupName, - Kind: "Feature", - } - FeatureResource = metav1.APIResource{ - Name: "features", - SingularName: "feature", - Namespaced: false, - Kind: FeatureGroupVersionKind.Kind, - } - - FeatureGroupVersionResource = schema.GroupVersionResource{ - Group: GroupName, - Version: Version, - Resource: "features", - } -) - -func init() { - resource.Put(FeatureGroupVersionResource) -} - -func NewFeature(namespace, name string, obj Feature) *Feature { - obj.APIVersion, obj.Kind = FeatureGroupVersionKind.ToAPIVersionAndKind() - obj.Name = name - obj.Namespace = namespace - return &obj -} - -type FeatureList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []Feature `json:"items"` -} - -type FeatureHandlerFunc func(key string, obj *Feature) (runtime.Object, error) - -type FeatureChangeHandlerFunc func(obj *Feature) (runtime.Object, error) - -type FeatureLister interface { - List(namespace string, selector labels.Selector) (ret []*Feature, err error) - Get(namespace, name string) (*Feature, error) -} - -type FeatureController interface { - Generic() controller.GenericController - Informer() cache.SharedIndexInformer - Lister() FeatureLister - AddHandler(ctx context.Context, name string, handler FeatureHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync FeatureHandlerFunc) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, handler FeatureHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, handler FeatureHandlerFunc) - Enqueue(namespace, name string) - EnqueueAfter(namespace, name string, after time.Duration) -} - -type FeatureInterface interface { - ObjectClient() *objectclient.ObjectClient - Create(*Feature) (*Feature, error) - GetNamespaced(namespace, name string, opts metav1.GetOptions) (*Feature, error) - Get(name string, opts metav1.GetOptions) (*Feature, error) - Update(*Feature) (*Feature, error) - Delete(name string, options *metav1.DeleteOptions) error - DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error - List(opts metav1.ListOptions) (*FeatureList, error) - ListNamespaced(namespace string, opts metav1.ListOptions) (*FeatureList, error) - Watch(opts metav1.ListOptions) (watch.Interface, error) - DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error - Controller() FeatureController - AddHandler(ctx context.Context, name string, sync FeatureHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync FeatureHandlerFunc) - AddLifecycle(ctx context.Context, name string, lifecycle FeatureLifecycle) - AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle FeatureLifecycle) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync FeatureHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync FeatureHandlerFunc) - AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle FeatureLifecycle) - AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle FeatureLifecycle) -} - -type featureLister struct { - controller *featureController -} - -func (l *featureLister) List(namespace string, selector labels.Selector) (ret []*Feature, err error) { - err = cache.ListAllByNamespace(l.controller.Informer().GetIndexer(), namespace, selector, func(obj interface{}) { - ret = append(ret, obj.(*Feature)) - }) - return -} - -func (l *featureLister) Get(namespace, name string) (*Feature, error) { - var key string - if namespace != "" { - key = namespace + "/" + name - } else { - key = name - } - obj, exists, err := l.controller.Informer().GetIndexer().GetByKey(key) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(schema.GroupResource{ - Group: FeatureGroupVersionKind.Group, - Resource: FeatureGroupVersionResource.Resource, - }, key) - } - return obj.(*Feature), nil -} - -type featureController struct { - controller.GenericController -} - -func (c *featureController) Generic() controller.GenericController { - return c.GenericController -} - -func (c *featureController) Lister() FeatureLister { - return &featureLister{ - controller: c, - } -} - -func (c *featureController) AddHandler(ctx context.Context, name string, handler FeatureHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*Feature); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *featureController) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, handler FeatureHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*Feature); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *featureController) AddClusterScopedHandler(ctx context.Context, name, cluster string, handler FeatureHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*Feature); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *featureController) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, cluster string, handler FeatureHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*Feature); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -type featureFactory struct { -} - -func (c featureFactory) Object() runtime.Object { - return &Feature{} -} - -func (c featureFactory) List() runtime.Object { - return &FeatureList{} -} - -func (s *featureClient) Controller() FeatureController { - genericController := controller.NewGenericController(FeatureGroupVersionKind.Kind+"Controller", - s.client.controllerFactory.ForResourceKind(FeatureGroupVersionResource, FeatureGroupVersionKind.Kind, false)) - - return &featureController{ - GenericController: genericController, - } -} - -type featureClient struct { - client *Client - ns string - objectClient *objectclient.ObjectClient - controller FeatureController -} - -func (s *featureClient) ObjectClient() *objectclient.ObjectClient { - return s.objectClient -} - -func (s *featureClient) Create(o *Feature) (*Feature, error) { - obj, err := s.objectClient.Create(o) - return obj.(*Feature), err -} - -func (s *featureClient) Get(name string, opts metav1.GetOptions) (*Feature, error) { - obj, err := s.objectClient.Get(name, opts) - return obj.(*Feature), err -} - -func (s *featureClient) GetNamespaced(namespace, name string, opts metav1.GetOptions) (*Feature, error) { - obj, err := s.objectClient.GetNamespaced(namespace, name, opts) - return obj.(*Feature), err -} - -func (s *featureClient) Update(o *Feature) (*Feature, error) { - obj, err := s.objectClient.Update(o.Name, o) - return obj.(*Feature), err -} - -func (s *featureClient) UpdateStatus(o *Feature) (*Feature, error) { - obj, err := s.objectClient.UpdateStatus(o.Name, o) - return obj.(*Feature), err -} - -func (s *featureClient) Delete(name string, options *metav1.DeleteOptions) error { - return s.objectClient.Delete(name, options) -} - -func (s *featureClient) DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error { - return s.objectClient.DeleteNamespaced(namespace, name, options) -} - -func (s *featureClient) List(opts metav1.ListOptions) (*FeatureList, error) { - obj, err := s.objectClient.List(opts) - return obj.(*FeatureList), err -} - -func (s *featureClient) ListNamespaced(namespace string, opts metav1.ListOptions) (*FeatureList, error) { - obj, err := s.objectClient.ListNamespaced(namespace, opts) - return obj.(*FeatureList), err -} - -func (s *featureClient) Watch(opts metav1.ListOptions) (watch.Interface, error) { - return s.objectClient.Watch(opts) -} - -// Patch applies the patch and returns the patched deployment. -func (s *featureClient) Patch(o *Feature, patchType types.PatchType, data []byte, subresources ...string) (*Feature, error) { - obj, err := s.objectClient.Patch(o.Name, o, patchType, data, subresources...) - return obj.(*Feature), err -} - -func (s *featureClient) DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error { - return s.objectClient.DeleteCollection(deleteOpts, listOpts) -} - -func (s *featureClient) AddHandler(ctx context.Context, name string, sync FeatureHandlerFunc) { - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *featureClient) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync FeatureHandlerFunc) { - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *featureClient) AddLifecycle(ctx context.Context, name string, lifecycle FeatureLifecycle) { - sync := NewFeatureLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *featureClient) AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle FeatureLifecycle) { - sync := NewFeatureLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *featureClient) AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync FeatureHandlerFunc) { - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *featureClient) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync FeatureHandlerFunc) { - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} - -func (s *featureClient) AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle FeatureLifecycle) { - sync := NewFeatureLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *featureClient) AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle FeatureLifecycle) { - sync := NewFeatureLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_feature_lifecycle_adapter.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_feature_lifecycle_adapter.go deleted file mode 100644 index b10732a7..00000000 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_feature_lifecycle_adapter.go +++ /dev/null @@ -1,66 +0,0 @@ -package v3 - -import ( - "github.com/rancher/norman/lifecycle" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/runtime" -) - -type FeatureLifecycle interface { - Create(obj *Feature) (runtime.Object, error) - Remove(obj *Feature) (runtime.Object, error) - Updated(obj *Feature) (runtime.Object, error) -} - -type featureLifecycleAdapter struct { - lifecycle FeatureLifecycle -} - -func (w *featureLifecycleAdapter) HasCreate() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasCreate() -} - -func (w *featureLifecycleAdapter) HasFinalize() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasFinalize() -} - -func (w *featureLifecycleAdapter) Create(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Create(obj.(*Feature)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *featureLifecycleAdapter) Finalize(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Remove(obj.(*Feature)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *featureLifecycleAdapter) Updated(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Updated(obj.(*Feature)) - if o == nil { - return nil, err - } - return o, err -} - -func NewFeatureLifecycleAdapter(name string, clusterScoped bool, client FeatureInterface, l FeatureLifecycle) FeatureHandlerFunc { - if clusterScoped { - resource.PutClusterScoped(FeatureGroupVersionResource) - } - adapter := &featureLifecycleAdapter{lifecycle: l} - syncFn := lifecycle.NewObjectLifecycleAdapter(name, clusterScoped, adapter, client.ObjectClient()) - return func(key string, obj *Feature) (runtime.Object, error) { - newObj, err := syncFn(key, obj) - if o, ok := newObj.(runtime.Object); ok { - return o, err - } - return nil, err - } -} diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_global_dns_controller.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_global_dns_controller.go deleted file mode 100644 index e6581f94..00000000 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_global_dns_controller.go +++ /dev/null @@ -1,321 +0,0 @@ -package v3 - -import ( - "context" - "time" - - "github.com/rancher/norman/controller" - "github.com/rancher/norman/objectclient" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/apimachinery/pkg/types" - "k8s.io/apimachinery/pkg/watch" - "k8s.io/client-go/tools/cache" -) - -var ( - GlobalDnsGroupVersionKind = schema.GroupVersionKind{ - Version: Version, - Group: GroupName, - Kind: "GlobalDns", - } - GlobalDnsResource = metav1.APIResource{ - Name: "globaldnses", - SingularName: "globaldns", - Namespaced: true, - - Kind: GlobalDnsGroupVersionKind.Kind, - } - - GlobalDnsGroupVersionResource = schema.GroupVersionResource{ - Group: GroupName, - Version: Version, - Resource: "globaldnses", - } -) - -func init() { - resource.Put(GlobalDnsGroupVersionResource) -} - -func NewGlobalDns(namespace, name string, obj GlobalDns) *GlobalDns { - obj.APIVersion, obj.Kind = GlobalDnsGroupVersionKind.ToAPIVersionAndKind() - obj.Name = name - obj.Namespace = namespace - return &obj -} - -type GlobalDnsList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []GlobalDns `json:"items"` -} - -type GlobalDnsHandlerFunc func(key string, obj *GlobalDns) (runtime.Object, error) - -type GlobalDnsChangeHandlerFunc func(obj *GlobalDns) (runtime.Object, error) - -type GlobalDnsLister interface { - List(namespace string, selector labels.Selector) (ret []*GlobalDns, err error) - Get(namespace, name string) (*GlobalDns, error) -} - -type GlobalDnsController interface { - Generic() controller.GenericController - Informer() cache.SharedIndexInformer - Lister() GlobalDnsLister - AddHandler(ctx context.Context, name string, handler GlobalDnsHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync GlobalDnsHandlerFunc) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, handler GlobalDnsHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, handler GlobalDnsHandlerFunc) - Enqueue(namespace, name string) - EnqueueAfter(namespace, name string, after time.Duration) -} - -type GlobalDnsInterface interface { - ObjectClient() *objectclient.ObjectClient - Create(*GlobalDns) (*GlobalDns, error) - GetNamespaced(namespace, name string, opts metav1.GetOptions) (*GlobalDns, error) - Get(name string, opts metav1.GetOptions) (*GlobalDns, error) - Update(*GlobalDns) (*GlobalDns, error) - Delete(name string, options *metav1.DeleteOptions) error - DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error - List(opts metav1.ListOptions) (*GlobalDnsList, error) - ListNamespaced(namespace string, opts metav1.ListOptions) (*GlobalDnsList, error) - Watch(opts metav1.ListOptions) (watch.Interface, error) - DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error - Controller() GlobalDnsController - AddHandler(ctx context.Context, name string, sync GlobalDnsHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync GlobalDnsHandlerFunc) - AddLifecycle(ctx context.Context, name string, lifecycle GlobalDnsLifecycle) - AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle GlobalDnsLifecycle) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync GlobalDnsHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync GlobalDnsHandlerFunc) - AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle GlobalDnsLifecycle) - AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle GlobalDnsLifecycle) -} - -type globalDnsLister struct { - controller *globalDnsController -} - -func (l *globalDnsLister) List(namespace string, selector labels.Selector) (ret []*GlobalDns, err error) { - err = cache.ListAllByNamespace(l.controller.Informer().GetIndexer(), namespace, selector, func(obj interface{}) { - ret = append(ret, obj.(*GlobalDns)) - }) - return -} - -func (l *globalDnsLister) Get(namespace, name string) (*GlobalDns, error) { - var key string - if namespace != "" { - key = namespace + "/" + name - } else { - key = name - } - obj, exists, err := l.controller.Informer().GetIndexer().GetByKey(key) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(schema.GroupResource{ - Group: GlobalDnsGroupVersionKind.Group, - Resource: GlobalDnsGroupVersionResource.Resource, - }, key) - } - return obj.(*GlobalDns), nil -} - -type globalDnsController struct { - controller.GenericController -} - -func (c *globalDnsController) Generic() controller.GenericController { - return c.GenericController -} - -func (c *globalDnsController) Lister() GlobalDnsLister { - return &globalDnsLister{ - controller: c, - } -} - -func (c *globalDnsController) AddHandler(ctx context.Context, name string, handler GlobalDnsHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*GlobalDns); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *globalDnsController) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, handler GlobalDnsHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*GlobalDns); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *globalDnsController) AddClusterScopedHandler(ctx context.Context, name, cluster string, handler GlobalDnsHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*GlobalDns); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *globalDnsController) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, cluster string, handler GlobalDnsHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*GlobalDns); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -type globalDnsFactory struct { -} - -func (c globalDnsFactory) Object() runtime.Object { - return &GlobalDns{} -} - -func (c globalDnsFactory) List() runtime.Object { - return &GlobalDnsList{} -} - -func (s *globalDnsClient) Controller() GlobalDnsController { - genericController := controller.NewGenericController(GlobalDnsGroupVersionKind.Kind+"Controller", - s.client.controllerFactory.ForResourceKind(GlobalDnsGroupVersionResource, GlobalDnsGroupVersionKind.Kind, true)) - - return &globalDnsController{ - GenericController: genericController, - } -} - -type globalDnsClient struct { - client *Client - ns string - objectClient *objectclient.ObjectClient - controller GlobalDnsController -} - -func (s *globalDnsClient) ObjectClient() *objectclient.ObjectClient { - return s.objectClient -} - -func (s *globalDnsClient) Create(o *GlobalDns) (*GlobalDns, error) { - obj, err := s.objectClient.Create(o) - return obj.(*GlobalDns), err -} - -func (s *globalDnsClient) Get(name string, opts metav1.GetOptions) (*GlobalDns, error) { - obj, err := s.objectClient.Get(name, opts) - return obj.(*GlobalDns), err -} - -func (s *globalDnsClient) GetNamespaced(namespace, name string, opts metav1.GetOptions) (*GlobalDns, error) { - obj, err := s.objectClient.GetNamespaced(namespace, name, opts) - return obj.(*GlobalDns), err -} - -func (s *globalDnsClient) Update(o *GlobalDns) (*GlobalDns, error) { - obj, err := s.objectClient.Update(o.Name, o) - return obj.(*GlobalDns), err -} - -func (s *globalDnsClient) UpdateStatus(o *GlobalDns) (*GlobalDns, error) { - obj, err := s.objectClient.UpdateStatus(o.Name, o) - return obj.(*GlobalDns), err -} - -func (s *globalDnsClient) Delete(name string, options *metav1.DeleteOptions) error { - return s.objectClient.Delete(name, options) -} - -func (s *globalDnsClient) DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error { - return s.objectClient.DeleteNamespaced(namespace, name, options) -} - -func (s *globalDnsClient) List(opts metav1.ListOptions) (*GlobalDnsList, error) { - obj, err := s.objectClient.List(opts) - return obj.(*GlobalDnsList), err -} - -func (s *globalDnsClient) ListNamespaced(namespace string, opts metav1.ListOptions) (*GlobalDnsList, error) { - obj, err := s.objectClient.ListNamespaced(namespace, opts) - return obj.(*GlobalDnsList), err -} - -func (s *globalDnsClient) Watch(opts metav1.ListOptions) (watch.Interface, error) { - return s.objectClient.Watch(opts) -} - -// Patch applies the patch and returns the patched deployment. -func (s *globalDnsClient) Patch(o *GlobalDns, patchType types.PatchType, data []byte, subresources ...string) (*GlobalDns, error) { - obj, err := s.objectClient.Patch(o.Name, o, patchType, data, subresources...) - return obj.(*GlobalDns), err -} - -func (s *globalDnsClient) DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error { - return s.objectClient.DeleteCollection(deleteOpts, listOpts) -} - -func (s *globalDnsClient) AddHandler(ctx context.Context, name string, sync GlobalDnsHandlerFunc) { - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *globalDnsClient) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync GlobalDnsHandlerFunc) { - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *globalDnsClient) AddLifecycle(ctx context.Context, name string, lifecycle GlobalDnsLifecycle) { - sync := NewGlobalDnsLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *globalDnsClient) AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle GlobalDnsLifecycle) { - sync := NewGlobalDnsLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *globalDnsClient) AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync GlobalDnsHandlerFunc) { - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *globalDnsClient) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync GlobalDnsHandlerFunc) { - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} - -func (s *globalDnsClient) AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle GlobalDnsLifecycle) { - sync := NewGlobalDnsLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *globalDnsClient) AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle GlobalDnsLifecycle) { - sync := NewGlobalDnsLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_global_dns_lifecycle_adapter.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_global_dns_lifecycle_adapter.go deleted file mode 100644 index 4ff04fb0..00000000 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_global_dns_lifecycle_adapter.go +++ /dev/null @@ -1,66 +0,0 @@ -package v3 - -import ( - "github.com/rancher/norman/lifecycle" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/runtime" -) - -type GlobalDnsLifecycle interface { - Create(obj *GlobalDns) (runtime.Object, error) - Remove(obj *GlobalDns) (runtime.Object, error) - Updated(obj *GlobalDns) (runtime.Object, error) -} - -type globalDnsLifecycleAdapter struct { - lifecycle GlobalDnsLifecycle -} - -func (w *globalDnsLifecycleAdapter) HasCreate() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasCreate() -} - -func (w *globalDnsLifecycleAdapter) HasFinalize() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasFinalize() -} - -func (w *globalDnsLifecycleAdapter) Create(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Create(obj.(*GlobalDns)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *globalDnsLifecycleAdapter) Finalize(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Remove(obj.(*GlobalDns)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *globalDnsLifecycleAdapter) Updated(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Updated(obj.(*GlobalDns)) - if o == nil { - return nil, err - } - return o, err -} - -func NewGlobalDnsLifecycleAdapter(name string, clusterScoped bool, client GlobalDnsInterface, l GlobalDnsLifecycle) GlobalDnsHandlerFunc { - if clusterScoped { - resource.PutClusterScoped(GlobalDnsGroupVersionResource) - } - adapter := &globalDnsLifecycleAdapter{lifecycle: l} - syncFn := lifecycle.NewObjectLifecycleAdapter(name, clusterScoped, adapter, client.ObjectClient()) - return func(key string, obj *GlobalDns) (runtime.Object, error) { - newObj, err := syncFn(key, obj) - if o, ok := newObj.(runtime.Object); ok { - return o, err - } - return nil, err - } -} diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_global_dns_provider_controller.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_global_dns_provider_controller.go deleted file mode 100644 index e561159a..00000000 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_global_dns_provider_controller.go +++ /dev/null @@ -1,321 +0,0 @@ -package v3 - -import ( - "context" - "time" - - "github.com/rancher/norman/controller" - "github.com/rancher/norman/objectclient" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/apimachinery/pkg/types" - "k8s.io/apimachinery/pkg/watch" - "k8s.io/client-go/tools/cache" -) - -var ( - GlobalDNSProviderGroupVersionKind = schema.GroupVersionKind{ - Version: Version, - Group: GroupName, - Kind: "GlobalDNSProvider", - } - GlobalDNSProviderResource = metav1.APIResource{ - Name: "globaldnsproviders", - SingularName: "globaldnsprovider", - Namespaced: true, - - Kind: GlobalDNSProviderGroupVersionKind.Kind, - } - - GlobalDNSProviderGroupVersionResource = schema.GroupVersionResource{ - Group: GroupName, - Version: Version, - Resource: "globaldnsproviders", - } -) - -func init() { - resource.Put(GlobalDNSProviderGroupVersionResource) -} - -func NewGlobalDNSProvider(namespace, name string, obj GlobalDNSProvider) *GlobalDNSProvider { - obj.APIVersion, obj.Kind = GlobalDNSProviderGroupVersionKind.ToAPIVersionAndKind() - obj.Name = name - obj.Namespace = namespace - return &obj -} - -type GlobalDNSProviderList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []GlobalDNSProvider `json:"items"` -} - -type GlobalDNSProviderHandlerFunc func(key string, obj *GlobalDNSProvider) (runtime.Object, error) - -type GlobalDNSProviderChangeHandlerFunc func(obj *GlobalDNSProvider) (runtime.Object, error) - -type GlobalDNSProviderLister interface { - List(namespace string, selector labels.Selector) (ret []*GlobalDNSProvider, err error) - Get(namespace, name string) (*GlobalDNSProvider, error) -} - -type GlobalDNSProviderController interface { - Generic() controller.GenericController - Informer() cache.SharedIndexInformer - Lister() GlobalDNSProviderLister - AddHandler(ctx context.Context, name string, handler GlobalDNSProviderHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync GlobalDNSProviderHandlerFunc) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, handler GlobalDNSProviderHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, handler GlobalDNSProviderHandlerFunc) - Enqueue(namespace, name string) - EnqueueAfter(namespace, name string, after time.Duration) -} - -type GlobalDNSProviderInterface interface { - ObjectClient() *objectclient.ObjectClient - Create(*GlobalDNSProvider) (*GlobalDNSProvider, error) - GetNamespaced(namespace, name string, opts metav1.GetOptions) (*GlobalDNSProvider, error) - Get(name string, opts metav1.GetOptions) (*GlobalDNSProvider, error) - Update(*GlobalDNSProvider) (*GlobalDNSProvider, error) - Delete(name string, options *metav1.DeleteOptions) error - DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error - List(opts metav1.ListOptions) (*GlobalDNSProviderList, error) - ListNamespaced(namespace string, opts metav1.ListOptions) (*GlobalDNSProviderList, error) - Watch(opts metav1.ListOptions) (watch.Interface, error) - DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error - Controller() GlobalDNSProviderController - AddHandler(ctx context.Context, name string, sync GlobalDNSProviderHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync GlobalDNSProviderHandlerFunc) - AddLifecycle(ctx context.Context, name string, lifecycle GlobalDNSProviderLifecycle) - AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle GlobalDNSProviderLifecycle) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync GlobalDNSProviderHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync GlobalDNSProviderHandlerFunc) - AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle GlobalDNSProviderLifecycle) - AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle GlobalDNSProviderLifecycle) -} - -type globalDnsProviderLister struct { - controller *globalDnsProviderController -} - -func (l *globalDnsProviderLister) List(namespace string, selector labels.Selector) (ret []*GlobalDNSProvider, err error) { - err = cache.ListAllByNamespace(l.controller.Informer().GetIndexer(), namespace, selector, func(obj interface{}) { - ret = append(ret, obj.(*GlobalDNSProvider)) - }) - return -} - -func (l *globalDnsProviderLister) Get(namespace, name string) (*GlobalDNSProvider, error) { - var key string - if namespace != "" { - key = namespace + "/" + name - } else { - key = name - } - obj, exists, err := l.controller.Informer().GetIndexer().GetByKey(key) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(schema.GroupResource{ - Group: GlobalDNSProviderGroupVersionKind.Group, - Resource: GlobalDNSProviderGroupVersionResource.Resource, - }, key) - } - return obj.(*GlobalDNSProvider), nil -} - -type globalDnsProviderController struct { - controller.GenericController -} - -func (c *globalDnsProviderController) Generic() controller.GenericController { - return c.GenericController -} - -func (c *globalDnsProviderController) Lister() GlobalDNSProviderLister { - return &globalDnsProviderLister{ - controller: c, - } -} - -func (c *globalDnsProviderController) AddHandler(ctx context.Context, name string, handler GlobalDNSProviderHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*GlobalDNSProvider); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *globalDnsProviderController) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, handler GlobalDNSProviderHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*GlobalDNSProvider); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *globalDnsProviderController) AddClusterScopedHandler(ctx context.Context, name, cluster string, handler GlobalDNSProviderHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*GlobalDNSProvider); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *globalDnsProviderController) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, cluster string, handler GlobalDNSProviderHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*GlobalDNSProvider); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -type globalDnsProviderFactory struct { -} - -func (c globalDnsProviderFactory) Object() runtime.Object { - return &GlobalDNSProvider{} -} - -func (c globalDnsProviderFactory) List() runtime.Object { - return &GlobalDNSProviderList{} -} - -func (s *globalDnsProviderClient) Controller() GlobalDNSProviderController { - genericController := controller.NewGenericController(GlobalDNSProviderGroupVersionKind.Kind+"Controller", - s.client.controllerFactory.ForResourceKind(GlobalDNSProviderGroupVersionResource, GlobalDNSProviderGroupVersionKind.Kind, true)) - - return &globalDnsProviderController{ - GenericController: genericController, - } -} - -type globalDnsProviderClient struct { - client *Client - ns string - objectClient *objectclient.ObjectClient - controller GlobalDNSProviderController -} - -func (s *globalDnsProviderClient) ObjectClient() *objectclient.ObjectClient { - return s.objectClient -} - -func (s *globalDnsProviderClient) Create(o *GlobalDNSProvider) (*GlobalDNSProvider, error) { - obj, err := s.objectClient.Create(o) - return obj.(*GlobalDNSProvider), err -} - -func (s *globalDnsProviderClient) Get(name string, opts metav1.GetOptions) (*GlobalDNSProvider, error) { - obj, err := s.objectClient.Get(name, opts) - return obj.(*GlobalDNSProvider), err -} - -func (s *globalDnsProviderClient) GetNamespaced(namespace, name string, opts metav1.GetOptions) (*GlobalDNSProvider, error) { - obj, err := s.objectClient.GetNamespaced(namespace, name, opts) - return obj.(*GlobalDNSProvider), err -} - -func (s *globalDnsProviderClient) Update(o *GlobalDNSProvider) (*GlobalDNSProvider, error) { - obj, err := s.objectClient.Update(o.Name, o) - return obj.(*GlobalDNSProvider), err -} - -func (s *globalDnsProviderClient) UpdateStatus(o *GlobalDNSProvider) (*GlobalDNSProvider, error) { - obj, err := s.objectClient.UpdateStatus(o.Name, o) - return obj.(*GlobalDNSProvider), err -} - -func (s *globalDnsProviderClient) Delete(name string, options *metav1.DeleteOptions) error { - return s.objectClient.Delete(name, options) -} - -func (s *globalDnsProviderClient) DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error { - return s.objectClient.DeleteNamespaced(namespace, name, options) -} - -func (s *globalDnsProviderClient) List(opts metav1.ListOptions) (*GlobalDNSProviderList, error) { - obj, err := s.objectClient.List(opts) - return obj.(*GlobalDNSProviderList), err -} - -func (s *globalDnsProviderClient) ListNamespaced(namespace string, opts metav1.ListOptions) (*GlobalDNSProviderList, error) { - obj, err := s.objectClient.ListNamespaced(namespace, opts) - return obj.(*GlobalDNSProviderList), err -} - -func (s *globalDnsProviderClient) Watch(opts metav1.ListOptions) (watch.Interface, error) { - return s.objectClient.Watch(opts) -} - -// Patch applies the patch and returns the patched deployment. -func (s *globalDnsProviderClient) Patch(o *GlobalDNSProvider, patchType types.PatchType, data []byte, subresources ...string) (*GlobalDNSProvider, error) { - obj, err := s.objectClient.Patch(o.Name, o, patchType, data, subresources...) - return obj.(*GlobalDNSProvider), err -} - -func (s *globalDnsProviderClient) DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error { - return s.objectClient.DeleteCollection(deleteOpts, listOpts) -} - -func (s *globalDnsProviderClient) AddHandler(ctx context.Context, name string, sync GlobalDNSProviderHandlerFunc) { - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *globalDnsProviderClient) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync GlobalDNSProviderHandlerFunc) { - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *globalDnsProviderClient) AddLifecycle(ctx context.Context, name string, lifecycle GlobalDNSProviderLifecycle) { - sync := NewGlobalDNSProviderLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *globalDnsProviderClient) AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle GlobalDNSProviderLifecycle) { - sync := NewGlobalDNSProviderLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *globalDnsProviderClient) AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync GlobalDNSProviderHandlerFunc) { - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *globalDnsProviderClient) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync GlobalDNSProviderHandlerFunc) { - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} - -func (s *globalDnsProviderClient) AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle GlobalDNSProviderLifecycle) { - sync := NewGlobalDNSProviderLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *globalDnsProviderClient) AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle GlobalDNSProviderLifecycle) { - sync := NewGlobalDNSProviderLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_global_dns_provider_lifecycle_adapter.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_global_dns_provider_lifecycle_adapter.go deleted file mode 100644 index a6f6fb7f..00000000 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_global_dns_provider_lifecycle_adapter.go +++ /dev/null @@ -1,66 +0,0 @@ -package v3 - -import ( - "github.com/rancher/norman/lifecycle" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/runtime" -) - -type GlobalDNSProviderLifecycle interface { - Create(obj *GlobalDNSProvider) (runtime.Object, error) - Remove(obj *GlobalDNSProvider) (runtime.Object, error) - Updated(obj *GlobalDNSProvider) (runtime.Object, error) -} - -type globalDnsProviderLifecycleAdapter struct { - lifecycle GlobalDNSProviderLifecycle -} - -func (w *globalDnsProviderLifecycleAdapter) HasCreate() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasCreate() -} - -func (w *globalDnsProviderLifecycleAdapter) HasFinalize() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasFinalize() -} - -func (w *globalDnsProviderLifecycleAdapter) Create(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Create(obj.(*GlobalDNSProvider)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *globalDnsProviderLifecycleAdapter) Finalize(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Remove(obj.(*GlobalDNSProvider)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *globalDnsProviderLifecycleAdapter) Updated(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Updated(obj.(*GlobalDNSProvider)) - if o == nil { - return nil, err - } - return o, err -} - -func NewGlobalDNSProviderLifecycleAdapter(name string, clusterScoped bool, client GlobalDNSProviderInterface, l GlobalDNSProviderLifecycle) GlobalDNSProviderHandlerFunc { - if clusterScoped { - resource.PutClusterScoped(GlobalDNSProviderGroupVersionResource) - } - adapter := &globalDnsProviderLifecycleAdapter{lifecycle: l} - syncFn := lifecycle.NewObjectLifecycleAdapter(name, clusterScoped, adapter, client.ObjectClient()) - return func(key string, obj *GlobalDNSProvider) (runtime.Object, error) { - newObj, err := syncFn(key, obj) - if o, ok := newObj.(runtime.Object); ok { - return o, err - } - return nil, err - } -} diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_global_role_binding_controller.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_global_role_binding_controller.go deleted file mode 100644 index 76f07d97..00000000 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_global_role_binding_controller.go +++ /dev/null @@ -1,320 +0,0 @@ -package v3 - -import ( - "context" - "time" - - "github.com/rancher/norman/controller" - "github.com/rancher/norman/objectclient" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/apimachinery/pkg/types" - "k8s.io/apimachinery/pkg/watch" - "k8s.io/client-go/tools/cache" -) - -var ( - GlobalRoleBindingGroupVersionKind = schema.GroupVersionKind{ - Version: Version, - Group: GroupName, - Kind: "GlobalRoleBinding", - } - GlobalRoleBindingResource = metav1.APIResource{ - Name: "globalrolebindings", - SingularName: "globalrolebinding", - Namespaced: false, - Kind: GlobalRoleBindingGroupVersionKind.Kind, - } - - GlobalRoleBindingGroupVersionResource = schema.GroupVersionResource{ - Group: GroupName, - Version: Version, - Resource: "globalrolebindings", - } -) - -func init() { - resource.Put(GlobalRoleBindingGroupVersionResource) -} - -func NewGlobalRoleBinding(namespace, name string, obj GlobalRoleBinding) *GlobalRoleBinding { - obj.APIVersion, obj.Kind = GlobalRoleBindingGroupVersionKind.ToAPIVersionAndKind() - obj.Name = name - obj.Namespace = namespace - return &obj -} - -type GlobalRoleBindingList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []GlobalRoleBinding `json:"items"` -} - -type GlobalRoleBindingHandlerFunc func(key string, obj *GlobalRoleBinding) (runtime.Object, error) - -type GlobalRoleBindingChangeHandlerFunc func(obj *GlobalRoleBinding) (runtime.Object, error) - -type GlobalRoleBindingLister interface { - List(namespace string, selector labels.Selector) (ret []*GlobalRoleBinding, err error) - Get(namespace, name string) (*GlobalRoleBinding, error) -} - -type GlobalRoleBindingController interface { - Generic() controller.GenericController - Informer() cache.SharedIndexInformer - Lister() GlobalRoleBindingLister - AddHandler(ctx context.Context, name string, handler GlobalRoleBindingHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync GlobalRoleBindingHandlerFunc) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, handler GlobalRoleBindingHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, handler GlobalRoleBindingHandlerFunc) - Enqueue(namespace, name string) - EnqueueAfter(namespace, name string, after time.Duration) -} - -type GlobalRoleBindingInterface interface { - ObjectClient() *objectclient.ObjectClient - Create(*GlobalRoleBinding) (*GlobalRoleBinding, error) - GetNamespaced(namespace, name string, opts metav1.GetOptions) (*GlobalRoleBinding, error) - Get(name string, opts metav1.GetOptions) (*GlobalRoleBinding, error) - Update(*GlobalRoleBinding) (*GlobalRoleBinding, error) - Delete(name string, options *metav1.DeleteOptions) error - DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error - List(opts metav1.ListOptions) (*GlobalRoleBindingList, error) - ListNamespaced(namespace string, opts metav1.ListOptions) (*GlobalRoleBindingList, error) - Watch(opts metav1.ListOptions) (watch.Interface, error) - DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error - Controller() GlobalRoleBindingController - AddHandler(ctx context.Context, name string, sync GlobalRoleBindingHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync GlobalRoleBindingHandlerFunc) - AddLifecycle(ctx context.Context, name string, lifecycle GlobalRoleBindingLifecycle) - AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle GlobalRoleBindingLifecycle) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync GlobalRoleBindingHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync GlobalRoleBindingHandlerFunc) - AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle GlobalRoleBindingLifecycle) - AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle GlobalRoleBindingLifecycle) -} - -type globalRoleBindingLister struct { - controller *globalRoleBindingController -} - -func (l *globalRoleBindingLister) List(namespace string, selector labels.Selector) (ret []*GlobalRoleBinding, err error) { - err = cache.ListAllByNamespace(l.controller.Informer().GetIndexer(), namespace, selector, func(obj interface{}) { - ret = append(ret, obj.(*GlobalRoleBinding)) - }) - return -} - -func (l *globalRoleBindingLister) Get(namespace, name string) (*GlobalRoleBinding, error) { - var key string - if namespace != "" { - key = namespace + "/" + name - } else { - key = name - } - obj, exists, err := l.controller.Informer().GetIndexer().GetByKey(key) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(schema.GroupResource{ - Group: GlobalRoleBindingGroupVersionKind.Group, - Resource: GlobalRoleBindingGroupVersionResource.Resource, - }, key) - } - return obj.(*GlobalRoleBinding), nil -} - -type globalRoleBindingController struct { - controller.GenericController -} - -func (c *globalRoleBindingController) Generic() controller.GenericController { - return c.GenericController -} - -func (c *globalRoleBindingController) Lister() GlobalRoleBindingLister { - return &globalRoleBindingLister{ - controller: c, - } -} - -func (c *globalRoleBindingController) AddHandler(ctx context.Context, name string, handler GlobalRoleBindingHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*GlobalRoleBinding); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *globalRoleBindingController) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, handler GlobalRoleBindingHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*GlobalRoleBinding); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *globalRoleBindingController) AddClusterScopedHandler(ctx context.Context, name, cluster string, handler GlobalRoleBindingHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*GlobalRoleBinding); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *globalRoleBindingController) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, cluster string, handler GlobalRoleBindingHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*GlobalRoleBinding); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -type globalRoleBindingFactory struct { -} - -func (c globalRoleBindingFactory) Object() runtime.Object { - return &GlobalRoleBinding{} -} - -func (c globalRoleBindingFactory) List() runtime.Object { - return &GlobalRoleBindingList{} -} - -func (s *globalRoleBindingClient) Controller() GlobalRoleBindingController { - genericController := controller.NewGenericController(GlobalRoleBindingGroupVersionKind.Kind+"Controller", - s.client.controllerFactory.ForResourceKind(GlobalRoleBindingGroupVersionResource, GlobalRoleBindingGroupVersionKind.Kind, false)) - - return &globalRoleBindingController{ - GenericController: genericController, - } -} - -type globalRoleBindingClient struct { - client *Client - ns string - objectClient *objectclient.ObjectClient - controller GlobalRoleBindingController -} - -func (s *globalRoleBindingClient) ObjectClient() *objectclient.ObjectClient { - return s.objectClient -} - -func (s *globalRoleBindingClient) Create(o *GlobalRoleBinding) (*GlobalRoleBinding, error) { - obj, err := s.objectClient.Create(o) - return obj.(*GlobalRoleBinding), err -} - -func (s *globalRoleBindingClient) Get(name string, opts metav1.GetOptions) (*GlobalRoleBinding, error) { - obj, err := s.objectClient.Get(name, opts) - return obj.(*GlobalRoleBinding), err -} - -func (s *globalRoleBindingClient) GetNamespaced(namespace, name string, opts metav1.GetOptions) (*GlobalRoleBinding, error) { - obj, err := s.objectClient.GetNamespaced(namespace, name, opts) - return obj.(*GlobalRoleBinding), err -} - -func (s *globalRoleBindingClient) Update(o *GlobalRoleBinding) (*GlobalRoleBinding, error) { - obj, err := s.objectClient.Update(o.Name, o) - return obj.(*GlobalRoleBinding), err -} - -func (s *globalRoleBindingClient) UpdateStatus(o *GlobalRoleBinding) (*GlobalRoleBinding, error) { - obj, err := s.objectClient.UpdateStatus(o.Name, o) - return obj.(*GlobalRoleBinding), err -} - -func (s *globalRoleBindingClient) Delete(name string, options *metav1.DeleteOptions) error { - return s.objectClient.Delete(name, options) -} - -func (s *globalRoleBindingClient) DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error { - return s.objectClient.DeleteNamespaced(namespace, name, options) -} - -func (s *globalRoleBindingClient) List(opts metav1.ListOptions) (*GlobalRoleBindingList, error) { - obj, err := s.objectClient.List(opts) - return obj.(*GlobalRoleBindingList), err -} - -func (s *globalRoleBindingClient) ListNamespaced(namespace string, opts metav1.ListOptions) (*GlobalRoleBindingList, error) { - obj, err := s.objectClient.ListNamespaced(namespace, opts) - return obj.(*GlobalRoleBindingList), err -} - -func (s *globalRoleBindingClient) Watch(opts metav1.ListOptions) (watch.Interface, error) { - return s.objectClient.Watch(opts) -} - -// Patch applies the patch and returns the patched deployment. -func (s *globalRoleBindingClient) Patch(o *GlobalRoleBinding, patchType types.PatchType, data []byte, subresources ...string) (*GlobalRoleBinding, error) { - obj, err := s.objectClient.Patch(o.Name, o, patchType, data, subresources...) - return obj.(*GlobalRoleBinding), err -} - -func (s *globalRoleBindingClient) DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error { - return s.objectClient.DeleteCollection(deleteOpts, listOpts) -} - -func (s *globalRoleBindingClient) AddHandler(ctx context.Context, name string, sync GlobalRoleBindingHandlerFunc) { - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *globalRoleBindingClient) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync GlobalRoleBindingHandlerFunc) { - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *globalRoleBindingClient) AddLifecycle(ctx context.Context, name string, lifecycle GlobalRoleBindingLifecycle) { - sync := NewGlobalRoleBindingLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *globalRoleBindingClient) AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle GlobalRoleBindingLifecycle) { - sync := NewGlobalRoleBindingLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *globalRoleBindingClient) AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync GlobalRoleBindingHandlerFunc) { - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *globalRoleBindingClient) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync GlobalRoleBindingHandlerFunc) { - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} - -func (s *globalRoleBindingClient) AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle GlobalRoleBindingLifecycle) { - sync := NewGlobalRoleBindingLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *globalRoleBindingClient) AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle GlobalRoleBindingLifecycle) { - sync := NewGlobalRoleBindingLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_global_role_binding_lifecycle_adapter.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_global_role_binding_lifecycle_adapter.go deleted file mode 100644 index a2f75e54..00000000 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_global_role_binding_lifecycle_adapter.go +++ /dev/null @@ -1,66 +0,0 @@ -package v3 - -import ( - "github.com/rancher/norman/lifecycle" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/runtime" -) - -type GlobalRoleBindingLifecycle interface { - Create(obj *GlobalRoleBinding) (runtime.Object, error) - Remove(obj *GlobalRoleBinding) (runtime.Object, error) - Updated(obj *GlobalRoleBinding) (runtime.Object, error) -} - -type globalRoleBindingLifecycleAdapter struct { - lifecycle GlobalRoleBindingLifecycle -} - -func (w *globalRoleBindingLifecycleAdapter) HasCreate() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasCreate() -} - -func (w *globalRoleBindingLifecycleAdapter) HasFinalize() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasFinalize() -} - -func (w *globalRoleBindingLifecycleAdapter) Create(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Create(obj.(*GlobalRoleBinding)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *globalRoleBindingLifecycleAdapter) Finalize(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Remove(obj.(*GlobalRoleBinding)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *globalRoleBindingLifecycleAdapter) Updated(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Updated(obj.(*GlobalRoleBinding)) - if o == nil { - return nil, err - } - return o, err -} - -func NewGlobalRoleBindingLifecycleAdapter(name string, clusterScoped bool, client GlobalRoleBindingInterface, l GlobalRoleBindingLifecycle) GlobalRoleBindingHandlerFunc { - if clusterScoped { - resource.PutClusterScoped(GlobalRoleBindingGroupVersionResource) - } - adapter := &globalRoleBindingLifecycleAdapter{lifecycle: l} - syncFn := lifecycle.NewObjectLifecycleAdapter(name, clusterScoped, adapter, client.ObjectClient()) - return func(key string, obj *GlobalRoleBinding) (runtime.Object, error) { - newObj, err := syncFn(key, obj) - if o, ok := newObj.(runtime.Object); ok { - return o, err - } - return nil, err - } -} diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_global_role_controller.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_global_role_controller.go deleted file mode 100644 index cf36addc..00000000 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_global_role_controller.go +++ /dev/null @@ -1,320 +0,0 @@ -package v3 - -import ( - "context" - "time" - - "github.com/rancher/norman/controller" - "github.com/rancher/norman/objectclient" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/apimachinery/pkg/types" - "k8s.io/apimachinery/pkg/watch" - "k8s.io/client-go/tools/cache" -) - -var ( - GlobalRoleGroupVersionKind = schema.GroupVersionKind{ - Version: Version, - Group: GroupName, - Kind: "GlobalRole", - } - GlobalRoleResource = metav1.APIResource{ - Name: "globalroles", - SingularName: "globalrole", - Namespaced: false, - Kind: GlobalRoleGroupVersionKind.Kind, - } - - GlobalRoleGroupVersionResource = schema.GroupVersionResource{ - Group: GroupName, - Version: Version, - Resource: "globalroles", - } -) - -func init() { - resource.Put(GlobalRoleGroupVersionResource) -} - -func NewGlobalRole(namespace, name string, obj GlobalRole) *GlobalRole { - obj.APIVersion, obj.Kind = GlobalRoleGroupVersionKind.ToAPIVersionAndKind() - obj.Name = name - obj.Namespace = namespace - return &obj -} - -type GlobalRoleList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []GlobalRole `json:"items"` -} - -type GlobalRoleHandlerFunc func(key string, obj *GlobalRole) (runtime.Object, error) - -type GlobalRoleChangeHandlerFunc func(obj *GlobalRole) (runtime.Object, error) - -type GlobalRoleLister interface { - List(namespace string, selector labels.Selector) (ret []*GlobalRole, err error) - Get(namespace, name string) (*GlobalRole, error) -} - -type GlobalRoleController interface { - Generic() controller.GenericController - Informer() cache.SharedIndexInformer - Lister() GlobalRoleLister - AddHandler(ctx context.Context, name string, handler GlobalRoleHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync GlobalRoleHandlerFunc) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, handler GlobalRoleHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, handler GlobalRoleHandlerFunc) - Enqueue(namespace, name string) - EnqueueAfter(namespace, name string, after time.Duration) -} - -type GlobalRoleInterface interface { - ObjectClient() *objectclient.ObjectClient - Create(*GlobalRole) (*GlobalRole, error) - GetNamespaced(namespace, name string, opts metav1.GetOptions) (*GlobalRole, error) - Get(name string, opts metav1.GetOptions) (*GlobalRole, error) - Update(*GlobalRole) (*GlobalRole, error) - Delete(name string, options *metav1.DeleteOptions) error - DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error - List(opts metav1.ListOptions) (*GlobalRoleList, error) - ListNamespaced(namespace string, opts metav1.ListOptions) (*GlobalRoleList, error) - Watch(opts metav1.ListOptions) (watch.Interface, error) - DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error - Controller() GlobalRoleController - AddHandler(ctx context.Context, name string, sync GlobalRoleHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync GlobalRoleHandlerFunc) - AddLifecycle(ctx context.Context, name string, lifecycle GlobalRoleLifecycle) - AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle GlobalRoleLifecycle) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync GlobalRoleHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync GlobalRoleHandlerFunc) - AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle GlobalRoleLifecycle) - AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle GlobalRoleLifecycle) -} - -type globalRoleLister struct { - controller *globalRoleController -} - -func (l *globalRoleLister) List(namespace string, selector labels.Selector) (ret []*GlobalRole, err error) { - err = cache.ListAllByNamespace(l.controller.Informer().GetIndexer(), namespace, selector, func(obj interface{}) { - ret = append(ret, obj.(*GlobalRole)) - }) - return -} - -func (l *globalRoleLister) Get(namespace, name string) (*GlobalRole, error) { - var key string - if namespace != "" { - key = namespace + "/" + name - } else { - key = name - } - obj, exists, err := l.controller.Informer().GetIndexer().GetByKey(key) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(schema.GroupResource{ - Group: GlobalRoleGroupVersionKind.Group, - Resource: GlobalRoleGroupVersionResource.Resource, - }, key) - } - return obj.(*GlobalRole), nil -} - -type globalRoleController struct { - controller.GenericController -} - -func (c *globalRoleController) Generic() controller.GenericController { - return c.GenericController -} - -func (c *globalRoleController) Lister() GlobalRoleLister { - return &globalRoleLister{ - controller: c, - } -} - -func (c *globalRoleController) AddHandler(ctx context.Context, name string, handler GlobalRoleHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*GlobalRole); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *globalRoleController) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, handler GlobalRoleHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*GlobalRole); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *globalRoleController) AddClusterScopedHandler(ctx context.Context, name, cluster string, handler GlobalRoleHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*GlobalRole); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *globalRoleController) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, cluster string, handler GlobalRoleHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*GlobalRole); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -type globalRoleFactory struct { -} - -func (c globalRoleFactory) Object() runtime.Object { - return &GlobalRole{} -} - -func (c globalRoleFactory) List() runtime.Object { - return &GlobalRoleList{} -} - -func (s *globalRoleClient) Controller() GlobalRoleController { - genericController := controller.NewGenericController(GlobalRoleGroupVersionKind.Kind+"Controller", - s.client.controllerFactory.ForResourceKind(GlobalRoleGroupVersionResource, GlobalRoleGroupVersionKind.Kind, false)) - - return &globalRoleController{ - GenericController: genericController, - } -} - -type globalRoleClient struct { - client *Client - ns string - objectClient *objectclient.ObjectClient - controller GlobalRoleController -} - -func (s *globalRoleClient) ObjectClient() *objectclient.ObjectClient { - return s.objectClient -} - -func (s *globalRoleClient) Create(o *GlobalRole) (*GlobalRole, error) { - obj, err := s.objectClient.Create(o) - return obj.(*GlobalRole), err -} - -func (s *globalRoleClient) Get(name string, opts metav1.GetOptions) (*GlobalRole, error) { - obj, err := s.objectClient.Get(name, opts) - return obj.(*GlobalRole), err -} - -func (s *globalRoleClient) GetNamespaced(namespace, name string, opts metav1.GetOptions) (*GlobalRole, error) { - obj, err := s.objectClient.GetNamespaced(namespace, name, opts) - return obj.(*GlobalRole), err -} - -func (s *globalRoleClient) Update(o *GlobalRole) (*GlobalRole, error) { - obj, err := s.objectClient.Update(o.Name, o) - return obj.(*GlobalRole), err -} - -func (s *globalRoleClient) UpdateStatus(o *GlobalRole) (*GlobalRole, error) { - obj, err := s.objectClient.UpdateStatus(o.Name, o) - return obj.(*GlobalRole), err -} - -func (s *globalRoleClient) Delete(name string, options *metav1.DeleteOptions) error { - return s.objectClient.Delete(name, options) -} - -func (s *globalRoleClient) DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error { - return s.objectClient.DeleteNamespaced(namespace, name, options) -} - -func (s *globalRoleClient) List(opts metav1.ListOptions) (*GlobalRoleList, error) { - obj, err := s.objectClient.List(opts) - return obj.(*GlobalRoleList), err -} - -func (s *globalRoleClient) ListNamespaced(namespace string, opts metav1.ListOptions) (*GlobalRoleList, error) { - obj, err := s.objectClient.ListNamespaced(namespace, opts) - return obj.(*GlobalRoleList), err -} - -func (s *globalRoleClient) Watch(opts metav1.ListOptions) (watch.Interface, error) { - return s.objectClient.Watch(opts) -} - -// Patch applies the patch and returns the patched deployment. -func (s *globalRoleClient) Patch(o *GlobalRole, patchType types.PatchType, data []byte, subresources ...string) (*GlobalRole, error) { - obj, err := s.objectClient.Patch(o.Name, o, patchType, data, subresources...) - return obj.(*GlobalRole), err -} - -func (s *globalRoleClient) DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error { - return s.objectClient.DeleteCollection(deleteOpts, listOpts) -} - -func (s *globalRoleClient) AddHandler(ctx context.Context, name string, sync GlobalRoleHandlerFunc) { - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *globalRoleClient) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync GlobalRoleHandlerFunc) { - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *globalRoleClient) AddLifecycle(ctx context.Context, name string, lifecycle GlobalRoleLifecycle) { - sync := NewGlobalRoleLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *globalRoleClient) AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle GlobalRoleLifecycle) { - sync := NewGlobalRoleLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *globalRoleClient) AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync GlobalRoleHandlerFunc) { - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *globalRoleClient) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync GlobalRoleHandlerFunc) { - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} - -func (s *globalRoleClient) AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle GlobalRoleLifecycle) { - sync := NewGlobalRoleLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *globalRoleClient) AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle GlobalRoleLifecycle) { - sync := NewGlobalRoleLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_global_role_lifecycle_adapter.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_global_role_lifecycle_adapter.go deleted file mode 100644 index 9e8091f9..00000000 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_global_role_lifecycle_adapter.go +++ /dev/null @@ -1,66 +0,0 @@ -package v3 - -import ( - "github.com/rancher/norman/lifecycle" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/runtime" -) - -type GlobalRoleLifecycle interface { - Create(obj *GlobalRole) (runtime.Object, error) - Remove(obj *GlobalRole) (runtime.Object, error) - Updated(obj *GlobalRole) (runtime.Object, error) -} - -type globalRoleLifecycleAdapter struct { - lifecycle GlobalRoleLifecycle -} - -func (w *globalRoleLifecycleAdapter) HasCreate() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasCreate() -} - -func (w *globalRoleLifecycleAdapter) HasFinalize() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasFinalize() -} - -func (w *globalRoleLifecycleAdapter) Create(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Create(obj.(*GlobalRole)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *globalRoleLifecycleAdapter) Finalize(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Remove(obj.(*GlobalRole)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *globalRoleLifecycleAdapter) Updated(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Updated(obj.(*GlobalRole)) - if o == nil { - return nil, err - } - return o, err -} - -func NewGlobalRoleLifecycleAdapter(name string, clusterScoped bool, client GlobalRoleInterface, l GlobalRoleLifecycle) GlobalRoleHandlerFunc { - if clusterScoped { - resource.PutClusterScoped(GlobalRoleGroupVersionResource) - } - adapter := &globalRoleLifecycleAdapter{lifecycle: l} - syncFn := lifecycle.NewObjectLifecycleAdapter(name, clusterScoped, adapter, client.ObjectClient()) - return func(key string, obj *GlobalRole) (runtime.Object, error) { - newObj, err := syncFn(key, obj) - if o, ok := newObj.(runtime.Object); ok { - return o, err - } - return nil, err - } -} diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_group_controller.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_group_controller.go deleted file mode 100644 index 8863e9af..00000000 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_group_controller.go +++ /dev/null @@ -1,320 +0,0 @@ -package v3 - -import ( - "context" - "time" - - "github.com/rancher/norman/controller" - "github.com/rancher/norman/objectclient" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/apimachinery/pkg/types" - "k8s.io/apimachinery/pkg/watch" - "k8s.io/client-go/tools/cache" -) - -var ( - GroupGroupVersionKind = schema.GroupVersionKind{ - Version: Version, - Group: GroupName, - Kind: "Group", - } - GroupResource = metav1.APIResource{ - Name: "groups", - SingularName: "group", - Namespaced: false, - Kind: GroupGroupVersionKind.Kind, - } - - GroupGroupVersionResource = schema.GroupVersionResource{ - Group: GroupName, - Version: Version, - Resource: "groups", - } -) - -func init() { - resource.Put(GroupGroupVersionResource) -} - -func NewGroup(namespace, name string, obj Group) *Group { - obj.APIVersion, obj.Kind = GroupGroupVersionKind.ToAPIVersionAndKind() - obj.Name = name - obj.Namespace = namespace - return &obj -} - -type GroupList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []Group `json:"items"` -} - -type GroupHandlerFunc func(key string, obj *Group) (runtime.Object, error) - -type GroupChangeHandlerFunc func(obj *Group) (runtime.Object, error) - -type GroupLister interface { - List(namespace string, selector labels.Selector) (ret []*Group, err error) - Get(namespace, name string) (*Group, error) -} - -type GroupController interface { - Generic() controller.GenericController - Informer() cache.SharedIndexInformer - Lister() GroupLister - AddHandler(ctx context.Context, name string, handler GroupHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync GroupHandlerFunc) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, handler GroupHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, handler GroupHandlerFunc) - Enqueue(namespace, name string) - EnqueueAfter(namespace, name string, after time.Duration) -} - -type GroupInterface interface { - ObjectClient() *objectclient.ObjectClient - Create(*Group) (*Group, error) - GetNamespaced(namespace, name string, opts metav1.GetOptions) (*Group, error) - Get(name string, opts metav1.GetOptions) (*Group, error) - Update(*Group) (*Group, error) - Delete(name string, options *metav1.DeleteOptions) error - DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error - List(opts metav1.ListOptions) (*GroupList, error) - ListNamespaced(namespace string, opts metav1.ListOptions) (*GroupList, error) - Watch(opts metav1.ListOptions) (watch.Interface, error) - DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error - Controller() GroupController - AddHandler(ctx context.Context, name string, sync GroupHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync GroupHandlerFunc) - AddLifecycle(ctx context.Context, name string, lifecycle GroupLifecycle) - AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle GroupLifecycle) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync GroupHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync GroupHandlerFunc) - AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle GroupLifecycle) - AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle GroupLifecycle) -} - -type groupLister struct { - controller *groupController -} - -func (l *groupLister) List(namespace string, selector labels.Selector) (ret []*Group, err error) { - err = cache.ListAllByNamespace(l.controller.Informer().GetIndexer(), namespace, selector, func(obj interface{}) { - ret = append(ret, obj.(*Group)) - }) - return -} - -func (l *groupLister) Get(namespace, name string) (*Group, error) { - var key string - if namespace != "" { - key = namespace + "/" + name - } else { - key = name - } - obj, exists, err := l.controller.Informer().GetIndexer().GetByKey(key) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(schema.GroupResource{ - Group: GroupGroupVersionKind.Group, - Resource: GroupGroupVersionResource.Resource, - }, key) - } - return obj.(*Group), nil -} - -type groupController struct { - controller.GenericController -} - -func (c *groupController) Generic() controller.GenericController { - return c.GenericController -} - -func (c *groupController) Lister() GroupLister { - return &groupLister{ - controller: c, - } -} - -func (c *groupController) AddHandler(ctx context.Context, name string, handler GroupHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*Group); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *groupController) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, handler GroupHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*Group); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *groupController) AddClusterScopedHandler(ctx context.Context, name, cluster string, handler GroupHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*Group); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *groupController) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, cluster string, handler GroupHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*Group); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -type groupFactory struct { -} - -func (c groupFactory) Object() runtime.Object { - return &Group{} -} - -func (c groupFactory) List() runtime.Object { - return &GroupList{} -} - -func (s *groupClient) Controller() GroupController { - genericController := controller.NewGenericController(GroupGroupVersionKind.Kind+"Controller", - s.client.controllerFactory.ForResourceKind(GroupGroupVersionResource, GroupGroupVersionKind.Kind, false)) - - return &groupController{ - GenericController: genericController, - } -} - -type groupClient struct { - client *Client - ns string - objectClient *objectclient.ObjectClient - controller GroupController -} - -func (s *groupClient) ObjectClient() *objectclient.ObjectClient { - return s.objectClient -} - -func (s *groupClient) Create(o *Group) (*Group, error) { - obj, err := s.objectClient.Create(o) - return obj.(*Group), err -} - -func (s *groupClient) Get(name string, opts metav1.GetOptions) (*Group, error) { - obj, err := s.objectClient.Get(name, opts) - return obj.(*Group), err -} - -func (s *groupClient) GetNamespaced(namespace, name string, opts metav1.GetOptions) (*Group, error) { - obj, err := s.objectClient.GetNamespaced(namespace, name, opts) - return obj.(*Group), err -} - -func (s *groupClient) Update(o *Group) (*Group, error) { - obj, err := s.objectClient.Update(o.Name, o) - return obj.(*Group), err -} - -func (s *groupClient) UpdateStatus(o *Group) (*Group, error) { - obj, err := s.objectClient.UpdateStatus(o.Name, o) - return obj.(*Group), err -} - -func (s *groupClient) Delete(name string, options *metav1.DeleteOptions) error { - return s.objectClient.Delete(name, options) -} - -func (s *groupClient) DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error { - return s.objectClient.DeleteNamespaced(namespace, name, options) -} - -func (s *groupClient) List(opts metav1.ListOptions) (*GroupList, error) { - obj, err := s.objectClient.List(opts) - return obj.(*GroupList), err -} - -func (s *groupClient) ListNamespaced(namespace string, opts metav1.ListOptions) (*GroupList, error) { - obj, err := s.objectClient.ListNamespaced(namespace, opts) - return obj.(*GroupList), err -} - -func (s *groupClient) Watch(opts metav1.ListOptions) (watch.Interface, error) { - return s.objectClient.Watch(opts) -} - -// Patch applies the patch and returns the patched deployment. -func (s *groupClient) Patch(o *Group, patchType types.PatchType, data []byte, subresources ...string) (*Group, error) { - obj, err := s.objectClient.Patch(o.Name, o, patchType, data, subresources...) - return obj.(*Group), err -} - -func (s *groupClient) DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error { - return s.objectClient.DeleteCollection(deleteOpts, listOpts) -} - -func (s *groupClient) AddHandler(ctx context.Context, name string, sync GroupHandlerFunc) { - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *groupClient) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync GroupHandlerFunc) { - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *groupClient) AddLifecycle(ctx context.Context, name string, lifecycle GroupLifecycle) { - sync := NewGroupLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *groupClient) AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle GroupLifecycle) { - sync := NewGroupLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *groupClient) AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync GroupHandlerFunc) { - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *groupClient) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync GroupHandlerFunc) { - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} - -func (s *groupClient) AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle GroupLifecycle) { - sync := NewGroupLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *groupClient) AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle GroupLifecycle) { - sync := NewGroupLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_group_lifecycle_adapter.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_group_lifecycle_adapter.go deleted file mode 100644 index c306d1e0..00000000 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_group_lifecycle_adapter.go +++ /dev/null @@ -1,66 +0,0 @@ -package v3 - -import ( - "github.com/rancher/norman/lifecycle" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/runtime" -) - -type GroupLifecycle interface { - Create(obj *Group) (runtime.Object, error) - Remove(obj *Group) (runtime.Object, error) - Updated(obj *Group) (runtime.Object, error) -} - -type groupLifecycleAdapter struct { - lifecycle GroupLifecycle -} - -func (w *groupLifecycleAdapter) HasCreate() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasCreate() -} - -func (w *groupLifecycleAdapter) HasFinalize() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasFinalize() -} - -func (w *groupLifecycleAdapter) Create(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Create(obj.(*Group)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *groupLifecycleAdapter) Finalize(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Remove(obj.(*Group)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *groupLifecycleAdapter) Updated(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Updated(obj.(*Group)) - if o == nil { - return nil, err - } - return o, err -} - -func NewGroupLifecycleAdapter(name string, clusterScoped bool, client GroupInterface, l GroupLifecycle) GroupHandlerFunc { - if clusterScoped { - resource.PutClusterScoped(GroupGroupVersionResource) - } - adapter := &groupLifecycleAdapter{lifecycle: l} - syncFn := lifecycle.NewObjectLifecycleAdapter(name, clusterScoped, adapter, client.ObjectClient()) - return func(key string, obj *Group) (runtime.Object, error) { - newObj, err := syncFn(key, obj) - if o, ok := newObj.(runtime.Object); ok { - return o, err - } - return nil, err - } -} diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_group_member_controller.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_group_member_controller.go deleted file mode 100644 index 82407970..00000000 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_group_member_controller.go +++ /dev/null @@ -1,320 +0,0 @@ -package v3 - -import ( - "context" - "time" - - "github.com/rancher/norman/controller" - "github.com/rancher/norman/objectclient" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/apimachinery/pkg/types" - "k8s.io/apimachinery/pkg/watch" - "k8s.io/client-go/tools/cache" -) - -var ( - GroupMemberGroupVersionKind = schema.GroupVersionKind{ - Version: Version, - Group: GroupName, - Kind: "GroupMember", - } - GroupMemberResource = metav1.APIResource{ - Name: "groupmembers", - SingularName: "groupmember", - Namespaced: false, - Kind: GroupMemberGroupVersionKind.Kind, - } - - GroupMemberGroupVersionResource = schema.GroupVersionResource{ - Group: GroupName, - Version: Version, - Resource: "groupmembers", - } -) - -func init() { - resource.Put(GroupMemberGroupVersionResource) -} - -func NewGroupMember(namespace, name string, obj GroupMember) *GroupMember { - obj.APIVersion, obj.Kind = GroupMemberGroupVersionKind.ToAPIVersionAndKind() - obj.Name = name - obj.Namespace = namespace - return &obj -} - -type GroupMemberList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []GroupMember `json:"items"` -} - -type GroupMemberHandlerFunc func(key string, obj *GroupMember) (runtime.Object, error) - -type GroupMemberChangeHandlerFunc func(obj *GroupMember) (runtime.Object, error) - -type GroupMemberLister interface { - List(namespace string, selector labels.Selector) (ret []*GroupMember, err error) - Get(namespace, name string) (*GroupMember, error) -} - -type GroupMemberController interface { - Generic() controller.GenericController - Informer() cache.SharedIndexInformer - Lister() GroupMemberLister - AddHandler(ctx context.Context, name string, handler GroupMemberHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync GroupMemberHandlerFunc) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, handler GroupMemberHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, handler GroupMemberHandlerFunc) - Enqueue(namespace, name string) - EnqueueAfter(namespace, name string, after time.Duration) -} - -type GroupMemberInterface interface { - ObjectClient() *objectclient.ObjectClient - Create(*GroupMember) (*GroupMember, error) - GetNamespaced(namespace, name string, opts metav1.GetOptions) (*GroupMember, error) - Get(name string, opts metav1.GetOptions) (*GroupMember, error) - Update(*GroupMember) (*GroupMember, error) - Delete(name string, options *metav1.DeleteOptions) error - DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error - List(opts metav1.ListOptions) (*GroupMemberList, error) - ListNamespaced(namespace string, opts metav1.ListOptions) (*GroupMemberList, error) - Watch(opts metav1.ListOptions) (watch.Interface, error) - DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error - Controller() GroupMemberController - AddHandler(ctx context.Context, name string, sync GroupMemberHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync GroupMemberHandlerFunc) - AddLifecycle(ctx context.Context, name string, lifecycle GroupMemberLifecycle) - AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle GroupMemberLifecycle) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync GroupMemberHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync GroupMemberHandlerFunc) - AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle GroupMemberLifecycle) - AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle GroupMemberLifecycle) -} - -type groupMemberLister struct { - controller *groupMemberController -} - -func (l *groupMemberLister) List(namespace string, selector labels.Selector) (ret []*GroupMember, err error) { - err = cache.ListAllByNamespace(l.controller.Informer().GetIndexer(), namespace, selector, func(obj interface{}) { - ret = append(ret, obj.(*GroupMember)) - }) - return -} - -func (l *groupMemberLister) Get(namespace, name string) (*GroupMember, error) { - var key string - if namespace != "" { - key = namespace + "/" + name - } else { - key = name - } - obj, exists, err := l.controller.Informer().GetIndexer().GetByKey(key) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(schema.GroupResource{ - Group: GroupMemberGroupVersionKind.Group, - Resource: GroupMemberGroupVersionResource.Resource, - }, key) - } - return obj.(*GroupMember), nil -} - -type groupMemberController struct { - controller.GenericController -} - -func (c *groupMemberController) Generic() controller.GenericController { - return c.GenericController -} - -func (c *groupMemberController) Lister() GroupMemberLister { - return &groupMemberLister{ - controller: c, - } -} - -func (c *groupMemberController) AddHandler(ctx context.Context, name string, handler GroupMemberHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*GroupMember); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *groupMemberController) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, handler GroupMemberHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*GroupMember); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *groupMemberController) AddClusterScopedHandler(ctx context.Context, name, cluster string, handler GroupMemberHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*GroupMember); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *groupMemberController) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, cluster string, handler GroupMemberHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*GroupMember); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -type groupMemberFactory struct { -} - -func (c groupMemberFactory) Object() runtime.Object { - return &GroupMember{} -} - -func (c groupMemberFactory) List() runtime.Object { - return &GroupMemberList{} -} - -func (s *groupMemberClient) Controller() GroupMemberController { - genericController := controller.NewGenericController(GroupMemberGroupVersionKind.Kind+"Controller", - s.client.controllerFactory.ForResourceKind(GroupMemberGroupVersionResource, GroupMemberGroupVersionKind.Kind, false)) - - return &groupMemberController{ - GenericController: genericController, - } -} - -type groupMemberClient struct { - client *Client - ns string - objectClient *objectclient.ObjectClient - controller GroupMemberController -} - -func (s *groupMemberClient) ObjectClient() *objectclient.ObjectClient { - return s.objectClient -} - -func (s *groupMemberClient) Create(o *GroupMember) (*GroupMember, error) { - obj, err := s.objectClient.Create(o) - return obj.(*GroupMember), err -} - -func (s *groupMemberClient) Get(name string, opts metav1.GetOptions) (*GroupMember, error) { - obj, err := s.objectClient.Get(name, opts) - return obj.(*GroupMember), err -} - -func (s *groupMemberClient) GetNamespaced(namespace, name string, opts metav1.GetOptions) (*GroupMember, error) { - obj, err := s.objectClient.GetNamespaced(namespace, name, opts) - return obj.(*GroupMember), err -} - -func (s *groupMemberClient) Update(o *GroupMember) (*GroupMember, error) { - obj, err := s.objectClient.Update(o.Name, o) - return obj.(*GroupMember), err -} - -func (s *groupMemberClient) UpdateStatus(o *GroupMember) (*GroupMember, error) { - obj, err := s.objectClient.UpdateStatus(o.Name, o) - return obj.(*GroupMember), err -} - -func (s *groupMemberClient) Delete(name string, options *metav1.DeleteOptions) error { - return s.objectClient.Delete(name, options) -} - -func (s *groupMemberClient) DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error { - return s.objectClient.DeleteNamespaced(namespace, name, options) -} - -func (s *groupMemberClient) List(opts metav1.ListOptions) (*GroupMemberList, error) { - obj, err := s.objectClient.List(opts) - return obj.(*GroupMemberList), err -} - -func (s *groupMemberClient) ListNamespaced(namespace string, opts metav1.ListOptions) (*GroupMemberList, error) { - obj, err := s.objectClient.ListNamespaced(namespace, opts) - return obj.(*GroupMemberList), err -} - -func (s *groupMemberClient) Watch(opts metav1.ListOptions) (watch.Interface, error) { - return s.objectClient.Watch(opts) -} - -// Patch applies the patch and returns the patched deployment. -func (s *groupMemberClient) Patch(o *GroupMember, patchType types.PatchType, data []byte, subresources ...string) (*GroupMember, error) { - obj, err := s.objectClient.Patch(o.Name, o, patchType, data, subresources...) - return obj.(*GroupMember), err -} - -func (s *groupMemberClient) DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error { - return s.objectClient.DeleteCollection(deleteOpts, listOpts) -} - -func (s *groupMemberClient) AddHandler(ctx context.Context, name string, sync GroupMemberHandlerFunc) { - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *groupMemberClient) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync GroupMemberHandlerFunc) { - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *groupMemberClient) AddLifecycle(ctx context.Context, name string, lifecycle GroupMemberLifecycle) { - sync := NewGroupMemberLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *groupMemberClient) AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle GroupMemberLifecycle) { - sync := NewGroupMemberLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *groupMemberClient) AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync GroupMemberHandlerFunc) { - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *groupMemberClient) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync GroupMemberHandlerFunc) { - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} - -func (s *groupMemberClient) AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle GroupMemberLifecycle) { - sync := NewGroupMemberLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *groupMemberClient) AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle GroupMemberLifecycle) { - sync := NewGroupMemberLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_group_member_lifecycle_adapter.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_group_member_lifecycle_adapter.go deleted file mode 100644 index d14d4533..00000000 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_group_member_lifecycle_adapter.go +++ /dev/null @@ -1,66 +0,0 @@ -package v3 - -import ( - "github.com/rancher/norman/lifecycle" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/runtime" -) - -type GroupMemberLifecycle interface { - Create(obj *GroupMember) (runtime.Object, error) - Remove(obj *GroupMember) (runtime.Object, error) - Updated(obj *GroupMember) (runtime.Object, error) -} - -type groupMemberLifecycleAdapter struct { - lifecycle GroupMemberLifecycle -} - -func (w *groupMemberLifecycleAdapter) HasCreate() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasCreate() -} - -func (w *groupMemberLifecycleAdapter) HasFinalize() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasFinalize() -} - -func (w *groupMemberLifecycleAdapter) Create(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Create(obj.(*GroupMember)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *groupMemberLifecycleAdapter) Finalize(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Remove(obj.(*GroupMember)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *groupMemberLifecycleAdapter) Updated(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Updated(obj.(*GroupMember)) - if o == nil { - return nil, err - } - return o, err -} - -func NewGroupMemberLifecycleAdapter(name string, clusterScoped bool, client GroupMemberInterface, l GroupMemberLifecycle) GroupMemberHandlerFunc { - if clusterScoped { - resource.PutClusterScoped(GroupMemberGroupVersionResource) - } - adapter := &groupMemberLifecycleAdapter{lifecycle: l} - syncFn := lifecycle.NewObjectLifecycleAdapter(name, clusterScoped, adapter, client.ObjectClient()) - return func(key string, obj *GroupMember) (runtime.Object, error) { - newObj, err := syncFn(key, obj) - if o, ok := newObj.(runtime.Object); ok { - return o, err - } - return nil, err - } -} diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_k8s_client.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_k8s_client.go deleted file mode 100644 index 80784acf..00000000 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_k8s_client.go +++ /dev/null @@ -1,981 +0,0 @@ -package v3 - -import ( - "github.com/rancher/lasso/pkg/client" - "github.com/rancher/lasso/pkg/controller" - "github.com/rancher/norman/objectclient" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/client-go/rest" -) - -type Interface interface { - NodePoolsGetter - NodesGetter - NodeDriversGetter - NodeTemplatesGetter - ProjectsGetter - GlobalRolesGetter - GlobalRoleBindingsGetter - RoleTemplatesGetter - PodSecurityPolicyTemplatesGetter - PodSecurityPolicyTemplateProjectBindingsGetter - ClusterRoleTemplateBindingsGetter - ProjectRoleTemplateBindingsGetter - ClustersGetter - ClusterRegistrationTokensGetter - CatalogsGetter - TemplatesGetter - CatalogTemplatesGetter - CatalogTemplateVersionsGetter - TemplateVersionsGetter - TemplateContentsGetter - GroupsGetter - GroupMembersGetter - PrincipalsGetter - UsersGetter - AuthConfigsGetter - LdapConfigsGetter - TokensGetter - DynamicSchemasGetter - PreferencesGetter - UserAttributesGetter - ProjectNetworkPoliciesGetter - ClusterLoggingsGetter - ProjectLoggingsGetter - SettingsGetter - FeaturesGetter - ClusterAlertsGetter - ProjectAlertsGetter - NotifiersGetter - ClusterAlertGroupsGetter - ProjectAlertGroupsGetter - ClusterAlertRulesGetter - ProjectAlertRulesGetter - ComposeConfigsGetter - ProjectCatalogsGetter - ClusterCatalogsGetter - MultiClusterAppsGetter - MultiClusterAppRevisionsGetter - GlobalDnsesGetter - GlobalDNSProvidersGetter - KontainerDriversGetter - EtcdBackupsGetter - ClusterScansGetter - MonitorMetricsGetter - ClusterMonitorGraphsGetter - ProjectMonitorGraphsGetter - CloudCredentialsGetter - ClusterTemplatesGetter - ClusterTemplateRevisionsGetter - RkeK8sSystemImagesGetter - RkeK8sServiceOptionsGetter - RkeAddonsGetter - CisConfigsGetter - CisBenchmarkVersionsGetter -} - -type Client struct { - controllerFactory controller.SharedControllerFactory - clientFactory client.SharedClientFactory -} - -func NewForConfig(cfg rest.Config) (Interface, error) { - scheme := runtime.NewScheme() - if err := AddToScheme(scheme); err != nil { - return nil, err - } - controllerFactory, err := controller.NewSharedControllerFactoryFromConfig(&cfg, scheme) - if err != nil { - return nil, err - } - return NewFromControllerFactory(controllerFactory) -} - -func NewFromControllerFactory(factory controller.SharedControllerFactory) (Interface, error) { - return &Client{ - controllerFactory: factory, - clientFactory: factory.SharedCacheFactory().SharedClientFactory(), - }, nil -} - -type NodePoolsGetter interface { - NodePools(namespace string) NodePoolInterface -} - -func (c *Client) NodePools(namespace string) NodePoolInterface { - sharedClient := c.clientFactory.ForResourceKind(NodePoolGroupVersionResource, NodePoolGroupVersionKind.Kind, true) - objectClient := objectclient.NewObjectClient(namespace, sharedClient, &NodePoolResource, NodePoolGroupVersionKind, nodePoolFactory{}) - return &nodePoolClient{ - ns: namespace, - client: c, - objectClient: objectClient, - } -} - -type NodesGetter interface { - Nodes(namespace string) NodeInterface -} - -func (c *Client) Nodes(namespace string) NodeInterface { - sharedClient := c.clientFactory.ForResourceKind(NodeGroupVersionResource, NodeGroupVersionKind.Kind, true) - objectClient := objectclient.NewObjectClient(namespace, sharedClient, &NodeResource, NodeGroupVersionKind, nodeFactory{}) - return &nodeClient{ - ns: namespace, - client: c, - objectClient: objectClient, - } -} - -type NodeDriversGetter interface { - NodeDrivers(namespace string) NodeDriverInterface -} - -func (c *Client) NodeDrivers(namespace string) NodeDriverInterface { - sharedClient := c.clientFactory.ForResourceKind(NodeDriverGroupVersionResource, NodeDriverGroupVersionKind.Kind, false) - objectClient := objectclient.NewObjectClient(namespace, sharedClient, &NodeDriverResource, NodeDriverGroupVersionKind, nodeDriverFactory{}) - return &nodeDriverClient{ - ns: namespace, - client: c, - objectClient: objectClient, - } -} - -type NodeTemplatesGetter interface { - NodeTemplates(namespace string) NodeTemplateInterface -} - -func (c *Client) NodeTemplates(namespace string) NodeTemplateInterface { - sharedClient := c.clientFactory.ForResourceKind(NodeTemplateGroupVersionResource, NodeTemplateGroupVersionKind.Kind, true) - objectClient := objectclient.NewObjectClient(namespace, sharedClient, &NodeTemplateResource, NodeTemplateGroupVersionKind, nodeTemplateFactory{}) - return &nodeTemplateClient{ - ns: namespace, - client: c, - objectClient: objectClient, - } -} - -type ProjectsGetter interface { - Projects(namespace string) ProjectInterface -} - -func (c *Client) Projects(namespace string) ProjectInterface { - sharedClient := c.clientFactory.ForResourceKind(ProjectGroupVersionResource, ProjectGroupVersionKind.Kind, true) - objectClient := objectclient.NewObjectClient(namespace, sharedClient, &ProjectResource, ProjectGroupVersionKind, projectFactory{}) - return &projectClient{ - ns: namespace, - client: c, - objectClient: objectClient, - } -} - -type GlobalRolesGetter interface { - GlobalRoles(namespace string) GlobalRoleInterface -} - -func (c *Client) GlobalRoles(namespace string) GlobalRoleInterface { - sharedClient := c.clientFactory.ForResourceKind(GlobalRoleGroupVersionResource, GlobalRoleGroupVersionKind.Kind, false) - objectClient := objectclient.NewObjectClient(namespace, sharedClient, &GlobalRoleResource, GlobalRoleGroupVersionKind, globalRoleFactory{}) - return &globalRoleClient{ - ns: namespace, - client: c, - objectClient: objectClient, - } -} - -type GlobalRoleBindingsGetter interface { - GlobalRoleBindings(namespace string) GlobalRoleBindingInterface -} - -func (c *Client) GlobalRoleBindings(namespace string) GlobalRoleBindingInterface { - sharedClient := c.clientFactory.ForResourceKind(GlobalRoleBindingGroupVersionResource, GlobalRoleBindingGroupVersionKind.Kind, false) - objectClient := objectclient.NewObjectClient(namespace, sharedClient, &GlobalRoleBindingResource, GlobalRoleBindingGroupVersionKind, globalRoleBindingFactory{}) - return &globalRoleBindingClient{ - ns: namespace, - client: c, - objectClient: objectClient, - } -} - -type RoleTemplatesGetter interface { - RoleTemplates(namespace string) RoleTemplateInterface -} - -func (c *Client) RoleTemplates(namespace string) RoleTemplateInterface { - sharedClient := c.clientFactory.ForResourceKind(RoleTemplateGroupVersionResource, RoleTemplateGroupVersionKind.Kind, false) - objectClient := objectclient.NewObjectClient(namespace, sharedClient, &RoleTemplateResource, RoleTemplateGroupVersionKind, roleTemplateFactory{}) - return &roleTemplateClient{ - ns: namespace, - client: c, - objectClient: objectClient, - } -} - -type PodSecurityPolicyTemplatesGetter interface { - PodSecurityPolicyTemplates(namespace string) PodSecurityPolicyTemplateInterface -} - -func (c *Client) PodSecurityPolicyTemplates(namespace string) PodSecurityPolicyTemplateInterface { - sharedClient := c.clientFactory.ForResourceKind(PodSecurityPolicyTemplateGroupVersionResource, PodSecurityPolicyTemplateGroupVersionKind.Kind, false) - objectClient := objectclient.NewObjectClient(namespace, sharedClient, &PodSecurityPolicyTemplateResource, PodSecurityPolicyTemplateGroupVersionKind, podSecurityPolicyTemplateFactory{}) - return &podSecurityPolicyTemplateClient{ - ns: namespace, - client: c, - objectClient: objectClient, - } -} - -type PodSecurityPolicyTemplateProjectBindingsGetter interface { - PodSecurityPolicyTemplateProjectBindings(namespace string) PodSecurityPolicyTemplateProjectBindingInterface -} - -func (c *Client) PodSecurityPolicyTemplateProjectBindings(namespace string) PodSecurityPolicyTemplateProjectBindingInterface { - sharedClient := c.clientFactory.ForResourceKind(PodSecurityPolicyTemplateProjectBindingGroupVersionResource, PodSecurityPolicyTemplateProjectBindingGroupVersionKind.Kind, true) - objectClient := objectclient.NewObjectClient(namespace, sharedClient, &PodSecurityPolicyTemplateProjectBindingResource, PodSecurityPolicyTemplateProjectBindingGroupVersionKind, podSecurityPolicyTemplateProjectBindingFactory{}) - return &podSecurityPolicyTemplateProjectBindingClient{ - ns: namespace, - client: c, - objectClient: objectClient, - } -} - -type ClusterRoleTemplateBindingsGetter interface { - ClusterRoleTemplateBindings(namespace string) ClusterRoleTemplateBindingInterface -} - -func (c *Client) ClusterRoleTemplateBindings(namespace string) ClusterRoleTemplateBindingInterface { - sharedClient := c.clientFactory.ForResourceKind(ClusterRoleTemplateBindingGroupVersionResource, ClusterRoleTemplateBindingGroupVersionKind.Kind, true) - objectClient := objectclient.NewObjectClient(namespace, sharedClient, &ClusterRoleTemplateBindingResource, ClusterRoleTemplateBindingGroupVersionKind, clusterRoleTemplateBindingFactory{}) - return &clusterRoleTemplateBindingClient{ - ns: namespace, - client: c, - objectClient: objectClient, - } -} - -type ProjectRoleTemplateBindingsGetter interface { - ProjectRoleTemplateBindings(namespace string) ProjectRoleTemplateBindingInterface -} - -func (c *Client) ProjectRoleTemplateBindings(namespace string) ProjectRoleTemplateBindingInterface { - sharedClient := c.clientFactory.ForResourceKind(ProjectRoleTemplateBindingGroupVersionResource, ProjectRoleTemplateBindingGroupVersionKind.Kind, true) - objectClient := objectclient.NewObjectClient(namespace, sharedClient, &ProjectRoleTemplateBindingResource, ProjectRoleTemplateBindingGroupVersionKind, projectRoleTemplateBindingFactory{}) - return &projectRoleTemplateBindingClient{ - ns: namespace, - client: c, - objectClient: objectClient, - } -} - -type ClustersGetter interface { - Clusters(namespace string) ClusterInterface -} - -func (c *Client) Clusters(namespace string) ClusterInterface { - sharedClient := c.clientFactory.ForResourceKind(ClusterGroupVersionResource, ClusterGroupVersionKind.Kind, false) - objectClient := objectclient.NewObjectClient(namespace, sharedClient, &ClusterResource, ClusterGroupVersionKind, clusterFactory{}) - return &clusterClient{ - ns: namespace, - client: c, - objectClient: objectClient, - } -} - -type ClusterRegistrationTokensGetter interface { - ClusterRegistrationTokens(namespace string) ClusterRegistrationTokenInterface -} - -func (c *Client) ClusterRegistrationTokens(namespace string) ClusterRegistrationTokenInterface { - sharedClient := c.clientFactory.ForResourceKind(ClusterRegistrationTokenGroupVersionResource, ClusterRegistrationTokenGroupVersionKind.Kind, true) - objectClient := objectclient.NewObjectClient(namespace, sharedClient, &ClusterRegistrationTokenResource, ClusterRegistrationTokenGroupVersionKind, clusterRegistrationTokenFactory{}) - return &clusterRegistrationTokenClient{ - ns: namespace, - client: c, - objectClient: objectClient, - } -} - -type CatalogsGetter interface { - Catalogs(namespace string) CatalogInterface -} - -func (c *Client) Catalogs(namespace string) CatalogInterface { - sharedClient := c.clientFactory.ForResourceKind(CatalogGroupVersionResource, CatalogGroupVersionKind.Kind, false) - objectClient := objectclient.NewObjectClient(namespace, sharedClient, &CatalogResource, CatalogGroupVersionKind, catalogFactory{}) - return &catalogClient{ - ns: namespace, - client: c, - objectClient: objectClient, - } -} - -type TemplatesGetter interface { - Templates(namespace string) TemplateInterface -} - -func (c *Client) Templates(namespace string) TemplateInterface { - sharedClient := c.clientFactory.ForResourceKind(TemplateGroupVersionResource, TemplateGroupVersionKind.Kind, false) - objectClient := objectclient.NewObjectClient(namespace, sharedClient, &TemplateResource, TemplateGroupVersionKind, templateFactory{}) - return &templateClient{ - ns: namespace, - client: c, - objectClient: objectClient, - } -} - -type CatalogTemplatesGetter interface { - CatalogTemplates(namespace string) CatalogTemplateInterface -} - -func (c *Client) CatalogTemplates(namespace string) CatalogTemplateInterface { - sharedClient := c.clientFactory.ForResourceKind(CatalogTemplateGroupVersionResource, CatalogTemplateGroupVersionKind.Kind, true) - objectClient := objectclient.NewObjectClient(namespace, sharedClient, &CatalogTemplateResource, CatalogTemplateGroupVersionKind, catalogTemplateFactory{}) - return &catalogTemplateClient{ - ns: namespace, - client: c, - objectClient: objectClient, - } -} - -type CatalogTemplateVersionsGetter interface { - CatalogTemplateVersions(namespace string) CatalogTemplateVersionInterface -} - -func (c *Client) CatalogTemplateVersions(namespace string) CatalogTemplateVersionInterface { - sharedClient := c.clientFactory.ForResourceKind(CatalogTemplateVersionGroupVersionResource, CatalogTemplateVersionGroupVersionKind.Kind, true) - objectClient := objectclient.NewObjectClient(namespace, sharedClient, &CatalogTemplateVersionResource, CatalogTemplateVersionGroupVersionKind, catalogTemplateVersionFactory{}) - return &catalogTemplateVersionClient{ - ns: namespace, - client: c, - objectClient: objectClient, - } -} - -type TemplateVersionsGetter interface { - TemplateVersions(namespace string) TemplateVersionInterface -} - -func (c *Client) TemplateVersions(namespace string) TemplateVersionInterface { - sharedClient := c.clientFactory.ForResourceKind(TemplateVersionGroupVersionResource, TemplateVersionGroupVersionKind.Kind, false) - objectClient := objectclient.NewObjectClient(namespace, sharedClient, &TemplateVersionResource, TemplateVersionGroupVersionKind, templateVersionFactory{}) - return &templateVersionClient{ - ns: namespace, - client: c, - objectClient: objectClient, - } -} - -type TemplateContentsGetter interface { - TemplateContents(namespace string) TemplateContentInterface -} - -func (c *Client) TemplateContents(namespace string) TemplateContentInterface { - sharedClient := c.clientFactory.ForResourceKind(TemplateContentGroupVersionResource, TemplateContentGroupVersionKind.Kind, false) - objectClient := objectclient.NewObjectClient(namespace, sharedClient, &TemplateContentResource, TemplateContentGroupVersionKind, templateContentFactory{}) - return &templateContentClient{ - ns: namespace, - client: c, - objectClient: objectClient, - } -} - -type GroupsGetter interface { - Groups(namespace string) GroupInterface -} - -func (c *Client) Groups(namespace string) GroupInterface { - sharedClient := c.clientFactory.ForResourceKind(GroupGroupVersionResource, GroupGroupVersionKind.Kind, false) - objectClient := objectclient.NewObjectClient(namespace, sharedClient, &GroupResource, GroupGroupVersionKind, groupFactory{}) - return &groupClient{ - ns: namespace, - client: c, - objectClient: objectClient, - } -} - -type GroupMembersGetter interface { - GroupMembers(namespace string) GroupMemberInterface -} - -func (c *Client) GroupMembers(namespace string) GroupMemberInterface { - sharedClient := c.clientFactory.ForResourceKind(GroupMemberGroupVersionResource, GroupMemberGroupVersionKind.Kind, false) - objectClient := objectclient.NewObjectClient(namespace, sharedClient, &GroupMemberResource, GroupMemberGroupVersionKind, groupMemberFactory{}) - return &groupMemberClient{ - ns: namespace, - client: c, - objectClient: objectClient, - } -} - -type PrincipalsGetter interface { - Principals(namespace string) PrincipalInterface -} - -func (c *Client) Principals(namespace string) PrincipalInterface { - sharedClient := c.clientFactory.ForResourceKind(PrincipalGroupVersionResource, PrincipalGroupVersionKind.Kind, false) - objectClient := objectclient.NewObjectClient(namespace, sharedClient, &PrincipalResource, PrincipalGroupVersionKind, principalFactory{}) - return &principalClient{ - ns: namespace, - client: c, - objectClient: objectClient, - } -} - -type UsersGetter interface { - Users(namespace string) UserInterface -} - -func (c *Client) Users(namespace string) UserInterface { - sharedClient := c.clientFactory.ForResourceKind(UserGroupVersionResource, UserGroupVersionKind.Kind, false) - objectClient := objectclient.NewObjectClient(namespace, sharedClient, &UserResource, UserGroupVersionKind, userFactory{}) - return &userClient{ - ns: namespace, - client: c, - objectClient: objectClient, - } -} - -type AuthConfigsGetter interface { - AuthConfigs(namespace string) AuthConfigInterface -} - -func (c *Client) AuthConfigs(namespace string) AuthConfigInterface { - sharedClient := c.clientFactory.ForResourceKind(AuthConfigGroupVersionResource, AuthConfigGroupVersionKind.Kind, false) - objectClient := objectclient.NewObjectClient(namespace, sharedClient, &AuthConfigResource, AuthConfigGroupVersionKind, authConfigFactory{}) - return &authConfigClient{ - ns: namespace, - client: c, - objectClient: objectClient, - } -} - -type LdapConfigsGetter interface { - LdapConfigs(namespace string) LdapConfigInterface -} - -func (c *Client) LdapConfigs(namespace string) LdapConfigInterface { - sharedClient := c.clientFactory.ForResourceKind(LdapConfigGroupVersionResource, LdapConfigGroupVersionKind.Kind, false) - objectClient := objectclient.NewObjectClient(namespace, sharedClient, &LdapConfigResource, LdapConfigGroupVersionKind, ldapConfigFactory{}) - return &ldapConfigClient{ - ns: namespace, - client: c, - objectClient: objectClient, - } -} - -type TokensGetter interface { - Tokens(namespace string) TokenInterface -} - -func (c *Client) Tokens(namespace string) TokenInterface { - sharedClient := c.clientFactory.ForResourceKind(TokenGroupVersionResource, TokenGroupVersionKind.Kind, false) - objectClient := objectclient.NewObjectClient(namespace, sharedClient, &TokenResource, TokenGroupVersionKind, tokenFactory{}) - return &tokenClient{ - ns: namespace, - client: c, - objectClient: objectClient, - } -} - -type DynamicSchemasGetter interface { - DynamicSchemas(namespace string) DynamicSchemaInterface -} - -func (c *Client) DynamicSchemas(namespace string) DynamicSchemaInterface { - sharedClient := c.clientFactory.ForResourceKind(DynamicSchemaGroupVersionResource, DynamicSchemaGroupVersionKind.Kind, false) - objectClient := objectclient.NewObjectClient(namespace, sharedClient, &DynamicSchemaResource, DynamicSchemaGroupVersionKind, dynamicSchemaFactory{}) - return &dynamicSchemaClient{ - ns: namespace, - client: c, - objectClient: objectClient, - } -} - -type PreferencesGetter interface { - Preferences(namespace string) PreferenceInterface -} - -func (c *Client) Preferences(namespace string) PreferenceInterface { - sharedClient := c.clientFactory.ForResourceKind(PreferenceGroupVersionResource, PreferenceGroupVersionKind.Kind, true) - objectClient := objectclient.NewObjectClient(namespace, sharedClient, &PreferenceResource, PreferenceGroupVersionKind, preferenceFactory{}) - return &preferenceClient{ - ns: namespace, - client: c, - objectClient: objectClient, - } -} - -type UserAttributesGetter interface { - UserAttributes(namespace string) UserAttributeInterface -} - -func (c *Client) UserAttributes(namespace string) UserAttributeInterface { - sharedClient := c.clientFactory.ForResourceKind(UserAttributeGroupVersionResource, UserAttributeGroupVersionKind.Kind, false) - objectClient := objectclient.NewObjectClient(namespace, sharedClient, &UserAttributeResource, UserAttributeGroupVersionKind, userAttributeFactory{}) - return &userAttributeClient{ - ns: namespace, - client: c, - objectClient: objectClient, - } -} - -type ProjectNetworkPoliciesGetter interface { - ProjectNetworkPolicies(namespace string) ProjectNetworkPolicyInterface -} - -func (c *Client) ProjectNetworkPolicies(namespace string) ProjectNetworkPolicyInterface { - sharedClient := c.clientFactory.ForResourceKind(ProjectNetworkPolicyGroupVersionResource, ProjectNetworkPolicyGroupVersionKind.Kind, true) - objectClient := objectclient.NewObjectClient(namespace, sharedClient, &ProjectNetworkPolicyResource, ProjectNetworkPolicyGroupVersionKind, projectNetworkPolicyFactory{}) - return &projectNetworkPolicyClient{ - ns: namespace, - client: c, - objectClient: objectClient, - } -} - -type ClusterLoggingsGetter interface { - ClusterLoggings(namespace string) ClusterLoggingInterface -} - -func (c *Client) ClusterLoggings(namespace string) ClusterLoggingInterface { - sharedClient := c.clientFactory.ForResourceKind(ClusterLoggingGroupVersionResource, ClusterLoggingGroupVersionKind.Kind, true) - objectClient := objectclient.NewObjectClient(namespace, sharedClient, &ClusterLoggingResource, ClusterLoggingGroupVersionKind, clusterLoggingFactory{}) - return &clusterLoggingClient{ - ns: namespace, - client: c, - objectClient: objectClient, - } -} - -type ProjectLoggingsGetter interface { - ProjectLoggings(namespace string) ProjectLoggingInterface -} - -func (c *Client) ProjectLoggings(namespace string) ProjectLoggingInterface { - sharedClient := c.clientFactory.ForResourceKind(ProjectLoggingGroupVersionResource, ProjectLoggingGroupVersionKind.Kind, true) - objectClient := objectclient.NewObjectClient(namespace, sharedClient, &ProjectLoggingResource, ProjectLoggingGroupVersionKind, projectLoggingFactory{}) - return &projectLoggingClient{ - ns: namespace, - client: c, - objectClient: objectClient, - } -} - -type SettingsGetter interface { - Settings(namespace string) SettingInterface -} - -func (c *Client) Settings(namespace string) SettingInterface { - sharedClient := c.clientFactory.ForResourceKind(SettingGroupVersionResource, SettingGroupVersionKind.Kind, false) - objectClient := objectclient.NewObjectClient(namespace, sharedClient, &SettingResource, SettingGroupVersionKind, settingFactory{}) - return &settingClient{ - ns: namespace, - client: c, - objectClient: objectClient, - } -} - -type FeaturesGetter interface { - Features(namespace string) FeatureInterface -} - -func (c *Client) Features(namespace string) FeatureInterface { - sharedClient := c.clientFactory.ForResourceKind(FeatureGroupVersionResource, FeatureGroupVersionKind.Kind, false) - objectClient := objectclient.NewObjectClient(namespace, sharedClient, &FeatureResource, FeatureGroupVersionKind, featureFactory{}) - return &featureClient{ - ns: namespace, - client: c, - objectClient: objectClient, - } -} - -type ClusterAlertsGetter interface { - ClusterAlerts(namespace string) ClusterAlertInterface -} - -func (c *Client) ClusterAlerts(namespace string) ClusterAlertInterface { - sharedClient := c.clientFactory.ForResourceKind(ClusterAlertGroupVersionResource, ClusterAlertGroupVersionKind.Kind, true) - objectClient := objectclient.NewObjectClient(namespace, sharedClient, &ClusterAlertResource, ClusterAlertGroupVersionKind, clusterAlertFactory{}) - return &clusterAlertClient{ - ns: namespace, - client: c, - objectClient: objectClient, - } -} - -type ProjectAlertsGetter interface { - ProjectAlerts(namespace string) ProjectAlertInterface -} - -func (c *Client) ProjectAlerts(namespace string) ProjectAlertInterface { - sharedClient := c.clientFactory.ForResourceKind(ProjectAlertGroupVersionResource, ProjectAlertGroupVersionKind.Kind, true) - objectClient := objectclient.NewObjectClient(namespace, sharedClient, &ProjectAlertResource, ProjectAlertGroupVersionKind, projectAlertFactory{}) - return &projectAlertClient{ - ns: namespace, - client: c, - objectClient: objectClient, - } -} - -type NotifiersGetter interface { - Notifiers(namespace string) NotifierInterface -} - -func (c *Client) Notifiers(namespace string) NotifierInterface { - sharedClient := c.clientFactory.ForResourceKind(NotifierGroupVersionResource, NotifierGroupVersionKind.Kind, true) - objectClient := objectclient.NewObjectClient(namespace, sharedClient, &NotifierResource, NotifierGroupVersionKind, notifierFactory{}) - return ¬ifierClient{ - ns: namespace, - client: c, - objectClient: objectClient, - } -} - -type ClusterAlertGroupsGetter interface { - ClusterAlertGroups(namespace string) ClusterAlertGroupInterface -} - -func (c *Client) ClusterAlertGroups(namespace string) ClusterAlertGroupInterface { - sharedClient := c.clientFactory.ForResourceKind(ClusterAlertGroupGroupVersionResource, ClusterAlertGroupGroupVersionKind.Kind, true) - objectClient := objectclient.NewObjectClient(namespace, sharedClient, &ClusterAlertGroupResource, ClusterAlertGroupGroupVersionKind, clusterAlertGroupFactory{}) - return &clusterAlertGroupClient{ - ns: namespace, - client: c, - objectClient: objectClient, - } -} - -type ProjectAlertGroupsGetter interface { - ProjectAlertGroups(namespace string) ProjectAlertGroupInterface -} - -func (c *Client) ProjectAlertGroups(namespace string) ProjectAlertGroupInterface { - sharedClient := c.clientFactory.ForResourceKind(ProjectAlertGroupGroupVersionResource, ProjectAlertGroupGroupVersionKind.Kind, true) - objectClient := objectclient.NewObjectClient(namespace, sharedClient, &ProjectAlertGroupResource, ProjectAlertGroupGroupVersionKind, projectAlertGroupFactory{}) - return &projectAlertGroupClient{ - ns: namespace, - client: c, - objectClient: objectClient, - } -} - -type ClusterAlertRulesGetter interface { - ClusterAlertRules(namespace string) ClusterAlertRuleInterface -} - -func (c *Client) ClusterAlertRules(namespace string) ClusterAlertRuleInterface { - sharedClient := c.clientFactory.ForResourceKind(ClusterAlertRuleGroupVersionResource, ClusterAlertRuleGroupVersionKind.Kind, true) - objectClient := objectclient.NewObjectClient(namespace, sharedClient, &ClusterAlertRuleResource, ClusterAlertRuleGroupVersionKind, clusterAlertRuleFactory{}) - return &clusterAlertRuleClient{ - ns: namespace, - client: c, - objectClient: objectClient, - } -} - -type ProjectAlertRulesGetter interface { - ProjectAlertRules(namespace string) ProjectAlertRuleInterface -} - -func (c *Client) ProjectAlertRules(namespace string) ProjectAlertRuleInterface { - sharedClient := c.clientFactory.ForResourceKind(ProjectAlertRuleGroupVersionResource, ProjectAlertRuleGroupVersionKind.Kind, true) - objectClient := objectclient.NewObjectClient(namespace, sharedClient, &ProjectAlertRuleResource, ProjectAlertRuleGroupVersionKind, projectAlertRuleFactory{}) - return &projectAlertRuleClient{ - ns: namespace, - client: c, - objectClient: objectClient, - } -} - -type ComposeConfigsGetter interface { - ComposeConfigs(namespace string) ComposeConfigInterface -} - -func (c *Client) ComposeConfigs(namespace string) ComposeConfigInterface { - sharedClient := c.clientFactory.ForResourceKind(ComposeConfigGroupVersionResource, ComposeConfigGroupVersionKind.Kind, false) - objectClient := objectclient.NewObjectClient(namespace, sharedClient, &ComposeConfigResource, ComposeConfigGroupVersionKind, composeConfigFactory{}) - return &composeConfigClient{ - ns: namespace, - client: c, - objectClient: objectClient, - } -} - -type ProjectCatalogsGetter interface { - ProjectCatalogs(namespace string) ProjectCatalogInterface -} - -func (c *Client) ProjectCatalogs(namespace string) ProjectCatalogInterface { - sharedClient := c.clientFactory.ForResourceKind(ProjectCatalogGroupVersionResource, ProjectCatalogGroupVersionKind.Kind, true) - objectClient := objectclient.NewObjectClient(namespace, sharedClient, &ProjectCatalogResource, ProjectCatalogGroupVersionKind, projectCatalogFactory{}) - return &projectCatalogClient{ - ns: namespace, - client: c, - objectClient: objectClient, - } -} - -type ClusterCatalogsGetter interface { - ClusterCatalogs(namespace string) ClusterCatalogInterface -} - -func (c *Client) ClusterCatalogs(namespace string) ClusterCatalogInterface { - sharedClient := c.clientFactory.ForResourceKind(ClusterCatalogGroupVersionResource, ClusterCatalogGroupVersionKind.Kind, true) - objectClient := objectclient.NewObjectClient(namespace, sharedClient, &ClusterCatalogResource, ClusterCatalogGroupVersionKind, clusterCatalogFactory{}) - return &clusterCatalogClient{ - ns: namespace, - client: c, - objectClient: objectClient, - } -} - -type MultiClusterAppsGetter interface { - MultiClusterApps(namespace string) MultiClusterAppInterface -} - -func (c *Client) MultiClusterApps(namespace string) MultiClusterAppInterface { - sharedClient := c.clientFactory.ForResourceKind(MultiClusterAppGroupVersionResource, MultiClusterAppGroupVersionKind.Kind, true) - objectClient := objectclient.NewObjectClient(namespace, sharedClient, &MultiClusterAppResource, MultiClusterAppGroupVersionKind, multiClusterAppFactory{}) - return &multiClusterAppClient{ - ns: namespace, - client: c, - objectClient: objectClient, - } -} - -type MultiClusterAppRevisionsGetter interface { - MultiClusterAppRevisions(namespace string) MultiClusterAppRevisionInterface -} - -func (c *Client) MultiClusterAppRevisions(namespace string) MultiClusterAppRevisionInterface { - sharedClient := c.clientFactory.ForResourceKind(MultiClusterAppRevisionGroupVersionResource, MultiClusterAppRevisionGroupVersionKind.Kind, true) - objectClient := objectclient.NewObjectClient(namespace, sharedClient, &MultiClusterAppRevisionResource, MultiClusterAppRevisionGroupVersionKind, multiClusterAppRevisionFactory{}) - return &multiClusterAppRevisionClient{ - ns: namespace, - client: c, - objectClient: objectClient, - } -} - -type GlobalDnsesGetter interface { - GlobalDnses(namespace string) GlobalDnsInterface -} - -func (c *Client) GlobalDnses(namespace string) GlobalDnsInterface { - sharedClient := c.clientFactory.ForResourceKind(GlobalDnsGroupVersionResource, GlobalDnsGroupVersionKind.Kind, true) - objectClient := objectclient.NewObjectClient(namespace, sharedClient, &GlobalDnsResource, GlobalDnsGroupVersionKind, globalDnsFactory{}) - return &globalDnsClient{ - ns: namespace, - client: c, - objectClient: objectClient, - } -} - -type GlobalDNSProvidersGetter interface { - GlobalDNSProviders(namespace string) GlobalDNSProviderInterface -} - -func (c *Client) GlobalDNSProviders(namespace string) GlobalDNSProviderInterface { - sharedClient := c.clientFactory.ForResourceKind(GlobalDNSProviderGroupVersionResource, GlobalDNSProviderGroupVersionKind.Kind, true) - objectClient := objectclient.NewObjectClient(namespace, sharedClient, &GlobalDNSProviderResource, GlobalDNSProviderGroupVersionKind, globalDnsProviderFactory{}) - return &globalDnsProviderClient{ - ns: namespace, - client: c, - objectClient: objectClient, - } -} - -type KontainerDriversGetter interface { - KontainerDrivers(namespace string) KontainerDriverInterface -} - -func (c *Client) KontainerDrivers(namespace string) KontainerDriverInterface { - sharedClient := c.clientFactory.ForResourceKind(KontainerDriverGroupVersionResource, KontainerDriverGroupVersionKind.Kind, false) - objectClient := objectclient.NewObjectClient(namespace, sharedClient, &KontainerDriverResource, KontainerDriverGroupVersionKind, kontainerDriverFactory{}) - return &kontainerDriverClient{ - ns: namespace, - client: c, - objectClient: objectClient, - } -} - -type EtcdBackupsGetter interface { - EtcdBackups(namespace string) EtcdBackupInterface -} - -func (c *Client) EtcdBackups(namespace string) EtcdBackupInterface { - sharedClient := c.clientFactory.ForResourceKind(EtcdBackupGroupVersionResource, EtcdBackupGroupVersionKind.Kind, true) - objectClient := objectclient.NewObjectClient(namespace, sharedClient, &EtcdBackupResource, EtcdBackupGroupVersionKind, etcdBackupFactory{}) - return &etcdBackupClient{ - ns: namespace, - client: c, - objectClient: objectClient, - } -} - -type ClusterScansGetter interface { - ClusterScans(namespace string) ClusterScanInterface -} - -func (c *Client) ClusterScans(namespace string) ClusterScanInterface { - sharedClient := c.clientFactory.ForResourceKind(ClusterScanGroupVersionResource, ClusterScanGroupVersionKind.Kind, true) - objectClient := objectclient.NewObjectClient(namespace, sharedClient, &ClusterScanResource, ClusterScanGroupVersionKind, clusterScanFactory{}) - return &clusterScanClient{ - ns: namespace, - client: c, - objectClient: objectClient, - } -} - -type MonitorMetricsGetter interface { - MonitorMetrics(namespace string) MonitorMetricInterface -} - -func (c *Client) MonitorMetrics(namespace string) MonitorMetricInterface { - sharedClient := c.clientFactory.ForResourceKind(MonitorMetricGroupVersionResource, MonitorMetricGroupVersionKind.Kind, true) - objectClient := objectclient.NewObjectClient(namespace, sharedClient, &MonitorMetricResource, MonitorMetricGroupVersionKind, monitorMetricFactory{}) - return &monitorMetricClient{ - ns: namespace, - client: c, - objectClient: objectClient, - } -} - -type ClusterMonitorGraphsGetter interface { - ClusterMonitorGraphs(namespace string) ClusterMonitorGraphInterface -} - -func (c *Client) ClusterMonitorGraphs(namespace string) ClusterMonitorGraphInterface { - sharedClient := c.clientFactory.ForResourceKind(ClusterMonitorGraphGroupVersionResource, ClusterMonitorGraphGroupVersionKind.Kind, true) - objectClient := objectclient.NewObjectClient(namespace, sharedClient, &ClusterMonitorGraphResource, ClusterMonitorGraphGroupVersionKind, clusterMonitorGraphFactory{}) - return &clusterMonitorGraphClient{ - ns: namespace, - client: c, - objectClient: objectClient, - } -} - -type ProjectMonitorGraphsGetter interface { - ProjectMonitorGraphs(namespace string) ProjectMonitorGraphInterface -} - -func (c *Client) ProjectMonitorGraphs(namespace string) ProjectMonitorGraphInterface { - sharedClient := c.clientFactory.ForResourceKind(ProjectMonitorGraphGroupVersionResource, ProjectMonitorGraphGroupVersionKind.Kind, true) - objectClient := objectclient.NewObjectClient(namespace, sharedClient, &ProjectMonitorGraphResource, ProjectMonitorGraphGroupVersionKind, projectMonitorGraphFactory{}) - return &projectMonitorGraphClient{ - ns: namespace, - client: c, - objectClient: objectClient, - } -} - -type CloudCredentialsGetter interface { - CloudCredentials(namespace string) CloudCredentialInterface -} - -func (c *Client) CloudCredentials(namespace string) CloudCredentialInterface { - sharedClient := c.clientFactory.ForResourceKind(CloudCredentialGroupVersionResource, CloudCredentialGroupVersionKind.Kind, true) - objectClient := objectclient.NewObjectClient(namespace, sharedClient, &CloudCredentialResource, CloudCredentialGroupVersionKind, cloudCredentialFactory{}) - return &cloudCredentialClient{ - ns: namespace, - client: c, - objectClient: objectClient, - } -} - -type ClusterTemplatesGetter interface { - ClusterTemplates(namespace string) ClusterTemplateInterface -} - -func (c *Client) ClusterTemplates(namespace string) ClusterTemplateInterface { - sharedClient := c.clientFactory.ForResourceKind(ClusterTemplateGroupVersionResource, ClusterTemplateGroupVersionKind.Kind, true) - objectClient := objectclient.NewObjectClient(namespace, sharedClient, &ClusterTemplateResource, ClusterTemplateGroupVersionKind, clusterTemplateFactory{}) - return &clusterTemplateClient{ - ns: namespace, - client: c, - objectClient: objectClient, - } -} - -type ClusterTemplateRevisionsGetter interface { - ClusterTemplateRevisions(namespace string) ClusterTemplateRevisionInterface -} - -func (c *Client) ClusterTemplateRevisions(namespace string) ClusterTemplateRevisionInterface { - sharedClient := c.clientFactory.ForResourceKind(ClusterTemplateRevisionGroupVersionResource, ClusterTemplateRevisionGroupVersionKind.Kind, true) - objectClient := objectclient.NewObjectClient(namespace, sharedClient, &ClusterTemplateRevisionResource, ClusterTemplateRevisionGroupVersionKind, clusterTemplateRevisionFactory{}) - return &clusterTemplateRevisionClient{ - ns: namespace, - client: c, - objectClient: objectClient, - } -} - -type RkeK8sSystemImagesGetter interface { - RkeK8sSystemImages(namespace string) RkeK8sSystemImageInterface -} - -func (c *Client) RkeK8sSystemImages(namespace string) RkeK8sSystemImageInterface { - sharedClient := c.clientFactory.ForResourceKind(RkeK8sSystemImageGroupVersionResource, RkeK8sSystemImageGroupVersionKind.Kind, true) - objectClient := objectclient.NewObjectClient(namespace, sharedClient, &RkeK8sSystemImageResource, RkeK8sSystemImageGroupVersionKind, rkeK8sSystemImageFactory{}) - return &rkeK8sSystemImageClient{ - ns: namespace, - client: c, - objectClient: objectClient, - } -} - -type RkeK8sServiceOptionsGetter interface { - RkeK8sServiceOptions(namespace string) RkeK8sServiceOptionInterface -} - -func (c *Client) RkeK8sServiceOptions(namespace string) RkeK8sServiceOptionInterface { - sharedClient := c.clientFactory.ForResourceKind(RkeK8sServiceOptionGroupVersionResource, RkeK8sServiceOptionGroupVersionKind.Kind, true) - objectClient := objectclient.NewObjectClient(namespace, sharedClient, &RkeK8sServiceOptionResource, RkeK8sServiceOptionGroupVersionKind, rkeK8sServiceOptionFactory{}) - return &rkeK8sServiceOptionClient{ - ns: namespace, - client: c, - objectClient: objectClient, - } -} - -type RkeAddonsGetter interface { - RkeAddons(namespace string) RkeAddonInterface -} - -func (c *Client) RkeAddons(namespace string) RkeAddonInterface { - sharedClient := c.clientFactory.ForResourceKind(RkeAddonGroupVersionResource, RkeAddonGroupVersionKind.Kind, true) - objectClient := objectclient.NewObjectClient(namespace, sharedClient, &RkeAddonResource, RkeAddonGroupVersionKind, rkeAddonFactory{}) - return &rkeAddonClient{ - ns: namespace, - client: c, - objectClient: objectClient, - } -} - -type CisConfigsGetter interface { - CisConfigs(namespace string) CisConfigInterface -} - -func (c *Client) CisConfigs(namespace string) CisConfigInterface { - sharedClient := c.clientFactory.ForResourceKind(CisConfigGroupVersionResource, CisConfigGroupVersionKind.Kind, true) - objectClient := objectclient.NewObjectClient(namespace, sharedClient, &CisConfigResource, CisConfigGroupVersionKind, cisConfigFactory{}) - return &cisConfigClient{ - ns: namespace, - client: c, - objectClient: objectClient, - } -} - -type CisBenchmarkVersionsGetter interface { - CisBenchmarkVersions(namespace string) CisBenchmarkVersionInterface -} - -func (c *Client) CisBenchmarkVersions(namespace string) CisBenchmarkVersionInterface { - sharedClient := c.clientFactory.ForResourceKind(CisBenchmarkVersionGroupVersionResource, CisBenchmarkVersionGroupVersionKind.Kind, true) - objectClient := objectclient.NewObjectClient(namespace, sharedClient, &CisBenchmarkVersionResource, CisBenchmarkVersionGroupVersionKind, cisBenchmarkVersionFactory{}) - return &cisBenchmarkVersionClient{ - ns: namespace, - client: c, - objectClient: objectClient, - } -} diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_kontainer_driver_controller.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_kontainer_driver_controller.go deleted file mode 100644 index 32fb60b7..00000000 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_kontainer_driver_controller.go +++ /dev/null @@ -1,320 +0,0 @@ -package v3 - -import ( - "context" - "time" - - "github.com/rancher/norman/controller" - "github.com/rancher/norman/objectclient" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/apimachinery/pkg/types" - "k8s.io/apimachinery/pkg/watch" - "k8s.io/client-go/tools/cache" -) - -var ( - KontainerDriverGroupVersionKind = schema.GroupVersionKind{ - Version: Version, - Group: GroupName, - Kind: "KontainerDriver", - } - KontainerDriverResource = metav1.APIResource{ - Name: "kontainerdrivers", - SingularName: "kontainerdriver", - Namespaced: false, - Kind: KontainerDriverGroupVersionKind.Kind, - } - - KontainerDriverGroupVersionResource = schema.GroupVersionResource{ - Group: GroupName, - Version: Version, - Resource: "kontainerdrivers", - } -) - -func init() { - resource.Put(KontainerDriverGroupVersionResource) -} - -func NewKontainerDriver(namespace, name string, obj KontainerDriver) *KontainerDriver { - obj.APIVersion, obj.Kind = KontainerDriverGroupVersionKind.ToAPIVersionAndKind() - obj.Name = name - obj.Namespace = namespace - return &obj -} - -type KontainerDriverList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []KontainerDriver `json:"items"` -} - -type KontainerDriverHandlerFunc func(key string, obj *KontainerDriver) (runtime.Object, error) - -type KontainerDriverChangeHandlerFunc func(obj *KontainerDriver) (runtime.Object, error) - -type KontainerDriverLister interface { - List(namespace string, selector labels.Selector) (ret []*KontainerDriver, err error) - Get(namespace, name string) (*KontainerDriver, error) -} - -type KontainerDriverController interface { - Generic() controller.GenericController - Informer() cache.SharedIndexInformer - Lister() KontainerDriverLister - AddHandler(ctx context.Context, name string, handler KontainerDriverHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync KontainerDriverHandlerFunc) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, handler KontainerDriverHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, handler KontainerDriverHandlerFunc) - Enqueue(namespace, name string) - EnqueueAfter(namespace, name string, after time.Duration) -} - -type KontainerDriverInterface interface { - ObjectClient() *objectclient.ObjectClient - Create(*KontainerDriver) (*KontainerDriver, error) - GetNamespaced(namespace, name string, opts metav1.GetOptions) (*KontainerDriver, error) - Get(name string, opts metav1.GetOptions) (*KontainerDriver, error) - Update(*KontainerDriver) (*KontainerDriver, error) - Delete(name string, options *metav1.DeleteOptions) error - DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error - List(opts metav1.ListOptions) (*KontainerDriverList, error) - ListNamespaced(namespace string, opts metav1.ListOptions) (*KontainerDriverList, error) - Watch(opts metav1.ListOptions) (watch.Interface, error) - DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error - Controller() KontainerDriverController - AddHandler(ctx context.Context, name string, sync KontainerDriverHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync KontainerDriverHandlerFunc) - AddLifecycle(ctx context.Context, name string, lifecycle KontainerDriverLifecycle) - AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle KontainerDriverLifecycle) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync KontainerDriverHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync KontainerDriverHandlerFunc) - AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle KontainerDriverLifecycle) - AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle KontainerDriverLifecycle) -} - -type kontainerDriverLister struct { - controller *kontainerDriverController -} - -func (l *kontainerDriverLister) List(namespace string, selector labels.Selector) (ret []*KontainerDriver, err error) { - err = cache.ListAllByNamespace(l.controller.Informer().GetIndexer(), namespace, selector, func(obj interface{}) { - ret = append(ret, obj.(*KontainerDriver)) - }) - return -} - -func (l *kontainerDriverLister) Get(namespace, name string) (*KontainerDriver, error) { - var key string - if namespace != "" { - key = namespace + "/" + name - } else { - key = name - } - obj, exists, err := l.controller.Informer().GetIndexer().GetByKey(key) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(schema.GroupResource{ - Group: KontainerDriverGroupVersionKind.Group, - Resource: KontainerDriverGroupVersionResource.Resource, - }, key) - } - return obj.(*KontainerDriver), nil -} - -type kontainerDriverController struct { - controller.GenericController -} - -func (c *kontainerDriverController) Generic() controller.GenericController { - return c.GenericController -} - -func (c *kontainerDriverController) Lister() KontainerDriverLister { - return &kontainerDriverLister{ - controller: c, - } -} - -func (c *kontainerDriverController) AddHandler(ctx context.Context, name string, handler KontainerDriverHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*KontainerDriver); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *kontainerDriverController) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, handler KontainerDriverHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*KontainerDriver); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *kontainerDriverController) AddClusterScopedHandler(ctx context.Context, name, cluster string, handler KontainerDriverHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*KontainerDriver); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *kontainerDriverController) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, cluster string, handler KontainerDriverHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*KontainerDriver); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -type kontainerDriverFactory struct { -} - -func (c kontainerDriverFactory) Object() runtime.Object { - return &KontainerDriver{} -} - -func (c kontainerDriverFactory) List() runtime.Object { - return &KontainerDriverList{} -} - -func (s *kontainerDriverClient) Controller() KontainerDriverController { - genericController := controller.NewGenericController(KontainerDriverGroupVersionKind.Kind+"Controller", - s.client.controllerFactory.ForResourceKind(KontainerDriverGroupVersionResource, KontainerDriverGroupVersionKind.Kind, false)) - - return &kontainerDriverController{ - GenericController: genericController, - } -} - -type kontainerDriverClient struct { - client *Client - ns string - objectClient *objectclient.ObjectClient - controller KontainerDriverController -} - -func (s *kontainerDriverClient) ObjectClient() *objectclient.ObjectClient { - return s.objectClient -} - -func (s *kontainerDriverClient) Create(o *KontainerDriver) (*KontainerDriver, error) { - obj, err := s.objectClient.Create(o) - return obj.(*KontainerDriver), err -} - -func (s *kontainerDriverClient) Get(name string, opts metav1.GetOptions) (*KontainerDriver, error) { - obj, err := s.objectClient.Get(name, opts) - return obj.(*KontainerDriver), err -} - -func (s *kontainerDriverClient) GetNamespaced(namespace, name string, opts metav1.GetOptions) (*KontainerDriver, error) { - obj, err := s.objectClient.GetNamespaced(namespace, name, opts) - return obj.(*KontainerDriver), err -} - -func (s *kontainerDriverClient) Update(o *KontainerDriver) (*KontainerDriver, error) { - obj, err := s.objectClient.Update(o.Name, o) - return obj.(*KontainerDriver), err -} - -func (s *kontainerDriverClient) UpdateStatus(o *KontainerDriver) (*KontainerDriver, error) { - obj, err := s.objectClient.UpdateStatus(o.Name, o) - return obj.(*KontainerDriver), err -} - -func (s *kontainerDriverClient) Delete(name string, options *metav1.DeleteOptions) error { - return s.objectClient.Delete(name, options) -} - -func (s *kontainerDriverClient) DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error { - return s.objectClient.DeleteNamespaced(namespace, name, options) -} - -func (s *kontainerDriverClient) List(opts metav1.ListOptions) (*KontainerDriverList, error) { - obj, err := s.objectClient.List(opts) - return obj.(*KontainerDriverList), err -} - -func (s *kontainerDriverClient) ListNamespaced(namespace string, opts metav1.ListOptions) (*KontainerDriverList, error) { - obj, err := s.objectClient.ListNamespaced(namespace, opts) - return obj.(*KontainerDriverList), err -} - -func (s *kontainerDriverClient) Watch(opts metav1.ListOptions) (watch.Interface, error) { - return s.objectClient.Watch(opts) -} - -// Patch applies the patch and returns the patched deployment. -func (s *kontainerDriverClient) Patch(o *KontainerDriver, patchType types.PatchType, data []byte, subresources ...string) (*KontainerDriver, error) { - obj, err := s.objectClient.Patch(o.Name, o, patchType, data, subresources...) - return obj.(*KontainerDriver), err -} - -func (s *kontainerDriverClient) DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error { - return s.objectClient.DeleteCollection(deleteOpts, listOpts) -} - -func (s *kontainerDriverClient) AddHandler(ctx context.Context, name string, sync KontainerDriverHandlerFunc) { - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *kontainerDriverClient) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync KontainerDriverHandlerFunc) { - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *kontainerDriverClient) AddLifecycle(ctx context.Context, name string, lifecycle KontainerDriverLifecycle) { - sync := NewKontainerDriverLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *kontainerDriverClient) AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle KontainerDriverLifecycle) { - sync := NewKontainerDriverLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *kontainerDriverClient) AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync KontainerDriverHandlerFunc) { - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *kontainerDriverClient) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync KontainerDriverHandlerFunc) { - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} - -func (s *kontainerDriverClient) AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle KontainerDriverLifecycle) { - sync := NewKontainerDriverLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *kontainerDriverClient) AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle KontainerDriverLifecycle) { - sync := NewKontainerDriverLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_kontainer_driver_lifecycle_adapter.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_kontainer_driver_lifecycle_adapter.go deleted file mode 100644 index 413759c9..00000000 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_kontainer_driver_lifecycle_adapter.go +++ /dev/null @@ -1,66 +0,0 @@ -package v3 - -import ( - "github.com/rancher/norman/lifecycle" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/runtime" -) - -type KontainerDriverLifecycle interface { - Create(obj *KontainerDriver) (runtime.Object, error) - Remove(obj *KontainerDriver) (runtime.Object, error) - Updated(obj *KontainerDriver) (runtime.Object, error) -} - -type kontainerDriverLifecycleAdapter struct { - lifecycle KontainerDriverLifecycle -} - -func (w *kontainerDriverLifecycleAdapter) HasCreate() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasCreate() -} - -func (w *kontainerDriverLifecycleAdapter) HasFinalize() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasFinalize() -} - -func (w *kontainerDriverLifecycleAdapter) Create(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Create(obj.(*KontainerDriver)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *kontainerDriverLifecycleAdapter) Finalize(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Remove(obj.(*KontainerDriver)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *kontainerDriverLifecycleAdapter) Updated(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Updated(obj.(*KontainerDriver)) - if o == nil { - return nil, err - } - return o, err -} - -func NewKontainerDriverLifecycleAdapter(name string, clusterScoped bool, client KontainerDriverInterface, l KontainerDriverLifecycle) KontainerDriverHandlerFunc { - if clusterScoped { - resource.PutClusterScoped(KontainerDriverGroupVersionResource) - } - adapter := &kontainerDriverLifecycleAdapter{lifecycle: l} - syncFn := lifecycle.NewObjectLifecycleAdapter(name, clusterScoped, adapter, client.ObjectClient()) - return func(key string, obj *KontainerDriver) (runtime.Object, error) { - newObj, err := syncFn(key, obj) - if o, ok := newObj.(runtime.Object); ok { - return o, err - } - return nil, err - } -} diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_ldap_config_controller.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_ldap_config_controller.go deleted file mode 100644 index eb52683f..00000000 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_ldap_config_controller.go +++ /dev/null @@ -1,320 +0,0 @@ -package v3 - -import ( - "context" - "time" - - "github.com/rancher/norman/controller" - "github.com/rancher/norman/objectclient" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/apimachinery/pkg/types" - "k8s.io/apimachinery/pkg/watch" - "k8s.io/client-go/tools/cache" -) - -var ( - LdapConfigGroupVersionKind = schema.GroupVersionKind{ - Version: Version, - Group: GroupName, - Kind: "LdapConfig", - } - LdapConfigResource = metav1.APIResource{ - Name: "ldapconfigs", - SingularName: "ldapconfig", - Namespaced: false, - Kind: LdapConfigGroupVersionKind.Kind, - } - - LdapConfigGroupVersionResource = schema.GroupVersionResource{ - Group: GroupName, - Version: Version, - Resource: "ldapconfigs", - } -) - -func init() { - resource.Put(LdapConfigGroupVersionResource) -} - -func NewLdapConfig(namespace, name string, obj LdapConfig) *LdapConfig { - obj.APIVersion, obj.Kind = LdapConfigGroupVersionKind.ToAPIVersionAndKind() - obj.Name = name - obj.Namespace = namespace - return &obj -} - -type LdapConfigList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []LdapConfig `json:"items"` -} - -type LdapConfigHandlerFunc func(key string, obj *LdapConfig) (runtime.Object, error) - -type LdapConfigChangeHandlerFunc func(obj *LdapConfig) (runtime.Object, error) - -type LdapConfigLister interface { - List(namespace string, selector labels.Selector) (ret []*LdapConfig, err error) - Get(namespace, name string) (*LdapConfig, error) -} - -type LdapConfigController interface { - Generic() controller.GenericController - Informer() cache.SharedIndexInformer - Lister() LdapConfigLister - AddHandler(ctx context.Context, name string, handler LdapConfigHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync LdapConfigHandlerFunc) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, handler LdapConfigHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, handler LdapConfigHandlerFunc) - Enqueue(namespace, name string) - EnqueueAfter(namespace, name string, after time.Duration) -} - -type LdapConfigInterface interface { - ObjectClient() *objectclient.ObjectClient - Create(*LdapConfig) (*LdapConfig, error) - GetNamespaced(namespace, name string, opts metav1.GetOptions) (*LdapConfig, error) - Get(name string, opts metav1.GetOptions) (*LdapConfig, error) - Update(*LdapConfig) (*LdapConfig, error) - Delete(name string, options *metav1.DeleteOptions) error - DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error - List(opts metav1.ListOptions) (*LdapConfigList, error) - ListNamespaced(namespace string, opts metav1.ListOptions) (*LdapConfigList, error) - Watch(opts metav1.ListOptions) (watch.Interface, error) - DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error - Controller() LdapConfigController - AddHandler(ctx context.Context, name string, sync LdapConfigHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync LdapConfigHandlerFunc) - AddLifecycle(ctx context.Context, name string, lifecycle LdapConfigLifecycle) - AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle LdapConfigLifecycle) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync LdapConfigHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync LdapConfigHandlerFunc) - AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle LdapConfigLifecycle) - AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle LdapConfigLifecycle) -} - -type ldapConfigLister struct { - controller *ldapConfigController -} - -func (l *ldapConfigLister) List(namespace string, selector labels.Selector) (ret []*LdapConfig, err error) { - err = cache.ListAllByNamespace(l.controller.Informer().GetIndexer(), namespace, selector, func(obj interface{}) { - ret = append(ret, obj.(*LdapConfig)) - }) - return -} - -func (l *ldapConfigLister) Get(namespace, name string) (*LdapConfig, error) { - var key string - if namespace != "" { - key = namespace + "/" + name - } else { - key = name - } - obj, exists, err := l.controller.Informer().GetIndexer().GetByKey(key) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(schema.GroupResource{ - Group: LdapConfigGroupVersionKind.Group, - Resource: LdapConfigGroupVersionResource.Resource, - }, key) - } - return obj.(*LdapConfig), nil -} - -type ldapConfigController struct { - controller.GenericController -} - -func (c *ldapConfigController) Generic() controller.GenericController { - return c.GenericController -} - -func (c *ldapConfigController) Lister() LdapConfigLister { - return &ldapConfigLister{ - controller: c, - } -} - -func (c *ldapConfigController) AddHandler(ctx context.Context, name string, handler LdapConfigHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*LdapConfig); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *ldapConfigController) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, handler LdapConfigHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*LdapConfig); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *ldapConfigController) AddClusterScopedHandler(ctx context.Context, name, cluster string, handler LdapConfigHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*LdapConfig); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *ldapConfigController) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, cluster string, handler LdapConfigHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*LdapConfig); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -type ldapConfigFactory struct { -} - -func (c ldapConfigFactory) Object() runtime.Object { - return &LdapConfig{} -} - -func (c ldapConfigFactory) List() runtime.Object { - return &LdapConfigList{} -} - -func (s *ldapConfigClient) Controller() LdapConfigController { - genericController := controller.NewGenericController(LdapConfigGroupVersionKind.Kind+"Controller", - s.client.controllerFactory.ForResourceKind(LdapConfigGroupVersionResource, LdapConfigGroupVersionKind.Kind, false)) - - return &ldapConfigController{ - GenericController: genericController, - } -} - -type ldapConfigClient struct { - client *Client - ns string - objectClient *objectclient.ObjectClient - controller LdapConfigController -} - -func (s *ldapConfigClient) ObjectClient() *objectclient.ObjectClient { - return s.objectClient -} - -func (s *ldapConfigClient) Create(o *LdapConfig) (*LdapConfig, error) { - obj, err := s.objectClient.Create(o) - return obj.(*LdapConfig), err -} - -func (s *ldapConfigClient) Get(name string, opts metav1.GetOptions) (*LdapConfig, error) { - obj, err := s.objectClient.Get(name, opts) - return obj.(*LdapConfig), err -} - -func (s *ldapConfigClient) GetNamespaced(namespace, name string, opts metav1.GetOptions) (*LdapConfig, error) { - obj, err := s.objectClient.GetNamespaced(namespace, name, opts) - return obj.(*LdapConfig), err -} - -func (s *ldapConfigClient) Update(o *LdapConfig) (*LdapConfig, error) { - obj, err := s.objectClient.Update(o.Name, o) - return obj.(*LdapConfig), err -} - -func (s *ldapConfigClient) UpdateStatus(o *LdapConfig) (*LdapConfig, error) { - obj, err := s.objectClient.UpdateStatus(o.Name, o) - return obj.(*LdapConfig), err -} - -func (s *ldapConfigClient) Delete(name string, options *metav1.DeleteOptions) error { - return s.objectClient.Delete(name, options) -} - -func (s *ldapConfigClient) DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error { - return s.objectClient.DeleteNamespaced(namespace, name, options) -} - -func (s *ldapConfigClient) List(opts metav1.ListOptions) (*LdapConfigList, error) { - obj, err := s.objectClient.List(opts) - return obj.(*LdapConfigList), err -} - -func (s *ldapConfigClient) ListNamespaced(namespace string, opts metav1.ListOptions) (*LdapConfigList, error) { - obj, err := s.objectClient.ListNamespaced(namespace, opts) - return obj.(*LdapConfigList), err -} - -func (s *ldapConfigClient) Watch(opts metav1.ListOptions) (watch.Interface, error) { - return s.objectClient.Watch(opts) -} - -// Patch applies the patch and returns the patched deployment. -func (s *ldapConfigClient) Patch(o *LdapConfig, patchType types.PatchType, data []byte, subresources ...string) (*LdapConfig, error) { - obj, err := s.objectClient.Patch(o.Name, o, patchType, data, subresources...) - return obj.(*LdapConfig), err -} - -func (s *ldapConfigClient) DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error { - return s.objectClient.DeleteCollection(deleteOpts, listOpts) -} - -func (s *ldapConfigClient) AddHandler(ctx context.Context, name string, sync LdapConfigHandlerFunc) { - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *ldapConfigClient) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync LdapConfigHandlerFunc) { - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *ldapConfigClient) AddLifecycle(ctx context.Context, name string, lifecycle LdapConfigLifecycle) { - sync := NewLdapConfigLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *ldapConfigClient) AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle LdapConfigLifecycle) { - sync := NewLdapConfigLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *ldapConfigClient) AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync LdapConfigHandlerFunc) { - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *ldapConfigClient) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync LdapConfigHandlerFunc) { - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} - -func (s *ldapConfigClient) AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle LdapConfigLifecycle) { - sync := NewLdapConfigLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *ldapConfigClient) AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle LdapConfigLifecycle) { - sync := NewLdapConfigLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_ldap_config_lifecycle_adapter.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_ldap_config_lifecycle_adapter.go deleted file mode 100644 index 2173fdc4..00000000 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_ldap_config_lifecycle_adapter.go +++ /dev/null @@ -1,66 +0,0 @@ -package v3 - -import ( - "github.com/rancher/norman/lifecycle" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/runtime" -) - -type LdapConfigLifecycle interface { - Create(obj *LdapConfig) (runtime.Object, error) - Remove(obj *LdapConfig) (runtime.Object, error) - Updated(obj *LdapConfig) (runtime.Object, error) -} - -type ldapConfigLifecycleAdapter struct { - lifecycle LdapConfigLifecycle -} - -func (w *ldapConfigLifecycleAdapter) HasCreate() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasCreate() -} - -func (w *ldapConfigLifecycleAdapter) HasFinalize() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasFinalize() -} - -func (w *ldapConfigLifecycleAdapter) Create(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Create(obj.(*LdapConfig)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *ldapConfigLifecycleAdapter) Finalize(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Remove(obj.(*LdapConfig)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *ldapConfigLifecycleAdapter) Updated(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Updated(obj.(*LdapConfig)) - if o == nil { - return nil, err - } - return o, err -} - -func NewLdapConfigLifecycleAdapter(name string, clusterScoped bool, client LdapConfigInterface, l LdapConfigLifecycle) LdapConfigHandlerFunc { - if clusterScoped { - resource.PutClusterScoped(LdapConfigGroupVersionResource) - } - adapter := &ldapConfigLifecycleAdapter{lifecycle: l} - syncFn := lifecycle.NewObjectLifecycleAdapter(name, clusterScoped, adapter, client.ObjectClient()) - return func(key string, obj *LdapConfig) (runtime.Object, error) { - newObj, err := syncFn(key, obj) - if o, ok := newObj.(runtime.Object); ok { - return o, err - } - return nil, err - } -} diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_monitor_metric_controller.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_monitor_metric_controller.go deleted file mode 100644 index c9b312bd..00000000 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_monitor_metric_controller.go +++ /dev/null @@ -1,321 +0,0 @@ -package v3 - -import ( - "context" - "time" - - "github.com/rancher/norman/controller" - "github.com/rancher/norman/objectclient" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/apimachinery/pkg/types" - "k8s.io/apimachinery/pkg/watch" - "k8s.io/client-go/tools/cache" -) - -var ( - MonitorMetricGroupVersionKind = schema.GroupVersionKind{ - Version: Version, - Group: GroupName, - Kind: "MonitorMetric", - } - MonitorMetricResource = metav1.APIResource{ - Name: "monitormetrics", - SingularName: "monitormetric", - Namespaced: true, - - Kind: MonitorMetricGroupVersionKind.Kind, - } - - MonitorMetricGroupVersionResource = schema.GroupVersionResource{ - Group: GroupName, - Version: Version, - Resource: "monitormetrics", - } -) - -func init() { - resource.Put(MonitorMetricGroupVersionResource) -} - -func NewMonitorMetric(namespace, name string, obj MonitorMetric) *MonitorMetric { - obj.APIVersion, obj.Kind = MonitorMetricGroupVersionKind.ToAPIVersionAndKind() - obj.Name = name - obj.Namespace = namespace - return &obj -} - -type MonitorMetricList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []MonitorMetric `json:"items"` -} - -type MonitorMetricHandlerFunc func(key string, obj *MonitorMetric) (runtime.Object, error) - -type MonitorMetricChangeHandlerFunc func(obj *MonitorMetric) (runtime.Object, error) - -type MonitorMetricLister interface { - List(namespace string, selector labels.Selector) (ret []*MonitorMetric, err error) - Get(namespace, name string) (*MonitorMetric, error) -} - -type MonitorMetricController interface { - Generic() controller.GenericController - Informer() cache.SharedIndexInformer - Lister() MonitorMetricLister - AddHandler(ctx context.Context, name string, handler MonitorMetricHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync MonitorMetricHandlerFunc) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, handler MonitorMetricHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, handler MonitorMetricHandlerFunc) - Enqueue(namespace, name string) - EnqueueAfter(namespace, name string, after time.Duration) -} - -type MonitorMetricInterface interface { - ObjectClient() *objectclient.ObjectClient - Create(*MonitorMetric) (*MonitorMetric, error) - GetNamespaced(namespace, name string, opts metav1.GetOptions) (*MonitorMetric, error) - Get(name string, opts metav1.GetOptions) (*MonitorMetric, error) - Update(*MonitorMetric) (*MonitorMetric, error) - Delete(name string, options *metav1.DeleteOptions) error - DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error - List(opts metav1.ListOptions) (*MonitorMetricList, error) - ListNamespaced(namespace string, opts metav1.ListOptions) (*MonitorMetricList, error) - Watch(opts metav1.ListOptions) (watch.Interface, error) - DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error - Controller() MonitorMetricController - AddHandler(ctx context.Context, name string, sync MonitorMetricHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync MonitorMetricHandlerFunc) - AddLifecycle(ctx context.Context, name string, lifecycle MonitorMetricLifecycle) - AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle MonitorMetricLifecycle) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync MonitorMetricHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync MonitorMetricHandlerFunc) - AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle MonitorMetricLifecycle) - AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle MonitorMetricLifecycle) -} - -type monitorMetricLister struct { - controller *monitorMetricController -} - -func (l *monitorMetricLister) List(namespace string, selector labels.Selector) (ret []*MonitorMetric, err error) { - err = cache.ListAllByNamespace(l.controller.Informer().GetIndexer(), namespace, selector, func(obj interface{}) { - ret = append(ret, obj.(*MonitorMetric)) - }) - return -} - -func (l *monitorMetricLister) Get(namespace, name string) (*MonitorMetric, error) { - var key string - if namespace != "" { - key = namespace + "/" + name - } else { - key = name - } - obj, exists, err := l.controller.Informer().GetIndexer().GetByKey(key) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(schema.GroupResource{ - Group: MonitorMetricGroupVersionKind.Group, - Resource: MonitorMetricGroupVersionResource.Resource, - }, key) - } - return obj.(*MonitorMetric), nil -} - -type monitorMetricController struct { - controller.GenericController -} - -func (c *monitorMetricController) Generic() controller.GenericController { - return c.GenericController -} - -func (c *monitorMetricController) Lister() MonitorMetricLister { - return &monitorMetricLister{ - controller: c, - } -} - -func (c *monitorMetricController) AddHandler(ctx context.Context, name string, handler MonitorMetricHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*MonitorMetric); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *monitorMetricController) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, handler MonitorMetricHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*MonitorMetric); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *monitorMetricController) AddClusterScopedHandler(ctx context.Context, name, cluster string, handler MonitorMetricHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*MonitorMetric); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *monitorMetricController) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, cluster string, handler MonitorMetricHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*MonitorMetric); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -type monitorMetricFactory struct { -} - -func (c monitorMetricFactory) Object() runtime.Object { - return &MonitorMetric{} -} - -func (c monitorMetricFactory) List() runtime.Object { - return &MonitorMetricList{} -} - -func (s *monitorMetricClient) Controller() MonitorMetricController { - genericController := controller.NewGenericController(MonitorMetricGroupVersionKind.Kind+"Controller", - s.client.controllerFactory.ForResourceKind(MonitorMetricGroupVersionResource, MonitorMetricGroupVersionKind.Kind, true)) - - return &monitorMetricController{ - GenericController: genericController, - } -} - -type monitorMetricClient struct { - client *Client - ns string - objectClient *objectclient.ObjectClient - controller MonitorMetricController -} - -func (s *monitorMetricClient) ObjectClient() *objectclient.ObjectClient { - return s.objectClient -} - -func (s *monitorMetricClient) Create(o *MonitorMetric) (*MonitorMetric, error) { - obj, err := s.objectClient.Create(o) - return obj.(*MonitorMetric), err -} - -func (s *monitorMetricClient) Get(name string, opts metav1.GetOptions) (*MonitorMetric, error) { - obj, err := s.objectClient.Get(name, opts) - return obj.(*MonitorMetric), err -} - -func (s *monitorMetricClient) GetNamespaced(namespace, name string, opts metav1.GetOptions) (*MonitorMetric, error) { - obj, err := s.objectClient.GetNamespaced(namespace, name, opts) - return obj.(*MonitorMetric), err -} - -func (s *monitorMetricClient) Update(o *MonitorMetric) (*MonitorMetric, error) { - obj, err := s.objectClient.Update(o.Name, o) - return obj.(*MonitorMetric), err -} - -func (s *monitorMetricClient) UpdateStatus(o *MonitorMetric) (*MonitorMetric, error) { - obj, err := s.objectClient.UpdateStatus(o.Name, o) - return obj.(*MonitorMetric), err -} - -func (s *monitorMetricClient) Delete(name string, options *metav1.DeleteOptions) error { - return s.objectClient.Delete(name, options) -} - -func (s *monitorMetricClient) DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error { - return s.objectClient.DeleteNamespaced(namespace, name, options) -} - -func (s *monitorMetricClient) List(opts metav1.ListOptions) (*MonitorMetricList, error) { - obj, err := s.objectClient.List(opts) - return obj.(*MonitorMetricList), err -} - -func (s *monitorMetricClient) ListNamespaced(namespace string, opts metav1.ListOptions) (*MonitorMetricList, error) { - obj, err := s.objectClient.ListNamespaced(namespace, opts) - return obj.(*MonitorMetricList), err -} - -func (s *monitorMetricClient) Watch(opts metav1.ListOptions) (watch.Interface, error) { - return s.objectClient.Watch(opts) -} - -// Patch applies the patch and returns the patched deployment. -func (s *monitorMetricClient) Patch(o *MonitorMetric, patchType types.PatchType, data []byte, subresources ...string) (*MonitorMetric, error) { - obj, err := s.objectClient.Patch(o.Name, o, patchType, data, subresources...) - return obj.(*MonitorMetric), err -} - -func (s *monitorMetricClient) DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error { - return s.objectClient.DeleteCollection(deleteOpts, listOpts) -} - -func (s *monitorMetricClient) AddHandler(ctx context.Context, name string, sync MonitorMetricHandlerFunc) { - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *monitorMetricClient) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync MonitorMetricHandlerFunc) { - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *monitorMetricClient) AddLifecycle(ctx context.Context, name string, lifecycle MonitorMetricLifecycle) { - sync := NewMonitorMetricLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *monitorMetricClient) AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle MonitorMetricLifecycle) { - sync := NewMonitorMetricLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *monitorMetricClient) AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync MonitorMetricHandlerFunc) { - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *monitorMetricClient) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync MonitorMetricHandlerFunc) { - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} - -func (s *monitorMetricClient) AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle MonitorMetricLifecycle) { - sync := NewMonitorMetricLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *monitorMetricClient) AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle MonitorMetricLifecycle) { - sync := NewMonitorMetricLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_monitor_metric_lifecycle_adapter.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_monitor_metric_lifecycle_adapter.go deleted file mode 100644 index 27968bbf..00000000 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_monitor_metric_lifecycle_adapter.go +++ /dev/null @@ -1,66 +0,0 @@ -package v3 - -import ( - "github.com/rancher/norman/lifecycle" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/runtime" -) - -type MonitorMetricLifecycle interface { - Create(obj *MonitorMetric) (runtime.Object, error) - Remove(obj *MonitorMetric) (runtime.Object, error) - Updated(obj *MonitorMetric) (runtime.Object, error) -} - -type monitorMetricLifecycleAdapter struct { - lifecycle MonitorMetricLifecycle -} - -func (w *monitorMetricLifecycleAdapter) HasCreate() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasCreate() -} - -func (w *monitorMetricLifecycleAdapter) HasFinalize() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasFinalize() -} - -func (w *monitorMetricLifecycleAdapter) Create(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Create(obj.(*MonitorMetric)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *monitorMetricLifecycleAdapter) Finalize(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Remove(obj.(*MonitorMetric)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *monitorMetricLifecycleAdapter) Updated(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Updated(obj.(*MonitorMetric)) - if o == nil { - return nil, err - } - return o, err -} - -func NewMonitorMetricLifecycleAdapter(name string, clusterScoped bool, client MonitorMetricInterface, l MonitorMetricLifecycle) MonitorMetricHandlerFunc { - if clusterScoped { - resource.PutClusterScoped(MonitorMetricGroupVersionResource) - } - adapter := &monitorMetricLifecycleAdapter{lifecycle: l} - syncFn := lifecycle.NewObjectLifecycleAdapter(name, clusterScoped, adapter, client.ObjectClient()) - return func(key string, obj *MonitorMetric) (runtime.Object, error) { - newObj, err := syncFn(key, obj) - if o, ok := newObj.(runtime.Object); ok { - return o, err - } - return nil, err - } -} diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_multi_cluster_app_controller.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_multi_cluster_app_controller.go deleted file mode 100644 index 544c9aec..00000000 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_multi_cluster_app_controller.go +++ /dev/null @@ -1,321 +0,0 @@ -package v3 - -import ( - "context" - "time" - - "github.com/rancher/norman/controller" - "github.com/rancher/norman/objectclient" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/apimachinery/pkg/types" - "k8s.io/apimachinery/pkg/watch" - "k8s.io/client-go/tools/cache" -) - -var ( - MultiClusterAppGroupVersionKind = schema.GroupVersionKind{ - Version: Version, - Group: GroupName, - Kind: "MultiClusterApp", - } - MultiClusterAppResource = metav1.APIResource{ - Name: "multiclusterapps", - SingularName: "multiclusterapp", - Namespaced: true, - - Kind: MultiClusterAppGroupVersionKind.Kind, - } - - MultiClusterAppGroupVersionResource = schema.GroupVersionResource{ - Group: GroupName, - Version: Version, - Resource: "multiclusterapps", - } -) - -func init() { - resource.Put(MultiClusterAppGroupVersionResource) -} - -func NewMultiClusterApp(namespace, name string, obj MultiClusterApp) *MultiClusterApp { - obj.APIVersion, obj.Kind = MultiClusterAppGroupVersionKind.ToAPIVersionAndKind() - obj.Name = name - obj.Namespace = namespace - return &obj -} - -type MultiClusterAppList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []MultiClusterApp `json:"items"` -} - -type MultiClusterAppHandlerFunc func(key string, obj *MultiClusterApp) (runtime.Object, error) - -type MultiClusterAppChangeHandlerFunc func(obj *MultiClusterApp) (runtime.Object, error) - -type MultiClusterAppLister interface { - List(namespace string, selector labels.Selector) (ret []*MultiClusterApp, err error) - Get(namespace, name string) (*MultiClusterApp, error) -} - -type MultiClusterAppController interface { - Generic() controller.GenericController - Informer() cache.SharedIndexInformer - Lister() MultiClusterAppLister - AddHandler(ctx context.Context, name string, handler MultiClusterAppHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync MultiClusterAppHandlerFunc) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, handler MultiClusterAppHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, handler MultiClusterAppHandlerFunc) - Enqueue(namespace, name string) - EnqueueAfter(namespace, name string, after time.Duration) -} - -type MultiClusterAppInterface interface { - ObjectClient() *objectclient.ObjectClient - Create(*MultiClusterApp) (*MultiClusterApp, error) - GetNamespaced(namespace, name string, opts metav1.GetOptions) (*MultiClusterApp, error) - Get(name string, opts metav1.GetOptions) (*MultiClusterApp, error) - Update(*MultiClusterApp) (*MultiClusterApp, error) - Delete(name string, options *metav1.DeleteOptions) error - DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error - List(opts metav1.ListOptions) (*MultiClusterAppList, error) - ListNamespaced(namespace string, opts metav1.ListOptions) (*MultiClusterAppList, error) - Watch(opts metav1.ListOptions) (watch.Interface, error) - DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error - Controller() MultiClusterAppController - AddHandler(ctx context.Context, name string, sync MultiClusterAppHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync MultiClusterAppHandlerFunc) - AddLifecycle(ctx context.Context, name string, lifecycle MultiClusterAppLifecycle) - AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle MultiClusterAppLifecycle) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync MultiClusterAppHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync MultiClusterAppHandlerFunc) - AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle MultiClusterAppLifecycle) - AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle MultiClusterAppLifecycle) -} - -type multiClusterAppLister struct { - controller *multiClusterAppController -} - -func (l *multiClusterAppLister) List(namespace string, selector labels.Selector) (ret []*MultiClusterApp, err error) { - err = cache.ListAllByNamespace(l.controller.Informer().GetIndexer(), namespace, selector, func(obj interface{}) { - ret = append(ret, obj.(*MultiClusterApp)) - }) - return -} - -func (l *multiClusterAppLister) Get(namespace, name string) (*MultiClusterApp, error) { - var key string - if namespace != "" { - key = namespace + "/" + name - } else { - key = name - } - obj, exists, err := l.controller.Informer().GetIndexer().GetByKey(key) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(schema.GroupResource{ - Group: MultiClusterAppGroupVersionKind.Group, - Resource: MultiClusterAppGroupVersionResource.Resource, - }, key) - } - return obj.(*MultiClusterApp), nil -} - -type multiClusterAppController struct { - controller.GenericController -} - -func (c *multiClusterAppController) Generic() controller.GenericController { - return c.GenericController -} - -func (c *multiClusterAppController) Lister() MultiClusterAppLister { - return &multiClusterAppLister{ - controller: c, - } -} - -func (c *multiClusterAppController) AddHandler(ctx context.Context, name string, handler MultiClusterAppHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*MultiClusterApp); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *multiClusterAppController) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, handler MultiClusterAppHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*MultiClusterApp); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *multiClusterAppController) AddClusterScopedHandler(ctx context.Context, name, cluster string, handler MultiClusterAppHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*MultiClusterApp); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *multiClusterAppController) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, cluster string, handler MultiClusterAppHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*MultiClusterApp); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -type multiClusterAppFactory struct { -} - -func (c multiClusterAppFactory) Object() runtime.Object { - return &MultiClusterApp{} -} - -func (c multiClusterAppFactory) List() runtime.Object { - return &MultiClusterAppList{} -} - -func (s *multiClusterAppClient) Controller() MultiClusterAppController { - genericController := controller.NewGenericController(MultiClusterAppGroupVersionKind.Kind+"Controller", - s.client.controllerFactory.ForResourceKind(MultiClusterAppGroupVersionResource, MultiClusterAppGroupVersionKind.Kind, true)) - - return &multiClusterAppController{ - GenericController: genericController, - } -} - -type multiClusterAppClient struct { - client *Client - ns string - objectClient *objectclient.ObjectClient - controller MultiClusterAppController -} - -func (s *multiClusterAppClient) ObjectClient() *objectclient.ObjectClient { - return s.objectClient -} - -func (s *multiClusterAppClient) Create(o *MultiClusterApp) (*MultiClusterApp, error) { - obj, err := s.objectClient.Create(o) - return obj.(*MultiClusterApp), err -} - -func (s *multiClusterAppClient) Get(name string, opts metav1.GetOptions) (*MultiClusterApp, error) { - obj, err := s.objectClient.Get(name, opts) - return obj.(*MultiClusterApp), err -} - -func (s *multiClusterAppClient) GetNamespaced(namespace, name string, opts metav1.GetOptions) (*MultiClusterApp, error) { - obj, err := s.objectClient.GetNamespaced(namespace, name, opts) - return obj.(*MultiClusterApp), err -} - -func (s *multiClusterAppClient) Update(o *MultiClusterApp) (*MultiClusterApp, error) { - obj, err := s.objectClient.Update(o.Name, o) - return obj.(*MultiClusterApp), err -} - -func (s *multiClusterAppClient) UpdateStatus(o *MultiClusterApp) (*MultiClusterApp, error) { - obj, err := s.objectClient.UpdateStatus(o.Name, o) - return obj.(*MultiClusterApp), err -} - -func (s *multiClusterAppClient) Delete(name string, options *metav1.DeleteOptions) error { - return s.objectClient.Delete(name, options) -} - -func (s *multiClusterAppClient) DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error { - return s.objectClient.DeleteNamespaced(namespace, name, options) -} - -func (s *multiClusterAppClient) List(opts metav1.ListOptions) (*MultiClusterAppList, error) { - obj, err := s.objectClient.List(opts) - return obj.(*MultiClusterAppList), err -} - -func (s *multiClusterAppClient) ListNamespaced(namespace string, opts metav1.ListOptions) (*MultiClusterAppList, error) { - obj, err := s.objectClient.ListNamespaced(namespace, opts) - return obj.(*MultiClusterAppList), err -} - -func (s *multiClusterAppClient) Watch(opts metav1.ListOptions) (watch.Interface, error) { - return s.objectClient.Watch(opts) -} - -// Patch applies the patch and returns the patched deployment. -func (s *multiClusterAppClient) Patch(o *MultiClusterApp, patchType types.PatchType, data []byte, subresources ...string) (*MultiClusterApp, error) { - obj, err := s.objectClient.Patch(o.Name, o, patchType, data, subresources...) - return obj.(*MultiClusterApp), err -} - -func (s *multiClusterAppClient) DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error { - return s.objectClient.DeleteCollection(deleteOpts, listOpts) -} - -func (s *multiClusterAppClient) AddHandler(ctx context.Context, name string, sync MultiClusterAppHandlerFunc) { - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *multiClusterAppClient) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync MultiClusterAppHandlerFunc) { - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *multiClusterAppClient) AddLifecycle(ctx context.Context, name string, lifecycle MultiClusterAppLifecycle) { - sync := NewMultiClusterAppLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *multiClusterAppClient) AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle MultiClusterAppLifecycle) { - sync := NewMultiClusterAppLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *multiClusterAppClient) AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync MultiClusterAppHandlerFunc) { - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *multiClusterAppClient) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync MultiClusterAppHandlerFunc) { - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} - -func (s *multiClusterAppClient) AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle MultiClusterAppLifecycle) { - sync := NewMultiClusterAppLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *multiClusterAppClient) AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle MultiClusterAppLifecycle) { - sync := NewMultiClusterAppLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_multi_cluster_app_lifecycle_adapter.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_multi_cluster_app_lifecycle_adapter.go deleted file mode 100644 index 29732ad7..00000000 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_multi_cluster_app_lifecycle_adapter.go +++ /dev/null @@ -1,66 +0,0 @@ -package v3 - -import ( - "github.com/rancher/norman/lifecycle" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/runtime" -) - -type MultiClusterAppLifecycle interface { - Create(obj *MultiClusterApp) (runtime.Object, error) - Remove(obj *MultiClusterApp) (runtime.Object, error) - Updated(obj *MultiClusterApp) (runtime.Object, error) -} - -type multiClusterAppLifecycleAdapter struct { - lifecycle MultiClusterAppLifecycle -} - -func (w *multiClusterAppLifecycleAdapter) HasCreate() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasCreate() -} - -func (w *multiClusterAppLifecycleAdapter) HasFinalize() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasFinalize() -} - -func (w *multiClusterAppLifecycleAdapter) Create(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Create(obj.(*MultiClusterApp)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *multiClusterAppLifecycleAdapter) Finalize(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Remove(obj.(*MultiClusterApp)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *multiClusterAppLifecycleAdapter) Updated(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Updated(obj.(*MultiClusterApp)) - if o == nil { - return nil, err - } - return o, err -} - -func NewMultiClusterAppLifecycleAdapter(name string, clusterScoped bool, client MultiClusterAppInterface, l MultiClusterAppLifecycle) MultiClusterAppHandlerFunc { - if clusterScoped { - resource.PutClusterScoped(MultiClusterAppGroupVersionResource) - } - adapter := &multiClusterAppLifecycleAdapter{lifecycle: l} - syncFn := lifecycle.NewObjectLifecycleAdapter(name, clusterScoped, adapter, client.ObjectClient()) - return func(key string, obj *MultiClusterApp) (runtime.Object, error) { - newObj, err := syncFn(key, obj) - if o, ok := newObj.(runtime.Object); ok { - return o, err - } - return nil, err - } -} diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_multi_cluster_app_revision_controller.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_multi_cluster_app_revision_controller.go deleted file mode 100644 index 73ee74b1..00000000 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_multi_cluster_app_revision_controller.go +++ /dev/null @@ -1,321 +0,0 @@ -package v3 - -import ( - "context" - "time" - - "github.com/rancher/norman/controller" - "github.com/rancher/norman/objectclient" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/apimachinery/pkg/types" - "k8s.io/apimachinery/pkg/watch" - "k8s.io/client-go/tools/cache" -) - -var ( - MultiClusterAppRevisionGroupVersionKind = schema.GroupVersionKind{ - Version: Version, - Group: GroupName, - Kind: "MultiClusterAppRevision", - } - MultiClusterAppRevisionResource = metav1.APIResource{ - Name: "multiclusterapprevisions", - SingularName: "multiclusterapprevision", - Namespaced: true, - - Kind: MultiClusterAppRevisionGroupVersionKind.Kind, - } - - MultiClusterAppRevisionGroupVersionResource = schema.GroupVersionResource{ - Group: GroupName, - Version: Version, - Resource: "multiclusterapprevisions", - } -) - -func init() { - resource.Put(MultiClusterAppRevisionGroupVersionResource) -} - -func NewMultiClusterAppRevision(namespace, name string, obj MultiClusterAppRevision) *MultiClusterAppRevision { - obj.APIVersion, obj.Kind = MultiClusterAppRevisionGroupVersionKind.ToAPIVersionAndKind() - obj.Name = name - obj.Namespace = namespace - return &obj -} - -type MultiClusterAppRevisionList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []MultiClusterAppRevision `json:"items"` -} - -type MultiClusterAppRevisionHandlerFunc func(key string, obj *MultiClusterAppRevision) (runtime.Object, error) - -type MultiClusterAppRevisionChangeHandlerFunc func(obj *MultiClusterAppRevision) (runtime.Object, error) - -type MultiClusterAppRevisionLister interface { - List(namespace string, selector labels.Selector) (ret []*MultiClusterAppRevision, err error) - Get(namespace, name string) (*MultiClusterAppRevision, error) -} - -type MultiClusterAppRevisionController interface { - Generic() controller.GenericController - Informer() cache.SharedIndexInformer - Lister() MultiClusterAppRevisionLister - AddHandler(ctx context.Context, name string, handler MultiClusterAppRevisionHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync MultiClusterAppRevisionHandlerFunc) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, handler MultiClusterAppRevisionHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, handler MultiClusterAppRevisionHandlerFunc) - Enqueue(namespace, name string) - EnqueueAfter(namespace, name string, after time.Duration) -} - -type MultiClusterAppRevisionInterface interface { - ObjectClient() *objectclient.ObjectClient - Create(*MultiClusterAppRevision) (*MultiClusterAppRevision, error) - GetNamespaced(namespace, name string, opts metav1.GetOptions) (*MultiClusterAppRevision, error) - Get(name string, opts metav1.GetOptions) (*MultiClusterAppRevision, error) - Update(*MultiClusterAppRevision) (*MultiClusterAppRevision, error) - Delete(name string, options *metav1.DeleteOptions) error - DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error - List(opts metav1.ListOptions) (*MultiClusterAppRevisionList, error) - ListNamespaced(namespace string, opts metav1.ListOptions) (*MultiClusterAppRevisionList, error) - Watch(opts metav1.ListOptions) (watch.Interface, error) - DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error - Controller() MultiClusterAppRevisionController - AddHandler(ctx context.Context, name string, sync MultiClusterAppRevisionHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync MultiClusterAppRevisionHandlerFunc) - AddLifecycle(ctx context.Context, name string, lifecycle MultiClusterAppRevisionLifecycle) - AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle MultiClusterAppRevisionLifecycle) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync MultiClusterAppRevisionHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync MultiClusterAppRevisionHandlerFunc) - AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle MultiClusterAppRevisionLifecycle) - AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle MultiClusterAppRevisionLifecycle) -} - -type multiClusterAppRevisionLister struct { - controller *multiClusterAppRevisionController -} - -func (l *multiClusterAppRevisionLister) List(namespace string, selector labels.Selector) (ret []*MultiClusterAppRevision, err error) { - err = cache.ListAllByNamespace(l.controller.Informer().GetIndexer(), namespace, selector, func(obj interface{}) { - ret = append(ret, obj.(*MultiClusterAppRevision)) - }) - return -} - -func (l *multiClusterAppRevisionLister) Get(namespace, name string) (*MultiClusterAppRevision, error) { - var key string - if namespace != "" { - key = namespace + "/" + name - } else { - key = name - } - obj, exists, err := l.controller.Informer().GetIndexer().GetByKey(key) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(schema.GroupResource{ - Group: MultiClusterAppRevisionGroupVersionKind.Group, - Resource: MultiClusterAppRevisionGroupVersionResource.Resource, - }, key) - } - return obj.(*MultiClusterAppRevision), nil -} - -type multiClusterAppRevisionController struct { - controller.GenericController -} - -func (c *multiClusterAppRevisionController) Generic() controller.GenericController { - return c.GenericController -} - -func (c *multiClusterAppRevisionController) Lister() MultiClusterAppRevisionLister { - return &multiClusterAppRevisionLister{ - controller: c, - } -} - -func (c *multiClusterAppRevisionController) AddHandler(ctx context.Context, name string, handler MultiClusterAppRevisionHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*MultiClusterAppRevision); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *multiClusterAppRevisionController) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, handler MultiClusterAppRevisionHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*MultiClusterAppRevision); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *multiClusterAppRevisionController) AddClusterScopedHandler(ctx context.Context, name, cluster string, handler MultiClusterAppRevisionHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*MultiClusterAppRevision); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *multiClusterAppRevisionController) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, cluster string, handler MultiClusterAppRevisionHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*MultiClusterAppRevision); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -type multiClusterAppRevisionFactory struct { -} - -func (c multiClusterAppRevisionFactory) Object() runtime.Object { - return &MultiClusterAppRevision{} -} - -func (c multiClusterAppRevisionFactory) List() runtime.Object { - return &MultiClusterAppRevisionList{} -} - -func (s *multiClusterAppRevisionClient) Controller() MultiClusterAppRevisionController { - genericController := controller.NewGenericController(MultiClusterAppRevisionGroupVersionKind.Kind+"Controller", - s.client.controllerFactory.ForResourceKind(MultiClusterAppRevisionGroupVersionResource, MultiClusterAppRevisionGroupVersionKind.Kind, true)) - - return &multiClusterAppRevisionController{ - GenericController: genericController, - } -} - -type multiClusterAppRevisionClient struct { - client *Client - ns string - objectClient *objectclient.ObjectClient - controller MultiClusterAppRevisionController -} - -func (s *multiClusterAppRevisionClient) ObjectClient() *objectclient.ObjectClient { - return s.objectClient -} - -func (s *multiClusterAppRevisionClient) Create(o *MultiClusterAppRevision) (*MultiClusterAppRevision, error) { - obj, err := s.objectClient.Create(o) - return obj.(*MultiClusterAppRevision), err -} - -func (s *multiClusterAppRevisionClient) Get(name string, opts metav1.GetOptions) (*MultiClusterAppRevision, error) { - obj, err := s.objectClient.Get(name, opts) - return obj.(*MultiClusterAppRevision), err -} - -func (s *multiClusterAppRevisionClient) GetNamespaced(namespace, name string, opts metav1.GetOptions) (*MultiClusterAppRevision, error) { - obj, err := s.objectClient.GetNamespaced(namespace, name, opts) - return obj.(*MultiClusterAppRevision), err -} - -func (s *multiClusterAppRevisionClient) Update(o *MultiClusterAppRevision) (*MultiClusterAppRevision, error) { - obj, err := s.objectClient.Update(o.Name, o) - return obj.(*MultiClusterAppRevision), err -} - -func (s *multiClusterAppRevisionClient) UpdateStatus(o *MultiClusterAppRevision) (*MultiClusterAppRevision, error) { - obj, err := s.objectClient.UpdateStatus(o.Name, o) - return obj.(*MultiClusterAppRevision), err -} - -func (s *multiClusterAppRevisionClient) Delete(name string, options *metav1.DeleteOptions) error { - return s.objectClient.Delete(name, options) -} - -func (s *multiClusterAppRevisionClient) DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error { - return s.objectClient.DeleteNamespaced(namespace, name, options) -} - -func (s *multiClusterAppRevisionClient) List(opts metav1.ListOptions) (*MultiClusterAppRevisionList, error) { - obj, err := s.objectClient.List(opts) - return obj.(*MultiClusterAppRevisionList), err -} - -func (s *multiClusterAppRevisionClient) ListNamespaced(namespace string, opts metav1.ListOptions) (*MultiClusterAppRevisionList, error) { - obj, err := s.objectClient.ListNamespaced(namespace, opts) - return obj.(*MultiClusterAppRevisionList), err -} - -func (s *multiClusterAppRevisionClient) Watch(opts metav1.ListOptions) (watch.Interface, error) { - return s.objectClient.Watch(opts) -} - -// Patch applies the patch and returns the patched deployment. -func (s *multiClusterAppRevisionClient) Patch(o *MultiClusterAppRevision, patchType types.PatchType, data []byte, subresources ...string) (*MultiClusterAppRevision, error) { - obj, err := s.objectClient.Patch(o.Name, o, patchType, data, subresources...) - return obj.(*MultiClusterAppRevision), err -} - -func (s *multiClusterAppRevisionClient) DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error { - return s.objectClient.DeleteCollection(deleteOpts, listOpts) -} - -func (s *multiClusterAppRevisionClient) AddHandler(ctx context.Context, name string, sync MultiClusterAppRevisionHandlerFunc) { - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *multiClusterAppRevisionClient) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync MultiClusterAppRevisionHandlerFunc) { - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *multiClusterAppRevisionClient) AddLifecycle(ctx context.Context, name string, lifecycle MultiClusterAppRevisionLifecycle) { - sync := NewMultiClusterAppRevisionLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *multiClusterAppRevisionClient) AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle MultiClusterAppRevisionLifecycle) { - sync := NewMultiClusterAppRevisionLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *multiClusterAppRevisionClient) AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync MultiClusterAppRevisionHandlerFunc) { - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *multiClusterAppRevisionClient) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync MultiClusterAppRevisionHandlerFunc) { - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} - -func (s *multiClusterAppRevisionClient) AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle MultiClusterAppRevisionLifecycle) { - sync := NewMultiClusterAppRevisionLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *multiClusterAppRevisionClient) AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle MultiClusterAppRevisionLifecycle) { - sync := NewMultiClusterAppRevisionLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_multi_cluster_app_revision_lifecycle_adapter.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_multi_cluster_app_revision_lifecycle_adapter.go deleted file mode 100644 index 2f76c86b..00000000 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_multi_cluster_app_revision_lifecycle_adapter.go +++ /dev/null @@ -1,66 +0,0 @@ -package v3 - -import ( - "github.com/rancher/norman/lifecycle" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/runtime" -) - -type MultiClusterAppRevisionLifecycle interface { - Create(obj *MultiClusterAppRevision) (runtime.Object, error) - Remove(obj *MultiClusterAppRevision) (runtime.Object, error) - Updated(obj *MultiClusterAppRevision) (runtime.Object, error) -} - -type multiClusterAppRevisionLifecycleAdapter struct { - lifecycle MultiClusterAppRevisionLifecycle -} - -func (w *multiClusterAppRevisionLifecycleAdapter) HasCreate() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasCreate() -} - -func (w *multiClusterAppRevisionLifecycleAdapter) HasFinalize() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasFinalize() -} - -func (w *multiClusterAppRevisionLifecycleAdapter) Create(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Create(obj.(*MultiClusterAppRevision)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *multiClusterAppRevisionLifecycleAdapter) Finalize(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Remove(obj.(*MultiClusterAppRevision)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *multiClusterAppRevisionLifecycleAdapter) Updated(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Updated(obj.(*MultiClusterAppRevision)) - if o == nil { - return nil, err - } - return o, err -} - -func NewMultiClusterAppRevisionLifecycleAdapter(name string, clusterScoped bool, client MultiClusterAppRevisionInterface, l MultiClusterAppRevisionLifecycle) MultiClusterAppRevisionHandlerFunc { - if clusterScoped { - resource.PutClusterScoped(MultiClusterAppRevisionGroupVersionResource) - } - adapter := &multiClusterAppRevisionLifecycleAdapter{lifecycle: l} - syncFn := lifecycle.NewObjectLifecycleAdapter(name, clusterScoped, adapter, client.ObjectClient()) - return func(key string, obj *MultiClusterAppRevision) (runtime.Object, error) { - newObj, err := syncFn(key, obj) - if o, ok := newObj.(runtime.Object); ok { - return o, err - } - return nil, err - } -} diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_node_controller.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_node_controller.go deleted file mode 100644 index 7912234f..00000000 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_node_controller.go +++ /dev/null @@ -1,321 +0,0 @@ -package v3 - -import ( - "context" - "time" - - "github.com/rancher/norman/controller" - "github.com/rancher/norman/objectclient" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/apimachinery/pkg/types" - "k8s.io/apimachinery/pkg/watch" - "k8s.io/client-go/tools/cache" -) - -var ( - NodeGroupVersionKind = schema.GroupVersionKind{ - Version: Version, - Group: GroupName, - Kind: "Node", - } - NodeResource = metav1.APIResource{ - Name: "nodes", - SingularName: "node", - Namespaced: true, - - Kind: NodeGroupVersionKind.Kind, - } - - NodeGroupVersionResource = schema.GroupVersionResource{ - Group: GroupName, - Version: Version, - Resource: "nodes", - } -) - -func init() { - resource.Put(NodeGroupVersionResource) -} - -func NewNode(namespace, name string, obj Node) *Node { - obj.APIVersion, obj.Kind = NodeGroupVersionKind.ToAPIVersionAndKind() - obj.Name = name - obj.Namespace = namespace - return &obj -} - -type NodeList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []Node `json:"items"` -} - -type NodeHandlerFunc func(key string, obj *Node) (runtime.Object, error) - -type NodeChangeHandlerFunc func(obj *Node) (runtime.Object, error) - -type NodeLister interface { - List(namespace string, selector labels.Selector) (ret []*Node, err error) - Get(namespace, name string) (*Node, error) -} - -type NodeController interface { - Generic() controller.GenericController - Informer() cache.SharedIndexInformer - Lister() NodeLister - AddHandler(ctx context.Context, name string, handler NodeHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync NodeHandlerFunc) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, handler NodeHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, handler NodeHandlerFunc) - Enqueue(namespace, name string) - EnqueueAfter(namespace, name string, after time.Duration) -} - -type NodeInterface interface { - ObjectClient() *objectclient.ObjectClient - Create(*Node) (*Node, error) - GetNamespaced(namespace, name string, opts metav1.GetOptions) (*Node, error) - Get(name string, opts metav1.GetOptions) (*Node, error) - Update(*Node) (*Node, error) - Delete(name string, options *metav1.DeleteOptions) error - DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error - List(opts metav1.ListOptions) (*NodeList, error) - ListNamespaced(namespace string, opts metav1.ListOptions) (*NodeList, error) - Watch(opts metav1.ListOptions) (watch.Interface, error) - DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error - Controller() NodeController - AddHandler(ctx context.Context, name string, sync NodeHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync NodeHandlerFunc) - AddLifecycle(ctx context.Context, name string, lifecycle NodeLifecycle) - AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle NodeLifecycle) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync NodeHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync NodeHandlerFunc) - AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle NodeLifecycle) - AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle NodeLifecycle) -} - -type nodeLister struct { - controller *nodeController -} - -func (l *nodeLister) List(namespace string, selector labels.Selector) (ret []*Node, err error) { - err = cache.ListAllByNamespace(l.controller.Informer().GetIndexer(), namespace, selector, func(obj interface{}) { - ret = append(ret, obj.(*Node)) - }) - return -} - -func (l *nodeLister) Get(namespace, name string) (*Node, error) { - var key string - if namespace != "" { - key = namespace + "/" + name - } else { - key = name - } - obj, exists, err := l.controller.Informer().GetIndexer().GetByKey(key) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(schema.GroupResource{ - Group: NodeGroupVersionKind.Group, - Resource: NodeGroupVersionResource.Resource, - }, key) - } - return obj.(*Node), nil -} - -type nodeController struct { - controller.GenericController -} - -func (c *nodeController) Generic() controller.GenericController { - return c.GenericController -} - -func (c *nodeController) Lister() NodeLister { - return &nodeLister{ - controller: c, - } -} - -func (c *nodeController) AddHandler(ctx context.Context, name string, handler NodeHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*Node); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *nodeController) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, handler NodeHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*Node); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *nodeController) AddClusterScopedHandler(ctx context.Context, name, cluster string, handler NodeHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*Node); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *nodeController) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, cluster string, handler NodeHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*Node); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -type nodeFactory struct { -} - -func (c nodeFactory) Object() runtime.Object { - return &Node{} -} - -func (c nodeFactory) List() runtime.Object { - return &NodeList{} -} - -func (s *nodeClient) Controller() NodeController { - genericController := controller.NewGenericController(NodeGroupVersionKind.Kind+"Controller", - s.client.controllerFactory.ForResourceKind(NodeGroupVersionResource, NodeGroupVersionKind.Kind, true)) - - return &nodeController{ - GenericController: genericController, - } -} - -type nodeClient struct { - client *Client - ns string - objectClient *objectclient.ObjectClient - controller NodeController -} - -func (s *nodeClient) ObjectClient() *objectclient.ObjectClient { - return s.objectClient -} - -func (s *nodeClient) Create(o *Node) (*Node, error) { - obj, err := s.objectClient.Create(o) - return obj.(*Node), err -} - -func (s *nodeClient) Get(name string, opts metav1.GetOptions) (*Node, error) { - obj, err := s.objectClient.Get(name, opts) - return obj.(*Node), err -} - -func (s *nodeClient) GetNamespaced(namespace, name string, opts metav1.GetOptions) (*Node, error) { - obj, err := s.objectClient.GetNamespaced(namespace, name, opts) - return obj.(*Node), err -} - -func (s *nodeClient) Update(o *Node) (*Node, error) { - obj, err := s.objectClient.Update(o.Name, o) - return obj.(*Node), err -} - -func (s *nodeClient) UpdateStatus(o *Node) (*Node, error) { - obj, err := s.objectClient.UpdateStatus(o.Name, o) - return obj.(*Node), err -} - -func (s *nodeClient) Delete(name string, options *metav1.DeleteOptions) error { - return s.objectClient.Delete(name, options) -} - -func (s *nodeClient) DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error { - return s.objectClient.DeleteNamespaced(namespace, name, options) -} - -func (s *nodeClient) List(opts metav1.ListOptions) (*NodeList, error) { - obj, err := s.objectClient.List(opts) - return obj.(*NodeList), err -} - -func (s *nodeClient) ListNamespaced(namespace string, opts metav1.ListOptions) (*NodeList, error) { - obj, err := s.objectClient.ListNamespaced(namespace, opts) - return obj.(*NodeList), err -} - -func (s *nodeClient) Watch(opts metav1.ListOptions) (watch.Interface, error) { - return s.objectClient.Watch(opts) -} - -// Patch applies the patch and returns the patched deployment. -func (s *nodeClient) Patch(o *Node, patchType types.PatchType, data []byte, subresources ...string) (*Node, error) { - obj, err := s.objectClient.Patch(o.Name, o, patchType, data, subresources...) - return obj.(*Node), err -} - -func (s *nodeClient) DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error { - return s.objectClient.DeleteCollection(deleteOpts, listOpts) -} - -func (s *nodeClient) AddHandler(ctx context.Context, name string, sync NodeHandlerFunc) { - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *nodeClient) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync NodeHandlerFunc) { - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *nodeClient) AddLifecycle(ctx context.Context, name string, lifecycle NodeLifecycle) { - sync := NewNodeLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *nodeClient) AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle NodeLifecycle) { - sync := NewNodeLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *nodeClient) AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync NodeHandlerFunc) { - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *nodeClient) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync NodeHandlerFunc) { - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} - -func (s *nodeClient) AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle NodeLifecycle) { - sync := NewNodeLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *nodeClient) AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle NodeLifecycle) { - sync := NewNodeLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_node_driver_controller.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_node_driver_controller.go deleted file mode 100644 index 41721533..00000000 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_node_driver_controller.go +++ /dev/null @@ -1,320 +0,0 @@ -package v3 - -import ( - "context" - "time" - - "github.com/rancher/norman/controller" - "github.com/rancher/norman/objectclient" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/apimachinery/pkg/types" - "k8s.io/apimachinery/pkg/watch" - "k8s.io/client-go/tools/cache" -) - -var ( - NodeDriverGroupVersionKind = schema.GroupVersionKind{ - Version: Version, - Group: GroupName, - Kind: "NodeDriver", - } - NodeDriverResource = metav1.APIResource{ - Name: "nodedrivers", - SingularName: "nodedriver", - Namespaced: false, - Kind: NodeDriverGroupVersionKind.Kind, - } - - NodeDriverGroupVersionResource = schema.GroupVersionResource{ - Group: GroupName, - Version: Version, - Resource: "nodedrivers", - } -) - -func init() { - resource.Put(NodeDriverGroupVersionResource) -} - -func NewNodeDriver(namespace, name string, obj NodeDriver) *NodeDriver { - obj.APIVersion, obj.Kind = NodeDriverGroupVersionKind.ToAPIVersionAndKind() - obj.Name = name - obj.Namespace = namespace - return &obj -} - -type NodeDriverList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []NodeDriver `json:"items"` -} - -type NodeDriverHandlerFunc func(key string, obj *NodeDriver) (runtime.Object, error) - -type NodeDriverChangeHandlerFunc func(obj *NodeDriver) (runtime.Object, error) - -type NodeDriverLister interface { - List(namespace string, selector labels.Selector) (ret []*NodeDriver, err error) - Get(namespace, name string) (*NodeDriver, error) -} - -type NodeDriverController interface { - Generic() controller.GenericController - Informer() cache.SharedIndexInformer - Lister() NodeDriverLister - AddHandler(ctx context.Context, name string, handler NodeDriverHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync NodeDriverHandlerFunc) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, handler NodeDriverHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, handler NodeDriverHandlerFunc) - Enqueue(namespace, name string) - EnqueueAfter(namespace, name string, after time.Duration) -} - -type NodeDriverInterface interface { - ObjectClient() *objectclient.ObjectClient - Create(*NodeDriver) (*NodeDriver, error) - GetNamespaced(namespace, name string, opts metav1.GetOptions) (*NodeDriver, error) - Get(name string, opts metav1.GetOptions) (*NodeDriver, error) - Update(*NodeDriver) (*NodeDriver, error) - Delete(name string, options *metav1.DeleteOptions) error - DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error - List(opts metav1.ListOptions) (*NodeDriverList, error) - ListNamespaced(namespace string, opts metav1.ListOptions) (*NodeDriverList, error) - Watch(opts metav1.ListOptions) (watch.Interface, error) - DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error - Controller() NodeDriverController - AddHandler(ctx context.Context, name string, sync NodeDriverHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync NodeDriverHandlerFunc) - AddLifecycle(ctx context.Context, name string, lifecycle NodeDriverLifecycle) - AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle NodeDriverLifecycle) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync NodeDriverHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync NodeDriverHandlerFunc) - AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle NodeDriverLifecycle) - AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle NodeDriverLifecycle) -} - -type nodeDriverLister struct { - controller *nodeDriverController -} - -func (l *nodeDriverLister) List(namespace string, selector labels.Selector) (ret []*NodeDriver, err error) { - err = cache.ListAllByNamespace(l.controller.Informer().GetIndexer(), namespace, selector, func(obj interface{}) { - ret = append(ret, obj.(*NodeDriver)) - }) - return -} - -func (l *nodeDriverLister) Get(namespace, name string) (*NodeDriver, error) { - var key string - if namespace != "" { - key = namespace + "/" + name - } else { - key = name - } - obj, exists, err := l.controller.Informer().GetIndexer().GetByKey(key) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(schema.GroupResource{ - Group: NodeDriverGroupVersionKind.Group, - Resource: NodeDriverGroupVersionResource.Resource, - }, key) - } - return obj.(*NodeDriver), nil -} - -type nodeDriverController struct { - controller.GenericController -} - -func (c *nodeDriverController) Generic() controller.GenericController { - return c.GenericController -} - -func (c *nodeDriverController) Lister() NodeDriverLister { - return &nodeDriverLister{ - controller: c, - } -} - -func (c *nodeDriverController) AddHandler(ctx context.Context, name string, handler NodeDriverHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*NodeDriver); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *nodeDriverController) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, handler NodeDriverHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*NodeDriver); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *nodeDriverController) AddClusterScopedHandler(ctx context.Context, name, cluster string, handler NodeDriverHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*NodeDriver); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *nodeDriverController) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, cluster string, handler NodeDriverHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*NodeDriver); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -type nodeDriverFactory struct { -} - -func (c nodeDriverFactory) Object() runtime.Object { - return &NodeDriver{} -} - -func (c nodeDriverFactory) List() runtime.Object { - return &NodeDriverList{} -} - -func (s *nodeDriverClient) Controller() NodeDriverController { - genericController := controller.NewGenericController(NodeDriverGroupVersionKind.Kind+"Controller", - s.client.controllerFactory.ForResourceKind(NodeDriverGroupVersionResource, NodeDriverGroupVersionKind.Kind, false)) - - return &nodeDriverController{ - GenericController: genericController, - } -} - -type nodeDriverClient struct { - client *Client - ns string - objectClient *objectclient.ObjectClient - controller NodeDriverController -} - -func (s *nodeDriverClient) ObjectClient() *objectclient.ObjectClient { - return s.objectClient -} - -func (s *nodeDriverClient) Create(o *NodeDriver) (*NodeDriver, error) { - obj, err := s.objectClient.Create(o) - return obj.(*NodeDriver), err -} - -func (s *nodeDriverClient) Get(name string, opts metav1.GetOptions) (*NodeDriver, error) { - obj, err := s.objectClient.Get(name, opts) - return obj.(*NodeDriver), err -} - -func (s *nodeDriverClient) GetNamespaced(namespace, name string, opts metav1.GetOptions) (*NodeDriver, error) { - obj, err := s.objectClient.GetNamespaced(namespace, name, opts) - return obj.(*NodeDriver), err -} - -func (s *nodeDriverClient) Update(o *NodeDriver) (*NodeDriver, error) { - obj, err := s.objectClient.Update(o.Name, o) - return obj.(*NodeDriver), err -} - -func (s *nodeDriverClient) UpdateStatus(o *NodeDriver) (*NodeDriver, error) { - obj, err := s.objectClient.UpdateStatus(o.Name, o) - return obj.(*NodeDriver), err -} - -func (s *nodeDriverClient) Delete(name string, options *metav1.DeleteOptions) error { - return s.objectClient.Delete(name, options) -} - -func (s *nodeDriverClient) DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error { - return s.objectClient.DeleteNamespaced(namespace, name, options) -} - -func (s *nodeDriverClient) List(opts metav1.ListOptions) (*NodeDriverList, error) { - obj, err := s.objectClient.List(opts) - return obj.(*NodeDriverList), err -} - -func (s *nodeDriverClient) ListNamespaced(namespace string, opts metav1.ListOptions) (*NodeDriverList, error) { - obj, err := s.objectClient.ListNamespaced(namespace, opts) - return obj.(*NodeDriverList), err -} - -func (s *nodeDriverClient) Watch(opts metav1.ListOptions) (watch.Interface, error) { - return s.objectClient.Watch(opts) -} - -// Patch applies the patch and returns the patched deployment. -func (s *nodeDriverClient) Patch(o *NodeDriver, patchType types.PatchType, data []byte, subresources ...string) (*NodeDriver, error) { - obj, err := s.objectClient.Patch(o.Name, o, patchType, data, subresources...) - return obj.(*NodeDriver), err -} - -func (s *nodeDriverClient) DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error { - return s.objectClient.DeleteCollection(deleteOpts, listOpts) -} - -func (s *nodeDriverClient) AddHandler(ctx context.Context, name string, sync NodeDriverHandlerFunc) { - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *nodeDriverClient) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync NodeDriverHandlerFunc) { - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *nodeDriverClient) AddLifecycle(ctx context.Context, name string, lifecycle NodeDriverLifecycle) { - sync := NewNodeDriverLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *nodeDriverClient) AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle NodeDriverLifecycle) { - sync := NewNodeDriverLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *nodeDriverClient) AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync NodeDriverHandlerFunc) { - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *nodeDriverClient) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync NodeDriverHandlerFunc) { - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} - -func (s *nodeDriverClient) AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle NodeDriverLifecycle) { - sync := NewNodeDriverLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *nodeDriverClient) AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle NodeDriverLifecycle) { - sync := NewNodeDriverLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_node_driver_lifecycle_adapter.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_node_driver_lifecycle_adapter.go deleted file mode 100644 index 4d0b2fd0..00000000 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_node_driver_lifecycle_adapter.go +++ /dev/null @@ -1,66 +0,0 @@ -package v3 - -import ( - "github.com/rancher/norman/lifecycle" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/runtime" -) - -type NodeDriverLifecycle interface { - Create(obj *NodeDriver) (runtime.Object, error) - Remove(obj *NodeDriver) (runtime.Object, error) - Updated(obj *NodeDriver) (runtime.Object, error) -} - -type nodeDriverLifecycleAdapter struct { - lifecycle NodeDriverLifecycle -} - -func (w *nodeDriverLifecycleAdapter) HasCreate() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasCreate() -} - -func (w *nodeDriverLifecycleAdapter) HasFinalize() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasFinalize() -} - -func (w *nodeDriverLifecycleAdapter) Create(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Create(obj.(*NodeDriver)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *nodeDriverLifecycleAdapter) Finalize(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Remove(obj.(*NodeDriver)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *nodeDriverLifecycleAdapter) Updated(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Updated(obj.(*NodeDriver)) - if o == nil { - return nil, err - } - return o, err -} - -func NewNodeDriverLifecycleAdapter(name string, clusterScoped bool, client NodeDriverInterface, l NodeDriverLifecycle) NodeDriverHandlerFunc { - if clusterScoped { - resource.PutClusterScoped(NodeDriverGroupVersionResource) - } - adapter := &nodeDriverLifecycleAdapter{lifecycle: l} - syncFn := lifecycle.NewObjectLifecycleAdapter(name, clusterScoped, adapter, client.ObjectClient()) - return func(key string, obj *NodeDriver) (runtime.Object, error) { - newObj, err := syncFn(key, obj) - if o, ok := newObj.(runtime.Object); ok { - return o, err - } - return nil, err - } -} diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_node_lifecycle_adapter.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_node_lifecycle_adapter.go deleted file mode 100644 index 285dd478..00000000 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_node_lifecycle_adapter.go +++ /dev/null @@ -1,66 +0,0 @@ -package v3 - -import ( - "github.com/rancher/norman/lifecycle" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/runtime" -) - -type NodeLifecycle interface { - Create(obj *Node) (runtime.Object, error) - Remove(obj *Node) (runtime.Object, error) - Updated(obj *Node) (runtime.Object, error) -} - -type nodeLifecycleAdapter struct { - lifecycle NodeLifecycle -} - -func (w *nodeLifecycleAdapter) HasCreate() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasCreate() -} - -func (w *nodeLifecycleAdapter) HasFinalize() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasFinalize() -} - -func (w *nodeLifecycleAdapter) Create(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Create(obj.(*Node)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *nodeLifecycleAdapter) Finalize(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Remove(obj.(*Node)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *nodeLifecycleAdapter) Updated(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Updated(obj.(*Node)) - if o == nil { - return nil, err - } - return o, err -} - -func NewNodeLifecycleAdapter(name string, clusterScoped bool, client NodeInterface, l NodeLifecycle) NodeHandlerFunc { - if clusterScoped { - resource.PutClusterScoped(NodeGroupVersionResource) - } - adapter := &nodeLifecycleAdapter{lifecycle: l} - syncFn := lifecycle.NewObjectLifecycleAdapter(name, clusterScoped, adapter, client.ObjectClient()) - return func(key string, obj *Node) (runtime.Object, error) { - newObj, err := syncFn(key, obj) - if o, ok := newObj.(runtime.Object); ok { - return o, err - } - return nil, err - } -} diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_node_pool_controller.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_node_pool_controller.go deleted file mode 100644 index 4e5a16fa..00000000 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_node_pool_controller.go +++ /dev/null @@ -1,321 +0,0 @@ -package v3 - -import ( - "context" - "time" - - "github.com/rancher/norman/controller" - "github.com/rancher/norman/objectclient" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/apimachinery/pkg/types" - "k8s.io/apimachinery/pkg/watch" - "k8s.io/client-go/tools/cache" -) - -var ( - NodePoolGroupVersionKind = schema.GroupVersionKind{ - Version: Version, - Group: GroupName, - Kind: "NodePool", - } - NodePoolResource = metav1.APIResource{ - Name: "nodepools", - SingularName: "nodepool", - Namespaced: true, - - Kind: NodePoolGroupVersionKind.Kind, - } - - NodePoolGroupVersionResource = schema.GroupVersionResource{ - Group: GroupName, - Version: Version, - Resource: "nodepools", - } -) - -func init() { - resource.Put(NodePoolGroupVersionResource) -} - -func NewNodePool(namespace, name string, obj NodePool) *NodePool { - obj.APIVersion, obj.Kind = NodePoolGroupVersionKind.ToAPIVersionAndKind() - obj.Name = name - obj.Namespace = namespace - return &obj -} - -type NodePoolList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []NodePool `json:"items"` -} - -type NodePoolHandlerFunc func(key string, obj *NodePool) (runtime.Object, error) - -type NodePoolChangeHandlerFunc func(obj *NodePool) (runtime.Object, error) - -type NodePoolLister interface { - List(namespace string, selector labels.Selector) (ret []*NodePool, err error) - Get(namespace, name string) (*NodePool, error) -} - -type NodePoolController interface { - Generic() controller.GenericController - Informer() cache.SharedIndexInformer - Lister() NodePoolLister - AddHandler(ctx context.Context, name string, handler NodePoolHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync NodePoolHandlerFunc) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, handler NodePoolHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, handler NodePoolHandlerFunc) - Enqueue(namespace, name string) - EnqueueAfter(namespace, name string, after time.Duration) -} - -type NodePoolInterface interface { - ObjectClient() *objectclient.ObjectClient - Create(*NodePool) (*NodePool, error) - GetNamespaced(namespace, name string, opts metav1.GetOptions) (*NodePool, error) - Get(name string, opts metav1.GetOptions) (*NodePool, error) - Update(*NodePool) (*NodePool, error) - Delete(name string, options *metav1.DeleteOptions) error - DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error - List(opts metav1.ListOptions) (*NodePoolList, error) - ListNamespaced(namespace string, opts metav1.ListOptions) (*NodePoolList, error) - Watch(opts metav1.ListOptions) (watch.Interface, error) - DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error - Controller() NodePoolController - AddHandler(ctx context.Context, name string, sync NodePoolHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync NodePoolHandlerFunc) - AddLifecycle(ctx context.Context, name string, lifecycle NodePoolLifecycle) - AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle NodePoolLifecycle) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync NodePoolHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync NodePoolHandlerFunc) - AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle NodePoolLifecycle) - AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle NodePoolLifecycle) -} - -type nodePoolLister struct { - controller *nodePoolController -} - -func (l *nodePoolLister) List(namespace string, selector labels.Selector) (ret []*NodePool, err error) { - err = cache.ListAllByNamespace(l.controller.Informer().GetIndexer(), namespace, selector, func(obj interface{}) { - ret = append(ret, obj.(*NodePool)) - }) - return -} - -func (l *nodePoolLister) Get(namespace, name string) (*NodePool, error) { - var key string - if namespace != "" { - key = namespace + "/" + name - } else { - key = name - } - obj, exists, err := l.controller.Informer().GetIndexer().GetByKey(key) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(schema.GroupResource{ - Group: NodePoolGroupVersionKind.Group, - Resource: NodePoolGroupVersionResource.Resource, - }, key) - } - return obj.(*NodePool), nil -} - -type nodePoolController struct { - controller.GenericController -} - -func (c *nodePoolController) Generic() controller.GenericController { - return c.GenericController -} - -func (c *nodePoolController) Lister() NodePoolLister { - return &nodePoolLister{ - controller: c, - } -} - -func (c *nodePoolController) AddHandler(ctx context.Context, name string, handler NodePoolHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*NodePool); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *nodePoolController) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, handler NodePoolHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*NodePool); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *nodePoolController) AddClusterScopedHandler(ctx context.Context, name, cluster string, handler NodePoolHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*NodePool); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *nodePoolController) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, cluster string, handler NodePoolHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*NodePool); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -type nodePoolFactory struct { -} - -func (c nodePoolFactory) Object() runtime.Object { - return &NodePool{} -} - -func (c nodePoolFactory) List() runtime.Object { - return &NodePoolList{} -} - -func (s *nodePoolClient) Controller() NodePoolController { - genericController := controller.NewGenericController(NodePoolGroupVersionKind.Kind+"Controller", - s.client.controllerFactory.ForResourceKind(NodePoolGroupVersionResource, NodePoolGroupVersionKind.Kind, true)) - - return &nodePoolController{ - GenericController: genericController, - } -} - -type nodePoolClient struct { - client *Client - ns string - objectClient *objectclient.ObjectClient - controller NodePoolController -} - -func (s *nodePoolClient) ObjectClient() *objectclient.ObjectClient { - return s.objectClient -} - -func (s *nodePoolClient) Create(o *NodePool) (*NodePool, error) { - obj, err := s.objectClient.Create(o) - return obj.(*NodePool), err -} - -func (s *nodePoolClient) Get(name string, opts metav1.GetOptions) (*NodePool, error) { - obj, err := s.objectClient.Get(name, opts) - return obj.(*NodePool), err -} - -func (s *nodePoolClient) GetNamespaced(namespace, name string, opts metav1.GetOptions) (*NodePool, error) { - obj, err := s.objectClient.GetNamespaced(namespace, name, opts) - return obj.(*NodePool), err -} - -func (s *nodePoolClient) Update(o *NodePool) (*NodePool, error) { - obj, err := s.objectClient.Update(o.Name, o) - return obj.(*NodePool), err -} - -func (s *nodePoolClient) UpdateStatus(o *NodePool) (*NodePool, error) { - obj, err := s.objectClient.UpdateStatus(o.Name, o) - return obj.(*NodePool), err -} - -func (s *nodePoolClient) Delete(name string, options *metav1.DeleteOptions) error { - return s.objectClient.Delete(name, options) -} - -func (s *nodePoolClient) DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error { - return s.objectClient.DeleteNamespaced(namespace, name, options) -} - -func (s *nodePoolClient) List(opts metav1.ListOptions) (*NodePoolList, error) { - obj, err := s.objectClient.List(opts) - return obj.(*NodePoolList), err -} - -func (s *nodePoolClient) ListNamespaced(namespace string, opts metav1.ListOptions) (*NodePoolList, error) { - obj, err := s.objectClient.ListNamespaced(namespace, opts) - return obj.(*NodePoolList), err -} - -func (s *nodePoolClient) Watch(opts metav1.ListOptions) (watch.Interface, error) { - return s.objectClient.Watch(opts) -} - -// Patch applies the patch and returns the patched deployment. -func (s *nodePoolClient) Patch(o *NodePool, patchType types.PatchType, data []byte, subresources ...string) (*NodePool, error) { - obj, err := s.objectClient.Patch(o.Name, o, patchType, data, subresources...) - return obj.(*NodePool), err -} - -func (s *nodePoolClient) DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error { - return s.objectClient.DeleteCollection(deleteOpts, listOpts) -} - -func (s *nodePoolClient) AddHandler(ctx context.Context, name string, sync NodePoolHandlerFunc) { - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *nodePoolClient) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync NodePoolHandlerFunc) { - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *nodePoolClient) AddLifecycle(ctx context.Context, name string, lifecycle NodePoolLifecycle) { - sync := NewNodePoolLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *nodePoolClient) AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle NodePoolLifecycle) { - sync := NewNodePoolLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *nodePoolClient) AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync NodePoolHandlerFunc) { - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *nodePoolClient) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync NodePoolHandlerFunc) { - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} - -func (s *nodePoolClient) AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle NodePoolLifecycle) { - sync := NewNodePoolLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *nodePoolClient) AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle NodePoolLifecycle) { - sync := NewNodePoolLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_node_pool_lifecycle_adapter.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_node_pool_lifecycle_adapter.go deleted file mode 100644 index d9e2a3b9..00000000 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_node_pool_lifecycle_adapter.go +++ /dev/null @@ -1,66 +0,0 @@ -package v3 - -import ( - "github.com/rancher/norman/lifecycle" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/runtime" -) - -type NodePoolLifecycle interface { - Create(obj *NodePool) (runtime.Object, error) - Remove(obj *NodePool) (runtime.Object, error) - Updated(obj *NodePool) (runtime.Object, error) -} - -type nodePoolLifecycleAdapter struct { - lifecycle NodePoolLifecycle -} - -func (w *nodePoolLifecycleAdapter) HasCreate() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasCreate() -} - -func (w *nodePoolLifecycleAdapter) HasFinalize() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasFinalize() -} - -func (w *nodePoolLifecycleAdapter) Create(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Create(obj.(*NodePool)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *nodePoolLifecycleAdapter) Finalize(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Remove(obj.(*NodePool)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *nodePoolLifecycleAdapter) Updated(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Updated(obj.(*NodePool)) - if o == nil { - return nil, err - } - return o, err -} - -func NewNodePoolLifecycleAdapter(name string, clusterScoped bool, client NodePoolInterface, l NodePoolLifecycle) NodePoolHandlerFunc { - if clusterScoped { - resource.PutClusterScoped(NodePoolGroupVersionResource) - } - adapter := &nodePoolLifecycleAdapter{lifecycle: l} - syncFn := lifecycle.NewObjectLifecycleAdapter(name, clusterScoped, adapter, client.ObjectClient()) - return func(key string, obj *NodePool) (runtime.Object, error) { - newObj, err := syncFn(key, obj) - if o, ok := newObj.(runtime.Object); ok { - return o, err - } - return nil, err - } -} diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_node_template_controller.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_node_template_controller.go deleted file mode 100644 index d3df689b..00000000 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_node_template_controller.go +++ /dev/null @@ -1,321 +0,0 @@ -package v3 - -import ( - "context" - "time" - - "github.com/rancher/norman/controller" - "github.com/rancher/norman/objectclient" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/apimachinery/pkg/types" - "k8s.io/apimachinery/pkg/watch" - "k8s.io/client-go/tools/cache" -) - -var ( - NodeTemplateGroupVersionKind = schema.GroupVersionKind{ - Version: Version, - Group: GroupName, - Kind: "NodeTemplate", - } - NodeTemplateResource = metav1.APIResource{ - Name: "nodetemplates", - SingularName: "nodetemplate", - Namespaced: true, - - Kind: NodeTemplateGroupVersionKind.Kind, - } - - NodeTemplateGroupVersionResource = schema.GroupVersionResource{ - Group: GroupName, - Version: Version, - Resource: "nodetemplates", - } -) - -func init() { - resource.Put(NodeTemplateGroupVersionResource) -} - -func NewNodeTemplate(namespace, name string, obj NodeTemplate) *NodeTemplate { - obj.APIVersion, obj.Kind = NodeTemplateGroupVersionKind.ToAPIVersionAndKind() - obj.Name = name - obj.Namespace = namespace - return &obj -} - -type NodeTemplateList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []NodeTemplate `json:"items"` -} - -type NodeTemplateHandlerFunc func(key string, obj *NodeTemplate) (runtime.Object, error) - -type NodeTemplateChangeHandlerFunc func(obj *NodeTemplate) (runtime.Object, error) - -type NodeTemplateLister interface { - List(namespace string, selector labels.Selector) (ret []*NodeTemplate, err error) - Get(namespace, name string) (*NodeTemplate, error) -} - -type NodeTemplateController interface { - Generic() controller.GenericController - Informer() cache.SharedIndexInformer - Lister() NodeTemplateLister - AddHandler(ctx context.Context, name string, handler NodeTemplateHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync NodeTemplateHandlerFunc) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, handler NodeTemplateHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, handler NodeTemplateHandlerFunc) - Enqueue(namespace, name string) - EnqueueAfter(namespace, name string, after time.Duration) -} - -type NodeTemplateInterface interface { - ObjectClient() *objectclient.ObjectClient - Create(*NodeTemplate) (*NodeTemplate, error) - GetNamespaced(namespace, name string, opts metav1.GetOptions) (*NodeTemplate, error) - Get(name string, opts metav1.GetOptions) (*NodeTemplate, error) - Update(*NodeTemplate) (*NodeTemplate, error) - Delete(name string, options *metav1.DeleteOptions) error - DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error - List(opts metav1.ListOptions) (*NodeTemplateList, error) - ListNamespaced(namespace string, opts metav1.ListOptions) (*NodeTemplateList, error) - Watch(opts metav1.ListOptions) (watch.Interface, error) - DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error - Controller() NodeTemplateController - AddHandler(ctx context.Context, name string, sync NodeTemplateHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync NodeTemplateHandlerFunc) - AddLifecycle(ctx context.Context, name string, lifecycle NodeTemplateLifecycle) - AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle NodeTemplateLifecycle) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync NodeTemplateHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync NodeTemplateHandlerFunc) - AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle NodeTemplateLifecycle) - AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle NodeTemplateLifecycle) -} - -type nodeTemplateLister struct { - controller *nodeTemplateController -} - -func (l *nodeTemplateLister) List(namespace string, selector labels.Selector) (ret []*NodeTemplate, err error) { - err = cache.ListAllByNamespace(l.controller.Informer().GetIndexer(), namespace, selector, func(obj interface{}) { - ret = append(ret, obj.(*NodeTemplate)) - }) - return -} - -func (l *nodeTemplateLister) Get(namespace, name string) (*NodeTemplate, error) { - var key string - if namespace != "" { - key = namespace + "/" + name - } else { - key = name - } - obj, exists, err := l.controller.Informer().GetIndexer().GetByKey(key) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(schema.GroupResource{ - Group: NodeTemplateGroupVersionKind.Group, - Resource: NodeTemplateGroupVersionResource.Resource, - }, key) - } - return obj.(*NodeTemplate), nil -} - -type nodeTemplateController struct { - controller.GenericController -} - -func (c *nodeTemplateController) Generic() controller.GenericController { - return c.GenericController -} - -func (c *nodeTemplateController) Lister() NodeTemplateLister { - return &nodeTemplateLister{ - controller: c, - } -} - -func (c *nodeTemplateController) AddHandler(ctx context.Context, name string, handler NodeTemplateHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*NodeTemplate); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *nodeTemplateController) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, handler NodeTemplateHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*NodeTemplate); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *nodeTemplateController) AddClusterScopedHandler(ctx context.Context, name, cluster string, handler NodeTemplateHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*NodeTemplate); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *nodeTemplateController) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, cluster string, handler NodeTemplateHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*NodeTemplate); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -type nodeTemplateFactory struct { -} - -func (c nodeTemplateFactory) Object() runtime.Object { - return &NodeTemplate{} -} - -func (c nodeTemplateFactory) List() runtime.Object { - return &NodeTemplateList{} -} - -func (s *nodeTemplateClient) Controller() NodeTemplateController { - genericController := controller.NewGenericController(NodeTemplateGroupVersionKind.Kind+"Controller", - s.client.controllerFactory.ForResourceKind(NodeTemplateGroupVersionResource, NodeTemplateGroupVersionKind.Kind, true)) - - return &nodeTemplateController{ - GenericController: genericController, - } -} - -type nodeTemplateClient struct { - client *Client - ns string - objectClient *objectclient.ObjectClient - controller NodeTemplateController -} - -func (s *nodeTemplateClient) ObjectClient() *objectclient.ObjectClient { - return s.objectClient -} - -func (s *nodeTemplateClient) Create(o *NodeTemplate) (*NodeTemplate, error) { - obj, err := s.objectClient.Create(o) - return obj.(*NodeTemplate), err -} - -func (s *nodeTemplateClient) Get(name string, opts metav1.GetOptions) (*NodeTemplate, error) { - obj, err := s.objectClient.Get(name, opts) - return obj.(*NodeTemplate), err -} - -func (s *nodeTemplateClient) GetNamespaced(namespace, name string, opts metav1.GetOptions) (*NodeTemplate, error) { - obj, err := s.objectClient.GetNamespaced(namespace, name, opts) - return obj.(*NodeTemplate), err -} - -func (s *nodeTemplateClient) Update(o *NodeTemplate) (*NodeTemplate, error) { - obj, err := s.objectClient.Update(o.Name, o) - return obj.(*NodeTemplate), err -} - -func (s *nodeTemplateClient) UpdateStatus(o *NodeTemplate) (*NodeTemplate, error) { - obj, err := s.objectClient.UpdateStatus(o.Name, o) - return obj.(*NodeTemplate), err -} - -func (s *nodeTemplateClient) Delete(name string, options *metav1.DeleteOptions) error { - return s.objectClient.Delete(name, options) -} - -func (s *nodeTemplateClient) DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error { - return s.objectClient.DeleteNamespaced(namespace, name, options) -} - -func (s *nodeTemplateClient) List(opts metav1.ListOptions) (*NodeTemplateList, error) { - obj, err := s.objectClient.List(opts) - return obj.(*NodeTemplateList), err -} - -func (s *nodeTemplateClient) ListNamespaced(namespace string, opts metav1.ListOptions) (*NodeTemplateList, error) { - obj, err := s.objectClient.ListNamespaced(namespace, opts) - return obj.(*NodeTemplateList), err -} - -func (s *nodeTemplateClient) Watch(opts metav1.ListOptions) (watch.Interface, error) { - return s.objectClient.Watch(opts) -} - -// Patch applies the patch and returns the patched deployment. -func (s *nodeTemplateClient) Patch(o *NodeTemplate, patchType types.PatchType, data []byte, subresources ...string) (*NodeTemplate, error) { - obj, err := s.objectClient.Patch(o.Name, o, patchType, data, subresources...) - return obj.(*NodeTemplate), err -} - -func (s *nodeTemplateClient) DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error { - return s.objectClient.DeleteCollection(deleteOpts, listOpts) -} - -func (s *nodeTemplateClient) AddHandler(ctx context.Context, name string, sync NodeTemplateHandlerFunc) { - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *nodeTemplateClient) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync NodeTemplateHandlerFunc) { - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *nodeTemplateClient) AddLifecycle(ctx context.Context, name string, lifecycle NodeTemplateLifecycle) { - sync := NewNodeTemplateLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *nodeTemplateClient) AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle NodeTemplateLifecycle) { - sync := NewNodeTemplateLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *nodeTemplateClient) AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync NodeTemplateHandlerFunc) { - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *nodeTemplateClient) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync NodeTemplateHandlerFunc) { - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} - -func (s *nodeTemplateClient) AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle NodeTemplateLifecycle) { - sync := NewNodeTemplateLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *nodeTemplateClient) AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle NodeTemplateLifecycle) { - sync := NewNodeTemplateLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_node_template_lifecycle_adapter.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_node_template_lifecycle_adapter.go deleted file mode 100644 index eedda074..00000000 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_node_template_lifecycle_adapter.go +++ /dev/null @@ -1,66 +0,0 @@ -package v3 - -import ( - "github.com/rancher/norman/lifecycle" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/runtime" -) - -type NodeTemplateLifecycle interface { - Create(obj *NodeTemplate) (runtime.Object, error) - Remove(obj *NodeTemplate) (runtime.Object, error) - Updated(obj *NodeTemplate) (runtime.Object, error) -} - -type nodeTemplateLifecycleAdapter struct { - lifecycle NodeTemplateLifecycle -} - -func (w *nodeTemplateLifecycleAdapter) HasCreate() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasCreate() -} - -func (w *nodeTemplateLifecycleAdapter) HasFinalize() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasFinalize() -} - -func (w *nodeTemplateLifecycleAdapter) Create(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Create(obj.(*NodeTemplate)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *nodeTemplateLifecycleAdapter) Finalize(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Remove(obj.(*NodeTemplate)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *nodeTemplateLifecycleAdapter) Updated(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Updated(obj.(*NodeTemplate)) - if o == nil { - return nil, err - } - return o, err -} - -func NewNodeTemplateLifecycleAdapter(name string, clusterScoped bool, client NodeTemplateInterface, l NodeTemplateLifecycle) NodeTemplateHandlerFunc { - if clusterScoped { - resource.PutClusterScoped(NodeTemplateGroupVersionResource) - } - adapter := &nodeTemplateLifecycleAdapter{lifecycle: l} - syncFn := lifecycle.NewObjectLifecycleAdapter(name, clusterScoped, adapter, client.ObjectClient()) - return func(key string, obj *NodeTemplate) (runtime.Object, error) { - newObj, err := syncFn(key, obj) - if o, ok := newObj.(runtime.Object); ok { - return o, err - } - return nil, err - } -} diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_notifier_controller.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_notifier_controller.go deleted file mode 100644 index f0e11af1..00000000 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_notifier_controller.go +++ /dev/null @@ -1,321 +0,0 @@ -package v3 - -import ( - "context" - "time" - - "github.com/rancher/norman/controller" - "github.com/rancher/norman/objectclient" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/apimachinery/pkg/types" - "k8s.io/apimachinery/pkg/watch" - "k8s.io/client-go/tools/cache" -) - -var ( - NotifierGroupVersionKind = schema.GroupVersionKind{ - Version: Version, - Group: GroupName, - Kind: "Notifier", - } - NotifierResource = metav1.APIResource{ - Name: "notifiers", - SingularName: "notifier", - Namespaced: true, - - Kind: NotifierGroupVersionKind.Kind, - } - - NotifierGroupVersionResource = schema.GroupVersionResource{ - Group: GroupName, - Version: Version, - Resource: "notifiers", - } -) - -func init() { - resource.Put(NotifierGroupVersionResource) -} - -func NewNotifier(namespace, name string, obj Notifier) *Notifier { - obj.APIVersion, obj.Kind = NotifierGroupVersionKind.ToAPIVersionAndKind() - obj.Name = name - obj.Namespace = namespace - return &obj -} - -type NotifierList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []Notifier `json:"items"` -} - -type NotifierHandlerFunc func(key string, obj *Notifier) (runtime.Object, error) - -type NotifierChangeHandlerFunc func(obj *Notifier) (runtime.Object, error) - -type NotifierLister interface { - List(namespace string, selector labels.Selector) (ret []*Notifier, err error) - Get(namespace, name string) (*Notifier, error) -} - -type NotifierController interface { - Generic() controller.GenericController - Informer() cache.SharedIndexInformer - Lister() NotifierLister - AddHandler(ctx context.Context, name string, handler NotifierHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync NotifierHandlerFunc) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, handler NotifierHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, handler NotifierHandlerFunc) - Enqueue(namespace, name string) - EnqueueAfter(namespace, name string, after time.Duration) -} - -type NotifierInterface interface { - ObjectClient() *objectclient.ObjectClient - Create(*Notifier) (*Notifier, error) - GetNamespaced(namespace, name string, opts metav1.GetOptions) (*Notifier, error) - Get(name string, opts metav1.GetOptions) (*Notifier, error) - Update(*Notifier) (*Notifier, error) - Delete(name string, options *metav1.DeleteOptions) error - DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error - List(opts metav1.ListOptions) (*NotifierList, error) - ListNamespaced(namespace string, opts metav1.ListOptions) (*NotifierList, error) - Watch(opts metav1.ListOptions) (watch.Interface, error) - DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error - Controller() NotifierController - AddHandler(ctx context.Context, name string, sync NotifierHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync NotifierHandlerFunc) - AddLifecycle(ctx context.Context, name string, lifecycle NotifierLifecycle) - AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle NotifierLifecycle) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync NotifierHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync NotifierHandlerFunc) - AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle NotifierLifecycle) - AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle NotifierLifecycle) -} - -type notifierLister struct { - controller *notifierController -} - -func (l *notifierLister) List(namespace string, selector labels.Selector) (ret []*Notifier, err error) { - err = cache.ListAllByNamespace(l.controller.Informer().GetIndexer(), namespace, selector, func(obj interface{}) { - ret = append(ret, obj.(*Notifier)) - }) - return -} - -func (l *notifierLister) Get(namespace, name string) (*Notifier, error) { - var key string - if namespace != "" { - key = namespace + "/" + name - } else { - key = name - } - obj, exists, err := l.controller.Informer().GetIndexer().GetByKey(key) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(schema.GroupResource{ - Group: NotifierGroupVersionKind.Group, - Resource: NotifierGroupVersionResource.Resource, - }, key) - } - return obj.(*Notifier), nil -} - -type notifierController struct { - controller.GenericController -} - -func (c *notifierController) Generic() controller.GenericController { - return c.GenericController -} - -func (c *notifierController) Lister() NotifierLister { - return ¬ifierLister{ - controller: c, - } -} - -func (c *notifierController) AddHandler(ctx context.Context, name string, handler NotifierHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*Notifier); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *notifierController) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, handler NotifierHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*Notifier); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *notifierController) AddClusterScopedHandler(ctx context.Context, name, cluster string, handler NotifierHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*Notifier); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *notifierController) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, cluster string, handler NotifierHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*Notifier); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -type notifierFactory struct { -} - -func (c notifierFactory) Object() runtime.Object { - return &Notifier{} -} - -func (c notifierFactory) List() runtime.Object { - return &NotifierList{} -} - -func (s *notifierClient) Controller() NotifierController { - genericController := controller.NewGenericController(NotifierGroupVersionKind.Kind+"Controller", - s.client.controllerFactory.ForResourceKind(NotifierGroupVersionResource, NotifierGroupVersionKind.Kind, true)) - - return ¬ifierController{ - GenericController: genericController, - } -} - -type notifierClient struct { - client *Client - ns string - objectClient *objectclient.ObjectClient - controller NotifierController -} - -func (s *notifierClient) ObjectClient() *objectclient.ObjectClient { - return s.objectClient -} - -func (s *notifierClient) Create(o *Notifier) (*Notifier, error) { - obj, err := s.objectClient.Create(o) - return obj.(*Notifier), err -} - -func (s *notifierClient) Get(name string, opts metav1.GetOptions) (*Notifier, error) { - obj, err := s.objectClient.Get(name, opts) - return obj.(*Notifier), err -} - -func (s *notifierClient) GetNamespaced(namespace, name string, opts metav1.GetOptions) (*Notifier, error) { - obj, err := s.objectClient.GetNamespaced(namespace, name, opts) - return obj.(*Notifier), err -} - -func (s *notifierClient) Update(o *Notifier) (*Notifier, error) { - obj, err := s.objectClient.Update(o.Name, o) - return obj.(*Notifier), err -} - -func (s *notifierClient) UpdateStatus(o *Notifier) (*Notifier, error) { - obj, err := s.objectClient.UpdateStatus(o.Name, o) - return obj.(*Notifier), err -} - -func (s *notifierClient) Delete(name string, options *metav1.DeleteOptions) error { - return s.objectClient.Delete(name, options) -} - -func (s *notifierClient) DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error { - return s.objectClient.DeleteNamespaced(namespace, name, options) -} - -func (s *notifierClient) List(opts metav1.ListOptions) (*NotifierList, error) { - obj, err := s.objectClient.List(opts) - return obj.(*NotifierList), err -} - -func (s *notifierClient) ListNamespaced(namespace string, opts metav1.ListOptions) (*NotifierList, error) { - obj, err := s.objectClient.ListNamespaced(namespace, opts) - return obj.(*NotifierList), err -} - -func (s *notifierClient) Watch(opts metav1.ListOptions) (watch.Interface, error) { - return s.objectClient.Watch(opts) -} - -// Patch applies the patch and returns the patched deployment. -func (s *notifierClient) Patch(o *Notifier, patchType types.PatchType, data []byte, subresources ...string) (*Notifier, error) { - obj, err := s.objectClient.Patch(o.Name, o, patchType, data, subresources...) - return obj.(*Notifier), err -} - -func (s *notifierClient) DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error { - return s.objectClient.DeleteCollection(deleteOpts, listOpts) -} - -func (s *notifierClient) AddHandler(ctx context.Context, name string, sync NotifierHandlerFunc) { - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *notifierClient) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync NotifierHandlerFunc) { - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *notifierClient) AddLifecycle(ctx context.Context, name string, lifecycle NotifierLifecycle) { - sync := NewNotifierLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *notifierClient) AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle NotifierLifecycle) { - sync := NewNotifierLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *notifierClient) AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync NotifierHandlerFunc) { - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *notifierClient) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync NotifierHandlerFunc) { - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} - -func (s *notifierClient) AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle NotifierLifecycle) { - sync := NewNotifierLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *notifierClient) AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle NotifierLifecycle) { - sync := NewNotifierLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_notifier_lifecycle_adapter.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_notifier_lifecycle_adapter.go deleted file mode 100644 index 2f3beee1..00000000 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_notifier_lifecycle_adapter.go +++ /dev/null @@ -1,66 +0,0 @@ -package v3 - -import ( - "github.com/rancher/norman/lifecycle" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/runtime" -) - -type NotifierLifecycle interface { - Create(obj *Notifier) (runtime.Object, error) - Remove(obj *Notifier) (runtime.Object, error) - Updated(obj *Notifier) (runtime.Object, error) -} - -type notifierLifecycleAdapter struct { - lifecycle NotifierLifecycle -} - -func (w *notifierLifecycleAdapter) HasCreate() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasCreate() -} - -func (w *notifierLifecycleAdapter) HasFinalize() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasFinalize() -} - -func (w *notifierLifecycleAdapter) Create(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Create(obj.(*Notifier)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *notifierLifecycleAdapter) Finalize(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Remove(obj.(*Notifier)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *notifierLifecycleAdapter) Updated(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Updated(obj.(*Notifier)) - if o == nil { - return nil, err - } - return o, err -} - -func NewNotifierLifecycleAdapter(name string, clusterScoped bool, client NotifierInterface, l NotifierLifecycle) NotifierHandlerFunc { - if clusterScoped { - resource.PutClusterScoped(NotifierGroupVersionResource) - } - adapter := ¬ifierLifecycleAdapter{lifecycle: l} - syncFn := lifecycle.NewObjectLifecycleAdapter(name, clusterScoped, adapter, client.ObjectClient()) - return func(key string, obj *Notifier) (runtime.Object, error) { - newObj, err := syncFn(key, obj) - if o, ok := newObj.(runtime.Object); ok { - return o, err - } - return nil, err - } -} diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_pod_security_policy_template_controller.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_pod_security_policy_template_controller.go deleted file mode 100644 index baa26d1e..00000000 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_pod_security_policy_template_controller.go +++ /dev/null @@ -1,320 +0,0 @@ -package v3 - -import ( - "context" - "time" - - "github.com/rancher/norman/controller" - "github.com/rancher/norman/objectclient" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/apimachinery/pkg/types" - "k8s.io/apimachinery/pkg/watch" - "k8s.io/client-go/tools/cache" -) - -var ( - PodSecurityPolicyTemplateGroupVersionKind = schema.GroupVersionKind{ - Version: Version, - Group: GroupName, - Kind: "PodSecurityPolicyTemplate", - } - PodSecurityPolicyTemplateResource = metav1.APIResource{ - Name: "podsecuritypolicytemplates", - SingularName: "podsecuritypolicytemplate", - Namespaced: false, - Kind: PodSecurityPolicyTemplateGroupVersionKind.Kind, - } - - PodSecurityPolicyTemplateGroupVersionResource = schema.GroupVersionResource{ - Group: GroupName, - Version: Version, - Resource: "podsecuritypolicytemplates", - } -) - -func init() { - resource.Put(PodSecurityPolicyTemplateGroupVersionResource) -} - -func NewPodSecurityPolicyTemplate(namespace, name string, obj PodSecurityPolicyTemplate) *PodSecurityPolicyTemplate { - obj.APIVersion, obj.Kind = PodSecurityPolicyTemplateGroupVersionKind.ToAPIVersionAndKind() - obj.Name = name - obj.Namespace = namespace - return &obj -} - -type PodSecurityPolicyTemplateList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []PodSecurityPolicyTemplate `json:"items"` -} - -type PodSecurityPolicyTemplateHandlerFunc func(key string, obj *PodSecurityPolicyTemplate) (runtime.Object, error) - -type PodSecurityPolicyTemplateChangeHandlerFunc func(obj *PodSecurityPolicyTemplate) (runtime.Object, error) - -type PodSecurityPolicyTemplateLister interface { - List(namespace string, selector labels.Selector) (ret []*PodSecurityPolicyTemplate, err error) - Get(namespace, name string) (*PodSecurityPolicyTemplate, error) -} - -type PodSecurityPolicyTemplateController interface { - Generic() controller.GenericController - Informer() cache.SharedIndexInformer - Lister() PodSecurityPolicyTemplateLister - AddHandler(ctx context.Context, name string, handler PodSecurityPolicyTemplateHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync PodSecurityPolicyTemplateHandlerFunc) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, handler PodSecurityPolicyTemplateHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, handler PodSecurityPolicyTemplateHandlerFunc) - Enqueue(namespace, name string) - EnqueueAfter(namespace, name string, after time.Duration) -} - -type PodSecurityPolicyTemplateInterface interface { - ObjectClient() *objectclient.ObjectClient - Create(*PodSecurityPolicyTemplate) (*PodSecurityPolicyTemplate, error) - GetNamespaced(namespace, name string, opts metav1.GetOptions) (*PodSecurityPolicyTemplate, error) - Get(name string, opts metav1.GetOptions) (*PodSecurityPolicyTemplate, error) - Update(*PodSecurityPolicyTemplate) (*PodSecurityPolicyTemplate, error) - Delete(name string, options *metav1.DeleteOptions) error - DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error - List(opts metav1.ListOptions) (*PodSecurityPolicyTemplateList, error) - ListNamespaced(namespace string, opts metav1.ListOptions) (*PodSecurityPolicyTemplateList, error) - Watch(opts metav1.ListOptions) (watch.Interface, error) - DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error - Controller() PodSecurityPolicyTemplateController - AddHandler(ctx context.Context, name string, sync PodSecurityPolicyTemplateHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync PodSecurityPolicyTemplateHandlerFunc) - AddLifecycle(ctx context.Context, name string, lifecycle PodSecurityPolicyTemplateLifecycle) - AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle PodSecurityPolicyTemplateLifecycle) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync PodSecurityPolicyTemplateHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync PodSecurityPolicyTemplateHandlerFunc) - AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle PodSecurityPolicyTemplateLifecycle) - AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle PodSecurityPolicyTemplateLifecycle) -} - -type podSecurityPolicyTemplateLister struct { - controller *podSecurityPolicyTemplateController -} - -func (l *podSecurityPolicyTemplateLister) List(namespace string, selector labels.Selector) (ret []*PodSecurityPolicyTemplate, err error) { - err = cache.ListAllByNamespace(l.controller.Informer().GetIndexer(), namespace, selector, func(obj interface{}) { - ret = append(ret, obj.(*PodSecurityPolicyTemplate)) - }) - return -} - -func (l *podSecurityPolicyTemplateLister) Get(namespace, name string) (*PodSecurityPolicyTemplate, error) { - var key string - if namespace != "" { - key = namespace + "/" + name - } else { - key = name - } - obj, exists, err := l.controller.Informer().GetIndexer().GetByKey(key) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(schema.GroupResource{ - Group: PodSecurityPolicyTemplateGroupVersionKind.Group, - Resource: PodSecurityPolicyTemplateGroupVersionResource.Resource, - }, key) - } - return obj.(*PodSecurityPolicyTemplate), nil -} - -type podSecurityPolicyTemplateController struct { - controller.GenericController -} - -func (c *podSecurityPolicyTemplateController) Generic() controller.GenericController { - return c.GenericController -} - -func (c *podSecurityPolicyTemplateController) Lister() PodSecurityPolicyTemplateLister { - return &podSecurityPolicyTemplateLister{ - controller: c, - } -} - -func (c *podSecurityPolicyTemplateController) AddHandler(ctx context.Context, name string, handler PodSecurityPolicyTemplateHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*PodSecurityPolicyTemplate); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *podSecurityPolicyTemplateController) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, handler PodSecurityPolicyTemplateHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*PodSecurityPolicyTemplate); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *podSecurityPolicyTemplateController) AddClusterScopedHandler(ctx context.Context, name, cluster string, handler PodSecurityPolicyTemplateHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*PodSecurityPolicyTemplate); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *podSecurityPolicyTemplateController) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, cluster string, handler PodSecurityPolicyTemplateHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*PodSecurityPolicyTemplate); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -type podSecurityPolicyTemplateFactory struct { -} - -func (c podSecurityPolicyTemplateFactory) Object() runtime.Object { - return &PodSecurityPolicyTemplate{} -} - -func (c podSecurityPolicyTemplateFactory) List() runtime.Object { - return &PodSecurityPolicyTemplateList{} -} - -func (s *podSecurityPolicyTemplateClient) Controller() PodSecurityPolicyTemplateController { - genericController := controller.NewGenericController(PodSecurityPolicyTemplateGroupVersionKind.Kind+"Controller", - s.client.controllerFactory.ForResourceKind(PodSecurityPolicyTemplateGroupVersionResource, PodSecurityPolicyTemplateGroupVersionKind.Kind, false)) - - return &podSecurityPolicyTemplateController{ - GenericController: genericController, - } -} - -type podSecurityPolicyTemplateClient struct { - client *Client - ns string - objectClient *objectclient.ObjectClient - controller PodSecurityPolicyTemplateController -} - -func (s *podSecurityPolicyTemplateClient) ObjectClient() *objectclient.ObjectClient { - return s.objectClient -} - -func (s *podSecurityPolicyTemplateClient) Create(o *PodSecurityPolicyTemplate) (*PodSecurityPolicyTemplate, error) { - obj, err := s.objectClient.Create(o) - return obj.(*PodSecurityPolicyTemplate), err -} - -func (s *podSecurityPolicyTemplateClient) Get(name string, opts metav1.GetOptions) (*PodSecurityPolicyTemplate, error) { - obj, err := s.objectClient.Get(name, opts) - return obj.(*PodSecurityPolicyTemplate), err -} - -func (s *podSecurityPolicyTemplateClient) GetNamespaced(namespace, name string, opts metav1.GetOptions) (*PodSecurityPolicyTemplate, error) { - obj, err := s.objectClient.GetNamespaced(namespace, name, opts) - return obj.(*PodSecurityPolicyTemplate), err -} - -func (s *podSecurityPolicyTemplateClient) Update(o *PodSecurityPolicyTemplate) (*PodSecurityPolicyTemplate, error) { - obj, err := s.objectClient.Update(o.Name, o) - return obj.(*PodSecurityPolicyTemplate), err -} - -func (s *podSecurityPolicyTemplateClient) UpdateStatus(o *PodSecurityPolicyTemplate) (*PodSecurityPolicyTemplate, error) { - obj, err := s.objectClient.UpdateStatus(o.Name, o) - return obj.(*PodSecurityPolicyTemplate), err -} - -func (s *podSecurityPolicyTemplateClient) Delete(name string, options *metav1.DeleteOptions) error { - return s.objectClient.Delete(name, options) -} - -func (s *podSecurityPolicyTemplateClient) DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error { - return s.objectClient.DeleteNamespaced(namespace, name, options) -} - -func (s *podSecurityPolicyTemplateClient) List(opts metav1.ListOptions) (*PodSecurityPolicyTemplateList, error) { - obj, err := s.objectClient.List(opts) - return obj.(*PodSecurityPolicyTemplateList), err -} - -func (s *podSecurityPolicyTemplateClient) ListNamespaced(namespace string, opts metav1.ListOptions) (*PodSecurityPolicyTemplateList, error) { - obj, err := s.objectClient.ListNamespaced(namespace, opts) - return obj.(*PodSecurityPolicyTemplateList), err -} - -func (s *podSecurityPolicyTemplateClient) Watch(opts metav1.ListOptions) (watch.Interface, error) { - return s.objectClient.Watch(opts) -} - -// Patch applies the patch and returns the patched deployment. -func (s *podSecurityPolicyTemplateClient) Patch(o *PodSecurityPolicyTemplate, patchType types.PatchType, data []byte, subresources ...string) (*PodSecurityPolicyTemplate, error) { - obj, err := s.objectClient.Patch(o.Name, o, patchType, data, subresources...) - return obj.(*PodSecurityPolicyTemplate), err -} - -func (s *podSecurityPolicyTemplateClient) DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error { - return s.objectClient.DeleteCollection(deleteOpts, listOpts) -} - -func (s *podSecurityPolicyTemplateClient) AddHandler(ctx context.Context, name string, sync PodSecurityPolicyTemplateHandlerFunc) { - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *podSecurityPolicyTemplateClient) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync PodSecurityPolicyTemplateHandlerFunc) { - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *podSecurityPolicyTemplateClient) AddLifecycle(ctx context.Context, name string, lifecycle PodSecurityPolicyTemplateLifecycle) { - sync := NewPodSecurityPolicyTemplateLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *podSecurityPolicyTemplateClient) AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle PodSecurityPolicyTemplateLifecycle) { - sync := NewPodSecurityPolicyTemplateLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *podSecurityPolicyTemplateClient) AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync PodSecurityPolicyTemplateHandlerFunc) { - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *podSecurityPolicyTemplateClient) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync PodSecurityPolicyTemplateHandlerFunc) { - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} - -func (s *podSecurityPolicyTemplateClient) AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle PodSecurityPolicyTemplateLifecycle) { - sync := NewPodSecurityPolicyTemplateLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *podSecurityPolicyTemplateClient) AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle PodSecurityPolicyTemplateLifecycle) { - sync := NewPodSecurityPolicyTemplateLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_pod_security_policy_template_lifecycle_adapter.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_pod_security_policy_template_lifecycle_adapter.go deleted file mode 100644 index bc159728..00000000 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_pod_security_policy_template_lifecycle_adapter.go +++ /dev/null @@ -1,66 +0,0 @@ -package v3 - -import ( - "github.com/rancher/norman/lifecycle" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/runtime" -) - -type PodSecurityPolicyTemplateLifecycle interface { - Create(obj *PodSecurityPolicyTemplate) (runtime.Object, error) - Remove(obj *PodSecurityPolicyTemplate) (runtime.Object, error) - Updated(obj *PodSecurityPolicyTemplate) (runtime.Object, error) -} - -type podSecurityPolicyTemplateLifecycleAdapter struct { - lifecycle PodSecurityPolicyTemplateLifecycle -} - -func (w *podSecurityPolicyTemplateLifecycleAdapter) HasCreate() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasCreate() -} - -func (w *podSecurityPolicyTemplateLifecycleAdapter) HasFinalize() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasFinalize() -} - -func (w *podSecurityPolicyTemplateLifecycleAdapter) Create(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Create(obj.(*PodSecurityPolicyTemplate)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *podSecurityPolicyTemplateLifecycleAdapter) Finalize(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Remove(obj.(*PodSecurityPolicyTemplate)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *podSecurityPolicyTemplateLifecycleAdapter) Updated(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Updated(obj.(*PodSecurityPolicyTemplate)) - if o == nil { - return nil, err - } - return o, err -} - -func NewPodSecurityPolicyTemplateLifecycleAdapter(name string, clusterScoped bool, client PodSecurityPolicyTemplateInterface, l PodSecurityPolicyTemplateLifecycle) PodSecurityPolicyTemplateHandlerFunc { - if clusterScoped { - resource.PutClusterScoped(PodSecurityPolicyTemplateGroupVersionResource) - } - adapter := &podSecurityPolicyTemplateLifecycleAdapter{lifecycle: l} - syncFn := lifecycle.NewObjectLifecycleAdapter(name, clusterScoped, adapter, client.ObjectClient()) - return func(key string, obj *PodSecurityPolicyTemplate) (runtime.Object, error) { - newObj, err := syncFn(key, obj) - if o, ok := newObj.(runtime.Object); ok { - return o, err - } - return nil, err - } -} diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_pod_security_policy_template_project_binding_controller.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_pod_security_policy_template_project_binding_controller.go deleted file mode 100644 index 4654308d..00000000 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_pod_security_policy_template_project_binding_controller.go +++ /dev/null @@ -1,321 +0,0 @@ -package v3 - -import ( - "context" - "time" - - "github.com/rancher/norman/controller" - "github.com/rancher/norman/objectclient" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/apimachinery/pkg/types" - "k8s.io/apimachinery/pkg/watch" - "k8s.io/client-go/tools/cache" -) - -var ( - PodSecurityPolicyTemplateProjectBindingGroupVersionKind = schema.GroupVersionKind{ - Version: Version, - Group: GroupName, - Kind: "PodSecurityPolicyTemplateProjectBinding", - } - PodSecurityPolicyTemplateProjectBindingResource = metav1.APIResource{ - Name: "podsecuritypolicytemplateprojectbindings", - SingularName: "podsecuritypolicytemplateprojectbinding", - Namespaced: true, - - Kind: PodSecurityPolicyTemplateProjectBindingGroupVersionKind.Kind, - } - - PodSecurityPolicyTemplateProjectBindingGroupVersionResource = schema.GroupVersionResource{ - Group: GroupName, - Version: Version, - Resource: "podsecuritypolicytemplateprojectbindings", - } -) - -func init() { - resource.Put(PodSecurityPolicyTemplateProjectBindingGroupVersionResource) -} - -func NewPodSecurityPolicyTemplateProjectBinding(namespace, name string, obj PodSecurityPolicyTemplateProjectBinding) *PodSecurityPolicyTemplateProjectBinding { - obj.APIVersion, obj.Kind = PodSecurityPolicyTemplateProjectBindingGroupVersionKind.ToAPIVersionAndKind() - obj.Name = name - obj.Namespace = namespace - return &obj -} - -type PodSecurityPolicyTemplateProjectBindingList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []PodSecurityPolicyTemplateProjectBinding `json:"items"` -} - -type PodSecurityPolicyTemplateProjectBindingHandlerFunc func(key string, obj *PodSecurityPolicyTemplateProjectBinding) (runtime.Object, error) - -type PodSecurityPolicyTemplateProjectBindingChangeHandlerFunc func(obj *PodSecurityPolicyTemplateProjectBinding) (runtime.Object, error) - -type PodSecurityPolicyTemplateProjectBindingLister interface { - List(namespace string, selector labels.Selector) (ret []*PodSecurityPolicyTemplateProjectBinding, err error) - Get(namespace, name string) (*PodSecurityPolicyTemplateProjectBinding, error) -} - -type PodSecurityPolicyTemplateProjectBindingController interface { - Generic() controller.GenericController - Informer() cache.SharedIndexInformer - Lister() PodSecurityPolicyTemplateProjectBindingLister - AddHandler(ctx context.Context, name string, handler PodSecurityPolicyTemplateProjectBindingHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync PodSecurityPolicyTemplateProjectBindingHandlerFunc) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, handler PodSecurityPolicyTemplateProjectBindingHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, handler PodSecurityPolicyTemplateProjectBindingHandlerFunc) - Enqueue(namespace, name string) - EnqueueAfter(namespace, name string, after time.Duration) -} - -type PodSecurityPolicyTemplateProjectBindingInterface interface { - ObjectClient() *objectclient.ObjectClient - Create(*PodSecurityPolicyTemplateProjectBinding) (*PodSecurityPolicyTemplateProjectBinding, error) - GetNamespaced(namespace, name string, opts metav1.GetOptions) (*PodSecurityPolicyTemplateProjectBinding, error) - Get(name string, opts metav1.GetOptions) (*PodSecurityPolicyTemplateProjectBinding, error) - Update(*PodSecurityPolicyTemplateProjectBinding) (*PodSecurityPolicyTemplateProjectBinding, error) - Delete(name string, options *metav1.DeleteOptions) error - DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error - List(opts metav1.ListOptions) (*PodSecurityPolicyTemplateProjectBindingList, error) - ListNamespaced(namespace string, opts metav1.ListOptions) (*PodSecurityPolicyTemplateProjectBindingList, error) - Watch(opts metav1.ListOptions) (watch.Interface, error) - DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error - Controller() PodSecurityPolicyTemplateProjectBindingController - AddHandler(ctx context.Context, name string, sync PodSecurityPolicyTemplateProjectBindingHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync PodSecurityPolicyTemplateProjectBindingHandlerFunc) - AddLifecycle(ctx context.Context, name string, lifecycle PodSecurityPolicyTemplateProjectBindingLifecycle) - AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle PodSecurityPolicyTemplateProjectBindingLifecycle) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync PodSecurityPolicyTemplateProjectBindingHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync PodSecurityPolicyTemplateProjectBindingHandlerFunc) - AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle PodSecurityPolicyTemplateProjectBindingLifecycle) - AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle PodSecurityPolicyTemplateProjectBindingLifecycle) -} - -type podSecurityPolicyTemplateProjectBindingLister struct { - controller *podSecurityPolicyTemplateProjectBindingController -} - -func (l *podSecurityPolicyTemplateProjectBindingLister) List(namespace string, selector labels.Selector) (ret []*PodSecurityPolicyTemplateProjectBinding, err error) { - err = cache.ListAllByNamespace(l.controller.Informer().GetIndexer(), namespace, selector, func(obj interface{}) { - ret = append(ret, obj.(*PodSecurityPolicyTemplateProjectBinding)) - }) - return -} - -func (l *podSecurityPolicyTemplateProjectBindingLister) Get(namespace, name string) (*PodSecurityPolicyTemplateProjectBinding, error) { - var key string - if namespace != "" { - key = namespace + "/" + name - } else { - key = name - } - obj, exists, err := l.controller.Informer().GetIndexer().GetByKey(key) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(schema.GroupResource{ - Group: PodSecurityPolicyTemplateProjectBindingGroupVersionKind.Group, - Resource: PodSecurityPolicyTemplateProjectBindingGroupVersionResource.Resource, - }, key) - } - return obj.(*PodSecurityPolicyTemplateProjectBinding), nil -} - -type podSecurityPolicyTemplateProjectBindingController struct { - controller.GenericController -} - -func (c *podSecurityPolicyTemplateProjectBindingController) Generic() controller.GenericController { - return c.GenericController -} - -func (c *podSecurityPolicyTemplateProjectBindingController) Lister() PodSecurityPolicyTemplateProjectBindingLister { - return &podSecurityPolicyTemplateProjectBindingLister{ - controller: c, - } -} - -func (c *podSecurityPolicyTemplateProjectBindingController) AddHandler(ctx context.Context, name string, handler PodSecurityPolicyTemplateProjectBindingHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*PodSecurityPolicyTemplateProjectBinding); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *podSecurityPolicyTemplateProjectBindingController) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, handler PodSecurityPolicyTemplateProjectBindingHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*PodSecurityPolicyTemplateProjectBinding); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *podSecurityPolicyTemplateProjectBindingController) AddClusterScopedHandler(ctx context.Context, name, cluster string, handler PodSecurityPolicyTemplateProjectBindingHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*PodSecurityPolicyTemplateProjectBinding); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *podSecurityPolicyTemplateProjectBindingController) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, cluster string, handler PodSecurityPolicyTemplateProjectBindingHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*PodSecurityPolicyTemplateProjectBinding); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -type podSecurityPolicyTemplateProjectBindingFactory struct { -} - -func (c podSecurityPolicyTemplateProjectBindingFactory) Object() runtime.Object { - return &PodSecurityPolicyTemplateProjectBinding{} -} - -func (c podSecurityPolicyTemplateProjectBindingFactory) List() runtime.Object { - return &PodSecurityPolicyTemplateProjectBindingList{} -} - -func (s *podSecurityPolicyTemplateProjectBindingClient) Controller() PodSecurityPolicyTemplateProjectBindingController { - genericController := controller.NewGenericController(PodSecurityPolicyTemplateProjectBindingGroupVersionKind.Kind+"Controller", - s.client.controllerFactory.ForResourceKind(PodSecurityPolicyTemplateProjectBindingGroupVersionResource, PodSecurityPolicyTemplateProjectBindingGroupVersionKind.Kind, true)) - - return &podSecurityPolicyTemplateProjectBindingController{ - GenericController: genericController, - } -} - -type podSecurityPolicyTemplateProjectBindingClient struct { - client *Client - ns string - objectClient *objectclient.ObjectClient - controller PodSecurityPolicyTemplateProjectBindingController -} - -func (s *podSecurityPolicyTemplateProjectBindingClient) ObjectClient() *objectclient.ObjectClient { - return s.objectClient -} - -func (s *podSecurityPolicyTemplateProjectBindingClient) Create(o *PodSecurityPolicyTemplateProjectBinding) (*PodSecurityPolicyTemplateProjectBinding, error) { - obj, err := s.objectClient.Create(o) - return obj.(*PodSecurityPolicyTemplateProjectBinding), err -} - -func (s *podSecurityPolicyTemplateProjectBindingClient) Get(name string, opts metav1.GetOptions) (*PodSecurityPolicyTemplateProjectBinding, error) { - obj, err := s.objectClient.Get(name, opts) - return obj.(*PodSecurityPolicyTemplateProjectBinding), err -} - -func (s *podSecurityPolicyTemplateProjectBindingClient) GetNamespaced(namespace, name string, opts metav1.GetOptions) (*PodSecurityPolicyTemplateProjectBinding, error) { - obj, err := s.objectClient.GetNamespaced(namespace, name, opts) - return obj.(*PodSecurityPolicyTemplateProjectBinding), err -} - -func (s *podSecurityPolicyTemplateProjectBindingClient) Update(o *PodSecurityPolicyTemplateProjectBinding) (*PodSecurityPolicyTemplateProjectBinding, error) { - obj, err := s.objectClient.Update(o.Name, o) - return obj.(*PodSecurityPolicyTemplateProjectBinding), err -} - -func (s *podSecurityPolicyTemplateProjectBindingClient) UpdateStatus(o *PodSecurityPolicyTemplateProjectBinding) (*PodSecurityPolicyTemplateProjectBinding, error) { - obj, err := s.objectClient.UpdateStatus(o.Name, o) - return obj.(*PodSecurityPolicyTemplateProjectBinding), err -} - -func (s *podSecurityPolicyTemplateProjectBindingClient) Delete(name string, options *metav1.DeleteOptions) error { - return s.objectClient.Delete(name, options) -} - -func (s *podSecurityPolicyTemplateProjectBindingClient) DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error { - return s.objectClient.DeleteNamespaced(namespace, name, options) -} - -func (s *podSecurityPolicyTemplateProjectBindingClient) List(opts metav1.ListOptions) (*PodSecurityPolicyTemplateProjectBindingList, error) { - obj, err := s.objectClient.List(opts) - return obj.(*PodSecurityPolicyTemplateProjectBindingList), err -} - -func (s *podSecurityPolicyTemplateProjectBindingClient) ListNamespaced(namespace string, opts metav1.ListOptions) (*PodSecurityPolicyTemplateProjectBindingList, error) { - obj, err := s.objectClient.ListNamespaced(namespace, opts) - return obj.(*PodSecurityPolicyTemplateProjectBindingList), err -} - -func (s *podSecurityPolicyTemplateProjectBindingClient) Watch(opts metav1.ListOptions) (watch.Interface, error) { - return s.objectClient.Watch(opts) -} - -// Patch applies the patch and returns the patched deployment. -func (s *podSecurityPolicyTemplateProjectBindingClient) Patch(o *PodSecurityPolicyTemplateProjectBinding, patchType types.PatchType, data []byte, subresources ...string) (*PodSecurityPolicyTemplateProjectBinding, error) { - obj, err := s.objectClient.Patch(o.Name, o, patchType, data, subresources...) - return obj.(*PodSecurityPolicyTemplateProjectBinding), err -} - -func (s *podSecurityPolicyTemplateProjectBindingClient) DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error { - return s.objectClient.DeleteCollection(deleteOpts, listOpts) -} - -func (s *podSecurityPolicyTemplateProjectBindingClient) AddHandler(ctx context.Context, name string, sync PodSecurityPolicyTemplateProjectBindingHandlerFunc) { - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *podSecurityPolicyTemplateProjectBindingClient) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync PodSecurityPolicyTemplateProjectBindingHandlerFunc) { - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *podSecurityPolicyTemplateProjectBindingClient) AddLifecycle(ctx context.Context, name string, lifecycle PodSecurityPolicyTemplateProjectBindingLifecycle) { - sync := NewPodSecurityPolicyTemplateProjectBindingLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *podSecurityPolicyTemplateProjectBindingClient) AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle PodSecurityPolicyTemplateProjectBindingLifecycle) { - sync := NewPodSecurityPolicyTemplateProjectBindingLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *podSecurityPolicyTemplateProjectBindingClient) AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync PodSecurityPolicyTemplateProjectBindingHandlerFunc) { - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *podSecurityPolicyTemplateProjectBindingClient) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync PodSecurityPolicyTemplateProjectBindingHandlerFunc) { - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} - -func (s *podSecurityPolicyTemplateProjectBindingClient) AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle PodSecurityPolicyTemplateProjectBindingLifecycle) { - sync := NewPodSecurityPolicyTemplateProjectBindingLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *podSecurityPolicyTemplateProjectBindingClient) AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle PodSecurityPolicyTemplateProjectBindingLifecycle) { - sync := NewPodSecurityPolicyTemplateProjectBindingLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_pod_security_policy_template_project_binding_lifecycle_adapter.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_pod_security_policy_template_project_binding_lifecycle_adapter.go deleted file mode 100644 index c917eac5..00000000 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_pod_security_policy_template_project_binding_lifecycle_adapter.go +++ /dev/null @@ -1,66 +0,0 @@ -package v3 - -import ( - "github.com/rancher/norman/lifecycle" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/runtime" -) - -type PodSecurityPolicyTemplateProjectBindingLifecycle interface { - Create(obj *PodSecurityPolicyTemplateProjectBinding) (runtime.Object, error) - Remove(obj *PodSecurityPolicyTemplateProjectBinding) (runtime.Object, error) - Updated(obj *PodSecurityPolicyTemplateProjectBinding) (runtime.Object, error) -} - -type podSecurityPolicyTemplateProjectBindingLifecycleAdapter struct { - lifecycle PodSecurityPolicyTemplateProjectBindingLifecycle -} - -func (w *podSecurityPolicyTemplateProjectBindingLifecycleAdapter) HasCreate() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasCreate() -} - -func (w *podSecurityPolicyTemplateProjectBindingLifecycleAdapter) HasFinalize() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasFinalize() -} - -func (w *podSecurityPolicyTemplateProjectBindingLifecycleAdapter) Create(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Create(obj.(*PodSecurityPolicyTemplateProjectBinding)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *podSecurityPolicyTemplateProjectBindingLifecycleAdapter) Finalize(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Remove(obj.(*PodSecurityPolicyTemplateProjectBinding)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *podSecurityPolicyTemplateProjectBindingLifecycleAdapter) Updated(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Updated(obj.(*PodSecurityPolicyTemplateProjectBinding)) - if o == nil { - return nil, err - } - return o, err -} - -func NewPodSecurityPolicyTemplateProjectBindingLifecycleAdapter(name string, clusterScoped bool, client PodSecurityPolicyTemplateProjectBindingInterface, l PodSecurityPolicyTemplateProjectBindingLifecycle) PodSecurityPolicyTemplateProjectBindingHandlerFunc { - if clusterScoped { - resource.PutClusterScoped(PodSecurityPolicyTemplateProjectBindingGroupVersionResource) - } - adapter := &podSecurityPolicyTemplateProjectBindingLifecycleAdapter{lifecycle: l} - syncFn := lifecycle.NewObjectLifecycleAdapter(name, clusterScoped, adapter, client.ObjectClient()) - return func(key string, obj *PodSecurityPolicyTemplateProjectBinding) (runtime.Object, error) { - newObj, err := syncFn(key, obj) - if o, ok := newObj.(runtime.Object); ok { - return o, err - } - return nil, err - } -} diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_preference_controller.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_preference_controller.go deleted file mode 100644 index a2a72a6b..00000000 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_preference_controller.go +++ /dev/null @@ -1,321 +0,0 @@ -package v3 - -import ( - "context" - "time" - - "github.com/rancher/norman/controller" - "github.com/rancher/norman/objectclient" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/apimachinery/pkg/types" - "k8s.io/apimachinery/pkg/watch" - "k8s.io/client-go/tools/cache" -) - -var ( - PreferenceGroupVersionKind = schema.GroupVersionKind{ - Version: Version, - Group: GroupName, - Kind: "Preference", - } - PreferenceResource = metav1.APIResource{ - Name: "preferences", - SingularName: "preference", - Namespaced: true, - - Kind: PreferenceGroupVersionKind.Kind, - } - - PreferenceGroupVersionResource = schema.GroupVersionResource{ - Group: GroupName, - Version: Version, - Resource: "preferences", - } -) - -func init() { - resource.Put(PreferenceGroupVersionResource) -} - -func NewPreference(namespace, name string, obj Preference) *Preference { - obj.APIVersion, obj.Kind = PreferenceGroupVersionKind.ToAPIVersionAndKind() - obj.Name = name - obj.Namespace = namespace - return &obj -} - -type PreferenceList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []Preference `json:"items"` -} - -type PreferenceHandlerFunc func(key string, obj *Preference) (runtime.Object, error) - -type PreferenceChangeHandlerFunc func(obj *Preference) (runtime.Object, error) - -type PreferenceLister interface { - List(namespace string, selector labels.Selector) (ret []*Preference, err error) - Get(namespace, name string) (*Preference, error) -} - -type PreferenceController interface { - Generic() controller.GenericController - Informer() cache.SharedIndexInformer - Lister() PreferenceLister - AddHandler(ctx context.Context, name string, handler PreferenceHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync PreferenceHandlerFunc) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, handler PreferenceHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, handler PreferenceHandlerFunc) - Enqueue(namespace, name string) - EnqueueAfter(namespace, name string, after time.Duration) -} - -type PreferenceInterface interface { - ObjectClient() *objectclient.ObjectClient - Create(*Preference) (*Preference, error) - GetNamespaced(namespace, name string, opts metav1.GetOptions) (*Preference, error) - Get(name string, opts metav1.GetOptions) (*Preference, error) - Update(*Preference) (*Preference, error) - Delete(name string, options *metav1.DeleteOptions) error - DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error - List(opts metav1.ListOptions) (*PreferenceList, error) - ListNamespaced(namespace string, opts metav1.ListOptions) (*PreferenceList, error) - Watch(opts metav1.ListOptions) (watch.Interface, error) - DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error - Controller() PreferenceController - AddHandler(ctx context.Context, name string, sync PreferenceHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync PreferenceHandlerFunc) - AddLifecycle(ctx context.Context, name string, lifecycle PreferenceLifecycle) - AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle PreferenceLifecycle) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync PreferenceHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync PreferenceHandlerFunc) - AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle PreferenceLifecycle) - AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle PreferenceLifecycle) -} - -type preferenceLister struct { - controller *preferenceController -} - -func (l *preferenceLister) List(namespace string, selector labels.Selector) (ret []*Preference, err error) { - err = cache.ListAllByNamespace(l.controller.Informer().GetIndexer(), namespace, selector, func(obj interface{}) { - ret = append(ret, obj.(*Preference)) - }) - return -} - -func (l *preferenceLister) Get(namespace, name string) (*Preference, error) { - var key string - if namespace != "" { - key = namespace + "/" + name - } else { - key = name - } - obj, exists, err := l.controller.Informer().GetIndexer().GetByKey(key) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(schema.GroupResource{ - Group: PreferenceGroupVersionKind.Group, - Resource: PreferenceGroupVersionResource.Resource, - }, key) - } - return obj.(*Preference), nil -} - -type preferenceController struct { - controller.GenericController -} - -func (c *preferenceController) Generic() controller.GenericController { - return c.GenericController -} - -func (c *preferenceController) Lister() PreferenceLister { - return &preferenceLister{ - controller: c, - } -} - -func (c *preferenceController) AddHandler(ctx context.Context, name string, handler PreferenceHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*Preference); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *preferenceController) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, handler PreferenceHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*Preference); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *preferenceController) AddClusterScopedHandler(ctx context.Context, name, cluster string, handler PreferenceHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*Preference); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *preferenceController) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, cluster string, handler PreferenceHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*Preference); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -type preferenceFactory struct { -} - -func (c preferenceFactory) Object() runtime.Object { - return &Preference{} -} - -func (c preferenceFactory) List() runtime.Object { - return &PreferenceList{} -} - -func (s *preferenceClient) Controller() PreferenceController { - genericController := controller.NewGenericController(PreferenceGroupVersionKind.Kind+"Controller", - s.client.controllerFactory.ForResourceKind(PreferenceGroupVersionResource, PreferenceGroupVersionKind.Kind, true)) - - return &preferenceController{ - GenericController: genericController, - } -} - -type preferenceClient struct { - client *Client - ns string - objectClient *objectclient.ObjectClient - controller PreferenceController -} - -func (s *preferenceClient) ObjectClient() *objectclient.ObjectClient { - return s.objectClient -} - -func (s *preferenceClient) Create(o *Preference) (*Preference, error) { - obj, err := s.objectClient.Create(o) - return obj.(*Preference), err -} - -func (s *preferenceClient) Get(name string, opts metav1.GetOptions) (*Preference, error) { - obj, err := s.objectClient.Get(name, opts) - return obj.(*Preference), err -} - -func (s *preferenceClient) GetNamespaced(namespace, name string, opts metav1.GetOptions) (*Preference, error) { - obj, err := s.objectClient.GetNamespaced(namespace, name, opts) - return obj.(*Preference), err -} - -func (s *preferenceClient) Update(o *Preference) (*Preference, error) { - obj, err := s.objectClient.Update(o.Name, o) - return obj.(*Preference), err -} - -func (s *preferenceClient) UpdateStatus(o *Preference) (*Preference, error) { - obj, err := s.objectClient.UpdateStatus(o.Name, o) - return obj.(*Preference), err -} - -func (s *preferenceClient) Delete(name string, options *metav1.DeleteOptions) error { - return s.objectClient.Delete(name, options) -} - -func (s *preferenceClient) DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error { - return s.objectClient.DeleteNamespaced(namespace, name, options) -} - -func (s *preferenceClient) List(opts metav1.ListOptions) (*PreferenceList, error) { - obj, err := s.objectClient.List(opts) - return obj.(*PreferenceList), err -} - -func (s *preferenceClient) ListNamespaced(namespace string, opts metav1.ListOptions) (*PreferenceList, error) { - obj, err := s.objectClient.ListNamespaced(namespace, opts) - return obj.(*PreferenceList), err -} - -func (s *preferenceClient) Watch(opts metav1.ListOptions) (watch.Interface, error) { - return s.objectClient.Watch(opts) -} - -// Patch applies the patch and returns the patched deployment. -func (s *preferenceClient) Patch(o *Preference, patchType types.PatchType, data []byte, subresources ...string) (*Preference, error) { - obj, err := s.objectClient.Patch(o.Name, o, patchType, data, subresources...) - return obj.(*Preference), err -} - -func (s *preferenceClient) DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error { - return s.objectClient.DeleteCollection(deleteOpts, listOpts) -} - -func (s *preferenceClient) AddHandler(ctx context.Context, name string, sync PreferenceHandlerFunc) { - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *preferenceClient) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync PreferenceHandlerFunc) { - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *preferenceClient) AddLifecycle(ctx context.Context, name string, lifecycle PreferenceLifecycle) { - sync := NewPreferenceLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *preferenceClient) AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle PreferenceLifecycle) { - sync := NewPreferenceLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *preferenceClient) AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync PreferenceHandlerFunc) { - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *preferenceClient) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync PreferenceHandlerFunc) { - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} - -func (s *preferenceClient) AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle PreferenceLifecycle) { - sync := NewPreferenceLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *preferenceClient) AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle PreferenceLifecycle) { - sync := NewPreferenceLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_preference_lifecycle_adapter.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_preference_lifecycle_adapter.go deleted file mode 100644 index 99cc77f0..00000000 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_preference_lifecycle_adapter.go +++ /dev/null @@ -1,66 +0,0 @@ -package v3 - -import ( - "github.com/rancher/norman/lifecycle" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/runtime" -) - -type PreferenceLifecycle interface { - Create(obj *Preference) (runtime.Object, error) - Remove(obj *Preference) (runtime.Object, error) - Updated(obj *Preference) (runtime.Object, error) -} - -type preferenceLifecycleAdapter struct { - lifecycle PreferenceLifecycle -} - -func (w *preferenceLifecycleAdapter) HasCreate() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasCreate() -} - -func (w *preferenceLifecycleAdapter) HasFinalize() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasFinalize() -} - -func (w *preferenceLifecycleAdapter) Create(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Create(obj.(*Preference)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *preferenceLifecycleAdapter) Finalize(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Remove(obj.(*Preference)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *preferenceLifecycleAdapter) Updated(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Updated(obj.(*Preference)) - if o == nil { - return nil, err - } - return o, err -} - -func NewPreferenceLifecycleAdapter(name string, clusterScoped bool, client PreferenceInterface, l PreferenceLifecycle) PreferenceHandlerFunc { - if clusterScoped { - resource.PutClusterScoped(PreferenceGroupVersionResource) - } - adapter := &preferenceLifecycleAdapter{lifecycle: l} - syncFn := lifecycle.NewObjectLifecycleAdapter(name, clusterScoped, adapter, client.ObjectClient()) - return func(key string, obj *Preference) (runtime.Object, error) { - newObj, err := syncFn(key, obj) - if o, ok := newObj.(runtime.Object); ok { - return o, err - } - return nil, err - } -} diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_principal_controller.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_principal_controller.go deleted file mode 100644 index fe8d9d94..00000000 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_principal_controller.go +++ /dev/null @@ -1,320 +0,0 @@ -package v3 - -import ( - "context" - "time" - - "github.com/rancher/norman/controller" - "github.com/rancher/norman/objectclient" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/apimachinery/pkg/types" - "k8s.io/apimachinery/pkg/watch" - "k8s.io/client-go/tools/cache" -) - -var ( - PrincipalGroupVersionKind = schema.GroupVersionKind{ - Version: Version, - Group: GroupName, - Kind: "Principal", - } - PrincipalResource = metav1.APIResource{ - Name: "principals", - SingularName: "principal", - Namespaced: false, - Kind: PrincipalGroupVersionKind.Kind, - } - - PrincipalGroupVersionResource = schema.GroupVersionResource{ - Group: GroupName, - Version: Version, - Resource: "principals", - } -) - -func init() { - resource.Put(PrincipalGroupVersionResource) -} - -func NewPrincipal(namespace, name string, obj Principal) *Principal { - obj.APIVersion, obj.Kind = PrincipalGroupVersionKind.ToAPIVersionAndKind() - obj.Name = name - obj.Namespace = namespace - return &obj -} - -type PrincipalList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []Principal `json:"items"` -} - -type PrincipalHandlerFunc func(key string, obj *Principal) (runtime.Object, error) - -type PrincipalChangeHandlerFunc func(obj *Principal) (runtime.Object, error) - -type PrincipalLister interface { - List(namespace string, selector labels.Selector) (ret []*Principal, err error) - Get(namespace, name string) (*Principal, error) -} - -type PrincipalController interface { - Generic() controller.GenericController - Informer() cache.SharedIndexInformer - Lister() PrincipalLister - AddHandler(ctx context.Context, name string, handler PrincipalHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync PrincipalHandlerFunc) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, handler PrincipalHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, handler PrincipalHandlerFunc) - Enqueue(namespace, name string) - EnqueueAfter(namespace, name string, after time.Duration) -} - -type PrincipalInterface interface { - ObjectClient() *objectclient.ObjectClient - Create(*Principal) (*Principal, error) - GetNamespaced(namespace, name string, opts metav1.GetOptions) (*Principal, error) - Get(name string, opts metav1.GetOptions) (*Principal, error) - Update(*Principal) (*Principal, error) - Delete(name string, options *metav1.DeleteOptions) error - DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error - List(opts metav1.ListOptions) (*PrincipalList, error) - ListNamespaced(namespace string, opts metav1.ListOptions) (*PrincipalList, error) - Watch(opts metav1.ListOptions) (watch.Interface, error) - DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error - Controller() PrincipalController - AddHandler(ctx context.Context, name string, sync PrincipalHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync PrincipalHandlerFunc) - AddLifecycle(ctx context.Context, name string, lifecycle PrincipalLifecycle) - AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle PrincipalLifecycle) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync PrincipalHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync PrincipalHandlerFunc) - AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle PrincipalLifecycle) - AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle PrincipalLifecycle) -} - -type principalLister struct { - controller *principalController -} - -func (l *principalLister) List(namespace string, selector labels.Selector) (ret []*Principal, err error) { - err = cache.ListAllByNamespace(l.controller.Informer().GetIndexer(), namespace, selector, func(obj interface{}) { - ret = append(ret, obj.(*Principal)) - }) - return -} - -func (l *principalLister) Get(namespace, name string) (*Principal, error) { - var key string - if namespace != "" { - key = namespace + "/" + name - } else { - key = name - } - obj, exists, err := l.controller.Informer().GetIndexer().GetByKey(key) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(schema.GroupResource{ - Group: PrincipalGroupVersionKind.Group, - Resource: PrincipalGroupVersionResource.Resource, - }, key) - } - return obj.(*Principal), nil -} - -type principalController struct { - controller.GenericController -} - -func (c *principalController) Generic() controller.GenericController { - return c.GenericController -} - -func (c *principalController) Lister() PrincipalLister { - return &principalLister{ - controller: c, - } -} - -func (c *principalController) AddHandler(ctx context.Context, name string, handler PrincipalHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*Principal); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *principalController) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, handler PrincipalHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*Principal); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *principalController) AddClusterScopedHandler(ctx context.Context, name, cluster string, handler PrincipalHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*Principal); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *principalController) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, cluster string, handler PrincipalHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*Principal); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -type principalFactory struct { -} - -func (c principalFactory) Object() runtime.Object { - return &Principal{} -} - -func (c principalFactory) List() runtime.Object { - return &PrincipalList{} -} - -func (s *principalClient) Controller() PrincipalController { - genericController := controller.NewGenericController(PrincipalGroupVersionKind.Kind+"Controller", - s.client.controllerFactory.ForResourceKind(PrincipalGroupVersionResource, PrincipalGroupVersionKind.Kind, false)) - - return &principalController{ - GenericController: genericController, - } -} - -type principalClient struct { - client *Client - ns string - objectClient *objectclient.ObjectClient - controller PrincipalController -} - -func (s *principalClient) ObjectClient() *objectclient.ObjectClient { - return s.objectClient -} - -func (s *principalClient) Create(o *Principal) (*Principal, error) { - obj, err := s.objectClient.Create(o) - return obj.(*Principal), err -} - -func (s *principalClient) Get(name string, opts metav1.GetOptions) (*Principal, error) { - obj, err := s.objectClient.Get(name, opts) - return obj.(*Principal), err -} - -func (s *principalClient) GetNamespaced(namespace, name string, opts metav1.GetOptions) (*Principal, error) { - obj, err := s.objectClient.GetNamespaced(namespace, name, opts) - return obj.(*Principal), err -} - -func (s *principalClient) Update(o *Principal) (*Principal, error) { - obj, err := s.objectClient.Update(o.Name, o) - return obj.(*Principal), err -} - -func (s *principalClient) UpdateStatus(o *Principal) (*Principal, error) { - obj, err := s.objectClient.UpdateStatus(o.Name, o) - return obj.(*Principal), err -} - -func (s *principalClient) Delete(name string, options *metav1.DeleteOptions) error { - return s.objectClient.Delete(name, options) -} - -func (s *principalClient) DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error { - return s.objectClient.DeleteNamespaced(namespace, name, options) -} - -func (s *principalClient) List(opts metav1.ListOptions) (*PrincipalList, error) { - obj, err := s.objectClient.List(opts) - return obj.(*PrincipalList), err -} - -func (s *principalClient) ListNamespaced(namespace string, opts metav1.ListOptions) (*PrincipalList, error) { - obj, err := s.objectClient.ListNamespaced(namespace, opts) - return obj.(*PrincipalList), err -} - -func (s *principalClient) Watch(opts metav1.ListOptions) (watch.Interface, error) { - return s.objectClient.Watch(opts) -} - -// Patch applies the patch and returns the patched deployment. -func (s *principalClient) Patch(o *Principal, patchType types.PatchType, data []byte, subresources ...string) (*Principal, error) { - obj, err := s.objectClient.Patch(o.Name, o, patchType, data, subresources...) - return obj.(*Principal), err -} - -func (s *principalClient) DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error { - return s.objectClient.DeleteCollection(deleteOpts, listOpts) -} - -func (s *principalClient) AddHandler(ctx context.Context, name string, sync PrincipalHandlerFunc) { - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *principalClient) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync PrincipalHandlerFunc) { - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *principalClient) AddLifecycle(ctx context.Context, name string, lifecycle PrincipalLifecycle) { - sync := NewPrincipalLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *principalClient) AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle PrincipalLifecycle) { - sync := NewPrincipalLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *principalClient) AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync PrincipalHandlerFunc) { - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *principalClient) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync PrincipalHandlerFunc) { - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} - -func (s *principalClient) AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle PrincipalLifecycle) { - sync := NewPrincipalLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *principalClient) AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle PrincipalLifecycle) { - sync := NewPrincipalLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_principal_lifecycle_adapter.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_principal_lifecycle_adapter.go deleted file mode 100644 index 8c813362..00000000 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_principal_lifecycle_adapter.go +++ /dev/null @@ -1,66 +0,0 @@ -package v3 - -import ( - "github.com/rancher/norman/lifecycle" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/runtime" -) - -type PrincipalLifecycle interface { - Create(obj *Principal) (runtime.Object, error) - Remove(obj *Principal) (runtime.Object, error) - Updated(obj *Principal) (runtime.Object, error) -} - -type principalLifecycleAdapter struct { - lifecycle PrincipalLifecycle -} - -func (w *principalLifecycleAdapter) HasCreate() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasCreate() -} - -func (w *principalLifecycleAdapter) HasFinalize() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasFinalize() -} - -func (w *principalLifecycleAdapter) Create(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Create(obj.(*Principal)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *principalLifecycleAdapter) Finalize(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Remove(obj.(*Principal)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *principalLifecycleAdapter) Updated(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Updated(obj.(*Principal)) - if o == nil { - return nil, err - } - return o, err -} - -func NewPrincipalLifecycleAdapter(name string, clusterScoped bool, client PrincipalInterface, l PrincipalLifecycle) PrincipalHandlerFunc { - if clusterScoped { - resource.PutClusterScoped(PrincipalGroupVersionResource) - } - adapter := &principalLifecycleAdapter{lifecycle: l} - syncFn := lifecycle.NewObjectLifecycleAdapter(name, clusterScoped, adapter, client.ObjectClient()) - return func(key string, obj *Principal) (runtime.Object, error) { - newObj, err := syncFn(key, obj) - if o, ok := newObj.(runtime.Object); ok { - return o, err - } - return nil, err - } -} diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_project_alert_controller.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_project_alert_controller.go deleted file mode 100644 index ca84a986..00000000 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_project_alert_controller.go +++ /dev/null @@ -1,321 +0,0 @@ -package v3 - -import ( - "context" - "time" - - "github.com/rancher/norman/controller" - "github.com/rancher/norman/objectclient" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/apimachinery/pkg/types" - "k8s.io/apimachinery/pkg/watch" - "k8s.io/client-go/tools/cache" -) - -var ( - ProjectAlertGroupVersionKind = schema.GroupVersionKind{ - Version: Version, - Group: GroupName, - Kind: "ProjectAlert", - } - ProjectAlertResource = metav1.APIResource{ - Name: "projectalerts", - SingularName: "projectalert", - Namespaced: true, - - Kind: ProjectAlertGroupVersionKind.Kind, - } - - ProjectAlertGroupVersionResource = schema.GroupVersionResource{ - Group: GroupName, - Version: Version, - Resource: "projectalerts", - } -) - -func init() { - resource.Put(ProjectAlertGroupVersionResource) -} - -func NewProjectAlert(namespace, name string, obj ProjectAlert) *ProjectAlert { - obj.APIVersion, obj.Kind = ProjectAlertGroupVersionKind.ToAPIVersionAndKind() - obj.Name = name - obj.Namespace = namespace - return &obj -} - -type ProjectAlertList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []ProjectAlert `json:"items"` -} - -type ProjectAlertHandlerFunc func(key string, obj *ProjectAlert) (runtime.Object, error) - -type ProjectAlertChangeHandlerFunc func(obj *ProjectAlert) (runtime.Object, error) - -type ProjectAlertLister interface { - List(namespace string, selector labels.Selector) (ret []*ProjectAlert, err error) - Get(namespace, name string) (*ProjectAlert, error) -} - -type ProjectAlertController interface { - Generic() controller.GenericController - Informer() cache.SharedIndexInformer - Lister() ProjectAlertLister - AddHandler(ctx context.Context, name string, handler ProjectAlertHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync ProjectAlertHandlerFunc) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, handler ProjectAlertHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, handler ProjectAlertHandlerFunc) - Enqueue(namespace, name string) - EnqueueAfter(namespace, name string, after time.Duration) -} - -type ProjectAlertInterface interface { - ObjectClient() *objectclient.ObjectClient - Create(*ProjectAlert) (*ProjectAlert, error) - GetNamespaced(namespace, name string, opts metav1.GetOptions) (*ProjectAlert, error) - Get(name string, opts metav1.GetOptions) (*ProjectAlert, error) - Update(*ProjectAlert) (*ProjectAlert, error) - Delete(name string, options *metav1.DeleteOptions) error - DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error - List(opts metav1.ListOptions) (*ProjectAlertList, error) - ListNamespaced(namespace string, opts metav1.ListOptions) (*ProjectAlertList, error) - Watch(opts metav1.ListOptions) (watch.Interface, error) - DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error - Controller() ProjectAlertController - AddHandler(ctx context.Context, name string, sync ProjectAlertHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync ProjectAlertHandlerFunc) - AddLifecycle(ctx context.Context, name string, lifecycle ProjectAlertLifecycle) - AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle ProjectAlertLifecycle) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync ProjectAlertHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync ProjectAlertHandlerFunc) - AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle ProjectAlertLifecycle) - AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle ProjectAlertLifecycle) -} - -type projectAlertLister struct { - controller *projectAlertController -} - -func (l *projectAlertLister) List(namespace string, selector labels.Selector) (ret []*ProjectAlert, err error) { - err = cache.ListAllByNamespace(l.controller.Informer().GetIndexer(), namespace, selector, func(obj interface{}) { - ret = append(ret, obj.(*ProjectAlert)) - }) - return -} - -func (l *projectAlertLister) Get(namespace, name string) (*ProjectAlert, error) { - var key string - if namespace != "" { - key = namespace + "/" + name - } else { - key = name - } - obj, exists, err := l.controller.Informer().GetIndexer().GetByKey(key) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(schema.GroupResource{ - Group: ProjectAlertGroupVersionKind.Group, - Resource: ProjectAlertGroupVersionResource.Resource, - }, key) - } - return obj.(*ProjectAlert), nil -} - -type projectAlertController struct { - controller.GenericController -} - -func (c *projectAlertController) Generic() controller.GenericController { - return c.GenericController -} - -func (c *projectAlertController) Lister() ProjectAlertLister { - return &projectAlertLister{ - controller: c, - } -} - -func (c *projectAlertController) AddHandler(ctx context.Context, name string, handler ProjectAlertHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*ProjectAlert); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *projectAlertController) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, handler ProjectAlertHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*ProjectAlert); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *projectAlertController) AddClusterScopedHandler(ctx context.Context, name, cluster string, handler ProjectAlertHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*ProjectAlert); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *projectAlertController) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, cluster string, handler ProjectAlertHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*ProjectAlert); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -type projectAlertFactory struct { -} - -func (c projectAlertFactory) Object() runtime.Object { - return &ProjectAlert{} -} - -func (c projectAlertFactory) List() runtime.Object { - return &ProjectAlertList{} -} - -func (s *projectAlertClient) Controller() ProjectAlertController { - genericController := controller.NewGenericController(ProjectAlertGroupVersionKind.Kind+"Controller", - s.client.controllerFactory.ForResourceKind(ProjectAlertGroupVersionResource, ProjectAlertGroupVersionKind.Kind, true)) - - return &projectAlertController{ - GenericController: genericController, - } -} - -type projectAlertClient struct { - client *Client - ns string - objectClient *objectclient.ObjectClient - controller ProjectAlertController -} - -func (s *projectAlertClient) ObjectClient() *objectclient.ObjectClient { - return s.objectClient -} - -func (s *projectAlertClient) Create(o *ProjectAlert) (*ProjectAlert, error) { - obj, err := s.objectClient.Create(o) - return obj.(*ProjectAlert), err -} - -func (s *projectAlertClient) Get(name string, opts metav1.GetOptions) (*ProjectAlert, error) { - obj, err := s.objectClient.Get(name, opts) - return obj.(*ProjectAlert), err -} - -func (s *projectAlertClient) GetNamespaced(namespace, name string, opts metav1.GetOptions) (*ProjectAlert, error) { - obj, err := s.objectClient.GetNamespaced(namespace, name, opts) - return obj.(*ProjectAlert), err -} - -func (s *projectAlertClient) Update(o *ProjectAlert) (*ProjectAlert, error) { - obj, err := s.objectClient.Update(o.Name, o) - return obj.(*ProjectAlert), err -} - -func (s *projectAlertClient) UpdateStatus(o *ProjectAlert) (*ProjectAlert, error) { - obj, err := s.objectClient.UpdateStatus(o.Name, o) - return obj.(*ProjectAlert), err -} - -func (s *projectAlertClient) Delete(name string, options *metav1.DeleteOptions) error { - return s.objectClient.Delete(name, options) -} - -func (s *projectAlertClient) DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error { - return s.objectClient.DeleteNamespaced(namespace, name, options) -} - -func (s *projectAlertClient) List(opts metav1.ListOptions) (*ProjectAlertList, error) { - obj, err := s.objectClient.List(opts) - return obj.(*ProjectAlertList), err -} - -func (s *projectAlertClient) ListNamespaced(namespace string, opts metav1.ListOptions) (*ProjectAlertList, error) { - obj, err := s.objectClient.ListNamespaced(namespace, opts) - return obj.(*ProjectAlertList), err -} - -func (s *projectAlertClient) Watch(opts metav1.ListOptions) (watch.Interface, error) { - return s.objectClient.Watch(opts) -} - -// Patch applies the patch and returns the patched deployment. -func (s *projectAlertClient) Patch(o *ProjectAlert, patchType types.PatchType, data []byte, subresources ...string) (*ProjectAlert, error) { - obj, err := s.objectClient.Patch(o.Name, o, patchType, data, subresources...) - return obj.(*ProjectAlert), err -} - -func (s *projectAlertClient) DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error { - return s.objectClient.DeleteCollection(deleteOpts, listOpts) -} - -func (s *projectAlertClient) AddHandler(ctx context.Context, name string, sync ProjectAlertHandlerFunc) { - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *projectAlertClient) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync ProjectAlertHandlerFunc) { - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *projectAlertClient) AddLifecycle(ctx context.Context, name string, lifecycle ProjectAlertLifecycle) { - sync := NewProjectAlertLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *projectAlertClient) AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle ProjectAlertLifecycle) { - sync := NewProjectAlertLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *projectAlertClient) AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync ProjectAlertHandlerFunc) { - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *projectAlertClient) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync ProjectAlertHandlerFunc) { - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} - -func (s *projectAlertClient) AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle ProjectAlertLifecycle) { - sync := NewProjectAlertLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *projectAlertClient) AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle ProjectAlertLifecycle) { - sync := NewProjectAlertLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_project_alert_group_controller.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_project_alert_group_controller.go deleted file mode 100644 index 2591881f..00000000 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_project_alert_group_controller.go +++ /dev/null @@ -1,321 +0,0 @@ -package v3 - -import ( - "context" - "time" - - "github.com/rancher/norman/controller" - "github.com/rancher/norman/objectclient" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/apimachinery/pkg/types" - "k8s.io/apimachinery/pkg/watch" - "k8s.io/client-go/tools/cache" -) - -var ( - ProjectAlertGroupGroupVersionKind = schema.GroupVersionKind{ - Version: Version, - Group: GroupName, - Kind: "ProjectAlertGroup", - } - ProjectAlertGroupResource = metav1.APIResource{ - Name: "projectalertgroups", - SingularName: "projectalertgroup", - Namespaced: true, - - Kind: ProjectAlertGroupGroupVersionKind.Kind, - } - - ProjectAlertGroupGroupVersionResource = schema.GroupVersionResource{ - Group: GroupName, - Version: Version, - Resource: "projectalertgroups", - } -) - -func init() { - resource.Put(ProjectAlertGroupGroupVersionResource) -} - -func NewProjectAlertGroup(namespace, name string, obj ProjectAlertGroup) *ProjectAlertGroup { - obj.APIVersion, obj.Kind = ProjectAlertGroupGroupVersionKind.ToAPIVersionAndKind() - obj.Name = name - obj.Namespace = namespace - return &obj -} - -type ProjectAlertGroupList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []ProjectAlertGroup `json:"items"` -} - -type ProjectAlertGroupHandlerFunc func(key string, obj *ProjectAlertGroup) (runtime.Object, error) - -type ProjectAlertGroupChangeHandlerFunc func(obj *ProjectAlertGroup) (runtime.Object, error) - -type ProjectAlertGroupLister interface { - List(namespace string, selector labels.Selector) (ret []*ProjectAlertGroup, err error) - Get(namespace, name string) (*ProjectAlertGroup, error) -} - -type ProjectAlertGroupController interface { - Generic() controller.GenericController - Informer() cache.SharedIndexInformer - Lister() ProjectAlertGroupLister - AddHandler(ctx context.Context, name string, handler ProjectAlertGroupHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync ProjectAlertGroupHandlerFunc) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, handler ProjectAlertGroupHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, handler ProjectAlertGroupHandlerFunc) - Enqueue(namespace, name string) - EnqueueAfter(namespace, name string, after time.Duration) -} - -type ProjectAlertGroupInterface interface { - ObjectClient() *objectclient.ObjectClient - Create(*ProjectAlertGroup) (*ProjectAlertGroup, error) - GetNamespaced(namespace, name string, opts metav1.GetOptions) (*ProjectAlertGroup, error) - Get(name string, opts metav1.GetOptions) (*ProjectAlertGroup, error) - Update(*ProjectAlertGroup) (*ProjectAlertGroup, error) - Delete(name string, options *metav1.DeleteOptions) error - DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error - List(opts metav1.ListOptions) (*ProjectAlertGroupList, error) - ListNamespaced(namespace string, opts metav1.ListOptions) (*ProjectAlertGroupList, error) - Watch(opts metav1.ListOptions) (watch.Interface, error) - DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error - Controller() ProjectAlertGroupController - AddHandler(ctx context.Context, name string, sync ProjectAlertGroupHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync ProjectAlertGroupHandlerFunc) - AddLifecycle(ctx context.Context, name string, lifecycle ProjectAlertGroupLifecycle) - AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle ProjectAlertGroupLifecycle) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync ProjectAlertGroupHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync ProjectAlertGroupHandlerFunc) - AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle ProjectAlertGroupLifecycle) - AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle ProjectAlertGroupLifecycle) -} - -type projectAlertGroupLister struct { - controller *projectAlertGroupController -} - -func (l *projectAlertGroupLister) List(namespace string, selector labels.Selector) (ret []*ProjectAlertGroup, err error) { - err = cache.ListAllByNamespace(l.controller.Informer().GetIndexer(), namespace, selector, func(obj interface{}) { - ret = append(ret, obj.(*ProjectAlertGroup)) - }) - return -} - -func (l *projectAlertGroupLister) Get(namespace, name string) (*ProjectAlertGroup, error) { - var key string - if namespace != "" { - key = namespace + "/" + name - } else { - key = name - } - obj, exists, err := l.controller.Informer().GetIndexer().GetByKey(key) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(schema.GroupResource{ - Group: ProjectAlertGroupGroupVersionKind.Group, - Resource: ProjectAlertGroupGroupVersionResource.Resource, - }, key) - } - return obj.(*ProjectAlertGroup), nil -} - -type projectAlertGroupController struct { - controller.GenericController -} - -func (c *projectAlertGroupController) Generic() controller.GenericController { - return c.GenericController -} - -func (c *projectAlertGroupController) Lister() ProjectAlertGroupLister { - return &projectAlertGroupLister{ - controller: c, - } -} - -func (c *projectAlertGroupController) AddHandler(ctx context.Context, name string, handler ProjectAlertGroupHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*ProjectAlertGroup); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *projectAlertGroupController) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, handler ProjectAlertGroupHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*ProjectAlertGroup); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *projectAlertGroupController) AddClusterScopedHandler(ctx context.Context, name, cluster string, handler ProjectAlertGroupHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*ProjectAlertGroup); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *projectAlertGroupController) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, cluster string, handler ProjectAlertGroupHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*ProjectAlertGroup); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -type projectAlertGroupFactory struct { -} - -func (c projectAlertGroupFactory) Object() runtime.Object { - return &ProjectAlertGroup{} -} - -func (c projectAlertGroupFactory) List() runtime.Object { - return &ProjectAlertGroupList{} -} - -func (s *projectAlertGroupClient) Controller() ProjectAlertGroupController { - genericController := controller.NewGenericController(ProjectAlertGroupGroupVersionKind.Kind+"Controller", - s.client.controllerFactory.ForResourceKind(ProjectAlertGroupGroupVersionResource, ProjectAlertGroupGroupVersionKind.Kind, true)) - - return &projectAlertGroupController{ - GenericController: genericController, - } -} - -type projectAlertGroupClient struct { - client *Client - ns string - objectClient *objectclient.ObjectClient - controller ProjectAlertGroupController -} - -func (s *projectAlertGroupClient) ObjectClient() *objectclient.ObjectClient { - return s.objectClient -} - -func (s *projectAlertGroupClient) Create(o *ProjectAlertGroup) (*ProjectAlertGroup, error) { - obj, err := s.objectClient.Create(o) - return obj.(*ProjectAlertGroup), err -} - -func (s *projectAlertGroupClient) Get(name string, opts metav1.GetOptions) (*ProjectAlertGroup, error) { - obj, err := s.objectClient.Get(name, opts) - return obj.(*ProjectAlertGroup), err -} - -func (s *projectAlertGroupClient) GetNamespaced(namespace, name string, opts metav1.GetOptions) (*ProjectAlertGroup, error) { - obj, err := s.objectClient.GetNamespaced(namespace, name, opts) - return obj.(*ProjectAlertGroup), err -} - -func (s *projectAlertGroupClient) Update(o *ProjectAlertGroup) (*ProjectAlertGroup, error) { - obj, err := s.objectClient.Update(o.Name, o) - return obj.(*ProjectAlertGroup), err -} - -func (s *projectAlertGroupClient) UpdateStatus(o *ProjectAlertGroup) (*ProjectAlertGroup, error) { - obj, err := s.objectClient.UpdateStatus(o.Name, o) - return obj.(*ProjectAlertGroup), err -} - -func (s *projectAlertGroupClient) Delete(name string, options *metav1.DeleteOptions) error { - return s.objectClient.Delete(name, options) -} - -func (s *projectAlertGroupClient) DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error { - return s.objectClient.DeleteNamespaced(namespace, name, options) -} - -func (s *projectAlertGroupClient) List(opts metav1.ListOptions) (*ProjectAlertGroupList, error) { - obj, err := s.objectClient.List(opts) - return obj.(*ProjectAlertGroupList), err -} - -func (s *projectAlertGroupClient) ListNamespaced(namespace string, opts metav1.ListOptions) (*ProjectAlertGroupList, error) { - obj, err := s.objectClient.ListNamespaced(namespace, opts) - return obj.(*ProjectAlertGroupList), err -} - -func (s *projectAlertGroupClient) Watch(opts metav1.ListOptions) (watch.Interface, error) { - return s.objectClient.Watch(opts) -} - -// Patch applies the patch and returns the patched deployment. -func (s *projectAlertGroupClient) Patch(o *ProjectAlertGroup, patchType types.PatchType, data []byte, subresources ...string) (*ProjectAlertGroup, error) { - obj, err := s.objectClient.Patch(o.Name, o, patchType, data, subresources...) - return obj.(*ProjectAlertGroup), err -} - -func (s *projectAlertGroupClient) DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error { - return s.objectClient.DeleteCollection(deleteOpts, listOpts) -} - -func (s *projectAlertGroupClient) AddHandler(ctx context.Context, name string, sync ProjectAlertGroupHandlerFunc) { - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *projectAlertGroupClient) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync ProjectAlertGroupHandlerFunc) { - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *projectAlertGroupClient) AddLifecycle(ctx context.Context, name string, lifecycle ProjectAlertGroupLifecycle) { - sync := NewProjectAlertGroupLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *projectAlertGroupClient) AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle ProjectAlertGroupLifecycle) { - sync := NewProjectAlertGroupLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *projectAlertGroupClient) AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync ProjectAlertGroupHandlerFunc) { - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *projectAlertGroupClient) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync ProjectAlertGroupHandlerFunc) { - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} - -func (s *projectAlertGroupClient) AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle ProjectAlertGroupLifecycle) { - sync := NewProjectAlertGroupLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *projectAlertGroupClient) AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle ProjectAlertGroupLifecycle) { - sync := NewProjectAlertGroupLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_project_alert_group_lifecycle_adapter.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_project_alert_group_lifecycle_adapter.go deleted file mode 100644 index 8062970f..00000000 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_project_alert_group_lifecycle_adapter.go +++ /dev/null @@ -1,66 +0,0 @@ -package v3 - -import ( - "github.com/rancher/norman/lifecycle" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/runtime" -) - -type ProjectAlertGroupLifecycle interface { - Create(obj *ProjectAlertGroup) (runtime.Object, error) - Remove(obj *ProjectAlertGroup) (runtime.Object, error) - Updated(obj *ProjectAlertGroup) (runtime.Object, error) -} - -type projectAlertGroupLifecycleAdapter struct { - lifecycle ProjectAlertGroupLifecycle -} - -func (w *projectAlertGroupLifecycleAdapter) HasCreate() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasCreate() -} - -func (w *projectAlertGroupLifecycleAdapter) HasFinalize() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasFinalize() -} - -func (w *projectAlertGroupLifecycleAdapter) Create(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Create(obj.(*ProjectAlertGroup)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *projectAlertGroupLifecycleAdapter) Finalize(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Remove(obj.(*ProjectAlertGroup)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *projectAlertGroupLifecycleAdapter) Updated(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Updated(obj.(*ProjectAlertGroup)) - if o == nil { - return nil, err - } - return o, err -} - -func NewProjectAlertGroupLifecycleAdapter(name string, clusterScoped bool, client ProjectAlertGroupInterface, l ProjectAlertGroupLifecycle) ProjectAlertGroupHandlerFunc { - if clusterScoped { - resource.PutClusterScoped(ProjectAlertGroupGroupVersionResource) - } - adapter := &projectAlertGroupLifecycleAdapter{lifecycle: l} - syncFn := lifecycle.NewObjectLifecycleAdapter(name, clusterScoped, adapter, client.ObjectClient()) - return func(key string, obj *ProjectAlertGroup) (runtime.Object, error) { - newObj, err := syncFn(key, obj) - if o, ok := newObj.(runtime.Object); ok { - return o, err - } - return nil, err - } -} diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_project_alert_lifecycle_adapter.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_project_alert_lifecycle_adapter.go deleted file mode 100644 index a4a01248..00000000 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_project_alert_lifecycle_adapter.go +++ /dev/null @@ -1,66 +0,0 @@ -package v3 - -import ( - "github.com/rancher/norman/lifecycle" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/runtime" -) - -type ProjectAlertLifecycle interface { - Create(obj *ProjectAlert) (runtime.Object, error) - Remove(obj *ProjectAlert) (runtime.Object, error) - Updated(obj *ProjectAlert) (runtime.Object, error) -} - -type projectAlertLifecycleAdapter struct { - lifecycle ProjectAlertLifecycle -} - -func (w *projectAlertLifecycleAdapter) HasCreate() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasCreate() -} - -func (w *projectAlertLifecycleAdapter) HasFinalize() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasFinalize() -} - -func (w *projectAlertLifecycleAdapter) Create(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Create(obj.(*ProjectAlert)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *projectAlertLifecycleAdapter) Finalize(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Remove(obj.(*ProjectAlert)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *projectAlertLifecycleAdapter) Updated(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Updated(obj.(*ProjectAlert)) - if o == nil { - return nil, err - } - return o, err -} - -func NewProjectAlertLifecycleAdapter(name string, clusterScoped bool, client ProjectAlertInterface, l ProjectAlertLifecycle) ProjectAlertHandlerFunc { - if clusterScoped { - resource.PutClusterScoped(ProjectAlertGroupVersionResource) - } - adapter := &projectAlertLifecycleAdapter{lifecycle: l} - syncFn := lifecycle.NewObjectLifecycleAdapter(name, clusterScoped, adapter, client.ObjectClient()) - return func(key string, obj *ProjectAlert) (runtime.Object, error) { - newObj, err := syncFn(key, obj) - if o, ok := newObj.(runtime.Object); ok { - return o, err - } - return nil, err - } -} diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_project_alert_rule_controller.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_project_alert_rule_controller.go deleted file mode 100644 index afa41f40..00000000 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_project_alert_rule_controller.go +++ /dev/null @@ -1,321 +0,0 @@ -package v3 - -import ( - "context" - "time" - - "github.com/rancher/norman/controller" - "github.com/rancher/norman/objectclient" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/apimachinery/pkg/types" - "k8s.io/apimachinery/pkg/watch" - "k8s.io/client-go/tools/cache" -) - -var ( - ProjectAlertRuleGroupVersionKind = schema.GroupVersionKind{ - Version: Version, - Group: GroupName, - Kind: "ProjectAlertRule", - } - ProjectAlertRuleResource = metav1.APIResource{ - Name: "projectalertrules", - SingularName: "projectalertrule", - Namespaced: true, - - Kind: ProjectAlertRuleGroupVersionKind.Kind, - } - - ProjectAlertRuleGroupVersionResource = schema.GroupVersionResource{ - Group: GroupName, - Version: Version, - Resource: "projectalertrules", - } -) - -func init() { - resource.Put(ProjectAlertRuleGroupVersionResource) -} - -func NewProjectAlertRule(namespace, name string, obj ProjectAlertRule) *ProjectAlertRule { - obj.APIVersion, obj.Kind = ProjectAlertRuleGroupVersionKind.ToAPIVersionAndKind() - obj.Name = name - obj.Namespace = namespace - return &obj -} - -type ProjectAlertRuleList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []ProjectAlertRule `json:"items"` -} - -type ProjectAlertRuleHandlerFunc func(key string, obj *ProjectAlertRule) (runtime.Object, error) - -type ProjectAlertRuleChangeHandlerFunc func(obj *ProjectAlertRule) (runtime.Object, error) - -type ProjectAlertRuleLister interface { - List(namespace string, selector labels.Selector) (ret []*ProjectAlertRule, err error) - Get(namespace, name string) (*ProjectAlertRule, error) -} - -type ProjectAlertRuleController interface { - Generic() controller.GenericController - Informer() cache.SharedIndexInformer - Lister() ProjectAlertRuleLister - AddHandler(ctx context.Context, name string, handler ProjectAlertRuleHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync ProjectAlertRuleHandlerFunc) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, handler ProjectAlertRuleHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, handler ProjectAlertRuleHandlerFunc) - Enqueue(namespace, name string) - EnqueueAfter(namespace, name string, after time.Duration) -} - -type ProjectAlertRuleInterface interface { - ObjectClient() *objectclient.ObjectClient - Create(*ProjectAlertRule) (*ProjectAlertRule, error) - GetNamespaced(namespace, name string, opts metav1.GetOptions) (*ProjectAlertRule, error) - Get(name string, opts metav1.GetOptions) (*ProjectAlertRule, error) - Update(*ProjectAlertRule) (*ProjectAlertRule, error) - Delete(name string, options *metav1.DeleteOptions) error - DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error - List(opts metav1.ListOptions) (*ProjectAlertRuleList, error) - ListNamespaced(namespace string, opts metav1.ListOptions) (*ProjectAlertRuleList, error) - Watch(opts metav1.ListOptions) (watch.Interface, error) - DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error - Controller() ProjectAlertRuleController - AddHandler(ctx context.Context, name string, sync ProjectAlertRuleHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync ProjectAlertRuleHandlerFunc) - AddLifecycle(ctx context.Context, name string, lifecycle ProjectAlertRuleLifecycle) - AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle ProjectAlertRuleLifecycle) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync ProjectAlertRuleHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync ProjectAlertRuleHandlerFunc) - AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle ProjectAlertRuleLifecycle) - AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle ProjectAlertRuleLifecycle) -} - -type projectAlertRuleLister struct { - controller *projectAlertRuleController -} - -func (l *projectAlertRuleLister) List(namespace string, selector labels.Selector) (ret []*ProjectAlertRule, err error) { - err = cache.ListAllByNamespace(l.controller.Informer().GetIndexer(), namespace, selector, func(obj interface{}) { - ret = append(ret, obj.(*ProjectAlertRule)) - }) - return -} - -func (l *projectAlertRuleLister) Get(namespace, name string) (*ProjectAlertRule, error) { - var key string - if namespace != "" { - key = namespace + "/" + name - } else { - key = name - } - obj, exists, err := l.controller.Informer().GetIndexer().GetByKey(key) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(schema.GroupResource{ - Group: ProjectAlertRuleGroupVersionKind.Group, - Resource: ProjectAlertRuleGroupVersionResource.Resource, - }, key) - } - return obj.(*ProjectAlertRule), nil -} - -type projectAlertRuleController struct { - controller.GenericController -} - -func (c *projectAlertRuleController) Generic() controller.GenericController { - return c.GenericController -} - -func (c *projectAlertRuleController) Lister() ProjectAlertRuleLister { - return &projectAlertRuleLister{ - controller: c, - } -} - -func (c *projectAlertRuleController) AddHandler(ctx context.Context, name string, handler ProjectAlertRuleHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*ProjectAlertRule); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *projectAlertRuleController) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, handler ProjectAlertRuleHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*ProjectAlertRule); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *projectAlertRuleController) AddClusterScopedHandler(ctx context.Context, name, cluster string, handler ProjectAlertRuleHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*ProjectAlertRule); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *projectAlertRuleController) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, cluster string, handler ProjectAlertRuleHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*ProjectAlertRule); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -type projectAlertRuleFactory struct { -} - -func (c projectAlertRuleFactory) Object() runtime.Object { - return &ProjectAlertRule{} -} - -func (c projectAlertRuleFactory) List() runtime.Object { - return &ProjectAlertRuleList{} -} - -func (s *projectAlertRuleClient) Controller() ProjectAlertRuleController { - genericController := controller.NewGenericController(ProjectAlertRuleGroupVersionKind.Kind+"Controller", - s.client.controllerFactory.ForResourceKind(ProjectAlertRuleGroupVersionResource, ProjectAlertRuleGroupVersionKind.Kind, true)) - - return &projectAlertRuleController{ - GenericController: genericController, - } -} - -type projectAlertRuleClient struct { - client *Client - ns string - objectClient *objectclient.ObjectClient - controller ProjectAlertRuleController -} - -func (s *projectAlertRuleClient) ObjectClient() *objectclient.ObjectClient { - return s.objectClient -} - -func (s *projectAlertRuleClient) Create(o *ProjectAlertRule) (*ProjectAlertRule, error) { - obj, err := s.objectClient.Create(o) - return obj.(*ProjectAlertRule), err -} - -func (s *projectAlertRuleClient) Get(name string, opts metav1.GetOptions) (*ProjectAlertRule, error) { - obj, err := s.objectClient.Get(name, opts) - return obj.(*ProjectAlertRule), err -} - -func (s *projectAlertRuleClient) GetNamespaced(namespace, name string, opts metav1.GetOptions) (*ProjectAlertRule, error) { - obj, err := s.objectClient.GetNamespaced(namespace, name, opts) - return obj.(*ProjectAlertRule), err -} - -func (s *projectAlertRuleClient) Update(o *ProjectAlertRule) (*ProjectAlertRule, error) { - obj, err := s.objectClient.Update(o.Name, o) - return obj.(*ProjectAlertRule), err -} - -func (s *projectAlertRuleClient) UpdateStatus(o *ProjectAlertRule) (*ProjectAlertRule, error) { - obj, err := s.objectClient.UpdateStatus(o.Name, o) - return obj.(*ProjectAlertRule), err -} - -func (s *projectAlertRuleClient) Delete(name string, options *metav1.DeleteOptions) error { - return s.objectClient.Delete(name, options) -} - -func (s *projectAlertRuleClient) DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error { - return s.objectClient.DeleteNamespaced(namespace, name, options) -} - -func (s *projectAlertRuleClient) List(opts metav1.ListOptions) (*ProjectAlertRuleList, error) { - obj, err := s.objectClient.List(opts) - return obj.(*ProjectAlertRuleList), err -} - -func (s *projectAlertRuleClient) ListNamespaced(namespace string, opts metav1.ListOptions) (*ProjectAlertRuleList, error) { - obj, err := s.objectClient.ListNamespaced(namespace, opts) - return obj.(*ProjectAlertRuleList), err -} - -func (s *projectAlertRuleClient) Watch(opts metav1.ListOptions) (watch.Interface, error) { - return s.objectClient.Watch(opts) -} - -// Patch applies the patch and returns the patched deployment. -func (s *projectAlertRuleClient) Patch(o *ProjectAlertRule, patchType types.PatchType, data []byte, subresources ...string) (*ProjectAlertRule, error) { - obj, err := s.objectClient.Patch(o.Name, o, patchType, data, subresources...) - return obj.(*ProjectAlertRule), err -} - -func (s *projectAlertRuleClient) DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error { - return s.objectClient.DeleteCollection(deleteOpts, listOpts) -} - -func (s *projectAlertRuleClient) AddHandler(ctx context.Context, name string, sync ProjectAlertRuleHandlerFunc) { - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *projectAlertRuleClient) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync ProjectAlertRuleHandlerFunc) { - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *projectAlertRuleClient) AddLifecycle(ctx context.Context, name string, lifecycle ProjectAlertRuleLifecycle) { - sync := NewProjectAlertRuleLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *projectAlertRuleClient) AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle ProjectAlertRuleLifecycle) { - sync := NewProjectAlertRuleLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *projectAlertRuleClient) AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync ProjectAlertRuleHandlerFunc) { - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *projectAlertRuleClient) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync ProjectAlertRuleHandlerFunc) { - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} - -func (s *projectAlertRuleClient) AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle ProjectAlertRuleLifecycle) { - sync := NewProjectAlertRuleLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *projectAlertRuleClient) AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle ProjectAlertRuleLifecycle) { - sync := NewProjectAlertRuleLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_project_alert_rule_lifecycle_adapter.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_project_alert_rule_lifecycle_adapter.go deleted file mode 100644 index 041dbbe2..00000000 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_project_alert_rule_lifecycle_adapter.go +++ /dev/null @@ -1,66 +0,0 @@ -package v3 - -import ( - "github.com/rancher/norman/lifecycle" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/runtime" -) - -type ProjectAlertRuleLifecycle interface { - Create(obj *ProjectAlertRule) (runtime.Object, error) - Remove(obj *ProjectAlertRule) (runtime.Object, error) - Updated(obj *ProjectAlertRule) (runtime.Object, error) -} - -type projectAlertRuleLifecycleAdapter struct { - lifecycle ProjectAlertRuleLifecycle -} - -func (w *projectAlertRuleLifecycleAdapter) HasCreate() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasCreate() -} - -func (w *projectAlertRuleLifecycleAdapter) HasFinalize() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasFinalize() -} - -func (w *projectAlertRuleLifecycleAdapter) Create(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Create(obj.(*ProjectAlertRule)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *projectAlertRuleLifecycleAdapter) Finalize(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Remove(obj.(*ProjectAlertRule)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *projectAlertRuleLifecycleAdapter) Updated(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Updated(obj.(*ProjectAlertRule)) - if o == nil { - return nil, err - } - return o, err -} - -func NewProjectAlertRuleLifecycleAdapter(name string, clusterScoped bool, client ProjectAlertRuleInterface, l ProjectAlertRuleLifecycle) ProjectAlertRuleHandlerFunc { - if clusterScoped { - resource.PutClusterScoped(ProjectAlertRuleGroupVersionResource) - } - adapter := &projectAlertRuleLifecycleAdapter{lifecycle: l} - syncFn := lifecycle.NewObjectLifecycleAdapter(name, clusterScoped, adapter, client.ObjectClient()) - return func(key string, obj *ProjectAlertRule) (runtime.Object, error) { - newObj, err := syncFn(key, obj) - if o, ok := newObj.(runtime.Object); ok { - return o, err - } - return nil, err - } -} diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_project_catalog_controller.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_project_catalog_controller.go deleted file mode 100644 index 70dd4254..00000000 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_project_catalog_controller.go +++ /dev/null @@ -1,321 +0,0 @@ -package v3 - -import ( - "context" - "time" - - "github.com/rancher/norman/controller" - "github.com/rancher/norman/objectclient" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/apimachinery/pkg/types" - "k8s.io/apimachinery/pkg/watch" - "k8s.io/client-go/tools/cache" -) - -var ( - ProjectCatalogGroupVersionKind = schema.GroupVersionKind{ - Version: Version, - Group: GroupName, - Kind: "ProjectCatalog", - } - ProjectCatalogResource = metav1.APIResource{ - Name: "projectcatalogs", - SingularName: "projectcatalog", - Namespaced: true, - - Kind: ProjectCatalogGroupVersionKind.Kind, - } - - ProjectCatalogGroupVersionResource = schema.GroupVersionResource{ - Group: GroupName, - Version: Version, - Resource: "projectcatalogs", - } -) - -func init() { - resource.Put(ProjectCatalogGroupVersionResource) -} - -func NewProjectCatalog(namespace, name string, obj ProjectCatalog) *ProjectCatalog { - obj.APIVersion, obj.Kind = ProjectCatalogGroupVersionKind.ToAPIVersionAndKind() - obj.Name = name - obj.Namespace = namespace - return &obj -} - -type ProjectCatalogList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []ProjectCatalog `json:"items"` -} - -type ProjectCatalogHandlerFunc func(key string, obj *ProjectCatalog) (runtime.Object, error) - -type ProjectCatalogChangeHandlerFunc func(obj *ProjectCatalog) (runtime.Object, error) - -type ProjectCatalogLister interface { - List(namespace string, selector labels.Selector) (ret []*ProjectCatalog, err error) - Get(namespace, name string) (*ProjectCatalog, error) -} - -type ProjectCatalogController interface { - Generic() controller.GenericController - Informer() cache.SharedIndexInformer - Lister() ProjectCatalogLister - AddHandler(ctx context.Context, name string, handler ProjectCatalogHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync ProjectCatalogHandlerFunc) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, handler ProjectCatalogHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, handler ProjectCatalogHandlerFunc) - Enqueue(namespace, name string) - EnqueueAfter(namespace, name string, after time.Duration) -} - -type ProjectCatalogInterface interface { - ObjectClient() *objectclient.ObjectClient - Create(*ProjectCatalog) (*ProjectCatalog, error) - GetNamespaced(namespace, name string, opts metav1.GetOptions) (*ProjectCatalog, error) - Get(name string, opts metav1.GetOptions) (*ProjectCatalog, error) - Update(*ProjectCatalog) (*ProjectCatalog, error) - Delete(name string, options *metav1.DeleteOptions) error - DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error - List(opts metav1.ListOptions) (*ProjectCatalogList, error) - ListNamespaced(namespace string, opts metav1.ListOptions) (*ProjectCatalogList, error) - Watch(opts metav1.ListOptions) (watch.Interface, error) - DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error - Controller() ProjectCatalogController - AddHandler(ctx context.Context, name string, sync ProjectCatalogHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync ProjectCatalogHandlerFunc) - AddLifecycle(ctx context.Context, name string, lifecycle ProjectCatalogLifecycle) - AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle ProjectCatalogLifecycle) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync ProjectCatalogHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync ProjectCatalogHandlerFunc) - AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle ProjectCatalogLifecycle) - AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle ProjectCatalogLifecycle) -} - -type projectCatalogLister struct { - controller *projectCatalogController -} - -func (l *projectCatalogLister) List(namespace string, selector labels.Selector) (ret []*ProjectCatalog, err error) { - err = cache.ListAllByNamespace(l.controller.Informer().GetIndexer(), namespace, selector, func(obj interface{}) { - ret = append(ret, obj.(*ProjectCatalog)) - }) - return -} - -func (l *projectCatalogLister) Get(namespace, name string) (*ProjectCatalog, error) { - var key string - if namespace != "" { - key = namespace + "/" + name - } else { - key = name - } - obj, exists, err := l.controller.Informer().GetIndexer().GetByKey(key) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(schema.GroupResource{ - Group: ProjectCatalogGroupVersionKind.Group, - Resource: ProjectCatalogGroupVersionResource.Resource, - }, key) - } - return obj.(*ProjectCatalog), nil -} - -type projectCatalogController struct { - controller.GenericController -} - -func (c *projectCatalogController) Generic() controller.GenericController { - return c.GenericController -} - -func (c *projectCatalogController) Lister() ProjectCatalogLister { - return &projectCatalogLister{ - controller: c, - } -} - -func (c *projectCatalogController) AddHandler(ctx context.Context, name string, handler ProjectCatalogHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*ProjectCatalog); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *projectCatalogController) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, handler ProjectCatalogHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*ProjectCatalog); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *projectCatalogController) AddClusterScopedHandler(ctx context.Context, name, cluster string, handler ProjectCatalogHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*ProjectCatalog); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *projectCatalogController) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, cluster string, handler ProjectCatalogHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*ProjectCatalog); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -type projectCatalogFactory struct { -} - -func (c projectCatalogFactory) Object() runtime.Object { - return &ProjectCatalog{} -} - -func (c projectCatalogFactory) List() runtime.Object { - return &ProjectCatalogList{} -} - -func (s *projectCatalogClient) Controller() ProjectCatalogController { - genericController := controller.NewGenericController(ProjectCatalogGroupVersionKind.Kind+"Controller", - s.client.controllerFactory.ForResourceKind(ProjectCatalogGroupVersionResource, ProjectCatalogGroupVersionKind.Kind, true)) - - return &projectCatalogController{ - GenericController: genericController, - } -} - -type projectCatalogClient struct { - client *Client - ns string - objectClient *objectclient.ObjectClient - controller ProjectCatalogController -} - -func (s *projectCatalogClient) ObjectClient() *objectclient.ObjectClient { - return s.objectClient -} - -func (s *projectCatalogClient) Create(o *ProjectCatalog) (*ProjectCatalog, error) { - obj, err := s.objectClient.Create(o) - return obj.(*ProjectCatalog), err -} - -func (s *projectCatalogClient) Get(name string, opts metav1.GetOptions) (*ProjectCatalog, error) { - obj, err := s.objectClient.Get(name, opts) - return obj.(*ProjectCatalog), err -} - -func (s *projectCatalogClient) GetNamespaced(namespace, name string, opts metav1.GetOptions) (*ProjectCatalog, error) { - obj, err := s.objectClient.GetNamespaced(namespace, name, opts) - return obj.(*ProjectCatalog), err -} - -func (s *projectCatalogClient) Update(o *ProjectCatalog) (*ProjectCatalog, error) { - obj, err := s.objectClient.Update(o.Name, o) - return obj.(*ProjectCatalog), err -} - -func (s *projectCatalogClient) UpdateStatus(o *ProjectCatalog) (*ProjectCatalog, error) { - obj, err := s.objectClient.UpdateStatus(o.Name, o) - return obj.(*ProjectCatalog), err -} - -func (s *projectCatalogClient) Delete(name string, options *metav1.DeleteOptions) error { - return s.objectClient.Delete(name, options) -} - -func (s *projectCatalogClient) DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error { - return s.objectClient.DeleteNamespaced(namespace, name, options) -} - -func (s *projectCatalogClient) List(opts metav1.ListOptions) (*ProjectCatalogList, error) { - obj, err := s.objectClient.List(opts) - return obj.(*ProjectCatalogList), err -} - -func (s *projectCatalogClient) ListNamespaced(namespace string, opts metav1.ListOptions) (*ProjectCatalogList, error) { - obj, err := s.objectClient.ListNamespaced(namespace, opts) - return obj.(*ProjectCatalogList), err -} - -func (s *projectCatalogClient) Watch(opts metav1.ListOptions) (watch.Interface, error) { - return s.objectClient.Watch(opts) -} - -// Patch applies the patch and returns the patched deployment. -func (s *projectCatalogClient) Patch(o *ProjectCatalog, patchType types.PatchType, data []byte, subresources ...string) (*ProjectCatalog, error) { - obj, err := s.objectClient.Patch(o.Name, o, patchType, data, subresources...) - return obj.(*ProjectCatalog), err -} - -func (s *projectCatalogClient) DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error { - return s.objectClient.DeleteCollection(deleteOpts, listOpts) -} - -func (s *projectCatalogClient) AddHandler(ctx context.Context, name string, sync ProjectCatalogHandlerFunc) { - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *projectCatalogClient) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync ProjectCatalogHandlerFunc) { - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *projectCatalogClient) AddLifecycle(ctx context.Context, name string, lifecycle ProjectCatalogLifecycle) { - sync := NewProjectCatalogLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *projectCatalogClient) AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle ProjectCatalogLifecycle) { - sync := NewProjectCatalogLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *projectCatalogClient) AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync ProjectCatalogHandlerFunc) { - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *projectCatalogClient) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync ProjectCatalogHandlerFunc) { - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} - -func (s *projectCatalogClient) AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle ProjectCatalogLifecycle) { - sync := NewProjectCatalogLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *projectCatalogClient) AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle ProjectCatalogLifecycle) { - sync := NewProjectCatalogLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_project_catalog_lifecycle_adapter.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_project_catalog_lifecycle_adapter.go deleted file mode 100644 index 7d276428..00000000 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_project_catalog_lifecycle_adapter.go +++ /dev/null @@ -1,66 +0,0 @@ -package v3 - -import ( - "github.com/rancher/norman/lifecycle" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/runtime" -) - -type ProjectCatalogLifecycle interface { - Create(obj *ProjectCatalog) (runtime.Object, error) - Remove(obj *ProjectCatalog) (runtime.Object, error) - Updated(obj *ProjectCatalog) (runtime.Object, error) -} - -type projectCatalogLifecycleAdapter struct { - lifecycle ProjectCatalogLifecycle -} - -func (w *projectCatalogLifecycleAdapter) HasCreate() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasCreate() -} - -func (w *projectCatalogLifecycleAdapter) HasFinalize() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasFinalize() -} - -func (w *projectCatalogLifecycleAdapter) Create(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Create(obj.(*ProjectCatalog)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *projectCatalogLifecycleAdapter) Finalize(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Remove(obj.(*ProjectCatalog)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *projectCatalogLifecycleAdapter) Updated(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Updated(obj.(*ProjectCatalog)) - if o == nil { - return nil, err - } - return o, err -} - -func NewProjectCatalogLifecycleAdapter(name string, clusterScoped bool, client ProjectCatalogInterface, l ProjectCatalogLifecycle) ProjectCatalogHandlerFunc { - if clusterScoped { - resource.PutClusterScoped(ProjectCatalogGroupVersionResource) - } - adapter := &projectCatalogLifecycleAdapter{lifecycle: l} - syncFn := lifecycle.NewObjectLifecycleAdapter(name, clusterScoped, adapter, client.ObjectClient()) - return func(key string, obj *ProjectCatalog) (runtime.Object, error) { - newObj, err := syncFn(key, obj) - if o, ok := newObj.(runtime.Object); ok { - return o, err - } - return nil, err - } -} diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_project_controller.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_project_controller.go deleted file mode 100644 index 354076fc..00000000 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_project_controller.go +++ /dev/null @@ -1,321 +0,0 @@ -package v3 - -import ( - "context" - "time" - - "github.com/rancher/norman/controller" - "github.com/rancher/norman/objectclient" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/apimachinery/pkg/types" - "k8s.io/apimachinery/pkg/watch" - "k8s.io/client-go/tools/cache" -) - -var ( - ProjectGroupVersionKind = schema.GroupVersionKind{ - Version: Version, - Group: GroupName, - Kind: "Project", - } - ProjectResource = metav1.APIResource{ - Name: "projects", - SingularName: "project", - Namespaced: true, - - Kind: ProjectGroupVersionKind.Kind, - } - - ProjectGroupVersionResource = schema.GroupVersionResource{ - Group: GroupName, - Version: Version, - Resource: "projects", - } -) - -func init() { - resource.Put(ProjectGroupVersionResource) -} - -func NewProject(namespace, name string, obj Project) *Project { - obj.APIVersion, obj.Kind = ProjectGroupVersionKind.ToAPIVersionAndKind() - obj.Name = name - obj.Namespace = namespace - return &obj -} - -type ProjectList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []Project `json:"items"` -} - -type ProjectHandlerFunc func(key string, obj *Project) (runtime.Object, error) - -type ProjectChangeHandlerFunc func(obj *Project) (runtime.Object, error) - -type ProjectLister interface { - List(namespace string, selector labels.Selector) (ret []*Project, err error) - Get(namespace, name string) (*Project, error) -} - -type ProjectController interface { - Generic() controller.GenericController - Informer() cache.SharedIndexInformer - Lister() ProjectLister - AddHandler(ctx context.Context, name string, handler ProjectHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync ProjectHandlerFunc) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, handler ProjectHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, handler ProjectHandlerFunc) - Enqueue(namespace, name string) - EnqueueAfter(namespace, name string, after time.Duration) -} - -type ProjectInterface interface { - ObjectClient() *objectclient.ObjectClient - Create(*Project) (*Project, error) - GetNamespaced(namespace, name string, opts metav1.GetOptions) (*Project, error) - Get(name string, opts metav1.GetOptions) (*Project, error) - Update(*Project) (*Project, error) - Delete(name string, options *metav1.DeleteOptions) error - DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error - List(opts metav1.ListOptions) (*ProjectList, error) - ListNamespaced(namespace string, opts metav1.ListOptions) (*ProjectList, error) - Watch(opts metav1.ListOptions) (watch.Interface, error) - DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error - Controller() ProjectController - AddHandler(ctx context.Context, name string, sync ProjectHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync ProjectHandlerFunc) - AddLifecycle(ctx context.Context, name string, lifecycle ProjectLifecycle) - AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle ProjectLifecycle) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync ProjectHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync ProjectHandlerFunc) - AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle ProjectLifecycle) - AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle ProjectLifecycle) -} - -type projectLister struct { - controller *projectController -} - -func (l *projectLister) List(namespace string, selector labels.Selector) (ret []*Project, err error) { - err = cache.ListAllByNamespace(l.controller.Informer().GetIndexer(), namespace, selector, func(obj interface{}) { - ret = append(ret, obj.(*Project)) - }) - return -} - -func (l *projectLister) Get(namespace, name string) (*Project, error) { - var key string - if namespace != "" { - key = namespace + "/" + name - } else { - key = name - } - obj, exists, err := l.controller.Informer().GetIndexer().GetByKey(key) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(schema.GroupResource{ - Group: ProjectGroupVersionKind.Group, - Resource: ProjectGroupVersionResource.Resource, - }, key) - } - return obj.(*Project), nil -} - -type projectController struct { - controller.GenericController -} - -func (c *projectController) Generic() controller.GenericController { - return c.GenericController -} - -func (c *projectController) Lister() ProjectLister { - return &projectLister{ - controller: c, - } -} - -func (c *projectController) AddHandler(ctx context.Context, name string, handler ProjectHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*Project); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *projectController) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, handler ProjectHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*Project); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *projectController) AddClusterScopedHandler(ctx context.Context, name, cluster string, handler ProjectHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*Project); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *projectController) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, cluster string, handler ProjectHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*Project); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -type projectFactory struct { -} - -func (c projectFactory) Object() runtime.Object { - return &Project{} -} - -func (c projectFactory) List() runtime.Object { - return &ProjectList{} -} - -func (s *projectClient) Controller() ProjectController { - genericController := controller.NewGenericController(ProjectGroupVersionKind.Kind+"Controller", - s.client.controllerFactory.ForResourceKind(ProjectGroupVersionResource, ProjectGroupVersionKind.Kind, true)) - - return &projectController{ - GenericController: genericController, - } -} - -type projectClient struct { - client *Client - ns string - objectClient *objectclient.ObjectClient - controller ProjectController -} - -func (s *projectClient) ObjectClient() *objectclient.ObjectClient { - return s.objectClient -} - -func (s *projectClient) Create(o *Project) (*Project, error) { - obj, err := s.objectClient.Create(o) - return obj.(*Project), err -} - -func (s *projectClient) Get(name string, opts metav1.GetOptions) (*Project, error) { - obj, err := s.objectClient.Get(name, opts) - return obj.(*Project), err -} - -func (s *projectClient) GetNamespaced(namespace, name string, opts metav1.GetOptions) (*Project, error) { - obj, err := s.objectClient.GetNamespaced(namespace, name, opts) - return obj.(*Project), err -} - -func (s *projectClient) Update(o *Project) (*Project, error) { - obj, err := s.objectClient.Update(o.Name, o) - return obj.(*Project), err -} - -func (s *projectClient) UpdateStatus(o *Project) (*Project, error) { - obj, err := s.objectClient.UpdateStatus(o.Name, o) - return obj.(*Project), err -} - -func (s *projectClient) Delete(name string, options *metav1.DeleteOptions) error { - return s.objectClient.Delete(name, options) -} - -func (s *projectClient) DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error { - return s.objectClient.DeleteNamespaced(namespace, name, options) -} - -func (s *projectClient) List(opts metav1.ListOptions) (*ProjectList, error) { - obj, err := s.objectClient.List(opts) - return obj.(*ProjectList), err -} - -func (s *projectClient) ListNamespaced(namespace string, opts metav1.ListOptions) (*ProjectList, error) { - obj, err := s.objectClient.ListNamespaced(namespace, opts) - return obj.(*ProjectList), err -} - -func (s *projectClient) Watch(opts metav1.ListOptions) (watch.Interface, error) { - return s.objectClient.Watch(opts) -} - -// Patch applies the patch and returns the patched deployment. -func (s *projectClient) Patch(o *Project, patchType types.PatchType, data []byte, subresources ...string) (*Project, error) { - obj, err := s.objectClient.Patch(o.Name, o, patchType, data, subresources...) - return obj.(*Project), err -} - -func (s *projectClient) DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error { - return s.objectClient.DeleteCollection(deleteOpts, listOpts) -} - -func (s *projectClient) AddHandler(ctx context.Context, name string, sync ProjectHandlerFunc) { - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *projectClient) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync ProjectHandlerFunc) { - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *projectClient) AddLifecycle(ctx context.Context, name string, lifecycle ProjectLifecycle) { - sync := NewProjectLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *projectClient) AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle ProjectLifecycle) { - sync := NewProjectLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *projectClient) AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync ProjectHandlerFunc) { - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *projectClient) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync ProjectHandlerFunc) { - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} - -func (s *projectClient) AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle ProjectLifecycle) { - sync := NewProjectLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *projectClient) AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle ProjectLifecycle) { - sync := NewProjectLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_project_lifecycle_adapter.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_project_lifecycle_adapter.go deleted file mode 100644 index d46148f7..00000000 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_project_lifecycle_adapter.go +++ /dev/null @@ -1,66 +0,0 @@ -package v3 - -import ( - "github.com/rancher/norman/lifecycle" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/runtime" -) - -type ProjectLifecycle interface { - Create(obj *Project) (runtime.Object, error) - Remove(obj *Project) (runtime.Object, error) - Updated(obj *Project) (runtime.Object, error) -} - -type projectLifecycleAdapter struct { - lifecycle ProjectLifecycle -} - -func (w *projectLifecycleAdapter) HasCreate() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasCreate() -} - -func (w *projectLifecycleAdapter) HasFinalize() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasFinalize() -} - -func (w *projectLifecycleAdapter) Create(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Create(obj.(*Project)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *projectLifecycleAdapter) Finalize(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Remove(obj.(*Project)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *projectLifecycleAdapter) Updated(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Updated(obj.(*Project)) - if o == nil { - return nil, err - } - return o, err -} - -func NewProjectLifecycleAdapter(name string, clusterScoped bool, client ProjectInterface, l ProjectLifecycle) ProjectHandlerFunc { - if clusterScoped { - resource.PutClusterScoped(ProjectGroupVersionResource) - } - adapter := &projectLifecycleAdapter{lifecycle: l} - syncFn := lifecycle.NewObjectLifecycleAdapter(name, clusterScoped, adapter, client.ObjectClient()) - return func(key string, obj *Project) (runtime.Object, error) { - newObj, err := syncFn(key, obj) - if o, ok := newObj.(runtime.Object); ok { - return o, err - } - return nil, err - } -} diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_project_logging_controller.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_project_logging_controller.go deleted file mode 100644 index 233ae385..00000000 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_project_logging_controller.go +++ /dev/null @@ -1,321 +0,0 @@ -package v3 - -import ( - "context" - "time" - - "github.com/rancher/norman/controller" - "github.com/rancher/norman/objectclient" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/apimachinery/pkg/types" - "k8s.io/apimachinery/pkg/watch" - "k8s.io/client-go/tools/cache" -) - -var ( - ProjectLoggingGroupVersionKind = schema.GroupVersionKind{ - Version: Version, - Group: GroupName, - Kind: "ProjectLogging", - } - ProjectLoggingResource = metav1.APIResource{ - Name: "projectloggings", - SingularName: "projectlogging", - Namespaced: true, - - Kind: ProjectLoggingGroupVersionKind.Kind, - } - - ProjectLoggingGroupVersionResource = schema.GroupVersionResource{ - Group: GroupName, - Version: Version, - Resource: "projectloggings", - } -) - -func init() { - resource.Put(ProjectLoggingGroupVersionResource) -} - -func NewProjectLogging(namespace, name string, obj ProjectLogging) *ProjectLogging { - obj.APIVersion, obj.Kind = ProjectLoggingGroupVersionKind.ToAPIVersionAndKind() - obj.Name = name - obj.Namespace = namespace - return &obj -} - -type ProjectLoggingList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []ProjectLogging `json:"items"` -} - -type ProjectLoggingHandlerFunc func(key string, obj *ProjectLogging) (runtime.Object, error) - -type ProjectLoggingChangeHandlerFunc func(obj *ProjectLogging) (runtime.Object, error) - -type ProjectLoggingLister interface { - List(namespace string, selector labels.Selector) (ret []*ProjectLogging, err error) - Get(namespace, name string) (*ProjectLogging, error) -} - -type ProjectLoggingController interface { - Generic() controller.GenericController - Informer() cache.SharedIndexInformer - Lister() ProjectLoggingLister - AddHandler(ctx context.Context, name string, handler ProjectLoggingHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync ProjectLoggingHandlerFunc) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, handler ProjectLoggingHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, handler ProjectLoggingHandlerFunc) - Enqueue(namespace, name string) - EnqueueAfter(namespace, name string, after time.Duration) -} - -type ProjectLoggingInterface interface { - ObjectClient() *objectclient.ObjectClient - Create(*ProjectLogging) (*ProjectLogging, error) - GetNamespaced(namespace, name string, opts metav1.GetOptions) (*ProjectLogging, error) - Get(name string, opts metav1.GetOptions) (*ProjectLogging, error) - Update(*ProjectLogging) (*ProjectLogging, error) - Delete(name string, options *metav1.DeleteOptions) error - DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error - List(opts metav1.ListOptions) (*ProjectLoggingList, error) - ListNamespaced(namespace string, opts metav1.ListOptions) (*ProjectLoggingList, error) - Watch(opts metav1.ListOptions) (watch.Interface, error) - DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error - Controller() ProjectLoggingController - AddHandler(ctx context.Context, name string, sync ProjectLoggingHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync ProjectLoggingHandlerFunc) - AddLifecycle(ctx context.Context, name string, lifecycle ProjectLoggingLifecycle) - AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle ProjectLoggingLifecycle) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync ProjectLoggingHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync ProjectLoggingHandlerFunc) - AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle ProjectLoggingLifecycle) - AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle ProjectLoggingLifecycle) -} - -type projectLoggingLister struct { - controller *projectLoggingController -} - -func (l *projectLoggingLister) List(namespace string, selector labels.Selector) (ret []*ProjectLogging, err error) { - err = cache.ListAllByNamespace(l.controller.Informer().GetIndexer(), namespace, selector, func(obj interface{}) { - ret = append(ret, obj.(*ProjectLogging)) - }) - return -} - -func (l *projectLoggingLister) Get(namespace, name string) (*ProjectLogging, error) { - var key string - if namespace != "" { - key = namespace + "/" + name - } else { - key = name - } - obj, exists, err := l.controller.Informer().GetIndexer().GetByKey(key) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(schema.GroupResource{ - Group: ProjectLoggingGroupVersionKind.Group, - Resource: ProjectLoggingGroupVersionResource.Resource, - }, key) - } - return obj.(*ProjectLogging), nil -} - -type projectLoggingController struct { - controller.GenericController -} - -func (c *projectLoggingController) Generic() controller.GenericController { - return c.GenericController -} - -func (c *projectLoggingController) Lister() ProjectLoggingLister { - return &projectLoggingLister{ - controller: c, - } -} - -func (c *projectLoggingController) AddHandler(ctx context.Context, name string, handler ProjectLoggingHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*ProjectLogging); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *projectLoggingController) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, handler ProjectLoggingHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*ProjectLogging); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *projectLoggingController) AddClusterScopedHandler(ctx context.Context, name, cluster string, handler ProjectLoggingHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*ProjectLogging); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *projectLoggingController) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, cluster string, handler ProjectLoggingHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*ProjectLogging); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -type projectLoggingFactory struct { -} - -func (c projectLoggingFactory) Object() runtime.Object { - return &ProjectLogging{} -} - -func (c projectLoggingFactory) List() runtime.Object { - return &ProjectLoggingList{} -} - -func (s *projectLoggingClient) Controller() ProjectLoggingController { - genericController := controller.NewGenericController(ProjectLoggingGroupVersionKind.Kind+"Controller", - s.client.controllerFactory.ForResourceKind(ProjectLoggingGroupVersionResource, ProjectLoggingGroupVersionKind.Kind, true)) - - return &projectLoggingController{ - GenericController: genericController, - } -} - -type projectLoggingClient struct { - client *Client - ns string - objectClient *objectclient.ObjectClient - controller ProjectLoggingController -} - -func (s *projectLoggingClient) ObjectClient() *objectclient.ObjectClient { - return s.objectClient -} - -func (s *projectLoggingClient) Create(o *ProjectLogging) (*ProjectLogging, error) { - obj, err := s.objectClient.Create(o) - return obj.(*ProjectLogging), err -} - -func (s *projectLoggingClient) Get(name string, opts metav1.GetOptions) (*ProjectLogging, error) { - obj, err := s.objectClient.Get(name, opts) - return obj.(*ProjectLogging), err -} - -func (s *projectLoggingClient) GetNamespaced(namespace, name string, opts metav1.GetOptions) (*ProjectLogging, error) { - obj, err := s.objectClient.GetNamespaced(namespace, name, opts) - return obj.(*ProjectLogging), err -} - -func (s *projectLoggingClient) Update(o *ProjectLogging) (*ProjectLogging, error) { - obj, err := s.objectClient.Update(o.Name, o) - return obj.(*ProjectLogging), err -} - -func (s *projectLoggingClient) UpdateStatus(o *ProjectLogging) (*ProjectLogging, error) { - obj, err := s.objectClient.UpdateStatus(o.Name, o) - return obj.(*ProjectLogging), err -} - -func (s *projectLoggingClient) Delete(name string, options *metav1.DeleteOptions) error { - return s.objectClient.Delete(name, options) -} - -func (s *projectLoggingClient) DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error { - return s.objectClient.DeleteNamespaced(namespace, name, options) -} - -func (s *projectLoggingClient) List(opts metav1.ListOptions) (*ProjectLoggingList, error) { - obj, err := s.objectClient.List(opts) - return obj.(*ProjectLoggingList), err -} - -func (s *projectLoggingClient) ListNamespaced(namespace string, opts metav1.ListOptions) (*ProjectLoggingList, error) { - obj, err := s.objectClient.ListNamespaced(namespace, opts) - return obj.(*ProjectLoggingList), err -} - -func (s *projectLoggingClient) Watch(opts metav1.ListOptions) (watch.Interface, error) { - return s.objectClient.Watch(opts) -} - -// Patch applies the patch and returns the patched deployment. -func (s *projectLoggingClient) Patch(o *ProjectLogging, patchType types.PatchType, data []byte, subresources ...string) (*ProjectLogging, error) { - obj, err := s.objectClient.Patch(o.Name, o, patchType, data, subresources...) - return obj.(*ProjectLogging), err -} - -func (s *projectLoggingClient) DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error { - return s.objectClient.DeleteCollection(deleteOpts, listOpts) -} - -func (s *projectLoggingClient) AddHandler(ctx context.Context, name string, sync ProjectLoggingHandlerFunc) { - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *projectLoggingClient) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync ProjectLoggingHandlerFunc) { - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *projectLoggingClient) AddLifecycle(ctx context.Context, name string, lifecycle ProjectLoggingLifecycle) { - sync := NewProjectLoggingLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *projectLoggingClient) AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle ProjectLoggingLifecycle) { - sync := NewProjectLoggingLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *projectLoggingClient) AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync ProjectLoggingHandlerFunc) { - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *projectLoggingClient) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync ProjectLoggingHandlerFunc) { - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} - -func (s *projectLoggingClient) AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle ProjectLoggingLifecycle) { - sync := NewProjectLoggingLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *projectLoggingClient) AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle ProjectLoggingLifecycle) { - sync := NewProjectLoggingLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_project_logging_lifecycle_adapter.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_project_logging_lifecycle_adapter.go deleted file mode 100644 index d25e89ee..00000000 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_project_logging_lifecycle_adapter.go +++ /dev/null @@ -1,66 +0,0 @@ -package v3 - -import ( - "github.com/rancher/norman/lifecycle" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/runtime" -) - -type ProjectLoggingLifecycle interface { - Create(obj *ProjectLogging) (runtime.Object, error) - Remove(obj *ProjectLogging) (runtime.Object, error) - Updated(obj *ProjectLogging) (runtime.Object, error) -} - -type projectLoggingLifecycleAdapter struct { - lifecycle ProjectLoggingLifecycle -} - -func (w *projectLoggingLifecycleAdapter) HasCreate() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasCreate() -} - -func (w *projectLoggingLifecycleAdapter) HasFinalize() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasFinalize() -} - -func (w *projectLoggingLifecycleAdapter) Create(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Create(obj.(*ProjectLogging)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *projectLoggingLifecycleAdapter) Finalize(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Remove(obj.(*ProjectLogging)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *projectLoggingLifecycleAdapter) Updated(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Updated(obj.(*ProjectLogging)) - if o == nil { - return nil, err - } - return o, err -} - -func NewProjectLoggingLifecycleAdapter(name string, clusterScoped bool, client ProjectLoggingInterface, l ProjectLoggingLifecycle) ProjectLoggingHandlerFunc { - if clusterScoped { - resource.PutClusterScoped(ProjectLoggingGroupVersionResource) - } - adapter := &projectLoggingLifecycleAdapter{lifecycle: l} - syncFn := lifecycle.NewObjectLifecycleAdapter(name, clusterScoped, adapter, client.ObjectClient()) - return func(key string, obj *ProjectLogging) (runtime.Object, error) { - newObj, err := syncFn(key, obj) - if o, ok := newObj.(runtime.Object); ok { - return o, err - } - return nil, err - } -} diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_project_monitor_graph_controller.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_project_monitor_graph_controller.go deleted file mode 100644 index ddbcbe4b..00000000 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_project_monitor_graph_controller.go +++ /dev/null @@ -1,321 +0,0 @@ -package v3 - -import ( - "context" - "time" - - "github.com/rancher/norman/controller" - "github.com/rancher/norman/objectclient" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/apimachinery/pkg/types" - "k8s.io/apimachinery/pkg/watch" - "k8s.io/client-go/tools/cache" -) - -var ( - ProjectMonitorGraphGroupVersionKind = schema.GroupVersionKind{ - Version: Version, - Group: GroupName, - Kind: "ProjectMonitorGraph", - } - ProjectMonitorGraphResource = metav1.APIResource{ - Name: "projectmonitorgraphs", - SingularName: "projectmonitorgraph", - Namespaced: true, - - Kind: ProjectMonitorGraphGroupVersionKind.Kind, - } - - ProjectMonitorGraphGroupVersionResource = schema.GroupVersionResource{ - Group: GroupName, - Version: Version, - Resource: "projectmonitorgraphs", - } -) - -func init() { - resource.Put(ProjectMonitorGraphGroupVersionResource) -} - -func NewProjectMonitorGraph(namespace, name string, obj ProjectMonitorGraph) *ProjectMonitorGraph { - obj.APIVersion, obj.Kind = ProjectMonitorGraphGroupVersionKind.ToAPIVersionAndKind() - obj.Name = name - obj.Namespace = namespace - return &obj -} - -type ProjectMonitorGraphList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []ProjectMonitorGraph `json:"items"` -} - -type ProjectMonitorGraphHandlerFunc func(key string, obj *ProjectMonitorGraph) (runtime.Object, error) - -type ProjectMonitorGraphChangeHandlerFunc func(obj *ProjectMonitorGraph) (runtime.Object, error) - -type ProjectMonitorGraphLister interface { - List(namespace string, selector labels.Selector) (ret []*ProjectMonitorGraph, err error) - Get(namespace, name string) (*ProjectMonitorGraph, error) -} - -type ProjectMonitorGraphController interface { - Generic() controller.GenericController - Informer() cache.SharedIndexInformer - Lister() ProjectMonitorGraphLister - AddHandler(ctx context.Context, name string, handler ProjectMonitorGraphHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync ProjectMonitorGraphHandlerFunc) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, handler ProjectMonitorGraphHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, handler ProjectMonitorGraphHandlerFunc) - Enqueue(namespace, name string) - EnqueueAfter(namespace, name string, after time.Duration) -} - -type ProjectMonitorGraphInterface interface { - ObjectClient() *objectclient.ObjectClient - Create(*ProjectMonitorGraph) (*ProjectMonitorGraph, error) - GetNamespaced(namespace, name string, opts metav1.GetOptions) (*ProjectMonitorGraph, error) - Get(name string, opts metav1.GetOptions) (*ProjectMonitorGraph, error) - Update(*ProjectMonitorGraph) (*ProjectMonitorGraph, error) - Delete(name string, options *metav1.DeleteOptions) error - DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error - List(opts metav1.ListOptions) (*ProjectMonitorGraphList, error) - ListNamespaced(namespace string, opts metav1.ListOptions) (*ProjectMonitorGraphList, error) - Watch(opts metav1.ListOptions) (watch.Interface, error) - DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error - Controller() ProjectMonitorGraphController - AddHandler(ctx context.Context, name string, sync ProjectMonitorGraphHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync ProjectMonitorGraphHandlerFunc) - AddLifecycle(ctx context.Context, name string, lifecycle ProjectMonitorGraphLifecycle) - AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle ProjectMonitorGraphLifecycle) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync ProjectMonitorGraphHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync ProjectMonitorGraphHandlerFunc) - AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle ProjectMonitorGraphLifecycle) - AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle ProjectMonitorGraphLifecycle) -} - -type projectMonitorGraphLister struct { - controller *projectMonitorGraphController -} - -func (l *projectMonitorGraphLister) List(namespace string, selector labels.Selector) (ret []*ProjectMonitorGraph, err error) { - err = cache.ListAllByNamespace(l.controller.Informer().GetIndexer(), namespace, selector, func(obj interface{}) { - ret = append(ret, obj.(*ProjectMonitorGraph)) - }) - return -} - -func (l *projectMonitorGraphLister) Get(namespace, name string) (*ProjectMonitorGraph, error) { - var key string - if namespace != "" { - key = namespace + "/" + name - } else { - key = name - } - obj, exists, err := l.controller.Informer().GetIndexer().GetByKey(key) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(schema.GroupResource{ - Group: ProjectMonitorGraphGroupVersionKind.Group, - Resource: ProjectMonitorGraphGroupVersionResource.Resource, - }, key) - } - return obj.(*ProjectMonitorGraph), nil -} - -type projectMonitorGraphController struct { - controller.GenericController -} - -func (c *projectMonitorGraphController) Generic() controller.GenericController { - return c.GenericController -} - -func (c *projectMonitorGraphController) Lister() ProjectMonitorGraphLister { - return &projectMonitorGraphLister{ - controller: c, - } -} - -func (c *projectMonitorGraphController) AddHandler(ctx context.Context, name string, handler ProjectMonitorGraphHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*ProjectMonitorGraph); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *projectMonitorGraphController) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, handler ProjectMonitorGraphHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*ProjectMonitorGraph); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *projectMonitorGraphController) AddClusterScopedHandler(ctx context.Context, name, cluster string, handler ProjectMonitorGraphHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*ProjectMonitorGraph); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *projectMonitorGraphController) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, cluster string, handler ProjectMonitorGraphHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*ProjectMonitorGraph); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -type projectMonitorGraphFactory struct { -} - -func (c projectMonitorGraphFactory) Object() runtime.Object { - return &ProjectMonitorGraph{} -} - -func (c projectMonitorGraphFactory) List() runtime.Object { - return &ProjectMonitorGraphList{} -} - -func (s *projectMonitorGraphClient) Controller() ProjectMonitorGraphController { - genericController := controller.NewGenericController(ProjectMonitorGraphGroupVersionKind.Kind+"Controller", - s.client.controllerFactory.ForResourceKind(ProjectMonitorGraphGroupVersionResource, ProjectMonitorGraphGroupVersionKind.Kind, true)) - - return &projectMonitorGraphController{ - GenericController: genericController, - } -} - -type projectMonitorGraphClient struct { - client *Client - ns string - objectClient *objectclient.ObjectClient - controller ProjectMonitorGraphController -} - -func (s *projectMonitorGraphClient) ObjectClient() *objectclient.ObjectClient { - return s.objectClient -} - -func (s *projectMonitorGraphClient) Create(o *ProjectMonitorGraph) (*ProjectMonitorGraph, error) { - obj, err := s.objectClient.Create(o) - return obj.(*ProjectMonitorGraph), err -} - -func (s *projectMonitorGraphClient) Get(name string, opts metav1.GetOptions) (*ProjectMonitorGraph, error) { - obj, err := s.objectClient.Get(name, opts) - return obj.(*ProjectMonitorGraph), err -} - -func (s *projectMonitorGraphClient) GetNamespaced(namespace, name string, opts metav1.GetOptions) (*ProjectMonitorGraph, error) { - obj, err := s.objectClient.GetNamespaced(namespace, name, opts) - return obj.(*ProjectMonitorGraph), err -} - -func (s *projectMonitorGraphClient) Update(o *ProjectMonitorGraph) (*ProjectMonitorGraph, error) { - obj, err := s.objectClient.Update(o.Name, o) - return obj.(*ProjectMonitorGraph), err -} - -func (s *projectMonitorGraphClient) UpdateStatus(o *ProjectMonitorGraph) (*ProjectMonitorGraph, error) { - obj, err := s.objectClient.UpdateStatus(o.Name, o) - return obj.(*ProjectMonitorGraph), err -} - -func (s *projectMonitorGraphClient) Delete(name string, options *metav1.DeleteOptions) error { - return s.objectClient.Delete(name, options) -} - -func (s *projectMonitorGraphClient) DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error { - return s.objectClient.DeleteNamespaced(namespace, name, options) -} - -func (s *projectMonitorGraphClient) List(opts metav1.ListOptions) (*ProjectMonitorGraphList, error) { - obj, err := s.objectClient.List(opts) - return obj.(*ProjectMonitorGraphList), err -} - -func (s *projectMonitorGraphClient) ListNamespaced(namespace string, opts metav1.ListOptions) (*ProjectMonitorGraphList, error) { - obj, err := s.objectClient.ListNamespaced(namespace, opts) - return obj.(*ProjectMonitorGraphList), err -} - -func (s *projectMonitorGraphClient) Watch(opts metav1.ListOptions) (watch.Interface, error) { - return s.objectClient.Watch(opts) -} - -// Patch applies the patch and returns the patched deployment. -func (s *projectMonitorGraphClient) Patch(o *ProjectMonitorGraph, patchType types.PatchType, data []byte, subresources ...string) (*ProjectMonitorGraph, error) { - obj, err := s.objectClient.Patch(o.Name, o, patchType, data, subresources...) - return obj.(*ProjectMonitorGraph), err -} - -func (s *projectMonitorGraphClient) DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error { - return s.objectClient.DeleteCollection(deleteOpts, listOpts) -} - -func (s *projectMonitorGraphClient) AddHandler(ctx context.Context, name string, sync ProjectMonitorGraphHandlerFunc) { - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *projectMonitorGraphClient) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync ProjectMonitorGraphHandlerFunc) { - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *projectMonitorGraphClient) AddLifecycle(ctx context.Context, name string, lifecycle ProjectMonitorGraphLifecycle) { - sync := NewProjectMonitorGraphLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *projectMonitorGraphClient) AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle ProjectMonitorGraphLifecycle) { - sync := NewProjectMonitorGraphLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *projectMonitorGraphClient) AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync ProjectMonitorGraphHandlerFunc) { - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *projectMonitorGraphClient) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync ProjectMonitorGraphHandlerFunc) { - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} - -func (s *projectMonitorGraphClient) AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle ProjectMonitorGraphLifecycle) { - sync := NewProjectMonitorGraphLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *projectMonitorGraphClient) AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle ProjectMonitorGraphLifecycle) { - sync := NewProjectMonitorGraphLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_project_monitor_graph_lifecycle_adapter.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_project_monitor_graph_lifecycle_adapter.go deleted file mode 100644 index 584e48e1..00000000 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_project_monitor_graph_lifecycle_adapter.go +++ /dev/null @@ -1,66 +0,0 @@ -package v3 - -import ( - "github.com/rancher/norman/lifecycle" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/runtime" -) - -type ProjectMonitorGraphLifecycle interface { - Create(obj *ProjectMonitorGraph) (runtime.Object, error) - Remove(obj *ProjectMonitorGraph) (runtime.Object, error) - Updated(obj *ProjectMonitorGraph) (runtime.Object, error) -} - -type projectMonitorGraphLifecycleAdapter struct { - lifecycle ProjectMonitorGraphLifecycle -} - -func (w *projectMonitorGraphLifecycleAdapter) HasCreate() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasCreate() -} - -func (w *projectMonitorGraphLifecycleAdapter) HasFinalize() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasFinalize() -} - -func (w *projectMonitorGraphLifecycleAdapter) Create(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Create(obj.(*ProjectMonitorGraph)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *projectMonitorGraphLifecycleAdapter) Finalize(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Remove(obj.(*ProjectMonitorGraph)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *projectMonitorGraphLifecycleAdapter) Updated(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Updated(obj.(*ProjectMonitorGraph)) - if o == nil { - return nil, err - } - return o, err -} - -func NewProjectMonitorGraphLifecycleAdapter(name string, clusterScoped bool, client ProjectMonitorGraphInterface, l ProjectMonitorGraphLifecycle) ProjectMonitorGraphHandlerFunc { - if clusterScoped { - resource.PutClusterScoped(ProjectMonitorGraphGroupVersionResource) - } - adapter := &projectMonitorGraphLifecycleAdapter{lifecycle: l} - syncFn := lifecycle.NewObjectLifecycleAdapter(name, clusterScoped, adapter, client.ObjectClient()) - return func(key string, obj *ProjectMonitorGraph) (runtime.Object, error) { - newObj, err := syncFn(key, obj) - if o, ok := newObj.(runtime.Object); ok { - return o, err - } - return nil, err - } -} diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_project_network_policy_controller.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_project_network_policy_controller.go deleted file mode 100644 index c1511cc3..00000000 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_project_network_policy_controller.go +++ /dev/null @@ -1,321 +0,0 @@ -package v3 - -import ( - "context" - "time" - - "github.com/rancher/norman/controller" - "github.com/rancher/norman/objectclient" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/apimachinery/pkg/types" - "k8s.io/apimachinery/pkg/watch" - "k8s.io/client-go/tools/cache" -) - -var ( - ProjectNetworkPolicyGroupVersionKind = schema.GroupVersionKind{ - Version: Version, - Group: GroupName, - Kind: "ProjectNetworkPolicy", - } - ProjectNetworkPolicyResource = metav1.APIResource{ - Name: "projectnetworkpolicies", - SingularName: "projectnetworkpolicy", - Namespaced: true, - - Kind: ProjectNetworkPolicyGroupVersionKind.Kind, - } - - ProjectNetworkPolicyGroupVersionResource = schema.GroupVersionResource{ - Group: GroupName, - Version: Version, - Resource: "projectnetworkpolicies", - } -) - -func init() { - resource.Put(ProjectNetworkPolicyGroupVersionResource) -} - -func NewProjectNetworkPolicy(namespace, name string, obj ProjectNetworkPolicy) *ProjectNetworkPolicy { - obj.APIVersion, obj.Kind = ProjectNetworkPolicyGroupVersionKind.ToAPIVersionAndKind() - obj.Name = name - obj.Namespace = namespace - return &obj -} - -type ProjectNetworkPolicyList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []ProjectNetworkPolicy `json:"items"` -} - -type ProjectNetworkPolicyHandlerFunc func(key string, obj *ProjectNetworkPolicy) (runtime.Object, error) - -type ProjectNetworkPolicyChangeHandlerFunc func(obj *ProjectNetworkPolicy) (runtime.Object, error) - -type ProjectNetworkPolicyLister interface { - List(namespace string, selector labels.Selector) (ret []*ProjectNetworkPolicy, err error) - Get(namespace, name string) (*ProjectNetworkPolicy, error) -} - -type ProjectNetworkPolicyController interface { - Generic() controller.GenericController - Informer() cache.SharedIndexInformer - Lister() ProjectNetworkPolicyLister - AddHandler(ctx context.Context, name string, handler ProjectNetworkPolicyHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync ProjectNetworkPolicyHandlerFunc) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, handler ProjectNetworkPolicyHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, handler ProjectNetworkPolicyHandlerFunc) - Enqueue(namespace, name string) - EnqueueAfter(namespace, name string, after time.Duration) -} - -type ProjectNetworkPolicyInterface interface { - ObjectClient() *objectclient.ObjectClient - Create(*ProjectNetworkPolicy) (*ProjectNetworkPolicy, error) - GetNamespaced(namespace, name string, opts metav1.GetOptions) (*ProjectNetworkPolicy, error) - Get(name string, opts metav1.GetOptions) (*ProjectNetworkPolicy, error) - Update(*ProjectNetworkPolicy) (*ProjectNetworkPolicy, error) - Delete(name string, options *metav1.DeleteOptions) error - DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error - List(opts metav1.ListOptions) (*ProjectNetworkPolicyList, error) - ListNamespaced(namespace string, opts metav1.ListOptions) (*ProjectNetworkPolicyList, error) - Watch(opts metav1.ListOptions) (watch.Interface, error) - DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error - Controller() ProjectNetworkPolicyController - AddHandler(ctx context.Context, name string, sync ProjectNetworkPolicyHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync ProjectNetworkPolicyHandlerFunc) - AddLifecycle(ctx context.Context, name string, lifecycle ProjectNetworkPolicyLifecycle) - AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle ProjectNetworkPolicyLifecycle) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync ProjectNetworkPolicyHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync ProjectNetworkPolicyHandlerFunc) - AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle ProjectNetworkPolicyLifecycle) - AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle ProjectNetworkPolicyLifecycle) -} - -type projectNetworkPolicyLister struct { - controller *projectNetworkPolicyController -} - -func (l *projectNetworkPolicyLister) List(namespace string, selector labels.Selector) (ret []*ProjectNetworkPolicy, err error) { - err = cache.ListAllByNamespace(l.controller.Informer().GetIndexer(), namespace, selector, func(obj interface{}) { - ret = append(ret, obj.(*ProjectNetworkPolicy)) - }) - return -} - -func (l *projectNetworkPolicyLister) Get(namespace, name string) (*ProjectNetworkPolicy, error) { - var key string - if namespace != "" { - key = namespace + "/" + name - } else { - key = name - } - obj, exists, err := l.controller.Informer().GetIndexer().GetByKey(key) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(schema.GroupResource{ - Group: ProjectNetworkPolicyGroupVersionKind.Group, - Resource: ProjectNetworkPolicyGroupVersionResource.Resource, - }, key) - } - return obj.(*ProjectNetworkPolicy), nil -} - -type projectNetworkPolicyController struct { - controller.GenericController -} - -func (c *projectNetworkPolicyController) Generic() controller.GenericController { - return c.GenericController -} - -func (c *projectNetworkPolicyController) Lister() ProjectNetworkPolicyLister { - return &projectNetworkPolicyLister{ - controller: c, - } -} - -func (c *projectNetworkPolicyController) AddHandler(ctx context.Context, name string, handler ProjectNetworkPolicyHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*ProjectNetworkPolicy); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *projectNetworkPolicyController) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, handler ProjectNetworkPolicyHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*ProjectNetworkPolicy); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *projectNetworkPolicyController) AddClusterScopedHandler(ctx context.Context, name, cluster string, handler ProjectNetworkPolicyHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*ProjectNetworkPolicy); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *projectNetworkPolicyController) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, cluster string, handler ProjectNetworkPolicyHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*ProjectNetworkPolicy); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -type projectNetworkPolicyFactory struct { -} - -func (c projectNetworkPolicyFactory) Object() runtime.Object { - return &ProjectNetworkPolicy{} -} - -func (c projectNetworkPolicyFactory) List() runtime.Object { - return &ProjectNetworkPolicyList{} -} - -func (s *projectNetworkPolicyClient) Controller() ProjectNetworkPolicyController { - genericController := controller.NewGenericController(ProjectNetworkPolicyGroupVersionKind.Kind+"Controller", - s.client.controllerFactory.ForResourceKind(ProjectNetworkPolicyGroupVersionResource, ProjectNetworkPolicyGroupVersionKind.Kind, true)) - - return &projectNetworkPolicyController{ - GenericController: genericController, - } -} - -type projectNetworkPolicyClient struct { - client *Client - ns string - objectClient *objectclient.ObjectClient - controller ProjectNetworkPolicyController -} - -func (s *projectNetworkPolicyClient) ObjectClient() *objectclient.ObjectClient { - return s.objectClient -} - -func (s *projectNetworkPolicyClient) Create(o *ProjectNetworkPolicy) (*ProjectNetworkPolicy, error) { - obj, err := s.objectClient.Create(o) - return obj.(*ProjectNetworkPolicy), err -} - -func (s *projectNetworkPolicyClient) Get(name string, opts metav1.GetOptions) (*ProjectNetworkPolicy, error) { - obj, err := s.objectClient.Get(name, opts) - return obj.(*ProjectNetworkPolicy), err -} - -func (s *projectNetworkPolicyClient) GetNamespaced(namespace, name string, opts metav1.GetOptions) (*ProjectNetworkPolicy, error) { - obj, err := s.objectClient.GetNamespaced(namespace, name, opts) - return obj.(*ProjectNetworkPolicy), err -} - -func (s *projectNetworkPolicyClient) Update(o *ProjectNetworkPolicy) (*ProjectNetworkPolicy, error) { - obj, err := s.objectClient.Update(o.Name, o) - return obj.(*ProjectNetworkPolicy), err -} - -func (s *projectNetworkPolicyClient) UpdateStatus(o *ProjectNetworkPolicy) (*ProjectNetworkPolicy, error) { - obj, err := s.objectClient.UpdateStatus(o.Name, o) - return obj.(*ProjectNetworkPolicy), err -} - -func (s *projectNetworkPolicyClient) Delete(name string, options *metav1.DeleteOptions) error { - return s.objectClient.Delete(name, options) -} - -func (s *projectNetworkPolicyClient) DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error { - return s.objectClient.DeleteNamespaced(namespace, name, options) -} - -func (s *projectNetworkPolicyClient) List(opts metav1.ListOptions) (*ProjectNetworkPolicyList, error) { - obj, err := s.objectClient.List(opts) - return obj.(*ProjectNetworkPolicyList), err -} - -func (s *projectNetworkPolicyClient) ListNamespaced(namespace string, opts metav1.ListOptions) (*ProjectNetworkPolicyList, error) { - obj, err := s.objectClient.ListNamespaced(namespace, opts) - return obj.(*ProjectNetworkPolicyList), err -} - -func (s *projectNetworkPolicyClient) Watch(opts metav1.ListOptions) (watch.Interface, error) { - return s.objectClient.Watch(opts) -} - -// Patch applies the patch and returns the patched deployment. -func (s *projectNetworkPolicyClient) Patch(o *ProjectNetworkPolicy, patchType types.PatchType, data []byte, subresources ...string) (*ProjectNetworkPolicy, error) { - obj, err := s.objectClient.Patch(o.Name, o, patchType, data, subresources...) - return obj.(*ProjectNetworkPolicy), err -} - -func (s *projectNetworkPolicyClient) DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error { - return s.objectClient.DeleteCollection(deleteOpts, listOpts) -} - -func (s *projectNetworkPolicyClient) AddHandler(ctx context.Context, name string, sync ProjectNetworkPolicyHandlerFunc) { - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *projectNetworkPolicyClient) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync ProjectNetworkPolicyHandlerFunc) { - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *projectNetworkPolicyClient) AddLifecycle(ctx context.Context, name string, lifecycle ProjectNetworkPolicyLifecycle) { - sync := NewProjectNetworkPolicyLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *projectNetworkPolicyClient) AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle ProjectNetworkPolicyLifecycle) { - sync := NewProjectNetworkPolicyLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *projectNetworkPolicyClient) AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync ProjectNetworkPolicyHandlerFunc) { - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *projectNetworkPolicyClient) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync ProjectNetworkPolicyHandlerFunc) { - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} - -func (s *projectNetworkPolicyClient) AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle ProjectNetworkPolicyLifecycle) { - sync := NewProjectNetworkPolicyLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *projectNetworkPolicyClient) AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle ProjectNetworkPolicyLifecycle) { - sync := NewProjectNetworkPolicyLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_project_network_policy_lifecycle_adapter.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_project_network_policy_lifecycle_adapter.go deleted file mode 100644 index c175f8a9..00000000 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_project_network_policy_lifecycle_adapter.go +++ /dev/null @@ -1,66 +0,0 @@ -package v3 - -import ( - "github.com/rancher/norman/lifecycle" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/runtime" -) - -type ProjectNetworkPolicyLifecycle interface { - Create(obj *ProjectNetworkPolicy) (runtime.Object, error) - Remove(obj *ProjectNetworkPolicy) (runtime.Object, error) - Updated(obj *ProjectNetworkPolicy) (runtime.Object, error) -} - -type projectNetworkPolicyLifecycleAdapter struct { - lifecycle ProjectNetworkPolicyLifecycle -} - -func (w *projectNetworkPolicyLifecycleAdapter) HasCreate() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasCreate() -} - -func (w *projectNetworkPolicyLifecycleAdapter) HasFinalize() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasFinalize() -} - -func (w *projectNetworkPolicyLifecycleAdapter) Create(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Create(obj.(*ProjectNetworkPolicy)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *projectNetworkPolicyLifecycleAdapter) Finalize(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Remove(obj.(*ProjectNetworkPolicy)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *projectNetworkPolicyLifecycleAdapter) Updated(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Updated(obj.(*ProjectNetworkPolicy)) - if o == nil { - return nil, err - } - return o, err -} - -func NewProjectNetworkPolicyLifecycleAdapter(name string, clusterScoped bool, client ProjectNetworkPolicyInterface, l ProjectNetworkPolicyLifecycle) ProjectNetworkPolicyHandlerFunc { - if clusterScoped { - resource.PutClusterScoped(ProjectNetworkPolicyGroupVersionResource) - } - adapter := &projectNetworkPolicyLifecycleAdapter{lifecycle: l} - syncFn := lifecycle.NewObjectLifecycleAdapter(name, clusterScoped, adapter, client.ObjectClient()) - return func(key string, obj *ProjectNetworkPolicy) (runtime.Object, error) { - newObj, err := syncFn(key, obj) - if o, ok := newObj.(runtime.Object); ok { - return o, err - } - return nil, err - } -} diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_project_role_template_binding_controller.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_project_role_template_binding_controller.go deleted file mode 100644 index 92debebd..00000000 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_project_role_template_binding_controller.go +++ /dev/null @@ -1,321 +0,0 @@ -package v3 - -import ( - "context" - "time" - - "github.com/rancher/norman/controller" - "github.com/rancher/norman/objectclient" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/apimachinery/pkg/types" - "k8s.io/apimachinery/pkg/watch" - "k8s.io/client-go/tools/cache" -) - -var ( - ProjectRoleTemplateBindingGroupVersionKind = schema.GroupVersionKind{ - Version: Version, - Group: GroupName, - Kind: "ProjectRoleTemplateBinding", - } - ProjectRoleTemplateBindingResource = metav1.APIResource{ - Name: "projectroletemplatebindings", - SingularName: "projectroletemplatebinding", - Namespaced: true, - - Kind: ProjectRoleTemplateBindingGroupVersionKind.Kind, - } - - ProjectRoleTemplateBindingGroupVersionResource = schema.GroupVersionResource{ - Group: GroupName, - Version: Version, - Resource: "projectroletemplatebindings", - } -) - -func init() { - resource.Put(ProjectRoleTemplateBindingGroupVersionResource) -} - -func NewProjectRoleTemplateBinding(namespace, name string, obj ProjectRoleTemplateBinding) *ProjectRoleTemplateBinding { - obj.APIVersion, obj.Kind = ProjectRoleTemplateBindingGroupVersionKind.ToAPIVersionAndKind() - obj.Name = name - obj.Namespace = namespace - return &obj -} - -type ProjectRoleTemplateBindingList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []ProjectRoleTemplateBinding `json:"items"` -} - -type ProjectRoleTemplateBindingHandlerFunc func(key string, obj *ProjectRoleTemplateBinding) (runtime.Object, error) - -type ProjectRoleTemplateBindingChangeHandlerFunc func(obj *ProjectRoleTemplateBinding) (runtime.Object, error) - -type ProjectRoleTemplateBindingLister interface { - List(namespace string, selector labels.Selector) (ret []*ProjectRoleTemplateBinding, err error) - Get(namespace, name string) (*ProjectRoleTemplateBinding, error) -} - -type ProjectRoleTemplateBindingController interface { - Generic() controller.GenericController - Informer() cache.SharedIndexInformer - Lister() ProjectRoleTemplateBindingLister - AddHandler(ctx context.Context, name string, handler ProjectRoleTemplateBindingHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync ProjectRoleTemplateBindingHandlerFunc) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, handler ProjectRoleTemplateBindingHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, handler ProjectRoleTemplateBindingHandlerFunc) - Enqueue(namespace, name string) - EnqueueAfter(namespace, name string, after time.Duration) -} - -type ProjectRoleTemplateBindingInterface interface { - ObjectClient() *objectclient.ObjectClient - Create(*ProjectRoleTemplateBinding) (*ProjectRoleTemplateBinding, error) - GetNamespaced(namespace, name string, opts metav1.GetOptions) (*ProjectRoleTemplateBinding, error) - Get(name string, opts metav1.GetOptions) (*ProjectRoleTemplateBinding, error) - Update(*ProjectRoleTemplateBinding) (*ProjectRoleTemplateBinding, error) - Delete(name string, options *metav1.DeleteOptions) error - DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error - List(opts metav1.ListOptions) (*ProjectRoleTemplateBindingList, error) - ListNamespaced(namespace string, opts metav1.ListOptions) (*ProjectRoleTemplateBindingList, error) - Watch(opts metav1.ListOptions) (watch.Interface, error) - DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error - Controller() ProjectRoleTemplateBindingController - AddHandler(ctx context.Context, name string, sync ProjectRoleTemplateBindingHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync ProjectRoleTemplateBindingHandlerFunc) - AddLifecycle(ctx context.Context, name string, lifecycle ProjectRoleTemplateBindingLifecycle) - AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle ProjectRoleTemplateBindingLifecycle) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync ProjectRoleTemplateBindingHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync ProjectRoleTemplateBindingHandlerFunc) - AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle ProjectRoleTemplateBindingLifecycle) - AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle ProjectRoleTemplateBindingLifecycle) -} - -type projectRoleTemplateBindingLister struct { - controller *projectRoleTemplateBindingController -} - -func (l *projectRoleTemplateBindingLister) List(namespace string, selector labels.Selector) (ret []*ProjectRoleTemplateBinding, err error) { - err = cache.ListAllByNamespace(l.controller.Informer().GetIndexer(), namespace, selector, func(obj interface{}) { - ret = append(ret, obj.(*ProjectRoleTemplateBinding)) - }) - return -} - -func (l *projectRoleTemplateBindingLister) Get(namespace, name string) (*ProjectRoleTemplateBinding, error) { - var key string - if namespace != "" { - key = namespace + "/" + name - } else { - key = name - } - obj, exists, err := l.controller.Informer().GetIndexer().GetByKey(key) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(schema.GroupResource{ - Group: ProjectRoleTemplateBindingGroupVersionKind.Group, - Resource: ProjectRoleTemplateBindingGroupVersionResource.Resource, - }, key) - } - return obj.(*ProjectRoleTemplateBinding), nil -} - -type projectRoleTemplateBindingController struct { - controller.GenericController -} - -func (c *projectRoleTemplateBindingController) Generic() controller.GenericController { - return c.GenericController -} - -func (c *projectRoleTemplateBindingController) Lister() ProjectRoleTemplateBindingLister { - return &projectRoleTemplateBindingLister{ - controller: c, - } -} - -func (c *projectRoleTemplateBindingController) AddHandler(ctx context.Context, name string, handler ProjectRoleTemplateBindingHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*ProjectRoleTemplateBinding); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *projectRoleTemplateBindingController) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, handler ProjectRoleTemplateBindingHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*ProjectRoleTemplateBinding); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *projectRoleTemplateBindingController) AddClusterScopedHandler(ctx context.Context, name, cluster string, handler ProjectRoleTemplateBindingHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*ProjectRoleTemplateBinding); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *projectRoleTemplateBindingController) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, cluster string, handler ProjectRoleTemplateBindingHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*ProjectRoleTemplateBinding); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -type projectRoleTemplateBindingFactory struct { -} - -func (c projectRoleTemplateBindingFactory) Object() runtime.Object { - return &ProjectRoleTemplateBinding{} -} - -func (c projectRoleTemplateBindingFactory) List() runtime.Object { - return &ProjectRoleTemplateBindingList{} -} - -func (s *projectRoleTemplateBindingClient) Controller() ProjectRoleTemplateBindingController { - genericController := controller.NewGenericController(ProjectRoleTemplateBindingGroupVersionKind.Kind+"Controller", - s.client.controllerFactory.ForResourceKind(ProjectRoleTemplateBindingGroupVersionResource, ProjectRoleTemplateBindingGroupVersionKind.Kind, true)) - - return &projectRoleTemplateBindingController{ - GenericController: genericController, - } -} - -type projectRoleTemplateBindingClient struct { - client *Client - ns string - objectClient *objectclient.ObjectClient - controller ProjectRoleTemplateBindingController -} - -func (s *projectRoleTemplateBindingClient) ObjectClient() *objectclient.ObjectClient { - return s.objectClient -} - -func (s *projectRoleTemplateBindingClient) Create(o *ProjectRoleTemplateBinding) (*ProjectRoleTemplateBinding, error) { - obj, err := s.objectClient.Create(o) - return obj.(*ProjectRoleTemplateBinding), err -} - -func (s *projectRoleTemplateBindingClient) Get(name string, opts metav1.GetOptions) (*ProjectRoleTemplateBinding, error) { - obj, err := s.objectClient.Get(name, opts) - return obj.(*ProjectRoleTemplateBinding), err -} - -func (s *projectRoleTemplateBindingClient) GetNamespaced(namespace, name string, opts metav1.GetOptions) (*ProjectRoleTemplateBinding, error) { - obj, err := s.objectClient.GetNamespaced(namespace, name, opts) - return obj.(*ProjectRoleTemplateBinding), err -} - -func (s *projectRoleTemplateBindingClient) Update(o *ProjectRoleTemplateBinding) (*ProjectRoleTemplateBinding, error) { - obj, err := s.objectClient.Update(o.Name, o) - return obj.(*ProjectRoleTemplateBinding), err -} - -func (s *projectRoleTemplateBindingClient) UpdateStatus(o *ProjectRoleTemplateBinding) (*ProjectRoleTemplateBinding, error) { - obj, err := s.objectClient.UpdateStatus(o.Name, o) - return obj.(*ProjectRoleTemplateBinding), err -} - -func (s *projectRoleTemplateBindingClient) Delete(name string, options *metav1.DeleteOptions) error { - return s.objectClient.Delete(name, options) -} - -func (s *projectRoleTemplateBindingClient) DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error { - return s.objectClient.DeleteNamespaced(namespace, name, options) -} - -func (s *projectRoleTemplateBindingClient) List(opts metav1.ListOptions) (*ProjectRoleTemplateBindingList, error) { - obj, err := s.objectClient.List(opts) - return obj.(*ProjectRoleTemplateBindingList), err -} - -func (s *projectRoleTemplateBindingClient) ListNamespaced(namespace string, opts metav1.ListOptions) (*ProjectRoleTemplateBindingList, error) { - obj, err := s.objectClient.ListNamespaced(namespace, opts) - return obj.(*ProjectRoleTemplateBindingList), err -} - -func (s *projectRoleTemplateBindingClient) Watch(opts metav1.ListOptions) (watch.Interface, error) { - return s.objectClient.Watch(opts) -} - -// Patch applies the patch and returns the patched deployment. -func (s *projectRoleTemplateBindingClient) Patch(o *ProjectRoleTemplateBinding, patchType types.PatchType, data []byte, subresources ...string) (*ProjectRoleTemplateBinding, error) { - obj, err := s.objectClient.Patch(o.Name, o, patchType, data, subresources...) - return obj.(*ProjectRoleTemplateBinding), err -} - -func (s *projectRoleTemplateBindingClient) DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error { - return s.objectClient.DeleteCollection(deleteOpts, listOpts) -} - -func (s *projectRoleTemplateBindingClient) AddHandler(ctx context.Context, name string, sync ProjectRoleTemplateBindingHandlerFunc) { - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *projectRoleTemplateBindingClient) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync ProjectRoleTemplateBindingHandlerFunc) { - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *projectRoleTemplateBindingClient) AddLifecycle(ctx context.Context, name string, lifecycle ProjectRoleTemplateBindingLifecycle) { - sync := NewProjectRoleTemplateBindingLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *projectRoleTemplateBindingClient) AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle ProjectRoleTemplateBindingLifecycle) { - sync := NewProjectRoleTemplateBindingLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *projectRoleTemplateBindingClient) AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync ProjectRoleTemplateBindingHandlerFunc) { - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *projectRoleTemplateBindingClient) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync ProjectRoleTemplateBindingHandlerFunc) { - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} - -func (s *projectRoleTemplateBindingClient) AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle ProjectRoleTemplateBindingLifecycle) { - sync := NewProjectRoleTemplateBindingLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *projectRoleTemplateBindingClient) AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle ProjectRoleTemplateBindingLifecycle) { - sync := NewProjectRoleTemplateBindingLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_project_role_template_binding_lifecycle_adapter.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_project_role_template_binding_lifecycle_adapter.go deleted file mode 100644 index cad2188f..00000000 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_project_role_template_binding_lifecycle_adapter.go +++ /dev/null @@ -1,66 +0,0 @@ -package v3 - -import ( - "github.com/rancher/norman/lifecycle" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/runtime" -) - -type ProjectRoleTemplateBindingLifecycle interface { - Create(obj *ProjectRoleTemplateBinding) (runtime.Object, error) - Remove(obj *ProjectRoleTemplateBinding) (runtime.Object, error) - Updated(obj *ProjectRoleTemplateBinding) (runtime.Object, error) -} - -type projectRoleTemplateBindingLifecycleAdapter struct { - lifecycle ProjectRoleTemplateBindingLifecycle -} - -func (w *projectRoleTemplateBindingLifecycleAdapter) HasCreate() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasCreate() -} - -func (w *projectRoleTemplateBindingLifecycleAdapter) HasFinalize() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasFinalize() -} - -func (w *projectRoleTemplateBindingLifecycleAdapter) Create(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Create(obj.(*ProjectRoleTemplateBinding)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *projectRoleTemplateBindingLifecycleAdapter) Finalize(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Remove(obj.(*ProjectRoleTemplateBinding)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *projectRoleTemplateBindingLifecycleAdapter) Updated(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Updated(obj.(*ProjectRoleTemplateBinding)) - if o == nil { - return nil, err - } - return o, err -} - -func NewProjectRoleTemplateBindingLifecycleAdapter(name string, clusterScoped bool, client ProjectRoleTemplateBindingInterface, l ProjectRoleTemplateBindingLifecycle) ProjectRoleTemplateBindingHandlerFunc { - if clusterScoped { - resource.PutClusterScoped(ProjectRoleTemplateBindingGroupVersionResource) - } - adapter := &projectRoleTemplateBindingLifecycleAdapter{lifecycle: l} - syncFn := lifecycle.NewObjectLifecycleAdapter(name, clusterScoped, adapter, client.ObjectClient()) - return func(key string, obj *ProjectRoleTemplateBinding) (runtime.Object, error) { - newObj, err := syncFn(key, obj) - if o, ok := newObj.(runtime.Object); ok { - return o, err - } - return nil, err - } -} diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_rke_addon_controller.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_rke_addon_controller.go deleted file mode 100644 index f6e3a546..00000000 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_rke_addon_controller.go +++ /dev/null @@ -1,321 +0,0 @@ -package v3 - -import ( - "context" - "time" - - "github.com/rancher/norman/controller" - "github.com/rancher/norman/objectclient" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/apimachinery/pkg/types" - "k8s.io/apimachinery/pkg/watch" - "k8s.io/client-go/tools/cache" -) - -var ( - RkeAddonGroupVersionKind = schema.GroupVersionKind{ - Version: Version, - Group: GroupName, - Kind: "RkeAddon", - } - RkeAddonResource = metav1.APIResource{ - Name: "rkeaddons", - SingularName: "rkeaddon", - Namespaced: true, - - Kind: RkeAddonGroupVersionKind.Kind, - } - - RkeAddonGroupVersionResource = schema.GroupVersionResource{ - Group: GroupName, - Version: Version, - Resource: "rkeaddons", - } -) - -func init() { - resource.Put(RkeAddonGroupVersionResource) -} - -func NewRkeAddon(namespace, name string, obj RkeAddon) *RkeAddon { - obj.APIVersion, obj.Kind = RkeAddonGroupVersionKind.ToAPIVersionAndKind() - obj.Name = name - obj.Namespace = namespace - return &obj -} - -type RkeAddonList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []RkeAddon `json:"items"` -} - -type RkeAddonHandlerFunc func(key string, obj *RkeAddon) (runtime.Object, error) - -type RkeAddonChangeHandlerFunc func(obj *RkeAddon) (runtime.Object, error) - -type RkeAddonLister interface { - List(namespace string, selector labels.Selector) (ret []*RkeAddon, err error) - Get(namespace, name string) (*RkeAddon, error) -} - -type RkeAddonController interface { - Generic() controller.GenericController - Informer() cache.SharedIndexInformer - Lister() RkeAddonLister - AddHandler(ctx context.Context, name string, handler RkeAddonHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync RkeAddonHandlerFunc) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, handler RkeAddonHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, handler RkeAddonHandlerFunc) - Enqueue(namespace, name string) - EnqueueAfter(namespace, name string, after time.Duration) -} - -type RkeAddonInterface interface { - ObjectClient() *objectclient.ObjectClient - Create(*RkeAddon) (*RkeAddon, error) - GetNamespaced(namespace, name string, opts metav1.GetOptions) (*RkeAddon, error) - Get(name string, opts metav1.GetOptions) (*RkeAddon, error) - Update(*RkeAddon) (*RkeAddon, error) - Delete(name string, options *metav1.DeleteOptions) error - DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error - List(opts metav1.ListOptions) (*RkeAddonList, error) - ListNamespaced(namespace string, opts metav1.ListOptions) (*RkeAddonList, error) - Watch(opts metav1.ListOptions) (watch.Interface, error) - DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error - Controller() RkeAddonController - AddHandler(ctx context.Context, name string, sync RkeAddonHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync RkeAddonHandlerFunc) - AddLifecycle(ctx context.Context, name string, lifecycle RkeAddonLifecycle) - AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle RkeAddonLifecycle) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync RkeAddonHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync RkeAddonHandlerFunc) - AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle RkeAddonLifecycle) - AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle RkeAddonLifecycle) -} - -type rkeAddonLister struct { - controller *rkeAddonController -} - -func (l *rkeAddonLister) List(namespace string, selector labels.Selector) (ret []*RkeAddon, err error) { - err = cache.ListAllByNamespace(l.controller.Informer().GetIndexer(), namespace, selector, func(obj interface{}) { - ret = append(ret, obj.(*RkeAddon)) - }) - return -} - -func (l *rkeAddonLister) Get(namespace, name string) (*RkeAddon, error) { - var key string - if namespace != "" { - key = namespace + "/" + name - } else { - key = name - } - obj, exists, err := l.controller.Informer().GetIndexer().GetByKey(key) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(schema.GroupResource{ - Group: RkeAddonGroupVersionKind.Group, - Resource: RkeAddonGroupVersionResource.Resource, - }, key) - } - return obj.(*RkeAddon), nil -} - -type rkeAddonController struct { - controller.GenericController -} - -func (c *rkeAddonController) Generic() controller.GenericController { - return c.GenericController -} - -func (c *rkeAddonController) Lister() RkeAddonLister { - return &rkeAddonLister{ - controller: c, - } -} - -func (c *rkeAddonController) AddHandler(ctx context.Context, name string, handler RkeAddonHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*RkeAddon); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *rkeAddonController) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, handler RkeAddonHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*RkeAddon); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *rkeAddonController) AddClusterScopedHandler(ctx context.Context, name, cluster string, handler RkeAddonHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*RkeAddon); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *rkeAddonController) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, cluster string, handler RkeAddonHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*RkeAddon); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -type rkeAddonFactory struct { -} - -func (c rkeAddonFactory) Object() runtime.Object { - return &RkeAddon{} -} - -func (c rkeAddonFactory) List() runtime.Object { - return &RkeAddonList{} -} - -func (s *rkeAddonClient) Controller() RkeAddonController { - genericController := controller.NewGenericController(RkeAddonGroupVersionKind.Kind+"Controller", - s.client.controllerFactory.ForResourceKind(RkeAddonGroupVersionResource, RkeAddonGroupVersionKind.Kind, true)) - - return &rkeAddonController{ - GenericController: genericController, - } -} - -type rkeAddonClient struct { - client *Client - ns string - objectClient *objectclient.ObjectClient - controller RkeAddonController -} - -func (s *rkeAddonClient) ObjectClient() *objectclient.ObjectClient { - return s.objectClient -} - -func (s *rkeAddonClient) Create(o *RkeAddon) (*RkeAddon, error) { - obj, err := s.objectClient.Create(o) - return obj.(*RkeAddon), err -} - -func (s *rkeAddonClient) Get(name string, opts metav1.GetOptions) (*RkeAddon, error) { - obj, err := s.objectClient.Get(name, opts) - return obj.(*RkeAddon), err -} - -func (s *rkeAddonClient) GetNamespaced(namespace, name string, opts metav1.GetOptions) (*RkeAddon, error) { - obj, err := s.objectClient.GetNamespaced(namespace, name, opts) - return obj.(*RkeAddon), err -} - -func (s *rkeAddonClient) Update(o *RkeAddon) (*RkeAddon, error) { - obj, err := s.objectClient.Update(o.Name, o) - return obj.(*RkeAddon), err -} - -func (s *rkeAddonClient) UpdateStatus(o *RkeAddon) (*RkeAddon, error) { - obj, err := s.objectClient.UpdateStatus(o.Name, o) - return obj.(*RkeAddon), err -} - -func (s *rkeAddonClient) Delete(name string, options *metav1.DeleteOptions) error { - return s.objectClient.Delete(name, options) -} - -func (s *rkeAddonClient) DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error { - return s.objectClient.DeleteNamespaced(namespace, name, options) -} - -func (s *rkeAddonClient) List(opts metav1.ListOptions) (*RkeAddonList, error) { - obj, err := s.objectClient.List(opts) - return obj.(*RkeAddonList), err -} - -func (s *rkeAddonClient) ListNamespaced(namespace string, opts metav1.ListOptions) (*RkeAddonList, error) { - obj, err := s.objectClient.ListNamespaced(namespace, opts) - return obj.(*RkeAddonList), err -} - -func (s *rkeAddonClient) Watch(opts metav1.ListOptions) (watch.Interface, error) { - return s.objectClient.Watch(opts) -} - -// Patch applies the patch and returns the patched deployment. -func (s *rkeAddonClient) Patch(o *RkeAddon, patchType types.PatchType, data []byte, subresources ...string) (*RkeAddon, error) { - obj, err := s.objectClient.Patch(o.Name, o, patchType, data, subresources...) - return obj.(*RkeAddon), err -} - -func (s *rkeAddonClient) DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error { - return s.objectClient.DeleteCollection(deleteOpts, listOpts) -} - -func (s *rkeAddonClient) AddHandler(ctx context.Context, name string, sync RkeAddonHandlerFunc) { - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *rkeAddonClient) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync RkeAddonHandlerFunc) { - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *rkeAddonClient) AddLifecycle(ctx context.Context, name string, lifecycle RkeAddonLifecycle) { - sync := NewRkeAddonLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *rkeAddonClient) AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle RkeAddonLifecycle) { - sync := NewRkeAddonLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *rkeAddonClient) AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync RkeAddonHandlerFunc) { - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *rkeAddonClient) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync RkeAddonHandlerFunc) { - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} - -func (s *rkeAddonClient) AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle RkeAddonLifecycle) { - sync := NewRkeAddonLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *rkeAddonClient) AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle RkeAddonLifecycle) { - sync := NewRkeAddonLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_rke_addon_lifecycle_adapter.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_rke_addon_lifecycle_adapter.go deleted file mode 100644 index 4d260aef..00000000 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_rke_addon_lifecycle_adapter.go +++ /dev/null @@ -1,66 +0,0 @@ -package v3 - -import ( - "github.com/rancher/norman/lifecycle" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/runtime" -) - -type RkeAddonLifecycle interface { - Create(obj *RkeAddon) (runtime.Object, error) - Remove(obj *RkeAddon) (runtime.Object, error) - Updated(obj *RkeAddon) (runtime.Object, error) -} - -type rkeAddonLifecycleAdapter struct { - lifecycle RkeAddonLifecycle -} - -func (w *rkeAddonLifecycleAdapter) HasCreate() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasCreate() -} - -func (w *rkeAddonLifecycleAdapter) HasFinalize() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasFinalize() -} - -func (w *rkeAddonLifecycleAdapter) Create(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Create(obj.(*RkeAddon)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *rkeAddonLifecycleAdapter) Finalize(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Remove(obj.(*RkeAddon)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *rkeAddonLifecycleAdapter) Updated(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Updated(obj.(*RkeAddon)) - if o == nil { - return nil, err - } - return o, err -} - -func NewRkeAddonLifecycleAdapter(name string, clusterScoped bool, client RkeAddonInterface, l RkeAddonLifecycle) RkeAddonHandlerFunc { - if clusterScoped { - resource.PutClusterScoped(RkeAddonGroupVersionResource) - } - adapter := &rkeAddonLifecycleAdapter{lifecycle: l} - syncFn := lifecycle.NewObjectLifecycleAdapter(name, clusterScoped, adapter, client.ObjectClient()) - return func(key string, obj *RkeAddon) (runtime.Object, error) { - newObj, err := syncFn(key, obj) - if o, ok := newObj.(runtime.Object); ok { - return o, err - } - return nil, err - } -} diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_rke_k8s_service_option_controller.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_rke_k8s_service_option_controller.go deleted file mode 100644 index 6618dd36..00000000 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_rke_k8s_service_option_controller.go +++ /dev/null @@ -1,321 +0,0 @@ -package v3 - -import ( - "context" - "time" - - "github.com/rancher/norman/controller" - "github.com/rancher/norman/objectclient" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/apimachinery/pkg/types" - "k8s.io/apimachinery/pkg/watch" - "k8s.io/client-go/tools/cache" -) - -var ( - RkeK8sServiceOptionGroupVersionKind = schema.GroupVersionKind{ - Version: Version, - Group: GroupName, - Kind: "RkeK8sServiceOption", - } - RkeK8sServiceOptionResource = metav1.APIResource{ - Name: "rkek8sserviceoptions", - SingularName: "rkek8sserviceoption", - Namespaced: true, - - Kind: RkeK8sServiceOptionGroupVersionKind.Kind, - } - - RkeK8sServiceOptionGroupVersionResource = schema.GroupVersionResource{ - Group: GroupName, - Version: Version, - Resource: "rkek8sserviceoptions", - } -) - -func init() { - resource.Put(RkeK8sServiceOptionGroupVersionResource) -} - -func NewRkeK8sServiceOption(namespace, name string, obj RkeK8sServiceOption) *RkeK8sServiceOption { - obj.APIVersion, obj.Kind = RkeK8sServiceOptionGroupVersionKind.ToAPIVersionAndKind() - obj.Name = name - obj.Namespace = namespace - return &obj -} - -type RkeK8sServiceOptionList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []RkeK8sServiceOption `json:"items"` -} - -type RkeK8sServiceOptionHandlerFunc func(key string, obj *RkeK8sServiceOption) (runtime.Object, error) - -type RkeK8sServiceOptionChangeHandlerFunc func(obj *RkeK8sServiceOption) (runtime.Object, error) - -type RkeK8sServiceOptionLister interface { - List(namespace string, selector labels.Selector) (ret []*RkeK8sServiceOption, err error) - Get(namespace, name string) (*RkeK8sServiceOption, error) -} - -type RkeK8sServiceOptionController interface { - Generic() controller.GenericController - Informer() cache.SharedIndexInformer - Lister() RkeK8sServiceOptionLister - AddHandler(ctx context.Context, name string, handler RkeK8sServiceOptionHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync RkeK8sServiceOptionHandlerFunc) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, handler RkeK8sServiceOptionHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, handler RkeK8sServiceOptionHandlerFunc) - Enqueue(namespace, name string) - EnqueueAfter(namespace, name string, after time.Duration) -} - -type RkeK8sServiceOptionInterface interface { - ObjectClient() *objectclient.ObjectClient - Create(*RkeK8sServiceOption) (*RkeK8sServiceOption, error) - GetNamespaced(namespace, name string, opts metav1.GetOptions) (*RkeK8sServiceOption, error) - Get(name string, opts metav1.GetOptions) (*RkeK8sServiceOption, error) - Update(*RkeK8sServiceOption) (*RkeK8sServiceOption, error) - Delete(name string, options *metav1.DeleteOptions) error - DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error - List(opts metav1.ListOptions) (*RkeK8sServiceOptionList, error) - ListNamespaced(namespace string, opts metav1.ListOptions) (*RkeK8sServiceOptionList, error) - Watch(opts metav1.ListOptions) (watch.Interface, error) - DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error - Controller() RkeK8sServiceOptionController - AddHandler(ctx context.Context, name string, sync RkeK8sServiceOptionHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync RkeK8sServiceOptionHandlerFunc) - AddLifecycle(ctx context.Context, name string, lifecycle RkeK8sServiceOptionLifecycle) - AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle RkeK8sServiceOptionLifecycle) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync RkeK8sServiceOptionHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync RkeK8sServiceOptionHandlerFunc) - AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle RkeK8sServiceOptionLifecycle) - AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle RkeK8sServiceOptionLifecycle) -} - -type rkeK8sServiceOptionLister struct { - controller *rkeK8sServiceOptionController -} - -func (l *rkeK8sServiceOptionLister) List(namespace string, selector labels.Selector) (ret []*RkeK8sServiceOption, err error) { - err = cache.ListAllByNamespace(l.controller.Informer().GetIndexer(), namespace, selector, func(obj interface{}) { - ret = append(ret, obj.(*RkeK8sServiceOption)) - }) - return -} - -func (l *rkeK8sServiceOptionLister) Get(namespace, name string) (*RkeK8sServiceOption, error) { - var key string - if namespace != "" { - key = namespace + "/" + name - } else { - key = name - } - obj, exists, err := l.controller.Informer().GetIndexer().GetByKey(key) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(schema.GroupResource{ - Group: RkeK8sServiceOptionGroupVersionKind.Group, - Resource: RkeK8sServiceOptionGroupVersionResource.Resource, - }, key) - } - return obj.(*RkeK8sServiceOption), nil -} - -type rkeK8sServiceOptionController struct { - controller.GenericController -} - -func (c *rkeK8sServiceOptionController) Generic() controller.GenericController { - return c.GenericController -} - -func (c *rkeK8sServiceOptionController) Lister() RkeK8sServiceOptionLister { - return &rkeK8sServiceOptionLister{ - controller: c, - } -} - -func (c *rkeK8sServiceOptionController) AddHandler(ctx context.Context, name string, handler RkeK8sServiceOptionHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*RkeK8sServiceOption); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *rkeK8sServiceOptionController) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, handler RkeK8sServiceOptionHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*RkeK8sServiceOption); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *rkeK8sServiceOptionController) AddClusterScopedHandler(ctx context.Context, name, cluster string, handler RkeK8sServiceOptionHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*RkeK8sServiceOption); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *rkeK8sServiceOptionController) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, cluster string, handler RkeK8sServiceOptionHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*RkeK8sServiceOption); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -type rkeK8sServiceOptionFactory struct { -} - -func (c rkeK8sServiceOptionFactory) Object() runtime.Object { - return &RkeK8sServiceOption{} -} - -func (c rkeK8sServiceOptionFactory) List() runtime.Object { - return &RkeK8sServiceOptionList{} -} - -func (s *rkeK8sServiceOptionClient) Controller() RkeK8sServiceOptionController { - genericController := controller.NewGenericController(RkeK8sServiceOptionGroupVersionKind.Kind+"Controller", - s.client.controllerFactory.ForResourceKind(RkeK8sServiceOptionGroupVersionResource, RkeK8sServiceOptionGroupVersionKind.Kind, true)) - - return &rkeK8sServiceOptionController{ - GenericController: genericController, - } -} - -type rkeK8sServiceOptionClient struct { - client *Client - ns string - objectClient *objectclient.ObjectClient - controller RkeK8sServiceOptionController -} - -func (s *rkeK8sServiceOptionClient) ObjectClient() *objectclient.ObjectClient { - return s.objectClient -} - -func (s *rkeK8sServiceOptionClient) Create(o *RkeK8sServiceOption) (*RkeK8sServiceOption, error) { - obj, err := s.objectClient.Create(o) - return obj.(*RkeK8sServiceOption), err -} - -func (s *rkeK8sServiceOptionClient) Get(name string, opts metav1.GetOptions) (*RkeK8sServiceOption, error) { - obj, err := s.objectClient.Get(name, opts) - return obj.(*RkeK8sServiceOption), err -} - -func (s *rkeK8sServiceOptionClient) GetNamespaced(namespace, name string, opts metav1.GetOptions) (*RkeK8sServiceOption, error) { - obj, err := s.objectClient.GetNamespaced(namespace, name, opts) - return obj.(*RkeK8sServiceOption), err -} - -func (s *rkeK8sServiceOptionClient) Update(o *RkeK8sServiceOption) (*RkeK8sServiceOption, error) { - obj, err := s.objectClient.Update(o.Name, o) - return obj.(*RkeK8sServiceOption), err -} - -func (s *rkeK8sServiceOptionClient) UpdateStatus(o *RkeK8sServiceOption) (*RkeK8sServiceOption, error) { - obj, err := s.objectClient.UpdateStatus(o.Name, o) - return obj.(*RkeK8sServiceOption), err -} - -func (s *rkeK8sServiceOptionClient) Delete(name string, options *metav1.DeleteOptions) error { - return s.objectClient.Delete(name, options) -} - -func (s *rkeK8sServiceOptionClient) DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error { - return s.objectClient.DeleteNamespaced(namespace, name, options) -} - -func (s *rkeK8sServiceOptionClient) List(opts metav1.ListOptions) (*RkeK8sServiceOptionList, error) { - obj, err := s.objectClient.List(opts) - return obj.(*RkeK8sServiceOptionList), err -} - -func (s *rkeK8sServiceOptionClient) ListNamespaced(namespace string, opts metav1.ListOptions) (*RkeK8sServiceOptionList, error) { - obj, err := s.objectClient.ListNamespaced(namespace, opts) - return obj.(*RkeK8sServiceOptionList), err -} - -func (s *rkeK8sServiceOptionClient) Watch(opts metav1.ListOptions) (watch.Interface, error) { - return s.objectClient.Watch(opts) -} - -// Patch applies the patch and returns the patched deployment. -func (s *rkeK8sServiceOptionClient) Patch(o *RkeK8sServiceOption, patchType types.PatchType, data []byte, subresources ...string) (*RkeK8sServiceOption, error) { - obj, err := s.objectClient.Patch(o.Name, o, patchType, data, subresources...) - return obj.(*RkeK8sServiceOption), err -} - -func (s *rkeK8sServiceOptionClient) DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error { - return s.objectClient.DeleteCollection(deleteOpts, listOpts) -} - -func (s *rkeK8sServiceOptionClient) AddHandler(ctx context.Context, name string, sync RkeK8sServiceOptionHandlerFunc) { - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *rkeK8sServiceOptionClient) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync RkeK8sServiceOptionHandlerFunc) { - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *rkeK8sServiceOptionClient) AddLifecycle(ctx context.Context, name string, lifecycle RkeK8sServiceOptionLifecycle) { - sync := NewRkeK8sServiceOptionLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *rkeK8sServiceOptionClient) AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle RkeK8sServiceOptionLifecycle) { - sync := NewRkeK8sServiceOptionLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *rkeK8sServiceOptionClient) AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync RkeK8sServiceOptionHandlerFunc) { - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *rkeK8sServiceOptionClient) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync RkeK8sServiceOptionHandlerFunc) { - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} - -func (s *rkeK8sServiceOptionClient) AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle RkeK8sServiceOptionLifecycle) { - sync := NewRkeK8sServiceOptionLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *rkeK8sServiceOptionClient) AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle RkeK8sServiceOptionLifecycle) { - sync := NewRkeK8sServiceOptionLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_rke_k8s_service_option_lifecycle_adapter.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_rke_k8s_service_option_lifecycle_adapter.go deleted file mode 100644 index b6361733..00000000 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_rke_k8s_service_option_lifecycle_adapter.go +++ /dev/null @@ -1,66 +0,0 @@ -package v3 - -import ( - "github.com/rancher/norman/lifecycle" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/runtime" -) - -type RkeK8sServiceOptionLifecycle interface { - Create(obj *RkeK8sServiceOption) (runtime.Object, error) - Remove(obj *RkeK8sServiceOption) (runtime.Object, error) - Updated(obj *RkeK8sServiceOption) (runtime.Object, error) -} - -type rkeK8sServiceOptionLifecycleAdapter struct { - lifecycle RkeK8sServiceOptionLifecycle -} - -func (w *rkeK8sServiceOptionLifecycleAdapter) HasCreate() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasCreate() -} - -func (w *rkeK8sServiceOptionLifecycleAdapter) HasFinalize() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasFinalize() -} - -func (w *rkeK8sServiceOptionLifecycleAdapter) Create(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Create(obj.(*RkeK8sServiceOption)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *rkeK8sServiceOptionLifecycleAdapter) Finalize(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Remove(obj.(*RkeK8sServiceOption)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *rkeK8sServiceOptionLifecycleAdapter) Updated(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Updated(obj.(*RkeK8sServiceOption)) - if o == nil { - return nil, err - } - return o, err -} - -func NewRkeK8sServiceOptionLifecycleAdapter(name string, clusterScoped bool, client RkeK8sServiceOptionInterface, l RkeK8sServiceOptionLifecycle) RkeK8sServiceOptionHandlerFunc { - if clusterScoped { - resource.PutClusterScoped(RkeK8sServiceOptionGroupVersionResource) - } - adapter := &rkeK8sServiceOptionLifecycleAdapter{lifecycle: l} - syncFn := lifecycle.NewObjectLifecycleAdapter(name, clusterScoped, adapter, client.ObjectClient()) - return func(key string, obj *RkeK8sServiceOption) (runtime.Object, error) { - newObj, err := syncFn(key, obj) - if o, ok := newObj.(runtime.Object); ok { - return o, err - } - return nil, err - } -} diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_rke_k8s_system_image_controller.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_rke_k8s_system_image_controller.go deleted file mode 100644 index 358544b4..00000000 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_rke_k8s_system_image_controller.go +++ /dev/null @@ -1,321 +0,0 @@ -package v3 - -import ( - "context" - "time" - - "github.com/rancher/norman/controller" - "github.com/rancher/norman/objectclient" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/apimachinery/pkg/types" - "k8s.io/apimachinery/pkg/watch" - "k8s.io/client-go/tools/cache" -) - -var ( - RkeK8sSystemImageGroupVersionKind = schema.GroupVersionKind{ - Version: Version, - Group: GroupName, - Kind: "RkeK8sSystemImage", - } - RkeK8sSystemImageResource = metav1.APIResource{ - Name: "rkek8ssystemimages", - SingularName: "rkek8ssystemimage", - Namespaced: true, - - Kind: RkeK8sSystemImageGroupVersionKind.Kind, - } - - RkeK8sSystemImageGroupVersionResource = schema.GroupVersionResource{ - Group: GroupName, - Version: Version, - Resource: "rkek8ssystemimages", - } -) - -func init() { - resource.Put(RkeK8sSystemImageGroupVersionResource) -} - -func NewRkeK8sSystemImage(namespace, name string, obj RkeK8sSystemImage) *RkeK8sSystemImage { - obj.APIVersion, obj.Kind = RkeK8sSystemImageGroupVersionKind.ToAPIVersionAndKind() - obj.Name = name - obj.Namespace = namespace - return &obj -} - -type RkeK8sSystemImageList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []RkeK8sSystemImage `json:"items"` -} - -type RkeK8sSystemImageHandlerFunc func(key string, obj *RkeK8sSystemImage) (runtime.Object, error) - -type RkeK8sSystemImageChangeHandlerFunc func(obj *RkeK8sSystemImage) (runtime.Object, error) - -type RkeK8sSystemImageLister interface { - List(namespace string, selector labels.Selector) (ret []*RkeK8sSystemImage, err error) - Get(namespace, name string) (*RkeK8sSystemImage, error) -} - -type RkeK8sSystemImageController interface { - Generic() controller.GenericController - Informer() cache.SharedIndexInformer - Lister() RkeK8sSystemImageLister - AddHandler(ctx context.Context, name string, handler RkeK8sSystemImageHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync RkeK8sSystemImageHandlerFunc) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, handler RkeK8sSystemImageHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, handler RkeK8sSystemImageHandlerFunc) - Enqueue(namespace, name string) - EnqueueAfter(namespace, name string, after time.Duration) -} - -type RkeK8sSystemImageInterface interface { - ObjectClient() *objectclient.ObjectClient - Create(*RkeK8sSystemImage) (*RkeK8sSystemImage, error) - GetNamespaced(namespace, name string, opts metav1.GetOptions) (*RkeK8sSystemImage, error) - Get(name string, opts metav1.GetOptions) (*RkeK8sSystemImage, error) - Update(*RkeK8sSystemImage) (*RkeK8sSystemImage, error) - Delete(name string, options *metav1.DeleteOptions) error - DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error - List(opts metav1.ListOptions) (*RkeK8sSystemImageList, error) - ListNamespaced(namespace string, opts metav1.ListOptions) (*RkeK8sSystemImageList, error) - Watch(opts metav1.ListOptions) (watch.Interface, error) - DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error - Controller() RkeK8sSystemImageController - AddHandler(ctx context.Context, name string, sync RkeK8sSystemImageHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync RkeK8sSystemImageHandlerFunc) - AddLifecycle(ctx context.Context, name string, lifecycle RkeK8sSystemImageLifecycle) - AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle RkeK8sSystemImageLifecycle) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync RkeK8sSystemImageHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync RkeK8sSystemImageHandlerFunc) - AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle RkeK8sSystemImageLifecycle) - AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle RkeK8sSystemImageLifecycle) -} - -type rkeK8sSystemImageLister struct { - controller *rkeK8sSystemImageController -} - -func (l *rkeK8sSystemImageLister) List(namespace string, selector labels.Selector) (ret []*RkeK8sSystemImage, err error) { - err = cache.ListAllByNamespace(l.controller.Informer().GetIndexer(), namespace, selector, func(obj interface{}) { - ret = append(ret, obj.(*RkeK8sSystemImage)) - }) - return -} - -func (l *rkeK8sSystemImageLister) Get(namespace, name string) (*RkeK8sSystemImage, error) { - var key string - if namespace != "" { - key = namespace + "/" + name - } else { - key = name - } - obj, exists, err := l.controller.Informer().GetIndexer().GetByKey(key) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(schema.GroupResource{ - Group: RkeK8sSystemImageGroupVersionKind.Group, - Resource: RkeK8sSystemImageGroupVersionResource.Resource, - }, key) - } - return obj.(*RkeK8sSystemImage), nil -} - -type rkeK8sSystemImageController struct { - controller.GenericController -} - -func (c *rkeK8sSystemImageController) Generic() controller.GenericController { - return c.GenericController -} - -func (c *rkeK8sSystemImageController) Lister() RkeK8sSystemImageLister { - return &rkeK8sSystemImageLister{ - controller: c, - } -} - -func (c *rkeK8sSystemImageController) AddHandler(ctx context.Context, name string, handler RkeK8sSystemImageHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*RkeK8sSystemImage); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *rkeK8sSystemImageController) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, handler RkeK8sSystemImageHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*RkeK8sSystemImage); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *rkeK8sSystemImageController) AddClusterScopedHandler(ctx context.Context, name, cluster string, handler RkeK8sSystemImageHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*RkeK8sSystemImage); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *rkeK8sSystemImageController) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, cluster string, handler RkeK8sSystemImageHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*RkeK8sSystemImage); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -type rkeK8sSystemImageFactory struct { -} - -func (c rkeK8sSystemImageFactory) Object() runtime.Object { - return &RkeK8sSystemImage{} -} - -func (c rkeK8sSystemImageFactory) List() runtime.Object { - return &RkeK8sSystemImageList{} -} - -func (s *rkeK8sSystemImageClient) Controller() RkeK8sSystemImageController { - genericController := controller.NewGenericController(RkeK8sSystemImageGroupVersionKind.Kind+"Controller", - s.client.controllerFactory.ForResourceKind(RkeK8sSystemImageGroupVersionResource, RkeK8sSystemImageGroupVersionKind.Kind, true)) - - return &rkeK8sSystemImageController{ - GenericController: genericController, - } -} - -type rkeK8sSystemImageClient struct { - client *Client - ns string - objectClient *objectclient.ObjectClient - controller RkeK8sSystemImageController -} - -func (s *rkeK8sSystemImageClient) ObjectClient() *objectclient.ObjectClient { - return s.objectClient -} - -func (s *rkeK8sSystemImageClient) Create(o *RkeK8sSystemImage) (*RkeK8sSystemImage, error) { - obj, err := s.objectClient.Create(o) - return obj.(*RkeK8sSystemImage), err -} - -func (s *rkeK8sSystemImageClient) Get(name string, opts metav1.GetOptions) (*RkeK8sSystemImage, error) { - obj, err := s.objectClient.Get(name, opts) - return obj.(*RkeK8sSystemImage), err -} - -func (s *rkeK8sSystemImageClient) GetNamespaced(namespace, name string, opts metav1.GetOptions) (*RkeK8sSystemImage, error) { - obj, err := s.objectClient.GetNamespaced(namespace, name, opts) - return obj.(*RkeK8sSystemImage), err -} - -func (s *rkeK8sSystemImageClient) Update(o *RkeK8sSystemImage) (*RkeK8sSystemImage, error) { - obj, err := s.objectClient.Update(o.Name, o) - return obj.(*RkeK8sSystemImage), err -} - -func (s *rkeK8sSystemImageClient) UpdateStatus(o *RkeK8sSystemImage) (*RkeK8sSystemImage, error) { - obj, err := s.objectClient.UpdateStatus(o.Name, o) - return obj.(*RkeK8sSystemImage), err -} - -func (s *rkeK8sSystemImageClient) Delete(name string, options *metav1.DeleteOptions) error { - return s.objectClient.Delete(name, options) -} - -func (s *rkeK8sSystemImageClient) DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error { - return s.objectClient.DeleteNamespaced(namespace, name, options) -} - -func (s *rkeK8sSystemImageClient) List(opts metav1.ListOptions) (*RkeK8sSystemImageList, error) { - obj, err := s.objectClient.List(opts) - return obj.(*RkeK8sSystemImageList), err -} - -func (s *rkeK8sSystemImageClient) ListNamespaced(namespace string, opts metav1.ListOptions) (*RkeK8sSystemImageList, error) { - obj, err := s.objectClient.ListNamespaced(namespace, opts) - return obj.(*RkeK8sSystemImageList), err -} - -func (s *rkeK8sSystemImageClient) Watch(opts metav1.ListOptions) (watch.Interface, error) { - return s.objectClient.Watch(opts) -} - -// Patch applies the patch and returns the patched deployment. -func (s *rkeK8sSystemImageClient) Patch(o *RkeK8sSystemImage, patchType types.PatchType, data []byte, subresources ...string) (*RkeK8sSystemImage, error) { - obj, err := s.objectClient.Patch(o.Name, o, patchType, data, subresources...) - return obj.(*RkeK8sSystemImage), err -} - -func (s *rkeK8sSystemImageClient) DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error { - return s.objectClient.DeleteCollection(deleteOpts, listOpts) -} - -func (s *rkeK8sSystemImageClient) AddHandler(ctx context.Context, name string, sync RkeK8sSystemImageHandlerFunc) { - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *rkeK8sSystemImageClient) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync RkeK8sSystemImageHandlerFunc) { - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *rkeK8sSystemImageClient) AddLifecycle(ctx context.Context, name string, lifecycle RkeK8sSystemImageLifecycle) { - sync := NewRkeK8sSystemImageLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *rkeK8sSystemImageClient) AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle RkeK8sSystemImageLifecycle) { - sync := NewRkeK8sSystemImageLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *rkeK8sSystemImageClient) AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync RkeK8sSystemImageHandlerFunc) { - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *rkeK8sSystemImageClient) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync RkeK8sSystemImageHandlerFunc) { - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} - -func (s *rkeK8sSystemImageClient) AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle RkeK8sSystemImageLifecycle) { - sync := NewRkeK8sSystemImageLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *rkeK8sSystemImageClient) AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle RkeK8sSystemImageLifecycle) { - sync := NewRkeK8sSystemImageLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_rke_k8s_system_image_lifecycle_adapter.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_rke_k8s_system_image_lifecycle_adapter.go deleted file mode 100644 index 5d5a9dc1..00000000 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_rke_k8s_system_image_lifecycle_adapter.go +++ /dev/null @@ -1,66 +0,0 @@ -package v3 - -import ( - "github.com/rancher/norman/lifecycle" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/runtime" -) - -type RkeK8sSystemImageLifecycle interface { - Create(obj *RkeK8sSystemImage) (runtime.Object, error) - Remove(obj *RkeK8sSystemImage) (runtime.Object, error) - Updated(obj *RkeK8sSystemImage) (runtime.Object, error) -} - -type rkeK8sSystemImageLifecycleAdapter struct { - lifecycle RkeK8sSystemImageLifecycle -} - -func (w *rkeK8sSystemImageLifecycleAdapter) HasCreate() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasCreate() -} - -func (w *rkeK8sSystemImageLifecycleAdapter) HasFinalize() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasFinalize() -} - -func (w *rkeK8sSystemImageLifecycleAdapter) Create(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Create(obj.(*RkeK8sSystemImage)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *rkeK8sSystemImageLifecycleAdapter) Finalize(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Remove(obj.(*RkeK8sSystemImage)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *rkeK8sSystemImageLifecycleAdapter) Updated(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Updated(obj.(*RkeK8sSystemImage)) - if o == nil { - return nil, err - } - return o, err -} - -func NewRkeK8sSystemImageLifecycleAdapter(name string, clusterScoped bool, client RkeK8sSystemImageInterface, l RkeK8sSystemImageLifecycle) RkeK8sSystemImageHandlerFunc { - if clusterScoped { - resource.PutClusterScoped(RkeK8sSystemImageGroupVersionResource) - } - adapter := &rkeK8sSystemImageLifecycleAdapter{lifecycle: l} - syncFn := lifecycle.NewObjectLifecycleAdapter(name, clusterScoped, adapter, client.ObjectClient()) - return func(key string, obj *RkeK8sSystemImage) (runtime.Object, error) { - newObj, err := syncFn(key, obj) - if o, ok := newObj.(runtime.Object); ok { - return o, err - } - return nil, err - } -} diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_role_template_controller.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_role_template_controller.go deleted file mode 100644 index fbd9e400..00000000 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_role_template_controller.go +++ /dev/null @@ -1,320 +0,0 @@ -package v3 - -import ( - "context" - "time" - - "github.com/rancher/norman/controller" - "github.com/rancher/norman/objectclient" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/apimachinery/pkg/types" - "k8s.io/apimachinery/pkg/watch" - "k8s.io/client-go/tools/cache" -) - -var ( - RoleTemplateGroupVersionKind = schema.GroupVersionKind{ - Version: Version, - Group: GroupName, - Kind: "RoleTemplate", - } - RoleTemplateResource = metav1.APIResource{ - Name: "roletemplates", - SingularName: "roletemplate", - Namespaced: false, - Kind: RoleTemplateGroupVersionKind.Kind, - } - - RoleTemplateGroupVersionResource = schema.GroupVersionResource{ - Group: GroupName, - Version: Version, - Resource: "roletemplates", - } -) - -func init() { - resource.Put(RoleTemplateGroupVersionResource) -} - -func NewRoleTemplate(namespace, name string, obj RoleTemplate) *RoleTemplate { - obj.APIVersion, obj.Kind = RoleTemplateGroupVersionKind.ToAPIVersionAndKind() - obj.Name = name - obj.Namespace = namespace - return &obj -} - -type RoleTemplateList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []RoleTemplate `json:"items"` -} - -type RoleTemplateHandlerFunc func(key string, obj *RoleTemplate) (runtime.Object, error) - -type RoleTemplateChangeHandlerFunc func(obj *RoleTemplate) (runtime.Object, error) - -type RoleTemplateLister interface { - List(namespace string, selector labels.Selector) (ret []*RoleTemplate, err error) - Get(namespace, name string) (*RoleTemplate, error) -} - -type RoleTemplateController interface { - Generic() controller.GenericController - Informer() cache.SharedIndexInformer - Lister() RoleTemplateLister - AddHandler(ctx context.Context, name string, handler RoleTemplateHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync RoleTemplateHandlerFunc) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, handler RoleTemplateHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, handler RoleTemplateHandlerFunc) - Enqueue(namespace, name string) - EnqueueAfter(namespace, name string, after time.Duration) -} - -type RoleTemplateInterface interface { - ObjectClient() *objectclient.ObjectClient - Create(*RoleTemplate) (*RoleTemplate, error) - GetNamespaced(namespace, name string, opts metav1.GetOptions) (*RoleTemplate, error) - Get(name string, opts metav1.GetOptions) (*RoleTemplate, error) - Update(*RoleTemplate) (*RoleTemplate, error) - Delete(name string, options *metav1.DeleteOptions) error - DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error - List(opts metav1.ListOptions) (*RoleTemplateList, error) - ListNamespaced(namespace string, opts metav1.ListOptions) (*RoleTemplateList, error) - Watch(opts metav1.ListOptions) (watch.Interface, error) - DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error - Controller() RoleTemplateController - AddHandler(ctx context.Context, name string, sync RoleTemplateHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync RoleTemplateHandlerFunc) - AddLifecycle(ctx context.Context, name string, lifecycle RoleTemplateLifecycle) - AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle RoleTemplateLifecycle) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync RoleTemplateHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync RoleTemplateHandlerFunc) - AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle RoleTemplateLifecycle) - AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle RoleTemplateLifecycle) -} - -type roleTemplateLister struct { - controller *roleTemplateController -} - -func (l *roleTemplateLister) List(namespace string, selector labels.Selector) (ret []*RoleTemplate, err error) { - err = cache.ListAllByNamespace(l.controller.Informer().GetIndexer(), namespace, selector, func(obj interface{}) { - ret = append(ret, obj.(*RoleTemplate)) - }) - return -} - -func (l *roleTemplateLister) Get(namespace, name string) (*RoleTemplate, error) { - var key string - if namespace != "" { - key = namespace + "/" + name - } else { - key = name - } - obj, exists, err := l.controller.Informer().GetIndexer().GetByKey(key) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(schema.GroupResource{ - Group: RoleTemplateGroupVersionKind.Group, - Resource: RoleTemplateGroupVersionResource.Resource, - }, key) - } - return obj.(*RoleTemplate), nil -} - -type roleTemplateController struct { - controller.GenericController -} - -func (c *roleTemplateController) Generic() controller.GenericController { - return c.GenericController -} - -func (c *roleTemplateController) Lister() RoleTemplateLister { - return &roleTemplateLister{ - controller: c, - } -} - -func (c *roleTemplateController) AddHandler(ctx context.Context, name string, handler RoleTemplateHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*RoleTemplate); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *roleTemplateController) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, handler RoleTemplateHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*RoleTemplate); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *roleTemplateController) AddClusterScopedHandler(ctx context.Context, name, cluster string, handler RoleTemplateHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*RoleTemplate); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *roleTemplateController) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, cluster string, handler RoleTemplateHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*RoleTemplate); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -type roleTemplateFactory struct { -} - -func (c roleTemplateFactory) Object() runtime.Object { - return &RoleTemplate{} -} - -func (c roleTemplateFactory) List() runtime.Object { - return &RoleTemplateList{} -} - -func (s *roleTemplateClient) Controller() RoleTemplateController { - genericController := controller.NewGenericController(RoleTemplateGroupVersionKind.Kind+"Controller", - s.client.controllerFactory.ForResourceKind(RoleTemplateGroupVersionResource, RoleTemplateGroupVersionKind.Kind, false)) - - return &roleTemplateController{ - GenericController: genericController, - } -} - -type roleTemplateClient struct { - client *Client - ns string - objectClient *objectclient.ObjectClient - controller RoleTemplateController -} - -func (s *roleTemplateClient) ObjectClient() *objectclient.ObjectClient { - return s.objectClient -} - -func (s *roleTemplateClient) Create(o *RoleTemplate) (*RoleTemplate, error) { - obj, err := s.objectClient.Create(o) - return obj.(*RoleTemplate), err -} - -func (s *roleTemplateClient) Get(name string, opts metav1.GetOptions) (*RoleTemplate, error) { - obj, err := s.objectClient.Get(name, opts) - return obj.(*RoleTemplate), err -} - -func (s *roleTemplateClient) GetNamespaced(namespace, name string, opts metav1.GetOptions) (*RoleTemplate, error) { - obj, err := s.objectClient.GetNamespaced(namespace, name, opts) - return obj.(*RoleTemplate), err -} - -func (s *roleTemplateClient) Update(o *RoleTemplate) (*RoleTemplate, error) { - obj, err := s.objectClient.Update(o.Name, o) - return obj.(*RoleTemplate), err -} - -func (s *roleTemplateClient) UpdateStatus(o *RoleTemplate) (*RoleTemplate, error) { - obj, err := s.objectClient.UpdateStatus(o.Name, o) - return obj.(*RoleTemplate), err -} - -func (s *roleTemplateClient) Delete(name string, options *metav1.DeleteOptions) error { - return s.objectClient.Delete(name, options) -} - -func (s *roleTemplateClient) DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error { - return s.objectClient.DeleteNamespaced(namespace, name, options) -} - -func (s *roleTemplateClient) List(opts metav1.ListOptions) (*RoleTemplateList, error) { - obj, err := s.objectClient.List(opts) - return obj.(*RoleTemplateList), err -} - -func (s *roleTemplateClient) ListNamespaced(namespace string, opts metav1.ListOptions) (*RoleTemplateList, error) { - obj, err := s.objectClient.ListNamespaced(namespace, opts) - return obj.(*RoleTemplateList), err -} - -func (s *roleTemplateClient) Watch(opts metav1.ListOptions) (watch.Interface, error) { - return s.objectClient.Watch(opts) -} - -// Patch applies the patch and returns the patched deployment. -func (s *roleTemplateClient) Patch(o *RoleTemplate, patchType types.PatchType, data []byte, subresources ...string) (*RoleTemplate, error) { - obj, err := s.objectClient.Patch(o.Name, o, patchType, data, subresources...) - return obj.(*RoleTemplate), err -} - -func (s *roleTemplateClient) DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error { - return s.objectClient.DeleteCollection(deleteOpts, listOpts) -} - -func (s *roleTemplateClient) AddHandler(ctx context.Context, name string, sync RoleTemplateHandlerFunc) { - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *roleTemplateClient) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync RoleTemplateHandlerFunc) { - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *roleTemplateClient) AddLifecycle(ctx context.Context, name string, lifecycle RoleTemplateLifecycle) { - sync := NewRoleTemplateLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *roleTemplateClient) AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle RoleTemplateLifecycle) { - sync := NewRoleTemplateLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *roleTemplateClient) AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync RoleTemplateHandlerFunc) { - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *roleTemplateClient) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync RoleTemplateHandlerFunc) { - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} - -func (s *roleTemplateClient) AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle RoleTemplateLifecycle) { - sync := NewRoleTemplateLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *roleTemplateClient) AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle RoleTemplateLifecycle) { - sync := NewRoleTemplateLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_role_template_lifecycle_adapter.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_role_template_lifecycle_adapter.go deleted file mode 100644 index 1e85d93b..00000000 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_role_template_lifecycle_adapter.go +++ /dev/null @@ -1,66 +0,0 @@ -package v3 - -import ( - "github.com/rancher/norman/lifecycle" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/runtime" -) - -type RoleTemplateLifecycle interface { - Create(obj *RoleTemplate) (runtime.Object, error) - Remove(obj *RoleTemplate) (runtime.Object, error) - Updated(obj *RoleTemplate) (runtime.Object, error) -} - -type roleTemplateLifecycleAdapter struct { - lifecycle RoleTemplateLifecycle -} - -func (w *roleTemplateLifecycleAdapter) HasCreate() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasCreate() -} - -func (w *roleTemplateLifecycleAdapter) HasFinalize() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasFinalize() -} - -func (w *roleTemplateLifecycleAdapter) Create(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Create(obj.(*RoleTemplate)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *roleTemplateLifecycleAdapter) Finalize(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Remove(obj.(*RoleTemplate)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *roleTemplateLifecycleAdapter) Updated(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Updated(obj.(*RoleTemplate)) - if o == nil { - return nil, err - } - return o, err -} - -func NewRoleTemplateLifecycleAdapter(name string, clusterScoped bool, client RoleTemplateInterface, l RoleTemplateLifecycle) RoleTemplateHandlerFunc { - if clusterScoped { - resource.PutClusterScoped(RoleTemplateGroupVersionResource) - } - adapter := &roleTemplateLifecycleAdapter{lifecycle: l} - syncFn := lifecycle.NewObjectLifecycleAdapter(name, clusterScoped, adapter, client.ObjectClient()) - return func(key string, obj *RoleTemplate) (runtime.Object, error) { - newObj, err := syncFn(key, obj) - if o, ok := newObj.(runtime.Object); ok { - return o, err - } - return nil, err - } -} diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_scheme.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_scheme.go deleted file mode 100644 index 31393239..00000000 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_scheme.go +++ /dev/null @@ -1,166 +0,0 @@ -package v3 - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" -) - -const ( - GroupName = "management.cattle.io" - Version = "v3" -) - -// SchemeGroupVersion is group version used to register these objects -var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: Version} - -// Kind takes an unqualified kind and returns a Group qualified GroupKind -func Kind(kind string) schema.GroupKind { - return SchemeGroupVersion.WithKind(kind).GroupKind() -} - -// Resource takes an unqualified resource and returns a Group qualified GroupResource -func Resource(resource string) schema.GroupResource { - return SchemeGroupVersion.WithResource(resource).GroupResource() -} - -var ( - SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) - AddToScheme = SchemeBuilder.AddToScheme -) - -// Adds the list of known types to api.Scheme. -func addKnownTypes(scheme *runtime.Scheme) error { - // TODO this gets cleaned up when the types are fixed - scheme.AddKnownTypes(SchemeGroupVersion, - - &NodePool{}, - &NodePoolList{}, - &Node{}, - &NodeList{}, - &NodeDriver{}, - &NodeDriverList{}, - &NodeTemplate{}, - &NodeTemplateList{}, - &Project{}, - &ProjectList{}, - &GlobalRole{}, - &GlobalRoleList{}, - &GlobalRoleBinding{}, - &GlobalRoleBindingList{}, - &RoleTemplate{}, - &RoleTemplateList{}, - &PodSecurityPolicyTemplate{}, - &PodSecurityPolicyTemplateList{}, - &PodSecurityPolicyTemplateProjectBinding{}, - &PodSecurityPolicyTemplateProjectBindingList{}, - &ClusterRoleTemplateBinding{}, - &ClusterRoleTemplateBindingList{}, - &ProjectRoleTemplateBinding{}, - &ProjectRoleTemplateBindingList{}, - &Cluster{}, - &ClusterList{}, - &ClusterRegistrationToken{}, - &ClusterRegistrationTokenList{}, - &Catalog{}, - &CatalogList{}, - &Template{}, - &TemplateList{}, - &CatalogTemplate{}, - &CatalogTemplateList{}, - &CatalogTemplateVersion{}, - &CatalogTemplateVersionList{}, - &TemplateVersion{}, - &TemplateVersionList{}, - &TemplateContent{}, - &TemplateContentList{}, - &Group{}, - &GroupList{}, - &GroupMember{}, - &GroupMemberList{}, - &Principal{}, - &PrincipalList{}, - &User{}, - &UserList{}, - &AuthConfig{}, - &AuthConfigList{}, - &LdapConfig{}, - &LdapConfigList{}, - &Token{}, - &TokenList{}, - &DynamicSchema{}, - &DynamicSchemaList{}, - &Preference{}, - &PreferenceList{}, - &UserAttribute{}, - &UserAttributeList{}, - &ProjectNetworkPolicy{}, - &ProjectNetworkPolicyList{}, - &ClusterLogging{}, - &ClusterLoggingList{}, - &ProjectLogging{}, - &ProjectLoggingList{}, - &Setting{}, - &SettingList{}, - &Feature{}, - &FeatureList{}, - &ClusterAlert{}, - &ClusterAlertList{}, - &ProjectAlert{}, - &ProjectAlertList{}, - &Notifier{}, - &NotifierList{}, - &ClusterAlertGroup{}, - &ClusterAlertGroupList{}, - &ProjectAlertGroup{}, - &ProjectAlertGroupList{}, - &ClusterAlertRule{}, - &ClusterAlertRuleList{}, - &ProjectAlertRule{}, - &ProjectAlertRuleList{}, - &ComposeConfig{}, - &ComposeConfigList{}, - &ProjectCatalog{}, - &ProjectCatalogList{}, - &ClusterCatalog{}, - &ClusterCatalogList{}, - &MultiClusterApp{}, - &MultiClusterAppList{}, - &MultiClusterAppRevision{}, - &MultiClusterAppRevisionList{}, - &GlobalDns{}, - &GlobalDnsList{}, - &GlobalDNSProvider{}, - &GlobalDNSProviderList{}, - &KontainerDriver{}, - &KontainerDriverList{}, - &EtcdBackup{}, - &EtcdBackupList{}, - &ClusterScan{}, - &ClusterScanList{}, - &MonitorMetric{}, - &MonitorMetricList{}, - &ClusterMonitorGraph{}, - &ClusterMonitorGraphList{}, - &ProjectMonitorGraph{}, - &ProjectMonitorGraphList{}, - &CloudCredential{}, - &CloudCredentialList{}, - &ClusterTemplate{}, - &ClusterTemplateList{}, - &ClusterTemplateRevision{}, - &ClusterTemplateRevisionList{}, - &RkeK8sSystemImage{}, - &RkeK8sSystemImageList{}, - &RkeK8sServiceOption{}, - &RkeK8sServiceOptionList{}, - &RkeAddon{}, - &RkeAddonList{}, - &CisConfig{}, - &CisConfigList{}, - &CisBenchmarkVersion{}, - &CisBenchmarkVersionList{}, - ) - metav1.AddToGroupVersion(scheme, SchemeGroupVersion) - return nil -} diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_setting_controller.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_setting_controller.go deleted file mode 100644 index 5f36d855..00000000 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_setting_controller.go +++ /dev/null @@ -1,320 +0,0 @@ -package v3 - -import ( - "context" - "time" - - "github.com/rancher/norman/controller" - "github.com/rancher/norman/objectclient" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/apimachinery/pkg/types" - "k8s.io/apimachinery/pkg/watch" - "k8s.io/client-go/tools/cache" -) - -var ( - SettingGroupVersionKind = schema.GroupVersionKind{ - Version: Version, - Group: GroupName, - Kind: "Setting", - } - SettingResource = metav1.APIResource{ - Name: "settings", - SingularName: "setting", - Namespaced: false, - Kind: SettingGroupVersionKind.Kind, - } - - SettingGroupVersionResource = schema.GroupVersionResource{ - Group: GroupName, - Version: Version, - Resource: "settings", - } -) - -func init() { - resource.Put(SettingGroupVersionResource) -} - -func NewSetting(namespace, name string, obj Setting) *Setting { - obj.APIVersion, obj.Kind = SettingGroupVersionKind.ToAPIVersionAndKind() - obj.Name = name - obj.Namespace = namespace - return &obj -} - -type SettingList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []Setting `json:"items"` -} - -type SettingHandlerFunc func(key string, obj *Setting) (runtime.Object, error) - -type SettingChangeHandlerFunc func(obj *Setting) (runtime.Object, error) - -type SettingLister interface { - List(namespace string, selector labels.Selector) (ret []*Setting, err error) - Get(namespace, name string) (*Setting, error) -} - -type SettingController interface { - Generic() controller.GenericController - Informer() cache.SharedIndexInformer - Lister() SettingLister - AddHandler(ctx context.Context, name string, handler SettingHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync SettingHandlerFunc) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, handler SettingHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, handler SettingHandlerFunc) - Enqueue(namespace, name string) - EnqueueAfter(namespace, name string, after time.Duration) -} - -type SettingInterface interface { - ObjectClient() *objectclient.ObjectClient - Create(*Setting) (*Setting, error) - GetNamespaced(namespace, name string, opts metav1.GetOptions) (*Setting, error) - Get(name string, opts metav1.GetOptions) (*Setting, error) - Update(*Setting) (*Setting, error) - Delete(name string, options *metav1.DeleteOptions) error - DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error - List(opts metav1.ListOptions) (*SettingList, error) - ListNamespaced(namespace string, opts metav1.ListOptions) (*SettingList, error) - Watch(opts metav1.ListOptions) (watch.Interface, error) - DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error - Controller() SettingController - AddHandler(ctx context.Context, name string, sync SettingHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync SettingHandlerFunc) - AddLifecycle(ctx context.Context, name string, lifecycle SettingLifecycle) - AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle SettingLifecycle) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync SettingHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync SettingHandlerFunc) - AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle SettingLifecycle) - AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle SettingLifecycle) -} - -type settingLister struct { - controller *settingController -} - -func (l *settingLister) List(namespace string, selector labels.Selector) (ret []*Setting, err error) { - err = cache.ListAllByNamespace(l.controller.Informer().GetIndexer(), namespace, selector, func(obj interface{}) { - ret = append(ret, obj.(*Setting)) - }) - return -} - -func (l *settingLister) Get(namespace, name string) (*Setting, error) { - var key string - if namespace != "" { - key = namespace + "/" + name - } else { - key = name - } - obj, exists, err := l.controller.Informer().GetIndexer().GetByKey(key) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(schema.GroupResource{ - Group: SettingGroupVersionKind.Group, - Resource: SettingGroupVersionResource.Resource, - }, key) - } - return obj.(*Setting), nil -} - -type settingController struct { - controller.GenericController -} - -func (c *settingController) Generic() controller.GenericController { - return c.GenericController -} - -func (c *settingController) Lister() SettingLister { - return &settingLister{ - controller: c, - } -} - -func (c *settingController) AddHandler(ctx context.Context, name string, handler SettingHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*Setting); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *settingController) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, handler SettingHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*Setting); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *settingController) AddClusterScopedHandler(ctx context.Context, name, cluster string, handler SettingHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*Setting); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *settingController) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, cluster string, handler SettingHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*Setting); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -type settingFactory struct { -} - -func (c settingFactory) Object() runtime.Object { - return &Setting{} -} - -func (c settingFactory) List() runtime.Object { - return &SettingList{} -} - -func (s *settingClient) Controller() SettingController { - genericController := controller.NewGenericController(SettingGroupVersionKind.Kind+"Controller", - s.client.controllerFactory.ForResourceKind(SettingGroupVersionResource, SettingGroupVersionKind.Kind, false)) - - return &settingController{ - GenericController: genericController, - } -} - -type settingClient struct { - client *Client - ns string - objectClient *objectclient.ObjectClient - controller SettingController -} - -func (s *settingClient) ObjectClient() *objectclient.ObjectClient { - return s.objectClient -} - -func (s *settingClient) Create(o *Setting) (*Setting, error) { - obj, err := s.objectClient.Create(o) - return obj.(*Setting), err -} - -func (s *settingClient) Get(name string, opts metav1.GetOptions) (*Setting, error) { - obj, err := s.objectClient.Get(name, opts) - return obj.(*Setting), err -} - -func (s *settingClient) GetNamespaced(namespace, name string, opts metav1.GetOptions) (*Setting, error) { - obj, err := s.objectClient.GetNamespaced(namespace, name, opts) - return obj.(*Setting), err -} - -func (s *settingClient) Update(o *Setting) (*Setting, error) { - obj, err := s.objectClient.Update(o.Name, o) - return obj.(*Setting), err -} - -func (s *settingClient) UpdateStatus(o *Setting) (*Setting, error) { - obj, err := s.objectClient.UpdateStatus(o.Name, o) - return obj.(*Setting), err -} - -func (s *settingClient) Delete(name string, options *metav1.DeleteOptions) error { - return s.objectClient.Delete(name, options) -} - -func (s *settingClient) DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error { - return s.objectClient.DeleteNamespaced(namespace, name, options) -} - -func (s *settingClient) List(opts metav1.ListOptions) (*SettingList, error) { - obj, err := s.objectClient.List(opts) - return obj.(*SettingList), err -} - -func (s *settingClient) ListNamespaced(namespace string, opts metav1.ListOptions) (*SettingList, error) { - obj, err := s.objectClient.ListNamespaced(namespace, opts) - return obj.(*SettingList), err -} - -func (s *settingClient) Watch(opts metav1.ListOptions) (watch.Interface, error) { - return s.objectClient.Watch(opts) -} - -// Patch applies the patch and returns the patched deployment. -func (s *settingClient) Patch(o *Setting, patchType types.PatchType, data []byte, subresources ...string) (*Setting, error) { - obj, err := s.objectClient.Patch(o.Name, o, patchType, data, subresources...) - return obj.(*Setting), err -} - -func (s *settingClient) DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error { - return s.objectClient.DeleteCollection(deleteOpts, listOpts) -} - -func (s *settingClient) AddHandler(ctx context.Context, name string, sync SettingHandlerFunc) { - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *settingClient) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync SettingHandlerFunc) { - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *settingClient) AddLifecycle(ctx context.Context, name string, lifecycle SettingLifecycle) { - sync := NewSettingLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *settingClient) AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle SettingLifecycle) { - sync := NewSettingLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *settingClient) AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync SettingHandlerFunc) { - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *settingClient) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync SettingHandlerFunc) { - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} - -func (s *settingClient) AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle SettingLifecycle) { - sync := NewSettingLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *settingClient) AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle SettingLifecycle) { - sync := NewSettingLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_setting_lifecycle_adapter.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_setting_lifecycle_adapter.go deleted file mode 100644 index 5bb7e5b1..00000000 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_setting_lifecycle_adapter.go +++ /dev/null @@ -1,66 +0,0 @@ -package v3 - -import ( - "github.com/rancher/norman/lifecycle" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/runtime" -) - -type SettingLifecycle interface { - Create(obj *Setting) (runtime.Object, error) - Remove(obj *Setting) (runtime.Object, error) - Updated(obj *Setting) (runtime.Object, error) -} - -type settingLifecycleAdapter struct { - lifecycle SettingLifecycle -} - -func (w *settingLifecycleAdapter) HasCreate() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasCreate() -} - -func (w *settingLifecycleAdapter) HasFinalize() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasFinalize() -} - -func (w *settingLifecycleAdapter) Create(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Create(obj.(*Setting)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *settingLifecycleAdapter) Finalize(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Remove(obj.(*Setting)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *settingLifecycleAdapter) Updated(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Updated(obj.(*Setting)) - if o == nil { - return nil, err - } - return o, err -} - -func NewSettingLifecycleAdapter(name string, clusterScoped bool, client SettingInterface, l SettingLifecycle) SettingHandlerFunc { - if clusterScoped { - resource.PutClusterScoped(SettingGroupVersionResource) - } - adapter := &settingLifecycleAdapter{lifecycle: l} - syncFn := lifecycle.NewObjectLifecycleAdapter(name, clusterScoped, adapter, client.ObjectClient()) - return func(key string, obj *Setting) (runtime.Object, error) { - newObj, err := syncFn(key, obj) - if o, ok := newObj.(runtime.Object); ok { - return o, err - } - return nil, err - } -} diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_template_content_controller.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_template_content_controller.go deleted file mode 100644 index 6e9c875f..00000000 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_template_content_controller.go +++ /dev/null @@ -1,320 +0,0 @@ -package v3 - -import ( - "context" - "time" - - "github.com/rancher/norman/controller" - "github.com/rancher/norman/objectclient" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/apimachinery/pkg/types" - "k8s.io/apimachinery/pkg/watch" - "k8s.io/client-go/tools/cache" -) - -var ( - TemplateContentGroupVersionKind = schema.GroupVersionKind{ - Version: Version, - Group: GroupName, - Kind: "TemplateContent", - } - TemplateContentResource = metav1.APIResource{ - Name: "templatecontents", - SingularName: "templatecontent", - Namespaced: false, - Kind: TemplateContentGroupVersionKind.Kind, - } - - TemplateContentGroupVersionResource = schema.GroupVersionResource{ - Group: GroupName, - Version: Version, - Resource: "templatecontents", - } -) - -func init() { - resource.Put(TemplateContentGroupVersionResource) -} - -func NewTemplateContent(namespace, name string, obj TemplateContent) *TemplateContent { - obj.APIVersion, obj.Kind = TemplateContentGroupVersionKind.ToAPIVersionAndKind() - obj.Name = name - obj.Namespace = namespace - return &obj -} - -type TemplateContentList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []TemplateContent `json:"items"` -} - -type TemplateContentHandlerFunc func(key string, obj *TemplateContent) (runtime.Object, error) - -type TemplateContentChangeHandlerFunc func(obj *TemplateContent) (runtime.Object, error) - -type TemplateContentLister interface { - List(namespace string, selector labels.Selector) (ret []*TemplateContent, err error) - Get(namespace, name string) (*TemplateContent, error) -} - -type TemplateContentController interface { - Generic() controller.GenericController - Informer() cache.SharedIndexInformer - Lister() TemplateContentLister - AddHandler(ctx context.Context, name string, handler TemplateContentHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync TemplateContentHandlerFunc) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, handler TemplateContentHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, handler TemplateContentHandlerFunc) - Enqueue(namespace, name string) - EnqueueAfter(namespace, name string, after time.Duration) -} - -type TemplateContentInterface interface { - ObjectClient() *objectclient.ObjectClient - Create(*TemplateContent) (*TemplateContent, error) - GetNamespaced(namespace, name string, opts metav1.GetOptions) (*TemplateContent, error) - Get(name string, opts metav1.GetOptions) (*TemplateContent, error) - Update(*TemplateContent) (*TemplateContent, error) - Delete(name string, options *metav1.DeleteOptions) error - DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error - List(opts metav1.ListOptions) (*TemplateContentList, error) - ListNamespaced(namespace string, opts metav1.ListOptions) (*TemplateContentList, error) - Watch(opts metav1.ListOptions) (watch.Interface, error) - DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error - Controller() TemplateContentController - AddHandler(ctx context.Context, name string, sync TemplateContentHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync TemplateContentHandlerFunc) - AddLifecycle(ctx context.Context, name string, lifecycle TemplateContentLifecycle) - AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle TemplateContentLifecycle) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync TemplateContentHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync TemplateContentHandlerFunc) - AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle TemplateContentLifecycle) - AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle TemplateContentLifecycle) -} - -type templateContentLister struct { - controller *templateContentController -} - -func (l *templateContentLister) List(namespace string, selector labels.Selector) (ret []*TemplateContent, err error) { - err = cache.ListAllByNamespace(l.controller.Informer().GetIndexer(), namespace, selector, func(obj interface{}) { - ret = append(ret, obj.(*TemplateContent)) - }) - return -} - -func (l *templateContentLister) Get(namespace, name string) (*TemplateContent, error) { - var key string - if namespace != "" { - key = namespace + "/" + name - } else { - key = name - } - obj, exists, err := l.controller.Informer().GetIndexer().GetByKey(key) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(schema.GroupResource{ - Group: TemplateContentGroupVersionKind.Group, - Resource: TemplateContentGroupVersionResource.Resource, - }, key) - } - return obj.(*TemplateContent), nil -} - -type templateContentController struct { - controller.GenericController -} - -func (c *templateContentController) Generic() controller.GenericController { - return c.GenericController -} - -func (c *templateContentController) Lister() TemplateContentLister { - return &templateContentLister{ - controller: c, - } -} - -func (c *templateContentController) AddHandler(ctx context.Context, name string, handler TemplateContentHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*TemplateContent); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *templateContentController) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, handler TemplateContentHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*TemplateContent); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *templateContentController) AddClusterScopedHandler(ctx context.Context, name, cluster string, handler TemplateContentHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*TemplateContent); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *templateContentController) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, cluster string, handler TemplateContentHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*TemplateContent); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -type templateContentFactory struct { -} - -func (c templateContentFactory) Object() runtime.Object { - return &TemplateContent{} -} - -func (c templateContentFactory) List() runtime.Object { - return &TemplateContentList{} -} - -func (s *templateContentClient) Controller() TemplateContentController { - genericController := controller.NewGenericController(TemplateContentGroupVersionKind.Kind+"Controller", - s.client.controllerFactory.ForResourceKind(TemplateContentGroupVersionResource, TemplateContentGroupVersionKind.Kind, false)) - - return &templateContentController{ - GenericController: genericController, - } -} - -type templateContentClient struct { - client *Client - ns string - objectClient *objectclient.ObjectClient - controller TemplateContentController -} - -func (s *templateContentClient) ObjectClient() *objectclient.ObjectClient { - return s.objectClient -} - -func (s *templateContentClient) Create(o *TemplateContent) (*TemplateContent, error) { - obj, err := s.objectClient.Create(o) - return obj.(*TemplateContent), err -} - -func (s *templateContentClient) Get(name string, opts metav1.GetOptions) (*TemplateContent, error) { - obj, err := s.objectClient.Get(name, opts) - return obj.(*TemplateContent), err -} - -func (s *templateContentClient) GetNamespaced(namespace, name string, opts metav1.GetOptions) (*TemplateContent, error) { - obj, err := s.objectClient.GetNamespaced(namespace, name, opts) - return obj.(*TemplateContent), err -} - -func (s *templateContentClient) Update(o *TemplateContent) (*TemplateContent, error) { - obj, err := s.objectClient.Update(o.Name, o) - return obj.(*TemplateContent), err -} - -func (s *templateContentClient) UpdateStatus(o *TemplateContent) (*TemplateContent, error) { - obj, err := s.objectClient.UpdateStatus(o.Name, o) - return obj.(*TemplateContent), err -} - -func (s *templateContentClient) Delete(name string, options *metav1.DeleteOptions) error { - return s.objectClient.Delete(name, options) -} - -func (s *templateContentClient) DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error { - return s.objectClient.DeleteNamespaced(namespace, name, options) -} - -func (s *templateContentClient) List(opts metav1.ListOptions) (*TemplateContentList, error) { - obj, err := s.objectClient.List(opts) - return obj.(*TemplateContentList), err -} - -func (s *templateContentClient) ListNamespaced(namespace string, opts metav1.ListOptions) (*TemplateContentList, error) { - obj, err := s.objectClient.ListNamespaced(namespace, opts) - return obj.(*TemplateContentList), err -} - -func (s *templateContentClient) Watch(opts metav1.ListOptions) (watch.Interface, error) { - return s.objectClient.Watch(opts) -} - -// Patch applies the patch and returns the patched deployment. -func (s *templateContentClient) Patch(o *TemplateContent, patchType types.PatchType, data []byte, subresources ...string) (*TemplateContent, error) { - obj, err := s.objectClient.Patch(o.Name, o, patchType, data, subresources...) - return obj.(*TemplateContent), err -} - -func (s *templateContentClient) DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error { - return s.objectClient.DeleteCollection(deleteOpts, listOpts) -} - -func (s *templateContentClient) AddHandler(ctx context.Context, name string, sync TemplateContentHandlerFunc) { - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *templateContentClient) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync TemplateContentHandlerFunc) { - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *templateContentClient) AddLifecycle(ctx context.Context, name string, lifecycle TemplateContentLifecycle) { - sync := NewTemplateContentLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *templateContentClient) AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle TemplateContentLifecycle) { - sync := NewTemplateContentLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *templateContentClient) AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync TemplateContentHandlerFunc) { - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *templateContentClient) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync TemplateContentHandlerFunc) { - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} - -func (s *templateContentClient) AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle TemplateContentLifecycle) { - sync := NewTemplateContentLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *templateContentClient) AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle TemplateContentLifecycle) { - sync := NewTemplateContentLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_template_content_lifecycle_adapter.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_template_content_lifecycle_adapter.go deleted file mode 100644 index 6c09527d..00000000 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_template_content_lifecycle_adapter.go +++ /dev/null @@ -1,66 +0,0 @@ -package v3 - -import ( - "github.com/rancher/norman/lifecycle" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/runtime" -) - -type TemplateContentLifecycle interface { - Create(obj *TemplateContent) (runtime.Object, error) - Remove(obj *TemplateContent) (runtime.Object, error) - Updated(obj *TemplateContent) (runtime.Object, error) -} - -type templateContentLifecycleAdapter struct { - lifecycle TemplateContentLifecycle -} - -func (w *templateContentLifecycleAdapter) HasCreate() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasCreate() -} - -func (w *templateContentLifecycleAdapter) HasFinalize() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasFinalize() -} - -func (w *templateContentLifecycleAdapter) Create(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Create(obj.(*TemplateContent)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *templateContentLifecycleAdapter) Finalize(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Remove(obj.(*TemplateContent)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *templateContentLifecycleAdapter) Updated(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Updated(obj.(*TemplateContent)) - if o == nil { - return nil, err - } - return o, err -} - -func NewTemplateContentLifecycleAdapter(name string, clusterScoped bool, client TemplateContentInterface, l TemplateContentLifecycle) TemplateContentHandlerFunc { - if clusterScoped { - resource.PutClusterScoped(TemplateContentGroupVersionResource) - } - adapter := &templateContentLifecycleAdapter{lifecycle: l} - syncFn := lifecycle.NewObjectLifecycleAdapter(name, clusterScoped, adapter, client.ObjectClient()) - return func(key string, obj *TemplateContent) (runtime.Object, error) { - newObj, err := syncFn(key, obj) - if o, ok := newObj.(runtime.Object); ok { - return o, err - } - return nil, err - } -} diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_template_controller.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_template_controller.go deleted file mode 100644 index de65fc8c..00000000 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_template_controller.go +++ /dev/null @@ -1,320 +0,0 @@ -package v3 - -import ( - "context" - "time" - - "github.com/rancher/norman/controller" - "github.com/rancher/norman/objectclient" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/apimachinery/pkg/types" - "k8s.io/apimachinery/pkg/watch" - "k8s.io/client-go/tools/cache" -) - -var ( - TemplateGroupVersionKind = schema.GroupVersionKind{ - Version: Version, - Group: GroupName, - Kind: "Template", - } - TemplateResource = metav1.APIResource{ - Name: "templates", - SingularName: "template", - Namespaced: false, - Kind: TemplateGroupVersionKind.Kind, - } - - TemplateGroupVersionResource = schema.GroupVersionResource{ - Group: GroupName, - Version: Version, - Resource: "templates", - } -) - -func init() { - resource.Put(TemplateGroupVersionResource) -} - -func NewTemplate(namespace, name string, obj Template) *Template { - obj.APIVersion, obj.Kind = TemplateGroupVersionKind.ToAPIVersionAndKind() - obj.Name = name - obj.Namespace = namespace - return &obj -} - -type TemplateList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []Template `json:"items"` -} - -type TemplateHandlerFunc func(key string, obj *Template) (runtime.Object, error) - -type TemplateChangeHandlerFunc func(obj *Template) (runtime.Object, error) - -type TemplateLister interface { - List(namespace string, selector labels.Selector) (ret []*Template, err error) - Get(namespace, name string) (*Template, error) -} - -type TemplateController interface { - Generic() controller.GenericController - Informer() cache.SharedIndexInformer - Lister() TemplateLister - AddHandler(ctx context.Context, name string, handler TemplateHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync TemplateHandlerFunc) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, handler TemplateHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, handler TemplateHandlerFunc) - Enqueue(namespace, name string) - EnqueueAfter(namespace, name string, after time.Duration) -} - -type TemplateInterface interface { - ObjectClient() *objectclient.ObjectClient - Create(*Template) (*Template, error) - GetNamespaced(namespace, name string, opts metav1.GetOptions) (*Template, error) - Get(name string, opts metav1.GetOptions) (*Template, error) - Update(*Template) (*Template, error) - Delete(name string, options *metav1.DeleteOptions) error - DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error - List(opts metav1.ListOptions) (*TemplateList, error) - ListNamespaced(namespace string, opts metav1.ListOptions) (*TemplateList, error) - Watch(opts metav1.ListOptions) (watch.Interface, error) - DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error - Controller() TemplateController - AddHandler(ctx context.Context, name string, sync TemplateHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync TemplateHandlerFunc) - AddLifecycle(ctx context.Context, name string, lifecycle TemplateLifecycle) - AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle TemplateLifecycle) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync TemplateHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync TemplateHandlerFunc) - AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle TemplateLifecycle) - AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle TemplateLifecycle) -} - -type templateLister struct { - controller *templateController -} - -func (l *templateLister) List(namespace string, selector labels.Selector) (ret []*Template, err error) { - err = cache.ListAllByNamespace(l.controller.Informer().GetIndexer(), namespace, selector, func(obj interface{}) { - ret = append(ret, obj.(*Template)) - }) - return -} - -func (l *templateLister) Get(namespace, name string) (*Template, error) { - var key string - if namespace != "" { - key = namespace + "/" + name - } else { - key = name - } - obj, exists, err := l.controller.Informer().GetIndexer().GetByKey(key) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(schema.GroupResource{ - Group: TemplateGroupVersionKind.Group, - Resource: TemplateGroupVersionResource.Resource, - }, key) - } - return obj.(*Template), nil -} - -type templateController struct { - controller.GenericController -} - -func (c *templateController) Generic() controller.GenericController { - return c.GenericController -} - -func (c *templateController) Lister() TemplateLister { - return &templateLister{ - controller: c, - } -} - -func (c *templateController) AddHandler(ctx context.Context, name string, handler TemplateHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*Template); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *templateController) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, handler TemplateHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*Template); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *templateController) AddClusterScopedHandler(ctx context.Context, name, cluster string, handler TemplateHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*Template); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *templateController) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, cluster string, handler TemplateHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*Template); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -type templateFactory struct { -} - -func (c templateFactory) Object() runtime.Object { - return &Template{} -} - -func (c templateFactory) List() runtime.Object { - return &TemplateList{} -} - -func (s *templateClient) Controller() TemplateController { - genericController := controller.NewGenericController(TemplateGroupVersionKind.Kind+"Controller", - s.client.controllerFactory.ForResourceKind(TemplateGroupVersionResource, TemplateGroupVersionKind.Kind, false)) - - return &templateController{ - GenericController: genericController, - } -} - -type templateClient struct { - client *Client - ns string - objectClient *objectclient.ObjectClient - controller TemplateController -} - -func (s *templateClient) ObjectClient() *objectclient.ObjectClient { - return s.objectClient -} - -func (s *templateClient) Create(o *Template) (*Template, error) { - obj, err := s.objectClient.Create(o) - return obj.(*Template), err -} - -func (s *templateClient) Get(name string, opts metav1.GetOptions) (*Template, error) { - obj, err := s.objectClient.Get(name, opts) - return obj.(*Template), err -} - -func (s *templateClient) GetNamespaced(namespace, name string, opts metav1.GetOptions) (*Template, error) { - obj, err := s.objectClient.GetNamespaced(namespace, name, opts) - return obj.(*Template), err -} - -func (s *templateClient) Update(o *Template) (*Template, error) { - obj, err := s.objectClient.Update(o.Name, o) - return obj.(*Template), err -} - -func (s *templateClient) UpdateStatus(o *Template) (*Template, error) { - obj, err := s.objectClient.UpdateStatus(o.Name, o) - return obj.(*Template), err -} - -func (s *templateClient) Delete(name string, options *metav1.DeleteOptions) error { - return s.objectClient.Delete(name, options) -} - -func (s *templateClient) DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error { - return s.objectClient.DeleteNamespaced(namespace, name, options) -} - -func (s *templateClient) List(opts metav1.ListOptions) (*TemplateList, error) { - obj, err := s.objectClient.List(opts) - return obj.(*TemplateList), err -} - -func (s *templateClient) ListNamespaced(namespace string, opts metav1.ListOptions) (*TemplateList, error) { - obj, err := s.objectClient.ListNamespaced(namespace, opts) - return obj.(*TemplateList), err -} - -func (s *templateClient) Watch(opts metav1.ListOptions) (watch.Interface, error) { - return s.objectClient.Watch(opts) -} - -// Patch applies the patch and returns the patched deployment. -func (s *templateClient) Patch(o *Template, patchType types.PatchType, data []byte, subresources ...string) (*Template, error) { - obj, err := s.objectClient.Patch(o.Name, o, patchType, data, subresources...) - return obj.(*Template), err -} - -func (s *templateClient) DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error { - return s.objectClient.DeleteCollection(deleteOpts, listOpts) -} - -func (s *templateClient) AddHandler(ctx context.Context, name string, sync TemplateHandlerFunc) { - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *templateClient) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync TemplateHandlerFunc) { - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *templateClient) AddLifecycle(ctx context.Context, name string, lifecycle TemplateLifecycle) { - sync := NewTemplateLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *templateClient) AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle TemplateLifecycle) { - sync := NewTemplateLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *templateClient) AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync TemplateHandlerFunc) { - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *templateClient) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync TemplateHandlerFunc) { - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} - -func (s *templateClient) AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle TemplateLifecycle) { - sync := NewTemplateLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *templateClient) AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle TemplateLifecycle) { - sync := NewTemplateLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_template_lifecycle_adapter.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_template_lifecycle_adapter.go deleted file mode 100644 index 719467cc..00000000 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_template_lifecycle_adapter.go +++ /dev/null @@ -1,66 +0,0 @@ -package v3 - -import ( - "github.com/rancher/norman/lifecycle" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/runtime" -) - -type TemplateLifecycle interface { - Create(obj *Template) (runtime.Object, error) - Remove(obj *Template) (runtime.Object, error) - Updated(obj *Template) (runtime.Object, error) -} - -type templateLifecycleAdapter struct { - lifecycle TemplateLifecycle -} - -func (w *templateLifecycleAdapter) HasCreate() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasCreate() -} - -func (w *templateLifecycleAdapter) HasFinalize() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasFinalize() -} - -func (w *templateLifecycleAdapter) Create(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Create(obj.(*Template)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *templateLifecycleAdapter) Finalize(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Remove(obj.(*Template)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *templateLifecycleAdapter) Updated(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Updated(obj.(*Template)) - if o == nil { - return nil, err - } - return o, err -} - -func NewTemplateLifecycleAdapter(name string, clusterScoped bool, client TemplateInterface, l TemplateLifecycle) TemplateHandlerFunc { - if clusterScoped { - resource.PutClusterScoped(TemplateGroupVersionResource) - } - adapter := &templateLifecycleAdapter{lifecycle: l} - syncFn := lifecycle.NewObjectLifecycleAdapter(name, clusterScoped, adapter, client.ObjectClient()) - return func(key string, obj *Template) (runtime.Object, error) { - newObj, err := syncFn(key, obj) - if o, ok := newObj.(runtime.Object); ok { - return o, err - } - return nil, err - } -} diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_template_version_controller.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_template_version_controller.go deleted file mode 100644 index 5702da31..00000000 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_template_version_controller.go +++ /dev/null @@ -1,320 +0,0 @@ -package v3 - -import ( - "context" - "time" - - "github.com/rancher/norman/controller" - "github.com/rancher/norman/objectclient" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/apimachinery/pkg/types" - "k8s.io/apimachinery/pkg/watch" - "k8s.io/client-go/tools/cache" -) - -var ( - TemplateVersionGroupVersionKind = schema.GroupVersionKind{ - Version: Version, - Group: GroupName, - Kind: "TemplateVersion", - } - TemplateVersionResource = metav1.APIResource{ - Name: "templateversions", - SingularName: "templateversion", - Namespaced: false, - Kind: TemplateVersionGroupVersionKind.Kind, - } - - TemplateVersionGroupVersionResource = schema.GroupVersionResource{ - Group: GroupName, - Version: Version, - Resource: "templateversions", - } -) - -func init() { - resource.Put(TemplateVersionGroupVersionResource) -} - -func NewTemplateVersion(namespace, name string, obj TemplateVersion) *TemplateVersion { - obj.APIVersion, obj.Kind = TemplateVersionGroupVersionKind.ToAPIVersionAndKind() - obj.Name = name - obj.Namespace = namespace - return &obj -} - -type TemplateVersionList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []TemplateVersion `json:"items"` -} - -type TemplateVersionHandlerFunc func(key string, obj *TemplateVersion) (runtime.Object, error) - -type TemplateVersionChangeHandlerFunc func(obj *TemplateVersion) (runtime.Object, error) - -type TemplateVersionLister interface { - List(namespace string, selector labels.Selector) (ret []*TemplateVersion, err error) - Get(namespace, name string) (*TemplateVersion, error) -} - -type TemplateVersionController interface { - Generic() controller.GenericController - Informer() cache.SharedIndexInformer - Lister() TemplateVersionLister - AddHandler(ctx context.Context, name string, handler TemplateVersionHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync TemplateVersionHandlerFunc) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, handler TemplateVersionHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, handler TemplateVersionHandlerFunc) - Enqueue(namespace, name string) - EnqueueAfter(namespace, name string, after time.Duration) -} - -type TemplateVersionInterface interface { - ObjectClient() *objectclient.ObjectClient - Create(*TemplateVersion) (*TemplateVersion, error) - GetNamespaced(namespace, name string, opts metav1.GetOptions) (*TemplateVersion, error) - Get(name string, opts metav1.GetOptions) (*TemplateVersion, error) - Update(*TemplateVersion) (*TemplateVersion, error) - Delete(name string, options *metav1.DeleteOptions) error - DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error - List(opts metav1.ListOptions) (*TemplateVersionList, error) - ListNamespaced(namespace string, opts metav1.ListOptions) (*TemplateVersionList, error) - Watch(opts metav1.ListOptions) (watch.Interface, error) - DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error - Controller() TemplateVersionController - AddHandler(ctx context.Context, name string, sync TemplateVersionHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync TemplateVersionHandlerFunc) - AddLifecycle(ctx context.Context, name string, lifecycle TemplateVersionLifecycle) - AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle TemplateVersionLifecycle) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync TemplateVersionHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync TemplateVersionHandlerFunc) - AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle TemplateVersionLifecycle) - AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle TemplateVersionLifecycle) -} - -type templateVersionLister struct { - controller *templateVersionController -} - -func (l *templateVersionLister) List(namespace string, selector labels.Selector) (ret []*TemplateVersion, err error) { - err = cache.ListAllByNamespace(l.controller.Informer().GetIndexer(), namespace, selector, func(obj interface{}) { - ret = append(ret, obj.(*TemplateVersion)) - }) - return -} - -func (l *templateVersionLister) Get(namespace, name string) (*TemplateVersion, error) { - var key string - if namespace != "" { - key = namespace + "/" + name - } else { - key = name - } - obj, exists, err := l.controller.Informer().GetIndexer().GetByKey(key) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(schema.GroupResource{ - Group: TemplateVersionGroupVersionKind.Group, - Resource: TemplateVersionGroupVersionResource.Resource, - }, key) - } - return obj.(*TemplateVersion), nil -} - -type templateVersionController struct { - controller.GenericController -} - -func (c *templateVersionController) Generic() controller.GenericController { - return c.GenericController -} - -func (c *templateVersionController) Lister() TemplateVersionLister { - return &templateVersionLister{ - controller: c, - } -} - -func (c *templateVersionController) AddHandler(ctx context.Context, name string, handler TemplateVersionHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*TemplateVersion); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *templateVersionController) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, handler TemplateVersionHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*TemplateVersion); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *templateVersionController) AddClusterScopedHandler(ctx context.Context, name, cluster string, handler TemplateVersionHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*TemplateVersion); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *templateVersionController) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, cluster string, handler TemplateVersionHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*TemplateVersion); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -type templateVersionFactory struct { -} - -func (c templateVersionFactory) Object() runtime.Object { - return &TemplateVersion{} -} - -func (c templateVersionFactory) List() runtime.Object { - return &TemplateVersionList{} -} - -func (s *templateVersionClient) Controller() TemplateVersionController { - genericController := controller.NewGenericController(TemplateVersionGroupVersionKind.Kind+"Controller", - s.client.controllerFactory.ForResourceKind(TemplateVersionGroupVersionResource, TemplateVersionGroupVersionKind.Kind, false)) - - return &templateVersionController{ - GenericController: genericController, - } -} - -type templateVersionClient struct { - client *Client - ns string - objectClient *objectclient.ObjectClient - controller TemplateVersionController -} - -func (s *templateVersionClient) ObjectClient() *objectclient.ObjectClient { - return s.objectClient -} - -func (s *templateVersionClient) Create(o *TemplateVersion) (*TemplateVersion, error) { - obj, err := s.objectClient.Create(o) - return obj.(*TemplateVersion), err -} - -func (s *templateVersionClient) Get(name string, opts metav1.GetOptions) (*TemplateVersion, error) { - obj, err := s.objectClient.Get(name, opts) - return obj.(*TemplateVersion), err -} - -func (s *templateVersionClient) GetNamespaced(namespace, name string, opts metav1.GetOptions) (*TemplateVersion, error) { - obj, err := s.objectClient.GetNamespaced(namespace, name, opts) - return obj.(*TemplateVersion), err -} - -func (s *templateVersionClient) Update(o *TemplateVersion) (*TemplateVersion, error) { - obj, err := s.objectClient.Update(o.Name, o) - return obj.(*TemplateVersion), err -} - -func (s *templateVersionClient) UpdateStatus(o *TemplateVersion) (*TemplateVersion, error) { - obj, err := s.objectClient.UpdateStatus(o.Name, o) - return obj.(*TemplateVersion), err -} - -func (s *templateVersionClient) Delete(name string, options *metav1.DeleteOptions) error { - return s.objectClient.Delete(name, options) -} - -func (s *templateVersionClient) DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error { - return s.objectClient.DeleteNamespaced(namespace, name, options) -} - -func (s *templateVersionClient) List(opts metav1.ListOptions) (*TemplateVersionList, error) { - obj, err := s.objectClient.List(opts) - return obj.(*TemplateVersionList), err -} - -func (s *templateVersionClient) ListNamespaced(namespace string, opts metav1.ListOptions) (*TemplateVersionList, error) { - obj, err := s.objectClient.ListNamespaced(namespace, opts) - return obj.(*TemplateVersionList), err -} - -func (s *templateVersionClient) Watch(opts metav1.ListOptions) (watch.Interface, error) { - return s.objectClient.Watch(opts) -} - -// Patch applies the patch and returns the patched deployment. -func (s *templateVersionClient) Patch(o *TemplateVersion, patchType types.PatchType, data []byte, subresources ...string) (*TemplateVersion, error) { - obj, err := s.objectClient.Patch(o.Name, o, patchType, data, subresources...) - return obj.(*TemplateVersion), err -} - -func (s *templateVersionClient) DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error { - return s.objectClient.DeleteCollection(deleteOpts, listOpts) -} - -func (s *templateVersionClient) AddHandler(ctx context.Context, name string, sync TemplateVersionHandlerFunc) { - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *templateVersionClient) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync TemplateVersionHandlerFunc) { - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *templateVersionClient) AddLifecycle(ctx context.Context, name string, lifecycle TemplateVersionLifecycle) { - sync := NewTemplateVersionLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *templateVersionClient) AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle TemplateVersionLifecycle) { - sync := NewTemplateVersionLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *templateVersionClient) AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync TemplateVersionHandlerFunc) { - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *templateVersionClient) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync TemplateVersionHandlerFunc) { - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} - -func (s *templateVersionClient) AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle TemplateVersionLifecycle) { - sync := NewTemplateVersionLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *templateVersionClient) AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle TemplateVersionLifecycle) { - sync := NewTemplateVersionLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_template_version_lifecycle_adapter.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_template_version_lifecycle_adapter.go deleted file mode 100644 index bb7ea36a..00000000 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_template_version_lifecycle_adapter.go +++ /dev/null @@ -1,66 +0,0 @@ -package v3 - -import ( - "github.com/rancher/norman/lifecycle" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/runtime" -) - -type TemplateVersionLifecycle interface { - Create(obj *TemplateVersion) (runtime.Object, error) - Remove(obj *TemplateVersion) (runtime.Object, error) - Updated(obj *TemplateVersion) (runtime.Object, error) -} - -type templateVersionLifecycleAdapter struct { - lifecycle TemplateVersionLifecycle -} - -func (w *templateVersionLifecycleAdapter) HasCreate() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasCreate() -} - -func (w *templateVersionLifecycleAdapter) HasFinalize() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasFinalize() -} - -func (w *templateVersionLifecycleAdapter) Create(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Create(obj.(*TemplateVersion)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *templateVersionLifecycleAdapter) Finalize(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Remove(obj.(*TemplateVersion)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *templateVersionLifecycleAdapter) Updated(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Updated(obj.(*TemplateVersion)) - if o == nil { - return nil, err - } - return o, err -} - -func NewTemplateVersionLifecycleAdapter(name string, clusterScoped bool, client TemplateVersionInterface, l TemplateVersionLifecycle) TemplateVersionHandlerFunc { - if clusterScoped { - resource.PutClusterScoped(TemplateVersionGroupVersionResource) - } - adapter := &templateVersionLifecycleAdapter{lifecycle: l} - syncFn := lifecycle.NewObjectLifecycleAdapter(name, clusterScoped, adapter, client.ObjectClient()) - return func(key string, obj *TemplateVersion) (runtime.Object, error) { - newObj, err := syncFn(key, obj) - if o, ok := newObj.(runtime.Object); ok { - return o, err - } - return nil, err - } -} diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_token_controller.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_token_controller.go deleted file mode 100644 index c2211c9b..00000000 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_token_controller.go +++ /dev/null @@ -1,320 +0,0 @@ -package v3 - -import ( - "context" - "time" - - "github.com/rancher/norman/controller" - "github.com/rancher/norman/objectclient" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/apimachinery/pkg/types" - "k8s.io/apimachinery/pkg/watch" - "k8s.io/client-go/tools/cache" -) - -var ( - TokenGroupVersionKind = schema.GroupVersionKind{ - Version: Version, - Group: GroupName, - Kind: "Token", - } - TokenResource = metav1.APIResource{ - Name: "tokens", - SingularName: "token", - Namespaced: false, - Kind: TokenGroupVersionKind.Kind, - } - - TokenGroupVersionResource = schema.GroupVersionResource{ - Group: GroupName, - Version: Version, - Resource: "tokens", - } -) - -func init() { - resource.Put(TokenGroupVersionResource) -} - -func NewToken(namespace, name string, obj Token) *Token { - obj.APIVersion, obj.Kind = TokenGroupVersionKind.ToAPIVersionAndKind() - obj.Name = name - obj.Namespace = namespace - return &obj -} - -type TokenList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []Token `json:"items"` -} - -type TokenHandlerFunc func(key string, obj *Token) (runtime.Object, error) - -type TokenChangeHandlerFunc func(obj *Token) (runtime.Object, error) - -type TokenLister interface { - List(namespace string, selector labels.Selector) (ret []*Token, err error) - Get(namespace, name string) (*Token, error) -} - -type TokenController interface { - Generic() controller.GenericController - Informer() cache.SharedIndexInformer - Lister() TokenLister - AddHandler(ctx context.Context, name string, handler TokenHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync TokenHandlerFunc) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, handler TokenHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, handler TokenHandlerFunc) - Enqueue(namespace, name string) - EnqueueAfter(namespace, name string, after time.Duration) -} - -type TokenInterface interface { - ObjectClient() *objectclient.ObjectClient - Create(*Token) (*Token, error) - GetNamespaced(namespace, name string, opts metav1.GetOptions) (*Token, error) - Get(name string, opts metav1.GetOptions) (*Token, error) - Update(*Token) (*Token, error) - Delete(name string, options *metav1.DeleteOptions) error - DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error - List(opts metav1.ListOptions) (*TokenList, error) - ListNamespaced(namespace string, opts metav1.ListOptions) (*TokenList, error) - Watch(opts metav1.ListOptions) (watch.Interface, error) - DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error - Controller() TokenController - AddHandler(ctx context.Context, name string, sync TokenHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync TokenHandlerFunc) - AddLifecycle(ctx context.Context, name string, lifecycle TokenLifecycle) - AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle TokenLifecycle) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync TokenHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync TokenHandlerFunc) - AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle TokenLifecycle) - AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle TokenLifecycle) -} - -type tokenLister struct { - controller *tokenController -} - -func (l *tokenLister) List(namespace string, selector labels.Selector) (ret []*Token, err error) { - err = cache.ListAllByNamespace(l.controller.Informer().GetIndexer(), namespace, selector, func(obj interface{}) { - ret = append(ret, obj.(*Token)) - }) - return -} - -func (l *tokenLister) Get(namespace, name string) (*Token, error) { - var key string - if namespace != "" { - key = namespace + "/" + name - } else { - key = name - } - obj, exists, err := l.controller.Informer().GetIndexer().GetByKey(key) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(schema.GroupResource{ - Group: TokenGroupVersionKind.Group, - Resource: TokenGroupVersionResource.Resource, - }, key) - } - return obj.(*Token), nil -} - -type tokenController struct { - controller.GenericController -} - -func (c *tokenController) Generic() controller.GenericController { - return c.GenericController -} - -func (c *tokenController) Lister() TokenLister { - return &tokenLister{ - controller: c, - } -} - -func (c *tokenController) AddHandler(ctx context.Context, name string, handler TokenHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*Token); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *tokenController) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, handler TokenHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*Token); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *tokenController) AddClusterScopedHandler(ctx context.Context, name, cluster string, handler TokenHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*Token); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *tokenController) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, cluster string, handler TokenHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*Token); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -type tokenFactory struct { -} - -func (c tokenFactory) Object() runtime.Object { - return &Token{} -} - -func (c tokenFactory) List() runtime.Object { - return &TokenList{} -} - -func (s *tokenClient) Controller() TokenController { - genericController := controller.NewGenericController(TokenGroupVersionKind.Kind+"Controller", - s.client.controllerFactory.ForResourceKind(TokenGroupVersionResource, TokenGroupVersionKind.Kind, false)) - - return &tokenController{ - GenericController: genericController, - } -} - -type tokenClient struct { - client *Client - ns string - objectClient *objectclient.ObjectClient - controller TokenController -} - -func (s *tokenClient) ObjectClient() *objectclient.ObjectClient { - return s.objectClient -} - -func (s *tokenClient) Create(o *Token) (*Token, error) { - obj, err := s.objectClient.Create(o) - return obj.(*Token), err -} - -func (s *tokenClient) Get(name string, opts metav1.GetOptions) (*Token, error) { - obj, err := s.objectClient.Get(name, opts) - return obj.(*Token), err -} - -func (s *tokenClient) GetNamespaced(namespace, name string, opts metav1.GetOptions) (*Token, error) { - obj, err := s.objectClient.GetNamespaced(namespace, name, opts) - return obj.(*Token), err -} - -func (s *tokenClient) Update(o *Token) (*Token, error) { - obj, err := s.objectClient.Update(o.Name, o) - return obj.(*Token), err -} - -func (s *tokenClient) UpdateStatus(o *Token) (*Token, error) { - obj, err := s.objectClient.UpdateStatus(o.Name, o) - return obj.(*Token), err -} - -func (s *tokenClient) Delete(name string, options *metav1.DeleteOptions) error { - return s.objectClient.Delete(name, options) -} - -func (s *tokenClient) DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error { - return s.objectClient.DeleteNamespaced(namespace, name, options) -} - -func (s *tokenClient) List(opts metav1.ListOptions) (*TokenList, error) { - obj, err := s.objectClient.List(opts) - return obj.(*TokenList), err -} - -func (s *tokenClient) ListNamespaced(namespace string, opts metav1.ListOptions) (*TokenList, error) { - obj, err := s.objectClient.ListNamespaced(namespace, opts) - return obj.(*TokenList), err -} - -func (s *tokenClient) Watch(opts metav1.ListOptions) (watch.Interface, error) { - return s.objectClient.Watch(opts) -} - -// Patch applies the patch and returns the patched deployment. -func (s *tokenClient) Patch(o *Token, patchType types.PatchType, data []byte, subresources ...string) (*Token, error) { - obj, err := s.objectClient.Patch(o.Name, o, patchType, data, subresources...) - return obj.(*Token), err -} - -func (s *tokenClient) DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error { - return s.objectClient.DeleteCollection(deleteOpts, listOpts) -} - -func (s *tokenClient) AddHandler(ctx context.Context, name string, sync TokenHandlerFunc) { - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *tokenClient) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync TokenHandlerFunc) { - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *tokenClient) AddLifecycle(ctx context.Context, name string, lifecycle TokenLifecycle) { - sync := NewTokenLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *tokenClient) AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle TokenLifecycle) { - sync := NewTokenLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *tokenClient) AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync TokenHandlerFunc) { - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *tokenClient) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync TokenHandlerFunc) { - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} - -func (s *tokenClient) AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle TokenLifecycle) { - sync := NewTokenLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *tokenClient) AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle TokenLifecycle) { - sync := NewTokenLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_token_lifecycle_adapter.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_token_lifecycle_adapter.go deleted file mode 100644 index e82bf45a..00000000 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_token_lifecycle_adapter.go +++ /dev/null @@ -1,66 +0,0 @@ -package v3 - -import ( - "github.com/rancher/norman/lifecycle" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/runtime" -) - -type TokenLifecycle interface { - Create(obj *Token) (runtime.Object, error) - Remove(obj *Token) (runtime.Object, error) - Updated(obj *Token) (runtime.Object, error) -} - -type tokenLifecycleAdapter struct { - lifecycle TokenLifecycle -} - -func (w *tokenLifecycleAdapter) HasCreate() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasCreate() -} - -func (w *tokenLifecycleAdapter) HasFinalize() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasFinalize() -} - -func (w *tokenLifecycleAdapter) Create(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Create(obj.(*Token)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *tokenLifecycleAdapter) Finalize(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Remove(obj.(*Token)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *tokenLifecycleAdapter) Updated(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Updated(obj.(*Token)) - if o == nil { - return nil, err - } - return o, err -} - -func NewTokenLifecycleAdapter(name string, clusterScoped bool, client TokenInterface, l TokenLifecycle) TokenHandlerFunc { - if clusterScoped { - resource.PutClusterScoped(TokenGroupVersionResource) - } - adapter := &tokenLifecycleAdapter{lifecycle: l} - syncFn := lifecycle.NewObjectLifecycleAdapter(name, clusterScoped, adapter, client.ObjectClient()) - return func(key string, obj *Token) (runtime.Object, error) { - newObj, err := syncFn(key, obj) - if o, ok := newObj.(runtime.Object); ok { - return o, err - } - return nil, err - } -} diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_user_attribute_controller.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_user_attribute_controller.go deleted file mode 100644 index 6acc633f..00000000 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_user_attribute_controller.go +++ /dev/null @@ -1,320 +0,0 @@ -package v3 - -import ( - "context" - "time" - - "github.com/rancher/norman/controller" - "github.com/rancher/norman/objectclient" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/apimachinery/pkg/types" - "k8s.io/apimachinery/pkg/watch" - "k8s.io/client-go/tools/cache" -) - -var ( - UserAttributeGroupVersionKind = schema.GroupVersionKind{ - Version: Version, - Group: GroupName, - Kind: "UserAttribute", - } - UserAttributeResource = metav1.APIResource{ - Name: "userattributes", - SingularName: "userattribute", - Namespaced: false, - Kind: UserAttributeGroupVersionKind.Kind, - } - - UserAttributeGroupVersionResource = schema.GroupVersionResource{ - Group: GroupName, - Version: Version, - Resource: "userattributes", - } -) - -func init() { - resource.Put(UserAttributeGroupVersionResource) -} - -func NewUserAttribute(namespace, name string, obj UserAttribute) *UserAttribute { - obj.APIVersion, obj.Kind = UserAttributeGroupVersionKind.ToAPIVersionAndKind() - obj.Name = name - obj.Namespace = namespace - return &obj -} - -type UserAttributeList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []UserAttribute `json:"items"` -} - -type UserAttributeHandlerFunc func(key string, obj *UserAttribute) (runtime.Object, error) - -type UserAttributeChangeHandlerFunc func(obj *UserAttribute) (runtime.Object, error) - -type UserAttributeLister interface { - List(namespace string, selector labels.Selector) (ret []*UserAttribute, err error) - Get(namespace, name string) (*UserAttribute, error) -} - -type UserAttributeController interface { - Generic() controller.GenericController - Informer() cache.SharedIndexInformer - Lister() UserAttributeLister - AddHandler(ctx context.Context, name string, handler UserAttributeHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync UserAttributeHandlerFunc) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, handler UserAttributeHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, handler UserAttributeHandlerFunc) - Enqueue(namespace, name string) - EnqueueAfter(namespace, name string, after time.Duration) -} - -type UserAttributeInterface interface { - ObjectClient() *objectclient.ObjectClient - Create(*UserAttribute) (*UserAttribute, error) - GetNamespaced(namespace, name string, opts metav1.GetOptions) (*UserAttribute, error) - Get(name string, opts metav1.GetOptions) (*UserAttribute, error) - Update(*UserAttribute) (*UserAttribute, error) - Delete(name string, options *metav1.DeleteOptions) error - DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error - List(opts metav1.ListOptions) (*UserAttributeList, error) - ListNamespaced(namespace string, opts metav1.ListOptions) (*UserAttributeList, error) - Watch(opts metav1.ListOptions) (watch.Interface, error) - DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error - Controller() UserAttributeController - AddHandler(ctx context.Context, name string, sync UserAttributeHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync UserAttributeHandlerFunc) - AddLifecycle(ctx context.Context, name string, lifecycle UserAttributeLifecycle) - AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle UserAttributeLifecycle) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync UserAttributeHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync UserAttributeHandlerFunc) - AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle UserAttributeLifecycle) - AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle UserAttributeLifecycle) -} - -type userAttributeLister struct { - controller *userAttributeController -} - -func (l *userAttributeLister) List(namespace string, selector labels.Selector) (ret []*UserAttribute, err error) { - err = cache.ListAllByNamespace(l.controller.Informer().GetIndexer(), namespace, selector, func(obj interface{}) { - ret = append(ret, obj.(*UserAttribute)) - }) - return -} - -func (l *userAttributeLister) Get(namespace, name string) (*UserAttribute, error) { - var key string - if namespace != "" { - key = namespace + "/" + name - } else { - key = name - } - obj, exists, err := l.controller.Informer().GetIndexer().GetByKey(key) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(schema.GroupResource{ - Group: UserAttributeGroupVersionKind.Group, - Resource: UserAttributeGroupVersionResource.Resource, - }, key) - } - return obj.(*UserAttribute), nil -} - -type userAttributeController struct { - controller.GenericController -} - -func (c *userAttributeController) Generic() controller.GenericController { - return c.GenericController -} - -func (c *userAttributeController) Lister() UserAttributeLister { - return &userAttributeLister{ - controller: c, - } -} - -func (c *userAttributeController) AddHandler(ctx context.Context, name string, handler UserAttributeHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*UserAttribute); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *userAttributeController) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, handler UserAttributeHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*UserAttribute); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *userAttributeController) AddClusterScopedHandler(ctx context.Context, name, cluster string, handler UserAttributeHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*UserAttribute); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *userAttributeController) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, cluster string, handler UserAttributeHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*UserAttribute); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -type userAttributeFactory struct { -} - -func (c userAttributeFactory) Object() runtime.Object { - return &UserAttribute{} -} - -func (c userAttributeFactory) List() runtime.Object { - return &UserAttributeList{} -} - -func (s *userAttributeClient) Controller() UserAttributeController { - genericController := controller.NewGenericController(UserAttributeGroupVersionKind.Kind+"Controller", - s.client.controllerFactory.ForResourceKind(UserAttributeGroupVersionResource, UserAttributeGroupVersionKind.Kind, false)) - - return &userAttributeController{ - GenericController: genericController, - } -} - -type userAttributeClient struct { - client *Client - ns string - objectClient *objectclient.ObjectClient - controller UserAttributeController -} - -func (s *userAttributeClient) ObjectClient() *objectclient.ObjectClient { - return s.objectClient -} - -func (s *userAttributeClient) Create(o *UserAttribute) (*UserAttribute, error) { - obj, err := s.objectClient.Create(o) - return obj.(*UserAttribute), err -} - -func (s *userAttributeClient) Get(name string, opts metav1.GetOptions) (*UserAttribute, error) { - obj, err := s.objectClient.Get(name, opts) - return obj.(*UserAttribute), err -} - -func (s *userAttributeClient) GetNamespaced(namespace, name string, opts metav1.GetOptions) (*UserAttribute, error) { - obj, err := s.objectClient.GetNamespaced(namespace, name, opts) - return obj.(*UserAttribute), err -} - -func (s *userAttributeClient) Update(o *UserAttribute) (*UserAttribute, error) { - obj, err := s.objectClient.Update(o.Name, o) - return obj.(*UserAttribute), err -} - -func (s *userAttributeClient) UpdateStatus(o *UserAttribute) (*UserAttribute, error) { - obj, err := s.objectClient.UpdateStatus(o.Name, o) - return obj.(*UserAttribute), err -} - -func (s *userAttributeClient) Delete(name string, options *metav1.DeleteOptions) error { - return s.objectClient.Delete(name, options) -} - -func (s *userAttributeClient) DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error { - return s.objectClient.DeleteNamespaced(namespace, name, options) -} - -func (s *userAttributeClient) List(opts metav1.ListOptions) (*UserAttributeList, error) { - obj, err := s.objectClient.List(opts) - return obj.(*UserAttributeList), err -} - -func (s *userAttributeClient) ListNamespaced(namespace string, opts metav1.ListOptions) (*UserAttributeList, error) { - obj, err := s.objectClient.ListNamespaced(namespace, opts) - return obj.(*UserAttributeList), err -} - -func (s *userAttributeClient) Watch(opts metav1.ListOptions) (watch.Interface, error) { - return s.objectClient.Watch(opts) -} - -// Patch applies the patch and returns the patched deployment. -func (s *userAttributeClient) Patch(o *UserAttribute, patchType types.PatchType, data []byte, subresources ...string) (*UserAttribute, error) { - obj, err := s.objectClient.Patch(o.Name, o, patchType, data, subresources...) - return obj.(*UserAttribute), err -} - -func (s *userAttributeClient) DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error { - return s.objectClient.DeleteCollection(deleteOpts, listOpts) -} - -func (s *userAttributeClient) AddHandler(ctx context.Context, name string, sync UserAttributeHandlerFunc) { - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *userAttributeClient) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync UserAttributeHandlerFunc) { - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *userAttributeClient) AddLifecycle(ctx context.Context, name string, lifecycle UserAttributeLifecycle) { - sync := NewUserAttributeLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *userAttributeClient) AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle UserAttributeLifecycle) { - sync := NewUserAttributeLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *userAttributeClient) AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync UserAttributeHandlerFunc) { - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *userAttributeClient) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync UserAttributeHandlerFunc) { - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} - -func (s *userAttributeClient) AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle UserAttributeLifecycle) { - sync := NewUserAttributeLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *userAttributeClient) AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle UserAttributeLifecycle) { - sync := NewUserAttributeLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_user_attribute_lifecycle_adapter.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_user_attribute_lifecycle_adapter.go deleted file mode 100644 index 45605f1c..00000000 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_user_attribute_lifecycle_adapter.go +++ /dev/null @@ -1,66 +0,0 @@ -package v3 - -import ( - "github.com/rancher/norman/lifecycle" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/runtime" -) - -type UserAttributeLifecycle interface { - Create(obj *UserAttribute) (runtime.Object, error) - Remove(obj *UserAttribute) (runtime.Object, error) - Updated(obj *UserAttribute) (runtime.Object, error) -} - -type userAttributeLifecycleAdapter struct { - lifecycle UserAttributeLifecycle -} - -func (w *userAttributeLifecycleAdapter) HasCreate() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasCreate() -} - -func (w *userAttributeLifecycleAdapter) HasFinalize() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasFinalize() -} - -func (w *userAttributeLifecycleAdapter) Create(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Create(obj.(*UserAttribute)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *userAttributeLifecycleAdapter) Finalize(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Remove(obj.(*UserAttribute)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *userAttributeLifecycleAdapter) Updated(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Updated(obj.(*UserAttribute)) - if o == nil { - return nil, err - } - return o, err -} - -func NewUserAttributeLifecycleAdapter(name string, clusterScoped bool, client UserAttributeInterface, l UserAttributeLifecycle) UserAttributeHandlerFunc { - if clusterScoped { - resource.PutClusterScoped(UserAttributeGroupVersionResource) - } - adapter := &userAttributeLifecycleAdapter{lifecycle: l} - syncFn := lifecycle.NewObjectLifecycleAdapter(name, clusterScoped, adapter, client.ObjectClient()) - return func(key string, obj *UserAttribute) (runtime.Object, error) { - newObj, err := syncFn(key, obj) - if o, ok := newObj.(runtime.Object); ok { - return o, err - } - return nil, err - } -} diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_user_controller.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_user_controller.go deleted file mode 100644 index 051007c4..00000000 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_user_controller.go +++ /dev/null @@ -1,320 +0,0 @@ -package v3 - -import ( - "context" - "time" - - "github.com/rancher/norman/controller" - "github.com/rancher/norman/objectclient" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/apimachinery/pkg/types" - "k8s.io/apimachinery/pkg/watch" - "k8s.io/client-go/tools/cache" -) - -var ( - UserGroupVersionKind = schema.GroupVersionKind{ - Version: Version, - Group: GroupName, - Kind: "User", - } - UserResource = metav1.APIResource{ - Name: "users", - SingularName: "user", - Namespaced: false, - Kind: UserGroupVersionKind.Kind, - } - - UserGroupVersionResource = schema.GroupVersionResource{ - Group: GroupName, - Version: Version, - Resource: "users", - } -) - -func init() { - resource.Put(UserGroupVersionResource) -} - -func NewUser(namespace, name string, obj User) *User { - obj.APIVersion, obj.Kind = UserGroupVersionKind.ToAPIVersionAndKind() - obj.Name = name - obj.Namespace = namespace - return &obj -} - -type UserList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []User `json:"items"` -} - -type UserHandlerFunc func(key string, obj *User) (runtime.Object, error) - -type UserChangeHandlerFunc func(obj *User) (runtime.Object, error) - -type UserLister interface { - List(namespace string, selector labels.Selector) (ret []*User, err error) - Get(namespace, name string) (*User, error) -} - -type UserController interface { - Generic() controller.GenericController - Informer() cache.SharedIndexInformer - Lister() UserLister - AddHandler(ctx context.Context, name string, handler UserHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync UserHandlerFunc) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, handler UserHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, handler UserHandlerFunc) - Enqueue(namespace, name string) - EnqueueAfter(namespace, name string, after time.Duration) -} - -type UserInterface interface { - ObjectClient() *objectclient.ObjectClient - Create(*User) (*User, error) - GetNamespaced(namespace, name string, opts metav1.GetOptions) (*User, error) - Get(name string, opts metav1.GetOptions) (*User, error) - Update(*User) (*User, error) - Delete(name string, options *metav1.DeleteOptions) error - DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error - List(opts metav1.ListOptions) (*UserList, error) - ListNamespaced(namespace string, opts metav1.ListOptions) (*UserList, error) - Watch(opts metav1.ListOptions) (watch.Interface, error) - DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error - Controller() UserController - AddHandler(ctx context.Context, name string, sync UserHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync UserHandlerFunc) - AddLifecycle(ctx context.Context, name string, lifecycle UserLifecycle) - AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle UserLifecycle) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync UserHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync UserHandlerFunc) - AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle UserLifecycle) - AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle UserLifecycle) -} - -type userLister struct { - controller *userController -} - -func (l *userLister) List(namespace string, selector labels.Selector) (ret []*User, err error) { - err = cache.ListAllByNamespace(l.controller.Informer().GetIndexer(), namespace, selector, func(obj interface{}) { - ret = append(ret, obj.(*User)) - }) - return -} - -func (l *userLister) Get(namespace, name string) (*User, error) { - var key string - if namespace != "" { - key = namespace + "/" + name - } else { - key = name - } - obj, exists, err := l.controller.Informer().GetIndexer().GetByKey(key) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(schema.GroupResource{ - Group: UserGroupVersionKind.Group, - Resource: UserGroupVersionResource.Resource, - }, key) - } - return obj.(*User), nil -} - -type userController struct { - controller.GenericController -} - -func (c *userController) Generic() controller.GenericController { - return c.GenericController -} - -func (c *userController) Lister() UserLister { - return &userLister{ - controller: c, - } -} - -func (c *userController) AddHandler(ctx context.Context, name string, handler UserHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*User); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *userController) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, handler UserHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*User); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *userController) AddClusterScopedHandler(ctx context.Context, name, cluster string, handler UserHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*User); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *userController) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, cluster string, handler UserHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*User); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -type userFactory struct { -} - -func (c userFactory) Object() runtime.Object { - return &User{} -} - -func (c userFactory) List() runtime.Object { - return &UserList{} -} - -func (s *userClient) Controller() UserController { - genericController := controller.NewGenericController(UserGroupVersionKind.Kind+"Controller", - s.client.controllerFactory.ForResourceKind(UserGroupVersionResource, UserGroupVersionKind.Kind, false)) - - return &userController{ - GenericController: genericController, - } -} - -type userClient struct { - client *Client - ns string - objectClient *objectclient.ObjectClient - controller UserController -} - -func (s *userClient) ObjectClient() *objectclient.ObjectClient { - return s.objectClient -} - -func (s *userClient) Create(o *User) (*User, error) { - obj, err := s.objectClient.Create(o) - return obj.(*User), err -} - -func (s *userClient) Get(name string, opts metav1.GetOptions) (*User, error) { - obj, err := s.objectClient.Get(name, opts) - return obj.(*User), err -} - -func (s *userClient) GetNamespaced(namespace, name string, opts metav1.GetOptions) (*User, error) { - obj, err := s.objectClient.GetNamespaced(namespace, name, opts) - return obj.(*User), err -} - -func (s *userClient) Update(o *User) (*User, error) { - obj, err := s.objectClient.Update(o.Name, o) - return obj.(*User), err -} - -func (s *userClient) UpdateStatus(o *User) (*User, error) { - obj, err := s.objectClient.UpdateStatus(o.Name, o) - return obj.(*User), err -} - -func (s *userClient) Delete(name string, options *metav1.DeleteOptions) error { - return s.objectClient.Delete(name, options) -} - -func (s *userClient) DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error { - return s.objectClient.DeleteNamespaced(namespace, name, options) -} - -func (s *userClient) List(opts metav1.ListOptions) (*UserList, error) { - obj, err := s.objectClient.List(opts) - return obj.(*UserList), err -} - -func (s *userClient) ListNamespaced(namespace string, opts metav1.ListOptions) (*UserList, error) { - obj, err := s.objectClient.ListNamespaced(namespace, opts) - return obj.(*UserList), err -} - -func (s *userClient) Watch(opts metav1.ListOptions) (watch.Interface, error) { - return s.objectClient.Watch(opts) -} - -// Patch applies the patch and returns the patched deployment. -func (s *userClient) Patch(o *User, patchType types.PatchType, data []byte, subresources ...string) (*User, error) { - obj, err := s.objectClient.Patch(o.Name, o, patchType, data, subresources...) - return obj.(*User), err -} - -func (s *userClient) DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error { - return s.objectClient.DeleteCollection(deleteOpts, listOpts) -} - -func (s *userClient) AddHandler(ctx context.Context, name string, sync UserHandlerFunc) { - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *userClient) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync UserHandlerFunc) { - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *userClient) AddLifecycle(ctx context.Context, name string, lifecycle UserLifecycle) { - sync := NewUserLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *userClient) AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle UserLifecycle) { - sync := NewUserLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *userClient) AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync UserHandlerFunc) { - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *userClient) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync UserHandlerFunc) { - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} - -func (s *userClient) AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle UserLifecycle) { - sync := NewUserLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *userClient) AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle UserLifecycle) { - sync := NewUserLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_user_lifecycle_adapter.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_user_lifecycle_adapter.go deleted file mode 100644 index ab2082bb..00000000 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_user_lifecycle_adapter.go +++ /dev/null @@ -1,66 +0,0 @@ -package v3 - -import ( - "github.com/rancher/norman/lifecycle" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/runtime" -) - -type UserLifecycle interface { - Create(obj *User) (runtime.Object, error) - Remove(obj *User) (runtime.Object, error) - Updated(obj *User) (runtime.Object, error) -} - -type userLifecycleAdapter struct { - lifecycle UserLifecycle -} - -func (w *userLifecycleAdapter) HasCreate() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasCreate() -} - -func (w *userLifecycleAdapter) HasFinalize() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasFinalize() -} - -func (w *userLifecycleAdapter) Create(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Create(obj.(*User)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *userLifecycleAdapter) Finalize(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Remove(obj.(*User)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *userLifecycleAdapter) Updated(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Updated(obj.(*User)) - if o == nil { - return nil, err - } - return o, err -} - -func NewUserLifecycleAdapter(name string, clusterScoped bool, client UserInterface, l UserLifecycle) UserHandlerFunc { - if clusterScoped { - resource.PutClusterScoped(UserGroupVersionResource) - } - adapter := &userLifecycleAdapter{lifecycle: l} - syncFn := lifecycle.NewObjectLifecycleAdapter(name, clusterScoped, adapter, client.ObjectClient()) - return func(key string, obj *User) (runtime.Object, error) { - newObj, err := syncFn(key, obj) - if o, ok := newObj.(runtime.Object); ok { - return o, err - } - return nil, err - } -} diff --git a/vendor/github.com/rancher/types/apis/project.cattle.io/v3/app_types.go b/vendor/github.com/rancher/types/apis/project.cattle.io/v3/app_types.go deleted file mode 100644 index 541fd1b5..00000000 --- a/vendor/github.com/rancher/types/apis/project.cattle.io/v3/app_types.go +++ /dev/null @@ -1,126 +0,0 @@ -package v3 - -import ( - "strings" - - "github.com/rancher/norman/condition" - "github.com/rancher/norman/types" - v1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -type App struct { - types.Namespaced - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - Spec AppSpec `json:"spec,omitempty"` - Status AppStatus `json:"status,omitempty"` -} - -func (a *App) ObjClusterName() string { - return a.Spec.ObjClusterName() -} - -type AppSpec struct { - ProjectName string `json:"projectName,omitempty" norman:"type=reference[/v3/schemas/project]"` - Description string `json:"description,omitempty"` - TargetNamespace string `json:"targetNamespace,omitempty"` - ExternalID string `json:"externalId,omitempty"` - Files map[string]string `json:"files,omitempty"` - Answers map[string]string `json:"answers,omitempty"` - Wait bool `json:"wait,omitempty"` - Timeout int `json:"timeout,omitempty" norman:"min=1,default=300"` - AppRevisionName string `json:"appRevisionName,omitempty" norman:"type=reference[/v3/project/schemas/apprevision]"` - Prune bool `json:"prune,omitempty"` - MultiClusterAppName string `json:"multiClusterAppName,omitempty" norman:"type=reference[/v3/schemas/multiclusterapp]"` - ValuesYaml string `json:"valuesYaml,omitempty"` -} - -func (a *AppSpec) ObjClusterName() string { - if parts := strings.SplitN(a.ProjectName, ":", 2); len(parts) == 2 { - return parts[0] - } - return "" -} - -var ( - AppConditionInstalled condition.Cond = "Installed" - AppConditionMigrated condition.Cond = "Migrated" - AppConditionDeployed condition.Cond = "Deployed" - AppConditionForceUpgrade condition.Cond = "ForceUpgrade" - AppConditionUserTriggeredAction condition.Cond = "UserTriggeredAction" - IstioConditionMetricExpressionDeployed condition.Cond = "MetricExpressionDeployed" -) - -type AppStatus struct { - AppliedFiles map[string]string `json:"appliedFiles,omitempty"` - Notes string `json:"notes,omitempty"` - Conditions []AppCondition `json:"conditions,omitempty"` - LastAppliedTemplates string `json:"lastAppliedTemplate,omitempty"` - HelmVersion string `json:"helmVersion,omitempty" norman:"noupdate,nocreate"` -} - -type AppCondition struct { - // Type of cluster condition. - Type condition.Cond `json:"type"` - // Status of the condition, one of True, False, Unknown. - Status v1.ConditionStatus `json:"status"` - // The last time this condition was updated. - LastUpdateTime string `json:"lastUpdateTime,omitempty"` - // Last time the condition transitioned from one status to another. - LastTransitionTime string `json:"lastTransitionTime,omitempty"` - // The reason for the condition's last transition. - Reason string `json:"reason,omitempty"` - // Human-readable message indicating details about last transition - Message string `json:"message,omitempty"` -} - -type AppRevision struct { - types.Namespaced - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - Spec AppRevisionSpec `json:"spec,omitempty"` - Status AppRevisionStatus `json:"status,omitempty"` -} - -type AppRevisionSpec struct { - ProjectName string `json:"projectName,omitempty" norman:"type=reference[/v3/schemas/project]"` -} - -func (a *AppRevisionSpec) ObjClusterName() string { - if parts := strings.SplitN(a.ProjectName, ":", 2); len(parts) == 2 { - return parts[0] - } - return "" -} - -type AppRevisionStatus struct { - ProjectName string `json:"projectName,omitempty" norman:"type=reference[/v3/schemas/project]"` - ExternalID string `json:"externalId"` - Answers map[string]string `json:"answers"` - Digest string `json:"digest"` - ValuesYaml string `json:"valuesYaml,omitempty"` - Files map[string]string `json:"files,omitempty"` -} - -func (a *AppRevisionStatus) ObjClusterName() string { - if parts := strings.SplitN(a.ProjectName, ":", 2); len(parts) == 2 { - return parts[0] - } - return "" -} - -type AppUpgradeConfig struct { - ExternalID string `json:"externalId,omitempty"` - Answers map[string]string `json:"answers,omitempty"` - ForceUpgrade bool `json:"forceUpgrade,omitempty"` - Files map[string]string `json:"files,omitempty"` - ValuesYaml string `json:"valuesYaml,omitempty"` -} - -type RollbackRevision struct { - RevisionName string `json:"revisionName,omitempty" norman:"type=reference[/v3/project/schemas/apprevision]"` - ForceUpgrade bool `json:"forceUpgrade,omitempty"` -} diff --git a/vendor/github.com/rancher/types/apis/project.cattle.io/v3/pipeline_types.go b/vendor/github.com/rancher/types/apis/project.cattle.io/v3/pipeline_types.go deleted file mode 100644 index e330dfce..00000000 --- a/vendor/github.com/rancher/types/apis/project.cattle.io/v3/pipeline_types.go +++ /dev/null @@ -1,566 +0,0 @@ -package v3 - -import ( - "strings" - - "github.com/pkg/errors" - "github.com/rancher/norman/condition" - "github.com/rancher/norman/types" - "github.com/rancher/norman/types/convert" - v1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -type PipelineConditionType string - -const ( - PipelineExecutionConditionProvisioned condition.Cond = "Provisioned" - PipelineExecutionConditionInitialized condition.Cond = "Initialized" - PipelineExecutionConditionBuilt condition.Cond = "Built" - PipelineExecutionConditionNotified condition.Cond = "Notified" -) - -type SourceCodeProvider struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - ProjectName string `json:"projectName" norman:"type=reference[project]"` - Type string `json:"type" norman:"options=github|gitlab|bitbucketcloud|bitbucketserver"` -} - -func (s *SourceCodeProvider) ObjClusterName() string { - if parts := strings.SplitN(s.ProjectName, ":", 2); len(parts) == 2 { - return parts[0] - } - return "" -} - -type OauthProvider struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - SourceCodeProvider `json:",inline"` - - RedirectURL string `json:"redirectUrl"` -} - -type GithubProvider struct { - OauthProvider `json:",inline"` -} - -type GitlabProvider struct { - OauthProvider `json:",inline"` -} - -type BitbucketCloudProvider struct { - OauthProvider `json:",inline"` -} - -type BitbucketServerProvider struct { - OauthProvider `json:",inline"` -} - -type SourceCodeProviderConfig struct { - types.Namespaced - - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - ProjectName string `json:"projectName" norman:"required,type=reference[project]"` - Type string `json:"type" norman:"noupdate,options=github|gitlab|bitbucketcloud|bitbucketserver"` - Enabled bool `json:"enabled,omitempty"` -} - -func (s *SourceCodeProviderConfig) ObjClusterName() string { - if parts := strings.SplitN(s.ProjectName, ":", 2); len(parts) == 2 { - return parts[0] - } - return "" -} - -type GithubPipelineConfig struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - SourceCodeProviderConfig `json:",inline" mapstructure:",squash"` - - Hostname string `json:"hostname,omitempty" norman:"default=github.com" norman:"noupdate"` - TLS bool `json:"tls,omitempty" norman:"notnullable,default=true" norman:"noupdate"` - ClientID string `json:"clientId,omitempty" norman:"noupdate"` - ClientSecret string `json:"clientSecret,omitempty" norman:"noupdate,type=password"` - Inherit bool `json:"inherit,omitempty" norman:"noupdate"` -} - -type GitlabPipelineConfig struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - SourceCodeProviderConfig `json:",inline" mapstructure:",squash"` - - Hostname string `json:"hostname,omitempty" norman:"default=gitlab.com" norman:"noupdate"` - TLS bool `json:"tls,omitempty" norman:"notnullable,default=true" norman:"noupdate"` - ClientID string `json:"clientId,omitempty" norman:"noupdate"` - ClientSecret string `json:"clientSecret,omitempty" norman:"noupdate,type=password"` - RedirectURL string `json:"redirectUrl,omitempty" norman:"noupdate"` -} - -type BitbucketCloudPipelineConfig struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - SourceCodeProviderConfig `json:",inline" mapstructure:",squash"` - - ClientID string `json:"clientId,omitempty" norman:"noupdate"` - ClientSecret string `json:"clientSecret,omitempty" norman:"noupdate,type=password"` - RedirectURL string `json:"redirectUrl,omitempty" norman:"noupdate"` -} - -type BitbucketServerPipelineConfig struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - SourceCodeProviderConfig `json:",inline" mapstructure:",squash"` - - Hostname string `json:"hostname,omitempty"` - TLS bool `json:"tls,omitempty"` - ConsumerKey string `json:"consumerKey,omitempty"` - PublicKey string `json:"publicKey,omitempty"` - PrivateKey string `json:"privateKey,omitempty" norman:"type=password"` - RedirectURL string `json:"redirectUrl,omitempty"` -} - -type Pipeline struct { - types.Namespaced - - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - Spec PipelineSpec `json:"spec"` - Status PipelineStatus `json:"status"` -} - -func (p *Pipeline) ObjClusterName() string { - return p.Spec.ObjClusterName() -} - -type PipelineExecution struct { - types.Namespaced - - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - Spec PipelineExecutionSpec `json:"spec"` - Status PipelineExecutionStatus `json:"status"` -} - -func (p *PipelineExecution) ObjClusterName() string { - return p.Spec.ObjClusterName() -} - -type PipelineSetting struct { - types.Namespaced - - ProjectName string `json:"projectName" norman:"type=reference[project]"` - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - Value string `json:"value" norman:"required"` - Default string `json:"default" norman:"nocreate,noupdate"` - Customized bool `json:"customized" norman:"nocreate,noupdate"` -} - -func (p *PipelineSetting) ObjClusterName() string { - if parts := strings.SplitN(p.ProjectName, ":", 2); len(parts) == 2 { - return parts[0] - } - return "" -} - -type SourceCodeCredential struct { - types.Namespaced - - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - Spec SourceCodeCredentialSpec `json:"spec"` - Status SourceCodeCredentialStatus `json:"status"` -} - -func (s *SourceCodeCredential) ObjClusterName() string { - return s.Spec.ObjClusterName() -} - -type SourceCodeRepository struct { - types.Namespaced - - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - Spec SourceCodeRepositorySpec `json:"spec"` - Status SourceCodeRepositoryStatus `json:"status"` -} - -func (s *SourceCodeRepository) ObjClusterName() string { - return s.Spec.ObjClusterName() -} - -type PipelineStatus struct { - PipelineState string `json:"pipelineState,omitempty" norman:"required,options=active|inactive,default=active"` - NextRun int `json:"nextRun" yaml:"nextRun,omitempty" norman:"default=1,min=1"` - LastExecutionID string `json:"lastExecutionId,omitempty" yaml:"lastExecutionId,omitempty"` - LastRunState string `json:"lastRunState,omitempty" yaml:"lastRunState,omitempty"` - LastStarted string `json:"lastStarted,omitempty" yaml:"lastStarted,omitempty"` - NextStart string `json:"nextStart,omitempty" yaml:"nextStart,omitempty"` - WebHookID string `json:"webhookId,omitempty" yaml:"webhookId,omitempty"` - Token string `json:"token,omitempty" yaml:"token,omitempty" norman:"writeOnly,noupdate"` - SourceCodeCredential *SourceCodeCredential `json:"sourceCodeCredential,omitempty" yaml:"sourceCodeCredential,omitempty"` -} - -type PipelineSpec struct { - ProjectName string `json:"projectName" yaml:"projectName" norman:"required,type=reference[project]"` - - DisplayName string `json:"displayName,omitempty" yaml:"displayName,omitempty"` - TriggerWebhookPush bool `json:"triggerWebhookPush,omitempty" yaml:"triggerWebhookPush,omitempty"` - TriggerWebhookPr bool `json:"triggerWebhookPr,omitempty" yaml:"triggerWebhookPr,omitempty"` - TriggerWebhookTag bool `json:"triggerWebhookTag,omitempty" yaml:"triggerWebhookTag,omitempty"` - - RepositoryURL string `json:"repositoryUrl,omitempty" yaml:"repositoryUrl,omitempty"` - SourceCodeCredentialName string `json:"sourceCodeCredentialName,omitempty" yaml:"sourceCodeCredentialName,omitempty" norman:"type=reference[sourceCodeCredential],noupdate"` -} - -func (p *PipelineSpec) ObjClusterName() string { - if parts := strings.SplitN(p.ProjectName, ":", 2); len(parts) == 2 { - return parts[0] - } - return "" -} - -type PipelineConfig struct { - Stages []Stage `json:"stages,omitempty" yaml:"stages,omitempty"` - - Timeout int `json:"timeout,omitempty" yaml:"timeout,omitempty"` - Branch *Constraint `json:"branch,omitempty" yaml:"branch,omitempty"` - Notification *PipelineNotification `json:"notification,omitempty" yaml:"notification,omitempty"` -} - -type PipelineNotification struct { - Recipients []Recipient `json:"recipients,omitempty" yaml:"recipients,omitempty"` - Message string `json:"message,omitempty" yaml:"message,omitempty"` - Condition stringorslice `json:"condition,omitempty" yaml:"condition,omitempty"` -} - -type Recipient struct { - Recipient string `json:"recipient,omitempty"` - Notifier string `json:"notifier,omitempty"` -} - -type PipelineCondition struct { - // Type of cluster condition. - Type PipelineConditionType `json:"type"` - // Status of the condition, one of True, False, Unknown. - Status v1.ConditionStatus `json:"status"` - // The last time this condition was updated. - LastUpdateTime string `json:"lastUpdateTime,omitempty"` - // Last time the condition transitioned from one status to another. - LastTransitionTime string `json:"lastTransitionTime,omitempty"` - // The reason for the condition's last transition. - Reason string `json:"reason,omitempty"` - // Human-readable message indicating details about last transition - Message string `json:"message,omitempty"` -} - -type Stage struct { - Name string `json:"name,omitempty" yaml:"name,omitempty" norman:"required"` - Steps []Step `json:"steps,omitempty" yaml:"steps,omitempty" norman:"required"` - - When *Constraints `json:"when,omitempty" yaml:"when,omitempty"` -} - -type Step struct { - SourceCodeConfig *SourceCodeConfig `json:"sourceCodeConfig,omitempty" yaml:"sourceCodeConfig,omitempty"` - RunScriptConfig *RunScriptConfig `json:"runScriptConfig,omitempty" yaml:"runScriptConfig,omitempty"` - PublishImageConfig *PublishImageConfig `json:"publishImageConfig,omitempty" yaml:"publishImageConfig,omitempty"` - ApplyYamlConfig *ApplyYamlConfig `json:"applyYamlConfig,omitempty" yaml:"applyYamlConfig,omitempty"` - PublishCatalogConfig *PublishCatalogConfig `json:"publishCatalogConfig,omitempty" yaml:"publishCatalogConfig,omitempty"` - ApplyAppConfig *ApplyAppConfig `json:"applyAppConfig,omitempty" yaml:"applyAppConfig,omitempty"` - - Env map[string]string `json:"env,omitempty" yaml:"env,omitempty"` - EnvFrom []EnvFrom `json:"envFrom,omitempty" yaml:"envFrom,omitempty"` - Privileged bool `json:"privileged,omitempty" yaml:"privileged,omitempty"` - CPURequest string `json:"cpuRequest,omitempty" yaml:"cpuRequest,omitempty"` - CPULimit string `json:"cpuLimit,omitempty" yaml:"cpuLimit,omitempty"` - MemoryRequest string `json:"memoryRequest,omitempty" yaml:"memoryRequest,omitempty"` - MemoryLimit string `json:"memoryLimit,omitempty" yaml:"memoryLimit,omitempty"` - When *Constraints `json:"when,omitempty" yaml:"when,omitempty"` -} - -type Constraints struct { - Branch *Constraint `json:"branch,omitempty" yaml:"branch,omitempty"` - Event *Constraint `json:"event,omitempty" yaml:"event,omitempty"` -} - -type Constraint struct { - Include []string `json:"include,omitempty" yaml:"include,omitempty"` - Exclude []string `json:"exclude,omitempty" yaml:"exclude,omitempty"` -} - -type SourceCodeConfig struct { -} - -type RunScriptConfig struct { - Image string `json:"image,omitempty" yaml:"image,omitempty" norman:"required"` - ShellScript string `json:"shellScript,omitempty" yaml:"shellScript,omitempty"` -} - -type PublishImageConfig struct { - DockerfilePath string `json:"dockerfilePath,omittempty" yaml:"dockerfilePath,omitempty" norman:"required,default=./Dockerfile"` - BuildContext string `json:"buildContext,omitempty" yaml:"buildContext,omitempty" norman:"required,default=."` - Tag string `json:"tag,omitempty" yaml:"tag,omitempty" norman:"required,default=${CICD_GIT_REPOSITORY_NAME}:${CICD_GIT_BRANCH}"` - PushRemote bool `json:"pushRemote,omitempty" yaml:"pushRemote,omitempty"` - Registry string `json:"registry,omitempty" yaml:"registry,omitempty"` -} - -type ApplyYamlConfig struct { - Path string `json:"path,omitempty" yaml:"path,omitempty"` - Content string `json:"content,omitempty" yaml:"content,omitempty"` - Namespace string `json:"namespace,omitempty" yaml:"namespace,omitempty"` -} - -type PublishCatalogConfig struct { - Path string `json:"path,omitempty" yaml:"path,omitempty"` - CatalogTemplate string `json:"catalogTemplate,omitempty" yaml:"catalogTemplate,omitempty"` - Version string `json:"version,omitempty" yaml:"version,omitempty"` - GitURL string `json:"gitUrl,omitempty" yaml:"gitUrl,omitempty"` - GitBranch string `json:"gitBranch,omitempty" yaml:"gitBranch,omitempty"` - GitAuthor string `json:"gitAuthor,omitempty" yaml:"gitAuthor,omitempty"` - GitEmail string `json:"gitEmail,omitempty" yaml:"gitEmail,omitempty"` -} - -type ApplyAppConfig struct { - CatalogTemplate string `json:"catalogTemplate,omitempty" yaml:"catalogTemplate,omitempty"` - Version string `json:"version,omitempty" yaml:"version,omitempty"` - Answers map[string]string `json:"answers,omitempty" yaml:"answers,omitempty"` - Name string `json:"name,omitempty" yaml:"name,omitempty"` - TargetNamespace string `json:"targetNamespace,omitempty" yaml:"targetNamespace,omitempty"` -} - -type PipelineExecutionSpec struct { - ProjectName string `json:"projectName" yaml:"projectName" norman:"required,type=reference[project]"` - - PipelineName string `json:"pipelineName" norman:"required,type=reference[pipeline]"` - PipelineConfig PipelineConfig `json:"pipelineConfig,omitempty" norman:"required"` - RepositoryURL string `json:"repositoryUrl,omitempty"` - Run int `json:"run,omitempty" norman:"required,min=1"` - TriggeredBy string `json:"triggeredBy,omitempty" norman:"required,options=user|cron|webhook"` - TriggerUserName string `json:"triggerUserName,omitempty" norman:"type=reference[user]"` - Commit string `json:"commit,omitempty"` - Event string `json:"event,omitempty"` - Branch string `json:"branch,omitempty"` - Ref string `json:"ref,omitempty"` - HTMLLink string `json:"htmlLink,omitempty"` - Title string `json:"title,omitempty"` - Message string `json:"message,omitempty"` - Author string `json:"author,omitempty"` - AvatarURL string `json:"avatarUrl,omitempty"` - Email string `json:"email,omitempty"` -} - -func (p *PipelineExecutionSpec) ObjClusterName() string { - if parts := strings.SplitN(p.ProjectName, ":", 2); len(parts) == 2 { - return parts[0] - } - return "" -} - -type PipelineExecutionStatus struct { - Conditions []PipelineCondition `json:"conditions,omitempty"` - - ExecutionState string `json:"executionState,omitempty"` - Started string `json:"started,omitempty"` - Ended string `json:"ended,omitempty"` - Stages []StageStatus `json:"stages,omitempty"` -} - -type StageStatus struct { - State string `json:"state,omitempty"` - Started string `json:"started,omitempty"` - Ended string `json:"ended,omitempty"` - Steps []StepStatus `json:"steps,omitempty"` -} - -type StepStatus struct { - State string `json:"state,omitempty"` - Started string `json:"started,omitempty"` - Ended string `json:"ended,omitempty"` -} - -type SourceCodeCredentialSpec struct { - ProjectName string `json:"projectName" norman:"type=reference[project]"` - SourceCodeType string `json:"sourceCodeType,omitempty" norman:"required,options=github|gitlab|bitbucketcloud|bitbucketserver"` - UserName string `json:"userName" norman:"required,type=reference[user]"` - DisplayName string `json:"displayName,omitempty" norman:"required"` - AvatarURL string `json:"avatarUrl,omitempty"` - HTMLURL string `json:"htmlUrl,omitempty"` - LoginName string `json:"loginName,omitempty"` - GitLoginName string `json:"gitLoginName,omitempty"` - GitCloneToken string `json:"gitCloneToken,omitempty" norman:"writeOnly,noupdate"` - AccessToken string `json:"accessToken,omitempty" norman:"writeOnly,noupdate"` - RefreshToken string `json:"refreshToken,omitempty" norman:"writeOnly,noupdate"` - Expiry string `json:"expiry,omitempty"` -} - -func (s *SourceCodeCredentialSpec) ObjClusterName() string { - if parts := strings.SplitN(s.ProjectName, ":", 2); len(parts) == 2 { - return parts[0] - } - return "" -} - -type SourceCodeCredentialStatus struct { - Logout bool `json:"logout,omitempty"` -} - -type SourceCodeRepositorySpec struct { - ProjectName string `json:"projectName" norman:"type=reference[project]"` - SourceCodeType string `json:"sourceCodeType,omitempty" norman:"required,options=github|gitlab|bitbucketcloud|bitbucketserver"` - UserName string `json:"userName" norman:"required,type=reference[user]"` - SourceCodeCredentialName string `json:"sourceCodeCredentialName,omitempty" norman:"required,type=reference[sourceCodeCredential]"` - URL string `json:"url,omitempty"` - Permissions RepoPerm `json:"permissions,omitempty"` - Language string `json:"language,omitempty"` - DefaultBranch string `json:"defaultBranch,omitempty"` -} - -func (s *SourceCodeRepositorySpec) ObjClusterName() string { - if parts := strings.SplitN(s.ProjectName, ":", 2); len(parts) == 2 { - return parts[0] - } - return "" -} - -type SourceCodeRepositoryStatus struct { -} - -type RepoPerm struct { - Pull bool `json:"pull,omitempty"` - Push bool `json:"push,omitempty"` - Admin bool `json:"admin,omitempty"` -} - -type RunPipelineInput struct { - Branch string `json:"branch,omitempty"` -} - -type AuthAppInput struct { - InheritGlobal bool `json:"inheritGlobal,omitempty"` - SourceCodeType string `json:"sourceCodeType,omitempty" norman:"type=string,required,options=github|gitlab|bitbucketcloud|bitbucketserver"` - RedirectURL string `json:"redirectUrl,omitempty" norman:"type=string"` - TLS bool `json:"tls,omitempty"` - Host string `json:"host,omitempty"` - ClientID string `json:"clientId,omitempty" norman:"type=string,required"` - ClientSecret string `json:"clientSecret,omitempty" norman:"type=string,required"` - Code string `json:"code,omitempty" norman:"type=string,required"` -} - -type AuthUserInput struct { - SourceCodeType string `json:"sourceCodeType,omitempty" norman:"type=string,required,options=github|gitlab|bitbucketcloud|bitbucketserver"` - RedirectURL string `json:"redirectUrl,omitempty" norman:"type=string"` - Code string `json:"code,omitempty" norman:"type=string,required"` -} - -type PushPipelineConfigInput struct { - Configs map[string]PipelineConfig `json:"configs,omitempty"` -} - -type PipelineSystemImages struct { - Jenkins string `json:"jenkins,omitempty"` - JenkinsJnlp string `json:"jenkinsJnlp,omitempty"` - AlpineGit string `json:"alpineGit,omitempty"` - PluginsDocker string `json:"pluginsDocker,omitempty"` - Minio string `json:"minio,omitempty"` - Registry string `json:"registry,omitempty"` - RegistryProxy string `json:"registryProxy,omitempty"` - KubeApply string `json:"kubeApply,omitempty"` -} - -type OauthApplyInput struct { - Hostname string `json:"hostname,omitempty"` - TLS bool `json:"tls,omitempty"` - RedirectURL string `json:"redirectUrl,omitempty"` - ClientID string `json:"clientId,omitempty"` - ClientSecret string `json:"clientSecret,omitempty"` - Code string `json:"code,omitempty"` -} - -type GithubApplyInput struct { - OauthApplyInput - InheritAuth bool `json:"inheritAuth,omitempty"` -} - -type GitlabApplyInput struct { - OauthApplyInput -} - -type BitbucketCloudApplyInput struct { - OauthApplyInput -} - -type BitbucketServerApplyInput struct { - OAuthToken string `json:"oauthToken,omitempty"` - OAuthVerifier string `json:"oauthVerifier,omitempty"` - Hostname string `json:"hostname,omitempty"` - TLS bool `json:"tls,omitempty"` - RedirectURL string `json:"redirectUrl,omitempty"` -} - -type BitbucketServerRequestLoginInput struct { - Hostname string `json:"hostname,omitempty"` - TLS bool `json:"tls,omitempty"` - RedirectURL string `json:"redirectUrl,omitempty"` -} - -type BitbucketServerRequestLoginOutput struct { - LoginURL string `json:"loginUrl"` -} - -type EnvFrom struct { - SourceName string `json:"sourceName,omitempty" yaml:"sourceName,omitempty" norman:"type=string,required"` - SourceKey string `json:"sourceKey,omitempty" yaml:"sourceKey,omitempty" norman:"type=string,required"` - TargetKey string `json:"targetKey,omitempty" yaml:"targetKey,omitempty"` -} - -// UnmarshalYAML unmarshals the constraint. -// So as to support yaml syntax including: -// branch: dev, branch: ["dev","hotfix"], branch: {include:[],exclude:[]} -func (c *Constraint) UnmarshalYAML(unmarshal func(interface{}) error) error { - var out1 = struct { - Include stringorslice - Exclude stringorslice - }{} - - var out2 stringorslice - - unmarshal(&out1) - unmarshal(&out2) - - c.Exclude = out1.Exclude - c.Include = append( - out1.Include, - out2..., - ) - return nil -} - -type stringorslice []string - -// UnmarshalYAML implements the Unmarshaller interface. -func (s *stringorslice) UnmarshalYAML(unmarshal func(interface{}) error) error { - var stringType string - if err := unmarshal(&stringType); err == nil { - *s = []string{stringType} - return nil - } - - var sliceType []interface{} - if err := unmarshal(&sliceType); err == nil { - *s = convert.ToStringSlice(sliceType) - return nil - } - - return errors.New("Failed to unmarshal stringorslice") -} diff --git a/vendor/github.com/rancher/types/apis/project.cattle.io/v3/types.go b/vendor/github.com/rancher/types/apis/project.cattle.io/v3/types.go deleted file mode 100644 index ab23cf6e..00000000 --- a/vendor/github.com/rancher/types/apis/project.cattle.io/v3/types.go +++ /dev/null @@ -1,120 +0,0 @@ -package v3 - -import ( - "github.com/rancher/norman/types" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -type ServiceAccountToken struct { - types.Namespaced - - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - AccountName string `json:"accountName"` - AccountUID string `json:"accountUid"` - Description string `json:"description"` - Token string `json:"token" norman:"writeOnly"` - CACRT string `json:"caCrt"` -} -type NamespacedServiceAccountToken ServiceAccountToken - -type DockerCredential struct { - types.Namespaced - - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - Description string `json:"description"` - Registries map[string]RegistryCredential `json:"registries"` -} -type NamespacedDockerCredential DockerCredential - -type RegistryCredential struct { - Description string `json:"description"` - Username string `json:"username"` - Password string `json:"password" norman:"writeOnly"` - Auth string `json:"auth" norman:"writeOnly"` - Email string `json:"email"` -} - -type Certificate struct { - types.Namespaced - - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - Description string `json:"description"` - Certs string `json:"certs"` - Key string `json:"key" norman:"writeOnly"` - - CertFingerprint string `json:"certFingerprint" norman:"nocreate,noupdate"` - CN string `json:"cn" norman:"nocreate,noupdate"` - Version string `json:"version" norman:"nocreate,noupdate"` - ExpiresAt string `json:"expiresAt" norman:"nocreate,noupdate"` - Issuer string `json:"issuer" norman:"nocreate,noupdate"` - IssuedAt string `json:"issuedAt" norman:"nocreate,noupdate"` - Algorithm string `json:"algorithm" norman:"nocreate,noupdate"` - SerialNumber string `json:"serialNumber" norman:"nocreate,noupdate"` - KeySize string `json:"keySize" norman:"nocreate,noupdate"` - SubjectAlternativeNames []string `json:"subjectAlternativeNames" norman:"nocreate,noupdate"` -} -type NamespacedCertificate Certificate - -type BasicAuth struct { - types.Namespaced - - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - Description string `json:"description"` - Username string `json:"username"` - Password string `json:"password" norman:"writeOnly"` -} -type NamespacedBasicAuth BasicAuth - -type SSHAuth struct { - types.Namespaced - - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - Description string `json:"description"` - PrivateKey string `json:"privateKey" norman:"writeOnly"` - Fingerprint string `json:"certFingerprint" norman:"nocreate,noupdate"` -} -type NamespacedSSHAuth SSHAuth - -type PublicEndpoint struct { - NodeName string `json:"nodeName,omitempty" norman:"type=reference[/v3/schemas/node],nocreate,noupdate"` - Addresses []string `json:"addresses,omitempty" norman:"nocreate,noupdate"` - Port int32 `json:"port,omitempty" norman:"nocreate,noupdate"` - Protocol string `json:"protocol,omitempty" norman:"nocreate,noupdate"` - // for node port service endpoint - ServiceName string `json:"serviceName,omitempty" norman:"type=reference[service],nocreate,noupdate"` - // for host port endpoint - PodName string `json:"podName,omitempty" norman:"type=reference[pod],nocreate,noupdate"` - // for ingress endpoint. ServiceName, podName, ingressName are mutually exclusive - IngressName string `json:"ingressName,omitempty" norman:"type=reference[ingress],nocreate,noupdate"` - // Hostname/path are set for Ingress endpoints - Hostname string `json:"hostname,omitempty" norman:"nocreate,noupdate"` - Path string `json:"path,omitempty" norman:"nocreate,noupdate"` - // True when endpoint is exposed on every node - AllNodes bool `json:"allNodes" norman:"nocreate,noupdate"` -} - -type Workload struct { - types.Namespaced - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` -} - -type DeploymentRollbackInput struct { - ReplicaSetID string `json:"replicaSetId" norman:"type=reference[replicaSet]"` -} - -type WorkloadMetric struct { - Port int32 `json:"port,omitempty"` - Path string `json:"path,omitempty"` - Schema string `json:"schema,omitempty" norman:"type=enum,options=HTTP|HTTPS"` -} diff --git a/vendor/github.com/rancher/types/apis/project.cattle.io/v3/zz_generated_app_controller.go b/vendor/github.com/rancher/types/apis/project.cattle.io/v3/zz_generated_app_controller.go deleted file mode 100644 index ead9e7de..00000000 --- a/vendor/github.com/rancher/types/apis/project.cattle.io/v3/zz_generated_app_controller.go +++ /dev/null @@ -1,321 +0,0 @@ -package v3 - -import ( - "context" - "time" - - "github.com/rancher/norman/controller" - "github.com/rancher/norman/objectclient" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/apimachinery/pkg/types" - "k8s.io/apimachinery/pkg/watch" - "k8s.io/client-go/tools/cache" -) - -var ( - AppGroupVersionKind = schema.GroupVersionKind{ - Version: Version, - Group: GroupName, - Kind: "App", - } - AppResource = metav1.APIResource{ - Name: "apps", - SingularName: "app", - Namespaced: true, - - Kind: AppGroupVersionKind.Kind, - } - - AppGroupVersionResource = schema.GroupVersionResource{ - Group: GroupName, - Version: Version, - Resource: "apps", - } -) - -func init() { - resource.Put(AppGroupVersionResource) -} - -func NewApp(namespace, name string, obj App) *App { - obj.APIVersion, obj.Kind = AppGroupVersionKind.ToAPIVersionAndKind() - obj.Name = name - obj.Namespace = namespace - return &obj -} - -type AppList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []App `json:"items"` -} - -type AppHandlerFunc func(key string, obj *App) (runtime.Object, error) - -type AppChangeHandlerFunc func(obj *App) (runtime.Object, error) - -type AppLister interface { - List(namespace string, selector labels.Selector) (ret []*App, err error) - Get(namespace, name string) (*App, error) -} - -type AppController interface { - Generic() controller.GenericController - Informer() cache.SharedIndexInformer - Lister() AppLister - AddHandler(ctx context.Context, name string, handler AppHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync AppHandlerFunc) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, handler AppHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, handler AppHandlerFunc) - Enqueue(namespace, name string) - EnqueueAfter(namespace, name string, after time.Duration) -} - -type AppInterface interface { - ObjectClient() *objectclient.ObjectClient - Create(*App) (*App, error) - GetNamespaced(namespace, name string, opts metav1.GetOptions) (*App, error) - Get(name string, opts metav1.GetOptions) (*App, error) - Update(*App) (*App, error) - Delete(name string, options *metav1.DeleteOptions) error - DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error - List(opts metav1.ListOptions) (*AppList, error) - ListNamespaced(namespace string, opts metav1.ListOptions) (*AppList, error) - Watch(opts metav1.ListOptions) (watch.Interface, error) - DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error - Controller() AppController - AddHandler(ctx context.Context, name string, sync AppHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync AppHandlerFunc) - AddLifecycle(ctx context.Context, name string, lifecycle AppLifecycle) - AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle AppLifecycle) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync AppHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync AppHandlerFunc) - AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle AppLifecycle) - AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle AppLifecycle) -} - -type appLister struct { - controller *appController -} - -func (l *appLister) List(namespace string, selector labels.Selector) (ret []*App, err error) { - err = cache.ListAllByNamespace(l.controller.Informer().GetIndexer(), namespace, selector, func(obj interface{}) { - ret = append(ret, obj.(*App)) - }) - return -} - -func (l *appLister) Get(namespace, name string) (*App, error) { - var key string - if namespace != "" { - key = namespace + "/" + name - } else { - key = name - } - obj, exists, err := l.controller.Informer().GetIndexer().GetByKey(key) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(schema.GroupResource{ - Group: AppGroupVersionKind.Group, - Resource: AppGroupVersionResource.Resource, - }, key) - } - return obj.(*App), nil -} - -type appController struct { - controller.GenericController -} - -func (c *appController) Generic() controller.GenericController { - return c.GenericController -} - -func (c *appController) Lister() AppLister { - return &appLister{ - controller: c, - } -} - -func (c *appController) AddHandler(ctx context.Context, name string, handler AppHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*App); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *appController) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, handler AppHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*App); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *appController) AddClusterScopedHandler(ctx context.Context, name, cluster string, handler AppHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*App); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *appController) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, cluster string, handler AppHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*App); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -type appFactory struct { -} - -func (c appFactory) Object() runtime.Object { - return &App{} -} - -func (c appFactory) List() runtime.Object { - return &AppList{} -} - -func (s *appClient) Controller() AppController { - genericController := controller.NewGenericController(AppGroupVersionKind.Kind+"Controller", - s.client.controllerFactory.ForResourceKind(AppGroupVersionResource, AppGroupVersionKind.Kind, true)) - - return &appController{ - GenericController: genericController, - } -} - -type appClient struct { - client *Client - ns string - objectClient *objectclient.ObjectClient - controller AppController -} - -func (s *appClient) ObjectClient() *objectclient.ObjectClient { - return s.objectClient -} - -func (s *appClient) Create(o *App) (*App, error) { - obj, err := s.objectClient.Create(o) - return obj.(*App), err -} - -func (s *appClient) Get(name string, opts metav1.GetOptions) (*App, error) { - obj, err := s.objectClient.Get(name, opts) - return obj.(*App), err -} - -func (s *appClient) GetNamespaced(namespace, name string, opts metav1.GetOptions) (*App, error) { - obj, err := s.objectClient.GetNamespaced(namespace, name, opts) - return obj.(*App), err -} - -func (s *appClient) Update(o *App) (*App, error) { - obj, err := s.objectClient.Update(o.Name, o) - return obj.(*App), err -} - -func (s *appClient) UpdateStatus(o *App) (*App, error) { - obj, err := s.objectClient.UpdateStatus(o.Name, o) - return obj.(*App), err -} - -func (s *appClient) Delete(name string, options *metav1.DeleteOptions) error { - return s.objectClient.Delete(name, options) -} - -func (s *appClient) DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error { - return s.objectClient.DeleteNamespaced(namespace, name, options) -} - -func (s *appClient) List(opts metav1.ListOptions) (*AppList, error) { - obj, err := s.objectClient.List(opts) - return obj.(*AppList), err -} - -func (s *appClient) ListNamespaced(namespace string, opts metav1.ListOptions) (*AppList, error) { - obj, err := s.objectClient.ListNamespaced(namespace, opts) - return obj.(*AppList), err -} - -func (s *appClient) Watch(opts metav1.ListOptions) (watch.Interface, error) { - return s.objectClient.Watch(opts) -} - -// Patch applies the patch and returns the patched deployment. -func (s *appClient) Patch(o *App, patchType types.PatchType, data []byte, subresources ...string) (*App, error) { - obj, err := s.objectClient.Patch(o.Name, o, patchType, data, subresources...) - return obj.(*App), err -} - -func (s *appClient) DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error { - return s.objectClient.DeleteCollection(deleteOpts, listOpts) -} - -func (s *appClient) AddHandler(ctx context.Context, name string, sync AppHandlerFunc) { - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *appClient) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync AppHandlerFunc) { - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *appClient) AddLifecycle(ctx context.Context, name string, lifecycle AppLifecycle) { - sync := NewAppLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *appClient) AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle AppLifecycle) { - sync := NewAppLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *appClient) AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync AppHandlerFunc) { - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *appClient) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync AppHandlerFunc) { - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} - -func (s *appClient) AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle AppLifecycle) { - sync := NewAppLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *appClient) AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle AppLifecycle) { - sync := NewAppLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} diff --git a/vendor/github.com/rancher/types/apis/project.cattle.io/v3/zz_generated_app_lifecycle_adapter.go b/vendor/github.com/rancher/types/apis/project.cattle.io/v3/zz_generated_app_lifecycle_adapter.go deleted file mode 100644 index 2a042fd5..00000000 --- a/vendor/github.com/rancher/types/apis/project.cattle.io/v3/zz_generated_app_lifecycle_adapter.go +++ /dev/null @@ -1,66 +0,0 @@ -package v3 - -import ( - "github.com/rancher/norman/lifecycle" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/runtime" -) - -type AppLifecycle interface { - Create(obj *App) (runtime.Object, error) - Remove(obj *App) (runtime.Object, error) - Updated(obj *App) (runtime.Object, error) -} - -type appLifecycleAdapter struct { - lifecycle AppLifecycle -} - -func (w *appLifecycleAdapter) HasCreate() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasCreate() -} - -func (w *appLifecycleAdapter) HasFinalize() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasFinalize() -} - -func (w *appLifecycleAdapter) Create(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Create(obj.(*App)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *appLifecycleAdapter) Finalize(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Remove(obj.(*App)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *appLifecycleAdapter) Updated(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Updated(obj.(*App)) - if o == nil { - return nil, err - } - return o, err -} - -func NewAppLifecycleAdapter(name string, clusterScoped bool, client AppInterface, l AppLifecycle) AppHandlerFunc { - if clusterScoped { - resource.PutClusterScoped(AppGroupVersionResource) - } - adapter := &appLifecycleAdapter{lifecycle: l} - syncFn := lifecycle.NewObjectLifecycleAdapter(name, clusterScoped, adapter, client.ObjectClient()) - return func(key string, obj *App) (runtime.Object, error) { - newObj, err := syncFn(key, obj) - if o, ok := newObj.(runtime.Object); ok { - return o, err - } - return nil, err - } -} diff --git a/vendor/github.com/rancher/types/apis/project.cattle.io/v3/zz_generated_app_revision_controller.go b/vendor/github.com/rancher/types/apis/project.cattle.io/v3/zz_generated_app_revision_controller.go deleted file mode 100644 index a609bc20..00000000 --- a/vendor/github.com/rancher/types/apis/project.cattle.io/v3/zz_generated_app_revision_controller.go +++ /dev/null @@ -1,321 +0,0 @@ -package v3 - -import ( - "context" - "time" - - "github.com/rancher/norman/controller" - "github.com/rancher/norman/objectclient" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/apimachinery/pkg/types" - "k8s.io/apimachinery/pkg/watch" - "k8s.io/client-go/tools/cache" -) - -var ( - AppRevisionGroupVersionKind = schema.GroupVersionKind{ - Version: Version, - Group: GroupName, - Kind: "AppRevision", - } - AppRevisionResource = metav1.APIResource{ - Name: "apprevisions", - SingularName: "apprevision", - Namespaced: true, - - Kind: AppRevisionGroupVersionKind.Kind, - } - - AppRevisionGroupVersionResource = schema.GroupVersionResource{ - Group: GroupName, - Version: Version, - Resource: "apprevisions", - } -) - -func init() { - resource.Put(AppRevisionGroupVersionResource) -} - -func NewAppRevision(namespace, name string, obj AppRevision) *AppRevision { - obj.APIVersion, obj.Kind = AppRevisionGroupVersionKind.ToAPIVersionAndKind() - obj.Name = name - obj.Namespace = namespace - return &obj -} - -type AppRevisionList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []AppRevision `json:"items"` -} - -type AppRevisionHandlerFunc func(key string, obj *AppRevision) (runtime.Object, error) - -type AppRevisionChangeHandlerFunc func(obj *AppRevision) (runtime.Object, error) - -type AppRevisionLister interface { - List(namespace string, selector labels.Selector) (ret []*AppRevision, err error) - Get(namespace, name string) (*AppRevision, error) -} - -type AppRevisionController interface { - Generic() controller.GenericController - Informer() cache.SharedIndexInformer - Lister() AppRevisionLister - AddHandler(ctx context.Context, name string, handler AppRevisionHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync AppRevisionHandlerFunc) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, handler AppRevisionHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, handler AppRevisionHandlerFunc) - Enqueue(namespace, name string) - EnqueueAfter(namespace, name string, after time.Duration) -} - -type AppRevisionInterface interface { - ObjectClient() *objectclient.ObjectClient - Create(*AppRevision) (*AppRevision, error) - GetNamespaced(namespace, name string, opts metav1.GetOptions) (*AppRevision, error) - Get(name string, opts metav1.GetOptions) (*AppRevision, error) - Update(*AppRevision) (*AppRevision, error) - Delete(name string, options *metav1.DeleteOptions) error - DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error - List(opts metav1.ListOptions) (*AppRevisionList, error) - ListNamespaced(namespace string, opts metav1.ListOptions) (*AppRevisionList, error) - Watch(opts metav1.ListOptions) (watch.Interface, error) - DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error - Controller() AppRevisionController - AddHandler(ctx context.Context, name string, sync AppRevisionHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync AppRevisionHandlerFunc) - AddLifecycle(ctx context.Context, name string, lifecycle AppRevisionLifecycle) - AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle AppRevisionLifecycle) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync AppRevisionHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync AppRevisionHandlerFunc) - AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle AppRevisionLifecycle) - AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle AppRevisionLifecycle) -} - -type appRevisionLister struct { - controller *appRevisionController -} - -func (l *appRevisionLister) List(namespace string, selector labels.Selector) (ret []*AppRevision, err error) { - err = cache.ListAllByNamespace(l.controller.Informer().GetIndexer(), namespace, selector, func(obj interface{}) { - ret = append(ret, obj.(*AppRevision)) - }) - return -} - -func (l *appRevisionLister) Get(namespace, name string) (*AppRevision, error) { - var key string - if namespace != "" { - key = namespace + "/" + name - } else { - key = name - } - obj, exists, err := l.controller.Informer().GetIndexer().GetByKey(key) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(schema.GroupResource{ - Group: AppRevisionGroupVersionKind.Group, - Resource: AppRevisionGroupVersionResource.Resource, - }, key) - } - return obj.(*AppRevision), nil -} - -type appRevisionController struct { - controller.GenericController -} - -func (c *appRevisionController) Generic() controller.GenericController { - return c.GenericController -} - -func (c *appRevisionController) Lister() AppRevisionLister { - return &appRevisionLister{ - controller: c, - } -} - -func (c *appRevisionController) AddHandler(ctx context.Context, name string, handler AppRevisionHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*AppRevision); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *appRevisionController) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, handler AppRevisionHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*AppRevision); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *appRevisionController) AddClusterScopedHandler(ctx context.Context, name, cluster string, handler AppRevisionHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*AppRevision); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *appRevisionController) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, cluster string, handler AppRevisionHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*AppRevision); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -type appRevisionFactory struct { -} - -func (c appRevisionFactory) Object() runtime.Object { - return &AppRevision{} -} - -func (c appRevisionFactory) List() runtime.Object { - return &AppRevisionList{} -} - -func (s *appRevisionClient) Controller() AppRevisionController { - genericController := controller.NewGenericController(AppRevisionGroupVersionKind.Kind+"Controller", - s.client.controllerFactory.ForResourceKind(AppRevisionGroupVersionResource, AppRevisionGroupVersionKind.Kind, true)) - - return &appRevisionController{ - GenericController: genericController, - } -} - -type appRevisionClient struct { - client *Client - ns string - objectClient *objectclient.ObjectClient - controller AppRevisionController -} - -func (s *appRevisionClient) ObjectClient() *objectclient.ObjectClient { - return s.objectClient -} - -func (s *appRevisionClient) Create(o *AppRevision) (*AppRevision, error) { - obj, err := s.objectClient.Create(o) - return obj.(*AppRevision), err -} - -func (s *appRevisionClient) Get(name string, opts metav1.GetOptions) (*AppRevision, error) { - obj, err := s.objectClient.Get(name, opts) - return obj.(*AppRevision), err -} - -func (s *appRevisionClient) GetNamespaced(namespace, name string, opts metav1.GetOptions) (*AppRevision, error) { - obj, err := s.objectClient.GetNamespaced(namespace, name, opts) - return obj.(*AppRevision), err -} - -func (s *appRevisionClient) Update(o *AppRevision) (*AppRevision, error) { - obj, err := s.objectClient.Update(o.Name, o) - return obj.(*AppRevision), err -} - -func (s *appRevisionClient) UpdateStatus(o *AppRevision) (*AppRevision, error) { - obj, err := s.objectClient.UpdateStatus(o.Name, o) - return obj.(*AppRevision), err -} - -func (s *appRevisionClient) Delete(name string, options *metav1.DeleteOptions) error { - return s.objectClient.Delete(name, options) -} - -func (s *appRevisionClient) DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error { - return s.objectClient.DeleteNamespaced(namespace, name, options) -} - -func (s *appRevisionClient) List(opts metav1.ListOptions) (*AppRevisionList, error) { - obj, err := s.objectClient.List(opts) - return obj.(*AppRevisionList), err -} - -func (s *appRevisionClient) ListNamespaced(namespace string, opts metav1.ListOptions) (*AppRevisionList, error) { - obj, err := s.objectClient.ListNamespaced(namespace, opts) - return obj.(*AppRevisionList), err -} - -func (s *appRevisionClient) Watch(opts metav1.ListOptions) (watch.Interface, error) { - return s.objectClient.Watch(opts) -} - -// Patch applies the patch and returns the patched deployment. -func (s *appRevisionClient) Patch(o *AppRevision, patchType types.PatchType, data []byte, subresources ...string) (*AppRevision, error) { - obj, err := s.objectClient.Patch(o.Name, o, patchType, data, subresources...) - return obj.(*AppRevision), err -} - -func (s *appRevisionClient) DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error { - return s.objectClient.DeleteCollection(deleteOpts, listOpts) -} - -func (s *appRevisionClient) AddHandler(ctx context.Context, name string, sync AppRevisionHandlerFunc) { - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *appRevisionClient) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync AppRevisionHandlerFunc) { - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *appRevisionClient) AddLifecycle(ctx context.Context, name string, lifecycle AppRevisionLifecycle) { - sync := NewAppRevisionLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *appRevisionClient) AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle AppRevisionLifecycle) { - sync := NewAppRevisionLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *appRevisionClient) AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync AppRevisionHandlerFunc) { - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *appRevisionClient) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync AppRevisionHandlerFunc) { - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} - -func (s *appRevisionClient) AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle AppRevisionLifecycle) { - sync := NewAppRevisionLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *appRevisionClient) AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle AppRevisionLifecycle) { - sync := NewAppRevisionLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} diff --git a/vendor/github.com/rancher/types/apis/project.cattle.io/v3/zz_generated_app_revision_lifecycle_adapter.go b/vendor/github.com/rancher/types/apis/project.cattle.io/v3/zz_generated_app_revision_lifecycle_adapter.go deleted file mode 100644 index a81aefc8..00000000 --- a/vendor/github.com/rancher/types/apis/project.cattle.io/v3/zz_generated_app_revision_lifecycle_adapter.go +++ /dev/null @@ -1,66 +0,0 @@ -package v3 - -import ( - "github.com/rancher/norman/lifecycle" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/runtime" -) - -type AppRevisionLifecycle interface { - Create(obj *AppRevision) (runtime.Object, error) - Remove(obj *AppRevision) (runtime.Object, error) - Updated(obj *AppRevision) (runtime.Object, error) -} - -type appRevisionLifecycleAdapter struct { - lifecycle AppRevisionLifecycle -} - -func (w *appRevisionLifecycleAdapter) HasCreate() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasCreate() -} - -func (w *appRevisionLifecycleAdapter) HasFinalize() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasFinalize() -} - -func (w *appRevisionLifecycleAdapter) Create(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Create(obj.(*AppRevision)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *appRevisionLifecycleAdapter) Finalize(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Remove(obj.(*AppRevision)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *appRevisionLifecycleAdapter) Updated(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Updated(obj.(*AppRevision)) - if o == nil { - return nil, err - } - return o, err -} - -func NewAppRevisionLifecycleAdapter(name string, clusterScoped bool, client AppRevisionInterface, l AppRevisionLifecycle) AppRevisionHandlerFunc { - if clusterScoped { - resource.PutClusterScoped(AppRevisionGroupVersionResource) - } - adapter := &appRevisionLifecycleAdapter{lifecycle: l} - syncFn := lifecycle.NewObjectLifecycleAdapter(name, clusterScoped, adapter, client.ObjectClient()) - return func(key string, obj *AppRevision) (runtime.Object, error) { - newObj, err := syncFn(key, obj) - if o, ok := newObj.(runtime.Object); ok { - return o, err - } - return nil, err - } -} diff --git a/vendor/github.com/rancher/types/apis/project.cattle.io/v3/zz_generated_basic_auth_controller.go b/vendor/github.com/rancher/types/apis/project.cattle.io/v3/zz_generated_basic_auth_controller.go deleted file mode 100644 index 4bc6cc88..00000000 --- a/vendor/github.com/rancher/types/apis/project.cattle.io/v3/zz_generated_basic_auth_controller.go +++ /dev/null @@ -1,321 +0,0 @@ -package v3 - -import ( - "context" - "time" - - "github.com/rancher/norman/controller" - "github.com/rancher/norman/objectclient" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/apimachinery/pkg/types" - "k8s.io/apimachinery/pkg/watch" - "k8s.io/client-go/tools/cache" -) - -var ( - BasicAuthGroupVersionKind = schema.GroupVersionKind{ - Version: Version, - Group: GroupName, - Kind: "BasicAuth", - } - BasicAuthResource = metav1.APIResource{ - Name: "basicauths", - SingularName: "basicauth", - Namespaced: true, - - Kind: BasicAuthGroupVersionKind.Kind, - } - - BasicAuthGroupVersionResource = schema.GroupVersionResource{ - Group: GroupName, - Version: Version, - Resource: "basicauths", - } -) - -func init() { - resource.Put(BasicAuthGroupVersionResource) -} - -func NewBasicAuth(namespace, name string, obj BasicAuth) *BasicAuth { - obj.APIVersion, obj.Kind = BasicAuthGroupVersionKind.ToAPIVersionAndKind() - obj.Name = name - obj.Namespace = namespace - return &obj -} - -type BasicAuthList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []BasicAuth `json:"items"` -} - -type BasicAuthHandlerFunc func(key string, obj *BasicAuth) (runtime.Object, error) - -type BasicAuthChangeHandlerFunc func(obj *BasicAuth) (runtime.Object, error) - -type BasicAuthLister interface { - List(namespace string, selector labels.Selector) (ret []*BasicAuth, err error) - Get(namespace, name string) (*BasicAuth, error) -} - -type BasicAuthController interface { - Generic() controller.GenericController - Informer() cache.SharedIndexInformer - Lister() BasicAuthLister - AddHandler(ctx context.Context, name string, handler BasicAuthHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync BasicAuthHandlerFunc) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, handler BasicAuthHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, handler BasicAuthHandlerFunc) - Enqueue(namespace, name string) - EnqueueAfter(namespace, name string, after time.Duration) -} - -type BasicAuthInterface interface { - ObjectClient() *objectclient.ObjectClient - Create(*BasicAuth) (*BasicAuth, error) - GetNamespaced(namespace, name string, opts metav1.GetOptions) (*BasicAuth, error) - Get(name string, opts metav1.GetOptions) (*BasicAuth, error) - Update(*BasicAuth) (*BasicAuth, error) - Delete(name string, options *metav1.DeleteOptions) error - DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error - List(opts metav1.ListOptions) (*BasicAuthList, error) - ListNamespaced(namespace string, opts metav1.ListOptions) (*BasicAuthList, error) - Watch(opts metav1.ListOptions) (watch.Interface, error) - DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error - Controller() BasicAuthController - AddHandler(ctx context.Context, name string, sync BasicAuthHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync BasicAuthHandlerFunc) - AddLifecycle(ctx context.Context, name string, lifecycle BasicAuthLifecycle) - AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle BasicAuthLifecycle) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync BasicAuthHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync BasicAuthHandlerFunc) - AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle BasicAuthLifecycle) - AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle BasicAuthLifecycle) -} - -type basicAuthLister struct { - controller *basicAuthController -} - -func (l *basicAuthLister) List(namespace string, selector labels.Selector) (ret []*BasicAuth, err error) { - err = cache.ListAllByNamespace(l.controller.Informer().GetIndexer(), namespace, selector, func(obj interface{}) { - ret = append(ret, obj.(*BasicAuth)) - }) - return -} - -func (l *basicAuthLister) Get(namespace, name string) (*BasicAuth, error) { - var key string - if namespace != "" { - key = namespace + "/" + name - } else { - key = name - } - obj, exists, err := l.controller.Informer().GetIndexer().GetByKey(key) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(schema.GroupResource{ - Group: BasicAuthGroupVersionKind.Group, - Resource: BasicAuthGroupVersionResource.Resource, - }, key) - } - return obj.(*BasicAuth), nil -} - -type basicAuthController struct { - controller.GenericController -} - -func (c *basicAuthController) Generic() controller.GenericController { - return c.GenericController -} - -func (c *basicAuthController) Lister() BasicAuthLister { - return &basicAuthLister{ - controller: c, - } -} - -func (c *basicAuthController) AddHandler(ctx context.Context, name string, handler BasicAuthHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*BasicAuth); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *basicAuthController) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, handler BasicAuthHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*BasicAuth); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *basicAuthController) AddClusterScopedHandler(ctx context.Context, name, cluster string, handler BasicAuthHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*BasicAuth); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *basicAuthController) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, cluster string, handler BasicAuthHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*BasicAuth); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -type basicAuthFactory struct { -} - -func (c basicAuthFactory) Object() runtime.Object { - return &BasicAuth{} -} - -func (c basicAuthFactory) List() runtime.Object { - return &BasicAuthList{} -} - -func (s *basicAuthClient) Controller() BasicAuthController { - genericController := controller.NewGenericController(BasicAuthGroupVersionKind.Kind+"Controller", - s.client.controllerFactory.ForResourceKind(BasicAuthGroupVersionResource, BasicAuthGroupVersionKind.Kind, true)) - - return &basicAuthController{ - GenericController: genericController, - } -} - -type basicAuthClient struct { - client *Client - ns string - objectClient *objectclient.ObjectClient - controller BasicAuthController -} - -func (s *basicAuthClient) ObjectClient() *objectclient.ObjectClient { - return s.objectClient -} - -func (s *basicAuthClient) Create(o *BasicAuth) (*BasicAuth, error) { - obj, err := s.objectClient.Create(o) - return obj.(*BasicAuth), err -} - -func (s *basicAuthClient) Get(name string, opts metav1.GetOptions) (*BasicAuth, error) { - obj, err := s.objectClient.Get(name, opts) - return obj.(*BasicAuth), err -} - -func (s *basicAuthClient) GetNamespaced(namespace, name string, opts metav1.GetOptions) (*BasicAuth, error) { - obj, err := s.objectClient.GetNamespaced(namespace, name, opts) - return obj.(*BasicAuth), err -} - -func (s *basicAuthClient) Update(o *BasicAuth) (*BasicAuth, error) { - obj, err := s.objectClient.Update(o.Name, o) - return obj.(*BasicAuth), err -} - -func (s *basicAuthClient) UpdateStatus(o *BasicAuth) (*BasicAuth, error) { - obj, err := s.objectClient.UpdateStatus(o.Name, o) - return obj.(*BasicAuth), err -} - -func (s *basicAuthClient) Delete(name string, options *metav1.DeleteOptions) error { - return s.objectClient.Delete(name, options) -} - -func (s *basicAuthClient) DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error { - return s.objectClient.DeleteNamespaced(namespace, name, options) -} - -func (s *basicAuthClient) List(opts metav1.ListOptions) (*BasicAuthList, error) { - obj, err := s.objectClient.List(opts) - return obj.(*BasicAuthList), err -} - -func (s *basicAuthClient) ListNamespaced(namespace string, opts metav1.ListOptions) (*BasicAuthList, error) { - obj, err := s.objectClient.ListNamespaced(namespace, opts) - return obj.(*BasicAuthList), err -} - -func (s *basicAuthClient) Watch(opts metav1.ListOptions) (watch.Interface, error) { - return s.objectClient.Watch(opts) -} - -// Patch applies the patch and returns the patched deployment. -func (s *basicAuthClient) Patch(o *BasicAuth, patchType types.PatchType, data []byte, subresources ...string) (*BasicAuth, error) { - obj, err := s.objectClient.Patch(o.Name, o, patchType, data, subresources...) - return obj.(*BasicAuth), err -} - -func (s *basicAuthClient) DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error { - return s.objectClient.DeleteCollection(deleteOpts, listOpts) -} - -func (s *basicAuthClient) AddHandler(ctx context.Context, name string, sync BasicAuthHandlerFunc) { - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *basicAuthClient) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync BasicAuthHandlerFunc) { - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *basicAuthClient) AddLifecycle(ctx context.Context, name string, lifecycle BasicAuthLifecycle) { - sync := NewBasicAuthLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *basicAuthClient) AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle BasicAuthLifecycle) { - sync := NewBasicAuthLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *basicAuthClient) AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync BasicAuthHandlerFunc) { - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *basicAuthClient) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync BasicAuthHandlerFunc) { - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} - -func (s *basicAuthClient) AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle BasicAuthLifecycle) { - sync := NewBasicAuthLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *basicAuthClient) AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle BasicAuthLifecycle) { - sync := NewBasicAuthLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} diff --git a/vendor/github.com/rancher/types/apis/project.cattle.io/v3/zz_generated_basic_auth_lifecycle_adapter.go b/vendor/github.com/rancher/types/apis/project.cattle.io/v3/zz_generated_basic_auth_lifecycle_adapter.go deleted file mode 100644 index 6101826b..00000000 --- a/vendor/github.com/rancher/types/apis/project.cattle.io/v3/zz_generated_basic_auth_lifecycle_adapter.go +++ /dev/null @@ -1,66 +0,0 @@ -package v3 - -import ( - "github.com/rancher/norman/lifecycle" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/runtime" -) - -type BasicAuthLifecycle interface { - Create(obj *BasicAuth) (runtime.Object, error) - Remove(obj *BasicAuth) (runtime.Object, error) - Updated(obj *BasicAuth) (runtime.Object, error) -} - -type basicAuthLifecycleAdapter struct { - lifecycle BasicAuthLifecycle -} - -func (w *basicAuthLifecycleAdapter) HasCreate() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasCreate() -} - -func (w *basicAuthLifecycleAdapter) HasFinalize() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasFinalize() -} - -func (w *basicAuthLifecycleAdapter) Create(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Create(obj.(*BasicAuth)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *basicAuthLifecycleAdapter) Finalize(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Remove(obj.(*BasicAuth)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *basicAuthLifecycleAdapter) Updated(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Updated(obj.(*BasicAuth)) - if o == nil { - return nil, err - } - return o, err -} - -func NewBasicAuthLifecycleAdapter(name string, clusterScoped bool, client BasicAuthInterface, l BasicAuthLifecycle) BasicAuthHandlerFunc { - if clusterScoped { - resource.PutClusterScoped(BasicAuthGroupVersionResource) - } - adapter := &basicAuthLifecycleAdapter{lifecycle: l} - syncFn := lifecycle.NewObjectLifecycleAdapter(name, clusterScoped, adapter, client.ObjectClient()) - return func(key string, obj *BasicAuth) (runtime.Object, error) { - newObj, err := syncFn(key, obj) - if o, ok := newObj.(runtime.Object); ok { - return o, err - } - return nil, err - } -} diff --git a/vendor/github.com/rancher/types/apis/project.cattle.io/v3/zz_generated_certificate_controller.go b/vendor/github.com/rancher/types/apis/project.cattle.io/v3/zz_generated_certificate_controller.go deleted file mode 100644 index cfe2fa87..00000000 --- a/vendor/github.com/rancher/types/apis/project.cattle.io/v3/zz_generated_certificate_controller.go +++ /dev/null @@ -1,321 +0,0 @@ -package v3 - -import ( - "context" - "time" - - "github.com/rancher/norman/controller" - "github.com/rancher/norman/objectclient" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/apimachinery/pkg/types" - "k8s.io/apimachinery/pkg/watch" - "k8s.io/client-go/tools/cache" -) - -var ( - CertificateGroupVersionKind = schema.GroupVersionKind{ - Version: Version, - Group: GroupName, - Kind: "Certificate", - } - CertificateResource = metav1.APIResource{ - Name: "certificates", - SingularName: "certificate", - Namespaced: true, - - Kind: CertificateGroupVersionKind.Kind, - } - - CertificateGroupVersionResource = schema.GroupVersionResource{ - Group: GroupName, - Version: Version, - Resource: "certificates", - } -) - -func init() { - resource.Put(CertificateGroupVersionResource) -} - -func NewCertificate(namespace, name string, obj Certificate) *Certificate { - obj.APIVersion, obj.Kind = CertificateGroupVersionKind.ToAPIVersionAndKind() - obj.Name = name - obj.Namespace = namespace - return &obj -} - -type CertificateList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []Certificate `json:"items"` -} - -type CertificateHandlerFunc func(key string, obj *Certificate) (runtime.Object, error) - -type CertificateChangeHandlerFunc func(obj *Certificate) (runtime.Object, error) - -type CertificateLister interface { - List(namespace string, selector labels.Selector) (ret []*Certificate, err error) - Get(namespace, name string) (*Certificate, error) -} - -type CertificateController interface { - Generic() controller.GenericController - Informer() cache.SharedIndexInformer - Lister() CertificateLister - AddHandler(ctx context.Context, name string, handler CertificateHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync CertificateHandlerFunc) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, handler CertificateHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, handler CertificateHandlerFunc) - Enqueue(namespace, name string) - EnqueueAfter(namespace, name string, after time.Duration) -} - -type CertificateInterface interface { - ObjectClient() *objectclient.ObjectClient - Create(*Certificate) (*Certificate, error) - GetNamespaced(namespace, name string, opts metav1.GetOptions) (*Certificate, error) - Get(name string, opts metav1.GetOptions) (*Certificate, error) - Update(*Certificate) (*Certificate, error) - Delete(name string, options *metav1.DeleteOptions) error - DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error - List(opts metav1.ListOptions) (*CertificateList, error) - ListNamespaced(namespace string, opts metav1.ListOptions) (*CertificateList, error) - Watch(opts metav1.ListOptions) (watch.Interface, error) - DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error - Controller() CertificateController - AddHandler(ctx context.Context, name string, sync CertificateHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync CertificateHandlerFunc) - AddLifecycle(ctx context.Context, name string, lifecycle CertificateLifecycle) - AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle CertificateLifecycle) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync CertificateHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync CertificateHandlerFunc) - AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle CertificateLifecycle) - AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle CertificateLifecycle) -} - -type certificateLister struct { - controller *certificateController -} - -func (l *certificateLister) List(namespace string, selector labels.Selector) (ret []*Certificate, err error) { - err = cache.ListAllByNamespace(l.controller.Informer().GetIndexer(), namespace, selector, func(obj interface{}) { - ret = append(ret, obj.(*Certificate)) - }) - return -} - -func (l *certificateLister) Get(namespace, name string) (*Certificate, error) { - var key string - if namespace != "" { - key = namespace + "/" + name - } else { - key = name - } - obj, exists, err := l.controller.Informer().GetIndexer().GetByKey(key) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(schema.GroupResource{ - Group: CertificateGroupVersionKind.Group, - Resource: CertificateGroupVersionResource.Resource, - }, key) - } - return obj.(*Certificate), nil -} - -type certificateController struct { - controller.GenericController -} - -func (c *certificateController) Generic() controller.GenericController { - return c.GenericController -} - -func (c *certificateController) Lister() CertificateLister { - return &certificateLister{ - controller: c, - } -} - -func (c *certificateController) AddHandler(ctx context.Context, name string, handler CertificateHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*Certificate); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *certificateController) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, handler CertificateHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*Certificate); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *certificateController) AddClusterScopedHandler(ctx context.Context, name, cluster string, handler CertificateHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*Certificate); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *certificateController) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, cluster string, handler CertificateHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*Certificate); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -type certificateFactory struct { -} - -func (c certificateFactory) Object() runtime.Object { - return &Certificate{} -} - -func (c certificateFactory) List() runtime.Object { - return &CertificateList{} -} - -func (s *certificateClient) Controller() CertificateController { - genericController := controller.NewGenericController(CertificateGroupVersionKind.Kind+"Controller", - s.client.controllerFactory.ForResourceKind(CertificateGroupVersionResource, CertificateGroupVersionKind.Kind, true)) - - return &certificateController{ - GenericController: genericController, - } -} - -type certificateClient struct { - client *Client - ns string - objectClient *objectclient.ObjectClient - controller CertificateController -} - -func (s *certificateClient) ObjectClient() *objectclient.ObjectClient { - return s.objectClient -} - -func (s *certificateClient) Create(o *Certificate) (*Certificate, error) { - obj, err := s.objectClient.Create(o) - return obj.(*Certificate), err -} - -func (s *certificateClient) Get(name string, opts metav1.GetOptions) (*Certificate, error) { - obj, err := s.objectClient.Get(name, opts) - return obj.(*Certificate), err -} - -func (s *certificateClient) GetNamespaced(namespace, name string, opts metav1.GetOptions) (*Certificate, error) { - obj, err := s.objectClient.GetNamespaced(namespace, name, opts) - return obj.(*Certificate), err -} - -func (s *certificateClient) Update(o *Certificate) (*Certificate, error) { - obj, err := s.objectClient.Update(o.Name, o) - return obj.(*Certificate), err -} - -func (s *certificateClient) UpdateStatus(o *Certificate) (*Certificate, error) { - obj, err := s.objectClient.UpdateStatus(o.Name, o) - return obj.(*Certificate), err -} - -func (s *certificateClient) Delete(name string, options *metav1.DeleteOptions) error { - return s.objectClient.Delete(name, options) -} - -func (s *certificateClient) DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error { - return s.objectClient.DeleteNamespaced(namespace, name, options) -} - -func (s *certificateClient) List(opts metav1.ListOptions) (*CertificateList, error) { - obj, err := s.objectClient.List(opts) - return obj.(*CertificateList), err -} - -func (s *certificateClient) ListNamespaced(namespace string, opts metav1.ListOptions) (*CertificateList, error) { - obj, err := s.objectClient.ListNamespaced(namespace, opts) - return obj.(*CertificateList), err -} - -func (s *certificateClient) Watch(opts metav1.ListOptions) (watch.Interface, error) { - return s.objectClient.Watch(opts) -} - -// Patch applies the patch and returns the patched deployment. -func (s *certificateClient) Patch(o *Certificate, patchType types.PatchType, data []byte, subresources ...string) (*Certificate, error) { - obj, err := s.objectClient.Patch(o.Name, o, patchType, data, subresources...) - return obj.(*Certificate), err -} - -func (s *certificateClient) DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error { - return s.objectClient.DeleteCollection(deleteOpts, listOpts) -} - -func (s *certificateClient) AddHandler(ctx context.Context, name string, sync CertificateHandlerFunc) { - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *certificateClient) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync CertificateHandlerFunc) { - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *certificateClient) AddLifecycle(ctx context.Context, name string, lifecycle CertificateLifecycle) { - sync := NewCertificateLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *certificateClient) AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle CertificateLifecycle) { - sync := NewCertificateLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *certificateClient) AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync CertificateHandlerFunc) { - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *certificateClient) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync CertificateHandlerFunc) { - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} - -func (s *certificateClient) AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle CertificateLifecycle) { - sync := NewCertificateLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *certificateClient) AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle CertificateLifecycle) { - sync := NewCertificateLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} diff --git a/vendor/github.com/rancher/types/apis/project.cattle.io/v3/zz_generated_certificate_lifecycle_adapter.go b/vendor/github.com/rancher/types/apis/project.cattle.io/v3/zz_generated_certificate_lifecycle_adapter.go deleted file mode 100644 index b92cd168..00000000 --- a/vendor/github.com/rancher/types/apis/project.cattle.io/v3/zz_generated_certificate_lifecycle_adapter.go +++ /dev/null @@ -1,66 +0,0 @@ -package v3 - -import ( - "github.com/rancher/norman/lifecycle" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/runtime" -) - -type CertificateLifecycle interface { - Create(obj *Certificate) (runtime.Object, error) - Remove(obj *Certificate) (runtime.Object, error) - Updated(obj *Certificate) (runtime.Object, error) -} - -type certificateLifecycleAdapter struct { - lifecycle CertificateLifecycle -} - -func (w *certificateLifecycleAdapter) HasCreate() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasCreate() -} - -func (w *certificateLifecycleAdapter) HasFinalize() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasFinalize() -} - -func (w *certificateLifecycleAdapter) Create(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Create(obj.(*Certificate)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *certificateLifecycleAdapter) Finalize(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Remove(obj.(*Certificate)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *certificateLifecycleAdapter) Updated(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Updated(obj.(*Certificate)) - if o == nil { - return nil, err - } - return o, err -} - -func NewCertificateLifecycleAdapter(name string, clusterScoped bool, client CertificateInterface, l CertificateLifecycle) CertificateHandlerFunc { - if clusterScoped { - resource.PutClusterScoped(CertificateGroupVersionResource) - } - adapter := &certificateLifecycleAdapter{lifecycle: l} - syncFn := lifecycle.NewObjectLifecycleAdapter(name, clusterScoped, adapter, client.ObjectClient()) - return func(key string, obj *Certificate) (runtime.Object, error) { - newObj, err := syncFn(key, obj) - if o, ok := newObj.(runtime.Object); ok { - return o, err - } - return nil, err - } -} diff --git a/vendor/github.com/rancher/types/apis/project.cattle.io/v3/zz_generated_deepcopy.go b/vendor/github.com/rancher/types/apis/project.cattle.io/v3/zz_generated_deepcopy.go deleted file mode 100644 index 547947ed..00000000 --- a/vendor/github.com/rancher/types/apis/project.cattle.io/v3/zz_generated_deepcopy.go +++ /dev/null @@ -1,2465 +0,0 @@ -package v3 - -import ( - 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 *App) DeepCopyInto(out *App) { - *out = *in - out.Namespaced = in.Namespaced - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) - in.Status.DeepCopyInto(&out.Status) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new App. -func (in *App) DeepCopy() *App { - if in == nil { - return nil - } - out := new(App) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *App) 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 *AppCondition) DeepCopyInto(out *AppCondition) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AppCondition. -func (in *AppCondition) DeepCopy() *AppCondition { - if in == nil { - return nil - } - out := new(AppCondition) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AppList) DeepCopyInto(out *AppList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]App, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AppList. -func (in *AppList) DeepCopy() *AppList { - if in == nil { - return nil - } - out := new(AppList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *AppList) 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 *AppRevision) DeepCopyInto(out *AppRevision) { - *out = *in - out.Namespaced = in.Namespaced - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - out.Spec = in.Spec - in.Status.DeepCopyInto(&out.Status) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AppRevision. -func (in *AppRevision) DeepCopy() *AppRevision { - if in == nil { - return nil - } - out := new(AppRevision) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *AppRevision) 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 *AppRevisionList) DeepCopyInto(out *AppRevisionList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]AppRevision, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AppRevisionList. -func (in *AppRevisionList) DeepCopy() *AppRevisionList { - if in == nil { - return nil - } - out := new(AppRevisionList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *AppRevisionList) 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 *AppRevisionSpec) DeepCopyInto(out *AppRevisionSpec) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AppRevisionSpec. -func (in *AppRevisionSpec) DeepCopy() *AppRevisionSpec { - if in == nil { - return nil - } - out := new(AppRevisionSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AppRevisionStatus) DeepCopyInto(out *AppRevisionStatus) { - *out = *in - if in.Answers != nil { - in, out := &in.Answers, &out.Answers - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - if in.Files != nil { - in, out := &in.Files, &out.Files - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AppRevisionStatus. -func (in *AppRevisionStatus) DeepCopy() *AppRevisionStatus { - if in == nil { - return nil - } - out := new(AppRevisionStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AppSpec) DeepCopyInto(out *AppSpec) { - *out = *in - if in.Files != nil { - in, out := &in.Files, &out.Files - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - if in.Answers != nil { - in, out := &in.Answers, &out.Answers - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AppSpec. -func (in *AppSpec) DeepCopy() *AppSpec { - if in == nil { - return nil - } - out := new(AppSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AppStatus) DeepCopyInto(out *AppStatus) { - *out = *in - if in.AppliedFiles != nil { - in, out := &in.AppliedFiles, &out.AppliedFiles - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make([]AppCondition, len(*in)) - copy(*out, *in) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AppStatus. -func (in *AppStatus) DeepCopy() *AppStatus { - if in == nil { - return nil - } - out := new(AppStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AppUpgradeConfig) DeepCopyInto(out *AppUpgradeConfig) { - *out = *in - if in.Answers != nil { - in, out := &in.Answers, &out.Answers - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - if in.Files != nil { - in, out := &in.Files, &out.Files - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AppUpgradeConfig. -func (in *AppUpgradeConfig) DeepCopy() *AppUpgradeConfig { - if in == nil { - return nil - } - out := new(AppUpgradeConfig) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ApplyAppConfig) DeepCopyInto(out *ApplyAppConfig) { - *out = *in - if in.Answers != nil { - in, out := &in.Answers, &out.Answers - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ApplyAppConfig. -func (in *ApplyAppConfig) DeepCopy() *ApplyAppConfig { - if in == nil { - return nil - } - out := new(ApplyAppConfig) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ApplyYamlConfig) DeepCopyInto(out *ApplyYamlConfig) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ApplyYamlConfig. -func (in *ApplyYamlConfig) DeepCopy() *ApplyYamlConfig { - if in == nil { - return nil - } - out := new(ApplyYamlConfig) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AuthAppInput) DeepCopyInto(out *AuthAppInput) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AuthAppInput. -func (in *AuthAppInput) DeepCopy() *AuthAppInput { - if in == nil { - return nil - } - out := new(AuthAppInput) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AuthUserInput) DeepCopyInto(out *AuthUserInput) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AuthUserInput. -func (in *AuthUserInput) DeepCopy() *AuthUserInput { - if in == nil { - return nil - } - out := new(AuthUserInput) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *BasicAuth) DeepCopyInto(out *BasicAuth) { - *out = *in - out.Namespaced = in.Namespaced - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BasicAuth. -func (in *BasicAuth) DeepCopy() *BasicAuth { - if in == nil { - return nil - } - out := new(BasicAuth) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *BasicAuth) 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 *BasicAuthList) DeepCopyInto(out *BasicAuthList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]BasicAuth, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BasicAuthList. -func (in *BasicAuthList) DeepCopy() *BasicAuthList { - if in == nil { - return nil - } - out := new(BasicAuthList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *BasicAuthList) 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 *BitbucketCloudApplyInput) DeepCopyInto(out *BitbucketCloudApplyInput) { - *out = *in - out.OauthApplyInput = in.OauthApplyInput - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BitbucketCloudApplyInput. -func (in *BitbucketCloudApplyInput) DeepCopy() *BitbucketCloudApplyInput { - if in == nil { - return nil - } - out := new(BitbucketCloudApplyInput) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *BitbucketCloudPipelineConfig) DeepCopyInto(out *BitbucketCloudPipelineConfig) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.SourceCodeProviderConfig.DeepCopyInto(&out.SourceCodeProviderConfig) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BitbucketCloudPipelineConfig. -func (in *BitbucketCloudPipelineConfig) DeepCopy() *BitbucketCloudPipelineConfig { - if in == nil { - return nil - } - out := new(BitbucketCloudPipelineConfig) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *BitbucketCloudPipelineConfig) 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 *BitbucketCloudProvider) DeepCopyInto(out *BitbucketCloudProvider) { - *out = *in - in.OauthProvider.DeepCopyInto(&out.OauthProvider) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BitbucketCloudProvider. -func (in *BitbucketCloudProvider) DeepCopy() *BitbucketCloudProvider { - if in == nil { - return nil - } - out := new(BitbucketCloudProvider) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *BitbucketCloudProvider) 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 *BitbucketServerApplyInput) DeepCopyInto(out *BitbucketServerApplyInput) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BitbucketServerApplyInput. -func (in *BitbucketServerApplyInput) DeepCopy() *BitbucketServerApplyInput { - if in == nil { - return nil - } - out := new(BitbucketServerApplyInput) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *BitbucketServerPipelineConfig) DeepCopyInto(out *BitbucketServerPipelineConfig) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.SourceCodeProviderConfig.DeepCopyInto(&out.SourceCodeProviderConfig) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BitbucketServerPipelineConfig. -func (in *BitbucketServerPipelineConfig) DeepCopy() *BitbucketServerPipelineConfig { - if in == nil { - return nil - } - out := new(BitbucketServerPipelineConfig) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *BitbucketServerPipelineConfig) 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 *BitbucketServerProvider) DeepCopyInto(out *BitbucketServerProvider) { - *out = *in - in.OauthProvider.DeepCopyInto(&out.OauthProvider) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BitbucketServerProvider. -func (in *BitbucketServerProvider) DeepCopy() *BitbucketServerProvider { - if in == nil { - return nil - } - out := new(BitbucketServerProvider) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *BitbucketServerProvider) 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 *BitbucketServerRequestLoginInput) DeepCopyInto(out *BitbucketServerRequestLoginInput) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BitbucketServerRequestLoginInput. -func (in *BitbucketServerRequestLoginInput) DeepCopy() *BitbucketServerRequestLoginInput { - if in == nil { - return nil - } - out := new(BitbucketServerRequestLoginInput) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *BitbucketServerRequestLoginOutput) DeepCopyInto(out *BitbucketServerRequestLoginOutput) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BitbucketServerRequestLoginOutput. -func (in *BitbucketServerRequestLoginOutput) DeepCopy() *BitbucketServerRequestLoginOutput { - if in == nil { - return nil - } - out := new(BitbucketServerRequestLoginOutput) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Certificate) DeepCopyInto(out *Certificate) { - *out = *in - out.Namespaced = in.Namespaced - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - if in.SubjectAlternativeNames != nil { - in, out := &in.SubjectAlternativeNames, &out.SubjectAlternativeNames - *out = make([]string, len(*in)) - copy(*out, *in) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Certificate. -func (in *Certificate) DeepCopy() *Certificate { - if in == nil { - return nil - } - out := new(Certificate) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *Certificate) 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 *CertificateList) DeepCopyInto(out *CertificateList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]Certificate, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CertificateList. -func (in *CertificateList) DeepCopy() *CertificateList { - if in == nil { - return nil - } - out := new(CertificateList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *CertificateList) 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 *Constraint) DeepCopyInto(out *Constraint) { - *out = *in - if in.Include != nil { - in, out := &in.Include, &out.Include - *out = make([]string, len(*in)) - copy(*out, *in) - } - if in.Exclude != nil { - in, out := &in.Exclude, &out.Exclude - *out = make([]string, len(*in)) - copy(*out, *in) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Constraint. -func (in *Constraint) DeepCopy() *Constraint { - if in == nil { - return nil - } - out := new(Constraint) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Constraints) DeepCopyInto(out *Constraints) { - *out = *in - if in.Branch != nil { - in, out := &in.Branch, &out.Branch - *out = new(Constraint) - (*in).DeepCopyInto(*out) - } - if in.Event != nil { - in, out := &in.Event, &out.Event - *out = new(Constraint) - (*in).DeepCopyInto(*out) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Constraints. -func (in *Constraints) DeepCopy() *Constraints { - if in == nil { - return nil - } - out := new(Constraints) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *DeploymentRollbackInput) DeepCopyInto(out *DeploymentRollbackInput) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DeploymentRollbackInput. -func (in *DeploymentRollbackInput) DeepCopy() *DeploymentRollbackInput { - if in == nil { - return nil - } - out := new(DeploymentRollbackInput) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *DockerCredential) DeepCopyInto(out *DockerCredential) { - *out = *in - out.Namespaced = in.Namespaced - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - if in.Registries != nil { - in, out := &in.Registries, &out.Registries - *out = make(map[string]RegistryCredential, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DockerCredential. -func (in *DockerCredential) DeepCopy() *DockerCredential { - if in == nil { - return nil - } - out := new(DockerCredential) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *DockerCredential) 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 *DockerCredentialList) DeepCopyInto(out *DockerCredentialList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]DockerCredential, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DockerCredentialList. -func (in *DockerCredentialList) DeepCopy() *DockerCredentialList { - if in == nil { - return nil - } - out := new(DockerCredentialList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *DockerCredentialList) 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 *EnvFrom) DeepCopyInto(out *EnvFrom) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EnvFrom. -func (in *EnvFrom) DeepCopy() *EnvFrom { - if in == nil { - return nil - } - out := new(EnvFrom) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *GithubApplyInput) DeepCopyInto(out *GithubApplyInput) { - *out = *in - out.OauthApplyInput = in.OauthApplyInput - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GithubApplyInput. -func (in *GithubApplyInput) DeepCopy() *GithubApplyInput { - if in == nil { - return nil - } - out := new(GithubApplyInput) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *GithubPipelineConfig) DeepCopyInto(out *GithubPipelineConfig) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.SourceCodeProviderConfig.DeepCopyInto(&out.SourceCodeProviderConfig) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GithubPipelineConfig. -func (in *GithubPipelineConfig) DeepCopy() *GithubPipelineConfig { - if in == nil { - return nil - } - out := new(GithubPipelineConfig) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *GithubPipelineConfig) 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 *GithubProvider) DeepCopyInto(out *GithubProvider) { - *out = *in - in.OauthProvider.DeepCopyInto(&out.OauthProvider) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GithubProvider. -func (in *GithubProvider) DeepCopy() *GithubProvider { - if in == nil { - return nil - } - out := new(GithubProvider) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *GithubProvider) 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 *GitlabApplyInput) DeepCopyInto(out *GitlabApplyInput) { - *out = *in - out.OauthApplyInput = in.OauthApplyInput - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GitlabApplyInput. -func (in *GitlabApplyInput) DeepCopy() *GitlabApplyInput { - if in == nil { - return nil - } - out := new(GitlabApplyInput) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *GitlabPipelineConfig) DeepCopyInto(out *GitlabPipelineConfig) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.SourceCodeProviderConfig.DeepCopyInto(&out.SourceCodeProviderConfig) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GitlabPipelineConfig. -func (in *GitlabPipelineConfig) DeepCopy() *GitlabPipelineConfig { - if in == nil { - return nil - } - out := new(GitlabPipelineConfig) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *GitlabPipelineConfig) 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 *GitlabProvider) DeepCopyInto(out *GitlabProvider) { - *out = *in - in.OauthProvider.DeepCopyInto(&out.OauthProvider) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GitlabProvider. -func (in *GitlabProvider) DeepCopy() *GitlabProvider { - if in == nil { - return nil - } - out := new(GitlabProvider) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *GitlabProvider) 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 *NamespacedBasicAuth) DeepCopyInto(out *NamespacedBasicAuth) { - *out = *in - out.Namespaced = in.Namespaced - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NamespacedBasicAuth. -func (in *NamespacedBasicAuth) DeepCopy() *NamespacedBasicAuth { - if in == nil { - return nil - } - out := new(NamespacedBasicAuth) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *NamespacedBasicAuth) 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 *NamespacedBasicAuthList) DeepCopyInto(out *NamespacedBasicAuthList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]NamespacedBasicAuth, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NamespacedBasicAuthList. -func (in *NamespacedBasicAuthList) DeepCopy() *NamespacedBasicAuthList { - if in == nil { - return nil - } - out := new(NamespacedBasicAuthList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *NamespacedBasicAuthList) 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 *NamespacedCertificate) DeepCopyInto(out *NamespacedCertificate) { - *out = *in - out.Namespaced = in.Namespaced - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - if in.SubjectAlternativeNames != nil { - in, out := &in.SubjectAlternativeNames, &out.SubjectAlternativeNames - *out = make([]string, len(*in)) - copy(*out, *in) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NamespacedCertificate. -func (in *NamespacedCertificate) DeepCopy() *NamespacedCertificate { - if in == nil { - return nil - } - out := new(NamespacedCertificate) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *NamespacedCertificate) 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 *NamespacedCertificateList) DeepCopyInto(out *NamespacedCertificateList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]NamespacedCertificate, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NamespacedCertificateList. -func (in *NamespacedCertificateList) DeepCopy() *NamespacedCertificateList { - if in == nil { - return nil - } - out := new(NamespacedCertificateList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *NamespacedCertificateList) 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 *NamespacedDockerCredential) DeepCopyInto(out *NamespacedDockerCredential) { - *out = *in - out.Namespaced = in.Namespaced - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - if in.Registries != nil { - in, out := &in.Registries, &out.Registries - *out = make(map[string]RegistryCredential, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NamespacedDockerCredential. -func (in *NamespacedDockerCredential) DeepCopy() *NamespacedDockerCredential { - if in == nil { - return nil - } - out := new(NamespacedDockerCredential) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *NamespacedDockerCredential) 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 *NamespacedDockerCredentialList) DeepCopyInto(out *NamespacedDockerCredentialList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]NamespacedDockerCredential, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NamespacedDockerCredentialList. -func (in *NamespacedDockerCredentialList) DeepCopy() *NamespacedDockerCredentialList { - if in == nil { - return nil - } - out := new(NamespacedDockerCredentialList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *NamespacedDockerCredentialList) 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 *NamespacedSSHAuth) DeepCopyInto(out *NamespacedSSHAuth) { - *out = *in - out.Namespaced = in.Namespaced - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NamespacedSSHAuth. -func (in *NamespacedSSHAuth) DeepCopy() *NamespacedSSHAuth { - if in == nil { - return nil - } - out := new(NamespacedSSHAuth) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *NamespacedSSHAuth) 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 *NamespacedSSHAuthList) DeepCopyInto(out *NamespacedSSHAuthList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]NamespacedSSHAuth, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NamespacedSSHAuthList. -func (in *NamespacedSSHAuthList) DeepCopy() *NamespacedSSHAuthList { - if in == nil { - return nil - } - out := new(NamespacedSSHAuthList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *NamespacedSSHAuthList) 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 *NamespacedServiceAccountToken) DeepCopyInto(out *NamespacedServiceAccountToken) { - *out = *in - out.Namespaced = in.Namespaced - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NamespacedServiceAccountToken. -func (in *NamespacedServiceAccountToken) DeepCopy() *NamespacedServiceAccountToken { - if in == nil { - return nil - } - out := new(NamespacedServiceAccountToken) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *NamespacedServiceAccountToken) 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 *NamespacedServiceAccountTokenList) DeepCopyInto(out *NamespacedServiceAccountTokenList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]NamespacedServiceAccountToken, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NamespacedServiceAccountTokenList. -func (in *NamespacedServiceAccountTokenList) DeepCopy() *NamespacedServiceAccountTokenList { - if in == nil { - return nil - } - out := new(NamespacedServiceAccountTokenList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *NamespacedServiceAccountTokenList) 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 *OauthApplyInput) DeepCopyInto(out *OauthApplyInput) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OauthApplyInput. -func (in *OauthApplyInput) DeepCopy() *OauthApplyInput { - if in == nil { - return nil - } - out := new(OauthApplyInput) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *OauthProvider) DeepCopyInto(out *OauthProvider) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.SourceCodeProvider.DeepCopyInto(&out.SourceCodeProvider) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OauthProvider. -func (in *OauthProvider) DeepCopy() *OauthProvider { - if in == nil { - return nil - } - out := new(OauthProvider) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *OauthProvider) 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 *Pipeline) DeepCopyInto(out *Pipeline) { - *out = *in - out.Namespaced = in.Namespaced - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - out.Spec = in.Spec - in.Status.DeepCopyInto(&out.Status) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Pipeline. -func (in *Pipeline) DeepCopy() *Pipeline { - if in == nil { - return nil - } - out := new(Pipeline) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *Pipeline) 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 *PipelineCondition) DeepCopyInto(out *PipelineCondition) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PipelineCondition. -func (in *PipelineCondition) DeepCopy() *PipelineCondition { - if in == nil { - return nil - } - out := new(PipelineCondition) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *PipelineConfig) DeepCopyInto(out *PipelineConfig) { - *out = *in - if in.Stages != nil { - in, out := &in.Stages, &out.Stages - *out = make([]Stage, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.Branch != nil { - in, out := &in.Branch, &out.Branch - *out = new(Constraint) - (*in).DeepCopyInto(*out) - } - if in.Notification != nil { - in, out := &in.Notification, &out.Notification - *out = new(PipelineNotification) - (*in).DeepCopyInto(*out) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PipelineConfig. -func (in *PipelineConfig) DeepCopy() *PipelineConfig { - if in == nil { - return nil - } - out := new(PipelineConfig) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *PipelineExecution) DeepCopyInto(out *PipelineExecution) { - *out = *in - out.Namespaced = in.Namespaced - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) - in.Status.DeepCopyInto(&out.Status) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PipelineExecution. -func (in *PipelineExecution) DeepCopy() *PipelineExecution { - if in == nil { - return nil - } - out := new(PipelineExecution) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *PipelineExecution) 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 *PipelineExecutionList) DeepCopyInto(out *PipelineExecutionList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]PipelineExecution, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PipelineExecutionList. -func (in *PipelineExecutionList) DeepCopy() *PipelineExecutionList { - if in == nil { - return nil - } - out := new(PipelineExecutionList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *PipelineExecutionList) 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 *PipelineExecutionSpec) DeepCopyInto(out *PipelineExecutionSpec) { - *out = *in - in.PipelineConfig.DeepCopyInto(&out.PipelineConfig) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PipelineExecutionSpec. -func (in *PipelineExecutionSpec) DeepCopy() *PipelineExecutionSpec { - if in == nil { - return nil - } - out := new(PipelineExecutionSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *PipelineExecutionStatus) DeepCopyInto(out *PipelineExecutionStatus) { - *out = *in - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make([]PipelineCondition, len(*in)) - copy(*out, *in) - } - if in.Stages != nil { - in, out := &in.Stages, &out.Stages - *out = make([]StageStatus, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PipelineExecutionStatus. -func (in *PipelineExecutionStatus) DeepCopy() *PipelineExecutionStatus { - if in == nil { - return nil - } - out := new(PipelineExecutionStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *PipelineList) DeepCopyInto(out *PipelineList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]Pipeline, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PipelineList. -func (in *PipelineList) DeepCopy() *PipelineList { - if in == nil { - return nil - } - out := new(PipelineList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *PipelineList) 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 *PipelineNotification) DeepCopyInto(out *PipelineNotification) { - *out = *in - if in.Recipients != nil { - in, out := &in.Recipients, &out.Recipients - *out = make([]Recipient, len(*in)) - copy(*out, *in) - } - if in.Condition != nil { - in, out := &in.Condition, &out.Condition - *out = make(stringorslice, len(*in)) - copy(*out, *in) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PipelineNotification. -func (in *PipelineNotification) DeepCopy() *PipelineNotification { - if in == nil { - return nil - } - out := new(PipelineNotification) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *PipelineSetting) DeepCopyInto(out *PipelineSetting) { - *out = *in - out.Namespaced = in.Namespaced - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PipelineSetting. -func (in *PipelineSetting) DeepCopy() *PipelineSetting { - if in == nil { - return nil - } - out := new(PipelineSetting) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *PipelineSetting) 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 *PipelineSettingList) DeepCopyInto(out *PipelineSettingList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]PipelineSetting, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PipelineSettingList. -func (in *PipelineSettingList) DeepCopy() *PipelineSettingList { - if in == nil { - return nil - } - out := new(PipelineSettingList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *PipelineSettingList) 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 *PipelineSpec) DeepCopyInto(out *PipelineSpec) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PipelineSpec. -func (in *PipelineSpec) DeepCopy() *PipelineSpec { - if in == nil { - return nil - } - out := new(PipelineSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *PipelineStatus) DeepCopyInto(out *PipelineStatus) { - *out = *in - if in.SourceCodeCredential != nil { - in, out := &in.SourceCodeCredential, &out.SourceCodeCredential - *out = new(SourceCodeCredential) - (*in).DeepCopyInto(*out) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PipelineStatus. -func (in *PipelineStatus) DeepCopy() *PipelineStatus { - if in == nil { - return nil - } - out := new(PipelineStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *PipelineSystemImages) DeepCopyInto(out *PipelineSystemImages) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PipelineSystemImages. -func (in *PipelineSystemImages) DeepCopy() *PipelineSystemImages { - if in == nil { - return nil - } - out := new(PipelineSystemImages) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *PublicEndpoint) DeepCopyInto(out *PublicEndpoint) { - *out = *in - if in.Addresses != nil { - in, out := &in.Addresses, &out.Addresses - *out = make([]string, len(*in)) - copy(*out, *in) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PublicEndpoint. -func (in *PublicEndpoint) DeepCopy() *PublicEndpoint { - if in == nil { - return nil - } - out := new(PublicEndpoint) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *PublishCatalogConfig) DeepCopyInto(out *PublishCatalogConfig) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PublishCatalogConfig. -func (in *PublishCatalogConfig) DeepCopy() *PublishCatalogConfig { - if in == nil { - return nil - } - out := new(PublishCatalogConfig) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *PublishImageConfig) DeepCopyInto(out *PublishImageConfig) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PublishImageConfig. -func (in *PublishImageConfig) DeepCopy() *PublishImageConfig { - if in == nil { - return nil - } - out := new(PublishImageConfig) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *PushPipelineConfigInput) DeepCopyInto(out *PushPipelineConfigInput) { - *out = *in - if in.Configs != nil { - in, out := &in.Configs, &out.Configs - *out = make(map[string]PipelineConfig, len(*in)) - for key, val := range *in { - (*out)[key] = *val.DeepCopy() - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PushPipelineConfigInput. -func (in *PushPipelineConfigInput) DeepCopy() *PushPipelineConfigInput { - if in == nil { - return nil - } - out := new(PushPipelineConfigInput) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Recipient) DeepCopyInto(out *Recipient) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Recipient. -func (in *Recipient) DeepCopy() *Recipient { - if in == nil { - return nil - } - out := new(Recipient) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *RegistryCredential) DeepCopyInto(out *RegistryCredential) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RegistryCredential. -func (in *RegistryCredential) DeepCopy() *RegistryCredential { - if in == nil { - return nil - } - out := new(RegistryCredential) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *RepoPerm) DeepCopyInto(out *RepoPerm) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RepoPerm. -func (in *RepoPerm) DeepCopy() *RepoPerm { - if in == nil { - return nil - } - out := new(RepoPerm) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *RollbackRevision) DeepCopyInto(out *RollbackRevision) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RollbackRevision. -func (in *RollbackRevision) DeepCopy() *RollbackRevision { - if in == nil { - return nil - } - out := new(RollbackRevision) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *RunPipelineInput) DeepCopyInto(out *RunPipelineInput) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RunPipelineInput. -func (in *RunPipelineInput) DeepCopy() *RunPipelineInput { - if in == nil { - return nil - } - out := new(RunPipelineInput) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *RunScriptConfig) DeepCopyInto(out *RunScriptConfig) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RunScriptConfig. -func (in *RunScriptConfig) DeepCopy() *RunScriptConfig { - if in == nil { - return nil - } - out := new(RunScriptConfig) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *SSHAuth) DeepCopyInto(out *SSHAuth) { - *out = *in - out.Namespaced = in.Namespaced - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SSHAuth. -func (in *SSHAuth) DeepCopy() *SSHAuth { - if in == nil { - return nil - } - out := new(SSHAuth) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *SSHAuth) 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 *SSHAuthList) DeepCopyInto(out *SSHAuthList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]SSHAuth, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SSHAuthList. -func (in *SSHAuthList) DeepCopy() *SSHAuthList { - if in == nil { - return nil - } - out := new(SSHAuthList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *SSHAuthList) 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 *ServiceAccountToken) DeepCopyInto(out *ServiceAccountToken) { - *out = *in - out.Namespaced = in.Namespaced - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceAccountToken. -func (in *ServiceAccountToken) DeepCopy() *ServiceAccountToken { - if in == nil { - return nil - } - out := new(ServiceAccountToken) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ServiceAccountToken) 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 *ServiceAccountTokenList) DeepCopyInto(out *ServiceAccountTokenList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]ServiceAccountToken, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceAccountTokenList. -func (in *ServiceAccountTokenList) DeepCopy() *ServiceAccountTokenList { - if in == nil { - return nil - } - out := new(ServiceAccountTokenList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ServiceAccountTokenList) 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 *SourceCodeConfig) DeepCopyInto(out *SourceCodeConfig) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SourceCodeConfig. -func (in *SourceCodeConfig) DeepCopy() *SourceCodeConfig { - if in == nil { - return nil - } - out := new(SourceCodeConfig) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *SourceCodeCredential) DeepCopyInto(out *SourceCodeCredential) { - *out = *in - out.Namespaced = in.Namespaced - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - out.Spec = in.Spec - out.Status = in.Status - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SourceCodeCredential. -func (in *SourceCodeCredential) DeepCopy() *SourceCodeCredential { - if in == nil { - return nil - } - out := new(SourceCodeCredential) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *SourceCodeCredential) 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 *SourceCodeCredentialList) DeepCopyInto(out *SourceCodeCredentialList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]SourceCodeCredential, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SourceCodeCredentialList. -func (in *SourceCodeCredentialList) DeepCopy() *SourceCodeCredentialList { - if in == nil { - return nil - } - out := new(SourceCodeCredentialList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *SourceCodeCredentialList) 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 *SourceCodeCredentialSpec) DeepCopyInto(out *SourceCodeCredentialSpec) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SourceCodeCredentialSpec. -func (in *SourceCodeCredentialSpec) DeepCopy() *SourceCodeCredentialSpec { - if in == nil { - return nil - } - out := new(SourceCodeCredentialSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *SourceCodeCredentialStatus) DeepCopyInto(out *SourceCodeCredentialStatus) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SourceCodeCredentialStatus. -func (in *SourceCodeCredentialStatus) DeepCopy() *SourceCodeCredentialStatus { - if in == nil { - return nil - } - out := new(SourceCodeCredentialStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *SourceCodeProvider) DeepCopyInto(out *SourceCodeProvider) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SourceCodeProvider. -func (in *SourceCodeProvider) DeepCopy() *SourceCodeProvider { - if in == nil { - return nil - } - out := new(SourceCodeProvider) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *SourceCodeProvider) 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 *SourceCodeProviderConfig) DeepCopyInto(out *SourceCodeProviderConfig) { - *out = *in - out.Namespaced = in.Namespaced - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SourceCodeProviderConfig. -func (in *SourceCodeProviderConfig) DeepCopy() *SourceCodeProviderConfig { - if in == nil { - return nil - } - out := new(SourceCodeProviderConfig) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *SourceCodeProviderConfig) 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 *SourceCodeProviderConfigList) DeepCopyInto(out *SourceCodeProviderConfigList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]SourceCodeProviderConfig, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SourceCodeProviderConfigList. -func (in *SourceCodeProviderConfigList) DeepCopy() *SourceCodeProviderConfigList { - if in == nil { - return nil - } - out := new(SourceCodeProviderConfigList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *SourceCodeProviderConfigList) 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 *SourceCodeProviderList) DeepCopyInto(out *SourceCodeProviderList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]SourceCodeProvider, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SourceCodeProviderList. -func (in *SourceCodeProviderList) DeepCopy() *SourceCodeProviderList { - if in == nil { - return nil - } - out := new(SourceCodeProviderList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *SourceCodeProviderList) 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 *SourceCodeRepository) DeepCopyInto(out *SourceCodeRepository) { - *out = *in - out.Namespaced = in.Namespaced - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - out.Spec = in.Spec - out.Status = in.Status - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SourceCodeRepository. -func (in *SourceCodeRepository) DeepCopy() *SourceCodeRepository { - if in == nil { - return nil - } - out := new(SourceCodeRepository) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *SourceCodeRepository) 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 *SourceCodeRepositoryList) DeepCopyInto(out *SourceCodeRepositoryList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]SourceCodeRepository, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SourceCodeRepositoryList. -func (in *SourceCodeRepositoryList) DeepCopy() *SourceCodeRepositoryList { - if in == nil { - return nil - } - out := new(SourceCodeRepositoryList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *SourceCodeRepositoryList) 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 *SourceCodeRepositorySpec) DeepCopyInto(out *SourceCodeRepositorySpec) { - *out = *in - out.Permissions = in.Permissions - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SourceCodeRepositorySpec. -func (in *SourceCodeRepositorySpec) DeepCopy() *SourceCodeRepositorySpec { - if in == nil { - return nil - } - out := new(SourceCodeRepositorySpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *SourceCodeRepositoryStatus) DeepCopyInto(out *SourceCodeRepositoryStatus) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SourceCodeRepositoryStatus. -func (in *SourceCodeRepositoryStatus) DeepCopy() *SourceCodeRepositoryStatus { - if in == nil { - return nil - } - out := new(SourceCodeRepositoryStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Stage) DeepCopyInto(out *Stage) { - *out = *in - if in.Steps != nil { - in, out := &in.Steps, &out.Steps - *out = make([]Step, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.When != nil { - in, out := &in.When, &out.When - *out = new(Constraints) - (*in).DeepCopyInto(*out) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Stage. -func (in *Stage) DeepCopy() *Stage { - if in == nil { - return nil - } - out := new(Stage) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *StageStatus) DeepCopyInto(out *StageStatus) { - *out = *in - if in.Steps != nil { - in, out := &in.Steps, &out.Steps - *out = make([]StepStatus, len(*in)) - copy(*out, *in) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StageStatus. -func (in *StageStatus) DeepCopy() *StageStatus { - if in == nil { - return nil - } - out := new(StageStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Step) DeepCopyInto(out *Step) { - *out = *in - if in.SourceCodeConfig != nil { - in, out := &in.SourceCodeConfig, &out.SourceCodeConfig - *out = new(SourceCodeConfig) - **out = **in - } - if in.RunScriptConfig != nil { - in, out := &in.RunScriptConfig, &out.RunScriptConfig - *out = new(RunScriptConfig) - **out = **in - } - if in.PublishImageConfig != nil { - in, out := &in.PublishImageConfig, &out.PublishImageConfig - *out = new(PublishImageConfig) - **out = **in - } - if in.ApplyYamlConfig != nil { - in, out := &in.ApplyYamlConfig, &out.ApplyYamlConfig - *out = new(ApplyYamlConfig) - **out = **in - } - if in.PublishCatalogConfig != nil { - in, out := &in.PublishCatalogConfig, &out.PublishCatalogConfig - *out = new(PublishCatalogConfig) - **out = **in - } - if in.ApplyAppConfig != nil { - in, out := &in.ApplyAppConfig, &out.ApplyAppConfig - *out = new(ApplyAppConfig) - (*in).DeepCopyInto(*out) - } - if in.Env != nil { - in, out := &in.Env, &out.Env - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - if in.EnvFrom != nil { - in, out := &in.EnvFrom, &out.EnvFrom - *out = make([]EnvFrom, len(*in)) - copy(*out, *in) - } - if in.When != nil { - in, out := &in.When, &out.When - *out = new(Constraints) - (*in).DeepCopyInto(*out) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Step. -func (in *Step) DeepCopy() *Step { - if in == nil { - return nil - } - out := new(Step) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *StepStatus) DeepCopyInto(out *StepStatus) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StepStatus. -func (in *StepStatus) DeepCopy() *StepStatus { - if in == nil { - return nil - } - out := new(StepStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Workload) DeepCopyInto(out *Workload) { - *out = *in - out.Namespaced = in.Namespaced - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Workload. -func (in *Workload) DeepCopy() *Workload { - if in == nil { - return nil - } - out := new(Workload) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *Workload) 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 *WorkloadList) DeepCopyInto(out *WorkloadList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]Workload, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkloadList. -func (in *WorkloadList) DeepCopy() *WorkloadList { - if in == nil { - return nil - } - out := new(WorkloadList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *WorkloadList) 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 *WorkloadMetric) DeepCopyInto(out *WorkloadMetric) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkloadMetric. -func (in *WorkloadMetric) DeepCopy() *WorkloadMetric { - if in == nil { - return nil - } - out := new(WorkloadMetric) - in.DeepCopyInto(out) - return out -} diff --git a/vendor/github.com/rancher/types/apis/project.cattle.io/v3/zz_generated_docker_credential_controller.go b/vendor/github.com/rancher/types/apis/project.cattle.io/v3/zz_generated_docker_credential_controller.go deleted file mode 100644 index 9b337f7d..00000000 --- a/vendor/github.com/rancher/types/apis/project.cattle.io/v3/zz_generated_docker_credential_controller.go +++ /dev/null @@ -1,321 +0,0 @@ -package v3 - -import ( - "context" - "time" - - "github.com/rancher/norman/controller" - "github.com/rancher/norman/objectclient" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/apimachinery/pkg/types" - "k8s.io/apimachinery/pkg/watch" - "k8s.io/client-go/tools/cache" -) - -var ( - DockerCredentialGroupVersionKind = schema.GroupVersionKind{ - Version: Version, - Group: GroupName, - Kind: "DockerCredential", - } - DockerCredentialResource = metav1.APIResource{ - Name: "dockercredentials", - SingularName: "dockercredential", - Namespaced: true, - - Kind: DockerCredentialGroupVersionKind.Kind, - } - - DockerCredentialGroupVersionResource = schema.GroupVersionResource{ - Group: GroupName, - Version: Version, - Resource: "dockercredentials", - } -) - -func init() { - resource.Put(DockerCredentialGroupVersionResource) -} - -func NewDockerCredential(namespace, name string, obj DockerCredential) *DockerCredential { - obj.APIVersion, obj.Kind = DockerCredentialGroupVersionKind.ToAPIVersionAndKind() - obj.Name = name - obj.Namespace = namespace - return &obj -} - -type DockerCredentialList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []DockerCredential `json:"items"` -} - -type DockerCredentialHandlerFunc func(key string, obj *DockerCredential) (runtime.Object, error) - -type DockerCredentialChangeHandlerFunc func(obj *DockerCredential) (runtime.Object, error) - -type DockerCredentialLister interface { - List(namespace string, selector labels.Selector) (ret []*DockerCredential, err error) - Get(namespace, name string) (*DockerCredential, error) -} - -type DockerCredentialController interface { - Generic() controller.GenericController - Informer() cache.SharedIndexInformer - Lister() DockerCredentialLister - AddHandler(ctx context.Context, name string, handler DockerCredentialHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync DockerCredentialHandlerFunc) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, handler DockerCredentialHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, handler DockerCredentialHandlerFunc) - Enqueue(namespace, name string) - EnqueueAfter(namespace, name string, after time.Duration) -} - -type DockerCredentialInterface interface { - ObjectClient() *objectclient.ObjectClient - Create(*DockerCredential) (*DockerCredential, error) - GetNamespaced(namespace, name string, opts metav1.GetOptions) (*DockerCredential, error) - Get(name string, opts metav1.GetOptions) (*DockerCredential, error) - Update(*DockerCredential) (*DockerCredential, error) - Delete(name string, options *metav1.DeleteOptions) error - DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error - List(opts metav1.ListOptions) (*DockerCredentialList, error) - ListNamespaced(namespace string, opts metav1.ListOptions) (*DockerCredentialList, error) - Watch(opts metav1.ListOptions) (watch.Interface, error) - DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error - Controller() DockerCredentialController - AddHandler(ctx context.Context, name string, sync DockerCredentialHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync DockerCredentialHandlerFunc) - AddLifecycle(ctx context.Context, name string, lifecycle DockerCredentialLifecycle) - AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle DockerCredentialLifecycle) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync DockerCredentialHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync DockerCredentialHandlerFunc) - AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle DockerCredentialLifecycle) - AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle DockerCredentialLifecycle) -} - -type dockerCredentialLister struct { - controller *dockerCredentialController -} - -func (l *dockerCredentialLister) List(namespace string, selector labels.Selector) (ret []*DockerCredential, err error) { - err = cache.ListAllByNamespace(l.controller.Informer().GetIndexer(), namespace, selector, func(obj interface{}) { - ret = append(ret, obj.(*DockerCredential)) - }) - return -} - -func (l *dockerCredentialLister) Get(namespace, name string) (*DockerCredential, error) { - var key string - if namespace != "" { - key = namespace + "/" + name - } else { - key = name - } - obj, exists, err := l.controller.Informer().GetIndexer().GetByKey(key) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(schema.GroupResource{ - Group: DockerCredentialGroupVersionKind.Group, - Resource: DockerCredentialGroupVersionResource.Resource, - }, key) - } - return obj.(*DockerCredential), nil -} - -type dockerCredentialController struct { - controller.GenericController -} - -func (c *dockerCredentialController) Generic() controller.GenericController { - return c.GenericController -} - -func (c *dockerCredentialController) Lister() DockerCredentialLister { - return &dockerCredentialLister{ - controller: c, - } -} - -func (c *dockerCredentialController) AddHandler(ctx context.Context, name string, handler DockerCredentialHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*DockerCredential); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *dockerCredentialController) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, handler DockerCredentialHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*DockerCredential); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *dockerCredentialController) AddClusterScopedHandler(ctx context.Context, name, cluster string, handler DockerCredentialHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*DockerCredential); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *dockerCredentialController) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, cluster string, handler DockerCredentialHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*DockerCredential); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -type dockerCredentialFactory struct { -} - -func (c dockerCredentialFactory) Object() runtime.Object { - return &DockerCredential{} -} - -func (c dockerCredentialFactory) List() runtime.Object { - return &DockerCredentialList{} -} - -func (s *dockerCredentialClient) Controller() DockerCredentialController { - genericController := controller.NewGenericController(DockerCredentialGroupVersionKind.Kind+"Controller", - s.client.controllerFactory.ForResourceKind(DockerCredentialGroupVersionResource, DockerCredentialGroupVersionKind.Kind, true)) - - return &dockerCredentialController{ - GenericController: genericController, - } -} - -type dockerCredentialClient struct { - client *Client - ns string - objectClient *objectclient.ObjectClient - controller DockerCredentialController -} - -func (s *dockerCredentialClient) ObjectClient() *objectclient.ObjectClient { - return s.objectClient -} - -func (s *dockerCredentialClient) Create(o *DockerCredential) (*DockerCredential, error) { - obj, err := s.objectClient.Create(o) - return obj.(*DockerCredential), err -} - -func (s *dockerCredentialClient) Get(name string, opts metav1.GetOptions) (*DockerCredential, error) { - obj, err := s.objectClient.Get(name, opts) - return obj.(*DockerCredential), err -} - -func (s *dockerCredentialClient) GetNamespaced(namespace, name string, opts metav1.GetOptions) (*DockerCredential, error) { - obj, err := s.objectClient.GetNamespaced(namespace, name, opts) - return obj.(*DockerCredential), err -} - -func (s *dockerCredentialClient) Update(o *DockerCredential) (*DockerCredential, error) { - obj, err := s.objectClient.Update(o.Name, o) - return obj.(*DockerCredential), err -} - -func (s *dockerCredentialClient) UpdateStatus(o *DockerCredential) (*DockerCredential, error) { - obj, err := s.objectClient.UpdateStatus(o.Name, o) - return obj.(*DockerCredential), err -} - -func (s *dockerCredentialClient) Delete(name string, options *metav1.DeleteOptions) error { - return s.objectClient.Delete(name, options) -} - -func (s *dockerCredentialClient) DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error { - return s.objectClient.DeleteNamespaced(namespace, name, options) -} - -func (s *dockerCredentialClient) List(opts metav1.ListOptions) (*DockerCredentialList, error) { - obj, err := s.objectClient.List(opts) - return obj.(*DockerCredentialList), err -} - -func (s *dockerCredentialClient) ListNamespaced(namespace string, opts metav1.ListOptions) (*DockerCredentialList, error) { - obj, err := s.objectClient.ListNamespaced(namespace, opts) - return obj.(*DockerCredentialList), err -} - -func (s *dockerCredentialClient) Watch(opts metav1.ListOptions) (watch.Interface, error) { - return s.objectClient.Watch(opts) -} - -// Patch applies the patch and returns the patched deployment. -func (s *dockerCredentialClient) Patch(o *DockerCredential, patchType types.PatchType, data []byte, subresources ...string) (*DockerCredential, error) { - obj, err := s.objectClient.Patch(o.Name, o, patchType, data, subresources...) - return obj.(*DockerCredential), err -} - -func (s *dockerCredentialClient) DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error { - return s.objectClient.DeleteCollection(deleteOpts, listOpts) -} - -func (s *dockerCredentialClient) AddHandler(ctx context.Context, name string, sync DockerCredentialHandlerFunc) { - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *dockerCredentialClient) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync DockerCredentialHandlerFunc) { - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *dockerCredentialClient) AddLifecycle(ctx context.Context, name string, lifecycle DockerCredentialLifecycle) { - sync := NewDockerCredentialLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *dockerCredentialClient) AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle DockerCredentialLifecycle) { - sync := NewDockerCredentialLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *dockerCredentialClient) AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync DockerCredentialHandlerFunc) { - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *dockerCredentialClient) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync DockerCredentialHandlerFunc) { - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} - -func (s *dockerCredentialClient) AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle DockerCredentialLifecycle) { - sync := NewDockerCredentialLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *dockerCredentialClient) AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle DockerCredentialLifecycle) { - sync := NewDockerCredentialLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} diff --git a/vendor/github.com/rancher/types/apis/project.cattle.io/v3/zz_generated_docker_credential_lifecycle_adapter.go b/vendor/github.com/rancher/types/apis/project.cattle.io/v3/zz_generated_docker_credential_lifecycle_adapter.go deleted file mode 100644 index 4d06acd8..00000000 --- a/vendor/github.com/rancher/types/apis/project.cattle.io/v3/zz_generated_docker_credential_lifecycle_adapter.go +++ /dev/null @@ -1,66 +0,0 @@ -package v3 - -import ( - "github.com/rancher/norman/lifecycle" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/runtime" -) - -type DockerCredentialLifecycle interface { - Create(obj *DockerCredential) (runtime.Object, error) - Remove(obj *DockerCredential) (runtime.Object, error) - Updated(obj *DockerCredential) (runtime.Object, error) -} - -type dockerCredentialLifecycleAdapter struct { - lifecycle DockerCredentialLifecycle -} - -func (w *dockerCredentialLifecycleAdapter) HasCreate() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasCreate() -} - -func (w *dockerCredentialLifecycleAdapter) HasFinalize() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasFinalize() -} - -func (w *dockerCredentialLifecycleAdapter) Create(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Create(obj.(*DockerCredential)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *dockerCredentialLifecycleAdapter) Finalize(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Remove(obj.(*DockerCredential)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *dockerCredentialLifecycleAdapter) Updated(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Updated(obj.(*DockerCredential)) - if o == nil { - return nil, err - } - return o, err -} - -func NewDockerCredentialLifecycleAdapter(name string, clusterScoped bool, client DockerCredentialInterface, l DockerCredentialLifecycle) DockerCredentialHandlerFunc { - if clusterScoped { - resource.PutClusterScoped(DockerCredentialGroupVersionResource) - } - adapter := &dockerCredentialLifecycleAdapter{lifecycle: l} - syncFn := lifecycle.NewObjectLifecycleAdapter(name, clusterScoped, adapter, client.ObjectClient()) - return func(key string, obj *DockerCredential) (runtime.Object, error) { - newObj, err := syncFn(key, obj) - if o, ok := newObj.(runtime.Object); ok { - return o, err - } - return nil, err - } -} diff --git a/vendor/github.com/rancher/types/apis/project.cattle.io/v3/zz_generated_k8s_client.go b/vendor/github.com/rancher/types/apis/project.cattle.io/v3/zz_generated_k8s_client.go deleted file mode 100644 index a046f50c..00000000 --- a/vendor/github.com/rancher/types/apis/project.cattle.io/v3/zz_generated_k8s_client.go +++ /dev/null @@ -1,336 +0,0 @@ -package v3 - -import ( - "github.com/rancher/lasso/pkg/client" - "github.com/rancher/lasso/pkg/controller" - "github.com/rancher/norman/objectclient" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/client-go/rest" -) - -type Interface interface { - ServiceAccountTokensGetter - DockerCredentialsGetter - CertificatesGetter - BasicAuthsGetter - SSHAuthsGetter - NamespacedServiceAccountTokensGetter - NamespacedDockerCredentialsGetter - NamespacedCertificatesGetter - NamespacedBasicAuthsGetter - NamespacedSSHAuthsGetter - WorkloadsGetter - AppsGetter - AppRevisionsGetter - SourceCodeProvidersGetter - SourceCodeProviderConfigsGetter - SourceCodeCredentialsGetter - PipelinesGetter - PipelineExecutionsGetter - PipelineSettingsGetter - SourceCodeRepositoriesGetter -} - -type Client struct { - controllerFactory controller.SharedControllerFactory - clientFactory client.SharedClientFactory -} - -func NewForConfig(cfg rest.Config) (Interface, error) { - scheme := runtime.NewScheme() - if err := AddToScheme(scheme); err != nil { - return nil, err - } - controllerFactory, err := controller.NewSharedControllerFactoryFromConfig(&cfg, scheme) - if err != nil { - return nil, err - } - return NewFromControllerFactory(controllerFactory) -} - -func NewFromControllerFactory(factory controller.SharedControllerFactory) (Interface, error) { - return &Client{ - controllerFactory: factory, - clientFactory: factory.SharedCacheFactory().SharedClientFactory(), - }, nil -} - -type ServiceAccountTokensGetter interface { - ServiceAccountTokens(namespace string) ServiceAccountTokenInterface -} - -func (c *Client) ServiceAccountTokens(namespace string) ServiceAccountTokenInterface { - sharedClient := c.clientFactory.ForResourceKind(ServiceAccountTokenGroupVersionResource, ServiceAccountTokenGroupVersionKind.Kind, true) - objectClient := objectclient.NewObjectClient(namespace, sharedClient, &ServiceAccountTokenResource, ServiceAccountTokenGroupVersionKind, serviceAccountTokenFactory{}) - return &serviceAccountTokenClient{ - ns: namespace, - client: c, - objectClient: objectClient, - } -} - -type DockerCredentialsGetter interface { - DockerCredentials(namespace string) DockerCredentialInterface -} - -func (c *Client) DockerCredentials(namespace string) DockerCredentialInterface { - sharedClient := c.clientFactory.ForResourceKind(DockerCredentialGroupVersionResource, DockerCredentialGroupVersionKind.Kind, true) - objectClient := objectclient.NewObjectClient(namespace, sharedClient, &DockerCredentialResource, DockerCredentialGroupVersionKind, dockerCredentialFactory{}) - return &dockerCredentialClient{ - ns: namespace, - client: c, - objectClient: objectClient, - } -} - -type CertificatesGetter interface { - Certificates(namespace string) CertificateInterface -} - -func (c *Client) Certificates(namespace string) CertificateInterface { - sharedClient := c.clientFactory.ForResourceKind(CertificateGroupVersionResource, CertificateGroupVersionKind.Kind, true) - objectClient := objectclient.NewObjectClient(namespace, sharedClient, &CertificateResource, CertificateGroupVersionKind, certificateFactory{}) - return &certificateClient{ - ns: namespace, - client: c, - objectClient: objectClient, - } -} - -type BasicAuthsGetter interface { - BasicAuths(namespace string) BasicAuthInterface -} - -func (c *Client) BasicAuths(namespace string) BasicAuthInterface { - sharedClient := c.clientFactory.ForResourceKind(BasicAuthGroupVersionResource, BasicAuthGroupVersionKind.Kind, true) - objectClient := objectclient.NewObjectClient(namespace, sharedClient, &BasicAuthResource, BasicAuthGroupVersionKind, basicAuthFactory{}) - return &basicAuthClient{ - ns: namespace, - client: c, - objectClient: objectClient, - } -} - -type SSHAuthsGetter interface { - SSHAuths(namespace string) SSHAuthInterface -} - -func (c *Client) SSHAuths(namespace string) SSHAuthInterface { - sharedClient := c.clientFactory.ForResourceKind(SSHAuthGroupVersionResource, SSHAuthGroupVersionKind.Kind, true) - objectClient := objectclient.NewObjectClient(namespace, sharedClient, &SSHAuthResource, SSHAuthGroupVersionKind, sshAuthFactory{}) - return &sshAuthClient{ - ns: namespace, - client: c, - objectClient: objectClient, - } -} - -type NamespacedServiceAccountTokensGetter interface { - NamespacedServiceAccountTokens(namespace string) NamespacedServiceAccountTokenInterface -} - -func (c *Client) NamespacedServiceAccountTokens(namespace string) NamespacedServiceAccountTokenInterface { - sharedClient := c.clientFactory.ForResourceKind(NamespacedServiceAccountTokenGroupVersionResource, NamespacedServiceAccountTokenGroupVersionKind.Kind, true) - objectClient := objectclient.NewObjectClient(namespace, sharedClient, &NamespacedServiceAccountTokenResource, NamespacedServiceAccountTokenGroupVersionKind, namespacedServiceAccountTokenFactory{}) - return &namespacedServiceAccountTokenClient{ - ns: namespace, - client: c, - objectClient: objectClient, - } -} - -type NamespacedDockerCredentialsGetter interface { - NamespacedDockerCredentials(namespace string) NamespacedDockerCredentialInterface -} - -func (c *Client) NamespacedDockerCredentials(namespace string) NamespacedDockerCredentialInterface { - sharedClient := c.clientFactory.ForResourceKind(NamespacedDockerCredentialGroupVersionResource, NamespacedDockerCredentialGroupVersionKind.Kind, true) - objectClient := objectclient.NewObjectClient(namespace, sharedClient, &NamespacedDockerCredentialResource, NamespacedDockerCredentialGroupVersionKind, namespacedDockerCredentialFactory{}) - return &namespacedDockerCredentialClient{ - ns: namespace, - client: c, - objectClient: objectClient, - } -} - -type NamespacedCertificatesGetter interface { - NamespacedCertificates(namespace string) NamespacedCertificateInterface -} - -func (c *Client) NamespacedCertificates(namespace string) NamespacedCertificateInterface { - sharedClient := c.clientFactory.ForResourceKind(NamespacedCertificateGroupVersionResource, NamespacedCertificateGroupVersionKind.Kind, true) - objectClient := objectclient.NewObjectClient(namespace, sharedClient, &NamespacedCertificateResource, NamespacedCertificateGroupVersionKind, namespacedCertificateFactory{}) - return &namespacedCertificateClient{ - ns: namespace, - client: c, - objectClient: objectClient, - } -} - -type NamespacedBasicAuthsGetter interface { - NamespacedBasicAuths(namespace string) NamespacedBasicAuthInterface -} - -func (c *Client) NamespacedBasicAuths(namespace string) NamespacedBasicAuthInterface { - sharedClient := c.clientFactory.ForResourceKind(NamespacedBasicAuthGroupVersionResource, NamespacedBasicAuthGroupVersionKind.Kind, true) - objectClient := objectclient.NewObjectClient(namespace, sharedClient, &NamespacedBasicAuthResource, NamespacedBasicAuthGroupVersionKind, namespacedBasicAuthFactory{}) - return &namespacedBasicAuthClient{ - ns: namespace, - client: c, - objectClient: objectClient, - } -} - -type NamespacedSSHAuthsGetter interface { - NamespacedSSHAuths(namespace string) NamespacedSSHAuthInterface -} - -func (c *Client) NamespacedSSHAuths(namespace string) NamespacedSSHAuthInterface { - sharedClient := c.clientFactory.ForResourceKind(NamespacedSSHAuthGroupVersionResource, NamespacedSSHAuthGroupVersionKind.Kind, true) - objectClient := objectclient.NewObjectClient(namespace, sharedClient, &NamespacedSSHAuthResource, NamespacedSSHAuthGroupVersionKind, namespacedSshAuthFactory{}) - return &namespacedSshAuthClient{ - ns: namespace, - client: c, - objectClient: objectClient, - } -} - -type WorkloadsGetter interface { - Workloads(namespace string) WorkloadInterface -} - -func (c *Client) Workloads(namespace string) WorkloadInterface { - sharedClient := c.clientFactory.ForResourceKind(WorkloadGroupVersionResource, WorkloadGroupVersionKind.Kind, true) - objectClient := objectclient.NewObjectClient(namespace, sharedClient, &WorkloadResource, WorkloadGroupVersionKind, workloadFactory{}) - return &workloadClient{ - ns: namespace, - client: c, - objectClient: objectClient, - } -} - -type AppsGetter interface { - Apps(namespace string) AppInterface -} - -func (c *Client) Apps(namespace string) AppInterface { - sharedClient := c.clientFactory.ForResourceKind(AppGroupVersionResource, AppGroupVersionKind.Kind, true) - objectClient := objectclient.NewObjectClient(namespace, sharedClient, &AppResource, AppGroupVersionKind, appFactory{}) - return &appClient{ - ns: namespace, - client: c, - objectClient: objectClient, - } -} - -type AppRevisionsGetter interface { - AppRevisions(namespace string) AppRevisionInterface -} - -func (c *Client) AppRevisions(namespace string) AppRevisionInterface { - sharedClient := c.clientFactory.ForResourceKind(AppRevisionGroupVersionResource, AppRevisionGroupVersionKind.Kind, true) - objectClient := objectclient.NewObjectClient(namespace, sharedClient, &AppRevisionResource, AppRevisionGroupVersionKind, appRevisionFactory{}) - return &appRevisionClient{ - ns: namespace, - client: c, - objectClient: objectClient, - } -} - -type SourceCodeProvidersGetter interface { - SourceCodeProviders(namespace string) SourceCodeProviderInterface -} - -func (c *Client) SourceCodeProviders(namespace string) SourceCodeProviderInterface { - sharedClient := c.clientFactory.ForResourceKind(SourceCodeProviderGroupVersionResource, SourceCodeProviderGroupVersionKind.Kind, false) - objectClient := objectclient.NewObjectClient(namespace, sharedClient, &SourceCodeProviderResource, SourceCodeProviderGroupVersionKind, sourceCodeProviderFactory{}) - return &sourceCodeProviderClient{ - ns: namespace, - client: c, - objectClient: objectClient, - } -} - -type SourceCodeProviderConfigsGetter interface { - SourceCodeProviderConfigs(namespace string) SourceCodeProviderConfigInterface -} - -func (c *Client) SourceCodeProviderConfigs(namespace string) SourceCodeProviderConfigInterface { - sharedClient := c.clientFactory.ForResourceKind(SourceCodeProviderConfigGroupVersionResource, SourceCodeProviderConfigGroupVersionKind.Kind, true) - objectClient := objectclient.NewObjectClient(namespace, sharedClient, &SourceCodeProviderConfigResource, SourceCodeProviderConfigGroupVersionKind, sourceCodeProviderConfigFactory{}) - return &sourceCodeProviderConfigClient{ - ns: namespace, - client: c, - objectClient: objectClient, - } -} - -type SourceCodeCredentialsGetter interface { - SourceCodeCredentials(namespace string) SourceCodeCredentialInterface -} - -func (c *Client) SourceCodeCredentials(namespace string) SourceCodeCredentialInterface { - sharedClient := c.clientFactory.ForResourceKind(SourceCodeCredentialGroupVersionResource, SourceCodeCredentialGroupVersionKind.Kind, true) - objectClient := objectclient.NewObjectClient(namespace, sharedClient, &SourceCodeCredentialResource, SourceCodeCredentialGroupVersionKind, sourceCodeCredentialFactory{}) - return &sourceCodeCredentialClient{ - ns: namespace, - client: c, - objectClient: objectClient, - } -} - -type PipelinesGetter interface { - Pipelines(namespace string) PipelineInterface -} - -func (c *Client) Pipelines(namespace string) PipelineInterface { - sharedClient := c.clientFactory.ForResourceKind(PipelineGroupVersionResource, PipelineGroupVersionKind.Kind, true) - objectClient := objectclient.NewObjectClient(namespace, sharedClient, &PipelineResource, PipelineGroupVersionKind, pipelineFactory{}) - return &pipelineClient{ - ns: namespace, - client: c, - objectClient: objectClient, - } -} - -type PipelineExecutionsGetter interface { - PipelineExecutions(namespace string) PipelineExecutionInterface -} - -func (c *Client) PipelineExecutions(namespace string) PipelineExecutionInterface { - sharedClient := c.clientFactory.ForResourceKind(PipelineExecutionGroupVersionResource, PipelineExecutionGroupVersionKind.Kind, true) - objectClient := objectclient.NewObjectClient(namespace, sharedClient, &PipelineExecutionResource, PipelineExecutionGroupVersionKind, pipelineExecutionFactory{}) - return &pipelineExecutionClient{ - ns: namespace, - client: c, - objectClient: objectClient, - } -} - -type PipelineSettingsGetter interface { - PipelineSettings(namespace string) PipelineSettingInterface -} - -func (c *Client) PipelineSettings(namespace string) PipelineSettingInterface { - sharedClient := c.clientFactory.ForResourceKind(PipelineSettingGroupVersionResource, PipelineSettingGroupVersionKind.Kind, true) - objectClient := objectclient.NewObjectClient(namespace, sharedClient, &PipelineSettingResource, PipelineSettingGroupVersionKind, pipelineSettingFactory{}) - return &pipelineSettingClient{ - ns: namespace, - client: c, - objectClient: objectClient, - } -} - -type SourceCodeRepositoriesGetter interface { - SourceCodeRepositories(namespace string) SourceCodeRepositoryInterface -} - -func (c *Client) SourceCodeRepositories(namespace string) SourceCodeRepositoryInterface { - sharedClient := c.clientFactory.ForResourceKind(SourceCodeRepositoryGroupVersionResource, SourceCodeRepositoryGroupVersionKind.Kind, true) - objectClient := objectclient.NewObjectClient(namespace, sharedClient, &SourceCodeRepositoryResource, SourceCodeRepositoryGroupVersionKind, sourceCodeRepositoryFactory{}) - return &sourceCodeRepositoryClient{ - ns: namespace, - client: c, - objectClient: objectClient, - } -} diff --git a/vendor/github.com/rancher/types/apis/project.cattle.io/v3/zz_generated_namespaced_basic_auth_controller.go b/vendor/github.com/rancher/types/apis/project.cattle.io/v3/zz_generated_namespaced_basic_auth_controller.go deleted file mode 100644 index 77427da6..00000000 --- a/vendor/github.com/rancher/types/apis/project.cattle.io/v3/zz_generated_namespaced_basic_auth_controller.go +++ /dev/null @@ -1,321 +0,0 @@ -package v3 - -import ( - "context" - "time" - - "github.com/rancher/norman/controller" - "github.com/rancher/norman/objectclient" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/apimachinery/pkg/types" - "k8s.io/apimachinery/pkg/watch" - "k8s.io/client-go/tools/cache" -) - -var ( - NamespacedBasicAuthGroupVersionKind = schema.GroupVersionKind{ - Version: Version, - Group: GroupName, - Kind: "NamespacedBasicAuth", - } - NamespacedBasicAuthResource = metav1.APIResource{ - Name: "namespacedbasicauths", - SingularName: "namespacedbasicauth", - Namespaced: true, - - Kind: NamespacedBasicAuthGroupVersionKind.Kind, - } - - NamespacedBasicAuthGroupVersionResource = schema.GroupVersionResource{ - Group: GroupName, - Version: Version, - Resource: "namespacedbasicauths", - } -) - -func init() { - resource.Put(NamespacedBasicAuthGroupVersionResource) -} - -func NewNamespacedBasicAuth(namespace, name string, obj NamespacedBasicAuth) *NamespacedBasicAuth { - obj.APIVersion, obj.Kind = NamespacedBasicAuthGroupVersionKind.ToAPIVersionAndKind() - obj.Name = name - obj.Namespace = namespace - return &obj -} - -type NamespacedBasicAuthList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []NamespacedBasicAuth `json:"items"` -} - -type NamespacedBasicAuthHandlerFunc func(key string, obj *NamespacedBasicAuth) (runtime.Object, error) - -type NamespacedBasicAuthChangeHandlerFunc func(obj *NamespacedBasicAuth) (runtime.Object, error) - -type NamespacedBasicAuthLister interface { - List(namespace string, selector labels.Selector) (ret []*NamespacedBasicAuth, err error) - Get(namespace, name string) (*NamespacedBasicAuth, error) -} - -type NamespacedBasicAuthController interface { - Generic() controller.GenericController - Informer() cache.SharedIndexInformer - Lister() NamespacedBasicAuthLister - AddHandler(ctx context.Context, name string, handler NamespacedBasicAuthHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync NamespacedBasicAuthHandlerFunc) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, handler NamespacedBasicAuthHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, handler NamespacedBasicAuthHandlerFunc) - Enqueue(namespace, name string) - EnqueueAfter(namespace, name string, after time.Duration) -} - -type NamespacedBasicAuthInterface interface { - ObjectClient() *objectclient.ObjectClient - Create(*NamespacedBasicAuth) (*NamespacedBasicAuth, error) - GetNamespaced(namespace, name string, opts metav1.GetOptions) (*NamespacedBasicAuth, error) - Get(name string, opts metav1.GetOptions) (*NamespacedBasicAuth, error) - Update(*NamespacedBasicAuth) (*NamespacedBasicAuth, error) - Delete(name string, options *metav1.DeleteOptions) error - DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error - List(opts metav1.ListOptions) (*NamespacedBasicAuthList, error) - ListNamespaced(namespace string, opts metav1.ListOptions) (*NamespacedBasicAuthList, error) - Watch(opts metav1.ListOptions) (watch.Interface, error) - DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error - Controller() NamespacedBasicAuthController - AddHandler(ctx context.Context, name string, sync NamespacedBasicAuthHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync NamespacedBasicAuthHandlerFunc) - AddLifecycle(ctx context.Context, name string, lifecycle NamespacedBasicAuthLifecycle) - AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle NamespacedBasicAuthLifecycle) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync NamespacedBasicAuthHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync NamespacedBasicAuthHandlerFunc) - AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle NamespacedBasicAuthLifecycle) - AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle NamespacedBasicAuthLifecycle) -} - -type namespacedBasicAuthLister struct { - controller *namespacedBasicAuthController -} - -func (l *namespacedBasicAuthLister) List(namespace string, selector labels.Selector) (ret []*NamespacedBasicAuth, err error) { - err = cache.ListAllByNamespace(l.controller.Informer().GetIndexer(), namespace, selector, func(obj interface{}) { - ret = append(ret, obj.(*NamespacedBasicAuth)) - }) - return -} - -func (l *namespacedBasicAuthLister) Get(namespace, name string) (*NamespacedBasicAuth, error) { - var key string - if namespace != "" { - key = namespace + "/" + name - } else { - key = name - } - obj, exists, err := l.controller.Informer().GetIndexer().GetByKey(key) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(schema.GroupResource{ - Group: NamespacedBasicAuthGroupVersionKind.Group, - Resource: NamespacedBasicAuthGroupVersionResource.Resource, - }, key) - } - return obj.(*NamespacedBasicAuth), nil -} - -type namespacedBasicAuthController struct { - controller.GenericController -} - -func (c *namespacedBasicAuthController) Generic() controller.GenericController { - return c.GenericController -} - -func (c *namespacedBasicAuthController) Lister() NamespacedBasicAuthLister { - return &namespacedBasicAuthLister{ - controller: c, - } -} - -func (c *namespacedBasicAuthController) AddHandler(ctx context.Context, name string, handler NamespacedBasicAuthHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*NamespacedBasicAuth); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *namespacedBasicAuthController) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, handler NamespacedBasicAuthHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*NamespacedBasicAuth); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *namespacedBasicAuthController) AddClusterScopedHandler(ctx context.Context, name, cluster string, handler NamespacedBasicAuthHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*NamespacedBasicAuth); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *namespacedBasicAuthController) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, cluster string, handler NamespacedBasicAuthHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*NamespacedBasicAuth); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -type namespacedBasicAuthFactory struct { -} - -func (c namespacedBasicAuthFactory) Object() runtime.Object { - return &NamespacedBasicAuth{} -} - -func (c namespacedBasicAuthFactory) List() runtime.Object { - return &NamespacedBasicAuthList{} -} - -func (s *namespacedBasicAuthClient) Controller() NamespacedBasicAuthController { - genericController := controller.NewGenericController(NamespacedBasicAuthGroupVersionKind.Kind+"Controller", - s.client.controllerFactory.ForResourceKind(NamespacedBasicAuthGroupVersionResource, NamespacedBasicAuthGroupVersionKind.Kind, true)) - - return &namespacedBasicAuthController{ - GenericController: genericController, - } -} - -type namespacedBasicAuthClient struct { - client *Client - ns string - objectClient *objectclient.ObjectClient - controller NamespacedBasicAuthController -} - -func (s *namespacedBasicAuthClient) ObjectClient() *objectclient.ObjectClient { - return s.objectClient -} - -func (s *namespacedBasicAuthClient) Create(o *NamespacedBasicAuth) (*NamespacedBasicAuth, error) { - obj, err := s.objectClient.Create(o) - return obj.(*NamespacedBasicAuth), err -} - -func (s *namespacedBasicAuthClient) Get(name string, opts metav1.GetOptions) (*NamespacedBasicAuth, error) { - obj, err := s.objectClient.Get(name, opts) - return obj.(*NamespacedBasicAuth), err -} - -func (s *namespacedBasicAuthClient) GetNamespaced(namespace, name string, opts metav1.GetOptions) (*NamespacedBasicAuth, error) { - obj, err := s.objectClient.GetNamespaced(namespace, name, opts) - return obj.(*NamespacedBasicAuth), err -} - -func (s *namespacedBasicAuthClient) Update(o *NamespacedBasicAuth) (*NamespacedBasicAuth, error) { - obj, err := s.objectClient.Update(o.Name, o) - return obj.(*NamespacedBasicAuth), err -} - -func (s *namespacedBasicAuthClient) UpdateStatus(o *NamespacedBasicAuth) (*NamespacedBasicAuth, error) { - obj, err := s.objectClient.UpdateStatus(o.Name, o) - return obj.(*NamespacedBasicAuth), err -} - -func (s *namespacedBasicAuthClient) Delete(name string, options *metav1.DeleteOptions) error { - return s.objectClient.Delete(name, options) -} - -func (s *namespacedBasicAuthClient) DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error { - return s.objectClient.DeleteNamespaced(namespace, name, options) -} - -func (s *namespacedBasicAuthClient) List(opts metav1.ListOptions) (*NamespacedBasicAuthList, error) { - obj, err := s.objectClient.List(opts) - return obj.(*NamespacedBasicAuthList), err -} - -func (s *namespacedBasicAuthClient) ListNamespaced(namespace string, opts metav1.ListOptions) (*NamespacedBasicAuthList, error) { - obj, err := s.objectClient.ListNamespaced(namespace, opts) - return obj.(*NamespacedBasicAuthList), err -} - -func (s *namespacedBasicAuthClient) Watch(opts metav1.ListOptions) (watch.Interface, error) { - return s.objectClient.Watch(opts) -} - -// Patch applies the patch and returns the patched deployment. -func (s *namespacedBasicAuthClient) Patch(o *NamespacedBasicAuth, patchType types.PatchType, data []byte, subresources ...string) (*NamespacedBasicAuth, error) { - obj, err := s.objectClient.Patch(o.Name, o, patchType, data, subresources...) - return obj.(*NamespacedBasicAuth), err -} - -func (s *namespacedBasicAuthClient) DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error { - return s.objectClient.DeleteCollection(deleteOpts, listOpts) -} - -func (s *namespacedBasicAuthClient) AddHandler(ctx context.Context, name string, sync NamespacedBasicAuthHandlerFunc) { - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *namespacedBasicAuthClient) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync NamespacedBasicAuthHandlerFunc) { - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *namespacedBasicAuthClient) AddLifecycle(ctx context.Context, name string, lifecycle NamespacedBasicAuthLifecycle) { - sync := NewNamespacedBasicAuthLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *namespacedBasicAuthClient) AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle NamespacedBasicAuthLifecycle) { - sync := NewNamespacedBasicAuthLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *namespacedBasicAuthClient) AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync NamespacedBasicAuthHandlerFunc) { - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *namespacedBasicAuthClient) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync NamespacedBasicAuthHandlerFunc) { - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} - -func (s *namespacedBasicAuthClient) AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle NamespacedBasicAuthLifecycle) { - sync := NewNamespacedBasicAuthLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *namespacedBasicAuthClient) AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle NamespacedBasicAuthLifecycle) { - sync := NewNamespacedBasicAuthLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} diff --git a/vendor/github.com/rancher/types/apis/project.cattle.io/v3/zz_generated_namespaced_basic_auth_lifecycle_adapter.go b/vendor/github.com/rancher/types/apis/project.cattle.io/v3/zz_generated_namespaced_basic_auth_lifecycle_adapter.go deleted file mode 100644 index 56346ecc..00000000 --- a/vendor/github.com/rancher/types/apis/project.cattle.io/v3/zz_generated_namespaced_basic_auth_lifecycle_adapter.go +++ /dev/null @@ -1,66 +0,0 @@ -package v3 - -import ( - "github.com/rancher/norman/lifecycle" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/runtime" -) - -type NamespacedBasicAuthLifecycle interface { - Create(obj *NamespacedBasicAuth) (runtime.Object, error) - Remove(obj *NamespacedBasicAuth) (runtime.Object, error) - Updated(obj *NamespacedBasicAuth) (runtime.Object, error) -} - -type namespacedBasicAuthLifecycleAdapter struct { - lifecycle NamespacedBasicAuthLifecycle -} - -func (w *namespacedBasicAuthLifecycleAdapter) HasCreate() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasCreate() -} - -func (w *namespacedBasicAuthLifecycleAdapter) HasFinalize() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasFinalize() -} - -func (w *namespacedBasicAuthLifecycleAdapter) Create(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Create(obj.(*NamespacedBasicAuth)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *namespacedBasicAuthLifecycleAdapter) Finalize(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Remove(obj.(*NamespacedBasicAuth)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *namespacedBasicAuthLifecycleAdapter) Updated(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Updated(obj.(*NamespacedBasicAuth)) - if o == nil { - return nil, err - } - return o, err -} - -func NewNamespacedBasicAuthLifecycleAdapter(name string, clusterScoped bool, client NamespacedBasicAuthInterface, l NamespacedBasicAuthLifecycle) NamespacedBasicAuthHandlerFunc { - if clusterScoped { - resource.PutClusterScoped(NamespacedBasicAuthGroupVersionResource) - } - adapter := &namespacedBasicAuthLifecycleAdapter{lifecycle: l} - syncFn := lifecycle.NewObjectLifecycleAdapter(name, clusterScoped, adapter, client.ObjectClient()) - return func(key string, obj *NamespacedBasicAuth) (runtime.Object, error) { - newObj, err := syncFn(key, obj) - if o, ok := newObj.(runtime.Object); ok { - return o, err - } - return nil, err - } -} diff --git a/vendor/github.com/rancher/types/apis/project.cattle.io/v3/zz_generated_namespaced_certificate_controller.go b/vendor/github.com/rancher/types/apis/project.cattle.io/v3/zz_generated_namespaced_certificate_controller.go deleted file mode 100644 index ee3eb4e4..00000000 --- a/vendor/github.com/rancher/types/apis/project.cattle.io/v3/zz_generated_namespaced_certificate_controller.go +++ /dev/null @@ -1,321 +0,0 @@ -package v3 - -import ( - "context" - "time" - - "github.com/rancher/norman/controller" - "github.com/rancher/norman/objectclient" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/apimachinery/pkg/types" - "k8s.io/apimachinery/pkg/watch" - "k8s.io/client-go/tools/cache" -) - -var ( - NamespacedCertificateGroupVersionKind = schema.GroupVersionKind{ - Version: Version, - Group: GroupName, - Kind: "NamespacedCertificate", - } - NamespacedCertificateResource = metav1.APIResource{ - Name: "namespacedcertificates", - SingularName: "namespacedcertificate", - Namespaced: true, - - Kind: NamespacedCertificateGroupVersionKind.Kind, - } - - NamespacedCertificateGroupVersionResource = schema.GroupVersionResource{ - Group: GroupName, - Version: Version, - Resource: "namespacedcertificates", - } -) - -func init() { - resource.Put(NamespacedCertificateGroupVersionResource) -} - -func NewNamespacedCertificate(namespace, name string, obj NamespacedCertificate) *NamespacedCertificate { - obj.APIVersion, obj.Kind = NamespacedCertificateGroupVersionKind.ToAPIVersionAndKind() - obj.Name = name - obj.Namespace = namespace - return &obj -} - -type NamespacedCertificateList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []NamespacedCertificate `json:"items"` -} - -type NamespacedCertificateHandlerFunc func(key string, obj *NamespacedCertificate) (runtime.Object, error) - -type NamespacedCertificateChangeHandlerFunc func(obj *NamespacedCertificate) (runtime.Object, error) - -type NamespacedCertificateLister interface { - List(namespace string, selector labels.Selector) (ret []*NamespacedCertificate, err error) - Get(namespace, name string) (*NamespacedCertificate, error) -} - -type NamespacedCertificateController interface { - Generic() controller.GenericController - Informer() cache.SharedIndexInformer - Lister() NamespacedCertificateLister - AddHandler(ctx context.Context, name string, handler NamespacedCertificateHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync NamespacedCertificateHandlerFunc) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, handler NamespacedCertificateHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, handler NamespacedCertificateHandlerFunc) - Enqueue(namespace, name string) - EnqueueAfter(namespace, name string, after time.Duration) -} - -type NamespacedCertificateInterface interface { - ObjectClient() *objectclient.ObjectClient - Create(*NamespacedCertificate) (*NamespacedCertificate, error) - GetNamespaced(namespace, name string, opts metav1.GetOptions) (*NamespacedCertificate, error) - Get(name string, opts metav1.GetOptions) (*NamespacedCertificate, error) - Update(*NamespacedCertificate) (*NamespacedCertificate, error) - Delete(name string, options *metav1.DeleteOptions) error - DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error - List(opts metav1.ListOptions) (*NamespacedCertificateList, error) - ListNamespaced(namespace string, opts metav1.ListOptions) (*NamespacedCertificateList, error) - Watch(opts metav1.ListOptions) (watch.Interface, error) - DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error - Controller() NamespacedCertificateController - AddHandler(ctx context.Context, name string, sync NamespacedCertificateHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync NamespacedCertificateHandlerFunc) - AddLifecycle(ctx context.Context, name string, lifecycle NamespacedCertificateLifecycle) - AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle NamespacedCertificateLifecycle) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync NamespacedCertificateHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync NamespacedCertificateHandlerFunc) - AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle NamespacedCertificateLifecycle) - AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle NamespacedCertificateLifecycle) -} - -type namespacedCertificateLister struct { - controller *namespacedCertificateController -} - -func (l *namespacedCertificateLister) List(namespace string, selector labels.Selector) (ret []*NamespacedCertificate, err error) { - err = cache.ListAllByNamespace(l.controller.Informer().GetIndexer(), namespace, selector, func(obj interface{}) { - ret = append(ret, obj.(*NamespacedCertificate)) - }) - return -} - -func (l *namespacedCertificateLister) Get(namespace, name string) (*NamespacedCertificate, error) { - var key string - if namespace != "" { - key = namespace + "/" + name - } else { - key = name - } - obj, exists, err := l.controller.Informer().GetIndexer().GetByKey(key) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(schema.GroupResource{ - Group: NamespacedCertificateGroupVersionKind.Group, - Resource: NamespacedCertificateGroupVersionResource.Resource, - }, key) - } - return obj.(*NamespacedCertificate), nil -} - -type namespacedCertificateController struct { - controller.GenericController -} - -func (c *namespacedCertificateController) Generic() controller.GenericController { - return c.GenericController -} - -func (c *namespacedCertificateController) Lister() NamespacedCertificateLister { - return &namespacedCertificateLister{ - controller: c, - } -} - -func (c *namespacedCertificateController) AddHandler(ctx context.Context, name string, handler NamespacedCertificateHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*NamespacedCertificate); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *namespacedCertificateController) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, handler NamespacedCertificateHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*NamespacedCertificate); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *namespacedCertificateController) AddClusterScopedHandler(ctx context.Context, name, cluster string, handler NamespacedCertificateHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*NamespacedCertificate); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *namespacedCertificateController) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, cluster string, handler NamespacedCertificateHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*NamespacedCertificate); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -type namespacedCertificateFactory struct { -} - -func (c namespacedCertificateFactory) Object() runtime.Object { - return &NamespacedCertificate{} -} - -func (c namespacedCertificateFactory) List() runtime.Object { - return &NamespacedCertificateList{} -} - -func (s *namespacedCertificateClient) Controller() NamespacedCertificateController { - genericController := controller.NewGenericController(NamespacedCertificateGroupVersionKind.Kind+"Controller", - s.client.controllerFactory.ForResourceKind(NamespacedCertificateGroupVersionResource, NamespacedCertificateGroupVersionKind.Kind, true)) - - return &namespacedCertificateController{ - GenericController: genericController, - } -} - -type namespacedCertificateClient struct { - client *Client - ns string - objectClient *objectclient.ObjectClient - controller NamespacedCertificateController -} - -func (s *namespacedCertificateClient) ObjectClient() *objectclient.ObjectClient { - return s.objectClient -} - -func (s *namespacedCertificateClient) Create(o *NamespacedCertificate) (*NamespacedCertificate, error) { - obj, err := s.objectClient.Create(o) - return obj.(*NamespacedCertificate), err -} - -func (s *namespacedCertificateClient) Get(name string, opts metav1.GetOptions) (*NamespacedCertificate, error) { - obj, err := s.objectClient.Get(name, opts) - return obj.(*NamespacedCertificate), err -} - -func (s *namespacedCertificateClient) GetNamespaced(namespace, name string, opts metav1.GetOptions) (*NamespacedCertificate, error) { - obj, err := s.objectClient.GetNamespaced(namespace, name, opts) - return obj.(*NamespacedCertificate), err -} - -func (s *namespacedCertificateClient) Update(o *NamespacedCertificate) (*NamespacedCertificate, error) { - obj, err := s.objectClient.Update(o.Name, o) - return obj.(*NamespacedCertificate), err -} - -func (s *namespacedCertificateClient) UpdateStatus(o *NamespacedCertificate) (*NamespacedCertificate, error) { - obj, err := s.objectClient.UpdateStatus(o.Name, o) - return obj.(*NamespacedCertificate), err -} - -func (s *namespacedCertificateClient) Delete(name string, options *metav1.DeleteOptions) error { - return s.objectClient.Delete(name, options) -} - -func (s *namespacedCertificateClient) DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error { - return s.objectClient.DeleteNamespaced(namespace, name, options) -} - -func (s *namespacedCertificateClient) List(opts metav1.ListOptions) (*NamespacedCertificateList, error) { - obj, err := s.objectClient.List(opts) - return obj.(*NamespacedCertificateList), err -} - -func (s *namespacedCertificateClient) ListNamespaced(namespace string, opts metav1.ListOptions) (*NamespacedCertificateList, error) { - obj, err := s.objectClient.ListNamespaced(namespace, opts) - return obj.(*NamespacedCertificateList), err -} - -func (s *namespacedCertificateClient) Watch(opts metav1.ListOptions) (watch.Interface, error) { - return s.objectClient.Watch(opts) -} - -// Patch applies the patch and returns the patched deployment. -func (s *namespacedCertificateClient) Patch(o *NamespacedCertificate, patchType types.PatchType, data []byte, subresources ...string) (*NamespacedCertificate, error) { - obj, err := s.objectClient.Patch(o.Name, o, patchType, data, subresources...) - return obj.(*NamespacedCertificate), err -} - -func (s *namespacedCertificateClient) DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error { - return s.objectClient.DeleteCollection(deleteOpts, listOpts) -} - -func (s *namespacedCertificateClient) AddHandler(ctx context.Context, name string, sync NamespacedCertificateHandlerFunc) { - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *namespacedCertificateClient) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync NamespacedCertificateHandlerFunc) { - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *namespacedCertificateClient) AddLifecycle(ctx context.Context, name string, lifecycle NamespacedCertificateLifecycle) { - sync := NewNamespacedCertificateLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *namespacedCertificateClient) AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle NamespacedCertificateLifecycle) { - sync := NewNamespacedCertificateLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *namespacedCertificateClient) AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync NamespacedCertificateHandlerFunc) { - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *namespacedCertificateClient) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync NamespacedCertificateHandlerFunc) { - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} - -func (s *namespacedCertificateClient) AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle NamespacedCertificateLifecycle) { - sync := NewNamespacedCertificateLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *namespacedCertificateClient) AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle NamespacedCertificateLifecycle) { - sync := NewNamespacedCertificateLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} diff --git a/vendor/github.com/rancher/types/apis/project.cattle.io/v3/zz_generated_namespaced_certificate_lifecycle_adapter.go b/vendor/github.com/rancher/types/apis/project.cattle.io/v3/zz_generated_namespaced_certificate_lifecycle_adapter.go deleted file mode 100644 index bc23859d..00000000 --- a/vendor/github.com/rancher/types/apis/project.cattle.io/v3/zz_generated_namespaced_certificate_lifecycle_adapter.go +++ /dev/null @@ -1,66 +0,0 @@ -package v3 - -import ( - "github.com/rancher/norman/lifecycle" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/runtime" -) - -type NamespacedCertificateLifecycle interface { - Create(obj *NamespacedCertificate) (runtime.Object, error) - Remove(obj *NamespacedCertificate) (runtime.Object, error) - Updated(obj *NamespacedCertificate) (runtime.Object, error) -} - -type namespacedCertificateLifecycleAdapter struct { - lifecycle NamespacedCertificateLifecycle -} - -func (w *namespacedCertificateLifecycleAdapter) HasCreate() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasCreate() -} - -func (w *namespacedCertificateLifecycleAdapter) HasFinalize() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasFinalize() -} - -func (w *namespacedCertificateLifecycleAdapter) Create(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Create(obj.(*NamespacedCertificate)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *namespacedCertificateLifecycleAdapter) Finalize(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Remove(obj.(*NamespacedCertificate)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *namespacedCertificateLifecycleAdapter) Updated(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Updated(obj.(*NamespacedCertificate)) - if o == nil { - return nil, err - } - return o, err -} - -func NewNamespacedCertificateLifecycleAdapter(name string, clusterScoped bool, client NamespacedCertificateInterface, l NamespacedCertificateLifecycle) NamespacedCertificateHandlerFunc { - if clusterScoped { - resource.PutClusterScoped(NamespacedCertificateGroupVersionResource) - } - adapter := &namespacedCertificateLifecycleAdapter{lifecycle: l} - syncFn := lifecycle.NewObjectLifecycleAdapter(name, clusterScoped, adapter, client.ObjectClient()) - return func(key string, obj *NamespacedCertificate) (runtime.Object, error) { - newObj, err := syncFn(key, obj) - if o, ok := newObj.(runtime.Object); ok { - return o, err - } - return nil, err - } -} diff --git a/vendor/github.com/rancher/types/apis/project.cattle.io/v3/zz_generated_namespaced_docker_credential_controller.go b/vendor/github.com/rancher/types/apis/project.cattle.io/v3/zz_generated_namespaced_docker_credential_controller.go deleted file mode 100644 index 838c4e2f..00000000 --- a/vendor/github.com/rancher/types/apis/project.cattle.io/v3/zz_generated_namespaced_docker_credential_controller.go +++ /dev/null @@ -1,321 +0,0 @@ -package v3 - -import ( - "context" - "time" - - "github.com/rancher/norman/controller" - "github.com/rancher/norman/objectclient" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/apimachinery/pkg/types" - "k8s.io/apimachinery/pkg/watch" - "k8s.io/client-go/tools/cache" -) - -var ( - NamespacedDockerCredentialGroupVersionKind = schema.GroupVersionKind{ - Version: Version, - Group: GroupName, - Kind: "NamespacedDockerCredential", - } - NamespacedDockerCredentialResource = metav1.APIResource{ - Name: "namespaceddockercredentials", - SingularName: "namespaceddockercredential", - Namespaced: true, - - Kind: NamespacedDockerCredentialGroupVersionKind.Kind, - } - - NamespacedDockerCredentialGroupVersionResource = schema.GroupVersionResource{ - Group: GroupName, - Version: Version, - Resource: "namespaceddockercredentials", - } -) - -func init() { - resource.Put(NamespacedDockerCredentialGroupVersionResource) -} - -func NewNamespacedDockerCredential(namespace, name string, obj NamespacedDockerCredential) *NamespacedDockerCredential { - obj.APIVersion, obj.Kind = NamespacedDockerCredentialGroupVersionKind.ToAPIVersionAndKind() - obj.Name = name - obj.Namespace = namespace - return &obj -} - -type NamespacedDockerCredentialList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []NamespacedDockerCredential `json:"items"` -} - -type NamespacedDockerCredentialHandlerFunc func(key string, obj *NamespacedDockerCredential) (runtime.Object, error) - -type NamespacedDockerCredentialChangeHandlerFunc func(obj *NamespacedDockerCredential) (runtime.Object, error) - -type NamespacedDockerCredentialLister interface { - List(namespace string, selector labels.Selector) (ret []*NamespacedDockerCredential, err error) - Get(namespace, name string) (*NamespacedDockerCredential, error) -} - -type NamespacedDockerCredentialController interface { - Generic() controller.GenericController - Informer() cache.SharedIndexInformer - Lister() NamespacedDockerCredentialLister - AddHandler(ctx context.Context, name string, handler NamespacedDockerCredentialHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync NamespacedDockerCredentialHandlerFunc) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, handler NamespacedDockerCredentialHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, handler NamespacedDockerCredentialHandlerFunc) - Enqueue(namespace, name string) - EnqueueAfter(namespace, name string, after time.Duration) -} - -type NamespacedDockerCredentialInterface interface { - ObjectClient() *objectclient.ObjectClient - Create(*NamespacedDockerCredential) (*NamespacedDockerCredential, error) - GetNamespaced(namespace, name string, opts metav1.GetOptions) (*NamespacedDockerCredential, error) - Get(name string, opts metav1.GetOptions) (*NamespacedDockerCredential, error) - Update(*NamespacedDockerCredential) (*NamespacedDockerCredential, error) - Delete(name string, options *metav1.DeleteOptions) error - DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error - List(opts metav1.ListOptions) (*NamespacedDockerCredentialList, error) - ListNamespaced(namespace string, opts metav1.ListOptions) (*NamespacedDockerCredentialList, error) - Watch(opts metav1.ListOptions) (watch.Interface, error) - DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error - Controller() NamespacedDockerCredentialController - AddHandler(ctx context.Context, name string, sync NamespacedDockerCredentialHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync NamespacedDockerCredentialHandlerFunc) - AddLifecycle(ctx context.Context, name string, lifecycle NamespacedDockerCredentialLifecycle) - AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle NamespacedDockerCredentialLifecycle) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync NamespacedDockerCredentialHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync NamespacedDockerCredentialHandlerFunc) - AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle NamespacedDockerCredentialLifecycle) - AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle NamespacedDockerCredentialLifecycle) -} - -type namespacedDockerCredentialLister struct { - controller *namespacedDockerCredentialController -} - -func (l *namespacedDockerCredentialLister) List(namespace string, selector labels.Selector) (ret []*NamespacedDockerCredential, err error) { - err = cache.ListAllByNamespace(l.controller.Informer().GetIndexer(), namespace, selector, func(obj interface{}) { - ret = append(ret, obj.(*NamespacedDockerCredential)) - }) - return -} - -func (l *namespacedDockerCredentialLister) Get(namespace, name string) (*NamespacedDockerCredential, error) { - var key string - if namespace != "" { - key = namespace + "/" + name - } else { - key = name - } - obj, exists, err := l.controller.Informer().GetIndexer().GetByKey(key) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(schema.GroupResource{ - Group: NamespacedDockerCredentialGroupVersionKind.Group, - Resource: NamespacedDockerCredentialGroupVersionResource.Resource, - }, key) - } - return obj.(*NamespacedDockerCredential), nil -} - -type namespacedDockerCredentialController struct { - controller.GenericController -} - -func (c *namespacedDockerCredentialController) Generic() controller.GenericController { - return c.GenericController -} - -func (c *namespacedDockerCredentialController) Lister() NamespacedDockerCredentialLister { - return &namespacedDockerCredentialLister{ - controller: c, - } -} - -func (c *namespacedDockerCredentialController) AddHandler(ctx context.Context, name string, handler NamespacedDockerCredentialHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*NamespacedDockerCredential); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *namespacedDockerCredentialController) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, handler NamespacedDockerCredentialHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*NamespacedDockerCredential); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *namespacedDockerCredentialController) AddClusterScopedHandler(ctx context.Context, name, cluster string, handler NamespacedDockerCredentialHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*NamespacedDockerCredential); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *namespacedDockerCredentialController) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, cluster string, handler NamespacedDockerCredentialHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*NamespacedDockerCredential); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -type namespacedDockerCredentialFactory struct { -} - -func (c namespacedDockerCredentialFactory) Object() runtime.Object { - return &NamespacedDockerCredential{} -} - -func (c namespacedDockerCredentialFactory) List() runtime.Object { - return &NamespacedDockerCredentialList{} -} - -func (s *namespacedDockerCredentialClient) Controller() NamespacedDockerCredentialController { - genericController := controller.NewGenericController(NamespacedDockerCredentialGroupVersionKind.Kind+"Controller", - s.client.controllerFactory.ForResourceKind(NamespacedDockerCredentialGroupVersionResource, NamespacedDockerCredentialGroupVersionKind.Kind, true)) - - return &namespacedDockerCredentialController{ - GenericController: genericController, - } -} - -type namespacedDockerCredentialClient struct { - client *Client - ns string - objectClient *objectclient.ObjectClient - controller NamespacedDockerCredentialController -} - -func (s *namespacedDockerCredentialClient) ObjectClient() *objectclient.ObjectClient { - return s.objectClient -} - -func (s *namespacedDockerCredentialClient) Create(o *NamespacedDockerCredential) (*NamespacedDockerCredential, error) { - obj, err := s.objectClient.Create(o) - return obj.(*NamespacedDockerCredential), err -} - -func (s *namespacedDockerCredentialClient) Get(name string, opts metav1.GetOptions) (*NamespacedDockerCredential, error) { - obj, err := s.objectClient.Get(name, opts) - return obj.(*NamespacedDockerCredential), err -} - -func (s *namespacedDockerCredentialClient) GetNamespaced(namespace, name string, opts metav1.GetOptions) (*NamespacedDockerCredential, error) { - obj, err := s.objectClient.GetNamespaced(namespace, name, opts) - return obj.(*NamespacedDockerCredential), err -} - -func (s *namespacedDockerCredentialClient) Update(o *NamespacedDockerCredential) (*NamespacedDockerCredential, error) { - obj, err := s.objectClient.Update(o.Name, o) - return obj.(*NamespacedDockerCredential), err -} - -func (s *namespacedDockerCredentialClient) UpdateStatus(o *NamespacedDockerCredential) (*NamespacedDockerCredential, error) { - obj, err := s.objectClient.UpdateStatus(o.Name, o) - return obj.(*NamespacedDockerCredential), err -} - -func (s *namespacedDockerCredentialClient) Delete(name string, options *metav1.DeleteOptions) error { - return s.objectClient.Delete(name, options) -} - -func (s *namespacedDockerCredentialClient) DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error { - return s.objectClient.DeleteNamespaced(namespace, name, options) -} - -func (s *namespacedDockerCredentialClient) List(opts metav1.ListOptions) (*NamespacedDockerCredentialList, error) { - obj, err := s.objectClient.List(opts) - return obj.(*NamespacedDockerCredentialList), err -} - -func (s *namespacedDockerCredentialClient) ListNamespaced(namespace string, opts metav1.ListOptions) (*NamespacedDockerCredentialList, error) { - obj, err := s.objectClient.ListNamespaced(namespace, opts) - return obj.(*NamespacedDockerCredentialList), err -} - -func (s *namespacedDockerCredentialClient) Watch(opts metav1.ListOptions) (watch.Interface, error) { - return s.objectClient.Watch(opts) -} - -// Patch applies the patch and returns the patched deployment. -func (s *namespacedDockerCredentialClient) Patch(o *NamespacedDockerCredential, patchType types.PatchType, data []byte, subresources ...string) (*NamespacedDockerCredential, error) { - obj, err := s.objectClient.Patch(o.Name, o, patchType, data, subresources...) - return obj.(*NamespacedDockerCredential), err -} - -func (s *namespacedDockerCredentialClient) DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error { - return s.objectClient.DeleteCollection(deleteOpts, listOpts) -} - -func (s *namespacedDockerCredentialClient) AddHandler(ctx context.Context, name string, sync NamespacedDockerCredentialHandlerFunc) { - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *namespacedDockerCredentialClient) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync NamespacedDockerCredentialHandlerFunc) { - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *namespacedDockerCredentialClient) AddLifecycle(ctx context.Context, name string, lifecycle NamespacedDockerCredentialLifecycle) { - sync := NewNamespacedDockerCredentialLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *namespacedDockerCredentialClient) AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle NamespacedDockerCredentialLifecycle) { - sync := NewNamespacedDockerCredentialLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *namespacedDockerCredentialClient) AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync NamespacedDockerCredentialHandlerFunc) { - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *namespacedDockerCredentialClient) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync NamespacedDockerCredentialHandlerFunc) { - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} - -func (s *namespacedDockerCredentialClient) AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle NamespacedDockerCredentialLifecycle) { - sync := NewNamespacedDockerCredentialLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *namespacedDockerCredentialClient) AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle NamespacedDockerCredentialLifecycle) { - sync := NewNamespacedDockerCredentialLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} diff --git a/vendor/github.com/rancher/types/apis/project.cattle.io/v3/zz_generated_namespaced_docker_credential_lifecycle_adapter.go b/vendor/github.com/rancher/types/apis/project.cattle.io/v3/zz_generated_namespaced_docker_credential_lifecycle_adapter.go deleted file mode 100644 index 2a8e7d19..00000000 --- a/vendor/github.com/rancher/types/apis/project.cattle.io/v3/zz_generated_namespaced_docker_credential_lifecycle_adapter.go +++ /dev/null @@ -1,66 +0,0 @@ -package v3 - -import ( - "github.com/rancher/norman/lifecycle" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/runtime" -) - -type NamespacedDockerCredentialLifecycle interface { - Create(obj *NamespacedDockerCredential) (runtime.Object, error) - Remove(obj *NamespacedDockerCredential) (runtime.Object, error) - Updated(obj *NamespacedDockerCredential) (runtime.Object, error) -} - -type namespacedDockerCredentialLifecycleAdapter struct { - lifecycle NamespacedDockerCredentialLifecycle -} - -func (w *namespacedDockerCredentialLifecycleAdapter) HasCreate() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasCreate() -} - -func (w *namespacedDockerCredentialLifecycleAdapter) HasFinalize() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasFinalize() -} - -func (w *namespacedDockerCredentialLifecycleAdapter) Create(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Create(obj.(*NamespacedDockerCredential)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *namespacedDockerCredentialLifecycleAdapter) Finalize(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Remove(obj.(*NamespacedDockerCredential)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *namespacedDockerCredentialLifecycleAdapter) Updated(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Updated(obj.(*NamespacedDockerCredential)) - if o == nil { - return nil, err - } - return o, err -} - -func NewNamespacedDockerCredentialLifecycleAdapter(name string, clusterScoped bool, client NamespacedDockerCredentialInterface, l NamespacedDockerCredentialLifecycle) NamespacedDockerCredentialHandlerFunc { - if clusterScoped { - resource.PutClusterScoped(NamespacedDockerCredentialGroupVersionResource) - } - adapter := &namespacedDockerCredentialLifecycleAdapter{lifecycle: l} - syncFn := lifecycle.NewObjectLifecycleAdapter(name, clusterScoped, adapter, client.ObjectClient()) - return func(key string, obj *NamespacedDockerCredential) (runtime.Object, error) { - newObj, err := syncFn(key, obj) - if o, ok := newObj.(runtime.Object); ok { - return o, err - } - return nil, err - } -} diff --git a/vendor/github.com/rancher/types/apis/project.cattle.io/v3/zz_generated_namespaced_service_account_token_controller.go b/vendor/github.com/rancher/types/apis/project.cattle.io/v3/zz_generated_namespaced_service_account_token_controller.go deleted file mode 100644 index 89430d2c..00000000 --- a/vendor/github.com/rancher/types/apis/project.cattle.io/v3/zz_generated_namespaced_service_account_token_controller.go +++ /dev/null @@ -1,321 +0,0 @@ -package v3 - -import ( - "context" - "time" - - "github.com/rancher/norman/controller" - "github.com/rancher/norman/objectclient" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/apimachinery/pkg/types" - "k8s.io/apimachinery/pkg/watch" - "k8s.io/client-go/tools/cache" -) - -var ( - NamespacedServiceAccountTokenGroupVersionKind = schema.GroupVersionKind{ - Version: Version, - Group: GroupName, - Kind: "NamespacedServiceAccountToken", - } - NamespacedServiceAccountTokenResource = metav1.APIResource{ - Name: "namespacedserviceaccounttokens", - SingularName: "namespacedserviceaccounttoken", - Namespaced: true, - - Kind: NamespacedServiceAccountTokenGroupVersionKind.Kind, - } - - NamespacedServiceAccountTokenGroupVersionResource = schema.GroupVersionResource{ - Group: GroupName, - Version: Version, - Resource: "namespacedserviceaccounttokens", - } -) - -func init() { - resource.Put(NamespacedServiceAccountTokenGroupVersionResource) -} - -func NewNamespacedServiceAccountToken(namespace, name string, obj NamespacedServiceAccountToken) *NamespacedServiceAccountToken { - obj.APIVersion, obj.Kind = NamespacedServiceAccountTokenGroupVersionKind.ToAPIVersionAndKind() - obj.Name = name - obj.Namespace = namespace - return &obj -} - -type NamespacedServiceAccountTokenList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []NamespacedServiceAccountToken `json:"items"` -} - -type NamespacedServiceAccountTokenHandlerFunc func(key string, obj *NamespacedServiceAccountToken) (runtime.Object, error) - -type NamespacedServiceAccountTokenChangeHandlerFunc func(obj *NamespacedServiceAccountToken) (runtime.Object, error) - -type NamespacedServiceAccountTokenLister interface { - List(namespace string, selector labels.Selector) (ret []*NamespacedServiceAccountToken, err error) - Get(namespace, name string) (*NamespacedServiceAccountToken, error) -} - -type NamespacedServiceAccountTokenController interface { - Generic() controller.GenericController - Informer() cache.SharedIndexInformer - Lister() NamespacedServiceAccountTokenLister - AddHandler(ctx context.Context, name string, handler NamespacedServiceAccountTokenHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync NamespacedServiceAccountTokenHandlerFunc) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, handler NamespacedServiceAccountTokenHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, handler NamespacedServiceAccountTokenHandlerFunc) - Enqueue(namespace, name string) - EnqueueAfter(namespace, name string, after time.Duration) -} - -type NamespacedServiceAccountTokenInterface interface { - ObjectClient() *objectclient.ObjectClient - Create(*NamespacedServiceAccountToken) (*NamespacedServiceAccountToken, error) - GetNamespaced(namespace, name string, opts metav1.GetOptions) (*NamespacedServiceAccountToken, error) - Get(name string, opts metav1.GetOptions) (*NamespacedServiceAccountToken, error) - Update(*NamespacedServiceAccountToken) (*NamespacedServiceAccountToken, error) - Delete(name string, options *metav1.DeleteOptions) error - DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error - List(opts metav1.ListOptions) (*NamespacedServiceAccountTokenList, error) - ListNamespaced(namespace string, opts metav1.ListOptions) (*NamespacedServiceAccountTokenList, error) - Watch(opts metav1.ListOptions) (watch.Interface, error) - DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error - Controller() NamespacedServiceAccountTokenController - AddHandler(ctx context.Context, name string, sync NamespacedServiceAccountTokenHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync NamespacedServiceAccountTokenHandlerFunc) - AddLifecycle(ctx context.Context, name string, lifecycle NamespacedServiceAccountTokenLifecycle) - AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle NamespacedServiceAccountTokenLifecycle) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync NamespacedServiceAccountTokenHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync NamespacedServiceAccountTokenHandlerFunc) - AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle NamespacedServiceAccountTokenLifecycle) - AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle NamespacedServiceAccountTokenLifecycle) -} - -type namespacedServiceAccountTokenLister struct { - controller *namespacedServiceAccountTokenController -} - -func (l *namespacedServiceAccountTokenLister) List(namespace string, selector labels.Selector) (ret []*NamespacedServiceAccountToken, err error) { - err = cache.ListAllByNamespace(l.controller.Informer().GetIndexer(), namespace, selector, func(obj interface{}) { - ret = append(ret, obj.(*NamespacedServiceAccountToken)) - }) - return -} - -func (l *namespacedServiceAccountTokenLister) Get(namespace, name string) (*NamespacedServiceAccountToken, error) { - var key string - if namespace != "" { - key = namespace + "/" + name - } else { - key = name - } - obj, exists, err := l.controller.Informer().GetIndexer().GetByKey(key) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(schema.GroupResource{ - Group: NamespacedServiceAccountTokenGroupVersionKind.Group, - Resource: NamespacedServiceAccountTokenGroupVersionResource.Resource, - }, key) - } - return obj.(*NamespacedServiceAccountToken), nil -} - -type namespacedServiceAccountTokenController struct { - controller.GenericController -} - -func (c *namespacedServiceAccountTokenController) Generic() controller.GenericController { - return c.GenericController -} - -func (c *namespacedServiceAccountTokenController) Lister() NamespacedServiceAccountTokenLister { - return &namespacedServiceAccountTokenLister{ - controller: c, - } -} - -func (c *namespacedServiceAccountTokenController) AddHandler(ctx context.Context, name string, handler NamespacedServiceAccountTokenHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*NamespacedServiceAccountToken); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *namespacedServiceAccountTokenController) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, handler NamespacedServiceAccountTokenHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*NamespacedServiceAccountToken); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *namespacedServiceAccountTokenController) AddClusterScopedHandler(ctx context.Context, name, cluster string, handler NamespacedServiceAccountTokenHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*NamespacedServiceAccountToken); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *namespacedServiceAccountTokenController) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, cluster string, handler NamespacedServiceAccountTokenHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*NamespacedServiceAccountToken); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -type namespacedServiceAccountTokenFactory struct { -} - -func (c namespacedServiceAccountTokenFactory) Object() runtime.Object { - return &NamespacedServiceAccountToken{} -} - -func (c namespacedServiceAccountTokenFactory) List() runtime.Object { - return &NamespacedServiceAccountTokenList{} -} - -func (s *namespacedServiceAccountTokenClient) Controller() NamespacedServiceAccountTokenController { - genericController := controller.NewGenericController(NamespacedServiceAccountTokenGroupVersionKind.Kind+"Controller", - s.client.controllerFactory.ForResourceKind(NamespacedServiceAccountTokenGroupVersionResource, NamespacedServiceAccountTokenGroupVersionKind.Kind, true)) - - return &namespacedServiceAccountTokenController{ - GenericController: genericController, - } -} - -type namespacedServiceAccountTokenClient struct { - client *Client - ns string - objectClient *objectclient.ObjectClient - controller NamespacedServiceAccountTokenController -} - -func (s *namespacedServiceAccountTokenClient) ObjectClient() *objectclient.ObjectClient { - return s.objectClient -} - -func (s *namespacedServiceAccountTokenClient) Create(o *NamespacedServiceAccountToken) (*NamespacedServiceAccountToken, error) { - obj, err := s.objectClient.Create(o) - return obj.(*NamespacedServiceAccountToken), err -} - -func (s *namespacedServiceAccountTokenClient) Get(name string, opts metav1.GetOptions) (*NamespacedServiceAccountToken, error) { - obj, err := s.objectClient.Get(name, opts) - return obj.(*NamespacedServiceAccountToken), err -} - -func (s *namespacedServiceAccountTokenClient) GetNamespaced(namespace, name string, opts metav1.GetOptions) (*NamespacedServiceAccountToken, error) { - obj, err := s.objectClient.GetNamespaced(namespace, name, opts) - return obj.(*NamespacedServiceAccountToken), err -} - -func (s *namespacedServiceAccountTokenClient) Update(o *NamespacedServiceAccountToken) (*NamespacedServiceAccountToken, error) { - obj, err := s.objectClient.Update(o.Name, o) - return obj.(*NamespacedServiceAccountToken), err -} - -func (s *namespacedServiceAccountTokenClient) UpdateStatus(o *NamespacedServiceAccountToken) (*NamespacedServiceAccountToken, error) { - obj, err := s.objectClient.UpdateStatus(o.Name, o) - return obj.(*NamespacedServiceAccountToken), err -} - -func (s *namespacedServiceAccountTokenClient) Delete(name string, options *metav1.DeleteOptions) error { - return s.objectClient.Delete(name, options) -} - -func (s *namespacedServiceAccountTokenClient) DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error { - return s.objectClient.DeleteNamespaced(namespace, name, options) -} - -func (s *namespacedServiceAccountTokenClient) List(opts metav1.ListOptions) (*NamespacedServiceAccountTokenList, error) { - obj, err := s.objectClient.List(opts) - return obj.(*NamespacedServiceAccountTokenList), err -} - -func (s *namespacedServiceAccountTokenClient) ListNamespaced(namespace string, opts metav1.ListOptions) (*NamespacedServiceAccountTokenList, error) { - obj, err := s.objectClient.ListNamespaced(namespace, opts) - return obj.(*NamespacedServiceAccountTokenList), err -} - -func (s *namespacedServiceAccountTokenClient) Watch(opts metav1.ListOptions) (watch.Interface, error) { - return s.objectClient.Watch(opts) -} - -// Patch applies the patch and returns the patched deployment. -func (s *namespacedServiceAccountTokenClient) Patch(o *NamespacedServiceAccountToken, patchType types.PatchType, data []byte, subresources ...string) (*NamespacedServiceAccountToken, error) { - obj, err := s.objectClient.Patch(o.Name, o, patchType, data, subresources...) - return obj.(*NamespacedServiceAccountToken), err -} - -func (s *namespacedServiceAccountTokenClient) DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error { - return s.objectClient.DeleteCollection(deleteOpts, listOpts) -} - -func (s *namespacedServiceAccountTokenClient) AddHandler(ctx context.Context, name string, sync NamespacedServiceAccountTokenHandlerFunc) { - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *namespacedServiceAccountTokenClient) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync NamespacedServiceAccountTokenHandlerFunc) { - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *namespacedServiceAccountTokenClient) AddLifecycle(ctx context.Context, name string, lifecycle NamespacedServiceAccountTokenLifecycle) { - sync := NewNamespacedServiceAccountTokenLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *namespacedServiceAccountTokenClient) AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle NamespacedServiceAccountTokenLifecycle) { - sync := NewNamespacedServiceAccountTokenLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *namespacedServiceAccountTokenClient) AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync NamespacedServiceAccountTokenHandlerFunc) { - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *namespacedServiceAccountTokenClient) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync NamespacedServiceAccountTokenHandlerFunc) { - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} - -func (s *namespacedServiceAccountTokenClient) AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle NamespacedServiceAccountTokenLifecycle) { - sync := NewNamespacedServiceAccountTokenLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *namespacedServiceAccountTokenClient) AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle NamespacedServiceAccountTokenLifecycle) { - sync := NewNamespacedServiceAccountTokenLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} diff --git a/vendor/github.com/rancher/types/apis/project.cattle.io/v3/zz_generated_namespaced_service_account_token_lifecycle_adapter.go b/vendor/github.com/rancher/types/apis/project.cattle.io/v3/zz_generated_namespaced_service_account_token_lifecycle_adapter.go deleted file mode 100644 index 932bbae3..00000000 --- a/vendor/github.com/rancher/types/apis/project.cattle.io/v3/zz_generated_namespaced_service_account_token_lifecycle_adapter.go +++ /dev/null @@ -1,66 +0,0 @@ -package v3 - -import ( - "github.com/rancher/norman/lifecycle" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/runtime" -) - -type NamespacedServiceAccountTokenLifecycle interface { - Create(obj *NamespacedServiceAccountToken) (runtime.Object, error) - Remove(obj *NamespacedServiceAccountToken) (runtime.Object, error) - Updated(obj *NamespacedServiceAccountToken) (runtime.Object, error) -} - -type namespacedServiceAccountTokenLifecycleAdapter struct { - lifecycle NamespacedServiceAccountTokenLifecycle -} - -func (w *namespacedServiceAccountTokenLifecycleAdapter) HasCreate() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasCreate() -} - -func (w *namespacedServiceAccountTokenLifecycleAdapter) HasFinalize() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasFinalize() -} - -func (w *namespacedServiceAccountTokenLifecycleAdapter) Create(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Create(obj.(*NamespacedServiceAccountToken)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *namespacedServiceAccountTokenLifecycleAdapter) Finalize(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Remove(obj.(*NamespacedServiceAccountToken)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *namespacedServiceAccountTokenLifecycleAdapter) Updated(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Updated(obj.(*NamespacedServiceAccountToken)) - if o == nil { - return nil, err - } - return o, err -} - -func NewNamespacedServiceAccountTokenLifecycleAdapter(name string, clusterScoped bool, client NamespacedServiceAccountTokenInterface, l NamespacedServiceAccountTokenLifecycle) NamespacedServiceAccountTokenHandlerFunc { - if clusterScoped { - resource.PutClusterScoped(NamespacedServiceAccountTokenGroupVersionResource) - } - adapter := &namespacedServiceAccountTokenLifecycleAdapter{lifecycle: l} - syncFn := lifecycle.NewObjectLifecycleAdapter(name, clusterScoped, adapter, client.ObjectClient()) - return func(key string, obj *NamespacedServiceAccountToken) (runtime.Object, error) { - newObj, err := syncFn(key, obj) - if o, ok := newObj.(runtime.Object); ok { - return o, err - } - return nil, err - } -} diff --git a/vendor/github.com/rancher/types/apis/project.cattle.io/v3/zz_generated_namespaced_ssh_auth_controller.go b/vendor/github.com/rancher/types/apis/project.cattle.io/v3/zz_generated_namespaced_ssh_auth_controller.go deleted file mode 100644 index 7b93f8df..00000000 --- a/vendor/github.com/rancher/types/apis/project.cattle.io/v3/zz_generated_namespaced_ssh_auth_controller.go +++ /dev/null @@ -1,321 +0,0 @@ -package v3 - -import ( - "context" - "time" - - "github.com/rancher/norman/controller" - "github.com/rancher/norman/objectclient" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/apimachinery/pkg/types" - "k8s.io/apimachinery/pkg/watch" - "k8s.io/client-go/tools/cache" -) - -var ( - NamespacedSSHAuthGroupVersionKind = schema.GroupVersionKind{ - Version: Version, - Group: GroupName, - Kind: "NamespacedSSHAuth", - } - NamespacedSSHAuthResource = metav1.APIResource{ - Name: "namespacedsshauths", - SingularName: "namespacedsshauth", - Namespaced: true, - - Kind: NamespacedSSHAuthGroupVersionKind.Kind, - } - - NamespacedSSHAuthGroupVersionResource = schema.GroupVersionResource{ - Group: GroupName, - Version: Version, - Resource: "namespacedsshauths", - } -) - -func init() { - resource.Put(NamespacedSSHAuthGroupVersionResource) -} - -func NewNamespacedSSHAuth(namespace, name string, obj NamespacedSSHAuth) *NamespacedSSHAuth { - obj.APIVersion, obj.Kind = NamespacedSSHAuthGroupVersionKind.ToAPIVersionAndKind() - obj.Name = name - obj.Namespace = namespace - return &obj -} - -type NamespacedSSHAuthList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []NamespacedSSHAuth `json:"items"` -} - -type NamespacedSSHAuthHandlerFunc func(key string, obj *NamespacedSSHAuth) (runtime.Object, error) - -type NamespacedSSHAuthChangeHandlerFunc func(obj *NamespacedSSHAuth) (runtime.Object, error) - -type NamespacedSSHAuthLister interface { - List(namespace string, selector labels.Selector) (ret []*NamespacedSSHAuth, err error) - Get(namespace, name string) (*NamespacedSSHAuth, error) -} - -type NamespacedSSHAuthController interface { - Generic() controller.GenericController - Informer() cache.SharedIndexInformer - Lister() NamespacedSSHAuthLister - AddHandler(ctx context.Context, name string, handler NamespacedSSHAuthHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync NamespacedSSHAuthHandlerFunc) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, handler NamespacedSSHAuthHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, handler NamespacedSSHAuthHandlerFunc) - Enqueue(namespace, name string) - EnqueueAfter(namespace, name string, after time.Duration) -} - -type NamespacedSSHAuthInterface interface { - ObjectClient() *objectclient.ObjectClient - Create(*NamespacedSSHAuth) (*NamespacedSSHAuth, error) - GetNamespaced(namespace, name string, opts metav1.GetOptions) (*NamespacedSSHAuth, error) - Get(name string, opts metav1.GetOptions) (*NamespacedSSHAuth, error) - Update(*NamespacedSSHAuth) (*NamespacedSSHAuth, error) - Delete(name string, options *metav1.DeleteOptions) error - DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error - List(opts metav1.ListOptions) (*NamespacedSSHAuthList, error) - ListNamespaced(namespace string, opts metav1.ListOptions) (*NamespacedSSHAuthList, error) - Watch(opts metav1.ListOptions) (watch.Interface, error) - DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error - Controller() NamespacedSSHAuthController - AddHandler(ctx context.Context, name string, sync NamespacedSSHAuthHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync NamespacedSSHAuthHandlerFunc) - AddLifecycle(ctx context.Context, name string, lifecycle NamespacedSSHAuthLifecycle) - AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle NamespacedSSHAuthLifecycle) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync NamespacedSSHAuthHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync NamespacedSSHAuthHandlerFunc) - AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle NamespacedSSHAuthLifecycle) - AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle NamespacedSSHAuthLifecycle) -} - -type namespacedSshAuthLister struct { - controller *namespacedSshAuthController -} - -func (l *namespacedSshAuthLister) List(namespace string, selector labels.Selector) (ret []*NamespacedSSHAuth, err error) { - err = cache.ListAllByNamespace(l.controller.Informer().GetIndexer(), namespace, selector, func(obj interface{}) { - ret = append(ret, obj.(*NamespacedSSHAuth)) - }) - return -} - -func (l *namespacedSshAuthLister) Get(namespace, name string) (*NamespacedSSHAuth, error) { - var key string - if namespace != "" { - key = namespace + "/" + name - } else { - key = name - } - obj, exists, err := l.controller.Informer().GetIndexer().GetByKey(key) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(schema.GroupResource{ - Group: NamespacedSSHAuthGroupVersionKind.Group, - Resource: NamespacedSSHAuthGroupVersionResource.Resource, - }, key) - } - return obj.(*NamespacedSSHAuth), nil -} - -type namespacedSshAuthController struct { - controller.GenericController -} - -func (c *namespacedSshAuthController) Generic() controller.GenericController { - return c.GenericController -} - -func (c *namespacedSshAuthController) Lister() NamespacedSSHAuthLister { - return &namespacedSshAuthLister{ - controller: c, - } -} - -func (c *namespacedSshAuthController) AddHandler(ctx context.Context, name string, handler NamespacedSSHAuthHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*NamespacedSSHAuth); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *namespacedSshAuthController) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, handler NamespacedSSHAuthHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*NamespacedSSHAuth); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *namespacedSshAuthController) AddClusterScopedHandler(ctx context.Context, name, cluster string, handler NamespacedSSHAuthHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*NamespacedSSHAuth); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *namespacedSshAuthController) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, cluster string, handler NamespacedSSHAuthHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*NamespacedSSHAuth); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -type namespacedSshAuthFactory struct { -} - -func (c namespacedSshAuthFactory) Object() runtime.Object { - return &NamespacedSSHAuth{} -} - -func (c namespacedSshAuthFactory) List() runtime.Object { - return &NamespacedSSHAuthList{} -} - -func (s *namespacedSshAuthClient) Controller() NamespacedSSHAuthController { - genericController := controller.NewGenericController(NamespacedSSHAuthGroupVersionKind.Kind+"Controller", - s.client.controllerFactory.ForResourceKind(NamespacedSSHAuthGroupVersionResource, NamespacedSSHAuthGroupVersionKind.Kind, true)) - - return &namespacedSshAuthController{ - GenericController: genericController, - } -} - -type namespacedSshAuthClient struct { - client *Client - ns string - objectClient *objectclient.ObjectClient - controller NamespacedSSHAuthController -} - -func (s *namespacedSshAuthClient) ObjectClient() *objectclient.ObjectClient { - return s.objectClient -} - -func (s *namespacedSshAuthClient) Create(o *NamespacedSSHAuth) (*NamespacedSSHAuth, error) { - obj, err := s.objectClient.Create(o) - return obj.(*NamespacedSSHAuth), err -} - -func (s *namespacedSshAuthClient) Get(name string, opts metav1.GetOptions) (*NamespacedSSHAuth, error) { - obj, err := s.objectClient.Get(name, opts) - return obj.(*NamespacedSSHAuth), err -} - -func (s *namespacedSshAuthClient) GetNamespaced(namespace, name string, opts metav1.GetOptions) (*NamespacedSSHAuth, error) { - obj, err := s.objectClient.GetNamespaced(namespace, name, opts) - return obj.(*NamespacedSSHAuth), err -} - -func (s *namespacedSshAuthClient) Update(o *NamespacedSSHAuth) (*NamespacedSSHAuth, error) { - obj, err := s.objectClient.Update(o.Name, o) - return obj.(*NamespacedSSHAuth), err -} - -func (s *namespacedSshAuthClient) UpdateStatus(o *NamespacedSSHAuth) (*NamespacedSSHAuth, error) { - obj, err := s.objectClient.UpdateStatus(o.Name, o) - return obj.(*NamespacedSSHAuth), err -} - -func (s *namespacedSshAuthClient) Delete(name string, options *metav1.DeleteOptions) error { - return s.objectClient.Delete(name, options) -} - -func (s *namespacedSshAuthClient) DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error { - return s.objectClient.DeleteNamespaced(namespace, name, options) -} - -func (s *namespacedSshAuthClient) List(opts metav1.ListOptions) (*NamespacedSSHAuthList, error) { - obj, err := s.objectClient.List(opts) - return obj.(*NamespacedSSHAuthList), err -} - -func (s *namespacedSshAuthClient) ListNamespaced(namespace string, opts metav1.ListOptions) (*NamespacedSSHAuthList, error) { - obj, err := s.objectClient.ListNamespaced(namespace, opts) - return obj.(*NamespacedSSHAuthList), err -} - -func (s *namespacedSshAuthClient) Watch(opts metav1.ListOptions) (watch.Interface, error) { - return s.objectClient.Watch(opts) -} - -// Patch applies the patch and returns the patched deployment. -func (s *namespacedSshAuthClient) Patch(o *NamespacedSSHAuth, patchType types.PatchType, data []byte, subresources ...string) (*NamespacedSSHAuth, error) { - obj, err := s.objectClient.Patch(o.Name, o, patchType, data, subresources...) - return obj.(*NamespacedSSHAuth), err -} - -func (s *namespacedSshAuthClient) DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error { - return s.objectClient.DeleteCollection(deleteOpts, listOpts) -} - -func (s *namespacedSshAuthClient) AddHandler(ctx context.Context, name string, sync NamespacedSSHAuthHandlerFunc) { - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *namespacedSshAuthClient) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync NamespacedSSHAuthHandlerFunc) { - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *namespacedSshAuthClient) AddLifecycle(ctx context.Context, name string, lifecycle NamespacedSSHAuthLifecycle) { - sync := NewNamespacedSSHAuthLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *namespacedSshAuthClient) AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle NamespacedSSHAuthLifecycle) { - sync := NewNamespacedSSHAuthLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *namespacedSshAuthClient) AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync NamespacedSSHAuthHandlerFunc) { - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *namespacedSshAuthClient) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync NamespacedSSHAuthHandlerFunc) { - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} - -func (s *namespacedSshAuthClient) AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle NamespacedSSHAuthLifecycle) { - sync := NewNamespacedSSHAuthLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *namespacedSshAuthClient) AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle NamespacedSSHAuthLifecycle) { - sync := NewNamespacedSSHAuthLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} diff --git a/vendor/github.com/rancher/types/apis/project.cattle.io/v3/zz_generated_namespaced_ssh_auth_lifecycle_adapter.go b/vendor/github.com/rancher/types/apis/project.cattle.io/v3/zz_generated_namespaced_ssh_auth_lifecycle_adapter.go deleted file mode 100644 index 243a8ff4..00000000 --- a/vendor/github.com/rancher/types/apis/project.cattle.io/v3/zz_generated_namespaced_ssh_auth_lifecycle_adapter.go +++ /dev/null @@ -1,66 +0,0 @@ -package v3 - -import ( - "github.com/rancher/norman/lifecycle" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/runtime" -) - -type NamespacedSSHAuthLifecycle interface { - Create(obj *NamespacedSSHAuth) (runtime.Object, error) - Remove(obj *NamespacedSSHAuth) (runtime.Object, error) - Updated(obj *NamespacedSSHAuth) (runtime.Object, error) -} - -type namespacedSshAuthLifecycleAdapter struct { - lifecycle NamespacedSSHAuthLifecycle -} - -func (w *namespacedSshAuthLifecycleAdapter) HasCreate() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasCreate() -} - -func (w *namespacedSshAuthLifecycleAdapter) HasFinalize() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasFinalize() -} - -func (w *namespacedSshAuthLifecycleAdapter) Create(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Create(obj.(*NamespacedSSHAuth)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *namespacedSshAuthLifecycleAdapter) Finalize(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Remove(obj.(*NamespacedSSHAuth)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *namespacedSshAuthLifecycleAdapter) Updated(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Updated(obj.(*NamespacedSSHAuth)) - if o == nil { - return nil, err - } - return o, err -} - -func NewNamespacedSSHAuthLifecycleAdapter(name string, clusterScoped bool, client NamespacedSSHAuthInterface, l NamespacedSSHAuthLifecycle) NamespacedSSHAuthHandlerFunc { - if clusterScoped { - resource.PutClusterScoped(NamespacedSSHAuthGroupVersionResource) - } - adapter := &namespacedSshAuthLifecycleAdapter{lifecycle: l} - syncFn := lifecycle.NewObjectLifecycleAdapter(name, clusterScoped, adapter, client.ObjectClient()) - return func(key string, obj *NamespacedSSHAuth) (runtime.Object, error) { - newObj, err := syncFn(key, obj) - if o, ok := newObj.(runtime.Object); ok { - return o, err - } - return nil, err - } -} diff --git a/vendor/github.com/rancher/types/apis/project.cattle.io/v3/zz_generated_pipeline_controller.go b/vendor/github.com/rancher/types/apis/project.cattle.io/v3/zz_generated_pipeline_controller.go deleted file mode 100644 index 27bc4c14..00000000 --- a/vendor/github.com/rancher/types/apis/project.cattle.io/v3/zz_generated_pipeline_controller.go +++ /dev/null @@ -1,321 +0,0 @@ -package v3 - -import ( - "context" - "time" - - "github.com/rancher/norman/controller" - "github.com/rancher/norman/objectclient" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/apimachinery/pkg/types" - "k8s.io/apimachinery/pkg/watch" - "k8s.io/client-go/tools/cache" -) - -var ( - PipelineGroupVersionKind = schema.GroupVersionKind{ - Version: Version, - Group: GroupName, - Kind: "Pipeline", - } - PipelineResource = metav1.APIResource{ - Name: "pipelines", - SingularName: "pipeline", - Namespaced: true, - - Kind: PipelineGroupVersionKind.Kind, - } - - PipelineGroupVersionResource = schema.GroupVersionResource{ - Group: GroupName, - Version: Version, - Resource: "pipelines", - } -) - -func init() { - resource.Put(PipelineGroupVersionResource) -} - -func NewPipeline(namespace, name string, obj Pipeline) *Pipeline { - obj.APIVersion, obj.Kind = PipelineGroupVersionKind.ToAPIVersionAndKind() - obj.Name = name - obj.Namespace = namespace - return &obj -} - -type PipelineList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []Pipeline `json:"items"` -} - -type PipelineHandlerFunc func(key string, obj *Pipeline) (runtime.Object, error) - -type PipelineChangeHandlerFunc func(obj *Pipeline) (runtime.Object, error) - -type PipelineLister interface { - List(namespace string, selector labels.Selector) (ret []*Pipeline, err error) - Get(namespace, name string) (*Pipeline, error) -} - -type PipelineController interface { - Generic() controller.GenericController - Informer() cache.SharedIndexInformer - Lister() PipelineLister - AddHandler(ctx context.Context, name string, handler PipelineHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync PipelineHandlerFunc) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, handler PipelineHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, handler PipelineHandlerFunc) - Enqueue(namespace, name string) - EnqueueAfter(namespace, name string, after time.Duration) -} - -type PipelineInterface interface { - ObjectClient() *objectclient.ObjectClient - Create(*Pipeline) (*Pipeline, error) - GetNamespaced(namespace, name string, opts metav1.GetOptions) (*Pipeline, error) - Get(name string, opts metav1.GetOptions) (*Pipeline, error) - Update(*Pipeline) (*Pipeline, error) - Delete(name string, options *metav1.DeleteOptions) error - DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error - List(opts metav1.ListOptions) (*PipelineList, error) - ListNamespaced(namespace string, opts metav1.ListOptions) (*PipelineList, error) - Watch(opts metav1.ListOptions) (watch.Interface, error) - DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error - Controller() PipelineController - AddHandler(ctx context.Context, name string, sync PipelineHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync PipelineHandlerFunc) - AddLifecycle(ctx context.Context, name string, lifecycle PipelineLifecycle) - AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle PipelineLifecycle) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync PipelineHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync PipelineHandlerFunc) - AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle PipelineLifecycle) - AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle PipelineLifecycle) -} - -type pipelineLister struct { - controller *pipelineController -} - -func (l *pipelineLister) List(namespace string, selector labels.Selector) (ret []*Pipeline, err error) { - err = cache.ListAllByNamespace(l.controller.Informer().GetIndexer(), namespace, selector, func(obj interface{}) { - ret = append(ret, obj.(*Pipeline)) - }) - return -} - -func (l *pipelineLister) Get(namespace, name string) (*Pipeline, error) { - var key string - if namespace != "" { - key = namespace + "/" + name - } else { - key = name - } - obj, exists, err := l.controller.Informer().GetIndexer().GetByKey(key) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(schema.GroupResource{ - Group: PipelineGroupVersionKind.Group, - Resource: PipelineGroupVersionResource.Resource, - }, key) - } - return obj.(*Pipeline), nil -} - -type pipelineController struct { - controller.GenericController -} - -func (c *pipelineController) Generic() controller.GenericController { - return c.GenericController -} - -func (c *pipelineController) Lister() PipelineLister { - return &pipelineLister{ - controller: c, - } -} - -func (c *pipelineController) AddHandler(ctx context.Context, name string, handler PipelineHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*Pipeline); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *pipelineController) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, handler PipelineHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*Pipeline); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *pipelineController) AddClusterScopedHandler(ctx context.Context, name, cluster string, handler PipelineHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*Pipeline); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *pipelineController) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, cluster string, handler PipelineHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*Pipeline); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -type pipelineFactory struct { -} - -func (c pipelineFactory) Object() runtime.Object { - return &Pipeline{} -} - -func (c pipelineFactory) List() runtime.Object { - return &PipelineList{} -} - -func (s *pipelineClient) Controller() PipelineController { - genericController := controller.NewGenericController(PipelineGroupVersionKind.Kind+"Controller", - s.client.controllerFactory.ForResourceKind(PipelineGroupVersionResource, PipelineGroupVersionKind.Kind, true)) - - return &pipelineController{ - GenericController: genericController, - } -} - -type pipelineClient struct { - client *Client - ns string - objectClient *objectclient.ObjectClient - controller PipelineController -} - -func (s *pipelineClient) ObjectClient() *objectclient.ObjectClient { - return s.objectClient -} - -func (s *pipelineClient) Create(o *Pipeline) (*Pipeline, error) { - obj, err := s.objectClient.Create(o) - return obj.(*Pipeline), err -} - -func (s *pipelineClient) Get(name string, opts metav1.GetOptions) (*Pipeline, error) { - obj, err := s.objectClient.Get(name, opts) - return obj.(*Pipeline), err -} - -func (s *pipelineClient) GetNamespaced(namespace, name string, opts metav1.GetOptions) (*Pipeline, error) { - obj, err := s.objectClient.GetNamespaced(namespace, name, opts) - return obj.(*Pipeline), err -} - -func (s *pipelineClient) Update(o *Pipeline) (*Pipeline, error) { - obj, err := s.objectClient.Update(o.Name, o) - return obj.(*Pipeline), err -} - -func (s *pipelineClient) UpdateStatus(o *Pipeline) (*Pipeline, error) { - obj, err := s.objectClient.UpdateStatus(o.Name, o) - return obj.(*Pipeline), err -} - -func (s *pipelineClient) Delete(name string, options *metav1.DeleteOptions) error { - return s.objectClient.Delete(name, options) -} - -func (s *pipelineClient) DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error { - return s.objectClient.DeleteNamespaced(namespace, name, options) -} - -func (s *pipelineClient) List(opts metav1.ListOptions) (*PipelineList, error) { - obj, err := s.objectClient.List(opts) - return obj.(*PipelineList), err -} - -func (s *pipelineClient) ListNamespaced(namespace string, opts metav1.ListOptions) (*PipelineList, error) { - obj, err := s.objectClient.ListNamespaced(namespace, opts) - return obj.(*PipelineList), err -} - -func (s *pipelineClient) Watch(opts metav1.ListOptions) (watch.Interface, error) { - return s.objectClient.Watch(opts) -} - -// Patch applies the patch and returns the patched deployment. -func (s *pipelineClient) Patch(o *Pipeline, patchType types.PatchType, data []byte, subresources ...string) (*Pipeline, error) { - obj, err := s.objectClient.Patch(o.Name, o, patchType, data, subresources...) - return obj.(*Pipeline), err -} - -func (s *pipelineClient) DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error { - return s.objectClient.DeleteCollection(deleteOpts, listOpts) -} - -func (s *pipelineClient) AddHandler(ctx context.Context, name string, sync PipelineHandlerFunc) { - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *pipelineClient) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync PipelineHandlerFunc) { - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *pipelineClient) AddLifecycle(ctx context.Context, name string, lifecycle PipelineLifecycle) { - sync := NewPipelineLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *pipelineClient) AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle PipelineLifecycle) { - sync := NewPipelineLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *pipelineClient) AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync PipelineHandlerFunc) { - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *pipelineClient) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync PipelineHandlerFunc) { - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} - -func (s *pipelineClient) AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle PipelineLifecycle) { - sync := NewPipelineLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *pipelineClient) AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle PipelineLifecycle) { - sync := NewPipelineLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} diff --git a/vendor/github.com/rancher/types/apis/project.cattle.io/v3/zz_generated_pipeline_execution_controller.go b/vendor/github.com/rancher/types/apis/project.cattle.io/v3/zz_generated_pipeline_execution_controller.go deleted file mode 100644 index a2ae6a98..00000000 --- a/vendor/github.com/rancher/types/apis/project.cattle.io/v3/zz_generated_pipeline_execution_controller.go +++ /dev/null @@ -1,321 +0,0 @@ -package v3 - -import ( - "context" - "time" - - "github.com/rancher/norman/controller" - "github.com/rancher/norman/objectclient" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/apimachinery/pkg/types" - "k8s.io/apimachinery/pkg/watch" - "k8s.io/client-go/tools/cache" -) - -var ( - PipelineExecutionGroupVersionKind = schema.GroupVersionKind{ - Version: Version, - Group: GroupName, - Kind: "PipelineExecution", - } - PipelineExecutionResource = metav1.APIResource{ - Name: "pipelineexecutions", - SingularName: "pipelineexecution", - Namespaced: true, - - Kind: PipelineExecutionGroupVersionKind.Kind, - } - - PipelineExecutionGroupVersionResource = schema.GroupVersionResource{ - Group: GroupName, - Version: Version, - Resource: "pipelineexecutions", - } -) - -func init() { - resource.Put(PipelineExecutionGroupVersionResource) -} - -func NewPipelineExecution(namespace, name string, obj PipelineExecution) *PipelineExecution { - obj.APIVersion, obj.Kind = PipelineExecutionGroupVersionKind.ToAPIVersionAndKind() - obj.Name = name - obj.Namespace = namespace - return &obj -} - -type PipelineExecutionList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []PipelineExecution `json:"items"` -} - -type PipelineExecutionHandlerFunc func(key string, obj *PipelineExecution) (runtime.Object, error) - -type PipelineExecutionChangeHandlerFunc func(obj *PipelineExecution) (runtime.Object, error) - -type PipelineExecutionLister interface { - List(namespace string, selector labels.Selector) (ret []*PipelineExecution, err error) - Get(namespace, name string) (*PipelineExecution, error) -} - -type PipelineExecutionController interface { - Generic() controller.GenericController - Informer() cache.SharedIndexInformer - Lister() PipelineExecutionLister - AddHandler(ctx context.Context, name string, handler PipelineExecutionHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync PipelineExecutionHandlerFunc) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, handler PipelineExecutionHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, handler PipelineExecutionHandlerFunc) - Enqueue(namespace, name string) - EnqueueAfter(namespace, name string, after time.Duration) -} - -type PipelineExecutionInterface interface { - ObjectClient() *objectclient.ObjectClient - Create(*PipelineExecution) (*PipelineExecution, error) - GetNamespaced(namespace, name string, opts metav1.GetOptions) (*PipelineExecution, error) - Get(name string, opts metav1.GetOptions) (*PipelineExecution, error) - Update(*PipelineExecution) (*PipelineExecution, error) - Delete(name string, options *metav1.DeleteOptions) error - DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error - List(opts metav1.ListOptions) (*PipelineExecutionList, error) - ListNamespaced(namespace string, opts metav1.ListOptions) (*PipelineExecutionList, error) - Watch(opts metav1.ListOptions) (watch.Interface, error) - DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error - Controller() PipelineExecutionController - AddHandler(ctx context.Context, name string, sync PipelineExecutionHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync PipelineExecutionHandlerFunc) - AddLifecycle(ctx context.Context, name string, lifecycle PipelineExecutionLifecycle) - AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle PipelineExecutionLifecycle) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync PipelineExecutionHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync PipelineExecutionHandlerFunc) - AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle PipelineExecutionLifecycle) - AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle PipelineExecutionLifecycle) -} - -type pipelineExecutionLister struct { - controller *pipelineExecutionController -} - -func (l *pipelineExecutionLister) List(namespace string, selector labels.Selector) (ret []*PipelineExecution, err error) { - err = cache.ListAllByNamespace(l.controller.Informer().GetIndexer(), namespace, selector, func(obj interface{}) { - ret = append(ret, obj.(*PipelineExecution)) - }) - return -} - -func (l *pipelineExecutionLister) Get(namespace, name string) (*PipelineExecution, error) { - var key string - if namespace != "" { - key = namespace + "/" + name - } else { - key = name - } - obj, exists, err := l.controller.Informer().GetIndexer().GetByKey(key) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(schema.GroupResource{ - Group: PipelineExecutionGroupVersionKind.Group, - Resource: PipelineExecutionGroupVersionResource.Resource, - }, key) - } - return obj.(*PipelineExecution), nil -} - -type pipelineExecutionController struct { - controller.GenericController -} - -func (c *pipelineExecutionController) Generic() controller.GenericController { - return c.GenericController -} - -func (c *pipelineExecutionController) Lister() PipelineExecutionLister { - return &pipelineExecutionLister{ - controller: c, - } -} - -func (c *pipelineExecutionController) AddHandler(ctx context.Context, name string, handler PipelineExecutionHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*PipelineExecution); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *pipelineExecutionController) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, handler PipelineExecutionHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*PipelineExecution); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *pipelineExecutionController) AddClusterScopedHandler(ctx context.Context, name, cluster string, handler PipelineExecutionHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*PipelineExecution); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *pipelineExecutionController) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, cluster string, handler PipelineExecutionHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*PipelineExecution); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -type pipelineExecutionFactory struct { -} - -func (c pipelineExecutionFactory) Object() runtime.Object { - return &PipelineExecution{} -} - -func (c pipelineExecutionFactory) List() runtime.Object { - return &PipelineExecutionList{} -} - -func (s *pipelineExecutionClient) Controller() PipelineExecutionController { - genericController := controller.NewGenericController(PipelineExecutionGroupVersionKind.Kind+"Controller", - s.client.controllerFactory.ForResourceKind(PipelineExecutionGroupVersionResource, PipelineExecutionGroupVersionKind.Kind, true)) - - return &pipelineExecutionController{ - GenericController: genericController, - } -} - -type pipelineExecutionClient struct { - client *Client - ns string - objectClient *objectclient.ObjectClient - controller PipelineExecutionController -} - -func (s *pipelineExecutionClient) ObjectClient() *objectclient.ObjectClient { - return s.objectClient -} - -func (s *pipelineExecutionClient) Create(o *PipelineExecution) (*PipelineExecution, error) { - obj, err := s.objectClient.Create(o) - return obj.(*PipelineExecution), err -} - -func (s *pipelineExecutionClient) Get(name string, opts metav1.GetOptions) (*PipelineExecution, error) { - obj, err := s.objectClient.Get(name, opts) - return obj.(*PipelineExecution), err -} - -func (s *pipelineExecutionClient) GetNamespaced(namespace, name string, opts metav1.GetOptions) (*PipelineExecution, error) { - obj, err := s.objectClient.GetNamespaced(namespace, name, opts) - return obj.(*PipelineExecution), err -} - -func (s *pipelineExecutionClient) Update(o *PipelineExecution) (*PipelineExecution, error) { - obj, err := s.objectClient.Update(o.Name, o) - return obj.(*PipelineExecution), err -} - -func (s *pipelineExecutionClient) UpdateStatus(o *PipelineExecution) (*PipelineExecution, error) { - obj, err := s.objectClient.UpdateStatus(o.Name, o) - return obj.(*PipelineExecution), err -} - -func (s *pipelineExecutionClient) Delete(name string, options *metav1.DeleteOptions) error { - return s.objectClient.Delete(name, options) -} - -func (s *pipelineExecutionClient) DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error { - return s.objectClient.DeleteNamespaced(namespace, name, options) -} - -func (s *pipelineExecutionClient) List(opts metav1.ListOptions) (*PipelineExecutionList, error) { - obj, err := s.objectClient.List(opts) - return obj.(*PipelineExecutionList), err -} - -func (s *pipelineExecutionClient) ListNamespaced(namespace string, opts metav1.ListOptions) (*PipelineExecutionList, error) { - obj, err := s.objectClient.ListNamespaced(namespace, opts) - return obj.(*PipelineExecutionList), err -} - -func (s *pipelineExecutionClient) Watch(opts metav1.ListOptions) (watch.Interface, error) { - return s.objectClient.Watch(opts) -} - -// Patch applies the patch and returns the patched deployment. -func (s *pipelineExecutionClient) Patch(o *PipelineExecution, patchType types.PatchType, data []byte, subresources ...string) (*PipelineExecution, error) { - obj, err := s.objectClient.Patch(o.Name, o, patchType, data, subresources...) - return obj.(*PipelineExecution), err -} - -func (s *pipelineExecutionClient) DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error { - return s.objectClient.DeleteCollection(deleteOpts, listOpts) -} - -func (s *pipelineExecutionClient) AddHandler(ctx context.Context, name string, sync PipelineExecutionHandlerFunc) { - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *pipelineExecutionClient) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync PipelineExecutionHandlerFunc) { - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *pipelineExecutionClient) AddLifecycle(ctx context.Context, name string, lifecycle PipelineExecutionLifecycle) { - sync := NewPipelineExecutionLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *pipelineExecutionClient) AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle PipelineExecutionLifecycle) { - sync := NewPipelineExecutionLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *pipelineExecutionClient) AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync PipelineExecutionHandlerFunc) { - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *pipelineExecutionClient) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync PipelineExecutionHandlerFunc) { - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} - -func (s *pipelineExecutionClient) AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle PipelineExecutionLifecycle) { - sync := NewPipelineExecutionLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *pipelineExecutionClient) AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle PipelineExecutionLifecycle) { - sync := NewPipelineExecutionLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} diff --git a/vendor/github.com/rancher/types/apis/project.cattle.io/v3/zz_generated_pipeline_execution_lifecycle_adapter.go b/vendor/github.com/rancher/types/apis/project.cattle.io/v3/zz_generated_pipeline_execution_lifecycle_adapter.go deleted file mode 100644 index 57fb53d0..00000000 --- a/vendor/github.com/rancher/types/apis/project.cattle.io/v3/zz_generated_pipeline_execution_lifecycle_adapter.go +++ /dev/null @@ -1,66 +0,0 @@ -package v3 - -import ( - "github.com/rancher/norman/lifecycle" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/runtime" -) - -type PipelineExecutionLifecycle interface { - Create(obj *PipelineExecution) (runtime.Object, error) - Remove(obj *PipelineExecution) (runtime.Object, error) - Updated(obj *PipelineExecution) (runtime.Object, error) -} - -type pipelineExecutionLifecycleAdapter struct { - lifecycle PipelineExecutionLifecycle -} - -func (w *pipelineExecutionLifecycleAdapter) HasCreate() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasCreate() -} - -func (w *pipelineExecutionLifecycleAdapter) HasFinalize() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasFinalize() -} - -func (w *pipelineExecutionLifecycleAdapter) Create(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Create(obj.(*PipelineExecution)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *pipelineExecutionLifecycleAdapter) Finalize(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Remove(obj.(*PipelineExecution)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *pipelineExecutionLifecycleAdapter) Updated(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Updated(obj.(*PipelineExecution)) - if o == nil { - return nil, err - } - return o, err -} - -func NewPipelineExecutionLifecycleAdapter(name string, clusterScoped bool, client PipelineExecutionInterface, l PipelineExecutionLifecycle) PipelineExecutionHandlerFunc { - if clusterScoped { - resource.PutClusterScoped(PipelineExecutionGroupVersionResource) - } - adapter := &pipelineExecutionLifecycleAdapter{lifecycle: l} - syncFn := lifecycle.NewObjectLifecycleAdapter(name, clusterScoped, adapter, client.ObjectClient()) - return func(key string, obj *PipelineExecution) (runtime.Object, error) { - newObj, err := syncFn(key, obj) - if o, ok := newObj.(runtime.Object); ok { - return o, err - } - return nil, err - } -} diff --git a/vendor/github.com/rancher/types/apis/project.cattle.io/v3/zz_generated_pipeline_lifecycle_adapter.go b/vendor/github.com/rancher/types/apis/project.cattle.io/v3/zz_generated_pipeline_lifecycle_adapter.go deleted file mode 100644 index c42b78c5..00000000 --- a/vendor/github.com/rancher/types/apis/project.cattle.io/v3/zz_generated_pipeline_lifecycle_adapter.go +++ /dev/null @@ -1,66 +0,0 @@ -package v3 - -import ( - "github.com/rancher/norman/lifecycle" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/runtime" -) - -type PipelineLifecycle interface { - Create(obj *Pipeline) (runtime.Object, error) - Remove(obj *Pipeline) (runtime.Object, error) - Updated(obj *Pipeline) (runtime.Object, error) -} - -type pipelineLifecycleAdapter struct { - lifecycle PipelineLifecycle -} - -func (w *pipelineLifecycleAdapter) HasCreate() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasCreate() -} - -func (w *pipelineLifecycleAdapter) HasFinalize() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasFinalize() -} - -func (w *pipelineLifecycleAdapter) Create(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Create(obj.(*Pipeline)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *pipelineLifecycleAdapter) Finalize(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Remove(obj.(*Pipeline)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *pipelineLifecycleAdapter) Updated(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Updated(obj.(*Pipeline)) - if o == nil { - return nil, err - } - return o, err -} - -func NewPipelineLifecycleAdapter(name string, clusterScoped bool, client PipelineInterface, l PipelineLifecycle) PipelineHandlerFunc { - if clusterScoped { - resource.PutClusterScoped(PipelineGroupVersionResource) - } - adapter := &pipelineLifecycleAdapter{lifecycle: l} - syncFn := lifecycle.NewObjectLifecycleAdapter(name, clusterScoped, adapter, client.ObjectClient()) - return func(key string, obj *Pipeline) (runtime.Object, error) { - newObj, err := syncFn(key, obj) - if o, ok := newObj.(runtime.Object); ok { - return o, err - } - return nil, err - } -} diff --git a/vendor/github.com/rancher/types/apis/project.cattle.io/v3/zz_generated_pipeline_setting_controller.go b/vendor/github.com/rancher/types/apis/project.cattle.io/v3/zz_generated_pipeline_setting_controller.go deleted file mode 100644 index b8cdf459..00000000 --- a/vendor/github.com/rancher/types/apis/project.cattle.io/v3/zz_generated_pipeline_setting_controller.go +++ /dev/null @@ -1,321 +0,0 @@ -package v3 - -import ( - "context" - "time" - - "github.com/rancher/norman/controller" - "github.com/rancher/norman/objectclient" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/apimachinery/pkg/types" - "k8s.io/apimachinery/pkg/watch" - "k8s.io/client-go/tools/cache" -) - -var ( - PipelineSettingGroupVersionKind = schema.GroupVersionKind{ - Version: Version, - Group: GroupName, - Kind: "PipelineSetting", - } - PipelineSettingResource = metav1.APIResource{ - Name: "pipelinesettings", - SingularName: "pipelinesetting", - Namespaced: true, - - Kind: PipelineSettingGroupVersionKind.Kind, - } - - PipelineSettingGroupVersionResource = schema.GroupVersionResource{ - Group: GroupName, - Version: Version, - Resource: "pipelinesettings", - } -) - -func init() { - resource.Put(PipelineSettingGroupVersionResource) -} - -func NewPipelineSetting(namespace, name string, obj PipelineSetting) *PipelineSetting { - obj.APIVersion, obj.Kind = PipelineSettingGroupVersionKind.ToAPIVersionAndKind() - obj.Name = name - obj.Namespace = namespace - return &obj -} - -type PipelineSettingList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []PipelineSetting `json:"items"` -} - -type PipelineSettingHandlerFunc func(key string, obj *PipelineSetting) (runtime.Object, error) - -type PipelineSettingChangeHandlerFunc func(obj *PipelineSetting) (runtime.Object, error) - -type PipelineSettingLister interface { - List(namespace string, selector labels.Selector) (ret []*PipelineSetting, err error) - Get(namespace, name string) (*PipelineSetting, error) -} - -type PipelineSettingController interface { - Generic() controller.GenericController - Informer() cache.SharedIndexInformer - Lister() PipelineSettingLister - AddHandler(ctx context.Context, name string, handler PipelineSettingHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync PipelineSettingHandlerFunc) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, handler PipelineSettingHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, handler PipelineSettingHandlerFunc) - Enqueue(namespace, name string) - EnqueueAfter(namespace, name string, after time.Duration) -} - -type PipelineSettingInterface interface { - ObjectClient() *objectclient.ObjectClient - Create(*PipelineSetting) (*PipelineSetting, error) - GetNamespaced(namespace, name string, opts metav1.GetOptions) (*PipelineSetting, error) - Get(name string, opts metav1.GetOptions) (*PipelineSetting, error) - Update(*PipelineSetting) (*PipelineSetting, error) - Delete(name string, options *metav1.DeleteOptions) error - DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error - List(opts metav1.ListOptions) (*PipelineSettingList, error) - ListNamespaced(namespace string, opts metav1.ListOptions) (*PipelineSettingList, error) - Watch(opts metav1.ListOptions) (watch.Interface, error) - DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error - Controller() PipelineSettingController - AddHandler(ctx context.Context, name string, sync PipelineSettingHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync PipelineSettingHandlerFunc) - AddLifecycle(ctx context.Context, name string, lifecycle PipelineSettingLifecycle) - AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle PipelineSettingLifecycle) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync PipelineSettingHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync PipelineSettingHandlerFunc) - AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle PipelineSettingLifecycle) - AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle PipelineSettingLifecycle) -} - -type pipelineSettingLister struct { - controller *pipelineSettingController -} - -func (l *pipelineSettingLister) List(namespace string, selector labels.Selector) (ret []*PipelineSetting, err error) { - err = cache.ListAllByNamespace(l.controller.Informer().GetIndexer(), namespace, selector, func(obj interface{}) { - ret = append(ret, obj.(*PipelineSetting)) - }) - return -} - -func (l *pipelineSettingLister) Get(namespace, name string) (*PipelineSetting, error) { - var key string - if namespace != "" { - key = namespace + "/" + name - } else { - key = name - } - obj, exists, err := l.controller.Informer().GetIndexer().GetByKey(key) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(schema.GroupResource{ - Group: PipelineSettingGroupVersionKind.Group, - Resource: PipelineSettingGroupVersionResource.Resource, - }, key) - } - return obj.(*PipelineSetting), nil -} - -type pipelineSettingController struct { - controller.GenericController -} - -func (c *pipelineSettingController) Generic() controller.GenericController { - return c.GenericController -} - -func (c *pipelineSettingController) Lister() PipelineSettingLister { - return &pipelineSettingLister{ - controller: c, - } -} - -func (c *pipelineSettingController) AddHandler(ctx context.Context, name string, handler PipelineSettingHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*PipelineSetting); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *pipelineSettingController) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, handler PipelineSettingHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*PipelineSetting); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *pipelineSettingController) AddClusterScopedHandler(ctx context.Context, name, cluster string, handler PipelineSettingHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*PipelineSetting); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *pipelineSettingController) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, cluster string, handler PipelineSettingHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*PipelineSetting); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -type pipelineSettingFactory struct { -} - -func (c pipelineSettingFactory) Object() runtime.Object { - return &PipelineSetting{} -} - -func (c pipelineSettingFactory) List() runtime.Object { - return &PipelineSettingList{} -} - -func (s *pipelineSettingClient) Controller() PipelineSettingController { - genericController := controller.NewGenericController(PipelineSettingGroupVersionKind.Kind+"Controller", - s.client.controllerFactory.ForResourceKind(PipelineSettingGroupVersionResource, PipelineSettingGroupVersionKind.Kind, true)) - - return &pipelineSettingController{ - GenericController: genericController, - } -} - -type pipelineSettingClient struct { - client *Client - ns string - objectClient *objectclient.ObjectClient - controller PipelineSettingController -} - -func (s *pipelineSettingClient) ObjectClient() *objectclient.ObjectClient { - return s.objectClient -} - -func (s *pipelineSettingClient) Create(o *PipelineSetting) (*PipelineSetting, error) { - obj, err := s.objectClient.Create(o) - return obj.(*PipelineSetting), err -} - -func (s *pipelineSettingClient) Get(name string, opts metav1.GetOptions) (*PipelineSetting, error) { - obj, err := s.objectClient.Get(name, opts) - return obj.(*PipelineSetting), err -} - -func (s *pipelineSettingClient) GetNamespaced(namespace, name string, opts metav1.GetOptions) (*PipelineSetting, error) { - obj, err := s.objectClient.GetNamespaced(namespace, name, opts) - return obj.(*PipelineSetting), err -} - -func (s *pipelineSettingClient) Update(o *PipelineSetting) (*PipelineSetting, error) { - obj, err := s.objectClient.Update(o.Name, o) - return obj.(*PipelineSetting), err -} - -func (s *pipelineSettingClient) UpdateStatus(o *PipelineSetting) (*PipelineSetting, error) { - obj, err := s.objectClient.UpdateStatus(o.Name, o) - return obj.(*PipelineSetting), err -} - -func (s *pipelineSettingClient) Delete(name string, options *metav1.DeleteOptions) error { - return s.objectClient.Delete(name, options) -} - -func (s *pipelineSettingClient) DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error { - return s.objectClient.DeleteNamespaced(namespace, name, options) -} - -func (s *pipelineSettingClient) List(opts metav1.ListOptions) (*PipelineSettingList, error) { - obj, err := s.objectClient.List(opts) - return obj.(*PipelineSettingList), err -} - -func (s *pipelineSettingClient) ListNamespaced(namespace string, opts metav1.ListOptions) (*PipelineSettingList, error) { - obj, err := s.objectClient.ListNamespaced(namespace, opts) - return obj.(*PipelineSettingList), err -} - -func (s *pipelineSettingClient) Watch(opts metav1.ListOptions) (watch.Interface, error) { - return s.objectClient.Watch(opts) -} - -// Patch applies the patch and returns the patched deployment. -func (s *pipelineSettingClient) Patch(o *PipelineSetting, patchType types.PatchType, data []byte, subresources ...string) (*PipelineSetting, error) { - obj, err := s.objectClient.Patch(o.Name, o, patchType, data, subresources...) - return obj.(*PipelineSetting), err -} - -func (s *pipelineSettingClient) DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error { - return s.objectClient.DeleteCollection(deleteOpts, listOpts) -} - -func (s *pipelineSettingClient) AddHandler(ctx context.Context, name string, sync PipelineSettingHandlerFunc) { - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *pipelineSettingClient) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync PipelineSettingHandlerFunc) { - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *pipelineSettingClient) AddLifecycle(ctx context.Context, name string, lifecycle PipelineSettingLifecycle) { - sync := NewPipelineSettingLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *pipelineSettingClient) AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle PipelineSettingLifecycle) { - sync := NewPipelineSettingLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *pipelineSettingClient) AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync PipelineSettingHandlerFunc) { - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *pipelineSettingClient) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync PipelineSettingHandlerFunc) { - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} - -func (s *pipelineSettingClient) AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle PipelineSettingLifecycle) { - sync := NewPipelineSettingLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *pipelineSettingClient) AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle PipelineSettingLifecycle) { - sync := NewPipelineSettingLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} diff --git a/vendor/github.com/rancher/types/apis/project.cattle.io/v3/zz_generated_pipeline_setting_lifecycle_adapter.go b/vendor/github.com/rancher/types/apis/project.cattle.io/v3/zz_generated_pipeline_setting_lifecycle_adapter.go deleted file mode 100644 index bcc97692..00000000 --- a/vendor/github.com/rancher/types/apis/project.cattle.io/v3/zz_generated_pipeline_setting_lifecycle_adapter.go +++ /dev/null @@ -1,66 +0,0 @@ -package v3 - -import ( - "github.com/rancher/norman/lifecycle" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/runtime" -) - -type PipelineSettingLifecycle interface { - Create(obj *PipelineSetting) (runtime.Object, error) - Remove(obj *PipelineSetting) (runtime.Object, error) - Updated(obj *PipelineSetting) (runtime.Object, error) -} - -type pipelineSettingLifecycleAdapter struct { - lifecycle PipelineSettingLifecycle -} - -func (w *pipelineSettingLifecycleAdapter) HasCreate() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasCreate() -} - -func (w *pipelineSettingLifecycleAdapter) HasFinalize() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasFinalize() -} - -func (w *pipelineSettingLifecycleAdapter) Create(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Create(obj.(*PipelineSetting)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *pipelineSettingLifecycleAdapter) Finalize(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Remove(obj.(*PipelineSetting)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *pipelineSettingLifecycleAdapter) Updated(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Updated(obj.(*PipelineSetting)) - if o == nil { - return nil, err - } - return o, err -} - -func NewPipelineSettingLifecycleAdapter(name string, clusterScoped bool, client PipelineSettingInterface, l PipelineSettingLifecycle) PipelineSettingHandlerFunc { - if clusterScoped { - resource.PutClusterScoped(PipelineSettingGroupVersionResource) - } - adapter := &pipelineSettingLifecycleAdapter{lifecycle: l} - syncFn := lifecycle.NewObjectLifecycleAdapter(name, clusterScoped, adapter, client.ObjectClient()) - return func(key string, obj *PipelineSetting) (runtime.Object, error) { - newObj, err := syncFn(key, obj) - if o, ok := newObj.(runtime.Object); ok { - return o, err - } - return nil, err - } -} diff --git a/vendor/github.com/rancher/types/apis/project.cattle.io/v3/zz_generated_scheme.go b/vendor/github.com/rancher/types/apis/project.cattle.io/v3/zz_generated_scheme.go deleted file mode 100644 index cbc29c95..00000000 --- a/vendor/github.com/rancher/types/apis/project.cattle.io/v3/zz_generated_scheme.go +++ /dev/null @@ -1,80 +0,0 @@ -package v3 - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" -) - -const ( - GroupName = "project.cattle.io" - Version = "v3" -) - -// SchemeGroupVersion is group version used to register these objects -var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: Version} - -// Kind takes an unqualified kind and returns a Group qualified GroupKind -func Kind(kind string) schema.GroupKind { - return SchemeGroupVersion.WithKind(kind).GroupKind() -} - -// Resource takes an unqualified resource and returns a Group qualified GroupResource -func Resource(resource string) schema.GroupResource { - return SchemeGroupVersion.WithResource(resource).GroupResource() -} - -var ( - SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) - AddToScheme = SchemeBuilder.AddToScheme -) - -// Adds the list of known types to api.Scheme. -func addKnownTypes(scheme *runtime.Scheme) error { - // TODO this gets cleaned up when the types are fixed - scheme.AddKnownTypes(SchemeGroupVersion, - - &ServiceAccountToken{}, - &ServiceAccountTokenList{}, - &DockerCredential{}, - &DockerCredentialList{}, - &Certificate{}, - &CertificateList{}, - &BasicAuth{}, - &BasicAuthList{}, - &SSHAuth{}, - &SSHAuthList{}, - &NamespacedServiceAccountToken{}, - &NamespacedServiceAccountTokenList{}, - &NamespacedDockerCredential{}, - &NamespacedDockerCredentialList{}, - &NamespacedCertificate{}, - &NamespacedCertificateList{}, - &NamespacedBasicAuth{}, - &NamespacedBasicAuthList{}, - &NamespacedSSHAuth{}, - &NamespacedSSHAuthList{}, - &Workload{}, - &WorkloadList{}, - &App{}, - &AppList{}, - &AppRevision{}, - &AppRevisionList{}, - &SourceCodeProvider{}, - &SourceCodeProviderList{}, - &SourceCodeProviderConfig{}, - &SourceCodeProviderConfigList{}, - &SourceCodeCredential{}, - &SourceCodeCredentialList{}, - &Pipeline{}, - &PipelineList{}, - &PipelineExecution{}, - &PipelineExecutionList{}, - &PipelineSetting{}, - &PipelineSettingList{}, - &SourceCodeRepository{}, - &SourceCodeRepositoryList{}, - ) - metav1.AddToGroupVersion(scheme, SchemeGroupVersion) - return nil -} diff --git a/vendor/github.com/rancher/types/apis/project.cattle.io/v3/zz_generated_service_account_token_controller.go b/vendor/github.com/rancher/types/apis/project.cattle.io/v3/zz_generated_service_account_token_controller.go deleted file mode 100644 index ae045ebf..00000000 --- a/vendor/github.com/rancher/types/apis/project.cattle.io/v3/zz_generated_service_account_token_controller.go +++ /dev/null @@ -1,321 +0,0 @@ -package v3 - -import ( - "context" - "time" - - "github.com/rancher/norman/controller" - "github.com/rancher/norman/objectclient" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/apimachinery/pkg/types" - "k8s.io/apimachinery/pkg/watch" - "k8s.io/client-go/tools/cache" -) - -var ( - ServiceAccountTokenGroupVersionKind = schema.GroupVersionKind{ - Version: Version, - Group: GroupName, - Kind: "ServiceAccountToken", - } - ServiceAccountTokenResource = metav1.APIResource{ - Name: "serviceaccounttokens", - SingularName: "serviceaccounttoken", - Namespaced: true, - - Kind: ServiceAccountTokenGroupVersionKind.Kind, - } - - ServiceAccountTokenGroupVersionResource = schema.GroupVersionResource{ - Group: GroupName, - Version: Version, - Resource: "serviceaccounttokens", - } -) - -func init() { - resource.Put(ServiceAccountTokenGroupVersionResource) -} - -func NewServiceAccountToken(namespace, name string, obj ServiceAccountToken) *ServiceAccountToken { - obj.APIVersion, obj.Kind = ServiceAccountTokenGroupVersionKind.ToAPIVersionAndKind() - obj.Name = name - obj.Namespace = namespace - return &obj -} - -type ServiceAccountTokenList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []ServiceAccountToken `json:"items"` -} - -type ServiceAccountTokenHandlerFunc func(key string, obj *ServiceAccountToken) (runtime.Object, error) - -type ServiceAccountTokenChangeHandlerFunc func(obj *ServiceAccountToken) (runtime.Object, error) - -type ServiceAccountTokenLister interface { - List(namespace string, selector labels.Selector) (ret []*ServiceAccountToken, err error) - Get(namespace, name string) (*ServiceAccountToken, error) -} - -type ServiceAccountTokenController interface { - Generic() controller.GenericController - Informer() cache.SharedIndexInformer - Lister() ServiceAccountTokenLister - AddHandler(ctx context.Context, name string, handler ServiceAccountTokenHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync ServiceAccountTokenHandlerFunc) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, handler ServiceAccountTokenHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, handler ServiceAccountTokenHandlerFunc) - Enqueue(namespace, name string) - EnqueueAfter(namespace, name string, after time.Duration) -} - -type ServiceAccountTokenInterface interface { - ObjectClient() *objectclient.ObjectClient - Create(*ServiceAccountToken) (*ServiceAccountToken, error) - GetNamespaced(namespace, name string, opts metav1.GetOptions) (*ServiceAccountToken, error) - Get(name string, opts metav1.GetOptions) (*ServiceAccountToken, error) - Update(*ServiceAccountToken) (*ServiceAccountToken, error) - Delete(name string, options *metav1.DeleteOptions) error - DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error - List(opts metav1.ListOptions) (*ServiceAccountTokenList, error) - ListNamespaced(namespace string, opts metav1.ListOptions) (*ServiceAccountTokenList, error) - Watch(opts metav1.ListOptions) (watch.Interface, error) - DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error - Controller() ServiceAccountTokenController - AddHandler(ctx context.Context, name string, sync ServiceAccountTokenHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync ServiceAccountTokenHandlerFunc) - AddLifecycle(ctx context.Context, name string, lifecycle ServiceAccountTokenLifecycle) - AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle ServiceAccountTokenLifecycle) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync ServiceAccountTokenHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync ServiceAccountTokenHandlerFunc) - AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle ServiceAccountTokenLifecycle) - AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle ServiceAccountTokenLifecycle) -} - -type serviceAccountTokenLister struct { - controller *serviceAccountTokenController -} - -func (l *serviceAccountTokenLister) List(namespace string, selector labels.Selector) (ret []*ServiceAccountToken, err error) { - err = cache.ListAllByNamespace(l.controller.Informer().GetIndexer(), namespace, selector, func(obj interface{}) { - ret = append(ret, obj.(*ServiceAccountToken)) - }) - return -} - -func (l *serviceAccountTokenLister) Get(namespace, name string) (*ServiceAccountToken, error) { - var key string - if namespace != "" { - key = namespace + "/" + name - } else { - key = name - } - obj, exists, err := l.controller.Informer().GetIndexer().GetByKey(key) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(schema.GroupResource{ - Group: ServiceAccountTokenGroupVersionKind.Group, - Resource: ServiceAccountTokenGroupVersionResource.Resource, - }, key) - } - return obj.(*ServiceAccountToken), nil -} - -type serviceAccountTokenController struct { - controller.GenericController -} - -func (c *serviceAccountTokenController) Generic() controller.GenericController { - return c.GenericController -} - -func (c *serviceAccountTokenController) Lister() ServiceAccountTokenLister { - return &serviceAccountTokenLister{ - controller: c, - } -} - -func (c *serviceAccountTokenController) AddHandler(ctx context.Context, name string, handler ServiceAccountTokenHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*ServiceAccountToken); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *serviceAccountTokenController) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, handler ServiceAccountTokenHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*ServiceAccountToken); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *serviceAccountTokenController) AddClusterScopedHandler(ctx context.Context, name, cluster string, handler ServiceAccountTokenHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*ServiceAccountToken); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *serviceAccountTokenController) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, cluster string, handler ServiceAccountTokenHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*ServiceAccountToken); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -type serviceAccountTokenFactory struct { -} - -func (c serviceAccountTokenFactory) Object() runtime.Object { - return &ServiceAccountToken{} -} - -func (c serviceAccountTokenFactory) List() runtime.Object { - return &ServiceAccountTokenList{} -} - -func (s *serviceAccountTokenClient) Controller() ServiceAccountTokenController { - genericController := controller.NewGenericController(ServiceAccountTokenGroupVersionKind.Kind+"Controller", - s.client.controllerFactory.ForResourceKind(ServiceAccountTokenGroupVersionResource, ServiceAccountTokenGroupVersionKind.Kind, true)) - - return &serviceAccountTokenController{ - GenericController: genericController, - } -} - -type serviceAccountTokenClient struct { - client *Client - ns string - objectClient *objectclient.ObjectClient - controller ServiceAccountTokenController -} - -func (s *serviceAccountTokenClient) ObjectClient() *objectclient.ObjectClient { - return s.objectClient -} - -func (s *serviceAccountTokenClient) Create(o *ServiceAccountToken) (*ServiceAccountToken, error) { - obj, err := s.objectClient.Create(o) - return obj.(*ServiceAccountToken), err -} - -func (s *serviceAccountTokenClient) Get(name string, opts metav1.GetOptions) (*ServiceAccountToken, error) { - obj, err := s.objectClient.Get(name, opts) - return obj.(*ServiceAccountToken), err -} - -func (s *serviceAccountTokenClient) GetNamespaced(namespace, name string, opts metav1.GetOptions) (*ServiceAccountToken, error) { - obj, err := s.objectClient.GetNamespaced(namespace, name, opts) - return obj.(*ServiceAccountToken), err -} - -func (s *serviceAccountTokenClient) Update(o *ServiceAccountToken) (*ServiceAccountToken, error) { - obj, err := s.objectClient.Update(o.Name, o) - return obj.(*ServiceAccountToken), err -} - -func (s *serviceAccountTokenClient) UpdateStatus(o *ServiceAccountToken) (*ServiceAccountToken, error) { - obj, err := s.objectClient.UpdateStatus(o.Name, o) - return obj.(*ServiceAccountToken), err -} - -func (s *serviceAccountTokenClient) Delete(name string, options *metav1.DeleteOptions) error { - return s.objectClient.Delete(name, options) -} - -func (s *serviceAccountTokenClient) DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error { - return s.objectClient.DeleteNamespaced(namespace, name, options) -} - -func (s *serviceAccountTokenClient) List(opts metav1.ListOptions) (*ServiceAccountTokenList, error) { - obj, err := s.objectClient.List(opts) - return obj.(*ServiceAccountTokenList), err -} - -func (s *serviceAccountTokenClient) ListNamespaced(namespace string, opts metav1.ListOptions) (*ServiceAccountTokenList, error) { - obj, err := s.objectClient.ListNamespaced(namespace, opts) - return obj.(*ServiceAccountTokenList), err -} - -func (s *serviceAccountTokenClient) Watch(opts metav1.ListOptions) (watch.Interface, error) { - return s.objectClient.Watch(opts) -} - -// Patch applies the patch and returns the patched deployment. -func (s *serviceAccountTokenClient) Patch(o *ServiceAccountToken, patchType types.PatchType, data []byte, subresources ...string) (*ServiceAccountToken, error) { - obj, err := s.objectClient.Patch(o.Name, o, patchType, data, subresources...) - return obj.(*ServiceAccountToken), err -} - -func (s *serviceAccountTokenClient) DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error { - return s.objectClient.DeleteCollection(deleteOpts, listOpts) -} - -func (s *serviceAccountTokenClient) AddHandler(ctx context.Context, name string, sync ServiceAccountTokenHandlerFunc) { - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *serviceAccountTokenClient) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync ServiceAccountTokenHandlerFunc) { - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *serviceAccountTokenClient) AddLifecycle(ctx context.Context, name string, lifecycle ServiceAccountTokenLifecycle) { - sync := NewServiceAccountTokenLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *serviceAccountTokenClient) AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle ServiceAccountTokenLifecycle) { - sync := NewServiceAccountTokenLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *serviceAccountTokenClient) AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync ServiceAccountTokenHandlerFunc) { - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *serviceAccountTokenClient) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync ServiceAccountTokenHandlerFunc) { - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} - -func (s *serviceAccountTokenClient) AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle ServiceAccountTokenLifecycle) { - sync := NewServiceAccountTokenLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *serviceAccountTokenClient) AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle ServiceAccountTokenLifecycle) { - sync := NewServiceAccountTokenLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} diff --git a/vendor/github.com/rancher/types/apis/project.cattle.io/v3/zz_generated_service_account_token_lifecycle_adapter.go b/vendor/github.com/rancher/types/apis/project.cattle.io/v3/zz_generated_service_account_token_lifecycle_adapter.go deleted file mode 100644 index b01dcbf5..00000000 --- a/vendor/github.com/rancher/types/apis/project.cattle.io/v3/zz_generated_service_account_token_lifecycle_adapter.go +++ /dev/null @@ -1,66 +0,0 @@ -package v3 - -import ( - "github.com/rancher/norman/lifecycle" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/runtime" -) - -type ServiceAccountTokenLifecycle interface { - Create(obj *ServiceAccountToken) (runtime.Object, error) - Remove(obj *ServiceAccountToken) (runtime.Object, error) - Updated(obj *ServiceAccountToken) (runtime.Object, error) -} - -type serviceAccountTokenLifecycleAdapter struct { - lifecycle ServiceAccountTokenLifecycle -} - -func (w *serviceAccountTokenLifecycleAdapter) HasCreate() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasCreate() -} - -func (w *serviceAccountTokenLifecycleAdapter) HasFinalize() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasFinalize() -} - -func (w *serviceAccountTokenLifecycleAdapter) Create(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Create(obj.(*ServiceAccountToken)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *serviceAccountTokenLifecycleAdapter) Finalize(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Remove(obj.(*ServiceAccountToken)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *serviceAccountTokenLifecycleAdapter) Updated(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Updated(obj.(*ServiceAccountToken)) - if o == nil { - return nil, err - } - return o, err -} - -func NewServiceAccountTokenLifecycleAdapter(name string, clusterScoped bool, client ServiceAccountTokenInterface, l ServiceAccountTokenLifecycle) ServiceAccountTokenHandlerFunc { - if clusterScoped { - resource.PutClusterScoped(ServiceAccountTokenGroupVersionResource) - } - adapter := &serviceAccountTokenLifecycleAdapter{lifecycle: l} - syncFn := lifecycle.NewObjectLifecycleAdapter(name, clusterScoped, adapter, client.ObjectClient()) - return func(key string, obj *ServiceAccountToken) (runtime.Object, error) { - newObj, err := syncFn(key, obj) - if o, ok := newObj.(runtime.Object); ok { - return o, err - } - return nil, err - } -} diff --git a/vendor/github.com/rancher/types/apis/project.cattle.io/v3/zz_generated_source_code_credential_controller.go b/vendor/github.com/rancher/types/apis/project.cattle.io/v3/zz_generated_source_code_credential_controller.go deleted file mode 100644 index 3508e344..00000000 --- a/vendor/github.com/rancher/types/apis/project.cattle.io/v3/zz_generated_source_code_credential_controller.go +++ /dev/null @@ -1,321 +0,0 @@ -package v3 - -import ( - "context" - "time" - - "github.com/rancher/norman/controller" - "github.com/rancher/norman/objectclient" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/apimachinery/pkg/types" - "k8s.io/apimachinery/pkg/watch" - "k8s.io/client-go/tools/cache" -) - -var ( - SourceCodeCredentialGroupVersionKind = schema.GroupVersionKind{ - Version: Version, - Group: GroupName, - Kind: "SourceCodeCredential", - } - SourceCodeCredentialResource = metav1.APIResource{ - Name: "sourcecodecredentials", - SingularName: "sourcecodecredential", - Namespaced: true, - - Kind: SourceCodeCredentialGroupVersionKind.Kind, - } - - SourceCodeCredentialGroupVersionResource = schema.GroupVersionResource{ - Group: GroupName, - Version: Version, - Resource: "sourcecodecredentials", - } -) - -func init() { - resource.Put(SourceCodeCredentialGroupVersionResource) -} - -func NewSourceCodeCredential(namespace, name string, obj SourceCodeCredential) *SourceCodeCredential { - obj.APIVersion, obj.Kind = SourceCodeCredentialGroupVersionKind.ToAPIVersionAndKind() - obj.Name = name - obj.Namespace = namespace - return &obj -} - -type SourceCodeCredentialList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []SourceCodeCredential `json:"items"` -} - -type SourceCodeCredentialHandlerFunc func(key string, obj *SourceCodeCredential) (runtime.Object, error) - -type SourceCodeCredentialChangeHandlerFunc func(obj *SourceCodeCredential) (runtime.Object, error) - -type SourceCodeCredentialLister interface { - List(namespace string, selector labels.Selector) (ret []*SourceCodeCredential, err error) - Get(namespace, name string) (*SourceCodeCredential, error) -} - -type SourceCodeCredentialController interface { - Generic() controller.GenericController - Informer() cache.SharedIndexInformer - Lister() SourceCodeCredentialLister - AddHandler(ctx context.Context, name string, handler SourceCodeCredentialHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync SourceCodeCredentialHandlerFunc) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, handler SourceCodeCredentialHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, handler SourceCodeCredentialHandlerFunc) - Enqueue(namespace, name string) - EnqueueAfter(namespace, name string, after time.Duration) -} - -type SourceCodeCredentialInterface interface { - ObjectClient() *objectclient.ObjectClient - Create(*SourceCodeCredential) (*SourceCodeCredential, error) - GetNamespaced(namespace, name string, opts metav1.GetOptions) (*SourceCodeCredential, error) - Get(name string, opts metav1.GetOptions) (*SourceCodeCredential, error) - Update(*SourceCodeCredential) (*SourceCodeCredential, error) - Delete(name string, options *metav1.DeleteOptions) error - DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error - List(opts metav1.ListOptions) (*SourceCodeCredentialList, error) - ListNamespaced(namespace string, opts metav1.ListOptions) (*SourceCodeCredentialList, error) - Watch(opts metav1.ListOptions) (watch.Interface, error) - DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error - Controller() SourceCodeCredentialController - AddHandler(ctx context.Context, name string, sync SourceCodeCredentialHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync SourceCodeCredentialHandlerFunc) - AddLifecycle(ctx context.Context, name string, lifecycle SourceCodeCredentialLifecycle) - AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle SourceCodeCredentialLifecycle) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync SourceCodeCredentialHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync SourceCodeCredentialHandlerFunc) - AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle SourceCodeCredentialLifecycle) - AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle SourceCodeCredentialLifecycle) -} - -type sourceCodeCredentialLister struct { - controller *sourceCodeCredentialController -} - -func (l *sourceCodeCredentialLister) List(namespace string, selector labels.Selector) (ret []*SourceCodeCredential, err error) { - err = cache.ListAllByNamespace(l.controller.Informer().GetIndexer(), namespace, selector, func(obj interface{}) { - ret = append(ret, obj.(*SourceCodeCredential)) - }) - return -} - -func (l *sourceCodeCredentialLister) Get(namespace, name string) (*SourceCodeCredential, error) { - var key string - if namespace != "" { - key = namespace + "/" + name - } else { - key = name - } - obj, exists, err := l.controller.Informer().GetIndexer().GetByKey(key) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(schema.GroupResource{ - Group: SourceCodeCredentialGroupVersionKind.Group, - Resource: SourceCodeCredentialGroupVersionResource.Resource, - }, key) - } - return obj.(*SourceCodeCredential), nil -} - -type sourceCodeCredentialController struct { - controller.GenericController -} - -func (c *sourceCodeCredentialController) Generic() controller.GenericController { - return c.GenericController -} - -func (c *sourceCodeCredentialController) Lister() SourceCodeCredentialLister { - return &sourceCodeCredentialLister{ - controller: c, - } -} - -func (c *sourceCodeCredentialController) AddHandler(ctx context.Context, name string, handler SourceCodeCredentialHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*SourceCodeCredential); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *sourceCodeCredentialController) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, handler SourceCodeCredentialHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*SourceCodeCredential); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *sourceCodeCredentialController) AddClusterScopedHandler(ctx context.Context, name, cluster string, handler SourceCodeCredentialHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*SourceCodeCredential); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *sourceCodeCredentialController) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, cluster string, handler SourceCodeCredentialHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*SourceCodeCredential); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -type sourceCodeCredentialFactory struct { -} - -func (c sourceCodeCredentialFactory) Object() runtime.Object { - return &SourceCodeCredential{} -} - -func (c sourceCodeCredentialFactory) List() runtime.Object { - return &SourceCodeCredentialList{} -} - -func (s *sourceCodeCredentialClient) Controller() SourceCodeCredentialController { - genericController := controller.NewGenericController(SourceCodeCredentialGroupVersionKind.Kind+"Controller", - s.client.controllerFactory.ForResourceKind(SourceCodeCredentialGroupVersionResource, SourceCodeCredentialGroupVersionKind.Kind, true)) - - return &sourceCodeCredentialController{ - GenericController: genericController, - } -} - -type sourceCodeCredentialClient struct { - client *Client - ns string - objectClient *objectclient.ObjectClient - controller SourceCodeCredentialController -} - -func (s *sourceCodeCredentialClient) ObjectClient() *objectclient.ObjectClient { - return s.objectClient -} - -func (s *sourceCodeCredentialClient) Create(o *SourceCodeCredential) (*SourceCodeCredential, error) { - obj, err := s.objectClient.Create(o) - return obj.(*SourceCodeCredential), err -} - -func (s *sourceCodeCredentialClient) Get(name string, opts metav1.GetOptions) (*SourceCodeCredential, error) { - obj, err := s.objectClient.Get(name, opts) - return obj.(*SourceCodeCredential), err -} - -func (s *sourceCodeCredentialClient) GetNamespaced(namespace, name string, opts metav1.GetOptions) (*SourceCodeCredential, error) { - obj, err := s.objectClient.GetNamespaced(namespace, name, opts) - return obj.(*SourceCodeCredential), err -} - -func (s *sourceCodeCredentialClient) Update(o *SourceCodeCredential) (*SourceCodeCredential, error) { - obj, err := s.objectClient.Update(o.Name, o) - return obj.(*SourceCodeCredential), err -} - -func (s *sourceCodeCredentialClient) UpdateStatus(o *SourceCodeCredential) (*SourceCodeCredential, error) { - obj, err := s.objectClient.UpdateStatus(o.Name, o) - return obj.(*SourceCodeCredential), err -} - -func (s *sourceCodeCredentialClient) Delete(name string, options *metav1.DeleteOptions) error { - return s.objectClient.Delete(name, options) -} - -func (s *sourceCodeCredentialClient) DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error { - return s.objectClient.DeleteNamespaced(namespace, name, options) -} - -func (s *sourceCodeCredentialClient) List(opts metav1.ListOptions) (*SourceCodeCredentialList, error) { - obj, err := s.objectClient.List(opts) - return obj.(*SourceCodeCredentialList), err -} - -func (s *sourceCodeCredentialClient) ListNamespaced(namespace string, opts metav1.ListOptions) (*SourceCodeCredentialList, error) { - obj, err := s.objectClient.ListNamespaced(namespace, opts) - return obj.(*SourceCodeCredentialList), err -} - -func (s *sourceCodeCredentialClient) Watch(opts metav1.ListOptions) (watch.Interface, error) { - return s.objectClient.Watch(opts) -} - -// Patch applies the patch and returns the patched deployment. -func (s *sourceCodeCredentialClient) Patch(o *SourceCodeCredential, patchType types.PatchType, data []byte, subresources ...string) (*SourceCodeCredential, error) { - obj, err := s.objectClient.Patch(o.Name, o, patchType, data, subresources...) - return obj.(*SourceCodeCredential), err -} - -func (s *sourceCodeCredentialClient) DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error { - return s.objectClient.DeleteCollection(deleteOpts, listOpts) -} - -func (s *sourceCodeCredentialClient) AddHandler(ctx context.Context, name string, sync SourceCodeCredentialHandlerFunc) { - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *sourceCodeCredentialClient) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync SourceCodeCredentialHandlerFunc) { - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *sourceCodeCredentialClient) AddLifecycle(ctx context.Context, name string, lifecycle SourceCodeCredentialLifecycle) { - sync := NewSourceCodeCredentialLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *sourceCodeCredentialClient) AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle SourceCodeCredentialLifecycle) { - sync := NewSourceCodeCredentialLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *sourceCodeCredentialClient) AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync SourceCodeCredentialHandlerFunc) { - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *sourceCodeCredentialClient) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync SourceCodeCredentialHandlerFunc) { - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} - -func (s *sourceCodeCredentialClient) AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle SourceCodeCredentialLifecycle) { - sync := NewSourceCodeCredentialLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *sourceCodeCredentialClient) AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle SourceCodeCredentialLifecycle) { - sync := NewSourceCodeCredentialLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} diff --git a/vendor/github.com/rancher/types/apis/project.cattle.io/v3/zz_generated_source_code_credential_lifecycle_adapter.go b/vendor/github.com/rancher/types/apis/project.cattle.io/v3/zz_generated_source_code_credential_lifecycle_adapter.go deleted file mode 100644 index 873e6fff..00000000 --- a/vendor/github.com/rancher/types/apis/project.cattle.io/v3/zz_generated_source_code_credential_lifecycle_adapter.go +++ /dev/null @@ -1,66 +0,0 @@ -package v3 - -import ( - "github.com/rancher/norman/lifecycle" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/runtime" -) - -type SourceCodeCredentialLifecycle interface { - Create(obj *SourceCodeCredential) (runtime.Object, error) - Remove(obj *SourceCodeCredential) (runtime.Object, error) - Updated(obj *SourceCodeCredential) (runtime.Object, error) -} - -type sourceCodeCredentialLifecycleAdapter struct { - lifecycle SourceCodeCredentialLifecycle -} - -func (w *sourceCodeCredentialLifecycleAdapter) HasCreate() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasCreate() -} - -func (w *sourceCodeCredentialLifecycleAdapter) HasFinalize() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasFinalize() -} - -func (w *sourceCodeCredentialLifecycleAdapter) Create(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Create(obj.(*SourceCodeCredential)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *sourceCodeCredentialLifecycleAdapter) Finalize(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Remove(obj.(*SourceCodeCredential)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *sourceCodeCredentialLifecycleAdapter) Updated(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Updated(obj.(*SourceCodeCredential)) - if o == nil { - return nil, err - } - return o, err -} - -func NewSourceCodeCredentialLifecycleAdapter(name string, clusterScoped bool, client SourceCodeCredentialInterface, l SourceCodeCredentialLifecycle) SourceCodeCredentialHandlerFunc { - if clusterScoped { - resource.PutClusterScoped(SourceCodeCredentialGroupVersionResource) - } - adapter := &sourceCodeCredentialLifecycleAdapter{lifecycle: l} - syncFn := lifecycle.NewObjectLifecycleAdapter(name, clusterScoped, adapter, client.ObjectClient()) - return func(key string, obj *SourceCodeCredential) (runtime.Object, error) { - newObj, err := syncFn(key, obj) - if o, ok := newObj.(runtime.Object); ok { - return o, err - } - return nil, err - } -} diff --git a/vendor/github.com/rancher/types/apis/project.cattle.io/v3/zz_generated_source_code_provider_config_controller.go b/vendor/github.com/rancher/types/apis/project.cattle.io/v3/zz_generated_source_code_provider_config_controller.go deleted file mode 100644 index 5ad9a638..00000000 --- a/vendor/github.com/rancher/types/apis/project.cattle.io/v3/zz_generated_source_code_provider_config_controller.go +++ /dev/null @@ -1,321 +0,0 @@ -package v3 - -import ( - "context" - "time" - - "github.com/rancher/norman/controller" - "github.com/rancher/norman/objectclient" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/apimachinery/pkg/types" - "k8s.io/apimachinery/pkg/watch" - "k8s.io/client-go/tools/cache" -) - -var ( - SourceCodeProviderConfigGroupVersionKind = schema.GroupVersionKind{ - Version: Version, - Group: GroupName, - Kind: "SourceCodeProviderConfig", - } - SourceCodeProviderConfigResource = metav1.APIResource{ - Name: "sourcecodeproviderconfigs", - SingularName: "sourcecodeproviderconfig", - Namespaced: true, - - Kind: SourceCodeProviderConfigGroupVersionKind.Kind, - } - - SourceCodeProviderConfigGroupVersionResource = schema.GroupVersionResource{ - Group: GroupName, - Version: Version, - Resource: "sourcecodeproviderconfigs", - } -) - -func init() { - resource.Put(SourceCodeProviderConfigGroupVersionResource) -} - -func NewSourceCodeProviderConfig(namespace, name string, obj SourceCodeProviderConfig) *SourceCodeProviderConfig { - obj.APIVersion, obj.Kind = SourceCodeProviderConfigGroupVersionKind.ToAPIVersionAndKind() - obj.Name = name - obj.Namespace = namespace - return &obj -} - -type SourceCodeProviderConfigList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []SourceCodeProviderConfig `json:"items"` -} - -type SourceCodeProviderConfigHandlerFunc func(key string, obj *SourceCodeProviderConfig) (runtime.Object, error) - -type SourceCodeProviderConfigChangeHandlerFunc func(obj *SourceCodeProviderConfig) (runtime.Object, error) - -type SourceCodeProviderConfigLister interface { - List(namespace string, selector labels.Selector) (ret []*SourceCodeProviderConfig, err error) - Get(namespace, name string) (*SourceCodeProviderConfig, error) -} - -type SourceCodeProviderConfigController interface { - Generic() controller.GenericController - Informer() cache.SharedIndexInformer - Lister() SourceCodeProviderConfigLister - AddHandler(ctx context.Context, name string, handler SourceCodeProviderConfigHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync SourceCodeProviderConfigHandlerFunc) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, handler SourceCodeProviderConfigHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, handler SourceCodeProviderConfigHandlerFunc) - Enqueue(namespace, name string) - EnqueueAfter(namespace, name string, after time.Duration) -} - -type SourceCodeProviderConfigInterface interface { - ObjectClient() *objectclient.ObjectClient - Create(*SourceCodeProviderConfig) (*SourceCodeProviderConfig, error) - GetNamespaced(namespace, name string, opts metav1.GetOptions) (*SourceCodeProviderConfig, error) - Get(name string, opts metav1.GetOptions) (*SourceCodeProviderConfig, error) - Update(*SourceCodeProviderConfig) (*SourceCodeProviderConfig, error) - Delete(name string, options *metav1.DeleteOptions) error - DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error - List(opts metav1.ListOptions) (*SourceCodeProviderConfigList, error) - ListNamespaced(namespace string, opts metav1.ListOptions) (*SourceCodeProviderConfigList, error) - Watch(opts metav1.ListOptions) (watch.Interface, error) - DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error - Controller() SourceCodeProviderConfigController - AddHandler(ctx context.Context, name string, sync SourceCodeProviderConfigHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync SourceCodeProviderConfigHandlerFunc) - AddLifecycle(ctx context.Context, name string, lifecycle SourceCodeProviderConfigLifecycle) - AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle SourceCodeProviderConfigLifecycle) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync SourceCodeProviderConfigHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync SourceCodeProviderConfigHandlerFunc) - AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle SourceCodeProviderConfigLifecycle) - AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle SourceCodeProviderConfigLifecycle) -} - -type sourceCodeProviderConfigLister struct { - controller *sourceCodeProviderConfigController -} - -func (l *sourceCodeProviderConfigLister) List(namespace string, selector labels.Selector) (ret []*SourceCodeProviderConfig, err error) { - err = cache.ListAllByNamespace(l.controller.Informer().GetIndexer(), namespace, selector, func(obj interface{}) { - ret = append(ret, obj.(*SourceCodeProviderConfig)) - }) - return -} - -func (l *sourceCodeProviderConfigLister) Get(namespace, name string) (*SourceCodeProviderConfig, error) { - var key string - if namespace != "" { - key = namespace + "/" + name - } else { - key = name - } - obj, exists, err := l.controller.Informer().GetIndexer().GetByKey(key) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(schema.GroupResource{ - Group: SourceCodeProviderConfigGroupVersionKind.Group, - Resource: SourceCodeProviderConfigGroupVersionResource.Resource, - }, key) - } - return obj.(*SourceCodeProviderConfig), nil -} - -type sourceCodeProviderConfigController struct { - controller.GenericController -} - -func (c *sourceCodeProviderConfigController) Generic() controller.GenericController { - return c.GenericController -} - -func (c *sourceCodeProviderConfigController) Lister() SourceCodeProviderConfigLister { - return &sourceCodeProviderConfigLister{ - controller: c, - } -} - -func (c *sourceCodeProviderConfigController) AddHandler(ctx context.Context, name string, handler SourceCodeProviderConfigHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*SourceCodeProviderConfig); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *sourceCodeProviderConfigController) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, handler SourceCodeProviderConfigHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*SourceCodeProviderConfig); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *sourceCodeProviderConfigController) AddClusterScopedHandler(ctx context.Context, name, cluster string, handler SourceCodeProviderConfigHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*SourceCodeProviderConfig); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *sourceCodeProviderConfigController) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, cluster string, handler SourceCodeProviderConfigHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*SourceCodeProviderConfig); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -type sourceCodeProviderConfigFactory struct { -} - -func (c sourceCodeProviderConfigFactory) Object() runtime.Object { - return &SourceCodeProviderConfig{} -} - -func (c sourceCodeProviderConfigFactory) List() runtime.Object { - return &SourceCodeProviderConfigList{} -} - -func (s *sourceCodeProviderConfigClient) Controller() SourceCodeProviderConfigController { - genericController := controller.NewGenericController(SourceCodeProviderConfigGroupVersionKind.Kind+"Controller", - s.client.controllerFactory.ForResourceKind(SourceCodeProviderConfigGroupVersionResource, SourceCodeProviderConfigGroupVersionKind.Kind, true)) - - return &sourceCodeProviderConfigController{ - GenericController: genericController, - } -} - -type sourceCodeProviderConfigClient struct { - client *Client - ns string - objectClient *objectclient.ObjectClient - controller SourceCodeProviderConfigController -} - -func (s *sourceCodeProviderConfigClient) ObjectClient() *objectclient.ObjectClient { - return s.objectClient -} - -func (s *sourceCodeProviderConfigClient) Create(o *SourceCodeProviderConfig) (*SourceCodeProviderConfig, error) { - obj, err := s.objectClient.Create(o) - return obj.(*SourceCodeProviderConfig), err -} - -func (s *sourceCodeProviderConfigClient) Get(name string, opts metav1.GetOptions) (*SourceCodeProviderConfig, error) { - obj, err := s.objectClient.Get(name, opts) - return obj.(*SourceCodeProviderConfig), err -} - -func (s *sourceCodeProviderConfigClient) GetNamespaced(namespace, name string, opts metav1.GetOptions) (*SourceCodeProviderConfig, error) { - obj, err := s.objectClient.GetNamespaced(namespace, name, opts) - return obj.(*SourceCodeProviderConfig), err -} - -func (s *sourceCodeProviderConfigClient) Update(o *SourceCodeProviderConfig) (*SourceCodeProviderConfig, error) { - obj, err := s.objectClient.Update(o.Name, o) - return obj.(*SourceCodeProviderConfig), err -} - -func (s *sourceCodeProviderConfigClient) UpdateStatus(o *SourceCodeProviderConfig) (*SourceCodeProviderConfig, error) { - obj, err := s.objectClient.UpdateStatus(o.Name, o) - return obj.(*SourceCodeProviderConfig), err -} - -func (s *sourceCodeProviderConfigClient) Delete(name string, options *metav1.DeleteOptions) error { - return s.objectClient.Delete(name, options) -} - -func (s *sourceCodeProviderConfigClient) DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error { - return s.objectClient.DeleteNamespaced(namespace, name, options) -} - -func (s *sourceCodeProviderConfigClient) List(opts metav1.ListOptions) (*SourceCodeProviderConfigList, error) { - obj, err := s.objectClient.List(opts) - return obj.(*SourceCodeProviderConfigList), err -} - -func (s *sourceCodeProviderConfigClient) ListNamespaced(namespace string, opts metav1.ListOptions) (*SourceCodeProviderConfigList, error) { - obj, err := s.objectClient.ListNamespaced(namespace, opts) - return obj.(*SourceCodeProviderConfigList), err -} - -func (s *sourceCodeProviderConfigClient) Watch(opts metav1.ListOptions) (watch.Interface, error) { - return s.objectClient.Watch(opts) -} - -// Patch applies the patch and returns the patched deployment. -func (s *sourceCodeProviderConfigClient) Patch(o *SourceCodeProviderConfig, patchType types.PatchType, data []byte, subresources ...string) (*SourceCodeProviderConfig, error) { - obj, err := s.objectClient.Patch(o.Name, o, patchType, data, subresources...) - return obj.(*SourceCodeProviderConfig), err -} - -func (s *sourceCodeProviderConfigClient) DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error { - return s.objectClient.DeleteCollection(deleteOpts, listOpts) -} - -func (s *sourceCodeProviderConfigClient) AddHandler(ctx context.Context, name string, sync SourceCodeProviderConfigHandlerFunc) { - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *sourceCodeProviderConfigClient) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync SourceCodeProviderConfigHandlerFunc) { - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *sourceCodeProviderConfigClient) AddLifecycle(ctx context.Context, name string, lifecycle SourceCodeProviderConfigLifecycle) { - sync := NewSourceCodeProviderConfigLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *sourceCodeProviderConfigClient) AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle SourceCodeProviderConfigLifecycle) { - sync := NewSourceCodeProviderConfigLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *sourceCodeProviderConfigClient) AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync SourceCodeProviderConfigHandlerFunc) { - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *sourceCodeProviderConfigClient) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync SourceCodeProviderConfigHandlerFunc) { - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} - -func (s *sourceCodeProviderConfigClient) AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle SourceCodeProviderConfigLifecycle) { - sync := NewSourceCodeProviderConfigLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *sourceCodeProviderConfigClient) AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle SourceCodeProviderConfigLifecycle) { - sync := NewSourceCodeProviderConfigLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} diff --git a/vendor/github.com/rancher/types/apis/project.cattle.io/v3/zz_generated_source_code_provider_config_lifecycle_adapter.go b/vendor/github.com/rancher/types/apis/project.cattle.io/v3/zz_generated_source_code_provider_config_lifecycle_adapter.go deleted file mode 100644 index 325a4d4f..00000000 --- a/vendor/github.com/rancher/types/apis/project.cattle.io/v3/zz_generated_source_code_provider_config_lifecycle_adapter.go +++ /dev/null @@ -1,66 +0,0 @@ -package v3 - -import ( - "github.com/rancher/norman/lifecycle" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/runtime" -) - -type SourceCodeProviderConfigLifecycle interface { - Create(obj *SourceCodeProviderConfig) (runtime.Object, error) - Remove(obj *SourceCodeProviderConfig) (runtime.Object, error) - Updated(obj *SourceCodeProviderConfig) (runtime.Object, error) -} - -type sourceCodeProviderConfigLifecycleAdapter struct { - lifecycle SourceCodeProviderConfigLifecycle -} - -func (w *sourceCodeProviderConfigLifecycleAdapter) HasCreate() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasCreate() -} - -func (w *sourceCodeProviderConfigLifecycleAdapter) HasFinalize() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasFinalize() -} - -func (w *sourceCodeProviderConfigLifecycleAdapter) Create(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Create(obj.(*SourceCodeProviderConfig)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *sourceCodeProviderConfigLifecycleAdapter) Finalize(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Remove(obj.(*SourceCodeProviderConfig)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *sourceCodeProviderConfigLifecycleAdapter) Updated(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Updated(obj.(*SourceCodeProviderConfig)) - if o == nil { - return nil, err - } - return o, err -} - -func NewSourceCodeProviderConfigLifecycleAdapter(name string, clusterScoped bool, client SourceCodeProviderConfigInterface, l SourceCodeProviderConfigLifecycle) SourceCodeProviderConfigHandlerFunc { - if clusterScoped { - resource.PutClusterScoped(SourceCodeProviderConfigGroupVersionResource) - } - adapter := &sourceCodeProviderConfigLifecycleAdapter{lifecycle: l} - syncFn := lifecycle.NewObjectLifecycleAdapter(name, clusterScoped, adapter, client.ObjectClient()) - return func(key string, obj *SourceCodeProviderConfig) (runtime.Object, error) { - newObj, err := syncFn(key, obj) - if o, ok := newObj.(runtime.Object); ok { - return o, err - } - return nil, err - } -} diff --git a/vendor/github.com/rancher/types/apis/project.cattle.io/v3/zz_generated_source_code_provider_controller.go b/vendor/github.com/rancher/types/apis/project.cattle.io/v3/zz_generated_source_code_provider_controller.go deleted file mode 100644 index 50bc2057..00000000 --- a/vendor/github.com/rancher/types/apis/project.cattle.io/v3/zz_generated_source_code_provider_controller.go +++ /dev/null @@ -1,320 +0,0 @@ -package v3 - -import ( - "context" - "time" - - "github.com/rancher/norman/controller" - "github.com/rancher/norman/objectclient" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/apimachinery/pkg/types" - "k8s.io/apimachinery/pkg/watch" - "k8s.io/client-go/tools/cache" -) - -var ( - SourceCodeProviderGroupVersionKind = schema.GroupVersionKind{ - Version: Version, - Group: GroupName, - Kind: "SourceCodeProvider", - } - SourceCodeProviderResource = metav1.APIResource{ - Name: "sourcecodeproviders", - SingularName: "sourcecodeprovider", - Namespaced: false, - Kind: SourceCodeProviderGroupVersionKind.Kind, - } - - SourceCodeProviderGroupVersionResource = schema.GroupVersionResource{ - Group: GroupName, - Version: Version, - Resource: "sourcecodeproviders", - } -) - -func init() { - resource.Put(SourceCodeProviderGroupVersionResource) -} - -func NewSourceCodeProvider(namespace, name string, obj SourceCodeProvider) *SourceCodeProvider { - obj.APIVersion, obj.Kind = SourceCodeProviderGroupVersionKind.ToAPIVersionAndKind() - obj.Name = name - obj.Namespace = namespace - return &obj -} - -type SourceCodeProviderList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []SourceCodeProvider `json:"items"` -} - -type SourceCodeProviderHandlerFunc func(key string, obj *SourceCodeProvider) (runtime.Object, error) - -type SourceCodeProviderChangeHandlerFunc func(obj *SourceCodeProvider) (runtime.Object, error) - -type SourceCodeProviderLister interface { - List(namespace string, selector labels.Selector) (ret []*SourceCodeProvider, err error) - Get(namespace, name string) (*SourceCodeProvider, error) -} - -type SourceCodeProviderController interface { - Generic() controller.GenericController - Informer() cache.SharedIndexInformer - Lister() SourceCodeProviderLister - AddHandler(ctx context.Context, name string, handler SourceCodeProviderHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync SourceCodeProviderHandlerFunc) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, handler SourceCodeProviderHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, handler SourceCodeProviderHandlerFunc) - Enqueue(namespace, name string) - EnqueueAfter(namespace, name string, after time.Duration) -} - -type SourceCodeProviderInterface interface { - ObjectClient() *objectclient.ObjectClient - Create(*SourceCodeProvider) (*SourceCodeProvider, error) - GetNamespaced(namespace, name string, opts metav1.GetOptions) (*SourceCodeProvider, error) - Get(name string, opts metav1.GetOptions) (*SourceCodeProvider, error) - Update(*SourceCodeProvider) (*SourceCodeProvider, error) - Delete(name string, options *metav1.DeleteOptions) error - DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error - List(opts metav1.ListOptions) (*SourceCodeProviderList, error) - ListNamespaced(namespace string, opts metav1.ListOptions) (*SourceCodeProviderList, error) - Watch(opts metav1.ListOptions) (watch.Interface, error) - DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error - Controller() SourceCodeProviderController - AddHandler(ctx context.Context, name string, sync SourceCodeProviderHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync SourceCodeProviderHandlerFunc) - AddLifecycle(ctx context.Context, name string, lifecycle SourceCodeProviderLifecycle) - AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle SourceCodeProviderLifecycle) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync SourceCodeProviderHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync SourceCodeProviderHandlerFunc) - AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle SourceCodeProviderLifecycle) - AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle SourceCodeProviderLifecycle) -} - -type sourceCodeProviderLister struct { - controller *sourceCodeProviderController -} - -func (l *sourceCodeProviderLister) List(namespace string, selector labels.Selector) (ret []*SourceCodeProvider, err error) { - err = cache.ListAllByNamespace(l.controller.Informer().GetIndexer(), namespace, selector, func(obj interface{}) { - ret = append(ret, obj.(*SourceCodeProvider)) - }) - return -} - -func (l *sourceCodeProviderLister) Get(namespace, name string) (*SourceCodeProvider, error) { - var key string - if namespace != "" { - key = namespace + "/" + name - } else { - key = name - } - obj, exists, err := l.controller.Informer().GetIndexer().GetByKey(key) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(schema.GroupResource{ - Group: SourceCodeProviderGroupVersionKind.Group, - Resource: SourceCodeProviderGroupVersionResource.Resource, - }, key) - } - return obj.(*SourceCodeProvider), nil -} - -type sourceCodeProviderController struct { - controller.GenericController -} - -func (c *sourceCodeProviderController) Generic() controller.GenericController { - return c.GenericController -} - -func (c *sourceCodeProviderController) Lister() SourceCodeProviderLister { - return &sourceCodeProviderLister{ - controller: c, - } -} - -func (c *sourceCodeProviderController) AddHandler(ctx context.Context, name string, handler SourceCodeProviderHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*SourceCodeProvider); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *sourceCodeProviderController) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, handler SourceCodeProviderHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*SourceCodeProvider); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *sourceCodeProviderController) AddClusterScopedHandler(ctx context.Context, name, cluster string, handler SourceCodeProviderHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*SourceCodeProvider); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *sourceCodeProviderController) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, cluster string, handler SourceCodeProviderHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*SourceCodeProvider); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -type sourceCodeProviderFactory struct { -} - -func (c sourceCodeProviderFactory) Object() runtime.Object { - return &SourceCodeProvider{} -} - -func (c sourceCodeProviderFactory) List() runtime.Object { - return &SourceCodeProviderList{} -} - -func (s *sourceCodeProviderClient) Controller() SourceCodeProviderController { - genericController := controller.NewGenericController(SourceCodeProviderGroupVersionKind.Kind+"Controller", - s.client.controllerFactory.ForResourceKind(SourceCodeProviderGroupVersionResource, SourceCodeProviderGroupVersionKind.Kind, false)) - - return &sourceCodeProviderController{ - GenericController: genericController, - } -} - -type sourceCodeProviderClient struct { - client *Client - ns string - objectClient *objectclient.ObjectClient - controller SourceCodeProviderController -} - -func (s *sourceCodeProviderClient) ObjectClient() *objectclient.ObjectClient { - return s.objectClient -} - -func (s *sourceCodeProviderClient) Create(o *SourceCodeProvider) (*SourceCodeProvider, error) { - obj, err := s.objectClient.Create(o) - return obj.(*SourceCodeProvider), err -} - -func (s *sourceCodeProviderClient) Get(name string, opts metav1.GetOptions) (*SourceCodeProvider, error) { - obj, err := s.objectClient.Get(name, opts) - return obj.(*SourceCodeProvider), err -} - -func (s *sourceCodeProviderClient) GetNamespaced(namespace, name string, opts metav1.GetOptions) (*SourceCodeProvider, error) { - obj, err := s.objectClient.GetNamespaced(namespace, name, opts) - return obj.(*SourceCodeProvider), err -} - -func (s *sourceCodeProviderClient) Update(o *SourceCodeProvider) (*SourceCodeProvider, error) { - obj, err := s.objectClient.Update(o.Name, o) - return obj.(*SourceCodeProvider), err -} - -func (s *sourceCodeProviderClient) UpdateStatus(o *SourceCodeProvider) (*SourceCodeProvider, error) { - obj, err := s.objectClient.UpdateStatus(o.Name, o) - return obj.(*SourceCodeProvider), err -} - -func (s *sourceCodeProviderClient) Delete(name string, options *metav1.DeleteOptions) error { - return s.objectClient.Delete(name, options) -} - -func (s *sourceCodeProviderClient) DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error { - return s.objectClient.DeleteNamespaced(namespace, name, options) -} - -func (s *sourceCodeProviderClient) List(opts metav1.ListOptions) (*SourceCodeProviderList, error) { - obj, err := s.objectClient.List(opts) - return obj.(*SourceCodeProviderList), err -} - -func (s *sourceCodeProviderClient) ListNamespaced(namespace string, opts metav1.ListOptions) (*SourceCodeProviderList, error) { - obj, err := s.objectClient.ListNamespaced(namespace, opts) - return obj.(*SourceCodeProviderList), err -} - -func (s *sourceCodeProviderClient) Watch(opts metav1.ListOptions) (watch.Interface, error) { - return s.objectClient.Watch(opts) -} - -// Patch applies the patch and returns the patched deployment. -func (s *sourceCodeProviderClient) Patch(o *SourceCodeProvider, patchType types.PatchType, data []byte, subresources ...string) (*SourceCodeProvider, error) { - obj, err := s.objectClient.Patch(o.Name, o, patchType, data, subresources...) - return obj.(*SourceCodeProvider), err -} - -func (s *sourceCodeProviderClient) DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error { - return s.objectClient.DeleteCollection(deleteOpts, listOpts) -} - -func (s *sourceCodeProviderClient) AddHandler(ctx context.Context, name string, sync SourceCodeProviderHandlerFunc) { - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *sourceCodeProviderClient) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync SourceCodeProviderHandlerFunc) { - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *sourceCodeProviderClient) AddLifecycle(ctx context.Context, name string, lifecycle SourceCodeProviderLifecycle) { - sync := NewSourceCodeProviderLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *sourceCodeProviderClient) AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle SourceCodeProviderLifecycle) { - sync := NewSourceCodeProviderLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *sourceCodeProviderClient) AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync SourceCodeProviderHandlerFunc) { - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *sourceCodeProviderClient) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync SourceCodeProviderHandlerFunc) { - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} - -func (s *sourceCodeProviderClient) AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle SourceCodeProviderLifecycle) { - sync := NewSourceCodeProviderLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *sourceCodeProviderClient) AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle SourceCodeProviderLifecycle) { - sync := NewSourceCodeProviderLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} diff --git a/vendor/github.com/rancher/types/apis/project.cattle.io/v3/zz_generated_source_code_provider_lifecycle_adapter.go b/vendor/github.com/rancher/types/apis/project.cattle.io/v3/zz_generated_source_code_provider_lifecycle_adapter.go deleted file mode 100644 index 37e6deaa..00000000 --- a/vendor/github.com/rancher/types/apis/project.cattle.io/v3/zz_generated_source_code_provider_lifecycle_adapter.go +++ /dev/null @@ -1,66 +0,0 @@ -package v3 - -import ( - "github.com/rancher/norman/lifecycle" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/runtime" -) - -type SourceCodeProviderLifecycle interface { - Create(obj *SourceCodeProvider) (runtime.Object, error) - Remove(obj *SourceCodeProvider) (runtime.Object, error) - Updated(obj *SourceCodeProvider) (runtime.Object, error) -} - -type sourceCodeProviderLifecycleAdapter struct { - lifecycle SourceCodeProviderLifecycle -} - -func (w *sourceCodeProviderLifecycleAdapter) HasCreate() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasCreate() -} - -func (w *sourceCodeProviderLifecycleAdapter) HasFinalize() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasFinalize() -} - -func (w *sourceCodeProviderLifecycleAdapter) Create(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Create(obj.(*SourceCodeProvider)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *sourceCodeProviderLifecycleAdapter) Finalize(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Remove(obj.(*SourceCodeProvider)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *sourceCodeProviderLifecycleAdapter) Updated(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Updated(obj.(*SourceCodeProvider)) - if o == nil { - return nil, err - } - return o, err -} - -func NewSourceCodeProviderLifecycleAdapter(name string, clusterScoped bool, client SourceCodeProviderInterface, l SourceCodeProviderLifecycle) SourceCodeProviderHandlerFunc { - if clusterScoped { - resource.PutClusterScoped(SourceCodeProviderGroupVersionResource) - } - adapter := &sourceCodeProviderLifecycleAdapter{lifecycle: l} - syncFn := lifecycle.NewObjectLifecycleAdapter(name, clusterScoped, adapter, client.ObjectClient()) - return func(key string, obj *SourceCodeProvider) (runtime.Object, error) { - newObj, err := syncFn(key, obj) - if o, ok := newObj.(runtime.Object); ok { - return o, err - } - return nil, err - } -} diff --git a/vendor/github.com/rancher/types/apis/project.cattle.io/v3/zz_generated_source_code_repository_controller.go b/vendor/github.com/rancher/types/apis/project.cattle.io/v3/zz_generated_source_code_repository_controller.go deleted file mode 100644 index 31c6aeff..00000000 --- a/vendor/github.com/rancher/types/apis/project.cattle.io/v3/zz_generated_source_code_repository_controller.go +++ /dev/null @@ -1,321 +0,0 @@ -package v3 - -import ( - "context" - "time" - - "github.com/rancher/norman/controller" - "github.com/rancher/norman/objectclient" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/apimachinery/pkg/types" - "k8s.io/apimachinery/pkg/watch" - "k8s.io/client-go/tools/cache" -) - -var ( - SourceCodeRepositoryGroupVersionKind = schema.GroupVersionKind{ - Version: Version, - Group: GroupName, - Kind: "SourceCodeRepository", - } - SourceCodeRepositoryResource = metav1.APIResource{ - Name: "sourcecoderepositories", - SingularName: "sourcecoderepository", - Namespaced: true, - - Kind: SourceCodeRepositoryGroupVersionKind.Kind, - } - - SourceCodeRepositoryGroupVersionResource = schema.GroupVersionResource{ - Group: GroupName, - Version: Version, - Resource: "sourcecoderepositories", - } -) - -func init() { - resource.Put(SourceCodeRepositoryGroupVersionResource) -} - -func NewSourceCodeRepository(namespace, name string, obj SourceCodeRepository) *SourceCodeRepository { - obj.APIVersion, obj.Kind = SourceCodeRepositoryGroupVersionKind.ToAPIVersionAndKind() - obj.Name = name - obj.Namespace = namespace - return &obj -} - -type SourceCodeRepositoryList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []SourceCodeRepository `json:"items"` -} - -type SourceCodeRepositoryHandlerFunc func(key string, obj *SourceCodeRepository) (runtime.Object, error) - -type SourceCodeRepositoryChangeHandlerFunc func(obj *SourceCodeRepository) (runtime.Object, error) - -type SourceCodeRepositoryLister interface { - List(namespace string, selector labels.Selector) (ret []*SourceCodeRepository, err error) - Get(namespace, name string) (*SourceCodeRepository, error) -} - -type SourceCodeRepositoryController interface { - Generic() controller.GenericController - Informer() cache.SharedIndexInformer - Lister() SourceCodeRepositoryLister - AddHandler(ctx context.Context, name string, handler SourceCodeRepositoryHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync SourceCodeRepositoryHandlerFunc) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, handler SourceCodeRepositoryHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, handler SourceCodeRepositoryHandlerFunc) - Enqueue(namespace, name string) - EnqueueAfter(namespace, name string, after time.Duration) -} - -type SourceCodeRepositoryInterface interface { - ObjectClient() *objectclient.ObjectClient - Create(*SourceCodeRepository) (*SourceCodeRepository, error) - GetNamespaced(namespace, name string, opts metav1.GetOptions) (*SourceCodeRepository, error) - Get(name string, opts metav1.GetOptions) (*SourceCodeRepository, error) - Update(*SourceCodeRepository) (*SourceCodeRepository, error) - Delete(name string, options *metav1.DeleteOptions) error - DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error - List(opts metav1.ListOptions) (*SourceCodeRepositoryList, error) - ListNamespaced(namespace string, opts metav1.ListOptions) (*SourceCodeRepositoryList, error) - Watch(opts metav1.ListOptions) (watch.Interface, error) - DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error - Controller() SourceCodeRepositoryController - AddHandler(ctx context.Context, name string, sync SourceCodeRepositoryHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync SourceCodeRepositoryHandlerFunc) - AddLifecycle(ctx context.Context, name string, lifecycle SourceCodeRepositoryLifecycle) - AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle SourceCodeRepositoryLifecycle) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync SourceCodeRepositoryHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync SourceCodeRepositoryHandlerFunc) - AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle SourceCodeRepositoryLifecycle) - AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle SourceCodeRepositoryLifecycle) -} - -type sourceCodeRepositoryLister struct { - controller *sourceCodeRepositoryController -} - -func (l *sourceCodeRepositoryLister) List(namespace string, selector labels.Selector) (ret []*SourceCodeRepository, err error) { - err = cache.ListAllByNamespace(l.controller.Informer().GetIndexer(), namespace, selector, func(obj interface{}) { - ret = append(ret, obj.(*SourceCodeRepository)) - }) - return -} - -func (l *sourceCodeRepositoryLister) Get(namespace, name string) (*SourceCodeRepository, error) { - var key string - if namespace != "" { - key = namespace + "/" + name - } else { - key = name - } - obj, exists, err := l.controller.Informer().GetIndexer().GetByKey(key) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(schema.GroupResource{ - Group: SourceCodeRepositoryGroupVersionKind.Group, - Resource: SourceCodeRepositoryGroupVersionResource.Resource, - }, key) - } - return obj.(*SourceCodeRepository), nil -} - -type sourceCodeRepositoryController struct { - controller.GenericController -} - -func (c *sourceCodeRepositoryController) Generic() controller.GenericController { - return c.GenericController -} - -func (c *sourceCodeRepositoryController) Lister() SourceCodeRepositoryLister { - return &sourceCodeRepositoryLister{ - controller: c, - } -} - -func (c *sourceCodeRepositoryController) AddHandler(ctx context.Context, name string, handler SourceCodeRepositoryHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*SourceCodeRepository); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *sourceCodeRepositoryController) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, handler SourceCodeRepositoryHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*SourceCodeRepository); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *sourceCodeRepositoryController) AddClusterScopedHandler(ctx context.Context, name, cluster string, handler SourceCodeRepositoryHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*SourceCodeRepository); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *sourceCodeRepositoryController) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, cluster string, handler SourceCodeRepositoryHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*SourceCodeRepository); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -type sourceCodeRepositoryFactory struct { -} - -func (c sourceCodeRepositoryFactory) Object() runtime.Object { - return &SourceCodeRepository{} -} - -func (c sourceCodeRepositoryFactory) List() runtime.Object { - return &SourceCodeRepositoryList{} -} - -func (s *sourceCodeRepositoryClient) Controller() SourceCodeRepositoryController { - genericController := controller.NewGenericController(SourceCodeRepositoryGroupVersionKind.Kind+"Controller", - s.client.controllerFactory.ForResourceKind(SourceCodeRepositoryGroupVersionResource, SourceCodeRepositoryGroupVersionKind.Kind, true)) - - return &sourceCodeRepositoryController{ - GenericController: genericController, - } -} - -type sourceCodeRepositoryClient struct { - client *Client - ns string - objectClient *objectclient.ObjectClient - controller SourceCodeRepositoryController -} - -func (s *sourceCodeRepositoryClient) ObjectClient() *objectclient.ObjectClient { - return s.objectClient -} - -func (s *sourceCodeRepositoryClient) Create(o *SourceCodeRepository) (*SourceCodeRepository, error) { - obj, err := s.objectClient.Create(o) - return obj.(*SourceCodeRepository), err -} - -func (s *sourceCodeRepositoryClient) Get(name string, opts metav1.GetOptions) (*SourceCodeRepository, error) { - obj, err := s.objectClient.Get(name, opts) - return obj.(*SourceCodeRepository), err -} - -func (s *sourceCodeRepositoryClient) GetNamespaced(namespace, name string, opts metav1.GetOptions) (*SourceCodeRepository, error) { - obj, err := s.objectClient.GetNamespaced(namespace, name, opts) - return obj.(*SourceCodeRepository), err -} - -func (s *sourceCodeRepositoryClient) Update(o *SourceCodeRepository) (*SourceCodeRepository, error) { - obj, err := s.objectClient.Update(o.Name, o) - return obj.(*SourceCodeRepository), err -} - -func (s *sourceCodeRepositoryClient) UpdateStatus(o *SourceCodeRepository) (*SourceCodeRepository, error) { - obj, err := s.objectClient.UpdateStatus(o.Name, o) - return obj.(*SourceCodeRepository), err -} - -func (s *sourceCodeRepositoryClient) Delete(name string, options *metav1.DeleteOptions) error { - return s.objectClient.Delete(name, options) -} - -func (s *sourceCodeRepositoryClient) DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error { - return s.objectClient.DeleteNamespaced(namespace, name, options) -} - -func (s *sourceCodeRepositoryClient) List(opts metav1.ListOptions) (*SourceCodeRepositoryList, error) { - obj, err := s.objectClient.List(opts) - return obj.(*SourceCodeRepositoryList), err -} - -func (s *sourceCodeRepositoryClient) ListNamespaced(namespace string, opts metav1.ListOptions) (*SourceCodeRepositoryList, error) { - obj, err := s.objectClient.ListNamespaced(namespace, opts) - return obj.(*SourceCodeRepositoryList), err -} - -func (s *sourceCodeRepositoryClient) Watch(opts metav1.ListOptions) (watch.Interface, error) { - return s.objectClient.Watch(opts) -} - -// Patch applies the patch and returns the patched deployment. -func (s *sourceCodeRepositoryClient) Patch(o *SourceCodeRepository, patchType types.PatchType, data []byte, subresources ...string) (*SourceCodeRepository, error) { - obj, err := s.objectClient.Patch(o.Name, o, patchType, data, subresources...) - return obj.(*SourceCodeRepository), err -} - -func (s *sourceCodeRepositoryClient) DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error { - return s.objectClient.DeleteCollection(deleteOpts, listOpts) -} - -func (s *sourceCodeRepositoryClient) AddHandler(ctx context.Context, name string, sync SourceCodeRepositoryHandlerFunc) { - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *sourceCodeRepositoryClient) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync SourceCodeRepositoryHandlerFunc) { - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *sourceCodeRepositoryClient) AddLifecycle(ctx context.Context, name string, lifecycle SourceCodeRepositoryLifecycle) { - sync := NewSourceCodeRepositoryLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *sourceCodeRepositoryClient) AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle SourceCodeRepositoryLifecycle) { - sync := NewSourceCodeRepositoryLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *sourceCodeRepositoryClient) AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync SourceCodeRepositoryHandlerFunc) { - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *sourceCodeRepositoryClient) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync SourceCodeRepositoryHandlerFunc) { - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} - -func (s *sourceCodeRepositoryClient) AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle SourceCodeRepositoryLifecycle) { - sync := NewSourceCodeRepositoryLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *sourceCodeRepositoryClient) AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle SourceCodeRepositoryLifecycle) { - sync := NewSourceCodeRepositoryLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} diff --git a/vendor/github.com/rancher/types/apis/project.cattle.io/v3/zz_generated_source_code_repository_lifecycle_adapter.go b/vendor/github.com/rancher/types/apis/project.cattle.io/v3/zz_generated_source_code_repository_lifecycle_adapter.go deleted file mode 100644 index 1099dcb3..00000000 --- a/vendor/github.com/rancher/types/apis/project.cattle.io/v3/zz_generated_source_code_repository_lifecycle_adapter.go +++ /dev/null @@ -1,66 +0,0 @@ -package v3 - -import ( - "github.com/rancher/norman/lifecycle" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/runtime" -) - -type SourceCodeRepositoryLifecycle interface { - Create(obj *SourceCodeRepository) (runtime.Object, error) - Remove(obj *SourceCodeRepository) (runtime.Object, error) - Updated(obj *SourceCodeRepository) (runtime.Object, error) -} - -type sourceCodeRepositoryLifecycleAdapter struct { - lifecycle SourceCodeRepositoryLifecycle -} - -func (w *sourceCodeRepositoryLifecycleAdapter) HasCreate() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasCreate() -} - -func (w *sourceCodeRepositoryLifecycleAdapter) HasFinalize() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasFinalize() -} - -func (w *sourceCodeRepositoryLifecycleAdapter) Create(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Create(obj.(*SourceCodeRepository)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *sourceCodeRepositoryLifecycleAdapter) Finalize(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Remove(obj.(*SourceCodeRepository)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *sourceCodeRepositoryLifecycleAdapter) Updated(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Updated(obj.(*SourceCodeRepository)) - if o == nil { - return nil, err - } - return o, err -} - -func NewSourceCodeRepositoryLifecycleAdapter(name string, clusterScoped bool, client SourceCodeRepositoryInterface, l SourceCodeRepositoryLifecycle) SourceCodeRepositoryHandlerFunc { - if clusterScoped { - resource.PutClusterScoped(SourceCodeRepositoryGroupVersionResource) - } - adapter := &sourceCodeRepositoryLifecycleAdapter{lifecycle: l} - syncFn := lifecycle.NewObjectLifecycleAdapter(name, clusterScoped, adapter, client.ObjectClient()) - return func(key string, obj *SourceCodeRepository) (runtime.Object, error) { - newObj, err := syncFn(key, obj) - if o, ok := newObj.(runtime.Object); ok { - return o, err - } - return nil, err - } -} diff --git a/vendor/github.com/rancher/types/apis/project.cattle.io/v3/zz_generated_ssh_auth_controller.go b/vendor/github.com/rancher/types/apis/project.cattle.io/v3/zz_generated_ssh_auth_controller.go deleted file mode 100644 index 8e615c42..00000000 --- a/vendor/github.com/rancher/types/apis/project.cattle.io/v3/zz_generated_ssh_auth_controller.go +++ /dev/null @@ -1,321 +0,0 @@ -package v3 - -import ( - "context" - "time" - - "github.com/rancher/norman/controller" - "github.com/rancher/norman/objectclient" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/apimachinery/pkg/types" - "k8s.io/apimachinery/pkg/watch" - "k8s.io/client-go/tools/cache" -) - -var ( - SSHAuthGroupVersionKind = schema.GroupVersionKind{ - Version: Version, - Group: GroupName, - Kind: "SSHAuth", - } - SSHAuthResource = metav1.APIResource{ - Name: "sshauths", - SingularName: "sshauth", - Namespaced: true, - - Kind: SSHAuthGroupVersionKind.Kind, - } - - SSHAuthGroupVersionResource = schema.GroupVersionResource{ - Group: GroupName, - Version: Version, - Resource: "sshauths", - } -) - -func init() { - resource.Put(SSHAuthGroupVersionResource) -} - -func NewSSHAuth(namespace, name string, obj SSHAuth) *SSHAuth { - obj.APIVersion, obj.Kind = SSHAuthGroupVersionKind.ToAPIVersionAndKind() - obj.Name = name - obj.Namespace = namespace - return &obj -} - -type SSHAuthList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []SSHAuth `json:"items"` -} - -type SSHAuthHandlerFunc func(key string, obj *SSHAuth) (runtime.Object, error) - -type SSHAuthChangeHandlerFunc func(obj *SSHAuth) (runtime.Object, error) - -type SSHAuthLister interface { - List(namespace string, selector labels.Selector) (ret []*SSHAuth, err error) - Get(namespace, name string) (*SSHAuth, error) -} - -type SSHAuthController interface { - Generic() controller.GenericController - Informer() cache.SharedIndexInformer - Lister() SSHAuthLister - AddHandler(ctx context.Context, name string, handler SSHAuthHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync SSHAuthHandlerFunc) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, handler SSHAuthHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, handler SSHAuthHandlerFunc) - Enqueue(namespace, name string) - EnqueueAfter(namespace, name string, after time.Duration) -} - -type SSHAuthInterface interface { - ObjectClient() *objectclient.ObjectClient - Create(*SSHAuth) (*SSHAuth, error) - GetNamespaced(namespace, name string, opts metav1.GetOptions) (*SSHAuth, error) - Get(name string, opts metav1.GetOptions) (*SSHAuth, error) - Update(*SSHAuth) (*SSHAuth, error) - Delete(name string, options *metav1.DeleteOptions) error - DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error - List(opts metav1.ListOptions) (*SSHAuthList, error) - ListNamespaced(namespace string, opts metav1.ListOptions) (*SSHAuthList, error) - Watch(opts metav1.ListOptions) (watch.Interface, error) - DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error - Controller() SSHAuthController - AddHandler(ctx context.Context, name string, sync SSHAuthHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync SSHAuthHandlerFunc) - AddLifecycle(ctx context.Context, name string, lifecycle SSHAuthLifecycle) - AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle SSHAuthLifecycle) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync SSHAuthHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync SSHAuthHandlerFunc) - AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle SSHAuthLifecycle) - AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle SSHAuthLifecycle) -} - -type sshAuthLister struct { - controller *sshAuthController -} - -func (l *sshAuthLister) List(namespace string, selector labels.Selector) (ret []*SSHAuth, err error) { - err = cache.ListAllByNamespace(l.controller.Informer().GetIndexer(), namespace, selector, func(obj interface{}) { - ret = append(ret, obj.(*SSHAuth)) - }) - return -} - -func (l *sshAuthLister) Get(namespace, name string) (*SSHAuth, error) { - var key string - if namespace != "" { - key = namespace + "/" + name - } else { - key = name - } - obj, exists, err := l.controller.Informer().GetIndexer().GetByKey(key) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(schema.GroupResource{ - Group: SSHAuthGroupVersionKind.Group, - Resource: SSHAuthGroupVersionResource.Resource, - }, key) - } - return obj.(*SSHAuth), nil -} - -type sshAuthController struct { - controller.GenericController -} - -func (c *sshAuthController) Generic() controller.GenericController { - return c.GenericController -} - -func (c *sshAuthController) Lister() SSHAuthLister { - return &sshAuthLister{ - controller: c, - } -} - -func (c *sshAuthController) AddHandler(ctx context.Context, name string, handler SSHAuthHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*SSHAuth); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *sshAuthController) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, handler SSHAuthHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*SSHAuth); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *sshAuthController) AddClusterScopedHandler(ctx context.Context, name, cluster string, handler SSHAuthHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*SSHAuth); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *sshAuthController) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, cluster string, handler SSHAuthHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*SSHAuth); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -type sshAuthFactory struct { -} - -func (c sshAuthFactory) Object() runtime.Object { - return &SSHAuth{} -} - -func (c sshAuthFactory) List() runtime.Object { - return &SSHAuthList{} -} - -func (s *sshAuthClient) Controller() SSHAuthController { - genericController := controller.NewGenericController(SSHAuthGroupVersionKind.Kind+"Controller", - s.client.controllerFactory.ForResourceKind(SSHAuthGroupVersionResource, SSHAuthGroupVersionKind.Kind, true)) - - return &sshAuthController{ - GenericController: genericController, - } -} - -type sshAuthClient struct { - client *Client - ns string - objectClient *objectclient.ObjectClient - controller SSHAuthController -} - -func (s *sshAuthClient) ObjectClient() *objectclient.ObjectClient { - return s.objectClient -} - -func (s *sshAuthClient) Create(o *SSHAuth) (*SSHAuth, error) { - obj, err := s.objectClient.Create(o) - return obj.(*SSHAuth), err -} - -func (s *sshAuthClient) Get(name string, opts metav1.GetOptions) (*SSHAuth, error) { - obj, err := s.objectClient.Get(name, opts) - return obj.(*SSHAuth), err -} - -func (s *sshAuthClient) GetNamespaced(namespace, name string, opts metav1.GetOptions) (*SSHAuth, error) { - obj, err := s.objectClient.GetNamespaced(namespace, name, opts) - return obj.(*SSHAuth), err -} - -func (s *sshAuthClient) Update(o *SSHAuth) (*SSHAuth, error) { - obj, err := s.objectClient.Update(o.Name, o) - return obj.(*SSHAuth), err -} - -func (s *sshAuthClient) UpdateStatus(o *SSHAuth) (*SSHAuth, error) { - obj, err := s.objectClient.UpdateStatus(o.Name, o) - return obj.(*SSHAuth), err -} - -func (s *sshAuthClient) Delete(name string, options *metav1.DeleteOptions) error { - return s.objectClient.Delete(name, options) -} - -func (s *sshAuthClient) DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error { - return s.objectClient.DeleteNamespaced(namespace, name, options) -} - -func (s *sshAuthClient) List(opts metav1.ListOptions) (*SSHAuthList, error) { - obj, err := s.objectClient.List(opts) - return obj.(*SSHAuthList), err -} - -func (s *sshAuthClient) ListNamespaced(namespace string, opts metav1.ListOptions) (*SSHAuthList, error) { - obj, err := s.objectClient.ListNamespaced(namespace, opts) - return obj.(*SSHAuthList), err -} - -func (s *sshAuthClient) Watch(opts metav1.ListOptions) (watch.Interface, error) { - return s.objectClient.Watch(opts) -} - -// Patch applies the patch and returns the patched deployment. -func (s *sshAuthClient) Patch(o *SSHAuth, patchType types.PatchType, data []byte, subresources ...string) (*SSHAuth, error) { - obj, err := s.objectClient.Patch(o.Name, o, patchType, data, subresources...) - return obj.(*SSHAuth), err -} - -func (s *sshAuthClient) DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error { - return s.objectClient.DeleteCollection(deleteOpts, listOpts) -} - -func (s *sshAuthClient) AddHandler(ctx context.Context, name string, sync SSHAuthHandlerFunc) { - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *sshAuthClient) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync SSHAuthHandlerFunc) { - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *sshAuthClient) AddLifecycle(ctx context.Context, name string, lifecycle SSHAuthLifecycle) { - sync := NewSSHAuthLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *sshAuthClient) AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle SSHAuthLifecycle) { - sync := NewSSHAuthLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *sshAuthClient) AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync SSHAuthHandlerFunc) { - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *sshAuthClient) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync SSHAuthHandlerFunc) { - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} - -func (s *sshAuthClient) AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle SSHAuthLifecycle) { - sync := NewSSHAuthLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *sshAuthClient) AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle SSHAuthLifecycle) { - sync := NewSSHAuthLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} diff --git a/vendor/github.com/rancher/types/apis/project.cattle.io/v3/zz_generated_ssh_auth_lifecycle_adapter.go b/vendor/github.com/rancher/types/apis/project.cattle.io/v3/zz_generated_ssh_auth_lifecycle_adapter.go deleted file mode 100644 index 2386f24a..00000000 --- a/vendor/github.com/rancher/types/apis/project.cattle.io/v3/zz_generated_ssh_auth_lifecycle_adapter.go +++ /dev/null @@ -1,66 +0,0 @@ -package v3 - -import ( - "github.com/rancher/norman/lifecycle" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/runtime" -) - -type SSHAuthLifecycle interface { - Create(obj *SSHAuth) (runtime.Object, error) - Remove(obj *SSHAuth) (runtime.Object, error) - Updated(obj *SSHAuth) (runtime.Object, error) -} - -type sshAuthLifecycleAdapter struct { - lifecycle SSHAuthLifecycle -} - -func (w *sshAuthLifecycleAdapter) HasCreate() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasCreate() -} - -func (w *sshAuthLifecycleAdapter) HasFinalize() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasFinalize() -} - -func (w *sshAuthLifecycleAdapter) Create(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Create(obj.(*SSHAuth)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *sshAuthLifecycleAdapter) Finalize(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Remove(obj.(*SSHAuth)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *sshAuthLifecycleAdapter) Updated(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Updated(obj.(*SSHAuth)) - if o == nil { - return nil, err - } - return o, err -} - -func NewSSHAuthLifecycleAdapter(name string, clusterScoped bool, client SSHAuthInterface, l SSHAuthLifecycle) SSHAuthHandlerFunc { - if clusterScoped { - resource.PutClusterScoped(SSHAuthGroupVersionResource) - } - adapter := &sshAuthLifecycleAdapter{lifecycle: l} - syncFn := lifecycle.NewObjectLifecycleAdapter(name, clusterScoped, adapter, client.ObjectClient()) - return func(key string, obj *SSHAuth) (runtime.Object, error) { - newObj, err := syncFn(key, obj) - if o, ok := newObj.(runtime.Object); ok { - return o, err - } - return nil, err - } -} diff --git a/vendor/github.com/rancher/types/apis/project.cattle.io/v3/zz_generated_workload_controller.go b/vendor/github.com/rancher/types/apis/project.cattle.io/v3/zz_generated_workload_controller.go deleted file mode 100644 index 9cba1303..00000000 --- a/vendor/github.com/rancher/types/apis/project.cattle.io/v3/zz_generated_workload_controller.go +++ /dev/null @@ -1,321 +0,0 @@ -package v3 - -import ( - "context" - "time" - - "github.com/rancher/norman/controller" - "github.com/rancher/norman/objectclient" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/apimachinery/pkg/types" - "k8s.io/apimachinery/pkg/watch" - "k8s.io/client-go/tools/cache" -) - -var ( - WorkloadGroupVersionKind = schema.GroupVersionKind{ - Version: Version, - Group: GroupName, - Kind: "Workload", - } - WorkloadResource = metav1.APIResource{ - Name: "workloads", - SingularName: "workload", - Namespaced: true, - - Kind: WorkloadGroupVersionKind.Kind, - } - - WorkloadGroupVersionResource = schema.GroupVersionResource{ - Group: GroupName, - Version: Version, - Resource: "workloads", - } -) - -func init() { - resource.Put(WorkloadGroupVersionResource) -} - -func NewWorkload(namespace, name string, obj Workload) *Workload { - obj.APIVersion, obj.Kind = WorkloadGroupVersionKind.ToAPIVersionAndKind() - obj.Name = name - obj.Namespace = namespace - return &obj -} - -type WorkloadList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []Workload `json:"items"` -} - -type WorkloadHandlerFunc func(key string, obj *Workload) (runtime.Object, error) - -type WorkloadChangeHandlerFunc func(obj *Workload) (runtime.Object, error) - -type WorkloadLister interface { - List(namespace string, selector labels.Selector) (ret []*Workload, err error) - Get(namespace, name string) (*Workload, error) -} - -type WorkloadController interface { - Generic() controller.GenericController - Informer() cache.SharedIndexInformer - Lister() WorkloadLister - AddHandler(ctx context.Context, name string, handler WorkloadHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync WorkloadHandlerFunc) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, handler WorkloadHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, handler WorkloadHandlerFunc) - Enqueue(namespace, name string) - EnqueueAfter(namespace, name string, after time.Duration) -} - -type WorkloadInterface interface { - ObjectClient() *objectclient.ObjectClient - Create(*Workload) (*Workload, error) - GetNamespaced(namespace, name string, opts metav1.GetOptions) (*Workload, error) - Get(name string, opts metav1.GetOptions) (*Workload, error) - Update(*Workload) (*Workload, error) - Delete(name string, options *metav1.DeleteOptions) error - DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error - List(opts metav1.ListOptions) (*WorkloadList, error) - ListNamespaced(namespace string, opts metav1.ListOptions) (*WorkloadList, error) - Watch(opts metav1.ListOptions) (watch.Interface, error) - DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error - Controller() WorkloadController - AddHandler(ctx context.Context, name string, sync WorkloadHandlerFunc) - AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync WorkloadHandlerFunc) - AddLifecycle(ctx context.Context, name string, lifecycle WorkloadLifecycle) - AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle WorkloadLifecycle) - AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync WorkloadHandlerFunc) - AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync WorkloadHandlerFunc) - AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle WorkloadLifecycle) - AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle WorkloadLifecycle) -} - -type workloadLister struct { - controller *workloadController -} - -func (l *workloadLister) List(namespace string, selector labels.Selector) (ret []*Workload, err error) { - err = cache.ListAllByNamespace(l.controller.Informer().GetIndexer(), namespace, selector, func(obj interface{}) { - ret = append(ret, obj.(*Workload)) - }) - return -} - -func (l *workloadLister) Get(namespace, name string) (*Workload, error) { - var key string - if namespace != "" { - key = namespace + "/" + name - } else { - key = name - } - obj, exists, err := l.controller.Informer().GetIndexer().GetByKey(key) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(schema.GroupResource{ - Group: WorkloadGroupVersionKind.Group, - Resource: WorkloadGroupVersionResource.Resource, - }, key) - } - return obj.(*Workload), nil -} - -type workloadController struct { - controller.GenericController -} - -func (c *workloadController) Generic() controller.GenericController { - return c.GenericController -} - -func (c *workloadController) Lister() WorkloadLister { - return &workloadLister{ - controller: c, - } -} - -func (c *workloadController) AddHandler(ctx context.Context, name string, handler WorkloadHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*Workload); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *workloadController) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, handler WorkloadHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*Workload); ok { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *workloadController) AddClusterScopedHandler(ctx context.Context, name, cluster string, handler WorkloadHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*Workload); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -func (c *workloadController) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, cluster string, handler WorkloadHandlerFunc) { - c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { - if !enabled() { - return nil, nil - } else if obj == nil { - return handler(key, nil) - } else if v, ok := obj.(*Workload); ok && controller.ObjectInCluster(cluster, obj) { - return handler(key, v) - } else { - return nil, nil - } - }) -} - -type workloadFactory struct { -} - -func (c workloadFactory) Object() runtime.Object { - return &Workload{} -} - -func (c workloadFactory) List() runtime.Object { - return &WorkloadList{} -} - -func (s *workloadClient) Controller() WorkloadController { - genericController := controller.NewGenericController(WorkloadGroupVersionKind.Kind+"Controller", - s.client.controllerFactory.ForResourceKind(WorkloadGroupVersionResource, WorkloadGroupVersionKind.Kind, true)) - - return &workloadController{ - GenericController: genericController, - } -} - -type workloadClient struct { - client *Client - ns string - objectClient *objectclient.ObjectClient - controller WorkloadController -} - -func (s *workloadClient) ObjectClient() *objectclient.ObjectClient { - return s.objectClient -} - -func (s *workloadClient) Create(o *Workload) (*Workload, error) { - obj, err := s.objectClient.Create(o) - return obj.(*Workload), err -} - -func (s *workloadClient) Get(name string, opts metav1.GetOptions) (*Workload, error) { - obj, err := s.objectClient.Get(name, opts) - return obj.(*Workload), err -} - -func (s *workloadClient) GetNamespaced(namespace, name string, opts metav1.GetOptions) (*Workload, error) { - obj, err := s.objectClient.GetNamespaced(namespace, name, opts) - return obj.(*Workload), err -} - -func (s *workloadClient) Update(o *Workload) (*Workload, error) { - obj, err := s.objectClient.Update(o.Name, o) - return obj.(*Workload), err -} - -func (s *workloadClient) UpdateStatus(o *Workload) (*Workload, error) { - obj, err := s.objectClient.UpdateStatus(o.Name, o) - return obj.(*Workload), err -} - -func (s *workloadClient) Delete(name string, options *metav1.DeleteOptions) error { - return s.objectClient.Delete(name, options) -} - -func (s *workloadClient) DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error { - return s.objectClient.DeleteNamespaced(namespace, name, options) -} - -func (s *workloadClient) List(opts metav1.ListOptions) (*WorkloadList, error) { - obj, err := s.objectClient.List(opts) - return obj.(*WorkloadList), err -} - -func (s *workloadClient) ListNamespaced(namespace string, opts metav1.ListOptions) (*WorkloadList, error) { - obj, err := s.objectClient.ListNamespaced(namespace, opts) - return obj.(*WorkloadList), err -} - -func (s *workloadClient) Watch(opts metav1.ListOptions) (watch.Interface, error) { - return s.objectClient.Watch(opts) -} - -// Patch applies the patch and returns the patched deployment. -func (s *workloadClient) Patch(o *Workload, patchType types.PatchType, data []byte, subresources ...string) (*Workload, error) { - obj, err := s.objectClient.Patch(o.Name, o, patchType, data, subresources...) - return obj.(*Workload), err -} - -func (s *workloadClient) DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error { - return s.objectClient.DeleteCollection(deleteOpts, listOpts) -} - -func (s *workloadClient) AddHandler(ctx context.Context, name string, sync WorkloadHandlerFunc) { - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *workloadClient) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync WorkloadHandlerFunc) { - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *workloadClient) AddLifecycle(ctx context.Context, name string, lifecycle WorkloadLifecycle) { - sync := NewWorkloadLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddHandler(ctx, name, sync) -} - -func (s *workloadClient) AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle WorkloadLifecycle) { - sync := NewWorkloadLifecycleAdapter(name, false, s, lifecycle) - s.Controller().AddFeatureHandler(ctx, enabled, name, sync) -} - -func (s *workloadClient) AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync WorkloadHandlerFunc) { - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *workloadClient) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync WorkloadHandlerFunc) { - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} - -func (s *workloadClient) AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle WorkloadLifecycle) { - sync := NewWorkloadLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) -} - -func (s *workloadClient) AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle WorkloadLifecycle) { - sync := NewWorkloadLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) -} diff --git a/vendor/github.com/rancher/types/apis/project.cattle.io/v3/zz_generated_workload_lifecycle_adapter.go b/vendor/github.com/rancher/types/apis/project.cattle.io/v3/zz_generated_workload_lifecycle_adapter.go deleted file mode 100644 index dd8fcea3..00000000 --- a/vendor/github.com/rancher/types/apis/project.cattle.io/v3/zz_generated_workload_lifecycle_adapter.go +++ /dev/null @@ -1,66 +0,0 @@ -package v3 - -import ( - "github.com/rancher/norman/lifecycle" - "github.com/rancher/norman/resource" - "k8s.io/apimachinery/pkg/runtime" -) - -type WorkloadLifecycle interface { - Create(obj *Workload) (runtime.Object, error) - Remove(obj *Workload) (runtime.Object, error) - Updated(obj *Workload) (runtime.Object, error) -} - -type workloadLifecycleAdapter struct { - lifecycle WorkloadLifecycle -} - -func (w *workloadLifecycleAdapter) HasCreate() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasCreate() -} - -func (w *workloadLifecycleAdapter) HasFinalize() bool { - o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) - return !ok || o.HasFinalize() -} - -func (w *workloadLifecycleAdapter) Create(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Create(obj.(*Workload)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *workloadLifecycleAdapter) Finalize(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Remove(obj.(*Workload)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *workloadLifecycleAdapter) Updated(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Updated(obj.(*Workload)) - if o == nil { - return nil, err - } - return o, err -} - -func NewWorkloadLifecycleAdapter(name string, clusterScoped bool, client WorkloadInterface, l WorkloadLifecycle) WorkloadHandlerFunc { - if clusterScoped { - resource.PutClusterScoped(WorkloadGroupVersionResource) - } - adapter := &workloadLifecycleAdapter{lifecycle: l} - syncFn := lifecycle.NewObjectLifecycleAdapter(name, clusterScoped, adapter, client.ObjectClient()) - return func(key string, obj *Workload) (runtime.Object, error) { - newObj, err := syncFn(key, obj) - if o, ok := newObj.(runtime.Object); ok { - return o, err - } - return nil, err - } -} diff --git a/vendor/github.com/rancher/types/condition/constants.go b/vendor/github.com/rancher/types/condition/constants.go deleted file mode 100644 index e5210e45..00000000 --- a/vendor/github.com/rancher/types/condition/constants.go +++ /dev/null @@ -1,26 +0,0 @@ -package condition - -import ( - cond "github.com/rancher/norman/condition" -) - -const ( - // transition type - - Created cond.Cond = "Created" - RunCompleted cond.Cond = "RunCompleted" - - // done type - - Completed cond.Cond = "Completed" - Ready cond.Cond = "Ready" - - // error type - - Failed cond.Cond = "Failed" - - // generic type - // these will not trigger any state change on the object - - Alerted cond.Cond = "Alerted" -) diff --git a/vendor/github.com/rancher/types/image/mirror.go b/vendor/github.com/rancher/types/image/mirror.go deleted file mode 100644 index 6321d12d..00000000 --- a/vendor/github.com/rancher/types/image/mirror.go +++ /dev/null @@ -1,30 +0,0 @@ -package image - -import "strings" - -var Mirrors = map[string]string{} - -func Mirror(image string) string { - orig := image - if strings.HasPrefix(image, "weaveworks") { - return image - } - - image = strings.Replace(image, "gcr.io/google_containers", "rancher", 1) - image = strings.Replace(image, "quay.io/coreos/", "rancher/coreos-", 1) - image = strings.Replace(image, "quay.io/calico/", "rancher/calico-", 1) - image = strings.Replace(image, "plugins/docker", "rancher/plugins-docker", 1) - image = strings.Replace(image, "k8s.gcr.io/defaultbackend", "rancher/nginx-ingress-controller-defaultbackend", 1) - image = strings.Replace(image, "k8s.gcr.io/k8s-dns-node-cache", "rancher/k8s-dns-node-cache", 1) - image = strings.Replace(image, "plugins/docker", "rancher/plugins-docker", 1) - image = strings.Replace(image, "kibana", "rancher/kibana", 1) - image = strings.Replace(image, "jenkins/", "rancher/jenkins-", 1) - image = strings.Replace(image, "alpine/git", "rancher/alpine-git", 1) - image = strings.Replace(image, "prom/", "rancher/prom-", 1) - image = strings.Replace(image, "quay.io/pires", "rancher", 1) - image = strings.Replace(image, "coredns/", "rancher/coredns-", 1) - image = strings.Replace(image, "minio/", "rancher/minio-", 1) - - Mirrors[image] = orig - return image -} diff --git a/vendor/github.com/rancher/types/kdm/kdm.go b/vendor/github.com/rancher/types/kdm/kdm.go deleted file mode 100644 index fdaec731..00000000 --- a/vendor/github.com/rancher/types/kdm/kdm.go +++ /dev/null @@ -1,58 +0,0 @@ -package kdm - -import ( - "encoding/json" - - v3 "github.com/rancher/types/apis/management.cattle.io/v3" -) - -const ( - Calico = "calico" - Canal = "canal" - Flannel = "flannel" - Weave = "weave" - CoreDNS = "coreDNS" - KubeDNS = "kubeDNS" - MetricsServer = "metricsServer" - NginxIngress = "nginxIngress" - Nodelocal = "nodelocal" - TemplateKeys = "templateKeys" -) - -type Data struct { - // K8sVersionServiceOptions - service options per k8s version - K8sVersionServiceOptions map[string]v3.KubernetesServicesOptions - K8sVersionRKESystemImages map[string]v3.RKESystemImages - - // Addon Templates per K8s version ("default" where nothing changes for k8s version) - K8sVersionedTemplates map[string]map[string]string - - // K8sVersionInfo - min/max RKE+Rancher versions per k8s version - K8sVersionInfo map[string]v3.K8sVersionInfo - - //Default K8s version for every rancher version - RancherDefaultK8sVersions map[string]string - - //Default K8s version for every rke version - RKEDefaultK8sVersions map[string]string - - K8sVersionDockerInfo map[string][]string - - // K8sVersionWindowsServiceOptions - service options per windows k8s version - K8sVersionWindowsServiceOptions map[string]v3.KubernetesServicesOptions - - CisConfigParams map[string]v3.CisConfigParams - CisBenchmarkVersionInfo map[string]v3.CisBenchmarkVersionInfo - - // K3S specific data, opaque and defined by the config file in kdm - K3S map[string]interface{} `json:"k3s,omitempty"` -} - -func FromData(b []byte) (Data, error) { - d := &Data{} - - if err := json.Unmarshal(b, d); err != nil { - return Data{}, err - } - return *d, nil -} diff --git a/vendor/golang.org/x/tools/AUTHORS b/vendor/golang.org/x/tools/AUTHORS new file mode 100644 index 00000000..15167cd7 --- /dev/null +++ b/vendor/golang.org/x/tools/AUTHORS @@ -0,0 +1,3 @@ +# This source code refers to The Go Authors for copyright purposes. +# The master list of authors is in the main Go distribution, +# visible at http://tip.golang.org/AUTHORS. diff --git a/vendor/golang.org/x/tools/CONTRIBUTORS b/vendor/golang.org/x/tools/CONTRIBUTORS new file mode 100644 index 00000000..1c4577e9 --- /dev/null +++ b/vendor/golang.org/x/tools/CONTRIBUTORS @@ -0,0 +1,3 @@ +# This source code was written by the Go contributors. +# The master list of contributors is in the main Go distribution, +# visible at http://tip.golang.org/CONTRIBUTORS. diff --git a/vendor/golang.org/x/tools/LICENSE b/vendor/golang.org/x/tools/LICENSE new file mode 100644 index 00000000..6a66aea5 --- /dev/null +++ b/vendor/golang.org/x/tools/LICENSE @@ -0,0 +1,27 @@ +Copyright (c) 2009 The Go Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/golang.org/x/tools/PATENTS b/vendor/golang.org/x/tools/PATENTS new file mode 100644 index 00000000..73309904 --- /dev/null +++ b/vendor/golang.org/x/tools/PATENTS @@ -0,0 +1,22 @@ +Additional IP Rights Grant (Patents) + +"This implementation" means the copyrightable works distributed by +Google as part of the Go project. + +Google 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, +transfer and otherwise run, modify and propagate the contents of this +implementation of Go, where such license applies only to those patent +claims, both currently owned or controlled by Google and acquired in +the future, licensable by Google that are necessarily infringed by this +implementation of Go. This grant does not include claims that would be +infringed only as a consequence of further modification of this +implementation. If you or your agent or exclusive licensee institute or +order or agree to the institution of patent litigation against any +entity (including a cross-claim or counterclaim in a lawsuit) alleging +that this implementation of Go or any code incorporated within this +implementation of Go constitutes direct or contributory patent +infringement, or inducement of patent infringement, then any patent +rights granted to you under this License for this implementation of Go +shall terminate as of the date such litigation is filed. diff --git a/vendor/golang.org/x/tools/go/ast/astutil/enclosing.go b/vendor/golang.org/x/tools/go/ast/astutil/enclosing.go new file mode 100644 index 00000000..6b7052b8 --- /dev/null +++ b/vendor/golang.org/x/tools/go/ast/astutil/enclosing.go @@ -0,0 +1,627 @@ +// Copyright 2013 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package astutil + +// This file defines utilities for working with source positions. + +import ( + "fmt" + "go/ast" + "go/token" + "sort" +) + +// PathEnclosingInterval returns the node that encloses the source +// interval [start, end), and all its ancestors up to the AST root. +// +// The definition of "enclosing" used by this function considers +// additional whitespace abutting a node to be enclosed by it. +// In this example: +// +// z := x + y // add them +// <-A-> +// <----B-----> +// +// the ast.BinaryExpr(+) node is considered to enclose interval B +// even though its [Pos()..End()) is actually only interval A. +// This behaviour makes user interfaces more tolerant of imperfect +// input. +// +// This function treats tokens as nodes, though they are not included +// in the result. e.g. PathEnclosingInterval("+") returns the +// enclosing ast.BinaryExpr("x + y"). +// +// If start==end, the 1-char interval following start is used instead. +// +// The 'exact' result is true if the interval contains only path[0] +// and perhaps some adjacent whitespace. It is false if the interval +// overlaps multiple children of path[0], or if it contains only +// interior whitespace of path[0]. +// In this example: +// +// z := x + y // add them +// <--C--> <---E--> +// ^ +// D +// +// intervals C, D and E are inexact. C is contained by the +// z-assignment statement, because it spans three of its children (:=, +// x, +). So too is the 1-char interval D, because it contains only +// interior whitespace of the assignment. E is considered interior +// whitespace of the BlockStmt containing the assignment. +// +// Precondition: [start, end) both lie within the same file as root. +// TODO(adonovan): return (nil, false) in this case and remove precond. +// Requires FileSet; see loader.tokenFileContainsPos. +// +// Postcondition: path is never nil; it always contains at least 'root'. +// +func PathEnclosingInterval(root *ast.File, start, end token.Pos) (path []ast.Node, exact bool) { + // fmt.Printf("EnclosingInterval %d %d\n", start, end) // debugging + + // Precondition: node.[Pos..End) and adjoining whitespace contain [start, end). + var visit func(node ast.Node) bool + visit = func(node ast.Node) bool { + path = append(path, node) + + nodePos := node.Pos() + nodeEnd := node.End() + + // fmt.Printf("visit(%T, %d, %d)\n", node, nodePos, nodeEnd) // debugging + + // Intersect [start, end) with interval of node. + if start < nodePos { + start = nodePos + } + if end > nodeEnd { + end = nodeEnd + } + + // Find sole child that contains [start, end). + children := childrenOf(node) + l := len(children) + for i, child := range children { + // [childPos, childEnd) is unaugmented interval of child. + childPos := child.Pos() + childEnd := child.End() + + // [augPos, augEnd) is whitespace-augmented interval of child. + augPos := childPos + augEnd := childEnd + if i > 0 { + augPos = children[i-1].End() // start of preceding whitespace + } + if i < l-1 { + nextChildPos := children[i+1].Pos() + // Does [start, end) lie between child and next child? + if start >= augEnd && end <= nextChildPos { + return false // inexact match + } + augEnd = nextChildPos // end of following whitespace + } + + // fmt.Printf("\tchild %d: [%d..%d)\tcontains interval [%d..%d)?\n", + // i, augPos, augEnd, start, end) // debugging + + // Does augmented child strictly contain [start, end)? + if augPos <= start && end <= augEnd { + _, isToken := child.(tokenNode) + return isToken || visit(child) + } + + // Does [start, end) overlap multiple children? + // i.e. left-augmented child contains start + // but LR-augmented child does not contain end. + if start < childEnd && end > augEnd { + break + } + } + + // No single child contained [start, end), + // so node is the result. Is it exact? + + // (It's tempting to put this condition before the + // child loop, but it gives the wrong result in the + // case where a node (e.g. ExprStmt) and its sole + // child have equal intervals.) + if start == nodePos && end == nodeEnd { + return true // exact match + } + + return false // inexact: overlaps multiple children + } + + if start > end { + start, end = end, start + } + + if start < root.End() && end > root.Pos() { + if start == end { + end = start + 1 // empty interval => interval of size 1 + } + exact = visit(root) + + // Reverse the path: + for i, l := 0, len(path); i < l/2; i++ { + path[i], path[l-1-i] = path[l-1-i], path[i] + } + } else { + // Selection lies within whitespace preceding the + // first (or following the last) declaration in the file. + // The result nonetheless always includes the ast.File. + path = append(path, root) + } + + return +} + +// tokenNode is a dummy implementation of ast.Node for a single token. +// They are used transiently by PathEnclosingInterval but never escape +// this package. +// +type tokenNode struct { + pos token.Pos + end token.Pos +} + +func (n tokenNode) Pos() token.Pos { + return n.pos +} + +func (n tokenNode) End() token.Pos { + return n.end +} + +func tok(pos token.Pos, len int) ast.Node { + return tokenNode{pos, pos + token.Pos(len)} +} + +// childrenOf returns the direct non-nil children of ast.Node n. +// It may include fake ast.Node implementations for bare tokens. +// it is not safe to call (e.g.) ast.Walk on such nodes. +// +func childrenOf(n ast.Node) []ast.Node { + var children []ast.Node + + // First add nodes for all true subtrees. + ast.Inspect(n, func(node ast.Node) bool { + if node == n { // push n + return true // recur + } + if node != nil { // push child + children = append(children, node) + } + return false // no recursion + }) + + // Then add fake Nodes for bare tokens. + switch n := n.(type) { + case *ast.ArrayType: + children = append(children, + tok(n.Lbrack, len("[")), + tok(n.Elt.End(), len("]"))) + + case *ast.AssignStmt: + children = append(children, + tok(n.TokPos, len(n.Tok.String()))) + + case *ast.BasicLit: + children = append(children, + tok(n.ValuePos, len(n.Value))) + + case *ast.BinaryExpr: + children = append(children, tok(n.OpPos, len(n.Op.String()))) + + case *ast.BlockStmt: + children = append(children, + tok(n.Lbrace, len("{")), + tok(n.Rbrace, len("}"))) + + case *ast.BranchStmt: + children = append(children, + tok(n.TokPos, len(n.Tok.String()))) + + case *ast.CallExpr: + children = append(children, + tok(n.Lparen, len("(")), + tok(n.Rparen, len(")"))) + if n.Ellipsis != 0 { + children = append(children, tok(n.Ellipsis, len("..."))) + } + + case *ast.CaseClause: + if n.List == nil { + children = append(children, + tok(n.Case, len("default"))) + } else { + children = append(children, + tok(n.Case, len("case"))) + } + children = append(children, tok(n.Colon, len(":"))) + + case *ast.ChanType: + switch n.Dir { + case ast.RECV: + children = append(children, tok(n.Begin, len("<-chan"))) + case ast.SEND: + children = append(children, tok(n.Begin, len("chan<-"))) + case ast.RECV | ast.SEND: + children = append(children, tok(n.Begin, len("chan"))) + } + + case *ast.CommClause: + if n.Comm == nil { + children = append(children, + tok(n.Case, len("default"))) + } else { + children = append(children, + tok(n.Case, len("case"))) + } + children = append(children, tok(n.Colon, len(":"))) + + case *ast.Comment: + // nop + + case *ast.CommentGroup: + // nop + + case *ast.CompositeLit: + children = append(children, + tok(n.Lbrace, len("{")), + tok(n.Rbrace, len("{"))) + + case *ast.DeclStmt: + // nop + + case *ast.DeferStmt: + children = append(children, + tok(n.Defer, len("defer"))) + + case *ast.Ellipsis: + children = append(children, + tok(n.Ellipsis, len("..."))) + + case *ast.EmptyStmt: + // nop + + case *ast.ExprStmt: + // nop + + case *ast.Field: + // TODO(adonovan): Field.{Doc,Comment,Tag}? + + case *ast.FieldList: + children = append(children, + tok(n.Opening, len("(")), + tok(n.Closing, len(")"))) + + case *ast.File: + // TODO test: Doc + children = append(children, + tok(n.Package, len("package"))) + + case *ast.ForStmt: + children = append(children, + tok(n.For, len("for"))) + + case *ast.FuncDecl: + // TODO(adonovan): FuncDecl.Comment? + + // Uniquely, FuncDecl breaks the invariant that + // preorder traversal yields tokens in lexical order: + // in fact, FuncDecl.Recv precedes FuncDecl.Type.Func. + // + // As a workaround, we inline the case for FuncType + // here and order things correctly. + // + children = nil // discard ast.Walk(FuncDecl) info subtrees + children = append(children, tok(n.Type.Func, len("func"))) + if n.Recv != nil { + children = append(children, n.Recv) + } + children = append(children, n.Name) + if n.Type.Params != nil { + children = append(children, n.Type.Params) + } + if n.Type.Results != nil { + children = append(children, n.Type.Results) + } + if n.Body != nil { + children = append(children, n.Body) + } + + case *ast.FuncLit: + // nop + + case *ast.FuncType: + if n.Func != 0 { + children = append(children, + tok(n.Func, len("func"))) + } + + case *ast.GenDecl: + children = append(children, + tok(n.TokPos, len(n.Tok.String()))) + if n.Lparen != 0 { + children = append(children, + tok(n.Lparen, len("(")), + tok(n.Rparen, len(")"))) + } + + case *ast.GoStmt: + children = append(children, + tok(n.Go, len("go"))) + + case *ast.Ident: + children = append(children, + tok(n.NamePos, len(n.Name))) + + case *ast.IfStmt: + children = append(children, + tok(n.If, len("if"))) + + case *ast.ImportSpec: + // TODO(adonovan): ImportSpec.{Doc,EndPos}? + + case *ast.IncDecStmt: + children = append(children, + tok(n.TokPos, len(n.Tok.String()))) + + case *ast.IndexExpr: + children = append(children, + tok(n.Lbrack, len("{")), + tok(n.Rbrack, len("}"))) + + case *ast.InterfaceType: + children = append(children, + tok(n.Interface, len("interface"))) + + case *ast.KeyValueExpr: + children = append(children, + tok(n.Colon, len(":"))) + + case *ast.LabeledStmt: + children = append(children, + tok(n.Colon, len(":"))) + + case *ast.MapType: + children = append(children, + tok(n.Map, len("map"))) + + case *ast.ParenExpr: + children = append(children, + tok(n.Lparen, len("(")), + tok(n.Rparen, len(")"))) + + case *ast.RangeStmt: + children = append(children, + tok(n.For, len("for")), + tok(n.TokPos, len(n.Tok.String()))) + + case *ast.ReturnStmt: + children = append(children, + tok(n.Return, len("return"))) + + case *ast.SelectStmt: + children = append(children, + tok(n.Select, len("select"))) + + case *ast.SelectorExpr: + // nop + + case *ast.SendStmt: + children = append(children, + tok(n.Arrow, len("<-"))) + + case *ast.SliceExpr: + children = append(children, + tok(n.Lbrack, len("[")), + tok(n.Rbrack, len("]"))) + + case *ast.StarExpr: + children = append(children, tok(n.Star, len("*"))) + + case *ast.StructType: + children = append(children, tok(n.Struct, len("struct"))) + + case *ast.SwitchStmt: + children = append(children, tok(n.Switch, len("switch"))) + + case *ast.TypeAssertExpr: + children = append(children, + tok(n.Lparen-1, len(".")), + tok(n.Lparen, len("(")), + tok(n.Rparen, len(")"))) + + case *ast.TypeSpec: + // TODO(adonovan): TypeSpec.{Doc,Comment}? + + case *ast.TypeSwitchStmt: + children = append(children, tok(n.Switch, len("switch"))) + + case *ast.UnaryExpr: + children = append(children, tok(n.OpPos, len(n.Op.String()))) + + case *ast.ValueSpec: + // TODO(adonovan): ValueSpec.{Doc,Comment}? + + case *ast.BadDecl, *ast.BadExpr, *ast.BadStmt: + // nop + } + + // TODO(adonovan): opt: merge the logic of ast.Inspect() into + // the switch above so we can make interleaved callbacks for + // both Nodes and Tokens in the right order and avoid the need + // to sort. + sort.Sort(byPos(children)) + + return children +} + +type byPos []ast.Node + +func (sl byPos) Len() int { + return len(sl) +} +func (sl byPos) Less(i, j int) bool { + return sl[i].Pos() < sl[j].Pos() +} +func (sl byPos) Swap(i, j int) { + sl[i], sl[j] = sl[j], sl[i] +} + +// NodeDescription returns a description of the concrete type of n suitable +// for a user interface. +// +// TODO(adonovan): in some cases (e.g. Field, FieldList, Ident, +// StarExpr) we could be much more specific given the path to the AST +// root. Perhaps we should do that. +// +func NodeDescription(n ast.Node) string { + switch n := n.(type) { + case *ast.ArrayType: + return "array type" + case *ast.AssignStmt: + return "assignment" + case *ast.BadDecl: + return "bad declaration" + case *ast.BadExpr: + return "bad expression" + case *ast.BadStmt: + return "bad statement" + case *ast.BasicLit: + return "basic literal" + case *ast.BinaryExpr: + return fmt.Sprintf("binary %s operation", n.Op) + case *ast.BlockStmt: + return "block" + case *ast.BranchStmt: + switch n.Tok { + case token.BREAK: + return "break statement" + case token.CONTINUE: + return "continue statement" + case token.GOTO: + return "goto statement" + case token.FALLTHROUGH: + return "fall-through statement" + } + case *ast.CallExpr: + if len(n.Args) == 1 && !n.Ellipsis.IsValid() { + return "function call (or conversion)" + } + return "function call" + case *ast.CaseClause: + return "case clause" + case *ast.ChanType: + return "channel type" + case *ast.CommClause: + return "communication clause" + case *ast.Comment: + return "comment" + case *ast.CommentGroup: + return "comment group" + case *ast.CompositeLit: + return "composite literal" + case *ast.DeclStmt: + return NodeDescription(n.Decl) + " statement" + case *ast.DeferStmt: + return "defer statement" + case *ast.Ellipsis: + return "ellipsis" + case *ast.EmptyStmt: + return "empty statement" + case *ast.ExprStmt: + return "expression statement" + case *ast.Field: + // Can be any of these: + // struct {x, y int} -- struct field(s) + // struct {T} -- anon struct field + // interface {I} -- interface embedding + // interface {f()} -- interface method + // func (A) func(B) C -- receiver, param(s), result(s) + return "field/method/parameter" + case *ast.FieldList: + return "field/method/parameter list" + case *ast.File: + return "source file" + case *ast.ForStmt: + return "for loop" + case *ast.FuncDecl: + return "function declaration" + case *ast.FuncLit: + return "function literal" + case *ast.FuncType: + return "function type" + case *ast.GenDecl: + switch n.Tok { + case token.IMPORT: + return "import declaration" + case token.CONST: + return "constant declaration" + case token.TYPE: + return "type declaration" + case token.VAR: + return "variable declaration" + } + case *ast.GoStmt: + return "go statement" + case *ast.Ident: + return "identifier" + case *ast.IfStmt: + return "if statement" + case *ast.ImportSpec: + return "import specification" + case *ast.IncDecStmt: + if n.Tok == token.INC { + return "increment statement" + } + return "decrement statement" + case *ast.IndexExpr: + return "index expression" + case *ast.InterfaceType: + return "interface type" + case *ast.KeyValueExpr: + return "key/value association" + case *ast.LabeledStmt: + return "statement label" + case *ast.MapType: + return "map type" + case *ast.Package: + return "package" + case *ast.ParenExpr: + return "parenthesized " + NodeDescription(n.X) + case *ast.RangeStmt: + return "range loop" + case *ast.ReturnStmt: + return "return statement" + case *ast.SelectStmt: + return "select statement" + case *ast.SelectorExpr: + return "selector" + case *ast.SendStmt: + return "channel send" + case *ast.SliceExpr: + return "slice expression" + case *ast.StarExpr: + return "*-operation" // load/store expr or pointer type + case *ast.StructType: + return "struct type" + case *ast.SwitchStmt: + return "switch statement" + case *ast.TypeAssertExpr: + return "type assertion" + case *ast.TypeSpec: + return "type specification" + case *ast.TypeSwitchStmt: + return "type switch" + case *ast.UnaryExpr: + return fmt.Sprintf("unary %s operation", n.Op) + case *ast.ValueSpec: + return "value specification" + + } + panic(fmt.Sprintf("unexpected node type: %T", n)) +} diff --git a/vendor/golang.org/x/tools/go/ast/astutil/imports.go b/vendor/golang.org/x/tools/go/ast/astutil/imports.go new file mode 100644 index 00000000..3e4b1953 --- /dev/null +++ b/vendor/golang.org/x/tools/go/ast/astutil/imports.go @@ -0,0 +1,481 @@ +// Copyright 2013 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Package astutil contains common utilities for working with the Go AST. +package astutil // import "golang.org/x/tools/go/ast/astutil" + +import ( + "fmt" + "go/ast" + "go/token" + "strconv" + "strings" +) + +// AddImport adds the import path to the file f, if absent. +func AddImport(fset *token.FileSet, f *ast.File, path string) (added bool) { + return AddNamedImport(fset, f, "", path) +} + +// AddNamedImport adds the import with the given name and path to the file f, if absent. +// If name is not empty, it is used to rename the import. +// +// For example, calling +// AddNamedImport(fset, f, "pathpkg", "path") +// adds +// import pathpkg "path" +func AddNamedImport(fset *token.FileSet, f *ast.File, name, path string) (added bool) { + if imports(f, name, path) { + return false + } + + newImport := &ast.ImportSpec{ + Path: &ast.BasicLit{ + Kind: token.STRING, + Value: strconv.Quote(path), + }, + } + if name != "" { + newImport.Name = &ast.Ident{Name: name} + } + + // Find an import decl to add to. + // The goal is to find an existing import + // whose import path has the longest shared + // prefix with path. + var ( + bestMatch = -1 // length of longest shared prefix + lastImport = -1 // index in f.Decls of the file's final import decl + impDecl *ast.GenDecl // import decl containing the best match + impIndex = -1 // spec index in impDecl containing the best match + + isThirdPartyPath = isThirdParty(path) + ) + for i, decl := range f.Decls { + gen, ok := decl.(*ast.GenDecl) + if ok && gen.Tok == token.IMPORT { + lastImport = i + // Do not add to import "C", to avoid disrupting the + // association with its doc comment, breaking cgo. + if declImports(gen, "C") { + continue + } + + // Match an empty import decl if that's all that is available. + if len(gen.Specs) == 0 && bestMatch == -1 { + impDecl = gen + } + + // Compute longest shared prefix with imports in this group and find best + // matched import spec. + // 1. Always prefer import spec with longest shared prefix. + // 2. While match length is 0, + // - for stdlib package: prefer first import spec. + // - for third party package: prefer first third party import spec. + // We cannot use last import spec as best match for third party package + // because grouped imports are usually placed last by goimports -local + // flag. + // See issue #19190. + seenAnyThirdParty := false + for j, spec := range gen.Specs { + impspec := spec.(*ast.ImportSpec) + p := importPath(impspec) + n := matchLen(p, path) + if n > bestMatch || (bestMatch == 0 && !seenAnyThirdParty && isThirdPartyPath) { + bestMatch = n + impDecl = gen + impIndex = j + } + seenAnyThirdParty = seenAnyThirdParty || isThirdParty(p) + } + } + } + + // If no import decl found, add one after the last import. + if impDecl == nil { + impDecl = &ast.GenDecl{ + Tok: token.IMPORT, + } + if lastImport >= 0 { + impDecl.TokPos = f.Decls[lastImport].End() + } else { + // There are no existing imports. + // Our new import, preceded by a blank line, goes after the package declaration + // and after the comment, if any, that starts on the same line as the + // package declaration. + impDecl.TokPos = f.Package + + file := fset.File(f.Package) + pkgLine := file.Line(f.Package) + for _, c := range f.Comments { + if file.Line(c.Pos()) > pkgLine { + break + } + // +2 for a blank line + impDecl.TokPos = c.End() + 2 + } + } + f.Decls = append(f.Decls, nil) + copy(f.Decls[lastImport+2:], f.Decls[lastImport+1:]) + f.Decls[lastImport+1] = impDecl + } + + // Insert new import at insertAt. + insertAt := 0 + if impIndex >= 0 { + // insert after the found import + insertAt = impIndex + 1 + } + impDecl.Specs = append(impDecl.Specs, nil) + copy(impDecl.Specs[insertAt+1:], impDecl.Specs[insertAt:]) + impDecl.Specs[insertAt] = newImport + pos := impDecl.Pos() + if insertAt > 0 { + // If there is a comment after an existing import, preserve the comment + // position by adding the new import after the comment. + if spec, ok := impDecl.Specs[insertAt-1].(*ast.ImportSpec); ok && spec.Comment != nil { + pos = spec.Comment.End() + } else { + // Assign same position as the previous import, + // so that the sorter sees it as being in the same block. + pos = impDecl.Specs[insertAt-1].Pos() + } + } + if newImport.Name != nil { + newImport.Name.NamePos = pos + } + newImport.Path.ValuePos = pos + newImport.EndPos = pos + + // Clean up parens. impDecl contains at least one spec. + if len(impDecl.Specs) == 1 { + // Remove unneeded parens. + impDecl.Lparen = token.NoPos + } else if !impDecl.Lparen.IsValid() { + // impDecl needs parens added. + impDecl.Lparen = impDecl.Specs[0].Pos() + } + + f.Imports = append(f.Imports, newImport) + + if len(f.Decls) <= 1 { + return true + } + + // Merge all the import declarations into the first one. + var first *ast.GenDecl + for i := 0; i < len(f.Decls); i++ { + decl := f.Decls[i] + gen, ok := decl.(*ast.GenDecl) + if !ok || gen.Tok != token.IMPORT || declImports(gen, "C") { + continue + } + if first == nil { + first = gen + continue // Don't touch the first one. + } + // We now know there is more than one package in this import + // declaration. Ensure that it ends up parenthesized. + first.Lparen = first.Pos() + // Move the imports of the other import declaration to the first one. + for _, spec := range gen.Specs { + spec.(*ast.ImportSpec).Path.ValuePos = first.Pos() + first.Specs = append(first.Specs, spec) + } + f.Decls = append(f.Decls[:i], f.Decls[i+1:]...) + i-- + } + + return true +} + +func isThirdParty(importPath string) bool { + // Third party package import path usually contains "." (".com", ".org", ...) + // This logic is taken from golang.org/x/tools/imports package. + return strings.Contains(importPath, ".") +} + +// DeleteImport deletes the import path from the file f, if present. +// If there are duplicate import declarations, all matching ones are deleted. +func DeleteImport(fset *token.FileSet, f *ast.File, path string) (deleted bool) { + return DeleteNamedImport(fset, f, "", path) +} + +// DeleteNamedImport deletes the import with the given name and path from the file f, if present. +// If there are duplicate import declarations, all matching ones are deleted. +func DeleteNamedImport(fset *token.FileSet, f *ast.File, name, path string) (deleted bool) { + var delspecs []*ast.ImportSpec + var delcomments []*ast.CommentGroup + + // Find the import nodes that import path, if any. + for i := 0; i < len(f.Decls); i++ { + decl := f.Decls[i] + gen, ok := decl.(*ast.GenDecl) + if !ok || gen.Tok != token.IMPORT { + continue + } + for j := 0; j < len(gen.Specs); j++ { + spec := gen.Specs[j] + impspec := spec.(*ast.ImportSpec) + if importName(impspec) != name || importPath(impspec) != path { + continue + } + + // We found an import spec that imports path. + // Delete it. + delspecs = append(delspecs, impspec) + deleted = true + copy(gen.Specs[j:], gen.Specs[j+1:]) + gen.Specs = gen.Specs[:len(gen.Specs)-1] + + // If this was the last import spec in this decl, + // delete the decl, too. + if len(gen.Specs) == 0 { + copy(f.Decls[i:], f.Decls[i+1:]) + f.Decls = f.Decls[:len(f.Decls)-1] + i-- + break + } else if len(gen.Specs) == 1 { + if impspec.Doc != nil { + delcomments = append(delcomments, impspec.Doc) + } + if impspec.Comment != nil { + delcomments = append(delcomments, impspec.Comment) + } + for _, cg := range f.Comments { + // Found comment on the same line as the import spec. + if cg.End() < impspec.Pos() && fset.Position(cg.End()).Line == fset.Position(impspec.Pos()).Line { + delcomments = append(delcomments, cg) + break + } + } + + spec := gen.Specs[0].(*ast.ImportSpec) + + // Move the documentation right after the import decl. + if spec.Doc != nil { + for fset.Position(gen.TokPos).Line+1 < fset.Position(spec.Doc.Pos()).Line { + fset.File(gen.TokPos).MergeLine(fset.Position(gen.TokPos).Line) + } + } + for _, cg := range f.Comments { + if cg.End() < spec.Pos() && fset.Position(cg.End()).Line == fset.Position(spec.Pos()).Line { + for fset.Position(gen.TokPos).Line+1 < fset.Position(spec.Pos()).Line { + fset.File(gen.TokPos).MergeLine(fset.Position(gen.TokPos).Line) + } + break + } + } + } + if j > 0 { + lastImpspec := gen.Specs[j-1].(*ast.ImportSpec) + lastLine := fset.Position(lastImpspec.Path.ValuePos).Line + line := fset.Position(impspec.Path.ValuePos).Line + + // We deleted an entry but now there may be + // a blank line-sized hole where the import was. + if line-lastLine > 1 { + // There was a blank line immediately preceding the deleted import, + // so there's no need to close the hole. + // Do nothing. + } else if line != fset.File(gen.Rparen).LineCount() { + // There was no blank line. Close the hole. + fset.File(gen.Rparen).MergeLine(line) + } + } + j-- + } + } + + // Delete imports from f.Imports. + for i := 0; i < len(f.Imports); i++ { + imp := f.Imports[i] + for j, del := range delspecs { + if imp == del { + copy(f.Imports[i:], f.Imports[i+1:]) + f.Imports = f.Imports[:len(f.Imports)-1] + copy(delspecs[j:], delspecs[j+1:]) + delspecs = delspecs[:len(delspecs)-1] + i-- + break + } + } + } + + // Delete comments from f.Comments. + for i := 0; i < len(f.Comments); i++ { + cg := f.Comments[i] + for j, del := range delcomments { + if cg == del { + copy(f.Comments[i:], f.Comments[i+1:]) + f.Comments = f.Comments[:len(f.Comments)-1] + copy(delcomments[j:], delcomments[j+1:]) + delcomments = delcomments[:len(delcomments)-1] + i-- + break + } + } + } + + if len(delspecs) > 0 { + panic(fmt.Sprintf("deleted specs from Decls but not Imports: %v", delspecs)) + } + + return +} + +// RewriteImport rewrites any import of path oldPath to path newPath. +func RewriteImport(fset *token.FileSet, f *ast.File, oldPath, newPath string) (rewrote bool) { + for _, imp := range f.Imports { + if importPath(imp) == oldPath { + rewrote = true + // record old End, because the default is to compute + // it using the length of imp.Path.Value. + imp.EndPos = imp.End() + imp.Path.Value = strconv.Quote(newPath) + } + } + return +} + +// UsesImport reports whether a given import is used. +func UsesImport(f *ast.File, path string) (used bool) { + spec := importSpec(f, path) + if spec == nil { + return + } + + name := spec.Name.String() + switch name { + case "": + // If the package name is not explicitly specified, + // make an educated guess. This is not guaranteed to be correct. + lastSlash := strings.LastIndex(path, "/") + if lastSlash == -1 { + name = path + } else { + name = path[lastSlash+1:] + } + case "_", ".": + // Not sure if this import is used - err on the side of caution. + return true + } + + ast.Walk(visitFn(func(n ast.Node) { + sel, ok := n.(*ast.SelectorExpr) + if ok && isTopName(sel.X, name) { + used = true + } + }), f) + + return +} + +type visitFn func(node ast.Node) + +func (fn visitFn) Visit(node ast.Node) ast.Visitor { + fn(node) + return fn +} + +// imports reports whether f has an import with the specified name and path. +func imports(f *ast.File, name, path string) bool { + for _, s := range f.Imports { + if importName(s) == name && importPath(s) == path { + return true + } + } + return false +} + +// importSpec returns the import spec if f imports path, +// or nil otherwise. +func importSpec(f *ast.File, path string) *ast.ImportSpec { + for _, s := range f.Imports { + if importPath(s) == path { + return s + } + } + return nil +} + +// importName returns the name of s, +// or "" if the import is not named. +func importName(s *ast.ImportSpec) string { + if s.Name == nil { + return "" + } + return s.Name.Name +} + +// importPath returns the unquoted import path of s, +// or "" if the path is not properly quoted. +func importPath(s *ast.ImportSpec) string { + t, err := strconv.Unquote(s.Path.Value) + if err != nil { + return "" + } + return t +} + +// declImports reports whether gen contains an import of path. +func declImports(gen *ast.GenDecl, path string) bool { + if gen.Tok != token.IMPORT { + return false + } + for _, spec := range gen.Specs { + impspec := spec.(*ast.ImportSpec) + if importPath(impspec) == path { + return true + } + } + return false +} + +// matchLen returns the length of the longest path segment prefix shared by x and y. +func matchLen(x, y string) int { + n := 0 + for i := 0; i < len(x) && i < len(y) && x[i] == y[i]; i++ { + if x[i] == '/' { + n++ + } + } + return n +} + +// isTopName returns true if n is a top-level unresolved identifier with the given name. +func isTopName(n ast.Expr, name string) bool { + id, ok := n.(*ast.Ident) + return ok && id.Name == name && id.Obj == nil +} + +// Imports returns the file imports grouped by paragraph. +func Imports(fset *token.FileSet, f *ast.File) [][]*ast.ImportSpec { + var groups [][]*ast.ImportSpec + + for _, decl := range f.Decls { + genDecl, ok := decl.(*ast.GenDecl) + if !ok || genDecl.Tok != token.IMPORT { + break + } + + group := []*ast.ImportSpec{} + + var lastLine int + for _, spec := range genDecl.Specs { + importSpec := spec.(*ast.ImportSpec) + pos := importSpec.Path.ValuePos + line := fset.Position(pos).Line + if lastLine > 0 && pos > 0 && line-lastLine > 1 { + groups = append(groups, group) + group = []*ast.ImportSpec{} + } + group = append(group, importSpec) + lastLine = line + } + groups = append(groups, group) + } + + return groups +} diff --git a/vendor/golang.org/x/tools/go/ast/astutil/rewrite.go b/vendor/golang.org/x/tools/go/ast/astutil/rewrite.go new file mode 100644 index 00000000..cf72ea99 --- /dev/null +++ b/vendor/golang.org/x/tools/go/ast/astutil/rewrite.go @@ -0,0 +1,477 @@ +// Copyright 2017 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package astutil + +import ( + "fmt" + "go/ast" + "reflect" + "sort" +) + +// An ApplyFunc is invoked by Apply for each node n, even if n is nil, +// before and/or after the node's children, using a Cursor describing +// the current node and providing operations on it. +// +// The return value of ApplyFunc controls the syntax tree traversal. +// See Apply for details. +type ApplyFunc func(*Cursor) bool + +// Apply traverses a syntax tree recursively, starting with root, +// and calling pre and post for each node as described below. +// Apply returns the syntax tree, possibly modified. +// +// If pre is not nil, it is called for each node before the node's +// children are traversed (pre-order). If pre returns false, no +// children are traversed, and post is not called for that node. +// +// If post is not nil, and a prior call of pre didn't return false, +// post is called for each node after its children are traversed +// (post-order). If post returns false, traversal is terminated and +// Apply returns immediately. +// +// Only fields that refer to AST nodes are considered children; +// i.e., token.Pos, Scopes, Objects, and fields of basic types +// (strings, etc.) are ignored. +// +// Children are traversed in the order in which they appear in the +// respective node's struct definition. A package's files are +// traversed in the filenames' alphabetical order. +// +func Apply(root ast.Node, pre, post ApplyFunc) (result ast.Node) { + parent := &struct{ ast.Node }{root} + defer func() { + if r := recover(); r != nil && r != abort { + panic(r) + } + result = parent.Node + }() + a := &application{pre: pre, post: post} + a.apply(parent, "Node", nil, root) + return +} + +var abort = new(int) // singleton, to signal termination of Apply + +// A Cursor describes a node encountered during Apply. +// Information about the node and its parent is available +// from the Node, Parent, Name, and Index methods. +// +// If p is a variable of type and value of the current parent node +// c.Parent(), and f is the field identifier with name c.Name(), +// the following invariants hold: +// +// p.f == c.Node() if c.Index() < 0 +// p.f[c.Index()] == c.Node() if c.Index() >= 0 +// +// The methods Replace, Delete, InsertBefore, and InsertAfter +// can be used to change the AST without disrupting Apply. +type Cursor struct { + parent ast.Node + name string + iter *iterator // valid if non-nil + node ast.Node +} + +// Node returns the current Node. +func (c *Cursor) Node() ast.Node { return c.node } + +// Parent returns the parent of the current Node. +func (c *Cursor) Parent() ast.Node { return c.parent } + +// Name returns the name of the parent Node field that contains the current Node. +// If the parent is a *ast.Package and the current Node is a *ast.File, Name returns +// the filename for the current Node. +func (c *Cursor) Name() string { return c.name } + +// Index reports the index >= 0 of the current Node in the slice of Nodes that +// contains it, or a value < 0 if the current Node is not part of a slice. +// The index of the current node changes if InsertBefore is called while +// processing the current node. +func (c *Cursor) Index() int { + if c.iter != nil { + return c.iter.index + } + return -1 +} + +// field returns the current node's parent field value. +func (c *Cursor) field() reflect.Value { + return reflect.Indirect(reflect.ValueOf(c.parent)).FieldByName(c.name) +} + +// Replace replaces the current Node with n. +// The replacement node is not walked by Apply. +func (c *Cursor) Replace(n ast.Node) { + if _, ok := c.node.(*ast.File); ok { + file, ok := n.(*ast.File) + if !ok { + panic("attempt to replace *ast.File with non-*ast.File") + } + c.parent.(*ast.Package).Files[c.name] = file + return + } + + v := c.field() + if i := c.Index(); i >= 0 { + v = v.Index(i) + } + v.Set(reflect.ValueOf(n)) +} + +// Delete deletes the current Node from its containing slice. +// If the current Node is not part of a slice, Delete panics. +// As a special case, if the current node is a package file, +// Delete removes it from the package's Files map. +func (c *Cursor) Delete() { + if _, ok := c.node.(*ast.File); ok { + delete(c.parent.(*ast.Package).Files, c.name) + return + } + + i := c.Index() + if i < 0 { + panic("Delete node not contained in slice") + } + v := c.field() + l := v.Len() + reflect.Copy(v.Slice(i, l), v.Slice(i+1, l)) + v.Index(l - 1).Set(reflect.Zero(v.Type().Elem())) + v.SetLen(l - 1) + c.iter.step-- +} + +// InsertAfter inserts n after the current Node in its containing slice. +// If the current Node is not part of a slice, InsertAfter panics. +// Apply does not walk n. +func (c *Cursor) InsertAfter(n ast.Node) { + i := c.Index() + if i < 0 { + panic("InsertAfter node not contained in slice") + } + v := c.field() + v.Set(reflect.Append(v, reflect.Zero(v.Type().Elem()))) + l := v.Len() + reflect.Copy(v.Slice(i+2, l), v.Slice(i+1, l)) + v.Index(i + 1).Set(reflect.ValueOf(n)) + c.iter.step++ +} + +// InsertBefore inserts n before the current Node in its containing slice. +// If the current Node is not part of a slice, InsertBefore panics. +// Apply will not walk n. +func (c *Cursor) InsertBefore(n ast.Node) { + i := c.Index() + if i < 0 { + panic("InsertBefore node not contained in slice") + } + v := c.field() + v.Set(reflect.Append(v, reflect.Zero(v.Type().Elem()))) + l := v.Len() + reflect.Copy(v.Slice(i+1, l), v.Slice(i, l)) + v.Index(i).Set(reflect.ValueOf(n)) + c.iter.index++ +} + +// application carries all the shared data so we can pass it around cheaply. +type application struct { + pre, post ApplyFunc + cursor Cursor + iter iterator +} + +func (a *application) apply(parent ast.Node, name string, iter *iterator, n ast.Node) { + // convert typed nil into untyped nil + if v := reflect.ValueOf(n); v.Kind() == reflect.Ptr && v.IsNil() { + n = nil + } + + // avoid heap-allocating a new cursor for each apply call; reuse a.cursor instead + saved := a.cursor + a.cursor.parent = parent + a.cursor.name = name + a.cursor.iter = iter + a.cursor.node = n + + if a.pre != nil && !a.pre(&a.cursor) { + a.cursor = saved + return + } + + // walk children + // (the order of the cases matches the order of the corresponding node types in go/ast) + switch n := n.(type) { + case nil: + // nothing to do + + // Comments and fields + case *ast.Comment: + // nothing to do + + case *ast.CommentGroup: + if n != nil { + a.applyList(n, "List") + } + + case *ast.Field: + a.apply(n, "Doc", nil, n.Doc) + a.applyList(n, "Names") + a.apply(n, "Type", nil, n.Type) + a.apply(n, "Tag", nil, n.Tag) + a.apply(n, "Comment", nil, n.Comment) + + case *ast.FieldList: + a.applyList(n, "List") + + // Expressions + case *ast.BadExpr, *ast.Ident, *ast.BasicLit: + // nothing to do + + case *ast.Ellipsis: + a.apply(n, "Elt", nil, n.Elt) + + case *ast.FuncLit: + a.apply(n, "Type", nil, n.Type) + a.apply(n, "Body", nil, n.Body) + + case *ast.CompositeLit: + a.apply(n, "Type", nil, n.Type) + a.applyList(n, "Elts") + + case *ast.ParenExpr: + a.apply(n, "X", nil, n.X) + + case *ast.SelectorExpr: + a.apply(n, "X", nil, n.X) + a.apply(n, "Sel", nil, n.Sel) + + case *ast.IndexExpr: + a.apply(n, "X", nil, n.X) + a.apply(n, "Index", nil, n.Index) + + case *ast.SliceExpr: + a.apply(n, "X", nil, n.X) + a.apply(n, "Low", nil, n.Low) + a.apply(n, "High", nil, n.High) + a.apply(n, "Max", nil, n.Max) + + case *ast.TypeAssertExpr: + a.apply(n, "X", nil, n.X) + a.apply(n, "Type", nil, n.Type) + + case *ast.CallExpr: + a.apply(n, "Fun", nil, n.Fun) + a.applyList(n, "Args") + + case *ast.StarExpr: + a.apply(n, "X", nil, n.X) + + case *ast.UnaryExpr: + a.apply(n, "X", nil, n.X) + + case *ast.BinaryExpr: + a.apply(n, "X", nil, n.X) + a.apply(n, "Y", nil, n.Y) + + case *ast.KeyValueExpr: + a.apply(n, "Key", nil, n.Key) + a.apply(n, "Value", nil, n.Value) + + // Types + case *ast.ArrayType: + a.apply(n, "Len", nil, n.Len) + a.apply(n, "Elt", nil, n.Elt) + + case *ast.StructType: + a.apply(n, "Fields", nil, n.Fields) + + case *ast.FuncType: + a.apply(n, "Params", nil, n.Params) + a.apply(n, "Results", nil, n.Results) + + case *ast.InterfaceType: + a.apply(n, "Methods", nil, n.Methods) + + case *ast.MapType: + a.apply(n, "Key", nil, n.Key) + a.apply(n, "Value", nil, n.Value) + + case *ast.ChanType: + a.apply(n, "Value", nil, n.Value) + + // Statements + case *ast.BadStmt: + // nothing to do + + case *ast.DeclStmt: + a.apply(n, "Decl", nil, n.Decl) + + case *ast.EmptyStmt: + // nothing to do + + case *ast.LabeledStmt: + a.apply(n, "Label", nil, n.Label) + a.apply(n, "Stmt", nil, n.Stmt) + + case *ast.ExprStmt: + a.apply(n, "X", nil, n.X) + + case *ast.SendStmt: + a.apply(n, "Chan", nil, n.Chan) + a.apply(n, "Value", nil, n.Value) + + case *ast.IncDecStmt: + a.apply(n, "X", nil, n.X) + + case *ast.AssignStmt: + a.applyList(n, "Lhs") + a.applyList(n, "Rhs") + + case *ast.GoStmt: + a.apply(n, "Call", nil, n.Call) + + case *ast.DeferStmt: + a.apply(n, "Call", nil, n.Call) + + case *ast.ReturnStmt: + a.applyList(n, "Results") + + case *ast.BranchStmt: + a.apply(n, "Label", nil, n.Label) + + case *ast.BlockStmt: + a.applyList(n, "List") + + case *ast.IfStmt: + a.apply(n, "Init", nil, n.Init) + a.apply(n, "Cond", nil, n.Cond) + a.apply(n, "Body", nil, n.Body) + a.apply(n, "Else", nil, n.Else) + + case *ast.CaseClause: + a.applyList(n, "List") + a.applyList(n, "Body") + + case *ast.SwitchStmt: + a.apply(n, "Init", nil, n.Init) + a.apply(n, "Tag", nil, n.Tag) + a.apply(n, "Body", nil, n.Body) + + case *ast.TypeSwitchStmt: + a.apply(n, "Init", nil, n.Init) + a.apply(n, "Assign", nil, n.Assign) + a.apply(n, "Body", nil, n.Body) + + case *ast.CommClause: + a.apply(n, "Comm", nil, n.Comm) + a.applyList(n, "Body") + + case *ast.SelectStmt: + a.apply(n, "Body", nil, n.Body) + + case *ast.ForStmt: + a.apply(n, "Init", nil, n.Init) + a.apply(n, "Cond", nil, n.Cond) + a.apply(n, "Post", nil, n.Post) + a.apply(n, "Body", nil, n.Body) + + case *ast.RangeStmt: + a.apply(n, "Key", nil, n.Key) + a.apply(n, "Value", nil, n.Value) + a.apply(n, "X", nil, n.X) + a.apply(n, "Body", nil, n.Body) + + // Declarations + case *ast.ImportSpec: + a.apply(n, "Doc", nil, n.Doc) + a.apply(n, "Name", nil, n.Name) + a.apply(n, "Path", nil, n.Path) + a.apply(n, "Comment", nil, n.Comment) + + case *ast.ValueSpec: + a.apply(n, "Doc", nil, n.Doc) + a.applyList(n, "Names") + a.apply(n, "Type", nil, n.Type) + a.applyList(n, "Values") + a.apply(n, "Comment", nil, n.Comment) + + case *ast.TypeSpec: + a.apply(n, "Doc", nil, n.Doc) + a.apply(n, "Name", nil, n.Name) + a.apply(n, "Type", nil, n.Type) + a.apply(n, "Comment", nil, n.Comment) + + case *ast.BadDecl: + // nothing to do + + case *ast.GenDecl: + a.apply(n, "Doc", nil, n.Doc) + a.applyList(n, "Specs") + + case *ast.FuncDecl: + a.apply(n, "Doc", nil, n.Doc) + a.apply(n, "Recv", nil, n.Recv) + a.apply(n, "Name", nil, n.Name) + a.apply(n, "Type", nil, n.Type) + a.apply(n, "Body", nil, n.Body) + + // Files and packages + case *ast.File: + a.apply(n, "Doc", nil, n.Doc) + a.apply(n, "Name", nil, n.Name) + a.applyList(n, "Decls") + // Don't walk n.Comments; they have either been walked already if + // they are Doc comments, or they can be easily walked explicitly. + + case *ast.Package: + // collect and sort names for reproducible behavior + var names []string + for name := range n.Files { + names = append(names, name) + } + sort.Strings(names) + for _, name := range names { + a.apply(n, name, nil, n.Files[name]) + } + + default: + panic(fmt.Sprintf("Apply: unexpected node type %T", n)) + } + + if a.post != nil && !a.post(&a.cursor) { + panic(abort) + } + + a.cursor = saved +} + +// An iterator controls iteration over a slice of nodes. +type iterator struct { + index, step int +} + +func (a *application) applyList(parent ast.Node, name string) { + // avoid heap-allocating a new iterator for each applyList call; reuse a.iter instead + saved := a.iter + a.iter.index = 0 + for { + // must reload parent.name each time, since cursor modifications might change it + v := reflect.Indirect(reflect.ValueOf(parent)).FieldByName(name) + if a.iter.index >= v.Len() { + break + } + + // element x may be nil in a bad AST - be cautious + var x ast.Node + if e := v.Index(a.iter.index); e.IsValid() { + x = e.Interface().(ast.Node) + } + + a.iter.step = 1 + a.apply(parent, name, &a.iter, x) + a.iter.index += a.iter.step + } + a.iter = saved +} diff --git a/vendor/golang.org/x/tools/go/ast/astutil/util.go b/vendor/golang.org/x/tools/go/ast/astutil/util.go new file mode 100644 index 00000000..76306298 --- /dev/null +++ b/vendor/golang.org/x/tools/go/ast/astutil/util.go @@ -0,0 +1,14 @@ +package astutil + +import "go/ast" + +// Unparen returns e with any enclosing parentheses stripped. +func Unparen(e ast.Expr) ast.Expr { + for { + p, ok := e.(*ast.ParenExpr) + if !ok { + return e + } + e = p.X + } +} diff --git a/vendor/golang.org/x/tools/go/gcexportdata/gcexportdata.go b/vendor/golang.org/x/tools/go/gcexportdata/gcexportdata.go new file mode 100644 index 00000000..f8363d8f --- /dev/null +++ b/vendor/golang.org/x/tools/go/gcexportdata/gcexportdata.go @@ -0,0 +1,109 @@ +// Copyright 2016 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Package gcexportdata provides functions for locating, reading, and +// writing export data files containing type information produced by the +// gc compiler. This package supports go1.7 export data format and all +// later versions. +// +// Although it might seem convenient for this package to live alongside +// go/types in the standard library, this would cause version skew +// problems for developer tools that use it, since they must be able to +// consume the outputs of the gc compiler both before and after a Go +// update such as from Go 1.7 to Go 1.8. Because this package lives in +// golang.org/x/tools, sites can update their version of this repo some +// time before the Go 1.8 release and rebuild and redeploy their +// developer tools, which will then be able to consume both Go 1.7 and +// Go 1.8 export data files, so they will work before and after the +// Go update. (See discussion at https://golang.org/issue/15651.) +// +package gcexportdata // import "golang.org/x/tools/go/gcexportdata" + +import ( + "bufio" + "bytes" + "fmt" + "go/token" + "go/types" + "io" + "io/ioutil" + + "golang.org/x/tools/go/internal/gcimporter" +) + +// Find returns the name of an object (.o) or archive (.a) file +// containing type information for the specified import path, +// using the workspace layout conventions of go/build. +// If no file was found, an empty filename is returned. +// +// A relative srcDir is interpreted relative to the current working directory. +// +// Find also returns the package's resolved (canonical) import path, +// reflecting the effects of srcDir and vendoring on importPath. +func Find(importPath, srcDir string) (filename, path string) { + return gcimporter.FindPkg(importPath, srcDir) +} + +// NewReader returns a reader for the export data section of an object +// (.o) or archive (.a) file read from r. The new reader may provide +// additional trailing data beyond the end of the export data. +func NewReader(r io.Reader) (io.Reader, error) { + buf := bufio.NewReader(r) + _, err := gcimporter.FindExportData(buf) + // If we ever switch to a zip-like archive format with the ToC + // at the end, we can return the correct portion of export data, + // but for now we must return the entire rest of the file. + return buf, err +} + +// Read reads export data from in, decodes it, and returns type +// information for the package. +// The package name is specified by path. +// File position information is added to fset. +// +// Read may inspect and add to the imports map to ensure that references +// within the export data to other packages are consistent. The caller +// must ensure that imports[path] does not exist, or exists but is +// incomplete (see types.Package.Complete), and Read inserts the +// resulting package into this map entry. +// +// On return, the state of the reader is undefined. +func Read(in io.Reader, fset *token.FileSet, imports map[string]*types.Package, path string) (*types.Package, error) { + data, err := ioutil.ReadAll(in) + if err != nil { + return nil, fmt.Errorf("reading export data for %q: %v", path, err) + } + + if bytes.HasPrefix(data, []byte("!")) { + return nil, fmt.Errorf("can't read export data for %q directly from an archive file (call gcexportdata.NewReader first to extract export data)", path) + } + + // The App Engine Go runtime v1.6 uses the old export data format. + // TODO(adonovan): delete once v1.7 has been around for a while. + if bytes.HasPrefix(data, []byte("package ")) { + return gcimporter.ImportData(imports, path, path, bytes.NewReader(data)) + } + + // The indexed export format starts with an 'i'; the older + // binary export format starts with a 'c', 'd', or 'v' + // (from "version"). Select appropriate importer. + if len(data) > 0 && data[0] == 'i' { + _, pkg, err := gcimporter.IImportData(fset, imports, data[1:], path) + return pkg, err + } + + _, pkg, err := gcimporter.BImportData(fset, imports, data, path) + return pkg, err +} + +// Write writes encoded type information for the specified package to out. +// The FileSet provides file position information for named objects. +func Write(out io.Writer, fset *token.FileSet, pkg *types.Package) error { + b, err := gcimporter.IExportData(fset, pkg) + if err != nil { + return err + } + _, err = out.Write(b) + return err +} diff --git a/vendor/golang.org/x/tools/go/gcexportdata/importer.go b/vendor/golang.org/x/tools/go/gcexportdata/importer.go new file mode 100644 index 00000000..efe221e7 --- /dev/null +++ b/vendor/golang.org/x/tools/go/gcexportdata/importer.go @@ -0,0 +1,73 @@ +// Copyright 2016 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package gcexportdata + +import ( + "fmt" + "go/token" + "go/types" + "os" +) + +// NewImporter returns a new instance of the types.Importer interface +// that reads type information from export data files written by gc. +// The Importer also satisfies types.ImporterFrom. +// +// Export data files are located using "go build" workspace conventions +// and the build.Default context. +// +// Use this importer instead of go/importer.For("gc", ...) to avoid the +// version-skew problems described in the documentation of this package, +// or to control the FileSet or access the imports map populated during +// package loading. +// +func NewImporter(fset *token.FileSet, imports map[string]*types.Package) types.ImporterFrom { + return importer{fset, imports} +} + +type importer struct { + fset *token.FileSet + imports map[string]*types.Package +} + +func (imp importer) Import(importPath string) (*types.Package, error) { + return imp.ImportFrom(importPath, "", 0) +} + +func (imp importer) ImportFrom(importPath, srcDir string, mode types.ImportMode) (_ *types.Package, err error) { + filename, path := Find(importPath, srcDir) + if filename == "" { + if importPath == "unsafe" { + // Even for unsafe, call Find first in case + // the package was vendored. + return types.Unsafe, nil + } + return nil, fmt.Errorf("can't find import: %s", importPath) + } + + if pkg, ok := imp.imports[path]; ok && pkg.Complete() { + return pkg, nil // cache hit + } + + // open file + f, err := os.Open(filename) + if err != nil { + return nil, err + } + defer func() { + f.Close() + if err != nil { + // add file name to error + err = fmt.Errorf("reading export data: %s: %v", filename, err) + } + }() + + r, err := NewReader(f) + if err != nil { + return nil, err + } + + return Read(r, imp.fset, imp.imports, path) +} diff --git a/vendor/golang.org/x/tools/go/internal/gcimporter/bexport.go b/vendor/golang.org/x/tools/go/internal/gcimporter/bexport.go new file mode 100644 index 00000000..a807d0aa --- /dev/null +++ b/vendor/golang.org/x/tools/go/internal/gcimporter/bexport.go @@ -0,0 +1,852 @@ +// Copyright 2016 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Binary package export. +// This file was derived from $GOROOT/src/cmd/compile/internal/gc/bexport.go; +// see that file for specification of the format. + +package gcimporter + +import ( + "bytes" + "encoding/binary" + "fmt" + "go/ast" + "go/constant" + "go/token" + "go/types" + "math" + "math/big" + "sort" + "strings" +) + +// If debugFormat is set, each integer and string value is preceded by a marker +// and position information in the encoding. This mechanism permits an importer +// to recognize immediately when it is out of sync. The importer recognizes this +// mode automatically (i.e., it can import export data produced with debugging +// support even if debugFormat is not set at the time of import). This mode will +// lead to massively larger export data (by a factor of 2 to 3) and should only +// be enabled during development and debugging. +// +// NOTE: This flag is the first flag to enable if importing dies because of +// (suspected) format errors, and whenever a change is made to the format. +const debugFormat = false // default: false + +// If trace is set, debugging output is printed to std out. +const trace = false // default: false + +// Current export format version. Increase with each format change. +// Note: The latest binary (non-indexed) export format is at version 6. +// This exporter is still at level 4, but it doesn't matter since +// the binary importer can handle older versions just fine. +// 6: package height (CL 105038) -- NOT IMPLEMENTED HERE +// 5: improved position encoding efficiency (issue 20080, CL 41619) -- NOT IMPLEMEMTED HERE +// 4: type name objects support type aliases, uses aliasTag +// 3: Go1.8 encoding (same as version 2, aliasTag defined but never used) +// 2: removed unused bool in ODCL export (compiler only) +// 1: header format change (more regular), export package for _ struct fields +// 0: Go1.7 encoding +const exportVersion = 4 + +// trackAllTypes enables cycle tracking for all types, not just named +// types. The existing compiler invariants assume that unnamed types +// that are not completely set up are not used, or else there are spurious +// errors. +// If disabled, only named types are tracked, possibly leading to slightly +// less efficient encoding in rare cases. It also prevents the export of +// some corner-case type declarations (but those are not handled correctly +// with with the textual export format either). +// TODO(gri) enable and remove once issues caused by it are fixed +const trackAllTypes = false + +type exporter struct { + fset *token.FileSet + out bytes.Buffer + + // object -> index maps, indexed in order of serialization + strIndex map[string]int + pkgIndex map[*types.Package]int + typIndex map[types.Type]int + + // position encoding + posInfoFormat bool + prevFile string + prevLine int + + // debugging support + written int // bytes written + indent int // for trace +} + +// internalError represents an error generated inside this package. +type internalError string + +func (e internalError) Error() string { return "gcimporter: " + string(e) } + +func internalErrorf(format string, args ...interface{}) error { + return internalError(fmt.Sprintf(format, args...)) +} + +// BExportData returns binary export data for pkg. +// If no file set is provided, position info will be missing. +func BExportData(fset *token.FileSet, pkg *types.Package) (b []byte, err error) { + defer func() { + if e := recover(); e != nil { + if ierr, ok := e.(internalError); ok { + err = ierr + return + } + // Not an internal error; panic again. + panic(e) + } + }() + + p := exporter{ + fset: fset, + strIndex: map[string]int{"": 0}, // empty string is mapped to 0 + pkgIndex: make(map[*types.Package]int), + typIndex: make(map[types.Type]int), + posInfoFormat: true, // TODO(gri) might become a flag, eventually + } + + // write version info + // The version string must start with "version %d" where %d is the version + // number. Additional debugging information may follow after a blank; that + // text is ignored by the importer. + p.rawStringln(fmt.Sprintf("version %d", exportVersion)) + var debug string + if debugFormat { + debug = "debug" + } + p.rawStringln(debug) // cannot use p.bool since it's affected by debugFormat; also want to see this clearly + p.bool(trackAllTypes) + p.bool(p.posInfoFormat) + + // --- generic export data --- + + // populate type map with predeclared "known" types + for index, typ := range predeclared() { + p.typIndex[typ] = index + } + if len(p.typIndex) != len(predeclared()) { + return nil, internalError("duplicate entries in type map?") + } + + // write package data + p.pkg(pkg, true) + if trace { + p.tracef("\n") + } + + // write objects + objcount := 0 + scope := pkg.Scope() + for _, name := range scope.Names() { + if !ast.IsExported(name) { + continue + } + if trace { + p.tracef("\n") + } + p.obj(scope.Lookup(name)) + objcount++ + } + + // indicate end of list + if trace { + p.tracef("\n") + } + p.tag(endTag) + + // for self-verification only (redundant) + p.int(objcount) + + if trace { + p.tracef("\n") + } + + // --- end of export data --- + + return p.out.Bytes(), nil +} + +func (p *exporter) pkg(pkg *types.Package, emptypath bool) { + if pkg == nil { + panic(internalError("unexpected nil pkg")) + } + + // if we saw the package before, write its index (>= 0) + if i, ok := p.pkgIndex[pkg]; ok { + p.index('P', i) + return + } + + // otherwise, remember the package, write the package tag (< 0) and package data + if trace { + p.tracef("P%d = { ", len(p.pkgIndex)) + defer p.tracef("} ") + } + p.pkgIndex[pkg] = len(p.pkgIndex) + + p.tag(packageTag) + p.string(pkg.Name()) + if emptypath { + p.string("") + } else { + p.string(pkg.Path()) + } +} + +func (p *exporter) obj(obj types.Object) { + switch obj := obj.(type) { + case *types.Const: + p.tag(constTag) + p.pos(obj) + p.qualifiedName(obj) + p.typ(obj.Type()) + p.value(obj.Val()) + + case *types.TypeName: + if obj.IsAlias() { + p.tag(aliasTag) + p.pos(obj) + p.qualifiedName(obj) + } else { + p.tag(typeTag) + } + p.typ(obj.Type()) + + case *types.Var: + p.tag(varTag) + p.pos(obj) + p.qualifiedName(obj) + p.typ(obj.Type()) + + case *types.Func: + p.tag(funcTag) + p.pos(obj) + p.qualifiedName(obj) + sig := obj.Type().(*types.Signature) + p.paramList(sig.Params(), sig.Variadic()) + p.paramList(sig.Results(), false) + + default: + panic(internalErrorf("unexpected object %v (%T)", obj, obj)) + } +} + +func (p *exporter) pos(obj types.Object) { + if !p.posInfoFormat { + return + } + + file, line := p.fileLine(obj) + if file == p.prevFile { + // common case: write line delta + // delta == 0 means different file or no line change + delta := line - p.prevLine + p.int(delta) + if delta == 0 { + p.int(-1) // -1 means no file change + } + } else { + // different file + p.int(0) + // Encode filename as length of common prefix with previous + // filename, followed by (possibly empty) suffix. Filenames + // frequently share path prefixes, so this can save a lot + // of space and make export data size less dependent on file + // path length. The suffix is unlikely to be empty because + // file names tend to end in ".go". + n := commonPrefixLen(p.prevFile, file) + p.int(n) // n >= 0 + p.string(file[n:]) // write suffix only + p.prevFile = file + p.int(line) + } + p.prevLine = line +} + +func (p *exporter) fileLine(obj types.Object) (file string, line int) { + if p.fset != nil { + pos := p.fset.Position(obj.Pos()) + file = pos.Filename + line = pos.Line + } + return +} + +func commonPrefixLen(a, b string) int { + if len(a) > len(b) { + a, b = b, a + } + // len(a) <= len(b) + i := 0 + for i < len(a) && a[i] == b[i] { + i++ + } + return i +} + +func (p *exporter) qualifiedName(obj types.Object) { + p.string(obj.Name()) + p.pkg(obj.Pkg(), false) +} + +func (p *exporter) typ(t types.Type) { + if t == nil { + panic(internalError("nil type")) + } + + // Possible optimization: Anonymous pointer types *T where + // T is a named type are common. We could canonicalize all + // such types *T to a single type PT = *T. This would lead + // to at most one *T entry in typIndex, and all future *T's + // would be encoded as the respective index directly. Would + // save 1 byte (pointerTag) per *T and reduce the typIndex + // size (at the cost of a canonicalization map). We can do + // this later, without encoding format change. + + // if we saw the type before, write its index (>= 0) + if i, ok := p.typIndex[t]; ok { + p.index('T', i) + return + } + + // otherwise, remember the type, write the type tag (< 0) and type data + if trackAllTypes { + if trace { + p.tracef("T%d = {>\n", len(p.typIndex)) + defer p.tracef("<\n} ") + } + p.typIndex[t] = len(p.typIndex) + } + + switch t := t.(type) { + case *types.Named: + if !trackAllTypes { + // if we don't track all types, track named types now + p.typIndex[t] = len(p.typIndex) + } + + p.tag(namedTag) + p.pos(t.Obj()) + p.qualifiedName(t.Obj()) + p.typ(t.Underlying()) + if !types.IsInterface(t) { + p.assocMethods(t) + } + + case *types.Array: + p.tag(arrayTag) + p.int64(t.Len()) + p.typ(t.Elem()) + + case *types.Slice: + p.tag(sliceTag) + p.typ(t.Elem()) + + case *dddSlice: + p.tag(dddTag) + p.typ(t.elem) + + case *types.Struct: + p.tag(structTag) + p.fieldList(t) + + case *types.Pointer: + p.tag(pointerTag) + p.typ(t.Elem()) + + case *types.Signature: + p.tag(signatureTag) + p.paramList(t.Params(), t.Variadic()) + p.paramList(t.Results(), false) + + case *types.Interface: + p.tag(interfaceTag) + p.iface(t) + + case *types.Map: + p.tag(mapTag) + p.typ(t.Key()) + p.typ(t.Elem()) + + case *types.Chan: + p.tag(chanTag) + p.int(int(3 - t.Dir())) // hack + p.typ(t.Elem()) + + default: + panic(internalErrorf("unexpected type %T: %s", t, t)) + } +} + +func (p *exporter) assocMethods(named *types.Named) { + // Sort methods (for determinism). + var methods []*types.Func + for i := 0; i < named.NumMethods(); i++ { + methods = append(methods, named.Method(i)) + } + sort.Sort(methodsByName(methods)) + + p.int(len(methods)) + + if trace && methods != nil { + p.tracef("associated methods {>\n") + } + + for i, m := range methods { + if trace && i > 0 { + p.tracef("\n") + } + + p.pos(m) + name := m.Name() + p.string(name) + if !exported(name) { + p.pkg(m.Pkg(), false) + } + + sig := m.Type().(*types.Signature) + p.paramList(types.NewTuple(sig.Recv()), false) + p.paramList(sig.Params(), sig.Variadic()) + p.paramList(sig.Results(), false) + p.int(0) // dummy value for go:nointerface pragma - ignored by importer + } + + if trace && methods != nil { + p.tracef("<\n} ") + } +} + +type methodsByName []*types.Func + +func (x methodsByName) Len() int { return len(x) } +func (x methodsByName) Swap(i, j int) { x[i], x[j] = x[j], x[i] } +func (x methodsByName) Less(i, j int) bool { return x[i].Name() < x[j].Name() } + +func (p *exporter) fieldList(t *types.Struct) { + if trace && t.NumFields() > 0 { + p.tracef("fields {>\n") + defer p.tracef("<\n} ") + } + + p.int(t.NumFields()) + for i := 0; i < t.NumFields(); i++ { + if trace && i > 0 { + p.tracef("\n") + } + p.field(t.Field(i)) + p.string(t.Tag(i)) + } +} + +func (p *exporter) field(f *types.Var) { + if !f.IsField() { + panic(internalError("field expected")) + } + + p.pos(f) + p.fieldName(f) + p.typ(f.Type()) +} + +func (p *exporter) iface(t *types.Interface) { + // TODO(gri): enable importer to load embedded interfaces, + // then emit Embeddeds and ExplicitMethods separately here. + p.int(0) + + n := t.NumMethods() + if trace && n > 0 { + p.tracef("methods {>\n") + defer p.tracef("<\n} ") + } + p.int(n) + for i := 0; i < n; i++ { + if trace && i > 0 { + p.tracef("\n") + } + p.method(t.Method(i)) + } +} + +func (p *exporter) method(m *types.Func) { + sig := m.Type().(*types.Signature) + if sig.Recv() == nil { + panic(internalError("method expected")) + } + + p.pos(m) + p.string(m.Name()) + if m.Name() != "_" && !ast.IsExported(m.Name()) { + p.pkg(m.Pkg(), false) + } + + // interface method; no need to encode receiver. + p.paramList(sig.Params(), sig.Variadic()) + p.paramList(sig.Results(), false) +} + +func (p *exporter) fieldName(f *types.Var) { + name := f.Name() + + if f.Anonymous() { + // anonymous field - we distinguish between 3 cases: + // 1) field name matches base type name and is exported + // 2) field name matches base type name and is not exported + // 3) field name doesn't match base type name (alias name) + bname := basetypeName(f.Type()) + if name == bname { + if ast.IsExported(name) { + name = "" // 1) we don't need to know the field name or package + } else { + name = "?" // 2) use unexported name "?" to force package export + } + } else { + // 3) indicate alias and export name as is + // (this requires an extra "@" but this is a rare case) + p.string("@") + } + } + + p.string(name) + if name != "" && !ast.IsExported(name) { + p.pkg(f.Pkg(), false) + } +} + +func basetypeName(typ types.Type) string { + switch typ := deref(typ).(type) { + case *types.Basic: + return typ.Name() + case *types.Named: + return typ.Obj().Name() + default: + return "" // unnamed type + } +} + +func (p *exporter) paramList(params *types.Tuple, variadic bool) { + // use negative length to indicate unnamed parameters + // (look at the first parameter only since either all + // names are present or all are absent) + n := params.Len() + if n > 0 && params.At(0).Name() == "" { + n = -n + } + p.int(n) + for i := 0; i < params.Len(); i++ { + q := params.At(i) + t := q.Type() + if variadic && i == params.Len()-1 { + t = &dddSlice{t.(*types.Slice).Elem()} + } + p.typ(t) + if n > 0 { + name := q.Name() + p.string(name) + if name != "_" { + p.pkg(q.Pkg(), false) + } + } + p.string("") // no compiler-specific info + } +} + +func (p *exporter) value(x constant.Value) { + if trace { + p.tracef("= ") + } + + switch x.Kind() { + case constant.Bool: + tag := falseTag + if constant.BoolVal(x) { + tag = trueTag + } + p.tag(tag) + + case constant.Int: + if v, exact := constant.Int64Val(x); exact { + // common case: x fits into an int64 - use compact encoding + p.tag(int64Tag) + p.int64(v) + return + } + // uncommon case: large x - use float encoding + // (powers of 2 will be encoded efficiently with exponent) + p.tag(floatTag) + p.float(constant.ToFloat(x)) + + case constant.Float: + p.tag(floatTag) + p.float(x) + + case constant.Complex: + p.tag(complexTag) + p.float(constant.Real(x)) + p.float(constant.Imag(x)) + + case constant.String: + p.tag(stringTag) + p.string(constant.StringVal(x)) + + case constant.Unknown: + // package contains type errors + p.tag(unknownTag) + + default: + panic(internalErrorf("unexpected value %v (%T)", x, x)) + } +} + +func (p *exporter) float(x constant.Value) { + if x.Kind() != constant.Float { + panic(internalErrorf("unexpected constant %v, want float", x)) + } + // extract sign (there is no -0) + sign := constant.Sign(x) + if sign == 0 { + // x == 0 + p.int(0) + return + } + // x != 0 + + var f big.Float + if v, exact := constant.Float64Val(x); exact { + // float64 + f.SetFloat64(v) + } else if num, denom := constant.Num(x), constant.Denom(x); num.Kind() == constant.Int { + // TODO(gri): add big.Rat accessor to constant.Value. + r := valueToRat(num) + f.SetRat(r.Quo(r, valueToRat(denom))) + } else { + // Value too large to represent as a fraction => inaccessible. + // TODO(gri): add big.Float accessor to constant.Value. + f.SetFloat64(math.MaxFloat64) // FIXME + } + + // extract exponent such that 0.5 <= m < 1.0 + var m big.Float + exp := f.MantExp(&m) + + // extract mantissa as *big.Int + // - set exponent large enough so mant satisfies mant.IsInt() + // - get *big.Int from mant + m.SetMantExp(&m, int(m.MinPrec())) + mant, acc := m.Int(nil) + if acc != big.Exact { + panic(internalError("internal error")) + } + + p.int(sign) + p.int(exp) + p.string(string(mant.Bytes())) +} + +func valueToRat(x constant.Value) *big.Rat { + // Convert little-endian to big-endian. + // I can't believe this is necessary. + bytes := constant.Bytes(x) + for i := 0; i < len(bytes)/2; i++ { + bytes[i], bytes[len(bytes)-1-i] = bytes[len(bytes)-1-i], bytes[i] + } + return new(big.Rat).SetInt(new(big.Int).SetBytes(bytes)) +} + +func (p *exporter) bool(b bool) bool { + if trace { + p.tracef("[") + defer p.tracef("= %v] ", b) + } + + x := 0 + if b { + x = 1 + } + p.int(x) + return b +} + +// ---------------------------------------------------------------------------- +// Low-level encoders + +func (p *exporter) index(marker byte, index int) { + if index < 0 { + panic(internalError("invalid index < 0")) + } + if debugFormat { + p.marker('t') + } + if trace { + p.tracef("%c%d ", marker, index) + } + p.rawInt64(int64(index)) +} + +func (p *exporter) tag(tag int) { + if tag >= 0 { + panic(internalError("invalid tag >= 0")) + } + if debugFormat { + p.marker('t') + } + if trace { + p.tracef("%s ", tagString[-tag]) + } + p.rawInt64(int64(tag)) +} + +func (p *exporter) int(x int) { + p.int64(int64(x)) +} + +func (p *exporter) int64(x int64) { + if debugFormat { + p.marker('i') + } + if trace { + p.tracef("%d ", x) + } + p.rawInt64(x) +} + +func (p *exporter) string(s string) { + if debugFormat { + p.marker('s') + } + if trace { + p.tracef("%q ", s) + } + // if we saw the string before, write its index (>= 0) + // (the empty string is mapped to 0) + if i, ok := p.strIndex[s]; ok { + p.rawInt64(int64(i)) + return + } + // otherwise, remember string and write its negative length and bytes + p.strIndex[s] = len(p.strIndex) + p.rawInt64(-int64(len(s))) + for i := 0; i < len(s); i++ { + p.rawByte(s[i]) + } +} + +// marker emits a marker byte and position information which makes +// it easy for a reader to detect if it is "out of sync". Used for +// debugFormat format only. +func (p *exporter) marker(m byte) { + p.rawByte(m) + // Enable this for help tracking down the location + // of an incorrect marker when running in debugFormat. + if false && trace { + p.tracef("#%d ", p.written) + } + p.rawInt64(int64(p.written)) +} + +// rawInt64 should only be used by low-level encoders. +func (p *exporter) rawInt64(x int64) { + var tmp [binary.MaxVarintLen64]byte + n := binary.PutVarint(tmp[:], x) + for i := 0; i < n; i++ { + p.rawByte(tmp[i]) + } +} + +// rawStringln should only be used to emit the initial version string. +func (p *exporter) rawStringln(s string) { + for i := 0; i < len(s); i++ { + p.rawByte(s[i]) + } + p.rawByte('\n') +} + +// rawByte is the bottleneck interface to write to p.out. +// rawByte escapes b as follows (any encoding does that +// hides '$'): +// +// '$' => '|' 'S' +// '|' => '|' '|' +// +// Necessary so other tools can find the end of the +// export data by searching for "$$". +// rawByte should only be used by low-level encoders. +func (p *exporter) rawByte(b byte) { + switch b { + case '$': + // write '$' as '|' 'S' + b = 'S' + fallthrough + case '|': + // write '|' as '|' '|' + p.out.WriteByte('|') + p.written++ + } + p.out.WriteByte(b) + p.written++ +} + +// tracef is like fmt.Printf but it rewrites the format string +// to take care of indentation. +func (p *exporter) tracef(format string, args ...interface{}) { + if strings.ContainsAny(format, "<>\n") { + var buf bytes.Buffer + for i := 0; i < len(format); i++ { + // no need to deal with runes + ch := format[i] + switch ch { + case '>': + p.indent++ + continue + case '<': + p.indent-- + continue + } + buf.WriteByte(ch) + if ch == '\n' { + for j := p.indent; j > 0; j-- { + buf.WriteString(". ") + } + } + } + format = buf.String() + } + fmt.Printf(format, args...) +} + +// Debugging support. +// (tagString is only used when tracing is enabled) +var tagString = [...]string{ + // Packages + -packageTag: "package", + + // Types + -namedTag: "named type", + -arrayTag: "array", + -sliceTag: "slice", + -dddTag: "ddd", + -structTag: "struct", + -pointerTag: "pointer", + -signatureTag: "signature", + -interfaceTag: "interface", + -mapTag: "map", + -chanTag: "chan", + + // Values + -falseTag: "false", + -trueTag: "true", + -int64Tag: "int64", + -floatTag: "float", + -fractionTag: "fraction", + -complexTag: "complex", + -stringTag: "string", + -unknownTag: "unknown", + + // Type aliases + -aliasTag: "alias", +} diff --git a/vendor/golang.org/x/tools/go/internal/gcimporter/bimport.go b/vendor/golang.org/x/tools/go/internal/gcimporter/bimport.go new file mode 100644 index 00000000..e9f73d14 --- /dev/null +++ b/vendor/golang.org/x/tools/go/internal/gcimporter/bimport.go @@ -0,0 +1,1039 @@ +// Copyright 2015 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// This file is a copy of $GOROOT/src/go/internal/gcimporter/bimport.go. + +package gcimporter + +import ( + "encoding/binary" + "fmt" + "go/constant" + "go/token" + "go/types" + "sort" + "strconv" + "strings" + "sync" + "unicode" + "unicode/utf8" +) + +type importer struct { + imports map[string]*types.Package + data []byte + importpath string + buf []byte // for reading strings + version int // export format version + + // object lists + strList []string // in order of appearance + pathList []string // in order of appearance + pkgList []*types.Package // in order of appearance + typList []types.Type // in order of appearance + interfaceList []*types.Interface // for delayed completion only + trackAllTypes bool + + // position encoding + posInfoFormat bool + prevFile string + prevLine int + fake fakeFileSet + + // debugging support + debugFormat bool + read int // bytes read +} + +// BImportData imports a package from the serialized package data +// and returns the number of bytes consumed and a reference to the package. +// If the export data version is not recognized or the format is otherwise +// compromised, an error is returned. +func BImportData(fset *token.FileSet, imports map[string]*types.Package, data []byte, path string) (_ int, pkg *types.Package, err error) { + // catch panics and return them as errors + const currentVersion = 6 + version := -1 // unknown version + defer func() { + if e := recover(); e != nil { + // Return a (possibly nil or incomplete) package unchanged (see #16088). + if version > currentVersion { + err = fmt.Errorf("cannot import %q (%v), export data is newer version - update tool", path, e) + } else { + err = fmt.Errorf("cannot import %q (%v), possibly version skew - reinstall package", path, e) + } + } + }() + + p := importer{ + imports: imports, + data: data, + importpath: path, + version: version, + strList: []string{""}, // empty string is mapped to 0 + pathList: []string{""}, // empty string is mapped to 0 + fake: fakeFileSet{ + fset: fset, + files: make(map[string]*token.File), + }, + } + + // read version info + var versionstr string + if b := p.rawByte(); b == 'c' || b == 'd' { + // Go1.7 encoding; first byte encodes low-level + // encoding format (compact vs debug). + // For backward-compatibility only (avoid problems with + // old installed packages). Newly compiled packages use + // the extensible format string. + // TODO(gri) Remove this support eventually; after Go1.8. + if b == 'd' { + p.debugFormat = true + } + p.trackAllTypes = p.rawByte() == 'a' + p.posInfoFormat = p.int() != 0 + versionstr = p.string() + if versionstr == "v1" { + version = 0 + } + } else { + // Go1.8 extensible encoding + // read version string and extract version number (ignore anything after the version number) + versionstr = p.rawStringln(b) + if s := strings.SplitN(versionstr, " ", 3); len(s) >= 2 && s[0] == "version" { + if v, err := strconv.Atoi(s[1]); err == nil && v > 0 { + version = v + } + } + } + p.version = version + + // read version specific flags - extend as necessary + switch p.version { + // case currentVersion: + // ... + // fallthrough + case currentVersion, 5, 4, 3, 2, 1: + p.debugFormat = p.rawStringln(p.rawByte()) == "debug" + p.trackAllTypes = p.int() != 0 + p.posInfoFormat = p.int() != 0 + case 0: + // Go1.7 encoding format - nothing to do here + default: + errorf("unknown bexport format version %d (%q)", p.version, versionstr) + } + + // --- generic export data --- + + // populate typList with predeclared "known" types + p.typList = append(p.typList, predeclared()...) + + // read package data + pkg = p.pkg() + + // read objects of phase 1 only (see cmd/compile/internal/gc/bexport.go) + objcount := 0 + for { + tag := p.tagOrIndex() + if tag == endTag { + break + } + p.obj(tag) + objcount++ + } + + // self-verification + if count := p.int(); count != objcount { + errorf("got %d objects; want %d", objcount, count) + } + + // ignore compiler-specific import data + + // complete interfaces + // TODO(gri) re-investigate if we still need to do this in a delayed fashion + for _, typ := range p.interfaceList { + typ.Complete() + } + + // record all referenced packages as imports + list := append(([]*types.Package)(nil), p.pkgList[1:]...) + sort.Sort(byPath(list)) + pkg.SetImports(list) + + // package was imported completely and without errors + pkg.MarkComplete() + + return p.read, pkg, nil +} + +func errorf(format string, args ...interface{}) { + panic(fmt.Sprintf(format, args...)) +} + +func (p *importer) pkg() *types.Package { + // if the package was seen before, i is its index (>= 0) + i := p.tagOrIndex() + if i >= 0 { + return p.pkgList[i] + } + + // otherwise, i is the package tag (< 0) + if i != packageTag { + errorf("unexpected package tag %d version %d", i, p.version) + } + + // read package data + name := p.string() + var path string + if p.version >= 5 { + path = p.path() + } else { + path = p.string() + } + if p.version >= 6 { + p.int() // package height; unused by go/types + } + + // we should never see an empty package name + if name == "" { + errorf("empty package name in import") + } + + // an empty path denotes the package we are currently importing; + // it must be the first package we see + if (path == "") != (len(p.pkgList) == 0) { + errorf("package path %q for pkg index %d", path, len(p.pkgList)) + } + + // if the package was imported before, use that one; otherwise create a new one + if path == "" { + path = p.importpath + } + pkg := p.imports[path] + if pkg == nil { + pkg = types.NewPackage(path, name) + p.imports[path] = pkg + } else if pkg.Name() != name { + errorf("conflicting names %s and %s for package %q", pkg.Name(), name, path) + } + p.pkgList = append(p.pkgList, pkg) + + return pkg +} + +// objTag returns the tag value for each object kind. +func objTag(obj types.Object) int { + switch obj.(type) { + case *types.Const: + return constTag + case *types.TypeName: + return typeTag + case *types.Var: + return varTag + case *types.Func: + return funcTag + default: + errorf("unexpected object: %v (%T)", obj, obj) // panics + panic("unreachable") + } +} + +func sameObj(a, b types.Object) bool { + // Because unnamed types are not canonicalized, we cannot simply compare types for + // (pointer) identity. + // Ideally we'd check equality of constant values as well, but this is good enough. + return objTag(a) == objTag(b) && types.Identical(a.Type(), b.Type()) +} + +func (p *importer) declare(obj types.Object) { + pkg := obj.Pkg() + if alt := pkg.Scope().Insert(obj); alt != nil { + // This can only trigger if we import a (non-type) object a second time. + // Excluding type aliases, this cannot happen because 1) we only import a package + // once; and b) we ignore compiler-specific export data which may contain + // functions whose inlined function bodies refer to other functions that + // were already imported. + // However, type aliases require reexporting the original type, so we need + // to allow it (see also the comment in cmd/compile/internal/gc/bimport.go, + // method importer.obj, switch case importing functions). + // TODO(gri) review/update this comment once the gc compiler handles type aliases. + if !sameObj(obj, alt) { + errorf("inconsistent import:\n\t%v\npreviously imported as:\n\t%v\n", obj, alt) + } + } +} + +func (p *importer) obj(tag int) { + switch tag { + case constTag: + pos := p.pos() + pkg, name := p.qualifiedName() + typ := p.typ(nil, nil) + val := p.value() + p.declare(types.NewConst(pos, pkg, name, typ, val)) + + case aliasTag: + // TODO(gri) verify type alias hookup is correct + pos := p.pos() + pkg, name := p.qualifiedName() + typ := p.typ(nil, nil) + p.declare(types.NewTypeName(pos, pkg, name, typ)) + + case typeTag: + p.typ(nil, nil) + + case varTag: + pos := p.pos() + pkg, name := p.qualifiedName() + typ := p.typ(nil, nil) + p.declare(types.NewVar(pos, pkg, name, typ)) + + case funcTag: + pos := p.pos() + pkg, name := p.qualifiedName() + params, isddd := p.paramList() + result, _ := p.paramList() + sig := types.NewSignature(nil, params, result, isddd) + p.declare(types.NewFunc(pos, pkg, name, sig)) + + default: + errorf("unexpected object tag %d", tag) + } +} + +const deltaNewFile = -64 // see cmd/compile/internal/gc/bexport.go + +func (p *importer) pos() token.Pos { + if !p.posInfoFormat { + return token.NoPos + } + + file := p.prevFile + line := p.prevLine + delta := p.int() + line += delta + if p.version >= 5 { + if delta == deltaNewFile { + if n := p.int(); n >= 0 { + // file changed + file = p.path() + line = n + } + } + } else { + if delta == 0 { + if n := p.int(); n >= 0 { + // file changed + file = p.prevFile[:n] + p.string() + line = p.int() + } + } + } + p.prevFile = file + p.prevLine = line + + return p.fake.pos(file, line, 0) +} + +// Synthesize a token.Pos +type fakeFileSet struct { + fset *token.FileSet + files map[string]*token.File +} + +func (s *fakeFileSet) pos(file string, line, column int) token.Pos { + // TODO(mdempsky): Make use of column. + + // Since we don't know the set of needed file positions, we + // reserve maxlines positions per file. + const maxlines = 64 * 1024 + f := s.files[file] + if f == nil { + f = s.fset.AddFile(file, -1, maxlines) + s.files[file] = f + // Allocate the fake linebreak indices on first use. + // TODO(adonovan): opt: save ~512KB using a more complex scheme? + fakeLinesOnce.Do(func() { + fakeLines = make([]int, maxlines) + for i := range fakeLines { + fakeLines[i] = i + } + }) + f.SetLines(fakeLines) + } + + if line > maxlines { + line = 1 + } + + // Treat the file as if it contained only newlines + // and column=1: use the line number as the offset. + return f.Pos(line - 1) +} + +var ( + fakeLines []int + fakeLinesOnce sync.Once +) + +func (p *importer) qualifiedName() (pkg *types.Package, name string) { + name = p.string() + pkg = p.pkg() + return +} + +func (p *importer) record(t types.Type) { + p.typList = append(p.typList, t) +} + +// A dddSlice is a types.Type representing ...T parameters. +// It only appears for parameter types and does not escape +// the importer. +type dddSlice struct { + elem types.Type +} + +func (t *dddSlice) Underlying() types.Type { return t } +func (t *dddSlice) String() string { return "..." + t.elem.String() } + +// parent is the package which declared the type; parent == nil means +// the package currently imported. The parent package is needed for +// exported struct fields and interface methods which don't contain +// explicit package information in the export data. +// +// A non-nil tname is used as the "owner" of the result type; i.e., +// the result type is the underlying type of tname. tname is used +// to give interface methods a named receiver type where possible. +func (p *importer) typ(parent *types.Package, tname *types.Named) types.Type { + // if the type was seen before, i is its index (>= 0) + i := p.tagOrIndex() + if i >= 0 { + return p.typList[i] + } + + // otherwise, i is the type tag (< 0) + switch i { + case namedTag: + // read type object + pos := p.pos() + parent, name := p.qualifiedName() + scope := parent.Scope() + obj := scope.Lookup(name) + + // if the object doesn't exist yet, create and insert it + if obj == nil { + obj = types.NewTypeName(pos, parent, name, nil) + scope.Insert(obj) + } + + if _, ok := obj.(*types.TypeName); !ok { + errorf("pkg = %s, name = %s => %s", parent, name, obj) + } + + // associate new named type with obj if it doesn't exist yet + t0 := types.NewNamed(obj.(*types.TypeName), nil, nil) + + // but record the existing type, if any + tname := obj.Type().(*types.Named) // tname is either t0 or the existing type + p.record(tname) + + // read underlying type + t0.SetUnderlying(p.typ(parent, t0)) + + // interfaces don't have associated methods + if types.IsInterface(t0) { + return tname + } + + // read associated methods + for i := p.int(); i > 0; i-- { + // TODO(gri) replace this with something closer to fieldName + pos := p.pos() + name := p.string() + if !exported(name) { + p.pkg() + } + + recv, _ := p.paramList() // TODO(gri) do we need a full param list for the receiver? + params, isddd := p.paramList() + result, _ := p.paramList() + p.int() // go:nointerface pragma - discarded + + sig := types.NewSignature(recv.At(0), params, result, isddd) + t0.AddMethod(types.NewFunc(pos, parent, name, sig)) + } + + return tname + + case arrayTag: + t := new(types.Array) + if p.trackAllTypes { + p.record(t) + } + + n := p.int64() + *t = *types.NewArray(p.typ(parent, nil), n) + return t + + case sliceTag: + t := new(types.Slice) + if p.trackAllTypes { + p.record(t) + } + + *t = *types.NewSlice(p.typ(parent, nil)) + return t + + case dddTag: + t := new(dddSlice) + if p.trackAllTypes { + p.record(t) + } + + t.elem = p.typ(parent, nil) + return t + + case structTag: + t := new(types.Struct) + if p.trackAllTypes { + p.record(t) + } + + *t = *types.NewStruct(p.fieldList(parent)) + return t + + case pointerTag: + t := new(types.Pointer) + if p.trackAllTypes { + p.record(t) + } + + *t = *types.NewPointer(p.typ(parent, nil)) + return t + + case signatureTag: + t := new(types.Signature) + if p.trackAllTypes { + p.record(t) + } + + params, isddd := p.paramList() + result, _ := p.paramList() + *t = *types.NewSignature(nil, params, result, isddd) + return t + + case interfaceTag: + // Create a dummy entry in the type list. This is safe because we + // cannot expect the interface type to appear in a cycle, as any + // such cycle must contain a named type which would have been + // first defined earlier. + // TODO(gri) Is this still true now that we have type aliases? + // See issue #23225. + n := len(p.typList) + if p.trackAllTypes { + p.record(nil) + } + + var embeddeds []types.Type + for n := p.int(); n > 0; n-- { + p.pos() + embeddeds = append(embeddeds, p.typ(parent, nil)) + } + + t := newInterface(p.methodList(parent, tname), embeddeds) + p.interfaceList = append(p.interfaceList, t) + if p.trackAllTypes { + p.typList[n] = t + } + return t + + case mapTag: + t := new(types.Map) + if p.trackAllTypes { + p.record(t) + } + + key := p.typ(parent, nil) + val := p.typ(parent, nil) + *t = *types.NewMap(key, val) + return t + + case chanTag: + t := new(types.Chan) + if p.trackAllTypes { + p.record(t) + } + + dir := chanDir(p.int()) + val := p.typ(parent, nil) + *t = *types.NewChan(dir, val) + return t + + default: + errorf("unexpected type tag %d", i) // panics + panic("unreachable") + } +} + +func chanDir(d int) types.ChanDir { + // tag values must match the constants in cmd/compile/internal/gc/go.go + switch d { + case 1 /* Crecv */ : + return types.RecvOnly + case 2 /* Csend */ : + return types.SendOnly + case 3 /* Cboth */ : + return types.SendRecv + default: + errorf("unexpected channel dir %d", d) + return 0 + } +} + +func (p *importer) fieldList(parent *types.Package) (fields []*types.Var, tags []string) { + if n := p.int(); n > 0 { + fields = make([]*types.Var, n) + tags = make([]string, n) + for i := range fields { + fields[i], tags[i] = p.field(parent) + } + } + return +} + +func (p *importer) field(parent *types.Package) (*types.Var, string) { + pos := p.pos() + pkg, name, alias := p.fieldName(parent) + typ := p.typ(parent, nil) + tag := p.string() + + anonymous := false + if name == "" { + // anonymous field - typ must be T or *T and T must be a type name + switch typ := deref(typ).(type) { + case *types.Basic: // basic types are named types + pkg = nil // // objects defined in Universe scope have no package + name = typ.Name() + case *types.Named: + name = typ.Obj().Name() + default: + errorf("named base type expected") + } + anonymous = true + } else if alias { + // anonymous field: we have an explicit name because it's an alias + anonymous = true + } + + return types.NewField(pos, pkg, name, typ, anonymous), tag +} + +func (p *importer) methodList(parent *types.Package, baseType *types.Named) (methods []*types.Func) { + if n := p.int(); n > 0 { + methods = make([]*types.Func, n) + for i := range methods { + methods[i] = p.method(parent, baseType) + } + } + return +} + +func (p *importer) method(parent *types.Package, baseType *types.Named) *types.Func { + pos := p.pos() + pkg, name, _ := p.fieldName(parent) + // If we don't have a baseType, use a nil receiver. + // A receiver using the actual interface type (which + // we don't know yet) will be filled in when we call + // types.Interface.Complete. + var recv *types.Var + if baseType != nil { + recv = types.NewVar(token.NoPos, parent, "", baseType) + } + params, isddd := p.paramList() + result, _ := p.paramList() + sig := types.NewSignature(recv, params, result, isddd) + return types.NewFunc(pos, pkg, name, sig) +} + +func (p *importer) fieldName(parent *types.Package) (pkg *types.Package, name string, alias bool) { + name = p.string() + pkg = parent + if pkg == nil { + // use the imported package instead + pkg = p.pkgList[0] + } + if p.version == 0 && name == "_" { + // version 0 didn't export a package for _ fields + return + } + switch name { + case "": + // 1) field name matches base type name and is exported: nothing to do + case "?": + // 2) field name matches base type name and is not exported: need package + name = "" + pkg = p.pkg() + case "@": + // 3) field name doesn't match type name (alias) + name = p.string() + alias = true + fallthrough + default: + if !exported(name) { + pkg = p.pkg() + } + } + return +} + +func (p *importer) paramList() (*types.Tuple, bool) { + n := p.int() + if n == 0 { + return nil, false + } + // negative length indicates unnamed parameters + named := true + if n < 0 { + n = -n + named = false + } + // n > 0 + params := make([]*types.Var, n) + isddd := false + for i := range params { + params[i], isddd = p.param(named) + } + return types.NewTuple(params...), isddd +} + +func (p *importer) param(named bool) (*types.Var, bool) { + t := p.typ(nil, nil) + td, isddd := t.(*dddSlice) + if isddd { + t = types.NewSlice(td.elem) + } + + var pkg *types.Package + var name string + if named { + name = p.string() + if name == "" { + errorf("expected named parameter") + } + if name != "_" { + pkg = p.pkg() + } + if i := strings.Index(name, "·"); i > 0 { + name = name[:i] // cut off gc-specific parameter numbering + } + } + + // read and discard compiler-specific info + p.string() + + return types.NewVar(token.NoPos, pkg, name, t), isddd +} + +func exported(name string) bool { + ch, _ := utf8.DecodeRuneInString(name) + return unicode.IsUpper(ch) +} + +func (p *importer) value() constant.Value { + switch tag := p.tagOrIndex(); tag { + case falseTag: + return constant.MakeBool(false) + case trueTag: + return constant.MakeBool(true) + case int64Tag: + return constant.MakeInt64(p.int64()) + case floatTag: + return p.float() + case complexTag: + re := p.float() + im := p.float() + return constant.BinaryOp(re, token.ADD, constant.MakeImag(im)) + case stringTag: + return constant.MakeString(p.string()) + case unknownTag: + return constant.MakeUnknown() + default: + errorf("unexpected value tag %d", tag) // panics + panic("unreachable") + } +} + +func (p *importer) float() constant.Value { + sign := p.int() + if sign == 0 { + return constant.MakeInt64(0) + } + + exp := p.int() + mant := []byte(p.string()) // big endian + + // remove leading 0's if any + for len(mant) > 0 && mant[0] == 0 { + mant = mant[1:] + } + + // convert to little endian + // TODO(gri) go/constant should have a more direct conversion function + // (e.g., once it supports a big.Float based implementation) + for i, j := 0, len(mant)-1; i < j; i, j = i+1, j-1 { + mant[i], mant[j] = mant[j], mant[i] + } + + // adjust exponent (constant.MakeFromBytes creates an integer value, + // but mant represents the mantissa bits such that 0.5 <= mant < 1.0) + exp -= len(mant) << 3 + if len(mant) > 0 { + for msd := mant[len(mant)-1]; msd&0x80 == 0; msd <<= 1 { + exp++ + } + } + + x := constant.MakeFromBytes(mant) + switch { + case exp < 0: + d := constant.Shift(constant.MakeInt64(1), token.SHL, uint(-exp)) + x = constant.BinaryOp(x, token.QUO, d) + case exp > 0: + x = constant.Shift(x, token.SHL, uint(exp)) + } + + if sign < 0 { + x = constant.UnaryOp(token.SUB, x, 0) + } + return x +} + +// ---------------------------------------------------------------------------- +// Low-level decoders + +func (p *importer) tagOrIndex() int { + if p.debugFormat { + p.marker('t') + } + + return int(p.rawInt64()) +} + +func (p *importer) int() int { + x := p.int64() + if int64(int(x)) != x { + errorf("exported integer too large") + } + return int(x) +} + +func (p *importer) int64() int64 { + if p.debugFormat { + p.marker('i') + } + + return p.rawInt64() +} + +func (p *importer) path() string { + if p.debugFormat { + p.marker('p') + } + // if the path was seen before, i is its index (>= 0) + // (the empty string is at index 0) + i := p.rawInt64() + if i >= 0 { + return p.pathList[i] + } + // otherwise, i is the negative path length (< 0) + a := make([]string, -i) + for n := range a { + a[n] = p.string() + } + s := strings.Join(a, "/") + p.pathList = append(p.pathList, s) + return s +} + +func (p *importer) string() string { + if p.debugFormat { + p.marker('s') + } + // if the string was seen before, i is its index (>= 0) + // (the empty string is at index 0) + i := p.rawInt64() + if i >= 0 { + return p.strList[i] + } + // otherwise, i is the negative string length (< 0) + if n := int(-i); n <= cap(p.buf) { + p.buf = p.buf[:n] + } else { + p.buf = make([]byte, n) + } + for i := range p.buf { + p.buf[i] = p.rawByte() + } + s := string(p.buf) + p.strList = append(p.strList, s) + return s +} + +func (p *importer) marker(want byte) { + if got := p.rawByte(); got != want { + errorf("incorrect marker: got %c; want %c (pos = %d)", got, want, p.read) + } + + pos := p.read + if n := int(p.rawInt64()); n != pos { + errorf("incorrect position: got %d; want %d", n, pos) + } +} + +// rawInt64 should only be used by low-level decoders. +func (p *importer) rawInt64() int64 { + i, err := binary.ReadVarint(p) + if err != nil { + errorf("read error: %v", err) + } + return i +} + +// rawStringln should only be used to read the initial version string. +func (p *importer) rawStringln(b byte) string { + p.buf = p.buf[:0] + for b != '\n' { + p.buf = append(p.buf, b) + b = p.rawByte() + } + return string(p.buf) +} + +// needed for binary.ReadVarint in rawInt64 +func (p *importer) ReadByte() (byte, error) { + return p.rawByte(), nil +} + +// byte is the bottleneck interface for reading p.data. +// It unescapes '|' 'S' to '$' and '|' '|' to '|'. +// rawByte should only be used by low-level decoders. +func (p *importer) rawByte() byte { + b := p.data[0] + r := 1 + if b == '|' { + b = p.data[1] + r = 2 + switch b { + case 'S': + b = '$' + case '|': + // nothing to do + default: + errorf("unexpected escape sequence in export data") + } + } + p.data = p.data[r:] + p.read += r + return b + +} + +// ---------------------------------------------------------------------------- +// Export format + +// Tags. Must be < 0. +const ( + // Objects + packageTag = -(iota + 1) + constTag + typeTag + varTag + funcTag + endTag + + // Types + namedTag + arrayTag + sliceTag + dddTag + structTag + pointerTag + signatureTag + interfaceTag + mapTag + chanTag + + // Values + falseTag + trueTag + int64Tag + floatTag + fractionTag // not used by gc + complexTag + stringTag + nilTag // only used by gc (appears in exported inlined function bodies) + unknownTag // not used by gc (only appears in packages with errors) + + // Type aliases + aliasTag +) + +var predeclOnce sync.Once +var predecl []types.Type // initialized lazily + +func predeclared() []types.Type { + predeclOnce.Do(func() { + // initialize lazily to be sure that all + // elements have been initialized before + predecl = []types.Type{ // basic types + types.Typ[types.Bool], + types.Typ[types.Int], + types.Typ[types.Int8], + types.Typ[types.Int16], + types.Typ[types.Int32], + types.Typ[types.Int64], + types.Typ[types.Uint], + types.Typ[types.Uint8], + types.Typ[types.Uint16], + types.Typ[types.Uint32], + types.Typ[types.Uint64], + types.Typ[types.Uintptr], + types.Typ[types.Float32], + types.Typ[types.Float64], + types.Typ[types.Complex64], + types.Typ[types.Complex128], + types.Typ[types.String], + + // basic type aliases + types.Universe.Lookup("byte").Type(), + types.Universe.Lookup("rune").Type(), + + // error + types.Universe.Lookup("error").Type(), + + // untyped types + types.Typ[types.UntypedBool], + types.Typ[types.UntypedInt], + types.Typ[types.UntypedRune], + types.Typ[types.UntypedFloat], + types.Typ[types.UntypedComplex], + types.Typ[types.UntypedString], + types.Typ[types.UntypedNil], + + // package unsafe + types.Typ[types.UnsafePointer], + + // invalid type + types.Typ[types.Invalid], // only appears in packages with errors + + // used internally by gc; never used by this package or in .a files + anyType{}, + } + }) + return predecl +} + +type anyType struct{} + +func (t anyType) Underlying() types.Type { return t } +func (t anyType) String() string { return "any" } diff --git a/vendor/golang.org/x/tools/go/internal/gcimporter/exportdata.go b/vendor/golang.org/x/tools/go/internal/gcimporter/exportdata.go new file mode 100644 index 00000000..f33dc561 --- /dev/null +++ b/vendor/golang.org/x/tools/go/internal/gcimporter/exportdata.go @@ -0,0 +1,93 @@ +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// This file is a copy of $GOROOT/src/go/internal/gcimporter/exportdata.go. + +// This file implements FindExportData. + +package gcimporter + +import ( + "bufio" + "fmt" + "io" + "strconv" + "strings" +) + +func readGopackHeader(r *bufio.Reader) (name string, size int, err error) { + // See $GOROOT/include/ar.h. + hdr := make([]byte, 16+12+6+6+8+10+2) + _, err = io.ReadFull(r, hdr) + if err != nil { + return + } + // leave for debugging + if false { + fmt.Printf("header: %s", hdr) + } + s := strings.TrimSpace(string(hdr[16+12+6+6+8:][:10])) + size, err = strconv.Atoi(s) + if err != nil || hdr[len(hdr)-2] != '`' || hdr[len(hdr)-1] != '\n' { + err = fmt.Errorf("invalid archive header") + return + } + name = strings.TrimSpace(string(hdr[:16])) + return +} + +// FindExportData positions the reader r at the beginning of the +// export data section of an underlying GC-created object/archive +// file by reading from it. The reader must be positioned at the +// start of the file before calling this function. The hdr result +// is the string before the export data, either "$$" or "$$B". +// +func FindExportData(r *bufio.Reader) (hdr string, err error) { + // Read first line to make sure this is an object file. + line, err := r.ReadSlice('\n') + if err != nil { + err = fmt.Errorf("can't find export data (%v)", err) + return + } + + if string(line) == "!\n" { + // Archive file. Scan to __.PKGDEF. + var name string + if name, _, err = readGopackHeader(r); err != nil { + return + } + + // First entry should be __.PKGDEF. + if name != "__.PKGDEF" { + err = fmt.Errorf("go archive is missing __.PKGDEF") + return + } + + // Read first line of __.PKGDEF data, so that line + // is once again the first line of the input. + if line, err = r.ReadSlice('\n'); err != nil { + err = fmt.Errorf("can't find export data (%v)", err) + return + } + } + + // Now at __.PKGDEF in archive or still at beginning of file. + // Either way, line should begin with "go object ". + if !strings.HasPrefix(string(line), "go object ") { + err = fmt.Errorf("not a Go object file") + return + } + + // Skip over object header to export data. + // Begins after first line starting with $$. + for line[0] != '$' { + if line, err = r.ReadSlice('\n'); err != nil { + err = fmt.Errorf("can't find export data (%v)", err) + return + } + } + hdr = string(line) + + return +} diff --git a/vendor/golang.org/x/tools/go/internal/gcimporter/gcimporter.go b/vendor/golang.org/x/tools/go/internal/gcimporter/gcimporter.go new file mode 100644 index 00000000..9cf18660 --- /dev/null +++ b/vendor/golang.org/x/tools/go/internal/gcimporter/gcimporter.go @@ -0,0 +1,1078 @@ +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// This file is a modified copy of $GOROOT/src/go/internal/gcimporter/gcimporter.go, +// but it also contains the original source-based importer code for Go1.6. +// Once we stop supporting 1.6, we can remove that code. + +// Package gcimporter provides various functions for reading +// gc-generated object files that can be used to implement the +// Importer interface defined by the Go 1.5 standard library package. +package gcimporter // import "golang.org/x/tools/go/internal/gcimporter" + +import ( + "bufio" + "errors" + "fmt" + "go/build" + "go/constant" + "go/token" + "go/types" + "io" + "io/ioutil" + "os" + "path/filepath" + "sort" + "strconv" + "strings" + "text/scanner" +) + +// debugging/development support +const debug = false + +var pkgExts = [...]string{".a", ".o"} + +// FindPkg returns the filename and unique package id for an import +// path based on package information provided by build.Import (using +// the build.Default build.Context). A relative srcDir is interpreted +// relative to the current working directory. +// If no file was found, an empty filename is returned. +// +func FindPkg(path, srcDir string) (filename, id string) { + if path == "" { + return + } + + var noext string + switch { + default: + // "x" -> "$GOPATH/pkg/$GOOS_$GOARCH/x.ext", "x" + // Don't require the source files to be present. + if abs, err := filepath.Abs(srcDir); err == nil { // see issue 14282 + srcDir = abs + } + bp, _ := build.Import(path, srcDir, build.FindOnly|build.AllowBinary) + if bp.PkgObj == "" { + id = path // make sure we have an id to print in error message + return + } + noext = strings.TrimSuffix(bp.PkgObj, ".a") + id = bp.ImportPath + + case build.IsLocalImport(path): + // "./x" -> "/this/directory/x.ext", "/this/directory/x" + noext = filepath.Join(srcDir, path) + id = noext + + case filepath.IsAbs(path): + // for completeness only - go/build.Import + // does not support absolute imports + // "/x" -> "/x.ext", "/x" + noext = path + id = path + } + + if false { // for debugging + if path != id { + fmt.Printf("%s -> %s\n", path, id) + } + } + + // try extensions + for _, ext := range pkgExts { + filename = noext + ext + if f, err := os.Stat(filename); err == nil && !f.IsDir() { + return + } + } + + filename = "" // not found + return +} + +// ImportData imports a package by reading the gc-generated export data, +// adds the corresponding package object to the packages map indexed by id, +// and returns the object. +// +// The packages map must contains all packages already imported. The data +// reader position must be the beginning of the export data section. The +// filename is only used in error messages. +// +// If packages[id] contains the completely imported package, that package +// can be used directly, and there is no need to call this function (but +// there is also no harm but for extra time used). +// +func ImportData(packages map[string]*types.Package, filename, id string, data io.Reader) (pkg *types.Package, err error) { + // support for parser error handling + defer func() { + switch r := recover().(type) { + case nil: + // nothing to do + case importError: + err = r + default: + panic(r) // internal error + } + }() + + var p parser + p.init(filename, id, data, packages) + pkg = p.parseExport() + + return +} + +// Import imports a gc-generated package given its import path and srcDir, adds +// the corresponding package object to the packages map, and returns the object. +// The packages map must contain all packages already imported. +// +func Import(packages map[string]*types.Package, path, srcDir string, lookup func(path string) (io.ReadCloser, error)) (pkg *types.Package, err error) { + var rc io.ReadCloser + var filename, id string + if lookup != nil { + // With custom lookup specified, assume that caller has + // converted path to a canonical import path for use in the map. + if path == "unsafe" { + return types.Unsafe, nil + } + id = path + + // No need to re-import if the package was imported completely before. + if pkg = packages[id]; pkg != nil && pkg.Complete() { + return + } + f, err := lookup(path) + if err != nil { + return nil, err + } + rc = f + } else { + filename, id = FindPkg(path, srcDir) + if filename == "" { + if path == "unsafe" { + return types.Unsafe, nil + } + return nil, fmt.Errorf("can't find import: %q", id) + } + + // no need to re-import if the package was imported completely before + if pkg = packages[id]; pkg != nil && pkg.Complete() { + return + } + + // open file + f, err := os.Open(filename) + if err != nil { + return nil, err + } + defer func() { + if err != nil { + // add file name to error + err = fmt.Errorf("%s: %v", filename, err) + } + }() + rc = f + } + defer rc.Close() + + var hdr string + buf := bufio.NewReader(rc) + if hdr, err = FindExportData(buf); err != nil { + return + } + + switch hdr { + case "$$\n": + // Work-around if we don't have a filename; happens only if lookup != nil. + // Either way, the filename is only needed for importer error messages, so + // this is fine. + if filename == "" { + filename = path + } + return ImportData(packages, filename, id, buf) + + case "$$B\n": + var data []byte + data, err = ioutil.ReadAll(buf) + if err != nil { + break + } + + // TODO(gri): allow clients of go/importer to provide a FileSet. + // Or, define a new standard go/types/gcexportdata package. + fset := token.NewFileSet() + + // The indexed export format starts with an 'i'; the older + // binary export format starts with a 'c', 'd', or 'v' + // (from "version"). Select appropriate importer. + if len(data) > 0 && data[0] == 'i' { + _, pkg, err = IImportData(fset, packages, data[1:], id) + } else { + _, pkg, err = BImportData(fset, packages, data, id) + } + + default: + err = fmt.Errorf("unknown export data header: %q", hdr) + } + + return +} + +// ---------------------------------------------------------------------------- +// Parser + +// TODO(gri) Imported objects don't have position information. +// Ideally use the debug table line info; alternatively +// create some fake position (or the position of the +// import). That way error messages referring to imported +// objects can print meaningful information. + +// parser parses the exports inside a gc compiler-produced +// object/archive file and populates its scope with the results. +type parser struct { + scanner scanner.Scanner + tok rune // current token + lit string // literal string; only valid for Ident, Int, String tokens + id string // package id of imported package + sharedPkgs map[string]*types.Package // package id -> package object (across importer) + localPkgs map[string]*types.Package // package id -> package object (just this package) +} + +func (p *parser) init(filename, id string, src io.Reader, packages map[string]*types.Package) { + p.scanner.Init(src) + p.scanner.Error = func(_ *scanner.Scanner, msg string) { p.error(msg) } + p.scanner.Mode = scanner.ScanIdents | scanner.ScanInts | scanner.ScanChars | scanner.ScanStrings | scanner.ScanComments | scanner.SkipComments + p.scanner.Whitespace = 1<<'\t' | 1<<' ' + p.scanner.Filename = filename // for good error messages + p.next() + p.id = id + p.sharedPkgs = packages + if debug { + // check consistency of packages map + for _, pkg := range packages { + if pkg.Name() == "" { + fmt.Printf("no package name for %s\n", pkg.Path()) + } + } + } +} + +func (p *parser) next() { + p.tok = p.scanner.Scan() + switch p.tok { + case scanner.Ident, scanner.Int, scanner.Char, scanner.String, '·': + p.lit = p.scanner.TokenText() + default: + p.lit = "" + } + if debug { + fmt.Printf("%s: %q -> %q\n", scanner.TokenString(p.tok), p.scanner.TokenText(), p.lit) + } +} + +func declTypeName(pkg *types.Package, name string) *types.TypeName { + scope := pkg.Scope() + if obj := scope.Lookup(name); obj != nil { + return obj.(*types.TypeName) + } + obj := types.NewTypeName(token.NoPos, pkg, name, nil) + // a named type may be referred to before the underlying type + // is known - set it up + types.NewNamed(obj, nil, nil) + scope.Insert(obj) + return obj +} + +// ---------------------------------------------------------------------------- +// Error handling + +// Internal errors are boxed as importErrors. +type importError struct { + pos scanner.Position + err error +} + +func (e importError) Error() string { + return fmt.Sprintf("import error %s (byte offset = %d): %s", e.pos, e.pos.Offset, e.err) +} + +func (p *parser) error(err interface{}) { + if s, ok := err.(string); ok { + err = errors.New(s) + } + // panic with a runtime.Error if err is not an error + panic(importError{p.scanner.Pos(), err.(error)}) +} + +func (p *parser) errorf(format string, args ...interface{}) { + p.error(fmt.Sprintf(format, args...)) +} + +func (p *parser) expect(tok rune) string { + lit := p.lit + if p.tok != tok { + p.errorf("expected %s, got %s (%s)", scanner.TokenString(tok), scanner.TokenString(p.tok), lit) + } + p.next() + return lit +} + +func (p *parser) expectSpecial(tok string) { + sep := 'x' // not white space + i := 0 + for i < len(tok) && p.tok == rune(tok[i]) && sep > ' ' { + sep = p.scanner.Peek() // if sep <= ' ', there is white space before the next token + p.next() + i++ + } + if i < len(tok) { + p.errorf("expected %q, got %q", tok, tok[0:i]) + } +} + +func (p *parser) expectKeyword(keyword string) { + lit := p.expect(scanner.Ident) + if lit != keyword { + p.errorf("expected keyword %s, got %q", keyword, lit) + } +} + +// ---------------------------------------------------------------------------- +// Qualified and unqualified names + +// PackageId = string_lit . +// +func (p *parser) parsePackageId() string { + id, err := strconv.Unquote(p.expect(scanner.String)) + if err != nil { + p.error(err) + } + // id == "" stands for the imported package id + // (only known at time of package installation) + if id == "" { + id = p.id + } + return id +} + +// PackageName = ident . +// +func (p *parser) parsePackageName() string { + return p.expect(scanner.Ident) +} + +// dotIdentifier = ( ident | '·' ) { ident | int | '·' } . +func (p *parser) parseDotIdent() string { + ident := "" + if p.tok != scanner.Int { + sep := 'x' // not white space + for (p.tok == scanner.Ident || p.tok == scanner.Int || p.tok == '·') && sep > ' ' { + ident += p.lit + sep = p.scanner.Peek() // if sep <= ' ', there is white space before the next token + p.next() + } + } + if ident == "" { + p.expect(scanner.Ident) // use expect() for error handling + } + return ident +} + +// QualifiedName = "@" PackageId "." ( "?" | dotIdentifier ) . +// +func (p *parser) parseQualifiedName() (id, name string) { + p.expect('@') + id = p.parsePackageId() + p.expect('.') + // Per rev f280b8a485fd (10/2/2013), qualified names may be used for anonymous fields. + if p.tok == '?' { + p.next() + } else { + name = p.parseDotIdent() + } + return +} + +// getPkg returns the package for a given id. If the package is +// not found, create the package and add it to the p.localPkgs +// and p.sharedPkgs maps. name is the (expected) name of the +// package. If name == "", the package name is expected to be +// set later via an import clause in the export data. +// +// id identifies a package, usually by a canonical package path like +// "encoding/json" but possibly by a non-canonical import path like +// "./json". +// +func (p *parser) getPkg(id, name string) *types.Package { + // package unsafe is not in the packages maps - handle explicitly + if id == "unsafe" { + return types.Unsafe + } + + pkg := p.localPkgs[id] + if pkg == nil { + // first import of id from this package + pkg = p.sharedPkgs[id] + if pkg == nil { + // first import of id by this importer; + // add (possibly unnamed) pkg to shared packages + pkg = types.NewPackage(id, name) + p.sharedPkgs[id] = pkg + } + // add (possibly unnamed) pkg to local packages + if p.localPkgs == nil { + p.localPkgs = make(map[string]*types.Package) + } + p.localPkgs[id] = pkg + } else if name != "" { + // package exists already and we have an expected package name; + // make sure names match or set package name if necessary + if pname := pkg.Name(); pname == "" { + pkg.SetName(name) + } else if pname != name { + p.errorf("%s package name mismatch: %s (given) vs %s (expected)", id, pname, name) + } + } + return pkg +} + +// parseExportedName is like parseQualifiedName, but +// the package id is resolved to an imported *types.Package. +// +func (p *parser) parseExportedName() (pkg *types.Package, name string) { + id, name := p.parseQualifiedName() + pkg = p.getPkg(id, "") + return +} + +// ---------------------------------------------------------------------------- +// Types + +// BasicType = identifier . +// +func (p *parser) parseBasicType() types.Type { + id := p.expect(scanner.Ident) + obj := types.Universe.Lookup(id) + if obj, ok := obj.(*types.TypeName); ok { + return obj.Type() + } + p.errorf("not a basic type: %s", id) + return nil +} + +// ArrayType = "[" int_lit "]" Type . +// +func (p *parser) parseArrayType(parent *types.Package) types.Type { + // "[" already consumed and lookahead known not to be "]" + lit := p.expect(scanner.Int) + p.expect(']') + elem := p.parseType(parent) + n, err := strconv.ParseInt(lit, 10, 64) + if err != nil { + p.error(err) + } + return types.NewArray(elem, n) +} + +// MapType = "map" "[" Type "]" Type . +// +func (p *parser) parseMapType(parent *types.Package) types.Type { + p.expectKeyword("map") + p.expect('[') + key := p.parseType(parent) + p.expect(']') + elem := p.parseType(parent) + return types.NewMap(key, elem) +} + +// Name = identifier | "?" | QualifiedName . +// +// For unqualified and anonymous names, the returned package is the parent +// package unless parent == nil, in which case the returned package is the +// package being imported. (The parent package is not nil if the the name +// is an unqualified struct field or interface method name belonging to a +// type declared in another package.) +// +// For qualified names, the returned package is nil (and not created if +// it doesn't exist yet) unless materializePkg is set (which creates an +// unnamed package with valid package path). In the latter case, a +// subsequent import clause is expected to provide a name for the package. +// +func (p *parser) parseName(parent *types.Package, materializePkg bool) (pkg *types.Package, name string) { + pkg = parent + if pkg == nil { + pkg = p.sharedPkgs[p.id] + } + switch p.tok { + case scanner.Ident: + name = p.lit + p.next() + case '?': + // anonymous + p.next() + case '@': + // exported name prefixed with package path + pkg = nil + var id string + id, name = p.parseQualifiedName() + if materializePkg { + pkg = p.getPkg(id, "") + } + default: + p.error("name expected") + } + return +} + +func deref(typ types.Type) types.Type { + if p, _ := typ.(*types.Pointer); p != nil { + return p.Elem() + } + return typ +} + +// Field = Name Type [ string_lit ] . +// +func (p *parser) parseField(parent *types.Package) (*types.Var, string) { + pkg, name := p.parseName(parent, true) + + if name == "_" { + // Blank fields should be package-qualified because they + // are unexported identifiers, but gc does not qualify them. + // Assuming that the ident belongs to the current package + // causes types to change during re-exporting, leading + // to spurious "can't assign A to B" errors from go/types. + // As a workaround, pretend all blank fields belong + // to the same unique dummy package. + const blankpkg = "<_>" + pkg = p.getPkg(blankpkg, blankpkg) + } + + typ := p.parseType(parent) + anonymous := false + if name == "" { + // anonymous field - typ must be T or *T and T must be a type name + switch typ := deref(typ).(type) { + case *types.Basic: // basic types are named types + pkg = nil // objects defined in Universe scope have no package + name = typ.Name() + case *types.Named: + name = typ.Obj().Name() + default: + p.errorf("anonymous field expected") + } + anonymous = true + } + tag := "" + if p.tok == scanner.String { + s := p.expect(scanner.String) + var err error + tag, err = strconv.Unquote(s) + if err != nil { + p.errorf("invalid struct tag %s: %s", s, err) + } + } + return types.NewField(token.NoPos, pkg, name, typ, anonymous), tag +} + +// StructType = "struct" "{" [ FieldList ] "}" . +// FieldList = Field { ";" Field } . +// +func (p *parser) parseStructType(parent *types.Package) types.Type { + var fields []*types.Var + var tags []string + + p.expectKeyword("struct") + p.expect('{') + for i := 0; p.tok != '}' && p.tok != scanner.EOF; i++ { + if i > 0 { + p.expect(';') + } + fld, tag := p.parseField(parent) + if tag != "" && tags == nil { + tags = make([]string, i) + } + if tags != nil { + tags = append(tags, tag) + } + fields = append(fields, fld) + } + p.expect('}') + + return types.NewStruct(fields, tags) +} + +// Parameter = ( identifier | "?" ) [ "..." ] Type [ string_lit ] . +// +func (p *parser) parseParameter() (par *types.Var, isVariadic bool) { + _, name := p.parseName(nil, false) + // remove gc-specific parameter numbering + if i := strings.Index(name, "·"); i >= 0 { + name = name[:i] + } + if p.tok == '.' { + p.expectSpecial("...") + isVariadic = true + } + typ := p.parseType(nil) + if isVariadic { + typ = types.NewSlice(typ) + } + // ignore argument tag (e.g. "noescape") + if p.tok == scanner.String { + p.next() + } + // TODO(gri) should we provide a package? + par = types.NewVar(token.NoPos, nil, name, typ) + return +} + +// Parameters = "(" [ ParameterList ] ")" . +// ParameterList = { Parameter "," } Parameter . +// +func (p *parser) parseParameters() (list []*types.Var, isVariadic bool) { + p.expect('(') + for p.tok != ')' && p.tok != scanner.EOF { + if len(list) > 0 { + p.expect(',') + } + par, variadic := p.parseParameter() + list = append(list, par) + if variadic { + if isVariadic { + p.error("... not on final argument") + } + isVariadic = true + } + } + p.expect(')') + + return +} + +// Signature = Parameters [ Result ] . +// Result = Type | Parameters . +// +func (p *parser) parseSignature(recv *types.Var) *types.Signature { + params, isVariadic := p.parseParameters() + + // optional result type + var results []*types.Var + if p.tok == '(' { + var variadic bool + results, variadic = p.parseParameters() + if variadic { + p.error("... not permitted on result type") + } + } + + return types.NewSignature(recv, types.NewTuple(params...), types.NewTuple(results...), isVariadic) +} + +// InterfaceType = "interface" "{" [ MethodList ] "}" . +// MethodList = Method { ";" Method } . +// Method = Name Signature . +// +// The methods of embedded interfaces are always "inlined" +// by the compiler and thus embedded interfaces are never +// visible in the export data. +// +func (p *parser) parseInterfaceType(parent *types.Package) types.Type { + var methods []*types.Func + + p.expectKeyword("interface") + p.expect('{') + for i := 0; p.tok != '}' && p.tok != scanner.EOF; i++ { + if i > 0 { + p.expect(';') + } + pkg, name := p.parseName(parent, true) + sig := p.parseSignature(nil) + methods = append(methods, types.NewFunc(token.NoPos, pkg, name, sig)) + } + p.expect('}') + + // Complete requires the type's embedded interfaces to be fully defined, + // but we do not define any + return types.NewInterface(methods, nil).Complete() +} + +// ChanType = ( "chan" [ "<-" ] | "<-" "chan" ) Type . +// +func (p *parser) parseChanType(parent *types.Package) types.Type { + dir := types.SendRecv + if p.tok == scanner.Ident { + p.expectKeyword("chan") + if p.tok == '<' { + p.expectSpecial("<-") + dir = types.SendOnly + } + } else { + p.expectSpecial("<-") + p.expectKeyword("chan") + dir = types.RecvOnly + } + elem := p.parseType(parent) + return types.NewChan(dir, elem) +} + +// Type = +// BasicType | TypeName | ArrayType | SliceType | StructType | +// PointerType | FuncType | InterfaceType | MapType | ChanType | +// "(" Type ")" . +// +// BasicType = ident . +// TypeName = ExportedName . +// SliceType = "[" "]" Type . +// PointerType = "*" Type . +// FuncType = "func" Signature . +// +func (p *parser) parseType(parent *types.Package) types.Type { + switch p.tok { + case scanner.Ident: + switch p.lit { + default: + return p.parseBasicType() + case "struct": + return p.parseStructType(parent) + case "func": + // FuncType + p.next() + return p.parseSignature(nil) + case "interface": + return p.parseInterfaceType(parent) + case "map": + return p.parseMapType(parent) + case "chan": + return p.parseChanType(parent) + } + case '@': + // TypeName + pkg, name := p.parseExportedName() + return declTypeName(pkg, name).Type() + case '[': + p.next() // look ahead + if p.tok == ']' { + // SliceType + p.next() + return types.NewSlice(p.parseType(parent)) + } + return p.parseArrayType(parent) + case '*': + // PointerType + p.next() + return types.NewPointer(p.parseType(parent)) + case '<': + return p.parseChanType(parent) + case '(': + // "(" Type ")" + p.next() + typ := p.parseType(parent) + p.expect(')') + return typ + } + p.errorf("expected type, got %s (%q)", scanner.TokenString(p.tok), p.lit) + return nil +} + +// ---------------------------------------------------------------------------- +// Declarations + +// ImportDecl = "import" PackageName PackageId . +// +func (p *parser) parseImportDecl() { + p.expectKeyword("import") + name := p.parsePackageName() + p.getPkg(p.parsePackageId(), name) +} + +// int_lit = [ "+" | "-" ] { "0" ... "9" } . +// +func (p *parser) parseInt() string { + s := "" + switch p.tok { + case '-': + s = "-" + p.next() + case '+': + p.next() + } + return s + p.expect(scanner.Int) +} + +// number = int_lit [ "p" int_lit ] . +// +func (p *parser) parseNumber() (typ *types.Basic, val constant.Value) { + // mantissa + mant := constant.MakeFromLiteral(p.parseInt(), token.INT, 0) + if mant == nil { + panic("invalid mantissa") + } + + if p.lit == "p" { + // exponent (base 2) + p.next() + exp, err := strconv.ParseInt(p.parseInt(), 10, 0) + if err != nil { + p.error(err) + } + if exp < 0 { + denom := constant.MakeInt64(1) + denom = constant.Shift(denom, token.SHL, uint(-exp)) + typ = types.Typ[types.UntypedFloat] + val = constant.BinaryOp(mant, token.QUO, denom) + return + } + if exp > 0 { + mant = constant.Shift(mant, token.SHL, uint(exp)) + } + typ = types.Typ[types.UntypedFloat] + val = mant + return + } + + typ = types.Typ[types.UntypedInt] + val = mant + return +} + +// ConstDecl = "const" ExportedName [ Type ] "=" Literal . +// Literal = bool_lit | int_lit | float_lit | complex_lit | rune_lit | string_lit . +// bool_lit = "true" | "false" . +// complex_lit = "(" float_lit "+" float_lit "i" ")" . +// rune_lit = "(" int_lit "+" int_lit ")" . +// string_lit = `"` { unicode_char } `"` . +// +func (p *parser) parseConstDecl() { + p.expectKeyword("const") + pkg, name := p.parseExportedName() + + var typ0 types.Type + if p.tok != '=' { + // constant types are never structured - no need for parent type + typ0 = p.parseType(nil) + } + + p.expect('=') + var typ types.Type + var val constant.Value + switch p.tok { + case scanner.Ident: + // bool_lit + if p.lit != "true" && p.lit != "false" { + p.error("expected true or false") + } + typ = types.Typ[types.UntypedBool] + val = constant.MakeBool(p.lit == "true") + p.next() + + case '-', scanner.Int: + // int_lit + typ, val = p.parseNumber() + + case '(': + // complex_lit or rune_lit + p.next() + if p.tok == scanner.Char { + p.next() + p.expect('+') + typ = types.Typ[types.UntypedRune] + _, val = p.parseNumber() + p.expect(')') + break + } + _, re := p.parseNumber() + p.expect('+') + _, im := p.parseNumber() + p.expectKeyword("i") + p.expect(')') + typ = types.Typ[types.UntypedComplex] + val = constant.BinaryOp(re, token.ADD, constant.MakeImag(im)) + + case scanner.Char: + // rune_lit + typ = types.Typ[types.UntypedRune] + val = constant.MakeFromLiteral(p.lit, token.CHAR, 0) + p.next() + + case scanner.String: + // string_lit + typ = types.Typ[types.UntypedString] + val = constant.MakeFromLiteral(p.lit, token.STRING, 0) + p.next() + + default: + p.errorf("expected literal got %s", scanner.TokenString(p.tok)) + } + + if typ0 == nil { + typ0 = typ + } + + pkg.Scope().Insert(types.NewConst(token.NoPos, pkg, name, typ0, val)) +} + +// TypeDecl = "type" ExportedName Type . +// +func (p *parser) parseTypeDecl() { + p.expectKeyword("type") + pkg, name := p.parseExportedName() + obj := declTypeName(pkg, name) + + // The type object may have been imported before and thus already + // have a type associated with it. We still need to parse the type + // structure, but throw it away if the object already has a type. + // This ensures that all imports refer to the same type object for + // a given type declaration. + typ := p.parseType(pkg) + + if name := obj.Type().(*types.Named); name.Underlying() == nil { + name.SetUnderlying(typ) + } +} + +// VarDecl = "var" ExportedName Type . +// +func (p *parser) parseVarDecl() { + p.expectKeyword("var") + pkg, name := p.parseExportedName() + typ := p.parseType(pkg) + pkg.Scope().Insert(types.NewVar(token.NoPos, pkg, name, typ)) +} + +// Func = Signature [ Body ] . +// Body = "{" ... "}" . +// +func (p *parser) parseFunc(recv *types.Var) *types.Signature { + sig := p.parseSignature(recv) + if p.tok == '{' { + p.next() + for i := 1; i > 0; p.next() { + switch p.tok { + case '{': + i++ + case '}': + i-- + } + } + } + return sig +} + +// MethodDecl = "func" Receiver Name Func . +// Receiver = "(" ( identifier | "?" ) [ "*" ] ExportedName ")" . +// +func (p *parser) parseMethodDecl() { + // "func" already consumed + p.expect('(') + recv, _ := p.parseParameter() // receiver + p.expect(')') + + // determine receiver base type object + base := deref(recv.Type()).(*types.Named) + + // parse method name, signature, and possibly inlined body + _, name := p.parseName(nil, false) + sig := p.parseFunc(recv) + + // methods always belong to the same package as the base type object + pkg := base.Obj().Pkg() + + // add method to type unless type was imported before + // and method exists already + // TODO(gri) This leads to a quadratic algorithm - ok for now because method counts are small. + base.AddMethod(types.NewFunc(token.NoPos, pkg, name, sig)) +} + +// FuncDecl = "func" ExportedName Func . +// +func (p *parser) parseFuncDecl() { + // "func" already consumed + pkg, name := p.parseExportedName() + typ := p.parseFunc(nil) + pkg.Scope().Insert(types.NewFunc(token.NoPos, pkg, name, typ)) +} + +// Decl = [ ImportDecl | ConstDecl | TypeDecl | VarDecl | FuncDecl | MethodDecl ] "\n" . +// +func (p *parser) parseDecl() { + if p.tok == scanner.Ident { + switch p.lit { + case "import": + p.parseImportDecl() + case "const": + p.parseConstDecl() + case "type": + p.parseTypeDecl() + case "var": + p.parseVarDecl() + case "func": + p.next() // look ahead + if p.tok == '(' { + p.parseMethodDecl() + } else { + p.parseFuncDecl() + } + } + } + p.expect('\n') +} + +// ---------------------------------------------------------------------------- +// Export + +// Export = "PackageClause { Decl } "$$" . +// PackageClause = "package" PackageName [ "safe" ] "\n" . +// +func (p *parser) parseExport() *types.Package { + p.expectKeyword("package") + name := p.parsePackageName() + if p.tok == scanner.Ident && p.lit == "safe" { + // package was compiled with -u option - ignore + p.next() + } + p.expect('\n') + + pkg := p.getPkg(p.id, name) + + for p.tok != '$' && p.tok != scanner.EOF { + p.parseDecl() + } + + if ch := p.scanner.Peek(); p.tok != '$' || ch != '$' { + // don't call next()/expect() since reading past the + // export data may cause scanner errors (e.g. NUL chars) + p.errorf("expected '$$', got %s %c", scanner.TokenString(p.tok), ch) + } + + if n := p.scanner.ErrorCount; n != 0 { + p.errorf("expected no scanner errors, got %d", n) + } + + // Record all locally referenced packages as imports. + var imports []*types.Package + for id, pkg2 := range p.localPkgs { + if pkg2.Name() == "" { + p.errorf("%s package has no name", id) + } + if id == p.id { + continue // avoid self-edge + } + imports = append(imports, pkg2) + } + sort.Sort(byPath(imports)) + pkg.SetImports(imports) + + // package was imported completely and without errors + pkg.MarkComplete() + + return pkg +} + +type byPath []*types.Package + +func (a byPath) Len() int { return len(a) } +func (a byPath) Swap(i, j int) { a[i], a[j] = a[j], a[i] } +func (a byPath) Less(i, j int) bool { return a[i].Path() < a[j].Path() } diff --git a/vendor/golang.org/x/tools/go/internal/gcimporter/iexport.go b/vendor/golang.org/x/tools/go/internal/gcimporter/iexport.go new file mode 100644 index 00000000..4be32a2e --- /dev/null +++ b/vendor/golang.org/x/tools/go/internal/gcimporter/iexport.go @@ -0,0 +1,739 @@ +// Copyright 2019 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Indexed binary package export. +// This file was derived from $GOROOT/src/cmd/compile/internal/gc/iexport.go; +// see that file for specification of the format. + +package gcimporter + +import ( + "bytes" + "encoding/binary" + "go/ast" + "go/constant" + "go/token" + "go/types" + "io" + "math/big" + "reflect" + "sort" +) + +// Current indexed export format version. Increase with each format change. +// 0: Go1.11 encoding +const iexportVersion = 0 + +// IExportData returns the binary export data for pkg. +// +// If no file set is provided, position info will be missing. +// The package path of the top-level package will not be recorded, +// so that calls to IImportData can override with a provided package path. +func IExportData(fset *token.FileSet, pkg *types.Package) (b []byte, err error) { + defer func() { + if e := recover(); e != nil { + if ierr, ok := e.(internalError); ok { + err = ierr + return + } + // Not an internal error; panic again. + panic(e) + } + }() + + p := iexporter{ + out: bytes.NewBuffer(nil), + fset: fset, + allPkgs: map[*types.Package]bool{}, + stringIndex: map[string]uint64{}, + declIndex: map[types.Object]uint64{}, + typIndex: map[types.Type]uint64{}, + localpkg: pkg, + } + + for i, pt := range predeclared() { + p.typIndex[pt] = uint64(i) + } + if len(p.typIndex) > predeclReserved { + panic(internalErrorf("too many predeclared types: %d > %d", len(p.typIndex), predeclReserved)) + } + + // Initialize work queue with exported declarations. + scope := pkg.Scope() + for _, name := range scope.Names() { + if ast.IsExported(name) { + p.pushDecl(scope.Lookup(name)) + } + } + + // Loop until no more work. + for !p.declTodo.empty() { + p.doDecl(p.declTodo.popHead()) + } + + // Append indices to data0 section. + dataLen := uint64(p.data0.Len()) + w := p.newWriter() + w.writeIndex(p.declIndex) + w.flush() + + // Assemble header. + var hdr intWriter + hdr.WriteByte('i') + hdr.uint64(iexportVersion) + hdr.uint64(uint64(p.strings.Len())) + hdr.uint64(dataLen) + + // Flush output. + io.Copy(p.out, &hdr) + io.Copy(p.out, &p.strings) + io.Copy(p.out, &p.data0) + + return p.out.Bytes(), nil +} + +// writeIndex writes out an object index. mainIndex indicates whether +// we're writing out the main index, which is also read by +// non-compiler tools and includes a complete package description +// (i.e., name and height). +func (w *exportWriter) writeIndex(index map[types.Object]uint64) { + // Build a map from packages to objects from that package. + pkgObjs := map[*types.Package][]types.Object{} + + // For the main index, make sure to include every package that + // we reference, even if we're not exporting (or reexporting) + // any symbols from it. + pkgObjs[w.p.localpkg] = nil + for pkg := range w.p.allPkgs { + pkgObjs[pkg] = nil + } + + for obj := range index { + pkgObjs[obj.Pkg()] = append(pkgObjs[obj.Pkg()], obj) + } + + var pkgs []*types.Package + for pkg, objs := range pkgObjs { + pkgs = append(pkgs, pkg) + + sort.Slice(objs, func(i, j int) bool { + return objs[i].Name() < objs[j].Name() + }) + } + + sort.Slice(pkgs, func(i, j int) bool { + return w.exportPath(pkgs[i]) < w.exportPath(pkgs[j]) + }) + + w.uint64(uint64(len(pkgs))) + for _, pkg := range pkgs { + w.string(w.exportPath(pkg)) + w.string(pkg.Name()) + w.uint64(uint64(0)) // package height is not needed for go/types + + objs := pkgObjs[pkg] + w.uint64(uint64(len(objs))) + for _, obj := range objs { + w.string(obj.Name()) + w.uint64(index[obj]) + } + } +} + +type iexporter struct { + fset *token.FileSet + out *bytes.Buffer + + localpkg *types.Package + + // allPkgs tracks all packages that have been referenced by + // the export data, so we can ensure to include them in the + // main index. + allPkgs map[*types.Package]bool + + declTodo objQueue + + strings intWriter + stringIndex map[string]uint64 + + data0 intWriter + declIndex map[types.Object]uint64 + typIndex map[types.Type]uint64 +} + +// stringOff returns the offset of s within the string section. +// If not already present, it's added to the end. +func (p *iexporter) stringOff(s string) uint64 { + off, ok := p.stringIndex[s] + if !ok { + off = uint64(p.strings.Len()) + p.stringIndex[s] = off + + p.strings.uint64(uint64(len(s))) + p.strings.WriteString(s) + } + return off +} + +// pushDecl adds n to the declaration work queue, if not already present. +func (p *iexporter) pushDecl(obj types.Object) { + // Package unsafe is known to the compiler and predeclared. + assert(obj.Pkg() != types.Unsafe) + + if _, ok := p.declIndex[obj]; ok { + return + } + + p.declIndex[obj] = ^uint64(0) // mark n present in work queue + p.declTodo.pushTail(obj) +} + +// exportWriter handles writing out individual data section chunks. +type exportWriter struct { + p *iexporter + + data intWriter + currPkg *types.Package + prevFile string + prevLine int64 +} + +func (w *exportWriter) exportPath(pkg *types.Package) string { + if pkg == w.p.localpkg { + return "" + } + return pkg.Path() +} + +func (p *iexporter) doDecl(obj types.Object) { + w := p.newWriter() + w.setPkg(obj.Pkg(), false) + + switch obj := obj.(type) { + case *types.Var: + w.tag('V') + w.pos(obj.Pos()) + w.typ(obj.Type(), obj.Pkg()) + + case *types.Func: + sig, _ := obj.Type().(*types.Signature) + if sig.Recv() != nil { + panic(internalErrorf("unexpected method: %v", sig)) + } + w.tag('F') + w.pos(obj.Pos()) + w.signature(sig) + + case *types.Const: + w.tag('C') + w.pos(obj.Pos()) + w.value(obj.Type(), obj.Val()) + + case *types.TypeName: + if obj.IsAlias() { + w.tag('A') + w.pos(obj.Pos()) + w.typ(obj.Type(), obj.Pkg()) + break + } + + // Defined type. + w.tag('T') + w.pos(obj.Pos()) + + underlying := obj.Type().Underlying() + w.typ(underlying, obj.Pkg()) + + t := obj.Type() + if types.IsInterface(t) { + break + } + + named, ok := t.(*types.Named) + if !ok { + panic(internalErrorf("%s is not a defined type", t)) + } + + n := named.NumMethods() + w.uint64(uint64(n)) + for i := 0; i < n; i++ { + m := named.Method(i) + w.pos(m.Pos()) + w.string(m.Name()) + sig, _ := m.Type().(*types.Signature) + w.param(sig.Recv()) + w.signature(sig) + } + + default: + panic(internalErrorf("unexpected object: %v", obj)) + } + + p.declIndex[obj] = w.flush() +} + +func (w *exportWriter) tag(tag byte) { + w.data.WriteByte(tag) +} + +func (w *exportWriter) pos(pos token.Pos) { + if w.p.fset == nil { + w.int64(0) + return + } + + p := w.p.fset.Position(pos) + file := p.Filename + line := int64(p.Line) + + // When file is the same as the last position (common case), + // we can save a few bytes by delta encoding just the line + // number. + // + // Note: Because data objects may be read out of order (or not + // at all), we can only apply delta encoding within a single + // object. This is handled implicitly by tracking prevFile and + // prevLine as fields of exportWriter. + + if file == w.prevFile { + delta := line - w.prevLine + w.int64(delta) + if delta == deltaNewFile { + w.int64(-1) + } + } else { + w.int64(deltaNewFile) + w.int64(line) // line >= 0 + w.string(file) + w.prevFile = file + } + w.prevLine = line +} + +func (w *exportWriter) pkg(pkg *types.Package) { + // Ensure any referenced packages are declared in the main index. + w.p.allPkgs[pkg] = true + + w.string(w.exportPath(pkg)) +} + +func (w *exportWriter) qualifiedIdent(obj types.Object) { + // Ensure any referenced declarations are written out too. + w.p.pushDecl(obj) + + w.string(obj.Name()) + w.pkg(obj.Pkg()) +} + +func (w *exportWriter) typ(t types.Type, pkg *types.Package) { + w.data.uint64(w.p.typOff(t, pkg)) +} + +func (p *iexporter) newWriter() *exportWriter { + return &exportWriter{p: p} +} + +func (w *exportWriter) flush() uint64 { + off := uint64(w.p.data0.Len()) + io.Copy(&w.p.data0, &w.data) + return off +} + +func (p *iexporter) typOff(t types.Type, pkg *types.Package) uint64 { + off, ok := p.typIndex[t] + if !ok { + w := p.newWriter() + w.doTyp(t, pkg) + off = predeclReserved + w.flush() + p.typIndex[t] = off + } + return off +} + +func (w *exportWriter) startType(k itag) { + w.data.uint64(uint64(k)) +} + +func (w *exportWriter) doTyp(t types.Type, pkg *types.Package) { + switch t := t.(type) { + case *types.Named: + w.startType(definedType) + w.qualifiedIdent(t.Obj()) + + case *types.Pointer: + w.startType(pointerType) + w.typ(t.Elem(), pkg) + + case *types.Slice: + w.startType(sliceType) + w.typ(t.Elem(), pkg) + + case *types.Array: + w.startType(arrayType) + w.uint64(uint64(t.Len())) + w.typ(t.Elem(), pkg) + + case *types.Chan: + w.startType(chanType) + // 1 RecvOnly; 2 SendOnly; 3 SendRecv + var dir uint64 + switch t.Dir() { + case types.RecvOnly: + dir = 1 + case types.SendOnly: + dir = 2 + case types.SendRecv: + dir = 3 + } + w.uint64(dir) + w.typ(t.Elem(), pkg) + + case *types.Map: + w.startType(mapType) + w.typ(t.Key(), pkg) + w.typ(t.Elem(), pkg) + + case *types.Signature: + w.startType(signatureType) + w.setPkg(pkg, true) + w.signature(t) + + case *types.Struct: + w.startType(structType) + w.setPkg(pkg, true) + + n := t.NumFields() + w.uint64(uint64(n)) + for i := 0; i < n; i++ { + f := t.Field(i) + w.pos(f.Pos()) + w.string(f.Name()) + w.typ(f.Type(), pkg) + w.bool(f.Anonymous()) + w.string(t.Tag(i)) // note (or tag) + } + + case *types.Interface: + w.startType(interfaceType) + w.setPkg(pkg, true) + + n := t.NumEmbeddeds() + w.uint64(uint64(n)) + for i := 0; i < n; i++ { + f := t.Embedded(i) + w.pos(f.Obj().Pos()) + w.typ(f.Obj().Type(), f.Obj().Pkg()) + } + + n = t.NumExplicitMethods() + w.uint64(uint64(n)) + for i := 0; i < n; i++ { + m := t.ExplicitMethod(i) + w.pos(m.Pos()) + w.string(m.Name()) + sig, _ := m.Type().(*types.Signature) + w.signature(sig) + } + + default: + panic(internalErrorf("unexpected type: %v, %v", t, reflect.TypeOf(t))) + } +} + +func (w *exportWriter) setPkg(pkg *types.Package, write bool) { + if write { + w.pkg(pkg) + } + + w.currPkg = pkg +} + +func (w *exportWriter) signature(sig *types.Signature) { + w.paramList(sig.Params()) + w.paramList(sig.Results()) + if sig.Params().Len() > 0 { + w.bool(sig.Variadic()) + } +} + +func (w *exportWriter) paramList(tup *types.Tuple) { + n := tup.Len() + w.uint64(uint64(n)) + for i := 0; i < n; i++ { + w.param(tup.At(i)) + } +} + +func (w *exportWriter) param(obj types.Object) { + w.pos(obj.Pos()) + w.localIdent(obj) + w.typ(obj.Type(), obj.Pkg()) +} + +func (w *exportWriter) value(typ types.Type, v constant.Value) { + w.typ(typ, nil) + + switch v.Kind() { + case constant.Bool: + w.bool(constant.BoolVal(v)) + case constant.Int: + var i big.Int + if i64, exact := constant.Int64Val(v); exact { + i.SetInt64(i64) + } else if ui64, exact := constant.Uint64Val(v); exact { + i.SetUint64(ui64) + } else { + i.SetString(v.ExactString(), 10) + } + w.mpint(&i, typ) + case constant.Float: + f := constantToFloat(v) + w.mpfloat(f, typ) + case constant.Complex: + w.mpfloat(constantToFloat(constant.Real(v)), typ) + w.mpfloat(constantToFloat(constant.Imag(v)), typ) + case constant.String: + w.string(constant.StringVal(v)) + case constant.Unknown: + // package contains type errors + default: + panic(internalErrorf("unexpected value %v (%T)", v, v)) + } +} + +// constantToFloat converts a constant.Value with kind constant.Float to a +// big.Float. +func constantToFloat(x constant.Value) *big.Float { + assert(x.Kind() == constant.Float) + // Use the same floating-point precision (512) as cmd/compile + // (see Mpprec in cmd/compile/internal/gc/mpfloat.go). + const mpprec = 512 + var f big.Float + f.SetPrec(mpprec) + if v, exact := constant.Float64Val(x); exact { + // float64 + f.SetFloat64(v) + } else if num, denom := constant.Num(x), constant.Denom(x); num.Kind() == constant.Int { + // TODO(gri): add big.Rat accessor to constant.Value. + n := valueToRat(num) + d := valueToRat(denom) + f.SetRat(n.Quo(n, d)) + } else { + // Value too large to represent as a fraction => inaccessible. + // TODO(gri): add big.Float accessor to constant.Value. + _, ok := f.SetString(x.ExactString()) + assert(ok) + } + return &f +} + +// mpint exports a multi-precision integer. +// +// For unsigned types, small values are written out as a single +// byte. Larger values are written out as a length-prefixed big-endian +// byte string, where the length prefix is encoded as its complement. +// For example, bytes 0, 1, and 2 directly represent the integer +// values 0, 1, and 2; while bytes 255, 254, and 253 indicate a 1-, +// 2-, and 3-byte big-endian string follow. +// +// Encoding for signed types use the same general approach as for +// unsigned types, except small values use zig-zag encoding and the +// bottom bit of length prefix byte for large values is reserved as a +// sign bit. +// +// The exact boundary between small and large encodings varies +// according to the maximum number of bytes needed to encode a value +// of type typ. As a special case, 8-bit types are always encoded as a +// single byte. +// +// TODO(mdempsky): Is this level of complexity really worthwhile? +func (w *exportWriter) mpint(x *big.Int, typ types.Type) { + basic, ok := typ.Underlying().(*types.Basic) + if !ok { + panic(internalErrorf("unexpected type %v (%T)", typ.Underlying(), typ.Underlying())) + } + + signed, maxBytes := intSize(basic) + + negative := x.Sign() < 0 + if !signed && negative { + panic(internalErrorf("negative unsigned integer; type %v, value %v", typ, x)) + } + + b := x.Bytes() + if len(b) > 0 && b[0] == 0 { + panic(internalErrorf("leading zeros")) + } + if uint(len(b)) > maxBytes { + panic(internalErrorf("bad mpint length: %d > %d (type %v, value %v)", len(b), maxBytes, typ, x)) + } + + maxSmall := 256 - maxBytes + if signed { + maxSmall = 256 - 2*maxBytes + } + if maxBytes == 1 { + maxSmall = 256 + } + + // Check if x can use small value encoding. + if len(b) <= 1 { + var ux uint + if len(b) == 1 { + ux = uint(b[0]) + } + if signed { + ux <<= 1 + if negative { + ux-- + } + } + if ux < maxSmall { + w.data.WriteByte(byte(ux)) + return + } + } + + n := 256 - uint(len(b)) + if signed { + n = 256 - 2*uint(len(b)) + if negative { + n |= 1 + } + } + if n < maxSmall || n >= 256 { + panic(internalErrorf("encoding mistake: %d, %v, %v => %d", len(b), signed, negative, n)) + } + + w.data.WriteByte(byte(n)) + w.data.Write(b) +} + +// mpfloat exports a multi-precision floating point number. +// +// The number's value is decomposed into mantissa × 2**exponent, where +// mantissa is an integer. The value is written out as mantissa (as a +// multi-precision integer) and then the exponent, except exponent is +// omitted if mantissa is zero. +func (w *exportWriter) mpfloat(f *big.Float, typ types.Type) { + if f.IsInf() { + panic("infinite constant") + } + + // Break into f = mant × 2**exp, with 0.5 <= mant < 1. + var mant big.Float + exp := int64(f.MantExp(&mant)) + + // Scale so that mant is an integer. + prec := mant.MinPrec() + mant.SetMantExp(&mant, int(prec)) + exp -= int64(prec) + + manti, acc := mant.Int(nil) + if acc != big.Exact { + panic(internalErrorf("mantissa scaling failed for %f (%s)", f, acc)) + } + w.mpint(manti, typ) + if manti.Sign() != 0 { + w.int64(exp) + } +} + +func (w *exportWriter) bool(b bool) bool { + var x uint64 + if b { + x = 1 + } + w.uint64(x) + return b +} + +func (w *exportWriter) int64(x int64) { w.data.int64(x) } +func (w *exportWriter) uint64(x uint64) { w.data.uint64(x) } +func (w *exportWriter) string(s string) { w.uint64(w.p.stringOff(s)) } + +func (w *exportWriter) localIdent(obj types.Object) { + // Anonymous parameters. + if obj == nil { + w.string("") + return + } + + name := obj.Name() + if name == "_" { + w.string("_") + return + } + + w.string(name) +} + +type intWriter struct { + bytes.Buffer +} + +func (w *intWriter) int64(x int64) { + var buf [binary.MaxVarintLen64]byte + n := binary.PutVarint(buf[:], x) + w.Write(buf[:n]) +} + +func (w *intWriter) uint64(x uint64) { + var buf [binary.MaxVarintLen64]byte + n := binary.PutUvarint(buf[:], x) + w.Write(buf[:n]) +} + +func assert(cond bool) { + if !cond { + panic("internal error: assertion failed") + } +} + +// The below is copied from go/src/cmd/compile/internal/gc/syntax.go. + +// objQueue is a FIFO queue of types.Object. The zero value of objQueue is +// a ready-to-use empty queue. +type objQueue struct { + ring []types.Object + head, tail int +} + +// empty returns true if q contains no Nodes. +func (q *objQueue) empty() bool { + return q.head == q.tail +} + +// pushTail appends n to the tail of the queue. +func (q *objQueue) pushTail(obj types.Object) { + if len(q.ring) == 0 { + q.ring = make([]types.Object, 16) + } else if q.head+len(q.ring) == q.tail { + // Grow the ring. + nring := make([]types.Object, len(q.ring)*2) + // Copy the old elements. + part := q.ring[q.head%len(q.ring):] + if q.tail-q.head <= len(part) { + part = part[:q.tail-q.head] + copy(nring, part) + } else { + pos := copy(nring, part) + copy(nring[pos:], q.ring[:q.tail%len(q.ring)]) + } + q.ring, q.head, q.tail = nring, 0, q.tail-q.head + } + + q.ring[q.tail%len(q.ring)] = obj + q.tail++ +} + +// popHead pops a node from the head of the queue. It panics if q is empty. +func (q *objQueue) popHead() types.Object { + if q.empty() { + panic("dequeue empty") + } + obj := q.ring[q.head%len(q.ring)] + q.head++ + return obj +} diff --git a/vendor/golang.org/x/tools/go/internal/gcimporter/iimport.go b/vendor/golang.org/x/tools/go/internal/gcimporter/iimport.go new file mode 100644 index 00000000..a31a8802 --- /dev/null +++ b/vendor/golang.org/x/tools/go/internal/gcimporter/iimport.go @@ -0,0 +1,630 @@ +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Indexed package import. +// See cmd/compile/internal/gc/iexport.go for the export data format. + +// This file is a copy of $GOROOT/src/go/internal/gcimporter/iimport.go. + +package gcimporter + +import ( + "bytes" + "encoding/binary" + "fmt" + "go/constant" + "go/token" + "go/types" + "io" + "sort" +) + +type intReader struct { + *bytes.Reader + path string +} + +func (r *intReader) int64() int64 { + i, err := binary.ReadVarint(r.Reader) + if err != nil { + errorf("import %q: read varint error: %v", r.path, err) + } + return i +} + +func (r *intReader) uint64() uint64 { + i, err := binary.ReadUvarint(r.Reader) + if err != nil { + errorf("import %q: read varint error: %v", r.path, err) + } + return i +} + +const predeclReserved = 32 + +type itag uint64 + +const ( + // Types + definedType itag = iota + pointerType + sliceType + arrayType + chanType + mapType + signatureType + structType + interfaceType +) + +// IImportData imports a package from the serialized package data +// and returns the number of bytes consumed and a reference to the package. +// If the export data version is not recognized or the format is otherwise +// compromised, an error is returned. +func IImportData(fset *token.FileSet, imports map[string]*types.Package, data []byte, path string) (_ int, pkg *types.Package, err error) { + const currentVersion = 1 + version := int64(-1) + defer func() { + if e := recover(); e != nil { + if version > currentVersion { + err = fmt.Errorf("cannot import %q (%v), export data is newer version - update tool", path, e) + } else { + err = fmt.Errorf("cannot import %q (%v), possibly version skew - reinstall package", path, e) + } + } + }() + + r := &intReader{bytes.NewReader(data), path} + + version = int64(r.uint64()) + switch version { + case currentVersion, 0: + default: + errorf("unknown iexport format version %d", version) + } + + sLen := int64(r.uint64()) + dLen := int64(r.uint64()) + + whence, _ := r.Seek(0, io.SeekCurrent) + stringData := data[whence : whence+sLen] + declData := data[whence+sLen : whence+sLen+dLen] + r.Seek(sLen+dLen, io.SeekCurrent) + + p := iimporter{ + ipath: path, + version: int(version), + + stringData: stringData, + stringCache: make(map[uint64]string), + pkgCache: make(map[uint64]*types.Package), + + declData: declData, + pkgIndex: make(map[*types.Package]map[string]uint64), + typCache: make(map[uint64]types.Type), + + fake: fakeFileSet{ + fset: fset, + files: make(map[string]*token.File), + }, + } + + for i, pt := range predeclared() { + p.typCache[uint64(i)] = pt + } + + pkgList := make([]*types.Package, r.uint64()) + for i := range pkgList { + pkgPathOff := r.uint64() + pkgPath := p.stringAt(pkgPathOff) + pkgName := p.stringAt(r.uint64()) + _ = r.uint64() // package height; unused by go/types + + if pkgPath == "" { + pkgPath = path + } + pkg := imports[pkgPath] + if pkg == nil { + pkg = types.NewPackage(pkgPath, pkgName) + imports[pkgPath] = pkg + } else if pkg.Name() != pkgName { + errorf("conflicting names %s and %s for package %q", pkg.Name(), pkgName, path) + } + + p.pkgCache[pkgPathOff] = pkg + + nameIndex := make(map[string]uint64) + for nSyms := r.uint64(); nSyms > 0; nSyms-- { + name := p.stringAt(r.uint64()) + nameIndex[name] = r.uint64() + } + + p.pkgIndex[pkg] = nameIndex + pkgList[i] = pkg + } + if len(pkgList) == 0 { + errorf("no packages found for %s", path) + panic("unreachable") + } + p.ipkg = pkgList[0] + names := make([]string, 0, len(p.pkgIndex[p.ipkg])) + for name := range p.pkgIndex[p.ipkg] { + names = append(names, name) + } + sort.Strings(names) + for _, name := range names { + p.doDecl(p.ipkg, name) + } + + for _, typ := range p.interfaceList { + typ.Complete() + } + + // record all referenced packages as imports + list := append(([]*types.Package)(nil), pkgList[1:]...) + sort.Sort(byPath(list)) + p.ipkg.SetImports(list) + + // package was imported completely and without errors + p.ipkg.MarkComplete() + + consumed, _ := r.Seek(0, io.SeekCurrent) + return int(consumed), p.ipkg, nil +} + +type iimporter struct { + ipath string + ipkg *types.Package + version int + + stringData []byte + stringCache map[uint64]string + pkgCache map[uint64]*types.Package + + declData []byte + pkgIndex map[*types.Package]map[string]uint64 + typCache map[uint64]types.Type + + fake fakeFileSet + interfaceList []*types.Interface +} + +func (p *iimporter) doDecl(pkg *types.Package, name string) { + // See if we've already imported this declaration. + if obj := pkg.Scope().Lookup(name); obj != nil { + return + } + + off, ok := p.pkgIndex[pkg][name] + if !ok { + errorf("%v.%v not in index", pkg, name) + } + + r := &importReader{p: p, currPkg: pkg} + r.declReader.Reset(p.declData[off:]) + + r.obj(name) +} + +func (p *iimporter) stringAt(off uint64) string { + if s, ok := p.stringCache[off]; ok { + return s + } + + slen, n := binary.Uvarint(p.stringData[off:]) + if n <= 0 { + errorf("varint failed") + } + spos := off + uint64(n) + s := string(p.stringData[spos : spos+slen]) + p.stringCache[off] = s + return s +} + +func (p *iimporter) pkgAt(off uint64) *types.Package { + if pkg, ok := p.pkgCache[off]; ok { + return pkg + } + path := p.stringAt(off) + if path == p.ipath { + return p.ipkg + } + errorf("missing package %q in %q", path, p.ipath) + return nil +} + +func (p *iimporter) typAt(off uint64, base *types.Named) types.Type { + if t, ok := p.typCache[off]; ok && (base == nil || !isInterface(t)) { + return t + } + + if off < predeclReserved { + errorf("predeclared type missing from cache: %v", off) + } + + r := &importReader{p: p} + r.declReader.Reset(p.declData[off-predeclReserved:]) + t := r.doType(base) + + if base == nil || !isInterface(t) { + p.typCache[off] = t + } + return t +} + +type importReader struct { + p *iimporter + declReader bytes.Reader + currPkg *types.Package + prevFile string + prevLine int64 + prevColumn int64 +} + +func (r *importReader) obj(name string) { + tag := r.byte() + pos := r.pos() + + switch tag { + case 'A': + typ := r.typ() + + r.declare(types.NewTypeName(pos, r.currPkg, name, typ)) + + case 'C': + typ, val := r.value() + + r.declare(types.NewConst(pos, r.currPkg, name, typ, val)) + + case 'F': + sig := r.signature(nil) + + r.declare(types.NewFunc(pos, r.currPkg, name, sig)) + + case 'T': + // Types can be recursive. We need to setup a stub + // declaration before recursing. + obj := types.NewTypeName(pos, r.currPkg, name, nil) + named := types.NewNamed(obj, nil, nil) + r.declare(obj) + + underlying := r.p.typAt(r.uint64(), named).Underlying() + named.SetUnderlying(underlying) + + if !isInterface(underlying) { + for n := r.uint64(); n > 0; n-- { + mpos := r.pos() + mname := r.ident() + recv := r.param() + msig := r.signature(recv) + + named.AddMethod(types.NewFunc(mpos, r.currPkg, mname, msig)) + } + } + + case 'V': + typ := r.typ() + + r.declare(types.NewVar(pos, r.currPkg, name, typ)) + + default: + errorf("unexpected tag: %v", tag) + } +} + +func (r *importReader) declare(obj types.Object) { + obj.Pkg().Scope().Insert(obj) +} + +func (r *importReader) value() (typ types.Type, val constant.Value) { + typ = r.typ() + + switch b := typ.Underlying().(*types.Basic); b.Info() & types.IsConstType { + case types.IsBoolean: + val = constant.MakeBool(r.bool()) + + case types.IsString: + val = constant.MakeString(r.string()) + + case types.IsInteger: + val = r.mpint(b) + + case types.IsFloat: + val = r.mpfloat(b) + + case types.IsComplex: + re := r.mpfloat(b) + im := r.mpfloat(b) + val = constant.BinaryOp(re, token.ADD, constant.MakeImag(im)) + + default: + if b.Kind() == types.Invalid { + val = constant.MakeUnknown() + return + } + errorf("unexpected type %v", typ) // panics + panic("unreachable") + } + + return +} + +func intSize(b *types.Basic) (signed bool, maxBytes uint) { + if (b.Info() & types.IsUntyped) != 0 { + return true, 64 + } + + switch b.Kind() { + case types.Float32, types.Complex64: + return true, 3 + case types.Float64, types.Complex128: + return true, 7 + } + + signed = (b.Info() & types.IsUnsigned) == 0 + switch b.Kind() { + case types.Int8, types.Uint8: + maxBytes = 1 + case types.Int16, types.Uint16: + maxBytes = 2 + case types.Int32, types.Uint32: + maxBytes = 4 + default: + maxBytes = 8 + } + + return +} + +func (r *importReader) mpint(b *types.Basic) constant.Value { + signed, maxBytes := intSize(b) + + maxSmall := 256 - maxBytes + if signed { + maxSmall = 256 - 2*maxBytes + } + if maxBytes == 1 { + maxSmall = 256 + } + + n, _ := r.declReader.ReadByte() + if uint(n) < maxSmall { + v := int64(n) + if signed { + v >>= 1 + if n&1 != 0 { + v = ^v + } + } + return constant.MakeInt64(v) + } + + v := -n + if signed { + v = -(n &^ 1) >> 1 + } + if v < 1 || uint(v) > maxBytes { + errorf("weird decoding: %v, %v => %v", n, signed, v) + } + + buf := make([]byte, v) + io.ReadFull(&r.declReader, buf) + + // convert to little endian + // TODO(gri) go/constant should have a more direct conversion function + // (e.g., once it supports a big.Float based implementation) + for i, j := 0, len(buf)-1; i < j; i, j = i+1, j-1 { + buf[i], buf[j] = buf[j], buf[i] + } + + x := constant.MakeFromBytes(buf) + if signed && n&1 != 0 { + x = constant.UnaryOp(token.SUB, x, 0) + } + return x +} + +func (r *importReader) mpfloat(b *types.Basic) constant.Value { + x := r.mpint(b) + if constant.Sign(x) == 0 { + return x + } + + exp := r.int64() + switch { + case exp > 0: + x = constant.Shift(x, token.SHL, uint(exp)) + case exp < 0: + d := constant.Shift(constant.MakeInt64(1), token.SHL, uint(-exp)) + x = constant.BinaryOp(x, token.QUO, d) + } + return x +} + +func (r *importReader) ident() string { + return r.string() +} + +func (r *importReader) qualifiedIdent() (*types.Package, string) { + name := r.string() + pkg := r.pkg() + return pkg, name +} + +func (r *importReader) pos() token.Pos { + if r.p.version >= 1 { + r.posv1() + } else { + r.posv0() + } + + if r.prevFile == "" && r.prevLine == 0 && r.prevColumn == 0 { + return token.NoPos + } + return r.p.fake.pos(r.prevFile, int(r.prevLine), int(r.prevColumn)) +} + +func (r *importReader) posv0() { + delta := r.int64() + if delta != deltaNewFile { + r.prevLine += delta + } else if l := r.int64(); l == -1 { + r.prevLine += deltaNewFile + } else { + r.prevFile = r.string() + r.prevLine = l + } +} + +func (r *importReader) posv1() { + delta := r.int64() + r.prevColumn += delta >> 1 + if delta&1 != 0 { + delta = r.int64() + r.prevLine += delta >> 1 + if delta&1 != 0 { + r.prevFile = r.string() + } + } +} + +func (r *importReader) typ() types.Type { + return r.p.typAt(r.uint64(), nil) +} + +func isInterface(t types.Type) bool { + _, ok := t.(*types.Interface) + return ok +} + +func (r *importReader) pkg() *types.Package { return r.p.pkgAt(r.uint64()) } +func (r *importReader) string() string { return r.p.stringAt(r.uint64()) } + +func (r *importReader) doType(base *types.Named) types.Type { + switch k := r.kind(); k { + default: + errorf("unexpected kind tag in %q: %v", r.p.ipath, k) + return nil + + case definedType: + pkg, name := r.qualifiedIdent() + r.p.doDecl(pkg, name) + return pkg.Scope().Lookup(name).(*types.TypeName).Type() + case pointerType: + return types.NewPointer(r.typ()) + case sliceType: + return types.NewSlice(r.typ()) + case arrayType: + n := r.uint64() + return types.NewArray(r.typ(), int64(n)) + case chanType: + dir := chanDir(int(r.uint64())) + return types.NewChan(dir, r.typ()) + case mapType: + return types.NewMap(r.typ(), r.typ()) + case signatureType: + r.currPkg = r.pkg() + return r.signature(nil) + + case structType: + r.currPkg = r.pkg() + + fields := make([]*types.Var, r.uint64()) + tags := make([]string, len(fields)) + for i := range fields { + fpos := r.pos() + fname := r.ident() + ftyp := r.typ() + emb := r.bool() + tag := r.string() + + fields[i] = types.NewField(fpos, r.currPkg, fname, ftyp, emb) + tags[i] = tag + } + return types.NewStruct(fields, tags) + + case interfaceType: + r.currPkg = r.pkg() + + embeddeds := make([]types.Type, r.uint64()) + for i := range embeddeds { + _ = r.pos() + embeddeds[i] = r.typ() + } + + methods := make([]*types.Func, r.uint64()) + for i := range methods { + mpos := r.pos() + mname := r.ident() + + // TODO(mdempsky): Matches bimport.go, but I + // don't agree with this. + var recv *types.Var + if base != nil { + recv = types.NewVar(token.NoPos, r.currPkg, "", base) + } + + msig := r.signature(recv) + methods[i] = types.NewFunc(mpos, r.currPkg, mname, msig) + } + + typ := newInterface(methods, embeddeds) + r.p.interfaceList = append(r.p.interfaceList, typ) + return typ + } +} + +func (r *importReader) kind() itag { + return itag(r.uint64()) +} + +func (r *importReader) signature(recv *types.Var) *types.Signature { + params := r.paramList() + results := r.paramList() + variadic := params.Len() > 0 && r.bool() + return types.NewSignature(recv, params, results, variadic) +} + +func (r *importReader) paramList() *types.Tuple { + xs := make([]*types.Var, r.uint64()) + for i := range xs { + xs[i] = r.param() + } + return types.NewTuple(xs...) +} + +func (r *importReader) param() *types.Var { + pos := r.pos() + name := r.ident() + typ := r.typ() + return types.NewParam(pos, r.currPkg, name, typ) +} + +func (r *importReader) bool() bool { + return r.uint64() != 0 +} + +func (r *importReader) int64() int64 { + n, err := binary.ReadVarint(&r.declReader) + if err != nil { + errorf("readVarint: %v", err) + } + return n +} + +func (r *importReader) uint64() uint64 { + n, err := binary.ReadUvarint(&r.declReader) + if err != nil { + errorf("readUvarint: %v", err) + } + return n +} + +func (r *importReader) byte() byte { + x, err := r.declReader.ReadByte() + if err != nil { + errorf("declReader.ReadByte: %v", err) + } + return x +} diff --git a/vendor/golang.org/x/tools/go/internal/gcimporter/newInterface10.go b/vendor/golang.org/x/tools/go/internal/gcimporter/newInterface10.go new file mode 100644 index 00000000..463f2522 --- /dev/null +++ b/vendor/golang.org/x/tools/go/internal/gcimporter/newInterface10.go @@ -0,0 +1,21 @@ +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build !go1.11 + +package gcimporter + +import "go/types" + +func newInterface(methods []*types.Func, embeddeds []types.Type) *types.Interface { + named := make([]*types.Named, len(embeddeds)) + for i, e := range embeddeds { + var ok bool + named[i], ok = e.(*types.Named) + if !ok { + panic("embedding of non-defined interfaces in interfaces is not supported before Go 1.11") + } + } + return types.NewInterface(methods, named) +} diff --git a/vendor/golang.org/x/tools/go/internal/gcimporter/newInterface11.go b/vendor/golang.org/x/tools/go/internal/gcimporter/newInterface11.go new file mode 100644 index 00000000..ab28b95c --- /dev/null +++ b/vendor/golang.org/x/tools/go/internal/gcimporter/newInterface11.go @@ -0,0 +1,13 @@ +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build go1.11 + +package gcimporter + +import "go/types" + +func newInterface(methods []*types.Func, embeddeds []types.Type) *types.Interface { + return types.NewInterfaceType(methods, embeddeds) +} diff --git a/vendor/golang.org/x/tools/go/internal/packagesdriver/sizes.go b/vendor/golang.org/x/tools/go/internal/packagesdriver/sizes.go new file mode 100644 index 00000000..db0c9a7e --- /dev/null +++ b/vendor/golang.org/x/tools/go/internal/packagesdriver/sizes.go @@ -0,0 +1,174 @@ +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Package packagesdriver fetches type sizes for go/packages and go/analysis. +package packagesdriver + +import ( + "bytes" + "context" + "encoding/json" + "fmt" + "go/types" + "log" + "os" + "os/exec" + "strings" + "time" +) + +var debug = false + +// GetSizes returns the sizes used by the underlying driver with the given parameters. +func GetSizes(ctx context.Context, buildFlags, env []string, dir string, usesExportData bool) (types.Sizes, error) { + // TODO(matloob): Clean this up. This code is mostly a copy of packages.findExternalDriver. + const toolPrefix = "GOPACKAGESDRIVER=" + tool := "" + for _, env := range env { + if val := strings.TrimPrefix(env, toolPrefix); val != env { + tool = val + } + } + + if tool == "" { + var err error + tool, err = exec.LookPath("gopackagesdriver") + if err != nil { + // We did not find the driver, so use "go list". + tool = "off" + } + } + + if tool == "off" { + return GetSizesGolist(ctx, buildFlags, env, dir, usesExportData) + } + + req, err := json.Marshal(struct { + Command string `json:"command"` + Env []string `json:"env"` + BuildFlags []string `json:"build_flags"` + }{ + Command: "sizes", + Env: env, + BuildFlags: buildFlags, + }) + if err != nil { + return nil, fmt.Errorf("failed to encode message to driver tool: %v", err) + } + + buf := new(bytes.Buffer) + cmd := exec.CommandContext(ctx, tool) + cmd.Dir = dir + cmd.Env = env + cmd.Stdin = bytes.NewReader(req) + cmd.Stdout = buf + cmd.Stderr = new(bytes.Buffer) + if err := cmd.Run(); err != nil { + return nil, fmt.Errorf("%v: %v: %s", tool, err, cmd.Stderr) + } + var response struct { + // Sizes, if not nil, is the types.Sizes to use when type checking. + Sizes *types.StdSizes + } + if err := json.Unmarshal(buf.Bytes(), &response); err != nil { + return nil, err + } + return response.Sizes, nil +} + +func GetSizesGolist(ctx context.Context, buildFlags, env []string, dir string, usesExportData bool) (types.Sizes, error) { + args := []string{"list", "-f", "{{context.GOARCH}} {{context.Compiler}}"} + args = append(args, buildFlags...) + args = append(args, "--", "unsafe") + stdout, stderr, err := invokeGo(ctx, env, dir, usesExportData, args...) + var goarch, compiler string + if err != nil { + if strings.Contains(err.Error(), "cannot find main module") { + // User's running outside of a module. All bets are off. Get GOARCH and guess compiler is gc. + // TODO(matloob): Is this a problem in practice? + envout, _, enverr := invokeGo(ctx, env, dir, usesExportData, "env", "GOARCH") + if enverr != nil { + return nil, err + } + goarch = strings.TrimSpace(envout.String()) + compiler = "gc" + } else { + return nil, err + } + } else { + fields := strings.Fields(stdout.String()) + if len(fields) < 2 { + return nil, fmt.Errorf("could not parse GOARCH and Go compiler in format \" \" from stdout of go command:\n%s\ndir: %s\nstdout: <<%s>>\nstderr: <<%s>>", + cmdDebugStr(env, args...), dir, stdout.String(), stderr.String()) + } + goarch = fields[0] + compiler = fields[1] + } + return types.SizesFor(compiler, goarch), nil +} + +// invokeGo returns the stdout and stderr of a go command invocation. +func invokeGo(ctx context.Context, env []string, dir string, usesExportData bool, args ...string) (*bytes.Buffer, *bytes.Buffer, error) { + if debug { + defer func(start time.Time) { log.Printf("%s for %v", time.Since(start), cmdDebugStr(env, args...)) }(time.Now()) + } + stdout := new(bytes.Buffer) + stderr := new(bytes.Buffer) + cmd := exec.CommandContext(ctx, "go", args...) + // On darwin the cwd gets resolved to the real path, which breaks anything that + // expects the working directory to keep the original path, including the + // go command when dealing with modules. + // The Go stdlib has a special feature where if the cwd and the PWD are the + // same node then it trusts the PWD, so by setting it in the env for the child + // process we fix up all the paths returned by the go command. + cmd.Env = append(append([]string{}, env...), "PWD="+dir) + cmd.Dir = dir + cmd.Stdout = stdout + cmd.Stderr = stderr + if err := cmd.Run(); err != nil { + exitErr, ok := err.(*exec.ExitError) + if !ok { + // Catastrophic error: + // - executable not found + // - context cancellation + return nil, nil, fmt.Errorf("couldn't exec 'go %v': %s %T", args, err, err) + } + + // Export mode entails a build. + // If that build fails, errors appear on stderr + // (despite the -e flag) and the Export field is blank. + // Do not fail in that case. + if !usesExportData { + return nil, nil, fmt.Errorf("go %v: %s: %s", args, exitErr, stderr) + } + } + + // As of writing, go list -export prints some non-fatal compilation + // errors to stderr, even with -e set. We would prefer that it put + // them in the Package.Error JSON (see https://golang.org/issue/26319). + // In the meantime, there's nowhere good to put them, but they can + // be useful for debugging. Print them if $GOPACKAGESPRINTGOLISTERRORS + // is set. + if len(stderr.Bytes()) != 0 && os.Getenv("GOPACKAGESPRINTGOLISTERRORS") != "" { + fmt.Fprintf(os.Stderr, "%s stderr: <<%s>>\n", cmdDebugStr(env, args...), stderr) + } + + // debugging + if false { + fmt.Fprintf(os.Stderr, "%s stdout: <<%s>>\n", cmdDebugStr(env, args...), stdout) + } + + return stdout, stderr, nil +} + +func cmdDebugStr(envlist []string, args ...string) string { + env := make(map[string]string) + for _, kv := range envlist { + split := strings.Split(kv, "=") + k, v := split[0], split[1] + env[k] = v + } + + return fmt.Sprintf("GOROOT=%v GOPATH=%v GO111MODULE=%v PWD=%v go %v", env["GOROOT"], env["GOPATH"], env["GO111MODULE"], env["PWD"], args) +} diff --git a/vendor/golang.org/x/tools/go/packages/doc.go b/vendor/golang.org/x/tools/go/packages/doc.go new file mode 100644 index 00000000..3799f8ed --- /dev/null +++ b/vendor/golang.org/x/tools/go/packages/doc.go @@ -0,0 +1,222 @@ +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +/* +Package packages loads Go packages for inspection and analysis. + +The Load function takes as input a list of patterns and return a list of Package +structs describing individual packages matched by those patterns. +The LoadMode controls the amount of detail in the loaded packages. + +Load passes most patterns directly to the underlying build tool, +but all patterns with the prefix "query=", where query is a +non-empty string of letters from [a-z], are reserved and may be +interpreted as query operators. + +Two query operators are currently supported: "file" and "pattern". + +The query "file=path/to/file.go" matches the package or packages enclosing +the Go source file path/to/file.go. For example "file=~/go/src/fmt/print.go" +might return the packages "fmt" and "fmt [fmt.test]". + +The query "pattern=string" causes "string" to be passed directly to +the underlying build tool. In most cases this is unnecessary, +but an application can use Load("pattern=" + x) as an escaping mechanism +to ensure that x is not interpreted as a query operator if it contains '='. + +All other query operators are reserved for future use and currently +cause Load to report an error. + +The Package struct provides basic information about the package, including + + - ID, a unique identifier for the package in the returned set; + - GoFiles, the names of the package's Go source files; + - Imports, a map from source import strings to the Packages they name; + - Types, the type information for the package's exported symbols; + - Syntax, the parsed syntax trees for the package's source code; and + - TypeInfo, the result of a complete type-check of the package syntax trees. + +(See the documentation for type Package for the complete list of fields +and more detailed descriptions.) + +For example, + + Load(nil, "bytes", "unicode...") + +returns four Package structs describing the standard library packages +bytes, unicode, unicode/utf16, and unicode/utf8. Note that one pattern +can match multiple packages and that a package might be matched by +multiple patterns: in general it is not possible to determine which +packages correspond to which patterns. + +Note that the list returned by Load contains only the packages matched +by the patterns. Their dependencies can be found by walking the import +graph using the Imports fields. + +The Load function can be configured by passing a pointer to a Config as +the first argument. A nil Config is equivalent to the zero Config, which +causes Load to run in LoadFiles mode, collecting minimal information. +See the documentation for type Config for details. + +As noted earlier, the Config.Mode controls the amount of detail +reported about the loaded packages, with each mode returning all the data of the +previous mode with some extra added. See the documentation for type LoadMode +for details. + +Most tools should pass their command-line arguments (after any flags) +uninterpreted to the loader, so that the loader can interpret them +according to the conventions of the underlying build system. +See the Example function for typical usage. + +*/ +package packages // import "golang.org/x/tools/go/packages" + +/* + +Motivation and design considerations + +The new package's design solves problems addressed by two existing +packages: go/build, which locates and describes packages, and +golang.org/x/tools/go/loader, which loads, parses and type-checks them. +The go/build.Package structure encodes too much of the 'go build' way +of organizing projects, leaving us in need of a data type that describes a +package of Go source code independent of the underlying build system. +We wanted something that works equally well with go build and vgo, and +also other build systems such as Bazel and Blaze, making it possible to +construct analysis tools that work in all these environments. +Tools such as errcheck and staticcheck were essentially unavailable to +the Go community at Google, and some of Google's internal tools for Go +are unavailable externally. +This new package provides a uniform way to obtain package metadata by +querying each of these build systems, optionally supporting their +preferred command-line notations for packages, so that tools integrate +neatly with users' build environments. The Metadata query function +executes an external query tool appropriate to the current workspace. + +Loading packages always returns the complete import graph "all the way down", +even if all you want is information about a single package, because the query +mechanisms of all the build systems we currently support ({go,vgo} list, and +blaze/bazel aspect-based query) cannot provide detailed information +about one package without visiting all its dependencies too, so there is +no additional asymptotic cost to providing transitive information. +(This property might not be true of a hypothetical 5th build system.) + +In calls to TypeCheck, all initial packages, and any package that +transitively depends on one of them, must be loaded from source. +Consider A->B->C->D->E: if A,C are initial, A,B,C must be loaded from +source; D may be loaded from export data, and E may not be loaded at all +(though it's possible that D's export data mentions it, so a +types.Package may be created for it and exposed.) + +The old loader had a feature to suppress type-checking of function +bodies on a per-package basis, primarily intended to reduce the work of +obtaining type information for imported packages. Now that imports are +satisfied by export data, the optimization no longer seems necessary. + +Despite some early attempts, the old loader did not exploit export data, +instead always using the equivalent of WholeProgram mode. This was due +to the complexity of mixing source and export data packages (now +resolved by the upward traversal mentioned above), and because export data +files were nearly always missing or stale. Now that 'go build' supports +caching, all the underlying build systems can guarantee to produce +export data in a reasonable (amortized) time. + +Test "main" packages synthesized by the build system are now reported as +first-class packages, avoiding the need for clients (such as go/ssa) to +reinvent this generation logic. + +One way in which go/packages is simpler than the old loader is in its +treatment of in-package tests. In-package tests are packages that +consist of all the files of the library under test, plus the test files. +The old loader constructed in-package tests by a two-phase process of +mutation called "augmentation": first it would construct and type check +all the ordinary library packages and type-check the packages that +depend on them; then it would add more (test) files to the package and +type-check again. This two-phase approach had four major problems: +1) in processing the tests, the loader modified the library package, + leaving no way for a client application to see both the test + package and the library package; one would mutate into the other. +2) because test files can declare additional methods on types defined in + the library portion of the package, the dispatch of method calls in + the library portion was affected by the presence of the test files. + This should have been a clue that the packages were logically + different. +3) this model of "augmentation" assumed at most one in-package test + per library package, which is true of projects using 'go build', + but not other build systems. +4) because of the two-phase nature of test processing, all packages that + import the library package had to be processed before augmentation, + forcing a "one-shot" API and preventing the client from calling Load + in several times in sequence as is now possible in WholeProgram mode. + (TypeCheck mode has a similar one-shot restriction for a different reason.) + +Early drafts of this package supported "multi-shot" operation. +Although it allowed clients to make a sequence of calls (or concurrent +calls) to Load, building up the graph of Packages incrementally, +it was of marginal value: it complicated the API +(since it allowed some options to vary across calls but not others), +it complicated the implementation, +it cannot be made to work in Types mode, as explained above, +and it was less efficient than making one combined call (when this is possible). +Among the clients we have inspected, none made multiple calls to load +but could not be easily and satisfactorily modified to make only a single call. +However, applications changes may be required. +For example, the ssadump command loads the user-specified packages +and in addition the runtime package. It is tempting to simply append +"runtime" to the user-provided list, but that does not work if the user +specified an ad-hoc package such as [a.go b.go]. +Instead, ssadump no longer requests the runtime package, +but seeks it among the dependencies of the user-specified packages, +and emits an error if it is not found. + +Overlays: The Overlay field in the Config allows providing alternate contents +for Go source files, by providing a mapping from file path to contents. +go/packages will pull in new imports added in overlay files when go/packages +is run in LoadImports mode or greater. +Overlay support for the go list driver isn't complete yet: if the file doesn't +exist on disk, it will only be recognized in an overlay if it is a non-test file +and the package would be reported even without the overlay. + +Questions & Tasks + +- Add GOARCH/GOOS? + They are not portable concepts, but could be made portable. + Our goal has been to allow users to express themselves using the conventions + of the underlying build system: if the build system honors GOARCH + during a build and during a metadata query, then so should + applications built atop that query mechanism. + Conversely, if the target architecture of the build is determined by + command-line flags, the application can pass the relevant + flags through to the build system using a command such as: + myapp -query_flag="--cpu=amd64" -query_flag="--os=darwin" + However, this approach is low-level, unwieldy, and non-portable. + GOOS and GOARCH seem important enough to warrant a dedicated option. + +- How should we handle partial failures such as a mixture of good and + malformed patterns, existing and non-existent packages, successful and + failed builds, import failures, import cycles, and so on, in a call to + Load? + +- Support bazel, blaze, and go1.10 list, not just go1.11 list. + +- Handle (and test) various partial success cases, e.g. + a mixture of good packages and: + invalid patterns + nonexistent packages + empty packages + packages with malformed package or import declarations + unreadable files + import cycles + other parse errors + type errors + Make sure we record errors at the correct place in the graph. + +- Missing packages among initial arguments are not reported. + Return bogus packages for them, like golist does. + +- "undeclared name" errors (for example) are reported out of source file + order. I suspect this is due to the breadth-first resolution now used + by go/types. Is that a bug? Discuss with gri. + +*/ diff --git a/vendor/golang.org/x/tools/go/packages/external.go b/vendor/golang.org/x/tools/go/packages/external.go new file mode 100644 index 00000000..6ac3e4f5 --- /dev/null +++ b/vendor/golang.org/x/tools/go/packages/external.go @@ -0,0 +1,100 @@ +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// This file enables an external tool to intercept package requests. +// If the tool is present then its results are used in preference to +// the go list command. + +package packages + +import ( + "bytes" + "encoding/json" + "fmt" + "os" + "os/exec" + "strings" +) + +// The Driver Protocol +// +// The driver, given the inputs to a call to Load, returns metadata about the packages specified. +// This allows for different build systems to support go/packages by telling go/packages how the +// packages' source is organized. +// The driver is a binary, either specified by the GOPACKAGESDRIVER environment variable or in +// the path as gopackagesdriver. It's given the inputs to load in its argv. See the package +// documentation in doc.go for the full description of the patterns that need to be supported. +// A driver receives as a JSON-serialized driverRequest struct in standard input and will +// produce a JSON-serialized driverResponse (see definition in packages.go) in its standard output. + +// driverRequest is used to provide the portion of Load's Config that is needed by a driver. +type driverRequest struct { + Mode LoadMode `json:"mode"` + // Env specifies the environment the underlying build system should be run in. + Env []string `json:"env"` + // BuildFlags are flags that should be passed to the underlying build system. + BuildFlags []string `json:"build_flags"` + // Tests specifies whether the patterns should also return test packages. + Tests bool `json:"tests"` + // Overlay maps file paths (relative to the driver's working directory) to the byte contents + // of overlay files. + Overlay map[string][]byte `json:"overlay"` +} + +// findExternalDriver returns the file path of a tool that supplies +// the build system package structure, or "" if not found." +// If GOPACKAGESDRIVER is set in the environment findExternalTool returns its +// value, otherwise it searches for a binary named gopackagesdriver on the PATH. +func findExternalDriver(cfg *Config) driver { + const toolPrefix = "GOPACKAGESDRIVER=" + tool := "" + for _, env := range cfg.Env { + if val := strings.TrimPrefix(env, toolPrefix); val != env { + tool = val + } + } + if tool != "" && tool == "off" { + return nil + } + if tool == "" { + var err error + tool, err = exec.LookPath("gopackagesdriver") + if err != nil { + return nil + } + } + return func(cfg *Config, words ...string) (*driverResponse, error) { + req, err := json.Marshal(driverRequest{ + Mode: cfg.Mode, + Env: cfg.Env, + BuildFlags: cfg.BuildFlags, + Tests: cfg.Tests, + Overlay: cfg.Overlay, + }) + if err != nil { + return nil, fmt.Errorf("failed to encode message to driver tool: %v", err) + } + + buf := new(bytes.Buffer) + stderr := new(bytes.Buffer) + cmd := exec.CommandContext(cfg.Context, tool, words...) + cmd.Dir = cfg.Dir + cmd.Env = cfg.Env + cmd.Stdin = bytes.NewReader(req) + cmd.Stdout = buf + cmd.Stderr = stderr + if len(stderr.Bytes()) != 0 && os.Getenv("GOPACKAGESPRINTDRIVERERRORS") != "" { + fmt.Fprintf(os.Stderr, "%s stderr: <<%s>>\n", cmdDebugStr(cmd, words...), stderr) + } + + if err := cmd.Run(); err != nil { + return nil, fmt.Errorf("%v: %v: %s", tool, err, cmd.Stderr) + } + var response driverResponse + if err := json.Unmarshal(buf.Bytes(), &response); err != nil { + return nil, err + } + return &response, nil + } +} diff --git a/vendor/golang.org/x/tools/go/packages/golist.go b/vendor/golang.org/x/tools/go/packages/golist.go new file mode 100644 index 00000000..648e3643 --- /dev/null +++ b/vendor/golang.org/x/tools/go/packages/golist.go @@ -0,0 +1,1143 @@ +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package packages + +import ( + "bytes" + "encoding/json" + "fmt" + "go/types" + "io/ioutil" + "log" + "os" + "os/exec" + "path" + "path/filepath" + "reflect" + "regexp" + "strconv" + "strings" + "sync" + "time" + "unicode" + + "golang.org/x/tools/go/internal/packagesdriver" + "golang.org/x/tools/internal/gopathwalk" + "golang.org/x/tools/internal/semver" + "golang.org/x/tools/internal/span" +) + +// debug controls verbose logging. +var debug, _ = strconv.ParseBool(os.Getenv("GOPACKAGESDEBUG")) + +// A goTooOldError reports that the go command +// found by exec.LookPath is too old to use the new go list behavior. +type goTooOldError struct { + error +} + +// responseDeduper wraps a driverResponse, deduplicating its contents. +type responseDeduper struct { + seenRoots map[string]bool + seenPackages map[string]*Package + dr *driverResponse +} + +// init fills in r with a driverResponse. +func (r *responseDeduper) init(dr *driverResponse) { + r.dr = dr + r.seenRoots = map[string]bool{} + r.seenPackages = map[string]*Package{} + for _, pkg := range dr.Packages { + r.seenPackages[pkg.ID] = pkg + } + for _, root := range dr.Roots { + r.seenRoots[root] = true + } +} + +func (r *responseDeduper) addPackage(p *Package) { + if r.seenPackages[p.ID] != nil { + return + } + r.seenPackages[p.ID] = p + r.dr.Packages = append(r.dr.Packages, p) +} + +func (r *responseDeduper) addRoot(id string) { + if r.seenRoots[id] { + return + } + r.seenRoots[id] = true + r.dr.Roots = append(r.dr.Roots, id) +} + +// goInfo contains global information from the go tool. +type goInfo struct { + rootDirs map[string]string + env goEnv +} + +type goEnv struct { + modulesOn bool +} + +func determineEnv(cfg *Config) goEnv { + buf, err := invokeGo(cfg, "env", "GOMOD") + if err != nil { + return goEnv{} + } + gomod := bytes.TrimSpace(buf.Bytes()) + + env := goEnv{} + env.modulesOn = len(gomod) > 0 + return env +} + +// goListDriver uses the go list command to interpret the patterns and produce +// the build system package structure. +// See driver for more details. +func goListDriver(cfg *Config, patterns ...string) (*driverResponse, error) { + var sizes types.Sizes + var sizeserr error + var sizeswg sync.WaitGroup + if cfg.Mode&NeedTypesSizes != 0 || cfg.Mode&NeedTypes != 0 { + sizeswg.Add(1) + go func() { + sizes, sizeserr = getSizes(cfg) + sizeswg.Done() + }() + } + defer sizeswg.Wait() + + // start fetching rootDirs + var info goInfo + var rootDirsReady, envReady = make(chan struct{}), make(chan struct{}) + go func() { + info.rootDirs = determineRootDirs(cfg) + close(rootDirsReady) + }() + go func() { + info.env = determineEnv(cfg) + close(envReady) + }() + getGoInfo := func() *goInfo { + <-rootDirsReady + <-envReady + return &info + } + + // Ensure that we don't leak goroutines: Load is synchronous, so callers will + // not expect it to access the fields of cfg after the call returns. + defer getGoInfo() + + // always pass getGoInfo to golistDriver + golistDriver := func(cfg *Config, patterns ...string) (*driverResponse, error) { + return golistDriver(cfg, getGoInfo, patterns...) + } + + // Determine files requested in contains patterns + var containFiles []string + var packagesNamed []string + restPatterns := make([]string, 0, len(patterns)) + // Extract file= and other [querytype]= patterns. Report an error if querytype + // doesn't exist. +extractQueries: + for _, pattern := range patterns { + eqidx := strings.Index(pattern, "=") + if eqidx < 0 { + restPatterns = append(restPatterns, pattern) + } else { + query, value := pattern[:eqidx], pattern[eqidx+len("="):] + switch query { + case "file": + containFiles = append(containFiles, value) + case "pattern": + restPatterns = append(restPatterns, value) + case "iamashamedtousethedisabledqueryname": + packagesNamed = append(packagesNamed, value) + case "": // not a reserved query + restPatterns = append(restPatterns, pattern) + default: + for _, rune := range query { + if rune < 'a' || rune > 'z' { // not a reserved query + restPatterns = append(restPatterns, pattern) + continue extractQueries + } + } + // Reject all other patterns containing "=" + return nil, fmt.Errorf("invalid query type %q in query pattern %q", query, pattern) + } + } + } + + response := &responseDeduper{} + var err error + + // See if we have any patterns to pass through to go list. Zero initial + // patterns also requires a go list call, since it's the equivalent of + // ".". + if len(restPatterns) > 0 || len(patterns) == 0 { + dr, err := golistDriver(cfg, restPatterns...) + if err != nil { + return nil, err + } + response.init(dr) + } else { + response.init(&driverResponse{}) + } + + sizeswg.Wait() + if sizeserr != nil { + return nil, sizeserr + } + // types.SizesFor always returns nil or a *types.StdSizes + response.dr.Sizes, _ = sizes.(*types.StdSizes) + + var containsCandidates []string + + if len(containFiles) != 0 { + if err := runContainsQueries(cfg, golistDriver, response, containFiles, getGoInfo); err != nil { + return nil, err + } + } + + if len(packagesNamed) != 0 { + if err := runNamedQueries(cfg, golistDriver, response, packagesNamed); err != nil { + return nil, err + } + } + + modifiedPkgs, needPkgs, err := processGolistOverlay(cfg, response, getGoInfo) + if err != nil { + return nil, err + } + if len(containFiles) > 0 { + containsCandidates = append(containsCandidates, modifiedPkgs...) + containsCandidates = append(containsCandidates, needPkgs...) + } + if err := addNeededOverlayPackages(cfg, golistDriver, response, needPkgs, getGoInfo); err != nil { + return nil, err + } + // Check candidate packages for containFiles. + if len(containFiles) > 0 { + for _, id := range containsCandidates { + pkg, ok := response.seenPackages[id] + if !ok { + response.addPackage(&Package{ + ID: id, + Errors: []Error{ + { + Kind: ListError, + Msg: fmt.Sprintf("package %s expected but not seen", id), + }, + }, + }) + continue + } + for _, f := range containFiles { + for _, g := range pkg.GoFiles { + if sameFile(f, g) { + response.addRoot(id) + } + } + } + } + } + + return response.dr, nil +} + +func addNeededOverlayPackages(cfg *Config, driver driver, response *responseDeduper, pkgs []string, getGoInfo func() *goInfo) error { + if len(pkgs) == 0 { + return nil + } + drivercfg := *cfg + if getGoInfo().env.modulesOn { + drivercfg.BuildFlags = append(drivercfg.BuildFlags, "-mod=readonly") + } + dr, err := driver(&drivercfg, pkgs...) + + if err != nil { + return err + } + for _, pkg := range dr.Packages { + response.addPackage(pkg) + } + _, needPkgs, err := processGolistOverlay(cfg, response, getGoInfo) + if err != nil { + return err + } + return addNeededOverlayPackages(cfg, driver, response, needPkgs, getGoInfo) +} + +func runContainsQueries(cfg *Config, driver driver, response *responseDeduper, queries []string, goInfo func() *goInfo) error { + for _, query := range queries { + // TODO(matloob): Do only one query per directory. + fdir := filepath.Dir(query) + // Pass absolute path of directory to go list so that it knows to treat it as a directory, + // not a package path. + pattern, err := filepath.Abs(fdir) + if err != nil { + return fmt.Errorf("could not determine absolute path of file= query path %q: %v", query, err) + } + dirResponse, err := driver(cfg, pattern) + if err != nil { + var queryErr error + if dirResponse, queryErr = adHocPackage(cfg, driver, pattern, query); queryErr != nil { + return err // return the original error + } + } + // `go list` can report errors for files that are not listed as part of a package's GoFiles. + // In the case of an invalid Go file, we should assume that it is part of package if only + // one package is in the response. The file may have valid contents in an overlay. + if len(dirResponse.Packages) == 1 { + pkg := dirResponse.Packages[0] + for i, err := range pkg.Errors { + s := errorSpan(err) + if !s.IsValid() { + break + } + if len(pkg.CompiledGoFiles) == 0 { + break + } + dir := filepath.Dir(pkg.CompiledGoFiles[0]) + filename := filepath.Join(dir, filepath.Base(s.URI().Filename())) + if info, err := os.Stat(filename); err != nil || info.IsDir() { + break + } + if !contains(pkg.CompiledGoFiles, filename) { + pkg.CompiledGoFiles = append(pkg.CompiledGoFiles, filename) + pkg.GoFiles = append(pkg.GoFiles, filename) + pkg.Errors = append(pkg.Errors[:i], pkg.Errors[i+1:]...) + } + } + } + // A final attempt to construct an ad-hoc package. + if len(dirResponse.Packages) == 1 && len(dirResponse.Packages[0].Errors) == 1 { + var queryErr error + if dirResponse, queryErr = adHocPackage(cfg, driver, pattern, query); queryErr != nil { + return err // return the original error + } + } + isRoot := make(map[string]bool, len(dirResponse.Roots)) + for _, root := range dirResponse.Roots { + isRoot[root] = true + } + for _, pkg := range dirResponse.Packages { + // Add any new packages to the main set + // We don't bother to filter packages that will be dropped by the changes of roots, + // that will happen anyway during graph construction outside this function. + // Over-reporting packages is not a problem. + response.addPackage(pkg) + // if the package was not a root one, it cannot have the file + if !isRoot[pkg.ID] { + continue + } + for _, pkgFile := range pkg.GoFiles { + if filepath.Base(query) == filepath.Base(pkgFile) { + response.addRoot(pkg.ID) + break + } + } + } + } + return nil +} + +// adHocPackage attempts to construct an ad-hoc package given a query that failed. +func adHocPackage(cfg *Config, driver driver, pattern, query string) (*driverResponse, error) { + // There was an error loading the package. Try to load the file as an ad-hoc package. + // Usually the error will appear in a returned package, but may not if we're in modules mode + // and the ad-hoc is located outside a module. + dirResponse, err := driver(cfg, query) + if err != nil { + return nil, err + } + // If we get nothing back from `go list`, try to make this file into its own ad-hoc package. + if len(dirResponse.Packages) == 0 && err == nil { + dirResponse.Packages = append(dirResponse.Packages, &Package{ + ID: "command-line-arguments", + PkgPath: query, + GoFiles: []string{query}, + CompiledGoFiles: []string{query}, + Imports: make(map[string]*Package), + }) + dirResponse.Roots = append(dirResponse.Roots, "command-line-arguments") + } + // Special case to handle issue #33482: + // If this is a file= query for ad-hoc packages where the file only exists on an overlay, + // and exists outside of a module, add the file in for the package. + if len(dirResponse.Packages) == 1 && (dirResponse.Packages[0].ID == "command-line-arguments" || + filepath.ToSlash(dirResponse.Packages[0].PkgPath) == filepath.ToSlash(query)) { + if len(dirResponse.Packages[0].GoFiles) == 0 { + filename := filepath.Join(pattern, filepath.Base(query)) // avoid recomputing abspath + // TODO(matloob): check if the file is outside of a root dir? + for path := range cfg.Overlay { + if path == filename { + dirResponse.Packages[0].Errors = nil + dirResponse.Packages[0].GoFiles = []string{path} + dirResponse.Packages[0].CompiledGoFiles = []string{path} + } + } + } + } + return dirResponse, nil +} + +func contains(files []string, filename string) bool { + for _, f := range files { + if f == filename { + return true + } + } + return false +} + +// errorSpan attempts to parse a standard `go list` error message +// by stripping off the trailing error message. +// +// It works only on errors whose message is prefixed by colon, +// followed by a space (": "). For example: +// +// attributes.go:13:1: expected 'package', found 'type' +// +func errorSpan(err Error) span.Span { + if err.Pos == "" { + input := strings.TrimSpace(err.Msg) + msgIndex := strings.Index(input, ": ") + if msgIndex < 0 { + return span.Parse(input) + } + return span.Parse(input[:msgIndex]) + } + return span.Parse(err.Pos) +} + +// modCacheRegexp splits a path in a module cache into module, module version, and package. +var modCacheRegexp = regexp.MustCompile(`(.*)@([^/\\]*)(.*)`) + +func runNamedQueries(cfg *Config, driver driver, response *responseDeduper, queries []string) error { + // calling `go env` isn't free; bail out if there's nothing to do. + if len(queries) == 0 { + return nil + } + // Determine which directories are relevant to scan. + roots, modRoot, err := roots(cfg) + if err != nil { + return err + } + + // Scan the selected directories. Simple matches, from GOPATH/GOROOT + // or the local module, can simply be "go list"ed. Matches from the + // module cache need special treatment. + var matchesMu sync.Mutex + var simpleMatches, modCacheMatches []string + add := func(root gopathwalk.Root, dir string) { + // Walk calls this concurrently; protect the result slices. + matchesMu.Lock() + defer matchesMu.Unlock() + + path := dir + if dir != root.Path { + path = dir[len(root.Path)+1:] + } + if pathMatchesQueries(path, queries) { + switch root.Type { + case gopathwalk.RootModuleCache: + modCacheMatches = append(modCacheMatches, path) + case gopathwalk.RootCurrentModule: + // We'd need to read go.mod to find the full + // import path. Relative's easier. + rel, err := filepath.Rel(cfg.Dir, dir) + if err != nil { + // This ought to be impossible, since + // we found dir in the current module. + panic(err) + } + simpleMatches = append(simpleMatches, "./"+rel) + case gopathwalk.RootGOPATH, gopathwalk.RootGOROOT: + simpleMatches = append(simpleMatches, path) + } + } + } + + startWalk := time.Now() + gopathwalk.Walk(roots, add, gopathwalk.Options{ModulesEnabled: modRoot != "", Debug: debug}) + cfg.Logf("%v for walk", time.Since(startWalk)) + + // Weird special case: the top-level package in a module will be in + // whatever directory the user checked the repository out into. It's + // more reasonable for that to not match the package name. So, if there + // are any Go files in the mod root, query it just to be safe. + if modRoot != "" { + rel, err := filepath.Rel(cfg.Dir, modRoot) + if err != nil { + panic(err) // See above. + } + + files, err := ioutil.ReadDir(modRoot) + if err != nil { + panic(err) // See above. + } + + for _, f := range files { + if strings.HasSuffix(f.Name(), ".go") { + simpleMatches = append(simpleMatches, rel) + break + } + } + } + + addResponse := func(r *driverResponse) { + for _, pkg := range r.Packages { + response.addPackage(pkg) + for _, name := range queries { + if pkg.Name == name { + response.addRoot(pkg.ID) + break + } + } + } + } + + if len(simpleMatches) != 0 { + resp, err := driver(cfg, simpleMatches...) + if err != nil { + return err + } + addResponse(resp) + } + + // Module cache matches are tricky. We want to avoid downloading new + // versions of things, so we need to use the ones present in the cache. + // go list doesn't accept version specifiers, so we have to write out a + // temporary module, and do the list in that module. + if len(modCacheMatches) != 0 { + // Collect all the matches, deduplicating by major version + // and preferring the newest. + type modInfo struct { + mod string + major string + } + mods := make(map[modInfo]string) + var imports []string + for _, modPath := range modCacheMatches { + matches := modCacheRegexp.FindStringSubmatch(modPath) + mod, ver := filepath.ToSlash(matches[1]), matches[2] + importPath := filepath.ToSlash(filepath.Join(matches[1], matches[3])) + + major := semver.Major(ver) + if prevVer, ok := mods[modInfo{mod, major}]; !ok || semver.Compare(ver, prevVer) > 0 { + mods[modInfo{mod, major}] = ver + } + + imports = append(imports, importPath) + } + + // Build the temporary module. + var gomod bytes.Buffer + gomod.WriteString("module modquery\nrequire (\n") + for mod, version := range mods { + gomod.WriteString("\t" + mod.mod + " " + version + "\n") + } + gomod.WriteString(")\n") + + tmpCfg := *cfg + + // We're only trying to look at stuff in the module cache, so + // disable the network. This should speed things up, and has + // prevented errors in at least one case, #28518. + tmpCfg.Env = append([]string{"GOPROXY=off"}, cfg.Env...) + + var err error + tmpCfg.Dir, err = ioutil.TempDir("", "gopackages-modquery") + if err != nil { + return err + } + defer os.RemoveAll(tmpCfg.Dir) + + if err := ioutil.WriteFile(filepath.Join(tmpCfg.Dir, "go.mod"), gomod.Bytes(), 0777); err != nil { + return fmt.Errorf("writing go.mod for module cache query: %v", err) + } + + // Run the query, using the import paths calculated from the matches above. + resp, err := driver(&tmpCfg, imports...) + if err != nil { + return fmt.Errorf("querying module cache matches: %v", err) + } + addResponse(resp) + } + + return nil +} + +func getSizes(cfg *Config) (types.Sizes, error) { + return packagesdriver.GetSizesGolist(cfg.Context, cfg.BuildFlags, cfg.Env, cfg.Dir, usesExportData(cfg)) +} + +// roots selects the appropriate paths to walk based on the passed-in configuration, +// particularly the environment and the presence of a go.mod in cfg.Dir's parents. +func roots(cfg *Config) ([]gopathwalk.Root, string, error) { + stdout, err := invokeGo(cfg, "env", "GOROOT", "GOPATH", "GOMOD") + if err != nil { + return nil, "", err + } + + fields := strings.Split(stdout.String(), "\n") + if len(fields) != 4 || len(fields[3]) != 0 { + return nil, "", fmt.Errorf("go env returned unexpected output: %q", stdout.String()) + } + goroot, gopath, gomod := fields[0], filepath.SplitList(fields[1]), fields[2] + var modDir string + if gomod != "" { + modDir = filepath.Dir(gomod) + } + + var roots []gopathwalk.Root + // Always add GOROOT. + roots = append(roots, gopathwalk.Root{ + Path: filepath.Join(goroot, "/src"), + Type: gopathwalk.RootGOROOT, + }) + // If modules are enabled, scan the module dir. + if modDir != "" { + roots = append(roots, gopathwalk.Root{ + Path: modDir, + Type: gopathwalk.RootCurrentModule, + }) + } + // Add either GOPATH/src or GOPATH/pkg/mod, depending on module mode. + for _, p := range gopath { + if modDir != "" { + roots = append(roots, gopathwalk.Root{ + Path: filepath.Join(p, "/pkg/mod"), + Type: gopathwalk.RootModuleCache, + }) + } else { + roots = append(roots, gopathwalk.Root{ + Path: filepath.Join(p, "/src"), + Type: gopathwalk.RootGOPATH, + }) + } + } + + return roots, modDir, nil +} + +// These functions were copied from goimports. See further documentation there. + +// pathMatchesQueries is adapted from pkgIsCandidate. +// TODO: is it reasonable to do Contains here, rather than an exact match on a path component? +func pathMatchesQueries(path string, queries []string) bool { + lastTwo := lastTwoComponents(path) + for _, query := range queries { + if strings.Contains(lastTwo, query) { + return true + } + if hasHyphenOrUpperASCII(lastTwo) && !hasHyphenOrUpperASCII(query) { + lastTwo = lowerASCIIAndRemoveHyphen(lastTwo) + if strings.Contains(lastTwo, query) { + return true + } + } + } + return false +} + +// lastTwoComponents returns at most the last two path components +// of v, using either / or \ as the path separator. +func lastTwoComponents(v string) string { + nslash := 0 + for i := len(v) - 1; i >= 0; i-- { + if v[i] == '/' || v[i] == '\\' { + nslash++ + if nslash == 2 { + return v[i:] + } + } + } + return v +} + +func hasHyphenOrUpperASCII(s string) bool { + for i := 0; i < len(s); i++ { + b := s[i] + if b == '-' || ('A' <= b && b <= 'Z') { + return true + } + } + return false +} + +func lowerASCIIAndRemoveHyphen(s string) (ret string) { + buf := make([]byte, 0, len(s)) + for i := 0; i < len(s); i++ { + b := s[i] + switch { + case b == '-': + continue + case 'A' <= b && b <= 'Z': + buf = append(buf, b+('a'-'A')) + default: + buf = append(buf, b) + } + } + return string(buf) +} + +// Fields must match go list; +// see $GOROOT/src/cmd/go/internal/load/pkg.go. +type jsonPackage struct { + ImportPath string + Dir string + Name string + Export string + GoFiles []string + CompiledGoFiles []string + CFiles []string + CgoFiles []string + CXXFiles []string + MFiles []string + HFiles []string + FFiles []string + SFiles []string + SwigFiles []string + SwigCXXFiles []string + SysoFiles []string + Imports []string + ImportMap map[string]string + Deps []string + TestGoFiles []string + TestImports []string + XTestGoFiles []string + XTestImports []string + ForTest string // q in a "p [q.test]" package, else "" + DepOnly bool + + Error *jsonPackageError +} + +type jsonPackageError struct { + ImportStack []string + Pos string + Err string +} + +func otherFiles(p *jsonPackage) [][]string { + return [][]string{p.CFiles, p.CXXFiles, p.MFiles, p.HFiles, p.FFiles, p.SFiles, p.SwigFiles, p.SwigCXXFiles, p.SysoFiles} +} + +// golistDriver uses the "go list" command to expand the pattern +// words and return metadata for the specified packages. dir may be +// "" and env may be nil, as per os/exec.Command. +func golistDriver(cfg *Config, rootsDirs func() *goInfo, words ...string) (*driverResponse, error) { + // go list uses the following identifiers in ImportPath and Imports: + // + // "p" -- importable package or main (command) + // "q.test" -- q's test executable + // "p [q.test]" -- variant of p as built for q's test executable + // "q_test [q.test]" -- q's external test package + // + // The packages p that are built differently for a test q.test + // are q itself, plus any helpers used by the external test q_test, + // typically including "testing" and all its dependencies. + + // Run "go list" for complete + // information on the specified packages. + buf, err := invokeGo(cfg, golistargs(cfg, words)...) + if err != nil { + return nil, err + } + seen := make(map[string]*jsonPackage) + // Decode the JSON and convert it to Package form. + var response driverResponse + for dec := json.NewDecoder(buf); dec.More(); { + p := new(jsonPackage) + if err := dec.Decode(p); err != nil { + return nil, fmt.Errorf("JSON decoding failed: %v", err) + } + + if p.ImportPath == "" { + // The documentation for go list says that “[e]rroneous packages will have + // a non-empty ImportPath”. If for some reason it comes back empty, we + // prefer to error out rather than silently discarding data or handing + // back a package without any way to refer to it. + if p.Error != nil { + return nil, Error{ + Pos: p.Error.Pos, + Msg: p.Error.Err, + } + } + return nil, fmt.Errorf("package missing import path: %+v", p) + } + + // Work around https://golang.org/issue/33157: + // go list -e, when given an absolute path, will find the package contained at + // that directory. But when no package exists there, it will return a fake package + // with an error and the ImportPath set to the absolute path provided to go list. + // Try to convert that absolute path to what its package path would be if it's + // contained in a known module or GOPATH entry. This will allow the package to be + // properly "reclaimed" when overlays are processed. + if filepath.IsAbs(p.ImportPath) && p.Error != nil { + pkgPath, ok := getPkgPath(cfg, p.ImportPath, rootsDirs) + if ok { + p.ImportPath = pkgPath + } + } + + if old, found := seen[p.ImportPath]; found { + if !reflect.DeepEqual(p, old) { + return nil, fmt.Errorf("internal error: go list gives conflicting information for package %v", p.ImportPath) + } + // skip the duplicate + continue + } + seen[p.ImportPath] = p + + pkg := &Package{ + Name: p.Name, + ID: p.ImportPath, + GoFiles: absJoin(p.Dir, p.GoFiles, p.CgoFiles), + CompiledGoFiles: absJoin(p.Dir, p.CompiledGoFiles), + OtherFiles: absJoin(p.Dir, otherFiles(p)...), + } + + // Work around https://golang.org/issue/28749: + // cmd/go puts assembly, C, and C++ files in CompiledGoFiles. + // Filter out any elements of CompiledGoFiles that are also in OtherFiles. + // We have to keep this workaround in place until go1.12 is a distant memory. + if len(pkg.OtherFiles) > 0 { + other := make(map[string]bool, len(pkg.OtherFiles)) + for _, f := range pkg.OtherFiles { + other[f] = true + } + + out := pkg.CompiledGoFiles[:0] + for _, f := range pkg.CompiledGoFiles { + if other[f] { + continue + } + out = append(out, f) + } + pkg.CompiledGoFiles = out + } + + // Extract the PkgPath from the package's ID. + if i := strings.IndexByte(pkg.ID, ' '); i >= 0 { + pkg.PkgPath = pkg.ID[:i] + } else { + pkg.PkgPath = pkg.ID + } + + if pkg.PkgPath == "unsafe" { + pkg.GoFiles = nil // ignore fake unsafe.go file + } + + // Assume go list emits only absolute paths for Dir. + if p.Dir != "" && !filepath.IsAbs(p.Dir) { + log.Fatalf("internal error: go list returned non-absolute Package.Dir: %s", p.Dir) + } + + if p.Export != "" && !filepath.IsAbs(p.Export) { + pkg.ExportFile = filepath.Join(p.Dir, p.Export) + } else { + pkg.ExportFile = p.Export + } + + // imports + // + // Imports contains the IDs of all imported packages. + // ImportsMap records (path, ID) only where they differ. + ids := make(map[string]bool) + for _, id := range p.Imports { + ids[id] = true + } + pkg.Imports = make(map[string]*Package) + for path, id := range p.ImportMap { + pkg.Imports[path] = &Package{ID: id} // non-identity import + delete(ids, id) + } + for id := range ids { + if id == "C" { + continue + } + + pkg.Imports[id] = &Package{ID: id} // identity import + } + if !p.DepOnly { + response.Roots = append(response.Roots, pkg.ID) + } + + // Work around for pre-go.1.11 versions of go list. + // TODO(matloob): they should be handled by the fallback. + // Can we delete this? + if len(pkg.CompiledGoFiles) == 0 { + pkg.CompiledGoFiles = pkg.GoFiles + } + + if p.Error != nil { + pkg.Errors = append(pkg.Errors, Error{ + Pos: p.Error.Pos, + Msg: strings.TrimSpace(p.Error.Err), // Trim to work around golang.org/issue/32363. + }) + } + + response.Packages = append(response.Packages, pkg) + } + + return &response, nil +} + +// getPkgPath finds the package path of a directory if it's relative to a root directory. +func getPkgPath(cfg *Config, dir string, goInfo func() *goInfo) (string, bool) { + absDir, err := filepath.Abs(dir) + if err != nil { + cfg.Logf("error getting absolute path of %s: %v", dir, err) + return "", false + } + for rdir, rpath := range goInfo().rootDirs { + absRdir, err := filepath.Abs(rdir) + if err != nil { + cfg.Logf("error getting absolute path of %s: %v", rdir, err) + continue + } + // Make sure that the directory is in the module, + // to avoid creating a path relative to another module. + if !strings.HasPrefix(absDir, absRdir) { + cfg.Logf("%s does not have prefix %s", absDir, absRdir) + continue + } + // TODO(matloob): This doesn't properly handle symlinks. + r, err := filepath.Rel(rdir, dir) + if err != nil { + continue + } + if rpath != "" { + // We choose only one root even though the directory even it can belong in multiple modules + // or GOPATH entries. This is okay because we only need to work with absolute dirs when a + // file is missing from disk, for instance when gopls calls go/packages in an overlay. + // Once the file is saved, gopls, or the next invocation of the tool will get the correct + // result straight from golist. + // TODO(matloob): Implement module tiebreaking? + return path.Join(rpath, filepath.ToSlash(r)), true + } + return filepath.ToSlash(r), true + } + return "", false +} + +// absJoin absolutizes and flattens the lists of files. +func absJoin(dir string, fileses ...[]string) (res []string) { + for _, files := range fileses { + for _, file := range files { + if !filepath.IsAbs(file) { + file = filepath.Join(dir, file) + } + res = append(res, file) + } + } + return res +} + +func golistargs(cfg *Config, words []string) []string { + const findFlags = NeedImports | NeedTypes | NeedSyntax | NeedTypesInfo + fullargs := []string{ + "list", "-e", "-json", + fmt.Sprintf("-compiled=%t", cfg.Mode&(NeedCompiledGoFiles|NeedSyntax|NeedTypesInfo|NeedTypesSizes) != 0), + fmt.Sprintf("-test=%t", cfg.Tests), + fmt.Sprintf("-export=%t", usesExportData(cfg)), + fmt.Sprintf("-deps=%t", cfg.Mode&NeedImports != 0), + // go list doesn't let you pass -test and -find together, + // probably because you'd just get the TestMain. + fmt.Sprintf("-find=%t", !cfg.Tests && cfg.Mode&findFlags == 0), + } + fullargs = append(fullargs, cfg.BuildFlags...) + fullargs = append(fullargs, "--") + fullargs = append(fullargs, words...) + return fullargs +} + +// invokeGo returns the stdout of a go command invocation. +func invokeGo(cfg *Config, args ...string) (*bytes.Buffer, error) { + stdout := new(bytes.Buffer) + stderr := new(bytes.Buffer) + cmd := exec.CommandContext(cfg.Context, "go", args...) + // On darwin the cwd gets resolved to the real path, which breaks anything that + // expects the working directory to keep the original path, including the + // go command when dealing with modules. + // The Go stdlib has a special feature where if the cwd and the PWD are the + // same node then it trusts the PWD, so by setting it in the env for the child + // process we fix up all the paths returned by the go command. + cmd.Env = append(append([]string{}, cfg.Env...), "PWD="+cfg.Dir) + cmd.Dir = cfg.Dir + cmd.Stdout = stdout + cmd.Stderr = stderr + defer func(start time.Time) { + cfg.Logf("%s for %v, stderr: <<%s>> stdout: <<%s>>\n", time.Since(start), cmdDebugStr(cmd, args...), stderr, stdout) + }(time.Now()) + + if err := cmd.Run(); err != nil { + // Check for 'go' executable not being found. + if ee, ok := err.(*exec.Error); ok && ee.Err == exec.ErrNotFound { + return nil, fmt.Errorf("'go list' driver requires 'go', but %s", exec.ErrNotFound) + } + + exitErr, ok := err.(*exec.ExitError) + if !ok { + // Catastrophic error: + // - context cancellation + return nil, fmt.Errorf("couldn't exec 'go %v': %s %T", args, err, err) + } + + // Old go version? + if strings.Contains(stderr.String(), "flag provided but not defined") { + return nil, goTooOldError{fmt.Errorf("unsupported version of go: %s: %s", exitErr, stderr)} + } + + // Related to #24854 + if len(stderr.String()) > 0 && strings.Contains(stderr.String(), "unexpected directory layout") { + return nil, fmt.Errorf("%s", stderr.String()) + } + + // Is there an error running the C compiler in cgo? This will be reported in the "Error" field + // and should be suppressed by go list -e. + // + // This condition is not perfect yet because the error message can include other error messages than runtime/cgo. + isPkgPathRune := func(r rune) bool { + // From https://golang.org/ref/spec#Import_declarations: + // Implementation restriction: A compiler may restrict ImportPaths to non-empty strings + // using only characters belonging to Unicode's L, M, N, P, and S general categories + // (the Graphic characters without spaces) and may also exclude the + // characters !"#$%&'()*,:;<=>?[\]^`{|} and the Unicode replacement character U+FFFD. + return unicode.IsOneOf([]*unicode.RangeTable{unicode.L, unicode.M, unicode.N, unicode.P, unicode.S}, r) && + !strings.ContainsRune("!\"#$%&'()*,:;<=>?[\\]^`{|}\uFFFD", r) + } + if len(stderr.String()) > 0 && strings.HasPrefix(stderr.String(), "# ") { + if strings.HasPrefix(strings.TrimLeftFunc(stderr.String()[len("# "):], isPkgPathRune), "\n") { + return stdout, nil + } + } + + // This error only appears in stderr. See golang.org/cl/166398 for a fix in go list to show + // the error in the Err section of stdout in case -e option is provided. + // This fix is provided for backwards compatibility. + if len(stderr.String()) > 0 && strings.Contains(stderr.String(), "named files must be .go files") { + output := fmt.Sprintf(`{"ImportPath": "command-line-arguments","Incomplete": true,"Error": {"Pos": "","Err": %q}}`, + strings.Trim(stderr.String(), "\n")) + return bytes.NewBufferString(output), nil + } + + // Similar to the previous error, but currently lacks a fix in Go. + if len(stderr.String()) > 0 && strings.Contains(stderr.String(), "named files must all be in one directory") { + output := fmt.Sprintf(`{"ImportPath": "command-line-arguments","Incomplete": true,"Error": {"Pos": "","Err": %q}}`, + strings.Trim(stderr.String(), "\n")) + return bytes.NewBufferString(output), nil + } + + // Backwards compatibility for Go 1.11 because 1.12 and 1.13 put the directory in the ImportPath. + // If the package doesn't exist, put the absolute path of the directory into the error message, + // as Go 1.13 list does. + const noSuchDirectory = "no such directory" + if len(stderr.String()) > 0 && strings.Contains(stderr.String(), noSuchDirectory) { + errstr := stderr.String() + abspath := strings.TrimSpace(errstr[strings.Index(errstr, noSuchDirectory)+len(noSuchDirectory):]) + output := fmt.Sprintf(`{"ImportPath": %q,"Incomplete": true,"Error": {"Pos": "","Err": %q}}`, + abspath, strings.Trim(stderr.String(), "\n")) + return bytes.NewBufferString(output), nil + } + + // Workaround for #29280: go list -e has incorrect behavior when an ad-hoc package doesn't exist. + // Note that the error message we look for in this case is different that the one looked for above. + if len(stderr.String()) > 0 && strings.Contains(stderr.String(), "no such file or directory") { + output := fmt.Sprintf(`{"ImportPath": "command-line-arguments","Incomplete": true,"Error": {"Pos": "","Err": %q}}`, + strings.Trim(stderr.String(), "\n")) + return bytes.NewBufferString(output), nil + } + + // Workaround for #34273. go list -e with GO111MODULE=on has incorrect behavior when listing a + // directory outside any module. + if len(stderr.String()) > 0 && strings.Contains(stderr.String(), "outside available modules") { + output := fmt.Sprintf(`{"ImportPath": %q,"Incomplete": true,"Error": {"Pos": "","Err": %q}}`, + // TODO(matloob): command-line-arguments isn't correct here. + "command-line-arguments", strings.Trim(stderr.String(), "\n")) + return bytes.NewBufferString(output), nil + } + + // Another variation of the previous error + if len(stderr.String()) > 0 && strings.Contains(stderr.String(), "outside module root") { + output := fmt.Sprintf(`{"ImportPath": %q,"Incomplete": true,"Error": {"Pos": "","Err": %q}}`, + // TODO(matloob): command-line-arguments isn't correct here. + "command-line-arguments", strings.Trim(stderr.String(), "\n")) + return bytes.NewBufferString(output), nil + } + + // Workaround for an instance of golang.org/issue/26755: go list -e will return a non-zero exit + // status if there's a dependency on a package that doesn't exist. But it should return + // a zero exit status and set an error on that package. + if len(stderr.String()) > 0 && strings.Contains(stderr.String(), "no Go files in") { + // Don't clobber stdout if `go list` actually returned something. + if len(stdout.String()) > 0 { + return stdout, nil + } + // try to extract package name from string + stderrStr := stderr.String() + var importPath string + colon := strings.Index(stderrStr, ":") + if colon > 0 && strings.HasPrefix(stderrStr, "go build ") { + importPath = stderrStr[len("go build "):colon] + } + output := fmt.Sprintf(`{"ImportPath": %q,"Incomplete": true,"Error": {"Pos": "","Err": %q}}`, + importPath, strings.Trim(stderrStr, "\n")) + return bytes.NewBufferString(output), nil + } + + // Export mode entails a build. + // If that build fails, errors appear on stderr + // (despite the -e flag) and the Export field is blank. + // Do not fail in that case. + // The same is true if an ad-hoc package given to go list doesn't exist. + // TODO(matloob): Remove these once we can depend on go list to exit with a zero status with -e even when + // packages don't exist or a build fails. + if !usesExportData(cfg) && !containsGoFile(args) { + return nil, fmt.Errorf("go %v: %s: %s", args, exitErr, stderr) + } + } + + // As of writing, go list -export prints some non-fatal compilation + // errors to stderr, even with -e set. We would prefer that it put + // them in the Package.Error JSON (see https://golang.org/issue/26319). + // In the meantime, there's nowhere good to put them, but they can + // be useful for debugging. Print them if $GOPACKAGESPRINTGOLISTERRORS + // is set. + if len(stderr.Bytes()) != 0 && os.Getenv("GOPACKAGESPRINTGOLISTERRORS") != "" { + fmt.Fprintf(os.Stderr, "%s stderr: <<%s>>\n", cmdDebugStr(cmd, args...), stderr) + } + return stdout, nil +} + +func containsGoFile(s []string) bool { + for _, f := range s { + if strings.HasSuffix(f, ".go") { + return true + } + } + return false +} + +func cmdDebugStr(cmd *exec.Cmd, args ...string) string { + env := make(map[string]string) + for _, kv := range cmd.Env { + split := strings.Split(kv, "=") + k, v := split[0], split[1] + env[k] = v + } + var quotedArgs []string + for _, arg := range args { + quotedArgs = append(quotedArgs, strconv.Quote(arg)) + } + + return fmt.Sprintf("GOROOT=%v GOPATH=%v GO111MODULE=%v PWD=%v go %s", env["GOROOT"], env["GOPATH"], env["GO111MODULE"], env["PWD"], strings.Join(quotedArgs, " ")) +} diff --git a/vendor/golang.org/x/tools/go/packages/golist_overlay.go b/vendor/golang.org/x/tools/go/packages/golist_overlay.go new file mode 100644 index 00000000..a7de6229 --- /dev/null +++ b/vendor/golang.org/x/tools/go/packages/golist_overlay.go @@ -0,0 +1,293 @@ +package packages + +import ( + "bytes" + "encoding/json" + "fmt" + "go/parser" + "go/token" + "path/filepath" + "strconv" + "strings" +) + +// processGolistOverlay provides rudimentary support for adding +// files that don't exist on disk to an overlay. The results can be +// sometimes incorrect. +// TODO(matloob): Handle unsupported cases, including the following: +// - determining the correct package to add given a new import path +func processGolistOverlay(cfg *Config, response *responseDeduper, rootDirs func() *goInfo) (modifiedPkgs, needPkgs []string, err error) { + havePkgs := make(map[string]string) // importPath -> non-test package ID + needPkgsSet := make(map[string]bool) + modifiedPkgsSet := make(map[string]bool) + + for _, pkg := range response.dr.Packages { + // This is an approximation of import path to id. This can be + // wrong for tests, vendored packages, and a number of other cases. + havePkgs[pkg.PkgPath] = pkg.ID + } + + // If no new imports are added, it is safe to avoid loading any needPkgs. + // Otherwise, it's hard to tell which package is actually being loaded + // (due to vendoring) and whether any modified package will show up + // in the transitive set of dependencies (because new imports are added, + // potentially modifying the transitive set of dependencies). + var overlayAddsImports bool + + for opath, contents := range cfg.Overlay { + base := filepath.Base(opath) + dir := filepath.Dir(opath) + var pkg *Package // if opath belongs to both a package and its test variant, this will be the test variant + var testVariantOf *Package // if opath is a test file, this is the package it is testing + var fileExists bool + isTestFile := strings.HasSuffix(opath, "_test.go") + pkgName, ok := extractPackageName(opath, contents) + if !ok { + // Don't bother adding a file that doesn't even have a parsable package statement + // to the overlay. + continue + } + nextPackage: + for _, p := range response.dr.Packages { + if pkgName != p.Name && p.ID != "command-line-arguments" { + continue + } + for _, f := range p.GoFiles { + if !sameFile(filepath.Dir(f), dir) { + continue + } + // Make sure to capture information on the package's test variant, if needed. + if isTestFile && !hasTestFiles(p) { + // TODO(matloob): Are there packages other than the 'production' variant + // of a package that this can match? This shouldn't match the test main package + // because the file is generated in another directory. + testVariantOf = p + continue nextPackage + } + if pkg != nil && p != pkg && pkg.PkgPath == p.PkgPath { + // If we've already seen the test variant, + // make sure to label which package it is a test variant of. + if hasTestFiles(pkg) { + testVariantOf = p + continue nextPackage + } + // If we have already seen the package of which this is a test variant. + if hasTestFiles(p) { + testVariantOf = pkg + } + } + pkg = p + if filepath.Base(f) == base { + fileExists = true + } + } + } + // The overlay could have included an entirely new package. + if pkg == nil { + // Try to find the module or gopath dir the file is contained in. + // Then for modules, add the module opath to the beginning. + pkgPath, ok := getPkgPath(cfg, dir, rootDirs) + if !ok { + break + } + isXTest := strings.HasSuffix(pkgName, "_test") + if isXTest { + pkgPath += "_test" + } + id := pkgPath + if isTestFile && !isXTest { + id = fmt.Sprintf("%s [%s.test]", pkgPath, pkgPath) + } + // Try to reclaim a package with the same id if it exists in the response. + for _, p := range response.dr.Packages { + if reclaimPackage(p, id, opath, contents) { + pkg = p + break + } + } + // Otherwise, create a new package + if pkg == nil { + pkg = &Package{PkgPath: pkgPath, ID: id, Name: pkgName, Imports: make(map[string]*Package)} + response.addPackage(pkg) + havePkgs[pkg.PkgPath] = id + // Add the production package's sources for a test variant. + if isTestFile && !isXTest && testVariantOf != nil { + pkg.GoFiles = append(pkg.GoFiles, testVariantOf.GoFiles...) + pkg.CompiledGoFiles = append(pkg.CompiledGoFiles, testVariantOf.CompiledGoFiles...) + } + } + } + if !fileExists { + pkg.GoFiles = append(pkg.GoFiles, opath) + // TODO(matloob): Adding the file to CompiledGoFiles can exhibit the wrong behavior + // if the file will be ignored due to its build tags. + pkg.CompiledGoFiles = append(pkg.CompiledGoFiles, opath) + modifiedPkgsSet[pkg.ID] = true + } + imports, err := extractImports(opath, contents) + if err != nil { + // Let the parser or type checker report errors later. + continue + } + for _, imp := range imports { + _, found := pkg.Imports[imp] + if !found { + overlayAddsImports = true + // TODO(matloob): Handle cases when the following block isn't correct. + // These include imports of vendored packages, etc. + id, ok := havePkgs[imp] + if !ok { + id = imp + } + pkg.Imports[imp] = &Package{ID: id} + // Add dependencies to the non-test variant version of this package as wel. + if testVariantOf != nil { + testVariantOf.Imports[imp] = &Package{ID: id} + } + } + } + continue + } + + // toPkgPath tries to guess the package path given the id. + // This isn't always correct -- it's certainly wrong for + // vendored packages' paths. + toPkgPath := func(id string) string { + // TODO(matloob): Handle vendor paths. + i := strings.IndexByte(id, ' ') + if i >= 0 { + return id[:i] + } + return id + } + + // Do another pass now that new packages have been created to determine the + // set of missing packages. + for _, pkg := range response.dr.Packages { + for _, imp := range pkg.Imports { + pkgPath := toPkgPath(imp.ID) + if _, ok := havePkgs[pkgPath]; !ok { + needPkgsSet[pkgPath] = true + } + } + } + + if overlayAddsImports { + needPkgs = make([]string, 0, len(needPkgsSet)) + for pkg := range needPkgsSet { + needPkgs = append(needPkgs, pkg) + } + } + modifiedPkgs = make([]string, 0, len(modifiedPkgsSet)) + for pkg := range modifiedPkgsSet { + modifiedPkgs = append(modifiedPkgs, pkg) + } + return modifiedPkgs, needPkgs, err +} + +func hasTestFiles(p *Package) bool { + for _, f := range p.GoFiles { + if strings.HasSuffix(f, "_test.go") { + return true + } + } + return false +} + +// determineRootDirs returns a mapping from directories code can be contained in to the +// corresponding import path prefixes of those directories. +// Its result is used to try to determine the import path for a package containing +// an overlay file. +func determineRootDirs(cfg *Config) map[string]string { + // Assume modules first: + out, err := invokeGo(cfg, "list", "-m", "-json", "all") + if err != nil { + return determineRootDirsGOPATH(cfg) + } + m := map[string]string{} + type jsonMod struct{ Path, Dir string } + for dec := json.NewDecoder(out); dec.More(); { + mod := new(jsonMod) + if err := dec.Decode(mod); err != nil { + return m // Give up and return an empty map. Package won't be found for overlay. + } + if mod.Dir != "" && mod.Path != "" { + // This is a valid module; add it to the map. + m[mod.Dir] = mod.Path + } + } + return m +} + +func determineRootDirsGOPATH(cfg *Config) map[string]string { + m := map[string]string{} + out, err := invokeGo(cfg, "env", "GOPATH") + if err != nil { + // Could not determine root dir mapping. Everything is best-effort, so just return an empty map. + // When we try to find the import path for a directory, there will be no root-dir match and + // we'll give up. + return m + } + for _, p := range filepath.SplitList(string(bytes.TrimSpace(out.Bytes()))) { + m[filepath.Join(p, "src")] = "" + } + return m +} + +func extractImports(filename string, contents []byte) ([]string, error) { + f, err := parser.ParseFile(token.NewFileSet(), filename, contents, parser.ImportsOnly) // TODO(matloob): reuse fileset? + if err != nil { + return nil, err + } + var res []string + for _, imp := range f.Imports { + quotedPath := imp.Path.Value + path, err := strconv.Unquote(quotedPath) + if err != nil { + return nil, err + } + res = append(res, path) + } + return res, nil +} + +// reclaimPackage attempts to reuse a package that failed to load in an overlay. +// +// If the package has errors and has no Name, GoFiles, or Imports, +// then it's possible that it doesn't yet exist on disk. +func reclaimPackage(pkg *Package, id string, filename string, contents []byte) bool { + // TODO(rstambler): Check the message of the actual error? + // It differs between $GOPATH and module mode. + if pkg.ID != id { + return false + } + if len(pkg.Errors) != 1 { + return false + } + if pkg.Name != "" || pkg.ExportFile != "" { + return false + } + if len(pkg.GoFiles) > 0 || len(pkg.CompiledGoFiles) > 0 || len(pkg.OtherFiles) > 0 { + return false + } + if len(pkg.Imports) > 0 { + return false + } + pkgName, ok := extractPackageName(filename, contents) + if !ok { + return false + } + pkg.Name = pkgName + pkg.Errors = nil + return true +} + +func extractPackageName(filename string, contents []byte) (string, bool) { + // TODO(rstambler): Check the message of the actual error? + // It differs between $GOPATH and module mode. + f, err := parser.ParseFile(token.NewFileSet(), filename, contents, parser.PackageClauseOnly) // TODO(matloob): reuse fileset? + if err != nil { + return "", false + } + return f.Name.Name, true +} diff --git a/vendor/golang.org/x/tools/go/packages/packages.go b/vendor/golang.org/x/tools/go/packages/packages.go new file mode 100644 index 00000000..050cca43 --- /dev/null +++ b/vendor/golang.org/x/tools/go/packages/packages.go @@ -0,0 +1,1116 @@ +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package packages + +// See doc.go for package documentation and implementation notes. + +import ( + "context" + "encoding/json" + "fmt" + "go/ast" + "go/parser" + "go/scanner" + "go/token" + "go/types" + "io/ioutil" + "log" + "os" + "path/filepath" + "strings" + "sync" + + "golang.org/x/tools/go/gcexportdata" +) + +// A LoadMode controls the amount of detail to return when loading. +// The bits below can be combined to specify which fields should be +// filled in the result packages. +// The zero value is a special case, equivalent to combining +// the NeedName, NeedFiles, and NeedCompiledGoFiles bits. +// ID and Errors (if present) will always be filled. +// Load may return more information than requested. +type LoadMode int + +const ( + // NeedName adds Name and PkgPath. + NeedName LoadMode = 1 << iota + + // NeedFiles adds GoFiles and OtherFiles. + NeedFiles + + // NeedCompiledGoFiles adds CompiledGoFiles. + NeedCompiledGoFiles + + // NeedImports adds Imports. If NeedDeps is not set, the Imports field will contain + // "placeholder" Packages with only the ID set. + NeedImports + + // NeedDeps adds the fields requested by the LoadMode in the packages in Imports. + NeedDeps + + // NeedExportsFile adds ExportsFile. + NeedExportsFile + + // NeedTypes adds Types, Fset, and IllTyped. + NeedTypes + + // NeedSyntax adds Syntax. + NeedSyntax + + // NeedTypesInfo adds TypesInfo. + NeedTypesInfo + + // NeedTypesSizes adds TypesSizes. + NeedTypesSizes +) + +const ( + // Deprecated: LoadFiles exists for historical compatibility + // and should not be used. Please directly specify the needed fields using the Need values. + LoadFiles = NeedName | NeedFiles | NeedCompiledGoFiles + + // Deprecated: LoadImports exists for historical compatibility + // and should not be used. Please directly specify the needed fields using the Need values. + LoadImports = LoadFiles | NeedImports + + // Deprecated: LoadTypes exists for historical compatibility + // and should not be used. Please directly specify the needed fields using the Need values. + LoadTypes = LoadImports | NeedTypes | NeedTypesSizes + + // Deprecated: LoadSyntax exists for historical compatibility + // and should not be used. Please directly specify the needed fields using the Need values. + LoadSyntax = LoadTypes | NeedSyntax | NeedTypesInfo + + // Deprecated: LoadAllSyntax exists for historical compatibility + // and should not be used. Please directly specify the needed fields using the Need values. + LoadAllSyntax = LoadSyntax | NeedDeps +) + +// A Config specifies details about how packages should be loaded. +// The zero value is a valid configuration. +// Calls to Load do not modify this struct. +type Config struct { + // Mode controls the level of information returned for each package. + Mode LoadMode + + // Context specifies the context for the load operation. + // If the context is cancelled, the loader may stop early + // and return an ErrCancelled error. + // If Context is nil, the load cannot be cancelled. + Context context.Context + + // Logf is the logger for the config. + // If the user provides a logger, debug logging is enabled. + // If the GOPACKAGESDEBUG environment variable is set to true, + // but the logger is nil, default to log.Printf. + Logf func(format string, args ...interface{}) + + // Dir is the directory in which to run the build system's query tool + // that provides information about the packages. + // If Dir is empty, the tool is run in the current directory. + Dir string + + // Env is the environment to use when invoking the build system's query tool. + // If Env is nil, the current environment is used. + // As in os/exec's Cmd, only the last value in the slice for + // each environment key is used. To specify the setting of only + // a few variables, append to the current environment, as in: + // + // opt.Env = append(os.Environ(), "GOOS=plan9", "GOARCH=386") + // + Env []string + + // BuildFlags is a list of command-line flags to be passed through to + // the build system's query tool. + BuildFlags []string + + // Fset provides source position information for syntax trees and types. + // If Fset is nil, Load will use a new fileset, but preserve Fset's value. + Fset *token.FileSet + + // ParseFile is called to read and parse each file + // when preparing a package's type-checked syntax tree. + // It must be safe to call ParseFile simultaneously from multiple goroutines. + // If ParseFile is nil, the loader will uses parser.ParseFile. + // + // ParseFile should parse the source from src and use filename only for + // recording position information. + // + // An application may supply a custom implementation of ParseFile + // to change the effective file contents or the behavior of the parser, + // or to modify the syntax tree. For example, selectively eliminating + // unwanted function bodies can significantly accelerate type checking. + ParseFile func(fset *token.FileSet, filename string, src []byte) (*ast.File, error) + + // If Tests is set, the loader includes not just the packages + // matching a particular pattern but also any related test packages, + // including test-only variants of the package and the test executable. + // + // For example, when using the go command, loading "fmt" with Tests=true + // returns four packages, with IDs "fmt" (the standard package), + // "fmt [fmt.test]" (the package as compiled for the test), + // "fmt_test" (the test functions from source files in package fmt_test), + // and "fmt.test" (the test binary). + // + // In build systems with explicit names for tests, + // setting Tests may have no effect. + Tests bool + + // Overlay provides a mapping of absolute file paths to file contents. + // If the file with the given path already exists, the parser will use the + // alternative file contents provided by the map. + // + // Overlays provide incomplete support for when a given file doesn't + // already exist on disk. See the package doc above for more details. + Overlay map[string][]byte +} + +// driver is the type for functions that query the build system for the +// packages named by the patterns. +type driver func(cfg *Config, patterns ...string) (*driverResponse, error) + +// driverResponse contains the results for a driver query. +type driverResponse struct { + // Sizes, if not nil, is the types.Sizes to use when type checking. + Sizes *types.StdSizes + + // Roots is the set of package IDs that make up the root packages. + // We have to encode this separately because when we encode a single package + // we cannot know if it is one of the roots as that requires knowledge of the + // graph it is part of. + Roots []string `json:",omitempty"` + + // Packages is the full set of packages in the graph. + // The packages are not connected into a graph. + // The Imports if populated will be stubs that only have their ID set. + // Imports will be connected and then type and syntax information added in a + // later pass (see refine). + Packages []*Package +} + +// Load loads and returns the Go packages named by the given patterns. +// +// Config specifies loading options; +// nil behaves the same as an empty Config. +// +// Load returns an error if any of the patterns was invalid +// as defined by the underlying build system. +// It may return an empty list of packages without an error, +// for instance for an empty expansion of a valid wildcard. +// Errors associated with a particular package are recorded in the +// corresponding Package's Errors list, and do not cause Load to +// return an error. Clients may need to handle such errors before +// proceeding with further analysis. The PrintErrors function is +// provided for convenient display of all errors. +func Load(cfg *Config, patterns ...string) ([]*Package, error) { + l := newLoader(cfg) + response, err := defaultDriver(&l.Config, patterns...) + if err != nil { + return nil, err + } + l.sizes = response.Sizes + return l.refine(response.Roots, response.Packages...) +} + +// defaultDriver is a driver that looks for an external driver binary, and if +// it does not find it falls back to the built in go list driver. +func defaultDriver(cfg *Config, patterns ...string) (*driverResponse, error) { + driver := findExternalDriver(cfg) + if driver == nil { + driver = goListDriver + } + return driver(cfg, patterns...) +} + +// A Package describes a loaded Go package. +type Package struct { + // ID is a unique identifier for a package, + // in a syntax provided by the underlying build system. + // + // Because the syntax varies based on the build system, + // clients should treat IDs as opaque and not attempt to + // interpret them. + ID string + + // Name is the package name as it appears in the package source code. + Name string + + // PkgPath is the package path as used by the go/types package. + PkgPath string + + // Errors contains any errors encountered querying the metadata + // of the package, or while parsing or type-checking its files. + Errors []Error + + // GoFiles lists the absolute file paths of the package's Go source files. + GoFiles []string + + // CompiledGoFiles lists the absolute file paths of the package's source + // files that were presented to the compiler. + // This may differ from GoFiles if files are processed before compilation. + CompiledGoFiles []string + + // OtherFiles lists the absolute file paths of the package's non-Go source files, + // including assembly, C, C++, Fortran, Objective-C, SWIG, and so on. + OtherFiles []string + + // ExportFile is the absolute path to a file containing type + // information for the package as provided by the build system. + ExportFile string + + // Imports maps import paths appearing in the package's Go source files + // to corresponding loaded Packages. + Imports map[string]*Package + + // Types provides type information for the package. + // The NeedTypes LoadMode bit sets this field for packages matching the + // patterns; type information for dependencies may be missing or incomplete, + // unless NeedDeps and NeedImports are also set. + Types *types.Package + + // Fset provides position information for Types, TypesInfo, and Syntax. + // It is set only when Types is set. + Fset *token.FileSet + + // IllTyped indicates whether the package or any dependency contains errors. + // It is set only when Types is set. + IllTyped bool + + // Syntax is the package's syntax trees, for the files listed in CompiledGoFiles. + // + // The NeedSyntax LoadMode bit populates this field for packages matching the patterns. + // If NeedDeps and NeedImports are also set, this field will also be populated + // for dependencies. + Syntax []*ast.File + + // TypesInfo provides type information about the package's syntax trees. + // It is set only when Syntax is set. + TypesInfo *types.Info + + // TypesSizes provides the effective size function for types in TypesInfo. + TypesSizes types.Sizes +} + +// An Error describes a problem with a package's metadata, syntax, or types. +type Error struct { + Pos string // "file:line:col" or "file:line" or "" or "-" + Msg string + Kind ErrorKind +} + +// ErrorKind describes the source of the error, allowing the user to +// differentiate between errors generated by the driver, the parser, or the +// type-checker. +type ErrorKind int + +const ( + UnknownError ErrorKind = iota + ListError + ParseError + TypeError +) + +func (err Error) Error() string { + pos := err.Pos + if pos == "" { + pos = "-" // like token.Position{}.String() + } + return pos + ": " + err.Msg +} + +// flatPackage is the JSON form of Package +// It drops all the type and syntax fields, and transforms the Imports +// +// TODO(adonovan): identify this struct with Package, effectively +// publishing the JSON protocol. +type flatPackage struct { + ID string + Name string `json:",omitempty"` + PkgPath string `json:",omitempty"` + Errors []Error `json:",omitempty"` + GoFiles []string `json:",omitempty"` + CompiledGoFiles []string `json:",omitempty"` + OtherFiles []string `json:",omitempty"` + ExportFile string `json:",omitempty"` + Imports map[string]string `json:",omitempty"` +} + +// MarshalJSON returns the Package in its JSON form. +// For the most part, the structure fields are written out unmodified, and +// the type and syntax fields are skipped. +// The imports are written out as just a map of path to package id. +// The errors are written using a custom type that tries to preserve the +// structure of error types we know about. +// +// This method exists to enable support for additional build systems. It is +// not intended for use by clients of the API and we may change the format. +func (p *Package) MarshalJSON() ([]byte, error) { + flat := &flatPackage{ + ID: p.ID, + Name: p.Name, + PkgPath: p.PkgPath, + Errors: p.Errors, + GoFiles: p.GoFiles, + CompiledGoFiles: p.CompiledGoFiles, + OtherFiles: p.OtherFiles, + ExportFile: p.ExportFile, + } + if len(p.Imports) > 0 { + flat.Imports = make(map[string]string, len(p.Imports)) + for path, ipkg := range p.Imports { + flat.Imports[path] = ipkg.ID + } + } + return json.Marshal(flat) +} + +// UnmarshalJSON reads in a Package from its JSON format. +// See MarshalJSON for details about the format accepted. +func (p *Package) UnmarshalJSON(b []byte) error { + flat := &flatPackage{} + if err := json.Unmarshal(b, &flat); err != nil { + return err + } + *p = Package{ + ID: flat.ID, + Name: flat.Name, + PkgPath: flat.PkgPath, + Errors: flat.Errors, + GoFiles: flat.GoFiles, + CompiledGoFiles: flat.CompiledGoFiles, + OtherFiles: flat.OtherFiles, + ExportFile: flat.ExportFile, + } + if len(flat.Imports) > 0 { + p.Imports = make(map[string]*Package, len(flat.Imports)) + for path, id := range flat.Imports { + p.Imports[path] = &Package{ID: id} + } + } + return nil +} + +func (p *Package) String() string { return p.ID } + +// loaderPackage augments Package with state used during the loading phase +type loaderPackage struct { + *Package + importErrors map[string]error // maps each bad import to its error + loadOnce sync.Once + color uint8 // for cycle detection + needsrc bool // load from source (Mode >= LoadTypes) + needtypes bool // type information is either requested or depended on + initial bool // package was matched by a pattern +} + +// loader holds the working state of a single call to load. +type loader struct { + pkgs map[string]*loaderPackage + Config + sizes types.Sizes + parseCache map[string]*parseValue + parseCacheMu sync.Mutex + exportMu sync.Mutex // enforces mutual exclusion of exportdata operations + + // Config.Mode contains the implied mode (see impliedLoadMode). + // Implied mode contains all the fields we need the data for. + // In requestedMode there are the actually requested fields. + // We'll zero them out before returning packages to the user. + // This makes it easier for us to get the conditions where + // we need certain modes right. + requestedMode LoadMode +} + +type parseValue struct { + f *ast.File + err error + ready chan struct{} +} + +func newLoader(cfg *Config) *loader { + ld := &loader{ + parseCache: map[string]*parseValue{}, + } + if cfg != nil { + ld.Config = *cfg + // If the user has provided a logger, use it. + ld.Config.Logf = cfg.Logf + } + if ld.Config.Logf == nil { + // If the GOPACKAGESDEBUG environment variable is set to true, + // but the user has not provided a logger, default to log.Printf. + if debug { + ld.Config.Logf = log.Printf + } else { + ld.Config.Logf = func(format string, args ...interface{}) {} + } + } + if ld.Config.Mode == 0 { + ld.Config.Mode = NeedName | NeedFiles | NeedCompiledGoFiles // Preserve zero behavior of Mode for backwards compatibility. + } + if ld.Config.Env == nil { + ld.Config.Env = os.Environ() + } + if ld.Context == nil { + ld.Context = context.Background() + } + if ld.Dir == "" { + if dir, err := os.Getwd(); err == nil { + ld.Dir = dir + } + } + + // Save the actually requested fields. We'll zero them out before returning packages to the user. + ld.requestedMode = ld.Mode + ld.Mode = impliedLoadMode(ld.Mode) + + if ld.Mode&NeedTypes != 0 || ld.Mode&NeedSyntax != 0 { + if ld.Fset == nil { + ld.Fset = token.NewFileSet() + } + + // ParseFile is required even in LoadTypes mode + // because we load source if export data is missing. + if ld.ParseFile == nil { + ld.ParseFile = func(fset *token.FileSet, filename string, src []byte) (*ast.File, error) { + const mode = parser.AllErrors | parser.ParseComments + return parser.ParseFile(fset, filename, src, mode) + } + } + } + + return ld +} + +// refine connects the supplied packages into a graph and then adds type and +// and syntax information as requested by the LoadMode. +func (ld *loader) refine(roots []string, list ...*Package) ([]*Package, error) { + rootMap := make(map[string]int, len(roots)) + for i, root := range roots { + rootMap[root] = i + } + ld.pkgs = make(map[string]*loaderPackage) + // first pass, fixup and build the map and roots + var initial = make([]*loaderPackage, len(roots)) + for _, pkg := range list { + rootIndex := -1 + if i, found := rootMap[pkg.ID]; found { + rootIndex = i + } + lpkg := &loaderPackage{ + Package: pkg, + needtypes: (ld.Mode&(NeedTypes|NeedTypesInfo) != 0 && ld.Mode&NeedDeps != 0 && rootIndex < 0) || rootIndex >= 0, + needsrc: (ld.Mode&(NeedSyntax|NeedTypesInfo) != 0 && ld.Mode&NeedDeps != 0 && rootIndex < 0) || rootIndex >= 0 || + len(ld.Overlay) > 0 || // Overlays can invalidate export data. TODO(matloob): make this check fine-grained based on dependencies on overlaid files + pkg.ExportFile == "" && pkg.PkgPath != "unsafe", + } + ld.pkgs[lpkg.ID] = lpkg + if rootIndex >= 0 { + initial[rootIndex] = lpkg + lpkg.initial = true + } + } + for i, root := range roots { + if initial[i] == nil { + return nil, fmt.Errorf("root package %v is missing", root) + } + } + + // Materialize the import graph. + + const ( + white = 0 // new + grey = 1 // in progress + black = 2 // complete + ) + + // visit traverses the import graph, depth-first, + // and materializes the graph as Packages.Imports. + // + // Valid imports are saved in the Packages.Import map. + // Invalid imports (cycles and missing nodes) are saved in the importErrors map. + // Thus, even in the presence of both kinds of errors, the Import graph remains a DAG. + // + // visit returns whether the package needs src or has a transitive + // dependency on a package that does. These are the only packages + // for which we load source code. + var stack []*loaderPackage + var visit func(lpkg *loaderPackage) bool + var srcPkgs []*loaderPackage + visit = func(lpkg *loaderPackage) bool { + switch lpkg.color { + case black: + return lpkg.needsrc + case grey: + panic("internal error: grey node") + } + lpkg.color = grey + stack = append(stack, lpkg) // push + stubs := lpkg.Imports // the structure form has only stubs with the ID in the Imports + // If NeedImports isn't set, the imports fields will all be zeroed out. + if ld.Mode&NeedImports != 0 { + lpkg.Imports = make(map[string]*Package, len(stubs)) + for importPath, ipkg := range stubs { + var importErr error + imp := ld.pkgs[ipkg.ID] + if imp == nil { + // (includes package "C" when DisableCgo) + importErr = fmt.Errorf("missing package: %q", ipkg.ID) + } else if imp.color == grey { + importErr = fmt.Errorf("import cycle: %s", stack) + } + if importErr != nil { + if lpkg.importErrors == nil { + lpkg.importErrors = make(map[string]error) + } + lpkg.importErrors[importPath] = importErr + continue + } + + if visit(imp) { + lpkg.needsrc = true + } + lpkg.Imports[importPath] = imp.Package + } + } + if lpkg.needsrc { + srcPkgs = append(srcPkgs, lpkg) + } + if ld.Mode&NeedTypesSizes != 0 { + lpkg.TypesSizes = ld.sizes + } + stack = stack[:len(stack)-1] // pop + lpkg.color = black + + return lpkg.needsrc + } + + if ld.Mode&NeedImports == 0 { + // We do this to drop the stub import packages that we are not even going to try to resolve. + for _, lpkg := range initial { + lpkg.Imports = nil + } + } else { + // For each initial package, create its import DAG. + for _, lpkg := range initial { + visit(lpkg) + } + } + if ld.Mode&NeedImports != 0 && ld.Mode&NeedTypes != 0 { + for _, lpkg := range srcPkgs { + // Complete type information is required for the + // immediate dependencies of each source package. + for _, ipkg := range lpkg.Imports { + imp := ld.pkgs[ipkg.ID] + imp.needtypes = true + } + } + } + // Load type data and syntax if needed, starting at + // the initial packages (roots of the import DAG). + if ld.Mode&NeedTypes != 0 || ld.Mode&NeedSyntax != 0 { + var wg sync.WaitGroup + for _, lpkg := range initial { + wg.Add(1) + go func(lpkg *loaderPackage) { + ld.loadRecursive(lpkg) + wg.Done() + }(lpkg) + } + wg.Wait() + } + + result := make([]*Package, len(initial)) + for i, lpkg := range initial { + result[i] = lpkg.Package + } + for i := range ld.pkgs { + // Clear all unrequested fields, for extra de-Hyrum-ization. + if ld.requestedMode&NeedName == 0 { + ld.pkgs[i].Name = "" + ld.pkgs[i].PkgPath = "" + } + if ld.requestedMode&NeedFiles == 0 { + ld.pkgs[i].GoFiles = nil + ld.pkgs[i].OtherFiles = nil + } + if ld.requestedMode&NeedCompiledGoFiles == 0 { + ld.pkgs[i].CompiledGoFiles = nil + } + if ld.requestedMode&NeedImports == 0 { + ld.pkgs[i].Imports = nil + } + if ld.requestedMode&NeedExportsFile == 0 { + ld.pkgs[i].ExportFile = "" + } + if ld.requestedMode&NeedTypes == 0 { + ld.pkgs[i].Types = nil + ld.pkgs[i].Fset = nil + ld.pkgs[i].IllTyped = false + } + if ld.requestedMode&NeedSyntax == 0 { + ld.pkgs[i].Syntax = nil + } + if ld.requestedMode&NeedTypesInfo == 0 { + ld.pkgs[i].TypesInfo = nil + } + if ld.requestedMode&NeedTypesSizes == 0 { + ld.pkgs[i].TypesSizes = nil + } + } + + return result, nil +} + +// loadRecursive loads the specified package and its dependencies, +// recursively, in parallel, in topological order. +// It is atomic and idempotent. +// Precondition: ld.Mode&NeedTypes. +func (ld *loader) loadRecursive(lpkg *loaderPackage) { + lpkg.loadOnce.Do(func() { + // Load the direct dependencies, in parallel. + var wg sync.WaitGroup + for _, ipkg := range lpkg.Imports { + imp := ld.pkgs[ipkg.ID] + wg.Add(1) + go func(imp *loaderPackage) { + ld.loadRecursive(imp) + wg.Done() + }(imp) + } + wg.Wait() + ld.loadPackage(lpkg) + }) +} + +// loadPackage loads the specified package. +// It must be called only once per Package, +// after immediate dependencies are loaded. +// Precondition: ld.Mode & NeedTypes. +func (ld *loader) loadPackage(lpkg *loaderPackage) { + if lpkg.PkgPath == "unsafe" { + // Fill in the blanks to avoid surprises. + lpkg.Types = types.Unsafe + lpkg.Fset = ld.Fset + lpkg.Syntax = []*ast.File{} + lpkg.TypesInfo = new(types.Info) + lpkg.TypesSizes = ld.sizes + return + } + + // Call NewPackage directly with explicit name. + // This avoids skew between golist and go/types when the files' + // package declarations are inconsistent. + lpkg.Types = types.NewPackage(lpkg.PkgPath, lpkg.Name) + lpkg.Fset = ld.Fset + + // Subtle: we populate all Types fields with an empty Package + // before loading export data so that export data processing + // never has to create a types.Package for an indirect dependency, + // which would then require that such created packages be explicitly + // inserted back into the Import graph as a final step after export data loading. + // The Diamond test exercises this case. + if !lpkg.needtypes { + return + } + if !lpkg.needsrc { + ld.loadFromExportData(lpkg) + return // not a source package, don't get syntax trees + } + + appendError := func(err error) { + // Convert various error types into the one true Error. + var errs []Error + switch err := err.(type) { + case Error: + // from driver + errs = append(errs, err) + + case *os.PathError: + // from parser + errs = append(errs, Error{ + Pos: err.Path + ":1", + Msg: err.Err.Error(), + Kind: ParseError, + }) + + case scanner.ErrorList: + // from parser + for _, err := range err { + errs = append(errs, Error{ + Pos: err.Pos.String(), + Msg: err.Msg, + Kind: ParseError, + }) + } + + case types.Error: + // from type checker + errs = append(errs, Error{ + Pos: err.Fset.Position(err.Pos).String(), + Msg: err.Msg, + Kind: TypeError, + }) + + default: + // unexpected impoverished error from parser? + errs = append(errs, Error{ + Pos: "-", + Msg: err.Error(), + Kind: UnknownError, + }) + + // If you see this error message, please file a bug. + log.Printf("internal error: error %q (%T) without position", err, err) + } + + lpkg.Errors = append(lpkg.Errors, errs...) + } + + if ld.Config.Mode&NeedTypes != 0 && len(lpkg.CompiledGoFiles) == 0 && lpkg.ExportFile != "" { + // The config requested loading sources and types, but sources are missing. + // Add an error to the package and fall back to loading from export data. + appendError(Error{"-", fmt.Sprintf("sources missing for package %s", lpkg.ID), ParseError}) + ld.loadFromExportData(lpkg) + return // can't get syntax trees for this package + } + + files, errs := ld.parseFiles(lpkg.CompiledGoFiles) + for _, err := range errs { + appendError(err) + } + + lpkg.Syntax = files + if ld.Config.Mode&NeedTypes == 0 { + return + } + + lpkg.TypesInfo = &types.Info{ + Types: make(map[ast.Expr]types.TypeAndValue), + Defs: make(map[*ast.Ident]types.Object), + Uses: make(map[*ast.Ident]types.Object), + Implicits: make(map[ast.Node]types.Object), + Scopes: make(map[ast.Node]*types.Scope), + Selections: make(map[*ast.SelectorExpr]*types.Selection), + } + lpkg.TypesSizes = ld.sizes + + importer := importerFunc(func(path string) (*types.Package, error) { + if path == "unsafe" { + return types.Unsafe, nil + } + + // The imports map is keyed by import path. + ipkg := lpkg.Imports[path] + if ipkg == nil { + if err := lpkg.importErrors[path]; err != nil { + return nil, err + } + // There was skew between the metadata and the + // import declarations, likely due to an edit + // race, or because the ParseFile feature was + // used to supply alternative file contents. + return nil, fmt.Errorf("no metadata for %s", path) + } + + if ipkg.Types != nil && ipkg.Types.Complete() { + return ipkg.Types, nil + } + log.Fatalf("internal error: package %q without types was imported from %q", path, lpkg) + panic("unreachable") + }) + + // type-check + tc := &types.Config{ + Importer: importer, + + // Type-check bodies of functions only in non-initial packages. + // Example: for import graph A->B->C and initial packages {A,C}, + // we can ignore function bodies in B. + IgnoreFuncBodies: ld.Mode&NeedDeps == 0 && !lpkg.initial, + + Error: appendError, + Sizes: ld.sizes, + } + types.NewChecker(tc, ld.Fset, lpkg.Types, lpkg.TypesInfo).Files(lpkg.Syntax) + + lpkg.importErrors = nil // no longer needed + + // If !Cgo, the type-checker uses FakeImportC mode, so + // it doesn't invoke the importer for import "C", + // nor report an error for the import, + // or for any undefined C.f reference. + // We must detect this explicitly and correctly + // mark the package as IllTyped (by reporting an error). + // TODO(adonovan): if these errors are annoying, + // we could just set IllTyped quietly. + if tc.FakeImportC { + outer: + for _, f := range lpkg.Syntax { + for _, imp := range f.Imports { + if imp.Path.Value == `"C"` { + err := types.Error{Fset: ld.Fset, Pos: imp.Pos(), Msg: `import "C" ignored`} + appendError(err) + break outer + } + } + } + } + + // Record accumulated errors. + illTyped := len(lpkg.Errors) > 0 + if !illTyped { + for _, imp := range lpkg.Imports { + if imp.IllTyped { + illTyped = true + break + } + } + } + lpkg.IllTyped = illTyped +} + +// An importFunc is an implementation of the single-method +// types.Importer interface based on a function value. +type importerFunc func(path string) (*types.Package, error) + +func (f importerFunc) Import(path string) (*types.Package, error) { return f(path) } + +// We use a counting semaphore to limit +// the number of parallel I/O calls per process. +var ioLimit = make(chan bool, 20) + +func (ld *loader) parseFile(filename string) (*ast.File, error) { + ld.parseCacheMu.Lock() + v, ok := ld.parseCache[filename] + if ok { + // cache hit + ld.parseCacheMu.Unlock() + <-v.ready + } else { + // cache miss + v = &parseValue{ready: make(chan struct{})} + ld.parseCache[filename] = v + ld.parseCacheMu.Unlock() + + var src []byte + for f, contents := range ld.Config.Overlay { + if sameFile(f, filename) { + src = contents + } + } + var err error + if src == nil { + ioLimit <- true // wait + src, err = ioutil.ReadFile(filename) + <-ioLimit // signal + } + if err != nil { + v.err = err + } else { + v.f, v.err = ld.ParseFile(ld.Fset, filename, src) + } + + close(v.ready) + } + return v.f, v.err +} + +// parseFiles reads and parses the Go source files and returns the ASTs +// of the ones that could be at least partially parsed, along with a +// list of I/O and parse errors encountered. +// +// Because files are scanned in parallel, the token.Pos +// positions of the resulting ast.Files are not ordered. +// +func (ld *loader) parseFiles(filenames []string) ([]*ast.File, []error) { + var wg sync.WaitGroup + n := len(filenames) + parsed := make([]*ast.File, n) + errors := make([]error, n) + for i, file := range filenames { + if ld.Config.Context.Err() != nil { + parsed[i] = nil + errors[i] = ld.Config.Context.Err() + continue + } + wg.Add(1) + go func(i int, filename string) { + parsed[i], errors[i] = ld.parseFile(filename) + wg.Done() + }(i, file) + } + wg.Wait() + + // Eliminate nils, preserving order. + var o int + for _, f := range parsed { + if f != nil { + parsed[o] = f + o++ + } + } + parsed = parsed[:o] + + o = 0 + for _, err := range errors { + if err != nil { + errors[o] = err + o++ + } + } + errors = errors[:o] + + return parsed, errors +} + +// sameFile returns true if x and y have the same basename and denote +// the same file. +// +func sameFile(x, y string) bool { + if x == y { + // It could be the case that y doesn't exist. + // For instance, it may be an overlay file that + // hasn't been written to disk. To handle that case + // let x == y through. (We added the exact absolute path + // string to the CompiledGoFiles list, so the unwritten + // overlay case implies x==y.) + return true + } + if strings.EqualFold(filepath.Base(x), filepath.Base(y)) { // (optimisation) + if xi, err := os.Stat(x); err == nil { + if yi, err := os.Stat(y); err == nil { + return os.SameFile(xi, yi) + } + } + } + return false +} + +// loadFromExportData returns type information for the specified +// package, loading it from an export data file on the first request. +func (ld *loader) loadFromExportData(lpkg *loaderPackage) (*types.Package, error) { + if lpkg.PkgPath == "" { + log.Fatalf("internal error: Package %s has no PkgPath", lpkg) + } + + // Because gcexportdata.Read has the potential to create or + // modify the types.Package for each node in the transitive + // closure of dependencies of lpkg, all exportdata operations + // must be sequential. (Finer-grained locking would require + // changes to the gcexportdata API.) + // + // The exportMu lock guards the Package.Pkg field and the + // types.Package it points to, for each Package in the graph. + // + // Not all accesses to Package.Pkg need to be protected by exportMu: + // graph ordering ensures that direct dependencies of source + // packages are fully loaded before the importer reads their Pkg field. + ld.exportMu.Lock() + defer ld.exportMu.Unlock() + + if tpkg := lpkg.Types; tpkg != nil && tpkg.Complete() { + return tpkg, nil // cache hit + } + + lpkg.IllTyped = true // fail safe + + if lpkg.ExportFile == "" { + // Errors while building export data will have been printed to stderr. + return nil, fmt.Errorf("no export data file") + } + f, err := os.Open(lpkg.ExportFile) + if err != nil { + return nil, err + } + defer f.Close() + + // Read gc export data. + // + // We don't currently support gccgo export data because all + // underlying workspaces use the gc toolchain. (Even build + // systems that support gccgo don't use it for workspace + // queries.) + r, err := gcexportdata.NewReader(f) + if err != nil { + return nil, fmt.Errorf("reading %s: %v", lpkg.ExportFile, err) + } + + // Build the view. + // + // The gcexportdata machinery has no concept of package ID. + // It identifies packages by their PkgPath, which although not + // globally unique is unique within the scope of one invocation + // of the linker, type-checker, or gcexportdata. + // + // So, we must build a PkgPath-keyed view of the global + // (conceptually ID-keyed) cache of packages and pass it to + // gcexportdata. The view must contain every existing + // package that might possibly be mentioned by the + // current package---its transitive closure. + // + // In loadPackage, we unconditionally create a types.Package for + // each dependency so that export data loading does not + // create new ones. + // + // TODO(adonovan): it would be simpler and more efficient + // if the export data machinery invoked a callback to + // get-or-create a package instead of a map. + // + view := make(map[string]*types.Package) // view seen by gcexportdata + seen := make(map[*loaderPackage]bool) // all visited packages + var visit func(pkgs map[string]*Package) + visit = func(pkgs map[string]*Package) { + for _, p := range pkgs { + lpkg := ld.pkgs[p.ID] + if !seen[lpkg] { + seen[lpkg] = true + view[lpkg.PkgPath] = lpkg.Types + visit(lpkg.Imports) + } + } + } + visit(lpkg.Imports) + + viewLen := len(view) + 1 // adding the self package + // Parse the export data. + // (May modify incomplete packages in view but not create new ones.) + tpkg, err := gcexportdata.Read(r, ld.Fset, view, lpkg.PkgPath) + if err != nil { + return nil, fmt.Errorf("reading %s: %v", lpkg.ExportFile, err) + } + if viewLen != len(view) { + log.Fatalf("Unexpected package creation during export data loading") + } + + lpkg.Types = tpkg + lpkg.IllTyped = false + + return tpkg, nil +} + +// impliedLoadMode returns loadMode with its dependencies. +func impliedLoadMode(loadMode LoadMode) LoadMode { + if loadMode&NeedTypesInfo != 0 && loadMode&NeedImports == 0 { + // If NeedTypesInfo, go/packages needs to do typechecking itself so it can + // associate type info with the AST. To do so, we need the export data + // for dependencies, which means we need to ask for the direct dependencies. + // NeedImports is used to ask for the direct dependencies. + loadMode |= NeedImports + } + + if loadMode&NeedDeps != 0 && loadMode&NeedImports == 0 { + // With NeedDeps we need to load at least direct dependencies. + // NeedImports is used to ask for the direct dependencies. + loadMode |= NeedImports + } + + return loadMode +} + +func usesExportData(cfg *Config) bool { + return cfg.Mode&NeedExportsFile != 0 || cfg.Mode&NeedTypes != 0 && cfg.Mode&NeedDeps == 0 +} diff --git a/vendor/golang.org/x/tools/go/packages/visit.go b/vendor/golang.org/x/tools/go/packages/visit.go new file mode 100644 index 00000000..b13cb081 --- /dev/null +++ b/vendor/golang.org/x/tools/go/packages/visit.go @@ -0,0 +1,55 @@ +package packages + +import ( + "fmt" + "os" + "sort" +) + +// Visit visits all the packages in the import graph whose roots are +// pkgs, calling the optional pre function the first time each package +// is encountered (preorder), and the optional post function after a +// package's dependencies have been visited (postorder). +// The boolean result of pre(pkg) determines whether +// the imports of package pkg are visited. +func Visit(pkgs []*Package, pre func(*Package) bool, post func(*Package)) { + seen := make(map[*Package]bool) + var visit func(*Package) + visit = func(pkg *Package) { + if !seen[pkg] { + seen[pkg] = true + + if pre == nil || pre(pkg) { + paths := make([]string, 0, len(pkg.Imports)) + for path := range pkg.Imports { + paths = append(paths, path) + } + sort.Strings(paths) // Imports is a map, this makes visit stable + for _, path := range paths { + visit(pkg.Imports[path]) + } + } + + if post != nil { + post(pkg) + } + } + } + for _, pkg := range pkgs { + visit(pkg) + } +} + +// PrintErrors prints to os.Stderr the accumulated errors of all +// packages in the import graph rooted at pkgs, dependencies first. +// PrintErrors returns the number of errors printed. +func PrintErrors(pkgs []*Package) int { + var n int + Visit(pkgs, nil, func(pkg *Package) { + for _, err := range pkg.Errors { + fmt.Fprintln(os.Stderr, err) + n++ + } + }) + return n +} diff --git a/vendor/golang.org/x/tools/imports/forward.go b/vendor/golang.org/x/tools/imports/forward.go new file mode 100644 index 00000000..eef25969 --- /dev/null +++ b/vendor/golang.org/x/tools/imports/forward.go @@ -0,0 +1,62 @@ +// Package imports implements a Go pretty-printer (like package "go/format") +// that also adds or removes import statements as necessary. +package imports // import "golang.org/x/tools/imports" + +import ( + "go/build" + + intimp "golang.org/x/tools/internal/imports" +) + +// Options specifies options for processing files. +type Options struct { + Fragment bool // Accept fragment of a source file (no package statement) + AllErrors bool // Report all errors (not just the first 10 on different lines) + + Comments bool // Print comments (true if nil *Options provided) + TabIndent bool // Use tabs for indent (true if nil *Options provided) + TabWidth int // Tab width (8 if nil *Options provided) + + FormatOnly bool // Disable the insertion and deletion of imports +} + +// Debug controls verbose logging. +var Debug = false + +// LocalPrefix is a comma-separated string of import path prefixes, which, if +// set, instructs Process to sort the import paths with the given prefixes +// into another group after 3rd-party packages. +var LocalPrefix string + +// Process formats and adjusts imports for the provided file. +// If opt is nil the defaults are used. +// +// Note that filename's directory influences which imports can be chosen, +// so it is important that filename be accurate. +// To process data ``as if'' it were in filename, pass the data as a non-nil src. +func Process(filename string, src []byte, opt *Options) ([]byte, error) { + if opt == nil { + opt = &Options{Comments: true, TabIndent: true, TabWidth: 8} + } + intopt := &intimp.Options{ + Env: &intimp.ProcessEnv{ + GOPATH: build.Default.GOPATH, + GOROOT: build.Default.GOROOT, + Debug: Debug, + LocalPrefix: LocalPrefix, + }, + AllErrors: opt.AllErrors, + Comments: opt.Comments, + FormatOnly: opt.FormatOnly, + Fragment: opt.Fragment, + TabIndent: opt.TabIndent, + TabWidth: opt.TabWidth, + } + return intimp.Process(filename, src, intopt) +} + +// VendorlessPath returns the devendorized version of the import path ipath. +// For example, VendorlessPath("foo/bar/vendor/a/b") returns "a/b". +func VendorlessPath(ipath string) string { + return intimp.VendorlessPath(ipath) +} diff --git a/vendor/golang.org/x/tools/internal/fastwalk/fastwalk.go b/vendor/golang.org/x/tools/internal/fastwalk/fastwalk.go new file mode 100644 index 00000000..7219c8e9 --- /dev/null +++ b/vendor/golang.org/x/tools/internal/fastwalk/fastwalk.go @@ -0,0 +1,196 @@ +// Copyright 2016 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Package fastwalk provides a faster version of filepath.Walk for file system +// scanning tools. +package fastwalk + +import ( + "errors" + "os" + "path/filepath" + "runtime" + "sync" +) + +// TraverseLink is used as a return value from WalkFuncs to indicate that the +// symlink named in the call may be traversed. +var TraverseLink = errors.New("fastwalk: traverse symlink, assuming target is a directory") + +// SkipFiles is a used as a return value from WalkFuncs to indicate that the +// callback should not be called for any other files in the current directory. +// Child directories will still be traversed. +var SkipFiles = errors.New("fastwalk: skip remaining files in directory") + +// Walk is a faster implementation of filepath.Walk. +// +// filepath.Walk's design necessarily calls os.Lstat on each file, +// even if the caller needs less info. +// Many tools need only the type of each file. +// On some platforms, this information is provided directly by the readdir +// system call, avoiding the need to stat each file individually. +// fastwalk_unix.go contains a fork of the syscall routines. +// +// See golang.org/issue/16399 +// +// Walk walks the file tree rooted at root, calling walkFn for +// each file or directory in the tree, including root. +// +// If fastWalk returns filepath.SkipDir, the directory is skipped. +// +// Unlike filepath.Walk: +// * file stat calls must be done by the user. +// The only provided metadata is the file type, which does not include +// any permission bits. +// * multiple goroutines stat the filesystem concurrently. The provided +// walkFn must be safe for concurrent use. +// * fastWalk can follow symlinks if walkFn returns the TraverseLink +// sentinel error. It is the walkFn's responsibility to prevent +// fastWalk from going into symlink cycles. +func Walk(root string, walkFn func(path string, typ os.FileMode) error) error { + // TODO(bradfitz): make numWorkers configurable? We used a + // minimum of 4 to give the kernel more info about multiple + // things we want, in hopes its I/O scheduling can take + // advantage of that. Hopefully most are in cache. Maybe 4 is + // even too low of a minimum. Profile more. + numWorkers := 4 + if n := runtime.NumCPU(); n > numWorkers { + numWorkers = n + } + + // Make sure to wait for all workers to finish, otherwise + // walkFn could still be called after returning. This Wait call + // runs after close(e.donec) below. + var wg sync.WaitGroup + defer wg.Wait() + + w := &walker{ + fn: walkFn, + enqueuec: make(chan walkItem, numWorkers), // buffered for performance + workc: make(chan walkItem, numWorkers), // buffered for performance + donec: make(chan struct{}), + + // buffered for correctness & not leaking goroutines: + resc: make(chan error, numWorkers), + } + defer close(w.donec) + + for i := 0; i < numWorkers; i++ { + wg.Add(1) + go w.doWork(&wg) + } + todo := []walkItem{{dir: root}} + out := 0 + for { + workc := w.workc + var workItem walkItem + if len(todo) == 0 { + workc = nil + } else { + workItem = todo[len(todo)-1] + } + select { + case workc <- workItem: + todo = todo[:len(todo)-1] + out++ + case it := <-w.enqueuec: + todo = append(todo, it) + case err := <-w.resc: + out-- + if err != nil { + return err + } + if out == 0 && len(todo) == 0 { + // It's safe to quit here, as long as the buffered + // enqueue channel isn't also readable, which might + // happen if the worker sends both another unit of + // work and its result before the other select was + // scheduled and both w.resc and w.enqueuec were + // readable. + select { + case it := <-w.enqueuec: + todo = append(todo, it) + default: + return nil + } + } + } + } +} + +// doWork reads directories as instructed (via workc) and runs the +// user's callback function. +func (w *walker) doWork(wg *sync.WaitGroup) { + defer wg.Done() + for { + select { + case <-w.donec: + return + case it := <-w.workc: + select { + case <-w.donec: + return + case w.resc <- w.walk(it.dir, !it.callbackDone): + } + } + } +} + +type walker struct { + fn func(path string, typ os.FileMode) error + + donec chan struct{} // closed on fastWalk's return + workc chan walkItem // to workers + enqueuec chan walkItem // from workers + resc chan error // from workers +} + +type walkItem struct { + dir string + callbackDone bool // callback already called; don't do it again +} + +func (w *walker) enqueue(it walkItem) { + select { + case w.enqueuec <- it: + case <-w.donec: + } +} + +func (w *walker) onDirEnt(dirName, baseName string, typ os.FileMode) error { + joined := dirName + string(os.PathSeparator) + baseName + if typ == os.ModeDir { + w.enqueue(walkItem{dir: joined}) + return nil + } + + err := w.fn(joined, typ) + if typ == os.ModeSymlink { + if err == TraverseLink { + // Set callbackDone so we don't call it twice for both the + // symlink-as-symlink and the symlink-as-directory later: + w.enqueue(walkItem{dir: joined, callbackDone: true}) + return nil + } + if err == filepath.SkipDir { + // Permit SkipDir on symlinks too. + return nil + } + } + return err +} + +func (w *walker) walk(root string, runUserCallback bool) error { + if runUserCallback { + err := w.fn(root, os.ModeDir) + if err == filepath.SkipDir { + return nil + } + if err != nil { + return err + } + } + + return readDir(root, w.onDirEnt) +} diff --git a/vendor/golang.org/x/tools/internal/fastwalk/fastwalk_dirent_fileno.go b/vendor/golang.org/x/tools/internal/fastwalk/fastwalk_dirent_fileno.go new file mode 100644 index 00000000..ccffec5a --- /dev/null +++ b/vendor/golang.org/x/tools/internal/fastwalk/fastwalk_dirent_fileno.go @@ -0,0 +1,13 @@ +// Copyright 2016 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build freebsd openbsd netbsd + +package fastwalk + +import "syscall" + +func direntInode(dirent *syscall.Dirent) uint64 { + return uint64(dirent.Fileno) +} diff --git a/vendor/golang.org/x/tools/internal/fastwalk/fastwalk_dirent_ino.go b/vendor/golang.org/x/tools/internal/fastwalk/fastwalk_dirent_ino.go new file mode 100644 index 00000000..ab7fbc0a --- /dev/null +++ b/vendor/golang.org/x/tools/internal/fastwalk/fastwalk_dirent_ino.go @@ -0,0 +1,14 @@ +// Copyright 2016 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build linux darwin +// +build !appengine + +package fastwalk + +import "syscall" + +func direntInode(dirent *syscall.Dirent) uint64 { + return uint64(dirent.Ino) +} diff --git a/vendor/golang.org/x/tools/internal/fastwalk/fastwalk_dirent_namlen_bsd.go b/vendor/golang.org/x/tools/internal/fastwalk/fastwalk_dirent_namlen_bsd.go new file mode 100644 index 00000000..a3b26a7b --- /dev/null +++ b/vendor/golang.org/x/tools/internal/fastwalk/fastwalk_dirent_namlen_bsd.go @@ -0,0 +1,13 @@ +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build darwin freebsd openbsd netbsd + +package fastwalk + +import "syscall" + +func direntNamlen(dirent *syscall.Dirent) uint64 { + return uint64(dirent.Namlen) +} diff --git a/vendor/golang.org/x/tools/internal/fastwalk/fastwalk_dirent_namlen_linux.go b/vendor/golang.org/x/tools/internal/fastwalk/fastwalk_dirent_namlen_linux.go new file mode 100644 index 00000000..e880d358 --- /dev/null +++ b/vendor/golang.org/x/tools/internal/fastwalk/fastwalk_dirent_namlen_linux.go @@ -0,0 +1,29 @@ +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build linux +// +build !appengine + +package fastwalk + +import ( + "bytes" + "syscall" + "unsafe" +) + +func direntNamlen(dirent *syscall.Dirent) uint64 { + const fixedHdr = uint16(unsafe.Offsetof(syscall.Dirent{}.Name)) + nameBuf := (*[unsafe.Sizeof(dirent.Name)]byte)(unsafe.Pointer(&dirent.Name[0])) + const nameBufLen = uint16(len(nameBuf)) + limit := dirent.Reclen - fixedHdr + if limit > nameBufLen { + limit = nameBufLen + } + nameLen := bytes.IndexByte(nameBuf[:limit], 0) + if nameLen < 0 { + panic("failed to find terminating 0 byte in dirent") + } + return uint64(nameLen) +} diff --git a/vendor/golang.org/x/tools/internal/fastwalk/fastwalk_portable.go b/vendor/golang.org/x/tools/internal/fastwalk/fastwalk_portable.go new file mode 100644 index 00000000..a906b875 --- /dev/null +++ b/vendor/golang.org/x/tools/internal/fastwalk/fastwalk_portable.go @@ -0,0 +1,37 @@ +// Copyright 2016 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build appengine !linux,!darwin,!freebsd,!openbsd,!netbsd + +package fastwalk + +import ( + "io/ioutil" + "os" +) + +// readDir calls fn for each directory entry in dirName. +// It does not descend into directories or follow symlinks. +// If fn returns a non-nil error, readDir returns with that error +// immediately. +func readDir(dirName string, fn func(dirName, entName string, typ os.FileMode) error) error { + fis, err := ioutil.ReadDir(dirName) + if err != nil { + return err + } + skipFiles := false + for _, fi := range fis { + if fi.Mode().IsRegular() && skipFiles { + continue + } + if err := fn(dirName, fi.Name(), fi.Mode()&os.ModeType); err != nil { + if err == SkipFiles { + skipFiles = true + continue + } + return err + } + } + return nil +} diff --git a/vendor/golang.org/x/tools/internal/fastwalk/fastwalk_unix.go b/vendor/golang.org/x/tools/internal/fastwalk/fastwalk_unix.go new file mode 100644 index 00000000..3369b1a0 --- /dev/null +++ b/vendor/golang.org/x/tools/internal/fastwalk/fastwalk_unix.go @@ -0,0 +1,127 @@ +// Copyright 2016 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build linux darwin freebsd openbsd netbsd +// +build !appengine + +package fastwalk + +import ( + "fmt" + "os" + "syscall" + "unsafe" +) + +const blockSize = 8 << 10 + +// unknownFileMode is a sentinel (and bogus) os.FileMode +// value used to represent a syscall.DT_UNKNOWN Dirent.Type. +const unknownFileMode os.FileMode = os.ModeNamedPipe | os.ModeSocket | os.ModeDevice + +func readDir(dirName string, fn func(dirName, entName string, typ os.FileMode) error) error { + fd, err := syscall.Open(dirName, 0, 0) + if err != nil { + return &os.PathError{Op: "open", Path: dirName, Err: err} + } + defer syscall.Close(fd) + + // The buffer must be at least a block long. + buf := make([]byte, blockSize) // stack-allocated; doesn't escape + bufp := 0 // starting read position in buf + nbuf := 0 // end valid data in buf + skipFiles := false + for { + if bufp >= nbuf { + bufp = 0 + nbuf, err = syscall.ReadDirent(fd, buf) + if err != nil { + return os.NewSyscallError("readdirent", err) + } + if nbuf <= 0 { + return nil + } + } + consumed, name, typ := parseDirEnt(buf[bufp:nbuf]) + bufp += consumed + if name == "" || name == "." || name == ".." { + continue + } + // Fallback for filesystems (like old XFS) that don't + // support Dirent.Type and have DT_UNKNOWN (0) there + // instead. + if typ == unknownFileMode { + fi, err := os.Lstat(dirName + "/" + name) + if err != nil { + // It got deleted in the meantime. + if os.IsNotExist(err) { + continue + } + return err + } + typ = fi.Mode() & os.ModeType + } + if skipFiles && typ.IsRegular() { + continue + } + if err := fn(dirName, name, typ); err != nil { + if err == SkipFiles { + skipFiles = true + continue + } + return err + } + } +} + +func parseDirEnt(buf []byte) (consumed int, name string, typ os.FileMode) { + // golang.org/issue/15653 + dirent := (*syscall.Dirent)(unsafe.Pointer(&buf[0])) + if v := unsafe.Offsetof(dirent.Reclen) + unsafe.Sizeof(dirent.Reclen); uintptr(len(buf)) < v { + panic(fmt.Sprintf("buf size of %d smaller than dirent header size %d", len(buf), v)) + } + if len(buf) < int(dirent.Reclen) { + panic(fmt.Sprintf("buf size %d < record length %d", len(buf), dirent.Reclen)) + } + consumed = int(dirent.Reclen) + if direntInode(dirent) == 0 { // File absent in directory. + return + } + switch dirent.Type { + case syscall.DT_REG: + typ = 0 + case syscall.DT_DIR: + typ = os.ModeDir + case syscall.DT_LNK: + typ = os.ModeSymlink + case syscall.DT_BLK: + typ = os.ModeDevice + case syscall.DT_FIFO: + typ = os.ModeNamedPipe + case syscall.DT_SOCK: + typ = os.ModeSocket + case syscall.DT_UNKNOWN: + typ = unknownFileMode + default: + // Skip weird things. + // It's probably a DT_WHT (http://lwn.net/Articles/325369/) + // or something. Revisit if/when this package is moved outside + // of goimports. goimports only cares about regular files, + // symlinks, and directories. + return + } + + nameBuf := (*[unsafe.Sizeof(dirent.Name)]byte)(unsafe.Pointer(&dirent.Name[0])) + nameLen := direntNamlen(dirent) + + // Special cases for common things: + if nameLen == 1 && nameBuf[0] == '.' { + name = "." + } else if nameLen == 2 && nameBuf[0] == '.' && nameBuf[1] == '.' { + name = ".." + } else { + name = string(nameBuf[:nameLen]) + } + return +} diff --git a/vendor/golang.org/x/tools/internal/gopathwalk/walk.go b/vendor/golang.org/x/tools/internal/gopathwalk/walk.go new file mode 100644 index 00000000..9a61bdbf --- /dev/null +++ b/vendor/golang.org/x/tools/internal/gopathwalk/walk.go @@ -0,0 +1,270 @@ +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Package gopathwalk is like filepath.Walk but specialized for finding Go +// packages, particularly in $GOPATH and $GOROOT. +package gopathwalk + +import ( + "bufio" + "bytes" + "fmt" + "go/build" + "io/ioutil" + "log" + "os" + "path/filepath" + "strings" + "time" + + "golang.org/x/tools/internal/fastwalk" +) + +// Options controls the behavior of a Walk call. +type Options struct { + Debug bool // Enable debug logging + ModulesEnabled bool // Search module caches. Also disables legacy goimports ignore rules. +} + +// RootType indicates the type of a Root. +type RootType int + +const ( + RootUnknown RootType = iota + RootGOROOT + RootGOPATH + RootCurrentModule + RootModuleCache + RootOther +) + +// A Root is a starting point for a Walk. +type Root struct { + Path string + Type RootType +} + +// SrcDirsRoots returns the roots from build.Default.SrcDirs(). Not modules-compatible. +func SrcDirsRoots(ctx *build.Context) []Root { + var roots []Root + roots = append(roots, Root{filepath.Join(ctx.GOROOT, "src"), RootGOROOT}) + for _, p := range filepath.SplitList(ctx.GOPATH) { + roots = append(roots, Root{filepath.Join(p, "src"), RootGOPATH}) + } + return roots +} + +// Walk walks Go source directories ($GOROOT, $GOPATH, etc) to find packages. +// For each package found, add will be called (concurrently) with the absolute +// paths of the containing source directory and the package directory. +// add will be called concurrently. +func Walk(roots []Root, add func(root Root, dir string), opts Options) { + WalkSkip(roots, add, func(Root, string) bool { return false }, opts) +} + +// WalkSkip walks Go source directories ($GOROOT, $GOPATH, etc) to find packages. +// For each package found, add will be called (concurrently) with the absolute +// paths of the containing source directory and the package directory. +// For each directory that will be scanned, skip will be called (concurrently) +// with the absolute paths of the containing source directory and the directory. +// If skip returns false on a directory it will be processed. +// add will be called concurrently. +// skip will be called concurrently. +func WalkSkip(roots []Root, add func(root Root, dir string), skip func(root Root, dir string) bool, opts Options) { + for _, root := range roots { + walkDir(root, add, skip, opts) + } +} + +func walkDir(root Root, add func(Root, string), skip func(root Root, dir string) bool, opts Options) { + if _, err := os.Stat(root.Path); os.IsNotExist(err) { + if opts.Debug { + log.Printf("skipping nonexistent directory: %v", root.Path) + } + return + } + start := time.Now() + if opts.Debug { + log.Printf("gopathwalk: scanning %s", root.Path) + } + w := &walker{ + root: root, + add: add, + skip: skip, + opts: opts, + } + w.init() + if err := fastwalk.Walk(root.Path, w.walk); err != nil { + log.Printf("gopathwalk: scanning directory %v: %v", root.Path, err) + } + + if opts.Debug { + log.Printf("gopathwalk: scanned %s in %v", root.Path, time.Since(start)) + } +} + +// walker is the callback for fastwalk.Walk. +type walker struct { + root Root // The source directory to scan. + add func(Root, string) // The callback that will be invoked for every possible Go package dir. + skip func(Root, string) bool // The callback that will be invoked for every dir. dir is skipped if it returns true. + opts Options // Options passed to Walk by the user. + + ignoredDirs []os.FileInfo // The ignored directories, loaded from .goimportsignore files. +} + +// init initializes the walker based on its Options. +func (w *walker) init() { + var ignoredPaths []string + if w.root.Type == RootModuleCache { + ignoredPaths = []string{"cache"} + } + if !w.opts.ModulesEnabled && w.root.Type == RootGOPATH { + ignoredPaths = w.getIgnoredDirs(w.root.Path) + ignoredPaths = append(ignoredPaths, "v", "mod") + } + + for _, p := range ignoredPaths { + full := filepath.Join(w.root.Path, p) + if fi, err := os.Stat(full); err == nil { + w.ignoredDirs = append(w.ignoredDirs, fi) + if w.opts.Debug { + log.Printf("Directory added to ignore list: %s", full) + } + } else if w.opts.Debug { + log.Printf("Error statting ignored directory: %v", err) + } + } +} + +// getIgnoredDirs reads an optional config file at /.goimportsignore +// of relative directories to ignore when scanning for go files. +// The provided path is one of the $GOPATH entries with "src" appended. +func (w *walker) getIgnoredDirs(path string) []string { + file := filepath.Join(path, ".goimportsignore") + slurp, err := ioutil.ReadFile(file) + if w.opts.Debug { + if err != nil { + log.Print(err) + } else { + log.Printf("Read %s", file) + } + } + if err != nil { + return nil + } + + var ignoredDirs []string + bs := bufio.NewScanner(bytes.NewReader(slurp)) + for bs.Scan() { + line := strings.TrimSpace(bs.Text()) + if line == "" || strings.HasPrefix(line, "#") { + continue + } + ignoredDirs = append(ignoredDirs, line) + } + return ignoredDirs +} + +func (w *walker) shouldSkipDir(fi os.FileInfo, dir string) bool { + for _, ignoredDir := range w.ignoredDirs { + if os.SameFile(fi, ignoredDir) { + return true + } + } + if w.skip != nil { + // Check with the user specified callback. + return w.skip(w.root, dir) + } + return false +} + +func (w *walker) walk(path string, typ os.FileMode) error { + dir := filepath.Dir(path) + if typ.IsRegular() { + if dir == w.root.Path && (w.root.Type == RootGOROOT || w.root.Type == RootGOPATH) { + // Doesn't make sense to have regular files + // directly in your $GOPATH/src or $GOROOT/src. + return fastwalk.SkipFiles + } + if !strings.HasSuffix(path, ".go") { + return nil + } + + w.add(w.root, dir) + return fastwalk.SkipFiles + } + if typ == os.ModeDir { + base := filepath.Base(path) + if base == "" || base[0] == '.' || base[0] == '_' || + base == "testdata" || + (w.root.Type == RootGOROOT && w.opts.ModulesEnabled && base == "vendor") || + (!w.opts.ModulesEnabled && base == "node_modules") { + return filepath.SkipDir + } + fi, err := os.Lstat(path) + if err == nil && w.shouldSkipDir(fi, path) { + return filepath.SkipDir + } + return nil + } + if typ == os.ModeSymlink { + base := filepath.Base(path) + if strings.HasPrefix(base, ".#") { + // Emacs noise. + return nil + } + fi, err := os.Lstat(path) + if err != nil { + // Just ignore it. + return nil + } + if w.shouldTraverse(dir, fi) { + return fastwalk.TraverseLink + } + } + return nil +} + +// shouldTraverse reports whether the symlink fi, found in dir, +// should be followed. It makes sure symlinks were never visited +// before to avoid symlink loops. +func (w *walker) shouldTraverse(dir string, fi os.FileInfo) bool { + path := filepath.Join(dir, fi.Name()) + target, err := filepath.EvalSymlinks(path) + if err != nil { + return false + } + ts, err := os.Stat(target) + if err != nil { + fmt.Fprintln(os.Stderr, err) + return false + } + if !ts.IsDir() { + return false + } + if w.shouldSkipDir(ts, dir) { + return false + } + // Check for symlink loops by statting each directory component + // and seeing if any are the same file as ts. + for { + parent := filepath.Dir(path) + if parent == path { + // Made it to the root without seeing a cycle. + // Use this symlink. + return true + } + parentInfo, err := os.Stat(parent) + if err != nil { + return false + } + if os.SameFile(ts, parentInfo) { + // Cycle. Don't traverse. + return false + } + path = parent + } + +} diff --git a/vendor/golang.org/x/tools/internal/imports/fix.go b/vendor/golang.org/x/tools/internal/imports/fix.go new file mode 100644 index 00000000..cdaa57b9 --- /dev/null +++ b/vendor/golang.org/x/tools/internal/imports/fix.go @@ -0,0 +1,1581 @@ +// Copyright 2013 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package imports + +import ( + "bytes" + "context" + "fmt" + "go/ast" + "go/build" + "go/parser" + "go/token" + "io/ioutil" + "os" + "os/exec" + "path" + "path/filepath" + "reflect" + "sort" + "strconv" + "strings" + "sync" + "time" + "unicode" + "unicode/utf8" + + "golang.org/x/tools/go/ast/astutil" + "golang.org/x/tools/go/packages" + "golang.org/x/tools/internal/gopathwalk" +) + +// importToGroup is a list of functions which map from an import path to +// a group number. +var importToGroup = []func(env *ProcessEnv, importPath string) (num int, ok bool){ + func(env *ProcessEnv, importPath string) (num int, ok bool) { + if env.LocalPrefix == "" { + return + } + for _, p := range strings.Split(env.LocalPrefix, ",") { + if strings.HasPrefix(importPath, p) || strings.TrimSuffix(p, "/") == importPath { + return 3, true + } + } + return + }, + func(_ *ProcessEnv, importPath string) (num int, ok bool) { + if strings.HasPrefix(importPath, "appengine") { + return 2, true + } + return + }, + func(_ *ProcessEnv, importPath string) (num int, ok bool) { + if strings.Contains(importPath, ".") { + return 1, true + } + return + }, +} + +func importGroup(env *ProcessEnv, importPath string) int { + for _, fn := range importToGroup { + if n, ok := fn(env, importPath); ok { + return n + } + } + return 0 +} + +type ImportFixType int + +const ( + AddImport ImportFixType = iota + DeleteImport + SetImportName +) + +type ImportFix struct { + // StmtInfo represents the import statement this fix will add, remove, or change. + StmtInfo ImportInfo + // IdentName is the identifier that this fix will add or remove. + IdentName string + // FixType is the type of fix this is (AddImport, DeleteImport, SetImportName). + FixType ImportFixType +} + +// An ImportInfo represents a single import statement. +type ImportInfo struct { + ImportPath string // import path, e.g. "crypto/rand". + Name string // import name, e.g. "crand", or "" if none. +} + +// A packageInfo represents what's known about a package. +type packageInfo struct { + name string // real package name, if known. + exports map[string]bool // known exports. +} + +// parseOtherFiles parses all the Go files in srcDir except filename, including +// test files if filename looks like a test. +func parseOtherFiles(fset *token.FileSet, srcDir, filename string) []*ast.File { + // This could use go/packages but it doesn't buy much, and it fails + // with https://golang.org/issue/26296 in LoadFiles mode in some cases. + considerTests := strings.HasSuffix(filename, "_test.go") + + fileBase := filepath.Base(filename) + packageFileInfos, err := ioutil.ReadDir(srcDir) + if err != nil { + return nil + } + + var files []*ast.File + for _, fi := range packageFileInfos { + if fi.Name() == fileBase || !strings.HasSuffix(fi.Name(), ".go") { + continue + } + if !considerTests && strings.HasSuffix(fi.Name(), "_test.go") { + continue + } + + f, err := parser.ParseFile(fset, filepath.Join(srcDir, fi.Name()), nil, 0) + if err != nil { + continue + } + + files = append(files, f) + } + + return files +} + +// addGlobals puts the names of package vars into the provided map. +func addGlobals(f *ast.File, globals map[string]bool) { + for _, decl := range f.Decls { + genDecl, ok := decl.(*ast.GenDecl) + if !ok { + continue + } + + for _, spec := range genDecl.Specs { + valueSpec, ok := spec.(*ast.ValueSpec) + if !ok { + continue + } + globals[valueSpec.Names[0].Name] = true + } + } +} + +// collectReferences builds a map of selector expressions, from +// left hand side (X) to a set of right hand sides (Sel). +func collectReferences(f *ast.File) references { + refs := references{} + + var visitor visitFn + visitor = func(node ast.Node) ast.Visitor { + if node == nil { + return visitor + } + switch v := node.(type) { + case *ast.SelectorExpr: + xident, ok := v.X.(*ast.Ident) + if !ok { + break + } + if xident.Obj != nil { + // If the parser can resolve it, it's not a package ref. + break + } + if !ast.IsExported(v.Sel.Name) { + // Whatever this is, it's not exported from a package. + break + } + pkgName := xident.Name + r := refs[pkgName] + if r == nil { + r = make(map[string]bool) + refs[pkgName] = r + } + r[v.Sel.Name] = true + } + return visitor + } + ast.Walk(visitor, f) + return refs +} + +// collectImports returns all the imports in f. +// Unnamed imports (., _) and "C" are ignored. +func collectImports(f *ast.File) []*ImportInfo { + var imports []*ImportInfo + for _, imp := range f.Imports { + var name string + if imp.Name != nil { + name = imp.Name.Name + } + if imp.Path.Value == `"C"` || name == "_" || name == "." { + continue + } + path := strings.Trim(imp.Path.Value, `"`) + imports = append(imports, &ImportInfo{ + Name: name, + ImportPath: path, + }) + } + return imports +} + +// findMissingImport searches pass's candidates for an import that provides +// pkg, containing all of syms. +func (p *pass) findMissingImport(pkg string, syms map[string]bool) *ImportInfo { + for _, candidate := range p.candidates { + pkgInfo, ok := p.knownPackages[candidate.ImportPath] + if !ok { + continue + } + if p.importIdentifier(candidate) != pkg { + continue + } + + allFound := true + for right := range syms { + if !pkgInfo.exports[right] { + allFound = false + break + } + } + + if allFound { + return candidate + } + } + return nil +} + +// references is set of references found in a Go file. The first map key is the +// left hand side of a selector expression, the second key is the right hand +// side, and the value should always be true. +type references map[string]map[string]bool + +// A pass contains all the inputs and state necessary to fix a file's imports. +// It can be modified in some ways during use; see comments below. +type pass struct { + // Inputs. These must be set before a call to load, and not modified after. + fset *token.FileSet // fset used to parse f and its siblings. + f *ast.File // the file being fixed. + srcDir string // the directory containing f. + env *ProcessEnv // the environment to use for go commands, etc. + loadRealPackageNames bool // if true, load package names from disk rather than guessing them. + otherFiles []*ast.File // sibling files. + + // Intermediate state, generated by load. + existingImports map[string]*ImportInfo + allRefs references + missingRefs references + + // Inputs to fix. These can be augmented between successive fix calls. + lastTry bool // indicates that this is the last call and fix should clean up as best it can. + candidates []*ImportInfo // candidate imports in priority order. + knownPackages map[string]*packageInfo // information about all known packages. +} + +// loadPackageNames saves the package names for everything referenced by imports. +func (p *pass) loadPackageNames(imports []*ImportInfo) error { + if p.env.Debug { + p.env.Logf("loading package names for %v packages", len(imports)) + defer func() { + p.env.Logf("done loading package names for %v packages", len(imports)) + }() + } + var unknown []string + for _, imp := range imports { + if _, ok := p.knownPackages[imp.ImportPath]; ok { + continue + } + unknown = append(unknown, imp.ImportPath) + } + + names, err := p.env.GetResolver().loadPackageNames(unknown, p.srcDir) + if err != nil { + return err + } + + for path, name := range names { + p.knownPackages[path] = &packageInfo{ + name: name, + exports: map[string]bool{}, + } + } + return nil +} + +// importIdentifier returns the identifier that imp will introduce. It will +// guess if the package name has not been loaded, e.g. because the source +// is not available. +func (p *pass) importIdentifier(imp *ImportInfo) string { + if imp.Name != "" { + return imp.Name + } + known := p.knownPackages[imp.ImportPath] + if known != nil && known.name != "" { + return known.name + } + return importPathToAssumedName(imp.ImportPath) +} + +// load reads in everything necessary to run a pass, and reports whether the +// file already has all the imports it needs. It fills in p.missingRefs with the +// file's missing symbols, if any, or removes unused imports if not. +func (p *pass) load() ([]*ImportFix, bool) { + p.knownPackages = map[string]*packageInfo{} + p.missingRefs = references{} + p.existingImports = map[string]*ImportInfo{} + + // Load basic information about the file in question. + p.allRefs = collectReferences(p.f) + + // Load stuff from other files in the same package: + // global variables so we know they don't need resolving, and imports + // that we might want to mimic. + globals := map[string]bool{} + for _, otherFile := range p.otherFiles { + // Don't load globals from files that are in the same directory + // but a different package. Using them to suggest imports is OK. + if p.f.Name.Name == otherFile.Name.Name { + addGlobals(otherFile, globals) + } + p.candidates = append(p.candidates, collectImports(otherFile)...) + } + + // Resolve all the import paths we've seen to package names, and store + // f's imports by the identifier they introduce. + imports := collectImports(p.f) + if p.loadRealPackageNames { + err := p.loadPackageNames(append(imports, p.candidates...)) + if err != nil { + if p.env.Debug { + p.env.Logf("loading package names: %v", err) + } + return nil, false + } + } + for _, imp := range imports { + p.existingImports[p.importIdentifier(imp)] = imp + } + + // Find missing references. + for left, rights := range p.allRefs { + if globals[left] { + continue + } + _, ok := p.existingImports[left] + if !ok { + p.missingRefs[left] = rights + continue + } + } + if len(p.missingRefs) != 0 { + return nil, false + } + + return p.fix() +} + +// fix attempts to satisfy missing imports using p.candidates. If it finds +// everything, or if p.lastTry is true, it updates fixes to add the imports it found, +// delete anything unused, and update import names, and returns true. +func (p *pass) fix() ([]*ImportFix, bool) { + // Find missing imports. + var selected []*ImportInfo + for left, rights := range p.missingRefs { + if imp := p.findMissingImport(left, rights); imp != nil { + selected = append(selected, imp) + } + } + + if !p.lastTry && len(selected) != len(p.missingRefs) { + return nil, false + } + + // Found everything, or giving up. Add the new imports and remove any unused. + var fixes []*ImportFix + for _, imp := range p.existingImports { + // We deliberately ignore globals here, because we can't be sure + // they're in the same package. People do things like put multiple + // main packages in the same directory, and we don't want to + // remove imports if they happen to have the same name as a var in + // a different package. + if _, ok := p.allRefs[p.importIdentifier(imp)]; !ok { + fixes = append(fixes, &ImportFix{ + StmtInfo: *imp, + IdentName: p.importIdentifier(imp), + FixType: DeleteImport, + }) + continue + } + + // An existing import may need to update its import name to be correct. + if name := p.importSpecName(imp); name != imp.Name { + fixes = append(fixes, &ImportFix{ + StmtInfo: ImportInfo{ + Name: name, + ImportPath: imp.ImportPath, + }, + IdentName: p.importIdentifier(imp), + FixType: SetImportName, + }) + } + } + + for _, imp := range selected { + fixes = append(fixes, &ImportFix{ + StmtInfo: ImportInfo{ + Name: p.importSpecName(imp), + ImportPath: imp.ImportPath, + }, + IdentName: p.importIdentifier(imp), + FixType: AddImport, + }) + } + + return fixes, true +} + +// importSpecName gets the import name of imp in the import spec. +// +// When the import identifier matches the assumed import name, the import name does +// not appear in the import spec. +func (p *pass) importSpecName(imp *ImportInfo) string { + // If we did not load the real package names, or the name is already set, + // we just return the existing name. + if !p.loadRealPackageNames || imp.Name != "" { + return imp.Name + } + + ident := p.importIdentifier(imp) + if ident == importPathToAssumedName(imp.ImportPath) { + return "" // ident not needed since the assumed and real names are the same. + } + return ident +} + +// apply will perform the fixes on f in order. +func apply(fset *token.FileSet, f *ast.File, fixes []*ImportFix) { + for _, fix := range fixes { + switch fix.FixType { + case DeleteImport: + astutil.DeleteNamedImport(fset, f, fix.StmtInfo.Name, fix.StmtInfo.ImportPath) + case AddImport: + astutil.AddNamedImport(fset, f, fix.StmtInfo.Name, fix.StmtInfo.ImportPath) + case SetImportName: + // Find the matching import path and change the name. + for _, spec := range f.Imports { + path := strings.Trim(spec.Path.Value, `"`) + if path == fix.StmtInfo.ImportPath { + spec.Name = &ast.Ident{ + Name: fix.StmtInfo.Name, + NamePos: spec.Pos(), + } + } + } + } + } +} + +// assumeSiblingImportsValid assumes that siblings' use of packages is valid, +// adding the exports they use. +func (p *pass) assumeSiblingImportsValid() { + for _, f := range p.otherFiles { + refs := collectReferences(f) + imports := collectImports(f) + importsByName := map[string]*ImportInfo{} + for _, imp := range imports { + importsByName[p.importIdentifier(imp)] = imp + } + for left, rights := range refs { + if imp, ok := importsByName[left]; ok { + if m, ok := stdlib[imp.ImportPath]; ok { + // We have the stdlib in memory; no need to guess. + rights = copyExports(m) + } + p.addCandidate(imp, &packageInfo{ + // no name; we already know it. + exports: rights, + }) + } + } + } +} + +// addCandidate adds a candidate import to p, and merges in the information +// in pkg. +func (p *pass) addCandidate(imp *ImportInfo, pkg *packageInfo) { + p.candidates = append(p.candidates, imp) + if existing, ok := p.knownPackages[imp.ImportPath]; ok { + if existing.name == "" { + existing.name = pkg.name + } + for export := range pkg.exports { + existing.exports[export] = true + } + } else { + p.knownPackages[imp.ImportPath] = pkg + } +} + +// fixImports adds and removes imports from f so that all its references are +// satisfied and there are no unused imports. +// +// This is declared as a variable rather than a function so goimports can +// easily be extended by adding a file with an init function. +var fixImports = fixImportsDefault + +func fixImportsDefault(fset *token.FileSet, f *ast.File, filename string, env *ProcessEnv) error { + fixes, err := getFixes(fset, f, filename, env) + if err != nil { + return err + } + apply(fset, f, fixes) + return err +} + +// getFixes gets the import fixes that need to be made to f in order to fix the imports. +// It does not modify the ast. +func getFixes(fset *token.FileSet, f *ast.File, filename string, env *ProcessEnv) ([]*ImportFix, error) { + abs, err := filepath.Abs(filename) + if err != nil { + return nil, err + } + srcDir := filepath.Dir(abs) + if env.Debug { + env.Logf("fixImports(filename=%q), abs=%q, srcDir=%q ...", filename, abs, srcDir) + } + + // First pass: looking only at f, and using the naive algorithm to + // derive package names from import paths, see if the file is already + // complete. We can't add any imports yet, because we don't know + // if missing references are actually package vars. + p := &pass{fset: fset, f: f, srcDir: srcDir} + if fixes, done := p.load(); done { + return fixes, nil + } + + otherFiles := parseOtherFiles(fset, srcDir, filename) + + // Second pass: add information from other files in the same package, + // like their package vars and imports. + p.otherFiles = otherFiles + if fixes, done := p.load(); done { + return fixes, nil + } + + // Now we can try adding imports from the stdlib. + p.assumeSiblingImportsValid() + addStdlibCandidates(p, p.missingRefs) + if fixes, done := p.fix(); done { + return fixes, nil + } + + // Third pass: get real package names where we had previously used + // the naive algorithm. This is the first step that will use the + // environment, so we provide it here for the first time. + p = &pass{fset: fset, f: f, srcDir: srcDir, env: env} + p.loadRealPackageNames = true + p.otherFiles = otherFiles + if fixes, done := p.load(); done { + return fixes, nil + } + + addStdlibCandidates(p, p.missingRefs) + p.assumeSiblingImportsValid() + if fixes, done := p.fix(); done { + return fixes, nil + } + + // Go look for candidates in $GOPATH, etc. We don't necessarily load + // the real exports of sibling imports, so keep assuming their contents. + if err := addExternalCandidates(p, p.missingRefs, filename); err != nil { + return nil, err + } + + p.lastTry = true + fixes, _ := p.fix() + return fixes, nil +} + +// getCandidatePkgs returns the list of pkgs that are accessible from filename, +// optionall filtered to only packages named pkgName. +func getCandidatePkgs(pkgName, filename string, env *ProcessEnv) ([]*pkg, error) { + // TODO(heschi): filter out current package. (Don't forget x_test can import x.) + + var result []*pkg + // Start off with the standard library. + for importPath := range stdlib { + if pkgName != "" && path.Base(importPath) != pkgName { + continue + } + result = append(result, &pkg{ + dir: filepath.Join(env.GOROOT, "src", importPath), + importPathShort: importPath, + packageName: path.Base(importPath), + relevance: 0, + }) + } + + // Exclude goroot results -- getting them is relatively expensive, not cached, + // and generally redundant with the in-memory version. + exclude := []gopathwalk.RootType{gopathwalk.RootGOROOT} + // Only the go/packages resolver uses the first argument, and nobody uses that resolver. + scannedPkgs, err := env.GetResolver().scan(nil, true, exclude) + if err != nil { + return nil, err + } + + dupCheck := map[string]struct{}{} + for _, pkg := range scannedPkgs { + if pkgName != "" && pkg.packageName != pkgName { + continue + } + if !canUse(filename, pkg.dir) { + continue + } + if _, ok := dupCheck[pkg.importPathShort]; ok { + continue + } + dupCheck[pkg.importPathShort] = struct{}{} + result = append(result, pkg) + } + + // Sort first by relevance, then by package name, with import path as a tiebreaker. + sort.Slice(result, func(i, j int) bool { + pi, pj := result[i], result[j] + if pi.relevance != pj.relevance { + return pi.relevance < pj.relevance + } + if pi.packageName != pj.packageName { + return pi.packageName < pj.packageName + } + return pi.importPathShort < pj.importPathShort + }) + + return result, nil +} + +func candidateImportName(pkg *pkg) string { + if importPathToAssumedName(pkg.importPathShort) != pkg.packageName { + return pkg.packageName + } + return "" +} + +// getAllCandidates gets all of the candidates to be imported, regardless of if they are needed. +func getAllCandidates(filename string, env *ProcessEnv) ([]ImportFix, error) { + pkgs, err := getCandidatePkgs("", filename, env) + if err != nil { + return nil, err + } + result := make([]ImportFix, 0, len(pkgs)) + for _, pkg := range pkgs { + result = append(result, ImportFix{ + StmtInfo: ImportInfo{ + ImportPath: pkg.importPathShort, + Name: candidateImportName(pkg), + }, + IdentName: pkg.packageName, + FixType: AddImport, + }) + } + return result, nil +} + +// A PackageExport is a package and its exports. +type PackageExport struct { + Fix *ImportFix + Exports []string +} + +func getPackageExports(completePackage, filename string, env *ProcessEnv) ([]PackageExport, error) { + pkgs, err := getCandidatePkgs(completePackage, filename, env) + if err != nil { + return nil, err + } + + results := make([]PackageExport, 0, len(pkgs)) + for _, pkg := range pkgs { + fix := &ImportFix{ + StmtInfo: ImportInfo{ + ImportPath: pkg.importPathShort, + Name: candidateImportName(pkg), + }, + IdentName: pkg.packageName, + FixType: AddImport, + } + var exports []string + if e, ok := stdlib[pkg.importPathShort]; ok { + exports = e + } else { + exports, err = loadExportsForPackage(context.Background(), env, completePackage, pkg) + if err != nil { + if env.Debug { + env.Logf("while completing %q, error loading exports from %q: %v", completePackage, pkg.importPathShort, err) + } + continue + } + } + sort.Strings(exports) + results = append(results, PackageExport{ + Fix: fix, + Exports: exports, + }) + } + + return results, nil +} + +// ProcessEnv contains environment variables and settings that affect the use of +// the go command, the go/build package, etc. +type ProcessEnv struct { + LocalPrefix string + Debug bool + + // If non-empty, these will be used instead of the + // process-wide values. + GOPATH, GOROOT, GO111MODULE, GOPROXY, GOFLAGS, GOSUMDB string + WorkingDir string + + // If true, use go/packages regardless of the environment. + ForceGoPackages bool + + // Logf is the default logger for the ProcessEnv. + Logf func(format string, args ...interface{}) + + resolver Resolver +} + +func (e *ProcessEnv) env() []string { + env := os.Environ() + add := func(k, v string) { + if v != "" { + env = append(env, k+"="+v) + } + } + add("GOPATH", e.GOPATH) + add("GOROOT", e.GOROOT) + add("GO111MODULE", e.GO111MODULE) + add("GOPROXY", e.GOPROXY) + add("GOFLAGS", e.GOFLAGS) + add("GOSUMDB", e.GOSUMDB) + if e.WorkingDir != "" { + add("PWD", e.WorkingDir) + } + return env +} + +func (e *ProcessEnv) GetResolver() Resolver { + if e.resolver != nil { + return e.resolver + } + if e.ForceGoPackages { + e.resolver = &goPackagesResolver{env: e} + return e.resolver + } + + out, err := e.invokeGo("env", "GOMOD") + if err != nil || len(bytes.TrimSpace(out.Bytes())) == 0 { + e.resolver = &gopathResolver{env: e} + return e.resolver + } + e.resolver = &ModuleResolver{env: e} + return e.resolver +} + +func (e *ProcessEnv) newPackagesConfig(mode packages.LoadMode) *packages.Config { + return &packages.Config{ + Mode: mode, + Dir: e.WorkingDir, + Env: e.env(), + } +} + +func (e *ProcessEnv) buildContext() *build.Context { + ctx := build.Default + ctx.GOROOT = e.GOROOT + ctx.GOPATH = e.GOPATH + + // As of Go 1.14, build.Context has a WorkingDir field + // (see golang.org/issue/34860). + // Populate it only if present. + if wd := reflect.ValueOf(&ctx).Elem().FieldByName("WorkingDir"); wd.IsValid() && wd.Kind() == reflect.String { + wd.SetString(e.WorkingDir) + } + return &ctx +} + +func (e *ProcessEnv) invokeGo(args ...string) (*bytes.Buffer, error) { + cmd := exec.Command("go", args...) + stdout := &bytes.Buffer{} + stderr := &bytes.Buffer{} + cmd.Stdout = stdout + cmd.Stderr = stderr + cmd.Env = e.env() + cmd.Dir = e.WorkingDir + + if e.Debug { + defer func(start time.Time) { e.Logf("%s for %v", time.Since(start), cmdDebugStr(cmd)) }(time.Now()) + } + if err := cmd.Run(); err != nil { + return nil, fmt.Errorf("running go: %v (stderr:\n%s)", err, stderr) + } + return stdout, nil +} + +func cmdDebugStr(cmd *exec.Cmd) string { + env := make(map[string]string) + for _, kv := range cmd.Env { + split := strings.Split(kv, "=") + k, v := split[0], split[1] + env[k] = v + } + + return fmt.Sprintf("GOROOT=%v GOPATH=%v GO111MODULE=%v GOPROXY=%v PWD=%v go %v", env["GOROOT"], env["GOPATH"], env["GO111MODULE"], env["GOPROXY"], env["PWD"], cmd.Args) +} + +func addStdlibCandidates(pass *pass, refs references) { + add := func(pkg string) { + exports := copyExports(stdlib[pkg]) + pass.addCandidate( + &ImportInfo{ImportPath: pkg}, + &packageInfo{name: path.Base(pkg), exports: exports}) + } + for left := range refs { + if left == "rand" { + // Make sure we try crypto/rand before math/rand. + add("crypto/rand") + add("math/rand") + continue + } + for importPath := range stdlib { + if path.Base(importPath) == left { + add(importPath) + } + } + } +} + +// A Resolver does the build-system-specific parts of goimports. +type Resolver interface { + // loadPackageNames loads the package names in importPaths. + loadPackageNames(importPaths []string, srcDir string) (map[string]string, error) + // scan finds (at least) the packages satisfying refs. If loadNames is true, + // package names will be set on the results, and dirs whose package name + // could not be determined will be excluded. + scan(refs references, loadNames bool, exclude []gopathwalk.RootType) ([]*pkg, error) + // loadExports returns the set of exported symbols in the package at dir. + // loadExports may be called concurrently. + loadExports(ctx context.Context, pkg *pkg) (string, []string, error) + + ClearForNewScan() +} + +// gopackagesResolver implements resolver for GOPATH and module workspaces using go/packages. +type goPackagesResolver struct { + env *ProcessEnv +} + +func (r *goPackagesResolver) ClearForNewScan() {} + +func (r *goPackagesResolver) loadPackageNames(importPaths []string, srcDir string) (map[string]string, error) { + if len(importPaths) == 0 { + return nil, nil + } + cfg := r.env.newPackagesConfig(packages.LoadFiles) + pkgs, err := packages.Load(cfg, importPaths...) + if err != nil { + return nil, err + } + names := map[string]string{} + for _, pkg := range pkgs { + names[VendorlessPath(pkg.PkgPath)] = pkg.Name + } + // We may not have found all the packages. Guess the rest. + for _, path := range importPaths { + if _, ok := names[path]; ok { + continue + } + names[path] = importPathToAssumedName(path) + } + return names, nil + +} + +func (r *goPackagesResolver) scan(refs references, _ bool, _ []gopathwalk.RootType) ([]*pkg, error) { + var loadQueries []string + for pkgName := range refs { + loadQueries = append(loadQueries, "iamashamedtousethedisabledqueryname="+pkgName) + } + sort.Strings(loadQueries) + cfg := r.env.newPackagesConfig(packages.LoadFiles) + goPackages, err := packages.Load(cfg, loadQueries...) + if err != nil { + return nil, err + } + + var scan []*pkg + for _, goPackage := range goPackages { + scan = append(scan, &pkg{ + dir: filepath.Dir(goPackage.CompiledGoFiles[0]), + importPathShort: VendorlessPath(goPackage.PkgPath), + goPackage: goPackage, + packageName: goPackage.Name, + }) + } + return scan, nil +} + +func (r *goPackagesResolver) loadExports(ctx context.Context, pkg *pkg) (string, []string, error) { + if pkg.goPackage == nil { + return "", nil, fmt.Errorf("goPackage not set") + } + var exports []string + fset := token.NewFileSet() + for _, fname := range pkg.goPackage.CompiledGoFiles { + f, err := parser.ParseFile(fset, fname, nil, 0) + if err != nil { + return "", nil, fmt.Errorf("parsing %s: %v", fname, err) + } + for name := range f.Scope.Objects { + if ast.IsExported(name) { + exports = append(exports, name) + } + } + } + return pkg.goPackage.Name, exports, nil +} + +func addExternalCandidates(pass *pass, refs references, filename string) error { + dirScan, err := pass.env.GetResolver().scan(refs, false, nil) + if err != nil { + return err + } + + // Search for imports matching potential package references. + type result struct { + imp *ImportInfo + pkg *packageInfo + } + results := make(chan result, len(refs)) + + ctx, cancel := context.WithCancel(context.TODO()) + var wg sync.WaitGroup + defer func() { + cancel() + wg.Wait() + }() + var ( + firstErr error + firstErrOnce sync.Once + ) + for pkgName, symbols := range refs { + wg.Add(1) + go func(pkgName string, symbols map[string]bool) { + defer wg.Done() + + found, err := findImport(ctx, pass, dirScan, pkgName, symbols, filename) + + if err != nil { + firstErrOnce.Do(func() { + firstErr = err + cancel() + }) + return + } + + if found == nil { + return // No matching package. + } + + imp := &ImportInfo{ + ImportPath: found.importPathShort, + } + + pkg := &packageInfo{ + name: pkgName, + exports: symbols, + } + results <- result{imp, pkg} + }(pkgName, symbols) + } + go func() { + wg.Wait() + close(results) + }() + + for result := range results { + pass.addCandidate(result.imp, result.pkg) + } + return firstErr +} + +// notIdentifier reports whether ch is an invalid identifier character. +func notIdentifier(ch rune) bool { + return !('a' <= ch && ch <= 'z' || 'A' <= ch && ch <= 'Z' || + '0' <= ch && ch <= '9' || + ch == '_' || + ch >= utf8.RuneSelf && (unicode.IsLetter(ch) || unicode.IsDigit(ch))) +} + +// importPathToAssumedName returns the assumed package name of an import path. +// It does this using only string parsing of the import path. +// It picks the last element of the path that does not look like a major +// version, and then picks the valid identifier off the start of that element. +// It is used to determine if a local rename should be added to an import for +// clarity. +// This function could be moved to a standard package and exported if we want +// for use in other tools. +func importPathToAssumedName(importPath string) string { + base := path.Base(importPath) + if strings.HasPrefix(base, "v") { + if _, err := strconv.Atoi(base[1:]); err == nil { + dir := path.Dir(importPath) + if dir != "." { + base = path.Base(dir) + } + } + } + base = strings.TrimPrefix(base, "go-") + if i := strings.IndexFunc(base, notIdentifier); i >= 0 { + base = base[:i] + } + return base +} + +// gopathResolver implements resolver for GOPATH workspaces. +type gopathResolver struct { + env *ProcessEnv + cache *dirInfoCache +} + +func (r *gopathResolver) init() { + if r.cache == nil { + r.cache = &dirInfoCache{ + dirs: map[string]*directoryPackageInfo{}, + } + } +} + +func (r *gopathResolver) ClearForNewScan() { + r.cache = nil +} + +func (r *gopathResolver) loadPackageNames(importPaths []string, srcDir string) (map[string]string, error) { + r.init() + names := map[string]string{} + for _, path := range importPaths { + names[path] = importPathToName(r.env, path, srcDir) + } + return names, nil +} + +// importPathToName finds out the actual package name, as declared in its .go files. +// If there's a problem, it returns "". +func importPathToName(env *ProcessEnv, importPath, srcDir string) (packageName string) { + // Fast path for standard library without going to disk. + if _, ok := stdlib[importPath]; ok { + return path.Base(importPath) // stdlib packages always match their paths. + } + + buildPkg, err := env.buildContext().Import(importPath, srcDir, build.FindOnly) + if err != nil { + return "" + } + pkgName, err := packageDirToName(buildPkg.Dir) + if err != nil { + return "" + } + return pkgName +} + +// packageDirToName is a faster version of build.Import if +// the only thing desired is the package name. Given a directory, +// packageDirToName then only parses one file in the package, +// trusting that the files in the directory are consistent. +func packageDirToName(dir string) (packageName string, err error) { + d, err := os.Open(dir) + if err != nil { + return "", err + } + names, err := d.Readdirnames(-1) + d.Close() + if err != nil { + return "", err + } + sort.Strings(names) // to have predictable behavior + var lastErr error + var nfile int + for _, name := range names { + if !strings.HasSuffix(name, ".go") { + continue + } + if strings.HasSuffix(name, "_test.go") { + continue + } + nfile++ + fullFile := filepath.Join(dir, name) + + fset := token.NewFileSet() + f, err := parser.ParseFile(fset, fullFile, nil, parser.PackageClauseOnly) + if err != nil { + lastErr = err + continue + } + pkgName := f.Name.Name + if pkgName == "documentation" { + // Special case from go/build.ImportDir, not + // handled by ctx.MatchFile. + continue + } + if pkgName == "main" { + // Also skip package main, assuming it's a +build ignore generator or example. + // Since you can't import a package main anyway, there's no harm here. + continue + } + return pkgName, nil + } + if lastErr != nil { + return "", lastErr + } + return "", fmt.Errorf("no importable package found in %d Go files", nfile) +} + +type pkg struct { + goPackage *packages.Package + dir string // absolute file path to pkg directory ("/usr/lib/go/src/net/http") + importPathShort string // vendorless import path ("net/http", "a/b") + packageName string // package name loaded from source if requested + relevance int // a weakly-defined score of how relevant a package is. 0 is most relevant. +} + +type pkgDistance struct { + pkg *pkg + distance int // relative distance to target +} + +// byDistanceOrImportPathShortLength sorts by relative distance breaking ties +// on the short import path length and then the import string itself. +type byDistanceOrImportPathShortLength []pkgDistance + +func (s byDistanceOrImportPathShortLength) Len() int { return len(s) } +func (s byDistanceOrImportPathShortLength) Less(i, j int) bool { + di, dj := s[i].distance, s[j].distance + if di == -1 { + return false + } + if dj == -1 { + return true + } + if di != dj { + return di < dj + } + + vi, vj := s[i].pkg.importPathShort, s[j].pkg.importPathShort + if len(vi) != len(vj) { + return len(vi) < len(vj) + } + return vi < vj +} +func (s byDistanceOrImportPathShortLength) Swap(i, j int) { s[i], s[j] = s[j], s[i] } + +func distance(basepath, targetpath string) int { + p, err := filepath.Rel(basepath, targetpath) + if err != nil { + return -1 + } + if p == "." { + return 0 + } + return strings.Count(p, string(filepath.Separator)) + 1 +} + +func (r *gopathResolver) scan(_ references, loadNames bool, exclude []gopathwalk.RootType) ([]*pkg, error) { + r.init() + add := func(root gopathwalk.Root, dir string) { + // We assume cached directories have not changed. We can skip them and their + // children. + if _, ok := r.cache.Load(dir); ok { + return + } + + importpath := filepath.ToSlash(dir[len(root.Path)+len("/"):]) + info := directoryPackageInfo{ + status: directoryScanned, + dir: dir, + rootType: root.Type, + nonCanonicalImportPath: VendorlessPath(importpath), + } + r.cache.Store(dir, info) + } + roots := filterRoots(gopathwalk.SrcDirsRoots(r.env.buildContext()), exclude) + gopathwalk.Walk(roots, add, gopathwalk.Options{Debug: r.env.Debug, ModulesEnabled: false}) + var result []*pkg + for _, dir := range r.cache.Keys() { + info, ok := r.cache.Load(dir) + if !ok { + continue + } + if loadNames { + var err error + info, err = r.cache.CachePackageName(info) + if err != nil { + continue + } + } + + p := &pkg{ + importPathShort: info.nonCanonicalImportPath, + dir: dir, + relevance: 1, + packageName: info.packageName, + } + if info.rootType == gopathwalk.RootGOROOT { + p.relevance = 0 + } + result = append(result, p) + } + return result, nil +} + +func filterRoots(roots []gopathwalk.Root, exclude []gopathwalk.RootType) []gopathwalk.Root { + var result []gopathwalk.Root +outer: + for _, root := range roots { + for _, i := range exclude { + if i == root.Type { + continue outer + } + } + result = append(result, root) + } + return result +} + +func (r *gopathResolver) loadExports(ctx context.Context, pkg *pkg) (string, []string, error) { + r.init() + if info, ok := r.cache.Load(pkg.dir); ok { + return r.cache.CacheExports(ctx, r.env, info) + } + return loadExportsFromFiles(ctx, r.env, pkg.dir) +} + +// VendorlessPath returns the devendorized version of the import path ipath. +// For example, VendorlessPath("foo/bar/vendor/a/b") returns "a/b". +func VendorlessPath(ipath string) string { + // Devendorize for use in import statement. + if i := strings.LastIndex(ipath, "/vendor/"); i >= 0 { + return ipath[i+len("/vendor/"):] + } + if strings.HasPrefix(ipath, "vendor/") { + return ipath[len("vendor/"):] + } + return ipath +} + +func loadExportsFromFiles(ctx context.Context, env *ProcessEnv, dir string) (string, []string, error) { + var exports []string + + // Look for non-test, buildable .go files which could provide exports. + all, err := ioutil.ReadDir(dir) + if err != nil { + return "", nil, err + } + var files []os.FileInfo + for _, fi := range all { + name := fi.Name() + if !strings.HasSuffix(name, ".go") || strings.HasSuffix(name, "_test.go") { + continue + } + match, err := env.buildContext().MatchFile(dir, fi.Name()) + if err != nil || !match { + continue + } + files = append(files, fi) + } + + if len(files) == 0 { + return "", nil, fmt.Errorf("dir %v contains no buildable, non-test .go files", dir) + } + + var pkgName string + fset := token.NewFileSet() + for _, fi := range files { + select { + case <-ctx.Done(): + return "", nil, ctx.Err() + default: + } + + fullFile := filepath.Join(dir, fi.Name()) + f, err := parser.ParseFile(fset, fullFile, nil, 0) + if err != nil { + return "", nil, fmt.Errorf("parsing %s: %v", fullFile, err) + } + if f.Name.Name == "documentation" { + // Special case from go/build.ImportDir, not + // handled by MatchFile above. + continue + } + pkgName = f.Name.Name + for name := range f.Scope.Objects { + if ast.IsExported(name) { + exports = append(exports, name) + } + } + } + + if env.Debug { + sortedExports := append([]string(nil), exports...) + sort.Strings(sortedExports) + env.Logf("loaded exports in dir %v (package %v): %v", dir, pkgName, strings.Join(sortedExports, ", ")) + } + return pkgName, exports, nil +} + +// findImport searches for a package with the given symbols. +// If no package is found, findImport returns ("", false, nil) +func findImport(ctx context.Context, pass *pass, dirScan []*pkg, pkgName string, symbols map[string]bool, filename string) (*pkg, error) { + pkgDir, err := filepath.Abs(filename) + if err != nil { + return nil, err + } + pkgDir = filepath.Dir(pkgDir) + + // Find candidate packages, looking only at their directory names first. + var candidates []pkgDistance + for _, pkg := range dirScan { + if pkg.dir == pkgDir && pass.f.Name.Name == pkgName { + // The candidate is in the same directory and has the + // same package name. Don't try to import ourselves. + continue + } + if pkgIsCandidate(filename, pkgName, pkg) { + candidates = append(candidates, pkgDistance{ + pkg: pkg, + distance: distance(pkgDir, pkg.dir), + }) + } + } + + // Sort the candidates by their import package length, + // assuming that shorter package names are better than long + // ones. Note that this sorts by the de-vendored name, so + // there's no "penalty" for vendoring. + sort.Sort(byDistanceOrImportPathShortLength(candidates)) + if pass.env.Debug { + for i, c := range candidates { + pass.env.Logf("%s candidate %d/%d: %v in %v", pkgName, i+1, len(candidates), c.pkg.importPathShort, c.pkg.dir) + } + } + + // Collect exports for packages with matching names. + + rescv := make([]chan *pkg, len(candidates)) + for i := range candidates { + rescv[i] = make(chan *pkg, 1) + } + const maxConcurrentPackageImport = 4 + loadExportsSem := make(chan struct{}, maxConcurrentPackageImport) + + ctx, cancel := context.WithCancel(ctx) + var wg sync.WaitGroup + defer func() { + cancel() + wg.Wait() + }() + + wg.Add(1) + go func() { + defer wg.Done() + for i, c := range candidates { + select { + case loadExportsSem <- struct{}{}: + case <-ctx.Done(): + return + } + + wg.Add(1) + go func(c pkgDistance, resc chan<- *pkg) { + defer func() { + <-loadExportsSem + wg.Done() + }() + + if pass.env.Debug { + pass.env.Logf("loading exports in dir %s (seeking package %s)", c.pkg.dir, pkgName) + } + exports, err := loadExportsForPackage(ctx, pass.env, pkgName, c.pkg) + if err != nil { + if pass.env.Debug { + pass.env.Logf("loading exports in dir %s (seeking package %s): %v", c.pkg.dir, pkgName, err) + } + resc <- nil + return + } + + exportsMap := make(map[string]bool, len(exports)) + for _, sym := range exports { + exportsMap[sym] = true + } + + // If it doesn't have the right + // symbols, send nil to mean no match. + for symbol := range symbols { + if !exportsMap[symbol] { + resc <- nil + return + } + } + resc <- c.pkg + }(c, rescv[i]) + } + }() + + for _, resc := range rescv { + pkg := <-resc + if pkg == nil { + continue + } + return pkg, nil + } + return nil, nil +} + +func loadExportsForPackage(ctx context.Context, env *ProcessEnv, expectPkg string, pkg *pkg) ([]string, error) { + pkgName, exports, err := env.GetResolver().loadExports(ctx, pkg) + if err != nil { + return nil, err + } + if expectPkg != pkgName { + return nil, fmt.Errorf("dir %v is package %v, wanted %v", pkg.dir, pkgName, expectPkg) + } + return exports, err +} + +// pkgIsCandidate reports whether pkg is a candidate for satisfying the +// finding which package pkgIdent in the file named by filename is trying +// to refer to. +// +// This check is purely lexical and is meant to be as fast as possible +// because it's run over all $GOPATH directories to filter out poor +// candidates in order to limit the CPU and I/O later parsing the +// exports in candidate packages. +// +// filename is the file being formatted. +// pkgIdent is the package being searched for, like "client" (if +// searching for "client.New") +func pkgIsCandidate(filename, pkgIdent string, pkg *pkg) bool { + // Check "internal" and "vendor" visibility: + if !canUse(filename, pkg.dir) { + return false + } + + // Speed optimization to minimize disk I/O: + // the last two components on disk must contain the + // package name somewhere. + // + // This permits mismatch naming like directory + // "go-foo" being package "foo", or "pkg.v3" being "pkg", + // or directory "google.golang.org/api/cloudbilling/v1" + // being package "cloudbilling", but doesn't + // permit a directory "foo" to be package + // "bar", which is strongly discouraged + // anyway. There's no reason goimports needs + // to be slow just to accommodate that. + lastTwo := lastTwoComponents(pkg.importPathShort) + if strings.Contains(lastTwo, pkgIdent) { + return true + } + if hasHyphenOrUpperASCII(lastTwo) && !hasHyphenOrUpperASCII(pkgIdent) { + lastTwo = lowerASCIIAndRemoveHyphen(lastTwo) + if strings.Contains(lastTwo, pkgIdent) { + return true + } + } + + return false +} + +func hasHyphenOrUpperASCII(s string) bool { + for i := 0; i < len(s); i++ { + b := s[i] + if b == '-' || ('A' <= b && b <= 'Z') { + return true + } + } + return false +} + +func lowerASCIIAndRemoveHyphen(s string) (ret string) { + buf := make([]byte, 0, len(s)) + for i := 0; i < len(s); i++ { + b := s[i] + switch { + case b == '-': + continue + case 'A' <= b && b <= 'Z': + buf = append(buf, b+('a'-'A')) + default: + buf = append(buf, b) + } + } + return string(buf) +} + +// canUse reports whether the package in dir is usable from filename, +// respecting the Go "internal" and "vendor" visibility rules. +func canUse(filename, dir string) bool { + // Fast path check, before any allocations. If it doesn't contain vendor + // or internal, it's not tricky: + // Note that this can false-negative on directories like "notinternal", + // but we check it correctly below. This is just a fast path. + if !strings.Contains(dir, "vendor") && !strings.Contains(dir, "internal") { + return true + } + + dirSlash := filepath.ToSlash(dir) + if !strings.Contains(dirSlash, "/vendor/") && !strings.Contains(dirSlash, "/internal/") && !strings.HasSuffix(dirSlash, "/internal") { + return true + } + // Vendor or internal directory only visible from children of parent. + // That means the path from the current directory to the target directory + // can contain ../vendor or ../internal but not ../foo/vendor or ../foo/internal + // or bar/vendor or bar/internal. + // After stripping all the leading ../, the only okay place to see vendor or internal + // is at the very beginning of the path. + absfile, err := filepath.Abs(filename) + if err != nil { + return false + } + absdir, err := filepath.Abs(dir) + if err != nil { + return false + } + rel, err := filepath.Rel(absfile, absdir) + if err != nil { + return false + } + relSlash := filepath.ToSlash(rel) + if i := strings.LastIndex(relSlash, "../"); i >= 0 { + relSlash = relSlash[i+len("../"):] + } + return !strings.Contains(relSlash, "/vendor/") && !strings.Contains(relSlash, "/internal/") && !strings.HasSuffix(relSlash, "/internal") +} + +// lastTwoComponents returns at most the last two path components +// of v, using either / or \ as the path separator. +func lastTwoComponents(v string) string { + nslash := 0 + for i := len(v) - 1; i >= 0; i-- { + if v[i] == '/' || v[i] == '\\' { + nslash++ + if nslash == 2 { + return v[i:] + } + } + } + return v +} + +type visitFn func(node ast.Node) ast.Visitor + +func (fn visitFn) Visit(node ast.Node) ast.Visitor { + return fn(node) +} + +func copyExports(pkg []string) map[string]bool { + m := make(map[string]bool, len(pkg)) + for _, v := range pkg { + m[v] = true + } + return m +} diff --git a/vendor/golang.org/x/tools/internal/imports/imports.go b/vendor/golang.org/x/tools/internal/imports/imports.go new file mode 100644 index 00000000..ed3867bb --- /dev/null +++ b/vendor/golang.org/x/tools/internal/imports/imports.go @@ -0,0 +1,397 @@ +// Copyright 2013 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +//go:generate go run mkstdlib.go + +// Package imports implements a Go pretty-printer (like package "go/format") +// that also adds or removes import statements as necessary. +package imports + +import ( + "bufio" + "bytes" + "fmt" + "go/ast" + "go/build" + "go/format" + "go/parser" + "go/printer" + "go/token" + "io" + "io/ioutil" + "log" + "regexp" + "strconv" + "strings" + + "golang.org/x/tools/go/ast/astutil" +) + +// Options is golang.org/x/tools/imports.Options with extra internal-only options. +type Options struct { + Env *ProcessEnv // The environment to use. Note: this contains the cached module and filesystem state. + + Fragment bool // Accept fragment of a source file (no package statement) + AllErrors bool // Report all errors (not just the first 10 on different lines) + + Comments bool // Print comments (true if nil *Options provided) + TabIndent bool // Use tabs for indent (true if nil *Options provided) + TabWidth int // Tab width (8 if nil *Options provided) + + FormatOnly bool // Disable the insertion and deletion of imports +} + +// Process implements golang.org/x/tools/imports.Process with explicit context in env. +func Process(filename string, src []byte, opt *Options) (formatted []byte, err error) { + src, opt, err = initialize(filename, src, opt) + if err != nil { + return nil, err + } + + fileSet := token.NewFileSet() + file, adjust, err := parse(fileSet, filename, src, opt) + if err != nil { + return nil, err + } + + if !opt.FormatOnly { + if err := fixImports(fileSet, file, filename, opt.Env); err != nil { + return nil, err + } + } + return formatFile(fileSet, file, src, adjust, opt) +} + +// FixImports returns a list of fixes to the imports that, when applied, +// will leave the imports in the same state as Process. +// +// Note that filename's directory influences which imports can be chosen, +// so it is important that filename be accurate. +func FixImports(filename string, src []byte, opt *Options) (fixes []*ImportFix, err error) { + src, opt, err = initialize(filename, src, opt) + if err != nil { + return nil, err + } + + fileSet := token.NewFileSet() + file, _, err := parse(fileSet, filename, src, opt) + if err != nil { + return nil, err + } + + return getFixes(fileSet, file, filename, opt.Env) +} + +// ApplyFix will apply all of the fixes to the file and format it. +func ApplyFixes(fixes []*ImportFix, filename string, src []byte, opt *Options) (formatted []byte, err error) { + src, opt, err = initialize(filename, src, opt) + if err != nil { + return nil, err + } + + fileSet := token.NewFileSet() + file, adjust, err := parse(fileSet, filename, src, opt) + if err != nil { + return nil, err + } + + // Apply the fixes to the file. + apply(fileSet, file, fixes) + + return formatFile(fileSet, file, src, adjust, opt) +} + +// GetAllCandidates gets all of the standard library candidate packages to import in +// sorted order on import path. +func GetAllCandidates(filename string, opt *Options) (pkgs []ImportFix, err error) { + _, opt, err = initialize(filename, nil, opt) + if err != nil { + return nil, err + } + return getAllCandidates(filename, opt.Env) +} + +// GetPackageExports returns all known packages with name pkg and their exports. +func GetPackageExports(pkg, filename string, opt *Options) (exports []PackageExport, err error) { + _, opt, err = initialize(filename, nil, opt) + if err != nil { + return nil, err + } + return getPackageExports(pkg, filename, opt.Env) +} + +// initialize sets the values for opt and src. +// If they are provided, they are not changed. Otherwise opt is set to the +// default values and src is read from the file system. +func initialize(filename string, src []byte, opt *Options) ([]byte, *Options, error) { + // Use defaults if opt is nil. + if opt == nil { + opt = &Options{Comments: true, TabIndent: true, TabWidth: 8} + } + + // Set the env if the user has not provided it. + if opt.Env == nil { + opt.Env = &ProcessEnv{ + GOPATH: build.Default.GOPATH, + GOROOT: build.Default.GOROOT, + } + } + + // Set the logger if the user has not provided it. + if opt.Env.Logf == nil { + opt.Env.Logf = log.Printf + } + + if src == nil { + b, err := ioutil.ReadFile(filename) + if err != nil { + return nil, nil, err + } + src = b + } + + return src, opt, nil +} + +func formatFile(fileSet *token.FileSet, file *ast.File, src []byte, adjust func(orig []byte, src []byte) []byte, opt *Options) ([]byte, error) { + mergeImports(opt.Env, fileSet, file) + sortImports(opt.Env, fileSet, file) + imps := astutil.Imports(fileSet, file) + var spacesBefore []string // import paths we need spaces before + for _, impSection := range imps { + // Within each block of contiguous imports, see if any + // import lines are in different group numbers. If so, + // we'll need to put a space between them so it's + // compatible with gofmt. + lastGroup := -1 + for _, importSpec := range impSection { + importPath, _ := strconv.Unquote(importSpec.Path.Value) + groupNum := importGroup(opt.Env, importPath) + if groupNum != lastGroup && lastGroup != -1 { + spacesBefore = append(spacesBefore, importPath) + } + lastGroup = groupNum + } + + } + + printerMode := printer.UseSpaces + if opt.TabIndent { + printerMode |= printer.TabIndent + } + printConfig := &printer.Config{Mode: printerMode, Tabwidth: opt.TabWidth} + + var buf bytes.Buffer + err := printConfig.Fprint(&buf, fileSet, file) + if err != nil { + return nil, err + } + out := buf.Bytes() + if adjust != nil { + out = adjust(src, out) + } + if len(spacesBefore) > 0 { + out, err = addImportSpaces(bytes.NewReader(out), spacesBefore) + if err != nil { + return nil, err + } + } + + out, err = format.Source(out) + if err != nil { + return nil, err + } + return out, nil +} + +// parse parses src, which was read from filename, +// as a Go source file or statement list. +func parse(fset *token.FileSet, filename string, src []byte, opt *Options) (*ast.File, func(orig, src []byte) []byte, error) { + parserMode := parser.Mode(0) + if opt.Comments { + parserMode |= parser.ParseComments + } + if opt.AllErrors { + parserMode |= parser.AllErrors + } + + // Try as whole source file. + file, err := parser.ParseFile(fset, filename, src, parserMode) + if err == nil { + return file, nil, nil + } + // If the error is that the source file didn't begin with a + // package line and we accept fragmented input, fall through to + // try as a source fragment. Stop and return on any other error. + if !opt.Fragment || !strings.Contains(err.Error(), "expected 'package'") { + return nil, nil, err + } + + // If this is a declaration list, make it a source file + // by inserting a package clause. + // Insert using a ;, not a newline, so that parse errors are on + // the correct line. + const prefix = "package main;" + psrc := append([]byte(prefix), src...) + file, err = parser.ParseFile(fset, filename, psrc, parserMode) + if err == nil { + // Gofmt will turn the ; into a \n. + // Do that ourselves now and update the file contents, + // so that positions and line numbers are correct going forward. + psrc[len(prefix)-1] = '\n' + fset.File(file.Package).SetLinesForContent(psrc) + + // If a main function exists, we will assume this is a main + // package and leave the file. + if containsMainFunc(file) { + return file, nil, nil + } + + adjust := func(orig, src []byte) []byte { + // Remove the package clause. + src = src[len(prefix):] + return matchSpace(orig, src) + } + return file, adjust, nil + } + // If the error is that the source file didn't begin with a + // declaration, fall through to try as a statement list. + // Stop and return on any other error. + if !strings.Contains(err.Error(), "expected declaration") { + return nil, nil, err + } + + // If this is a statement list, make it a source file + // by inserting a package clause and turning the list + // into a function body. This handles expressions too. + // Insert using a ;, not a newline, so that the line numbers + // in fsrc match the ones in src. + fsrc := append(append([]byte("package p; func _() {"), src...), '}') + file, err = parser.ParseFile(fset, filename, fsrc, parserMode) + if err == nil { + adjust := func(orig, src []byte) []byte { + // Remove the wrapping. + // Gofmt has turned the ; into a \n\n. + src = src[len("package p\n\nfunc _() {"):] + src = src[:len(src)-len("}\n")] + // Gofmt has also indented the function body one level. + // Remove that indent. + src = bytes.Replace(src, []byte("\n\t"), []byte("\n"), -1) + return matchSpace(orig, src) + } + return file, adjust, nil + } + + // Failed, and out of options. + return nil, nil, err +} + +// containsMainFunc checks if a file contains a function declaration with the +// function signature 'func main()' +func containsMainFunc(file *ast.File) bool { + for _, decl := range file.Decls { + if f, ok := decl.(*ast.FuncDecl); ok { + if f.Name.Name != "main" { + continue + } + + if len(f.Type.Params.List) != 0 { + continue + } + + if f.Type.Results != nil && len(f.Type.Results.List) != 0 { + continue + } + + return true + } + } + + return false +} + +func cutSpace(b []byte) (before, middle, after []byte) { + i := 0 + for i < len(b) && (b[i] == ' ' || b[i] == '\t' || b[i] == '\n') { + i++ + } + j := len(b) + for j > 0 && (b[j-1] == ' ' || b[j-1] == '\t' || b[j-1] == '\n') { + j-- + } + if i <= j { + return b[:i], b[i:j], b[j:] + } + return nil, nil, b[j:] +} + +// matchSpace reformats src to use the same space context as orig. +// 1) If orig begins with blank lines, matchSpace inserts them at the beginning of src. +// 2) matchSpace copies the indentation of the first non-blank line in orig +// to every non-blank line in src. +// 3) matchSpace copies the trailing space from orig and uses it in place +// of src's trailing space. +func matchSpace(orig []byte, src []byte) []byte { + before, _, after := cutSpace(orig) + i := bytes.LastIndex(before, []byte{'\n'}) + before, indent := before[:i+1], before[i+1:] + + _, src, _ = cutSpace(src) + + var b bytes.Buffer + b.Write(before) + for len(src) > 0 { + line := src + if i := bytes.IndexByte(line, '\n'); i >= 0 { + line, src = line[:i+1], line[i+1:] + } else { + src = nil + } + if len(line) > 0 && line[0] != '\n' { // not blank + b.Write(indent) + } + b.Write(line) + } + b.Write(after) + return b.Bytes() +} + +var impLine = regexp.MustCompile(`^\s+(?:[\w\.]+\s+)?"(.+)"`) + +func addImportSpaces(r io.Reader, breaks []string) ([]byte, error) { + var out bytes.Buffer + in := bufio.NewReader(r) + inImports := false + done := false + for { + s, err := in.ReadString('\n') + if err == io.EOF { + break + } else if err != nil { + return nil, err + } + + if !inImports && !done && strings.HasPrefix(s, "import") { + inImports = true + } + if inImports && (strings.HasPrefix(s, "var") || + strings.HasPrefix(s, "func") || + strings.HasPrefix(s, "const") || + strings.HasPrefix(s, "type")) { + done = true + inImports = false + } + if inImports && len(breaks) > 0 { + if m := impLine.FindStringSubmatch(s); m != nil { + if m[1] == breaks[0] { + out.WriteByte('\n') + breaks = breaks[1:] + } + } + } + + fmt.Fprint(&out, s) + } + return out.Bytes(), nil +} diff --git a/vendor/golang.org/x/tools/internal/imports/mod.go b/vendor/golang.org/x/tools/internal/imports/mod.go new file mode 100644 index 00000000..0f9b87eb --- /dev/null +++ b/vendor/golang.org/x/tools/internal/imports/mod.go @@ -0,0 +1,643 @@ +package imports + +import ( + "bytes" + "context" + "encoding/json" + "fmt" + "io/ioutil" + "os" + "path" + "path/filepath" + "regexp" + "sort" + "strconv" + "strings" + "sync" + + "golang.org/x/tools/internal/gopathwalk" + "golang.org/x/tools/internal/module" + "golang.org/x/tools/internal/semver" +) + +// ModuleResolver implements resolver for modules using the go command as little +// as feasible. +type ModuleResolver struct { + env *ProcessEnv + moduleCacheDir string + dummyVendorMod *ModuleJSON // If vendoring is enabled, the pseudo-module that represents the /vendor directory. + + Initialized bool + Main *ModuleJSON + ModsByModPath []*ModuleJSON // All modules, ordered by # of path components in module Path... + ModsByDir []*ModuleJSON // ...or Dir. + + // moduleCacheCache stores information about the module cache. + moduleCacheCache *dirInfoCache + otherCache *dirInfoCache +} + +type ModuleJSON struct { + Path string // module path + Replace *ModuleJSON // replaced by this module + Main bool // is this the main module? + Dir string // directory holding files for this module, if any + GoMod string // path to go.mod file for this module, if any + GoVersion string // go version used in module +} + +func (r *ModuleResolver) init() error { + if r.Initialized { + return nil + } + mainMod, vendorEnabled, err := vendorEnabled(r.env) + if err != nil { + return err + } + + if mainMod != nil && vendorEnabled { + // Vendor mode is on, so all the non-Main modules are irrelevant, + // and we need to search /vendor for everything. + r.Main = mainMod + r.dummyVendorMod = &ModuleJSON{ + Path: "", + Dir: filepath.Join(mainMod.Dir, "vendor"), + } + r.ModsByModPath = []*ModuleJSON{mainMod, r.dummyVendorMod} + r.ModsByDir = []*ModuleJSON{mainMod, r.dummyVendorMod} + } else { + // Vendor mode is off, so run go list -m ... to find everything. + r.initAllMods() + } + + r.moduleCacheDir = filepath.Join(filepath.SplitList(r.env.GOPATH)[0], "/pkg/mod") + + sort.Slice(r.ModsByModPath, func(i, j int) bool { + count := func(x int) int { + return strings.Count(r.ModsByModPath[x].Path, "/") + } + return count(j) < count(i) // descending order + }) + sort.Slice(r.ModsByDir, func(i, j int) bool { + count := func(x int) int { + return strings.Count(r.ModsByDir[x].Dir, "/") + } + return count(j) < count(i) // descending order + }) + + if r.moduleCacheCache == nil { + r.moduleCacheCache = &dirInfoCache{ + dirs: map[string]*directoryPackageInfo{}, + } + } + if r.otherCache == nil { + r.otherCache = &dirInfoCache{ + dirs: map[string]*directoryPackageInfo{}, + } + } + r.Initialized = true + return nil +} + +func (r *ModuleResolver) initAllMods() error { + stdout, err := r.env.invokeGo("list", "-m", "-json", "...") + if err != nil { + return err + } + for dec := json.NewDecoder(stdout); dec.More(); { + mod := &ModuleJSON{} + if err := dec.Decode(mod); err != nil { + return err + } + if mod.Dir == "" { + if r.env.Debug { + r.env.Logf("module %v has not been downloaded and will be ignored", mod.Path) + } + // Can't do anything with a module that's not downloaded. + continue + } + r.ModsByModPath = append(r.ModsByModPath, mod) + r.ModsByDir = append(r.ModsByDir, mod) + if mod.Main { + r.Main = mod + } + } + return nil +} + +func (r *ModuleResolver) ClearForNewScan() { + r.otherCache = &dirInfoCache{ + dirs: map[string]*directoryPackageInfo{}, + } +} + +func (r *ModuleResolver) ClearForNewMod() { + env := r.env + *r = ModuleResolver{ + env: env, + } + r.init() +} + +// findPackage returns the module and directory that contains the package at +// the given import path, or returns nil, "" if no module is in scope. +func (r *ModuleResolver) findPackage(importPath string) (*ModuleJSON, string) { + // This can't find packages in the stdlib, but that's harmless for all + // the existing code paths. + for _, m := range r.ModsByModPath { + if !strings.HasPrefix(importPath, m.Path) { + continue + } + pathInModule := importPath[len(m.Path):] + pkgDir := filepath.Join(m.Dir, pathInModule) + if r.dirIsNestedModule(pkgDir, m) { + continue + } + + if info, ok := r.cacheLoad(pkgDir); ok { + if loaded, err := info.reachedStatus(nameLoaded); loaded { + if err != nil { + continue // No package in this dir. + } + return m, pkgDir + } + if scanned, err := info.reachedStatus(directoryScanned); scanned && err != nil { + continue // Dir is unreadable, etc. + } + // This is slightly wrong: a directory doesn't have to have an + // importable package to count as a package for package-to-module + // resolution. package main or _test files should count but + // don't. + // TODO(heschi): fix this. + if _, err := r.cachePackageName(info); err == nil { + return m, pkgDir + } + } + + // Not cached. Read the filesystem. + pkgFiles, err := ioutil.ReadDir(pkgDir) + if err != nil { + continue + } + // A module only contains a package if it has buildable go + // files in that directory. If not, it could be provided by an + // outer module. See #29736. + for _, fi := range pkgFiles { + if ok, _ := r.env.buildContext().MatchFile(pkgDir, fi.Name()); ok { + return m, pkgDir + } + } + } + return nil, "" +} + +func (r *ModuleResolver) cacheLoad(dir string) (directoryPackageInfo, bool) { + if info, ok := r.moduleCacheCache.Load(dir); ok { + return info, ok + } + return r.otherCache.Load(dir) +} + +func (r *ModuleResolver) cacheStore(info directoryPackageInfo) { + if info.rootType == gopathwalk.RootModuleCache { + r.moduleCacheCache.Store(info.dir, info) + } else { + r.otherCache.Store(info.dir, info) + } +} + +func (r *ModuleResolver) cacheKeys() []string { + return append(r.moduleCacheCache.Keys(), r.otherCache.Keys()...) +} + +// cachePackageName caches the package name for a dir already in the cache. +func (r *ModuleResolver) cachePackageName(info directoryPackageInfo) (directoryPackageInfo, error) { + if info.rootType == gopathwalk.RootModuleCache { + return r.moduleCacheCache.CachePackageName(info) + } + return r.otherCache.CachePackageName(info) +} + +func (r *ModuleResolver) cacheExports(ctx context.Context, env *ProcessEnv, info directoryPackageInfo) (string, []string, error) { + if info.rootType == gopathwalk.RootModuleCache { + return r.moduleCacheCache.CacheExports(ctx, env, info) + } + return r.otherCache.CacheExports(ctx, env, info) +} + +// findModuleByDir returns the module that contains dir, or nil if no such +// module is in scope. +func (r *ModuleResolver) findModuleByDir(dir string) *ModuleJSON { + // This is quite tricky and may not be correct. dir could be: + // - a package in the main module. + // - a replace target underneath the main module's directory. + // - a nested module in the above. + // - a replace target somewhere totally random. + // - a nested module in the above. + // - in the mod cache. + // - in /vendor/ in -mod=vendor mode. + // - nested module? Dunno. + // Rumor has it that replace targets cannot contain other replace targets. + for _, m := range r.ModsByDir { + if !strings.HasPrefix(dir, m.Dir) { + continue + } + + if r.dirIsNestedModule(dir, m) { + continue + } + + return m + } + return nil +} + +// dirIsNestedModule reports if dir is contained in a nested module underneath +// mod, not actually in mod. +func (r *ModuleResolver) dirIsNestedModule(dir string, mod *ModuleJSON) bool { + if !strings.HasPrefix(dir, mod.Dir) { + return false + } + if r.dirInModuleCache(dir) { + // Nested modules in the module cache are pruned, + // so it cannot be a nested module. + return false + } + if mod != nil && mod == r.dummyVendorMod { + // The /vendor pseudomodule is flattened and doesn't actually count. + return false + } + modDir, _ := r.modInfo(dir) + if modDir == "" { + return false + } + return modDir != mod.Dir +} + +func (r *ModuleResolver) modInfo(dir string) (modDir string, modName string) { + readModName := func(modFile string) string { + modBytes, err := ioutil.ReadFile(modFile) + if err != nil { + return "" + } + return modulePath(modBytes) + } + + if r.dirInModuleCache(dir) { + matches := modCacheRegexp.FindStringSubmatch(dir) + index := strings.Index(dir, matches[1]+"@"+matches[2]) + modDir := filepath.Join(dir[:index], matches[1]+"@"+matches[2]) + return modDir, readModName(filepath.Join(modDir, "go.mod")) + } + for { + if info, ok := r.cacheLoad(dir); ok { + return info.moduleDir, info.moduleName + } + f := filepath.Join(dir, "go.mod") + info, err := os.Stat(f) + if err == nil && !info.IsDir() { + return dir, readModName(f) + } + + d := filepath.Dir(dir) + if len(d) >= len(dir) { + return "", "" // reached top of file system, no go.mod + } + dir = d + } +} + +func (r *ModuleResolver) dirInModuleCache(dir string) bool { + if r.moduleCacheDir == "" { + return false + } + return strings.HasPrefix(dir, r.moduleCacheDir) +} + +func (r *ModuleResolver) loadPackageNames(importPaths []string, srcDir string) (map[string]string, error) { + if err := r.init(); err != nil { + return nil, err + } + names := map[string]string{} + for _, path := range importPaths { + _, packageDir := r.findPackage(path) + if packageDir == "" { + continue + } + name, err := packageDirToName(packageDir) + if err != nil { + continue + } + names[path] = name + } + return names, nil +} + +func (r *ModuleResolver) scan(_ references, loadNames bool, exclude []gopathwalk.RootType) ([]*pkg, error) { + if err := r.init(); err != nil { + return nil, err + } + + // Walk GOROOT, GOPATH/pkg/mod, and the main module. + roots := []gopathwalk.Root{ + {filepath.Join(r.env.GOROOT, "/src"), gopathwalk.RootGOROOT}, + } + if r.Main != nil { + roots = append(roots, gopathwalk.Root{r.Main.Dir, gopathwalk.RootCurrentModule}) + } + if r.dummyVendorMod != nil { + roots = append(roots, gopathwalk.Root{r.dummyVendorMod.Dir, gopathwalk.RootOther}) + } else { + roots = append(roots, gopathwalk.Root{r.moduleCacheDir, gopathwalk.RootModuleCache}) + // Walk replace targets, just in case they're not in any of the above. + for _, mod := range r.ModsByModPath { + if mod.Replace != nil { + roots = append(roots, gopathwalk.Root{mod.Dir, gopathwalk.RootOther}) + } + } + } + + roots = filterRoots(roots, exclude) + + var result []*pkg + var mu sync.Mutex + + // We assume cached directories have not changed. We can skip them and their + // children. + skip := func(root gopathwalk.Root, dir string) bool { + mu.Lock() + defer mu.Unlock() + + info, ok := r.cacheLoad(dir) + if !ok { + return false + } + // This directory can be skipped as long as we have already scanned it. + // Packages with errors will continue to have errors, so there is no need + // to rescan them. + packageScanned, _ := info.reachedStatus(directoryScanned) + return packageScanned + } + + // Add anything new to the cache. We'll process everything in it below. + add := func(root gopathwalk.Root, dir string) { + mu.Lock() + defer mu.Unlock() + + r.cacheStore(r.scanDirForPackage(root, dir)) + } + + gopathwalk.WalkSkip(roots, add, skip, gopathwalk.Options{Debug: r.env.Debug, ModulesEnabled: true}) + + // Everything we already had, and everything new, is now in the cache. + for _, dir := range r.cacheKeys() { + info, ok := r.cacheLoad(dir) + if !ok { + continue + } + + // Skip this directory if we were not able to get the package information successfully. + if scanned, err := info.reachedStatus(directoryScanned); !scanned || err != nil { + continue + } + + // If we want package names, make sure the cache has them. + if loadNames { + var err error + if info, err = r.cachePackageName(info); err != nil { + continue + } + } + + res, err := r.canonicalize(info) + if err != nil { + continue + } + result = append(result, res) + } + + return result, nil +} + +// canonicalize gets the result of canonicalizing the packages using the results +// of initializing the resolver from 'go list -m'. +func (r *ModuleResolver) canonicalize(info directoryPackageInfo) (*pkg, error) { + // Packages in GOROOT are already canonical, regardless of the std/cmd modules. + if info.rootType == gopathwalk.RootGOROOT { + return &pkg{ + importPathShort: info.nonCanonicalImportPath, + dir: info.dir, + packageName: path.Base(info.nonCanonicalImportPath), + relevance: 0, + }, nil + } + + importPath := info.nonCanonicalImportPath + relevance := 2 + // Check if the directory is underneath a module that's in scope. + if mod := r.findModuleByDir(info.dir); mod != nil { + relevance = 1 + // It is. If dir is the target of a replace directive, + // our guessed import path is wrong. Use the real one. + if mod.Dir == info.dir { + importPath = mod.Path + } else { + dirInMod := info.dir[len(mod.Dir)+len("/"):] + importPath = path.Join(mod.Path, filepath.ToSlash(dirInMod)) + } + } else if info.needsReplace { + return nil, fmt.Errorf("package in %q is not valid without a replace statement", info.dir) + } + + res := &pkg{ + importPathShort: importPath, + dir: info.dir, + packageName: info.packageName, // may not be populated if the caller didn't ask for it + relevance: relevance, + } + // We may have discovered a package that has a different version + // in scope already. Canonicalize to that one if possible. + if _, canonicalDir := r.findPackage(importPath); canonicalDir != "" { + res.dir = canonicalDir + } + return res, nil +} + +func (r *ModuleResolver) loadExports(ctx context.Context, pkg *pkg) (string, []string, error) { + if err := r.init(); err != nil { + return "", nil, err + } + if info, ok := r.cacheLoad(pkg.dir); ok { + return r.cacheExports(ctx, r.env, info) + } + return loadExportsFromFiles(ctx, r.env, pkg.dir) +} + +func (r *ModuleResolver) scanDirForPackage(root gopathwalk.Root, dir string) directoryPackageInfo { + subdir := "" + if dir != root.Path { + subdir = dir[len(root.Path)+len("/"):] + } + importPath := filepath.ToSlash(subdir) + if strings.HasPrefix(importPath, "vendor/") { + // Only enter vendor directories if they're explicitly requested as a root. + return directoryPackageInfo{ + status: directoryScanned, + err: fmt.Errorf("unwanted vendor directory"), + } + } + switch root.Type { + case gopathwalk.RootCurrentModule: + importPath = path.Join(r.Main.Path, filepath.ToSlash(subdir)) + case gopathwalk.RootModuleCache: + matches := modCacheRegexp.FindStringSubmatch(subdir) + if len(matches) == 0 { + return directoryPackageInfo{ + status: directoryScanned, + err: fmt.Errorf("invalid module cache path: %v", subdir), + } + } + modPath, err := module.DecodePath(filepath.ToSlash(matches[1])) + if err != nil { + if r.env.Debug { + r.env.Logf("decoding module cache path %q: %v", subdir, err) + } + return directoryPackageInfo{ + status: directoryScanned, + err: fmt.Errorf("decoding module cache path %q: %v", subdir, err), + } + } + importPath = path.Join(modPath, filepath.ToSlash(matches[3])) + } + + modDir, modName := r.modInfo(dir) + result := directoryPackageInfo{ + status: directoryScanned, + dir: dir, + rootType: root.Type, + nonCanonicalImportPath: importPath, + needsReplace: false, + moduleDir: modDir, + moduleName: modName, + } + if root.Type == gopathwalk.RootGOROOT { + // stdlib packages are always in scope, despite the confusing go.mod + return result + } + // Check that this package is not obviously impossible to import. + if !strings.HasPrefix(importPath, modName) { + // The module's declared path does not match + // its expected path. It probably needs a + // replace directive we don't have. + result.needsReplace = true + } + + return result +} + +// modCacheRegexp splits a path in a module cache into module, module version, and package. +var modCacheRegexp = regexp.MustCompile(`(.*)@([^/\\]*)(.*)`) + +var ( + slashSlash = []byte("//") + moduleStr = []byte("module") +) + +// modulePath returns the module path from the gomod file text. +// If it cannot find a module path, it returns an empty string. +// It is tolerant of unrelated problems in the go.mod file. +// +// Copied from cmd/go/internal/modfile. +func modulePath(mod []byte) string { + for len(mod) > 0 { + line := mod + mod = nil + if i := bytes.IndexByte(line, '\n'); i >= 0 { + line, mod = line[:i], line[i+1:] + } + if i := bytes.Index(line, slashSlash); i >= 0 { + line = line[:i] + } + line = bytes.TrimSpace(line) + if !bytes.HasPrefix(line, moduleStr) { + continue + } + line = line[len(moduleStr):] + n := len(line) + line = bytes.TrimSpace(line) + if len(line) == n || len(line) == 0 { + continue + } + + if line[0] == '"' || line[0] == '`' { + p, err := strconv.Unquote(string(line)) + if err != nil { + return "" // malformed quoted string or multiline module path + } + return p + } + + return string(line) + } + return "" // missing module path +} + +var modFlagRegexp = regexp.MustCompile(`-mod[ =](\w+)`) + +// vendorEnabled indicates if vendoring is enabled. +// Inspired by setDefaultBuildMod in modload/init.go +func vendorEnabled(env *ProcessEnv) (*ModuleJSON, bool, error) { + mainMod, go114, err := getMainModuleAnd114(env) + if err != nil { + return nil, false, err + } + matches := modFlagRegexp.FindStringSubmatch(env.GOFLAGS) + var modFlag string + if len(matches) != 0 { + modFlag = matches[1] + } + if modFlag != "" { + // Don't override an explicit '-mod=' argument. + return mainMod, modFlag == "vendor", nil + } + if mainMod == nil || !go114 { + return mainMod, false, nil + } + // Check 1.14's automatic vendor mode. + if fi, err := os.Stat(filepath.Join(mainMod.Dir, "vendor")); err == nil && fi.IsDir() { + if mainMod.GoVersion != "" && semver.Compare("v"+mainMod.GoVersion, "v1.14") >= 0 { + // The Go version is at least 1.14, and a vendor directory exists. + // Set -mod=vendor by default. + return mainMod, true, nil + } + } + return mainMod, false, nil +} + +// getMainModuleAnd114 gets the main module's information and whether the +// go command in use is 1.14+. This is the information needed to figure out +// if vendoring should be enabled. +func getMainModuleAnd114(env *ProcessEnv) (*ModuleJSON, bool, error) { + const format = `{{.Path}} +{{.Dir}} +{{.GoMod}} +{{.GoVersion}} +{{range context.ReleaseTags}}{{if eq . "go1.14"}}{{.}}{{end}}{{end}} +` + stdout, err := env.invokeGo("list", "-m", "-f", format) + if err != nil { + return nil, false, nil + } + lines := strings.Split(stdout.String(), "\n") + if len(lines) < 5 { + return nil, false, fmt.Errorf("unexpected stdout: %q", stdout) + } + mod := &ModuleJSON{ + Path: lines[0], + Dir: lines[1], + GoMod: lines[2], + GoVersion: lines[3], + Main: true, + } + return mod, lines[4] == "go1.14", nil +} diff --git a/vendor/golang.org/x/tools/internal/imports/mod_cache.go b/vendor/golang.org/x/tools/internal/imports/mod_cache.go new file mode 100644 index 00000000..f6b070a3 --- /dev/null +++ b/vendor/golang.org/x/tools/internal/imports/mod_cache.go @@ -0,0 +1,165 @@ +package imports + +import ( + "context" + "fmt" + "sync" + + "golang.org/x/tools/internal/gopathwalk" +) + +// To find packages to import, the resolver needs to know about all of the +// the packages that could be imported. This includes packages that are +// already in modules that are in (1) the current module, (2) replace targets, +// and (3) packages in the module cache. Packages in (1) and (2) may change over +// time, as the client may edit the current module and locally replaced modules. +// The module cache (which includes all of the packages in (3)) can only +// ever be added to. +// +// The resolver can thus save state about packages in the module cache +// and guarantee that this will not change over time. To obtain information +// about new modules added to the module cache, the module cache should be +// rescanned. +// +// It is OK to serve information about modules that have been deleted, +// as they do still exist. +// TODO(suzmue): can we share information with the caller about +// what module needs to be downloaded to import this package? + +type directoryPackageStatus int + +const ( + _ directoryPackageStatus = iota + directoryScanned + nameLoaded + exportsLoaded +) + +type directoryPackageInfo struct { + // status indicates the extent to which this struct has been filled in. + status directoryPackageStatus + // err is non-nil when there was an error trying to reach status. + err error + + // Set when status >= directoryScanned. + + // dir is the absolute directory of this package. + dir string + rootType gopathwalk.RootType + // nonCanonicalImportPath is the package's expected import path. It may + // not actually be importable at that path. + nonCanonicalImportPath string + // needsReplace is true if the nonCanonicalImportPath does not match the + // module's declared path, making it impossible to import without a + // replace directive. + needsReplace bool + + // Module-related information. + moduleDir string // The directory that is the module root of this dir. + moduleName string // The module name that contains this dir. + + // Set when status >= nameLoaded. + + packageName string // the package name, as declared in the source. + + // Set when status >= exportsLoaded. + + exports []string +} + +// reachedStatus returns true when info has a status at least target and any error associated with +// an attempt to reach target. +func (info *directoryPackageInfo) reachedStatus(target directoryPackageStatus) (bool, error) { + if info.err == nil { + return info.status >= target, nil + } + if info.status == target { + return true, info.err + } + return true, nil +} + +// dirInfoCache is a concurrency safe map for storing information about +// directories that may contain packages. +// +// The information in this cache is built incrementally. Entries are initialized in scan. +// No new keys should be added in any other functions, as all directories containing +// packages are identified in scan. +// +// Other functions, including loadExports and findPackage, may update entries in this cache +// as they discover new things about the directory. +// +// The information in the cache is not expected to change for the cache's +// lifetime, so there is no protection against competing writes. Users should +// take care not to hold the cache across changes to the underlying files. +// +// TODO(suzmue): consider other concurrency strategies and data structures (RWLocks, sync.Map, etc) +type dirInfoCache struct { + mu sync.Mutex + // dirs stores information about packages in directories, keyed by absolute path. + dirs map[string]*directoryPackageInfo +} + +// Store stores the package info for dir. +func (d *dirInfoCache) Store(dir string, info directoryPackageInfo) { + d.mu.Lock() + defer d.mu.Unlock() + stored := info // defensive copy + d.dirs[dir] = &stored +} + +// Load returns a copy of the directoryPackageInfo for absolute directory dir. +func (d *dirInfoCache) Load(dir string) (directoryPackageInfo, bool) { + d.mu.Lock() + defer d.mu.Unlock() + info, ok := d.dirs[dir] + if !ok { + return directoryPackageInfo{}, false + } + return *info, true +} + +// Keys returns the keys currently present in d. +func (d *dirInfoCache) Keys() (keys []string) { + d.mu.Lock() + defer d.mu.Unlock() + for key := range d.dirs { + keys = append(keys, key) + } + return keys +} + +func (d *dirInfoCache) CachePackageName(info directoryPackageInfo) (directoryPackageInfo, error) { + if loaded, err := info.reachedStatus(nameLoaded); loaded { + return info, err + } + if scanned, err := info.reachedStatus(directoryScanned); !scanned || err != nil { + return info, fmt.Errorf("cannot read package name, scan error: %v", err) + } + info.packageName, info.err = packageDirToName(info.dir) + info.status = nameLoaded + d.Store(info.dir, info) + return info, info.err +} + +func (d *dirInfoCache) CacheExports(ctx context.Context, env *ProcessEnv, info directoryPackageInfo) (string, []string, error) { + if reached, _ := info.reachedStatus(exportsLoaded); reached { + return info.packageName, info.exports, info.err + } + if reached, err := info.reachedStatus(nameLoaded); reached && err != nil { + return "", nil, err + } + info.packageName, info.exports, info.err = loadExportsFromFiles(ctx, env, info.dir) + if info.err == context.Canceled { + return info.packageName, info.exports, info.err + } + // The cache structure wants things to proceed linearly. We can skip a + // step here, but only if we succeed. + if info.status == nameLoaded || info.err == nil { + info.status = exportsLoaded + } else { + info.status = nameLoaded + } + d.Store(info.dir, info) + return info.packageName, info.exports, info.err +} diff --git a/vendor/golang.org/x/tools/internal/imports/sortimports.go b/vendor/golang.org/x/tools/internal/imports/sortimports.go new file mode 100644 index 00000000..22627947 --- /dev/null +++ b/vendor/golang.org/x/tools/internal/imports/sortimports.go @@ -0,0 +1,280 @@ +// Copyright 2013 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Hacked up copy of go/ast/import.go + +package imports + +import ( + "go/ast" + "go/token" + "sort" + "strconv" +) + +// sortImports sorts runs of consecutive import lines in import blocks in f. +// It also removes duplicate imports when it is possible to do so without data loss. +func sortImports(env *ProcessEnv, fset *token.FileSet, f *ast.File) { + for i, d := range f.Decls { + d, ok := d.(*ast.GenDecl) + if !ok || d.Tok != token.IMPORT { + // Not an import declaration, so we're done. + // Imports are always first. + break + } + + if len(d.Specs) == 0 { + // Empty import block, remove it. + f.Decls = append(f.Decls[:i], f.Decls[i+1:]...) + } + + if !d.Lparen.IsValid() { + // Not a block: sorted by default. + continue + } + + // Identify and sort runs of specs on successive lines. + i := 0 + specs := d.Specs[:0] + for j, s := range d.Specs { + if j > i && fset.Position(s.Pos()).Line > 1+fset.Position(d.Specs[j-1].End()).Line { + // j begins a new run. End this one. + specs = append(specs, sortSpecs(env, fset, f, d.Specs[i:j])...) + i = j + } + } + specs = append(specs, sortSpecs(env, fset, f, d.Specs[i:])...) + d.Specs = specs + + // Deduping can leave a blank line before the rparen; clean that up. + if len(d.Specs) > 0 { + lastSpec := d.Specs[len(d.Specs)-1] + lastLine := fset.Position(lastSpec.Pos()).Line + if rParenLine := fset.Position(d.Rparen).Line; rParenLine > lastLine+1 { + fset.File(d.Rparen).MergeLine(rParenLine - 1) + } + } + } +} + +// mergeImports merges all the import declarations into the first one. +// Taken from golang.org/x/tools/ast/astutil. +func mergeImports(env *ProcessEnv, fset *token.FileSet, f *ast.File) { + if len(f.Decls) <= 1 { + return + } + + // Merge all the import declarations into the first one. + var first *ast.GenDecl + for i := 0; i < len(f.Decls); i++ { + decl := f.Decls[i] + gen, ok := decl.(*ast.GenDecl) + if !ok || gen.Tok != token.IMPORT || declImports(gen, "C") { + continue + } + if first == nil { + first = gen + continue // Don't touch the first one. + } + // We now know there is more than one package in this import + // declaration. Ensure that it ends up parenthesized. + first.Lparen = first.Pos() + // Move the imports of the other import declaration to the first one. + for _, spec := range gen.Specs { + spec.(*ast.ImportSpec).Path.ValuePos = first.Pos() + first.Specs = append(first.Specs, spec) + } + f.Decls = append(f.Decls[:i], f.Decls[i+1:]...) + i-- + } +} + +// declImports reports whether gen contains an import of path. +// Taken from golang.org/x/tools/ast/astutil. +func declImports(gen *ast.GenDecl, path string) bool { + if gen.Tok != token.IMPORT { + return false + } + for _, spec := range gen.Specs { + impspec := spec.(*ast.ImportSpec) + if importPath(impspec) == path { + return true + } + } + return false +} + +func importPath(s ast.Spec) string { + t, err := strconv.Unquote(s.(*ast.ImportSpec).Path.Value) + if err == nil { + return t + } + return "" +} + +func importName(s ast.Spec) string { + n := s.(*ast.ImportSpec).Name + if n == nil { + return "" + } + return n.Name +} + +func importComment(s ast.Spec) string { + c := s.(*ast.ImportSpec).Comment + if c == nil { + return "" + } + return c.Text() +} + +// collapse indicates whether prev may be removed, leaving only next. +func collapse(prev, next ast.Spec) bool { + if importPath(next) != importPath(prev) || importName(next) != importName(prev) { + return false + } + return prev.(*ast.ImportSpec).Comment == nil +} + +type posSpan struct { + Start token.Pos + End token.Pos +} + +func sortSpecs(env *ProcessEnv, fset *token.FileSet, f *ast.File, specs []ast.Spec) []ast.Spec { + // Can't short-circuit here even if specs are already sorted, + // since they might yet need deduplication. + // A lone import, however, may be safely ignored. + if len(specs) <= 1 { + return specs + } + + // Record positions for specs. + pos := make([]posSpan, len(specs)) + for i, s := range specs { + pos[i] = posSpan{s.Pos(), s.End()} + } + + // Identify comments in this range. + // Any comment from pos[0].Start to the final line counts. + lastLine := fset.Position(pos[len(pos)-1].End).Line + cstart := len(f.Comments) + cend := len(f.Comments) + for i, g := range f.Comments { + if g.Pos() < pos[0].Start { + continue + } + if i < cstart { + cstart = i + } + if fset.Position(g.End()).Line > lastLine { + cend = i + break + } + } + comments := f.Comments[cstart:cend] + + // Assign each comment to the import spec preceding it. + importComment := map[*ast.ImportSpec][]*ast.CommentGroup{} + specIndex := 0 + for _, g := range comments { + for specIndex+1 < len(specs) && pos[specIndex+1].Start <= g.Pos() { + specIndex++ + } + s := specs[specIndex].(*ast.ImportSpec) + importComment[s] = append(importComment[s], g) + } + + // Sort the import specs by import path. + // Remove duplicates, when possible without data loss. + // Reassign the import paths to have the same position sequence. + // Reassign each comment to abut the end of its spec. + // Sort the comments by new position. + sort.Sort(byImportSpec{env, specs}) + + // Dedup. Thanks to our sorting, we can just consider + // adjacent pairs of imports. + deduped := specs[:0] + for i, s := range specs { + if i == len(specs)-1 || !collapse(s, specs[i+1]) { + deduped = append(deduped, s) + } else { + p := s.Pos() + fset.File(p).MergeLine(fset.Position(p).Line) + } + } + specs = deduped + + // Fix up comment positions + for i, s := range specs { + s := s.(*ast.ImportSpec) + if s.Name != nil { + s.Name.NamePos = pos[i].Start + } + s.Path.ValuePos = pos[i].Start + s.EndPos = pos[i].End + nextSpecPos := pos[i].End + + for _, g := range importComment[s] { + for _, c := range g.List { + c.Slash = pos[i].End + nextSpecPos = c.End() + } + } + if i < len(specs)-1 { + pos[i+1].Start = nextSpecPos + pos[i+1].End = nextSpecPos + } + } + + sort.Sort(byCommentPos(comments)) + + // Fixup comments can insert blank lines, because import specs are on different lines. + // We remove those blank lines here by merging import spec to the first import spec line. + firstSpecLine := fset.Position(specs[0].Pos()).Line + for _, s := range specs[1:] { + p := s.Pos() + line := fset.File(p).Line(p) + for previousLine := line - 1; previousLine >= firstSpecLine; { + fset.File(p).MergeLine(previousLine) + previousLine-- + } + } + return specs +} + +type byImportSpec struct { + env *ProcessEnv + specs []ast.Spec // slice of *ast.ImportSpec +} + +func (x byImportSpec) Len() int { return len(x.specs) } +func (x byImportSpec) Swap(i, j int) { x.specs[i], x.specs[j] = x.specs[j], x.specs[i] } +func (x byImportSpec) Less(i, j int) bool { + ipath := importPath(x.specs[i]) + jpath := importPath(x.specs[j]) + + igroup := importGroup(x.env, ipath) + jgroup := importGroup(x.env, jpath) + if igroup != jgroup { + return igroup < jgroup + } + + if ipath != jpath { + return ipath < jpath + } + iname := importName(x.specs[i]) + jname := importName(x.specs[j]) + + if iname != jname { + return iname < jname + } + return importComment(x.specs[i]) < importComment(x.specs[j]) +} + +type byCommentPos []*ast.CommentGroup + +func (x byCommentPos) Len() int { return len(x) } +func (x byCommentPos) Swap(i, j int) { x[i], x[j] = x[j], x[i] } +func (x byCommentPos) Less(i, j int) bool { return x[i].Pos() < x[j].Pos() } diff --git a/vendor/golang.org/x/tools/internal/imports/zstdlib.go b/vendor/golang.org/x/tools/internal/imports/zstdlib.go new file mode 100644 index 00000000..7e60eb04 --- /dev/null +++ b/vendor/golang.org/x/tools/internal/imports/zstdlib.go @@ -0,0 +1,10377 @@ +// Code generated by mkstdlib.go. DO NOT EDIT. + +package imports + +var stdlib = map[string][]string{ + "archive/tar": []string{ + "ErrFieldTooLong", + "ErrHeader", + "ErrWriteAfterClose", + "ErrWriteTooLong", + "FileInfoHeader", + "Format", + "FormatGNU", + "FormatPAX", + "FormatUSTAR", + "FormatUnknown", + "Header", + "NewReader", + "NewWriter", + "Reader", + "TypeBlock", + "TypeChar", + "TypeCont", + "TypeDir", + "TypeFifo", + "TypeGNULongLink", + "TypeGNULongName", + "TypeGNUSparse", + "TypeLink", + "TypeReg", + "TypeRegA", + "TypeSymlink", + "TypeXGlobalHeader", + "TypeXHeader", + "Writer", + }, + "archive/zip": []string{ + "Compressor", + "Decompressor", + "Deflate", + "ErrAlgorithm", + "ErrChecksum", + "ErrFormat", + "File", + "FileHeader", + "FileInfoHeader", + "NewReader", + "NewWriter", + "OpenReader", + "ReadCloser", + "Reader", + "RegisterCompressor", + "RegisterDecompressor", + "Store", + "Writer", + }, + "bufio": []string{ + "ErrAdvanceTooFar", + "ErrBufferFull", + "ErrFinalToken", + "ErrInvalidUnreadByte", + "ErrInvalidUnreadRune", + "ErrNegativeAdvance", + "ErrNegativeCount", + "ErrTooLong", + "MaxScanTokenSize", + "NewReadWriter", + "NewReader", + "NewReaderSize", + "NewScanner", + "NewWriter", + "NewWriterSize", + "ReadWriter", + "Reader", + "ScanBytes", + "ScanLines", + "ScanRunes", + "ScanWords", + "Scanner", + "SplitFunc", + "Writer", + }, + "bytes": []string{ + "Buffer", + "Compare", + "Contains", + "ContainsAny", + "ContainsRune", + "Count", + "Equal", + "EqualFold", + "ErrTooLarge", + "Fields", + "FieldsFunc", + "HasPrefix", + "HasSuffix", + "Index", + "IndexAny", + "IndexByte", + "IndexFunc", + "IndexRune", + "Join", + "LastIndex", + "LastIndexAny", + "LastIndexByte", + "LastIndexFunc", + "Map", + "MinRead", + "NewBuffer", + "NewBufferString", + "NewReader", + "Reader", + "Repeat", + "Replace", + "ReplaceAll", + "Runes", + "Split", + "SplitAfter", + "SplitAfterN", + "SplitN", + "Title", + "ToLower", + "ToLowerSpecial", + "ToTitle", + "ToTitleSpecial", + "ToUpper", + "ToUpperSpecial", + "ToValidUTF8", + "Trim", + "TrimFunc", + "TrimLeft", + "TrimLeftFunc", + "TrimPrefix", + "TrimRight", + "TrimRightFunc", + "TrimSpace", + "TrimSuffix", + }, + "compress/bzip2": []string{ + "NewReader", + "StructuralError", + }, + "compress/flate": []string{ + "BestCompression", + "BestSpeed", + "CorruptInputError", + "DefaultCompression", + "HuffmanOnly", + "InternalError", + "NewReader", + "NewReaderDict", + "NewWriter", + "NewWriterDict", + "NoCompression", + "ReadError", + "Reader", + "Resetter", + "WriteError", + "Writer", + }, + "compress/gzip": []string{ + "BestCompression", + "BestSpeed", + "DefaultCompression", + "ErrChecksum", + "ErrHeader", + "Header", + "HuffmanOnly", + "NewReader", + "NewWriter", + "NewWriterLevel", + "NoCompression", + "Reader", + "Writer", + }, + "compress/lzw": []string{ + "LSB", + "MSB", + "NewReader", + "NewWriter", + "Order", + }, + "compress/zlib": []string{ + "BestCompression", + "BestSpeed", + "DefaultCompression", + "ErrChecksum", + "ErrDictionary", + "ErrHeader", + "HuffmanOnly", + "NewReader", + "NewReaderDict", + "NewWriter", + "NewWriterLevel", + "NewWriterLevelDict", + "NoCompression", + "Resetter", + "Writer", + }, + "container/heap": []string{ + "Fix", + "Init", + "Interface", + "Pop", + "Push", + "Remove", + }, + "container/list": []string{ + "Element", + "List", + "New", + }, + "container/ring": []string{ + "New", + "Ring", + }, + "context": []string{ + "Background", + "CancelFunc", + "Canceled", + "Context", + "DeadlineExceeded", + "TODO", + "WithCancel", + "WithDeadline", + "WithTimeout", + "WithValue", + }, + "crypto": []string{ + "BLAKE2b_256", + "BLAKE2b_384", + "BLAKE2b_512", + "BLAKE2s_256", + "Decrypter", + "DecrypterOpts", + "Hash", + "MD4", + "MD5", + "MD5SHA1", + "PrivateKey", + "PublicKey", + "RIPEMD160", + "RegisterHash", + "SHA1", + "SHA224", + "SHA256", + "SHA384", + "SHA3_224", + "SHA3_256", + "SHA3_384", + "SHA3_512", + "SHA512", + "SHA512_224", + "SHA512_256", + "Signer", + "SignerOpts", + }, + "crypto/aes": []string{ + "BlockSize", + "KeySizeError", + "NewCipher", + }, + "crypto/cipher": []string{ + "AEAD", + "Block", + "BlockMode", + "NewCBCDecrypter", + "NewCBCEncrypter", + "NewCFBDecrypter", + "NewCFBEncrypter", + "NewCTR", + "NewGCM", + "NewGCMWithNonceSize", + "NewGCMWithTagSize", + "NewOFB", + "Stream", + "StreamReader", + "StreamWriter", + }, + "crypto/des": []string{ + "BlockSize", + "KeySizeError", + "NewCipher", + "NewTripleDESCipher", + }, + "crypto/dsa": []string{ + "ErrInvalidPublicKey", + "GenerateKey", + "GenerateParameters", + "L1024N160", + "L2048N224", + "L2048N256", + "L3072N256", + "ParameterSizes", + "Parameters", + "PrivateKey", + "PublicKey", + "Sign", + "Verify", + }, + "crypto/ecdsa": []string{ + "GenerateKey", + "PrivateKey", + "PublicKey", + "Sign", + "Verify", + }, + "crypto/ed25519": []string{ + "GenerateKey", + "NewKeyFromSeed", + "PrivateKey", + "PrivateKeySize", + "PublicKey", + "PublicKeySize", + "SeedSize", + "Sign", + "SignatureSize", + "Verify", + }, + "crypto/elliptic": []string{ + "Curve", + "CurveParams", + "GenerateKey", + "Marshal", + "P224", + "P256", + "P384", + "P521", + "Unmarshal", + }, + "crypto/hmac": []string{ + "Equal", + "New", + }, + "crypto/md5": []string{ + "BlockSize", + "New", + "Size", + "Sum", + }, + "crypto/rand": []string{ + "Int", + "Prime", + "Read", + "Reader", + }, + "crypto/rc4": []string{ + "Cipher", + "KeySizeError", + "NewCipher", + }, + "crypto/rsa": []string{ + "CRTValue", + "DecryptOAEP", + "DecryptPKCS1v15", + "DecryptPKCS1v15SessionKey", + "EncryptOAEP", + "EncryptPKCS1v15", + "ErrDecryption", + "ErrMessageTooLong", + "ErrVerification", + "GenerateKey", + "GenerateMultiPrimeKey", + "OAEPOptions", + "PKCS1v15DecryptOptions", + "PSSOptions", + "PSSSaltLengthAuto", + "PSSSaltLengthEqualsHash", + "PrecomputedValues", + "PrivateKey", + "PublicKey", + "SignPKCS1v15", + "SignPSS", + "VerifyPKCS1v15", + "VerifyPSS", + }, + "crypto/sha1": []string{ + "BlockSize", + "New", + "Size", + "Sum", + }, + "crypto/sha256": []string{ + "BlockSize", + "New", + "New224", + "Size", + "Size224", + "Sum224", + "Sum256", + }, + "crypto/sha512": []string{ + "BlockSize", + "New", + "New384", + "New512_224", + "New512_256", + "Size", + "Size224", + "Size256", + "Size384", + "Sum384", + "Sum512", + "Sum512_224", + "Sum512_256", + }, + "crypto/subtle": []string{ + "ConstantTimeByteEq", + "ConstantTimeCompare", + "ConstantTimeCopy", + "ConstantTimeEq", + "ConstantTimeLessOrEq", + "ConstantTimeSelect", + }, + "crypto/tls": []string{ + "Certificate", + "CertificateRequestInfo", + "Client", + "ClientAuthType", + "ClientHelloInfo", + "ClientSessionCache", + "ClientSessionState", + "Config", + "Conn", + "ConnectionState", + "CurveID", + "CurveP256", + "CurveP384", + "CurveP521", + "Dial", + "DialWithDialer", + "ECDSAWithP256AndSHA256", + "ECDSAWithP384AndSHA384", + "ECDSAWithP521AndSHA512", + "ECDSAWithSHA1", + "Ed25519", + "Listen", + "LoadX509KeyPair", + "NewLRUClientSessionCache", + "NewListener", + "NoClientCert", + "PKCS1WithSHA1", + "PKCS1WithSHA256", + "PKCS1WithSHA384", + "PKCS1WithSHA512", + "PSSWithSHA256", + "PSSWithSHA384", + "PSSWithSHA512", + "RecordHeaderError", + "RenegotiateFreelyAsClient", + "RenegotiateNever", + "RenegotiateOnceAsClient", + "RenegotiationSupport", + "RequestClientCert", + "RequireAndVerifyClientCert", + "RequireAnyClientCert", + "Server", + "SignatureScheme", + "TLS_AES_128_GCM_SHA256", + "TLS_AES_256_GCM_SHA384", + "TLS_CHACHA20_POLY1305_SHA256", + "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA", + "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256", + "TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256", + "TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA", + "TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384", + "TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305", + "TLS_ECDHE_ECDSA_WITH_RC4_128_SHA", + "TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA", + "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA", + "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256", + "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256", + "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA", + "TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384", + "TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305", + "TLS_ECDHE_RSA_WITH_RC4_128_SHA", + "TLS_FALLBACK_SCSV", + "TLS_RSA_WITH_3DES_EDE_CBC_SHA", + "TLS_RSA_WITH_AES_128_CBC_SHA", + "TLS_RSA_WITH_AES_128_CBC_SHA256", + "TLS_RSA_WITH_AES_128_GCM_SHA256", + "TLS_RSA_WITH_AES_256_CBC_SHA", + "TLS_RSA_WITH_AES_256_GCM_SHA384", + "TLS_RSA_WITH_RC4_128_SHA", + "VerifyClientCertIfGiven", + "VersionSSL30", + "VersionTLS10", + "VersionTLS11", + "VersionTLS12", + "VersionTLS13", + "X25519", + "X509KeyPair", + }, + "crypto/x509": []string{ + "CANotAuthorizedForExtKeyUsage", + "CANotAuthorizedForThisName", + "CertPool", + "Certificate", + "CertificateInvalidError", + "CertificateRequest", + "ConstraintViolationError", + "CreateCertificate", + "CreateCertificateRequest", + "DSA", + "DSAWithSHA1", + "DSAWithSHA256", + "DecryptPEMBlock", + "ECDSA", + "ECDSAWithSHA1", + "ECDSAWithSHA256", + "ECDSAWithSHA384", + "ECDSAWithSHA512", + "Ed25519", + "EncryptPEMBlock", + "ErrUnsupportedAlgorithm", + "Expired", + "ExtKeyUsage", + "ExtKeyUsageAny", + "ExtKeyUsageClientAuth", + "ExtKeyUsageCodeSigning", + "ExtKeyUsageEmailProtection", + "ExtKeyUsageIPSECEndSystem", + "ExtKeyUsageIPSECTunnel", + "ExtKeyUsageIPSECUser", + "ExtKeyUsageMicrosoftCommercialCodeSigning", + "ExtKeyUsageMicrosoftKernelCodeSigning", + "ExtKeyUsageMicrosoftServerGatedCrypto", + "ExtKeyUsageNetscapeServerGatedCrypto", + "ExtKeyUsageOCSPSigning", + "ExtKeyUsageServerAuth", + "ExtKeyUsageTimeStamping", + "HostnameError", + "IncompatibleUsage", + "IncorrectPasswordError", + "InsecureAlgorithmError", + "InvalidReason", + "IsEncryptedPEMBlock", + "KeyUsage", + "KeyUsageCRLSign", + "KeyUsageCertSign", + "KeyUsageContentCommitment", + "KeyUsageDataEncipherment", + "KeyUsageDecipherOnly", + "KeyUsageDigitalSignature", + "KeyUsageEncipherOnly", + "KeyUsageKeyAgreement", + "KeyUsageKeyEncipherment", + "MD2WithRSA", + "MD5WithRSA", + "MarshalECPrivateKey", + "MarshalPKCS1PrivateKey", + "MarshalPKCS1PublicKey", + "MarshalPKCS8PrivateKey", + "MarshalPKIXPublicKey", + "NameConstraintsWithoutSANs", + "NameMismatch", + "NewCertPool", + "NotAuthorizedToSign", + "PEMCipher", + "PEMCipher3DES", + "PEMCipherAES128", + "PEMCipherAES192", + "PEMCipherAES256", + "PEMCipherDES", + "ParseCRL", + "ParseCertificate", + "ParseCertificateRequest", + "ParseCertificates", + "ParseDERCRL", + "ParseECPrivateKey", + "ParsePKCS1PrivateKey", + "ParsePKCS1PublicKey", + "ParsePKCS8PrivateKey", + "ParsePKIXPublicKey", + "PublicKeyAlgorithm", + "PureEd25519", + "RSA", + "SHA1WithRSA", + "SHA256WithRSA", + "SHA256WithRSAPSS", + "SHA384WithRSA", + "SHA384WithRSAPSS", + "SHA512WithRSA", + "SHA512WithRSAPSS", + "SignatureAlgorithm", + "SystemCertPool", + "SystemRootsError", + "TooManyConstraints", + "TooManyIntermediates", + "UnconstrainedName", + "UnhandledCriticalExtension", + "UnknownAuthorityError", + "UnknownPublicKeyAlgorithm", + "UnknownSignatureAlgorithm", + "VerifyOptions", + }, + "crypto/x509/pkix": []string{ + "AlgorithmIdentifier", + "AttributeTypeAndValue", + "AttributeTypeAndValueSET", + "CertificateList", + "Extension", + "Name", + "RDNSequence", + "RelativeDistinguishedNameSET", + "RevokedCertificate", + "TBSCertificateList", + }, + "database/sql": []string{ + "ColumnType", + "Conn", + "DB", + "DBStats", + "Drivers", + "ErrConnDone", + "ErrNoRows", + "ErrTxDone", + "IsolationLevel", + "LevelDefault", + "LevelLinearizable", + "LevelReadCommitted", + "LevelReadUncommitted", + "LevelRepeatableRead", + "LevelSerializable", + "LevelSnapshot", + "LevelWriteCommitted", + "Named", + "NamedArg", + "NullBool", + "NullFloat64", + "NullInt32", + "NullInt64", + "NullString", + "NullTime", + "Open", + "OpenDB", + "Out", + "RawBytes", + "Register", + "Result", + "Row", + "Rows", + "Scanner", + "Stmt", + "Tx", + "TxOptions", + }, + "database/sql/driver": []string{ + "Bool", + "ColumnConverter", + "Conn", + "ConnBeginTx", + "ConnPrepareContext", + "Connector", + "DefaultParameterConverter", + "Driver", + "DriverContext", + "ErrBadConn", + "ErrRemoveArgument", + "ErrSkip", + "Execer", + "ExecerContext", + "Int32", + "IsScanValue", + "IsValue", + "IsolationLevel", + "NamedValue", + "NamedValueChecker", + "NotNull", + "Null", + "Pinger", + "Queryer", + "QueryerContext", + "Result", + "ResultNoRows", + "Rows", + "RowsAffected", + "RowsColumnTypeDatabaseTypeName", + "RowsColumnTypeLength", + "RowsColumnTypeNullable", + "RowsColumnTypePrecisionScale", + "RowsColumnTypeScanType", + "RowsNextResultSet", + "SessionResetter", + "Stmt", + "StmtExecContext", + "StmtQueryContext", + "String", + "Tx", + "TxOptions", + "Value", + "ValueConverter", + "Valuer", + }, + "debug/dwarf": []string{ + "AddrType", + "ArrayType", + "Attr", + "AttrAbstractOrigin", + "AttrAccessibility", + "AttrAddrClass", + "AttrAllocated", + "AttrArtificial", + "AttrAssociated", + "AttrBaseTypes", + "AttrBitOffset", + "AttrBitSize", + "AttrByteSize", + "AttrCallColumn", + "AttrCallFile", + "AttrCallLine", + "AttrCalling", + "AttrCommonRef", + "AttrCompDir", + "AttrConstValue", + "AttrContainingType", + "AttrCount", + "AttrDataLocation", + "AttrDataMemberLoc", + "AttrDeclColumn", + "AttrDeclFile", + "AttrDeclLine", + "AttrDeclaration", + "AttrDefaultValue", + "AttrDescription", + "AttrDiscr", + "AttrDiscrList", + "AttrDiscrValue", + "AttrEncoding", + "AttrEntrypc", + "AttrExtension", + "AttrExternal", + "AttrFrameBase", + "AttrFriend", + "AttrHighpc", + "AttrIdentifierCase", + "AttrImport", + "AttrInline", + "AttrIsOptional", + "AttrLanguage", + "AttrLocation", + "AttrLowerBound", + "AttrLowpc", + "AttrMacroInfo", + "AttrName", + "AttrNamelistItem", + "AttrOrdering", + "AttrPriority", + "AttrProducer", + "AttrPrototyped", + "AttrRanges", + "AttrReturnAddr", + "AttrSegment", + "AttrSibling", + "AttrSpecification", + "AttrStartScope", + "AttrStaticLink", + "AttrStmtList", + "AttrStride", + "AttrStrideSize", + "AttrStringLength", + "AttrTrampoline", + "AttrType", + "AttrUpperBound", + "AttrUseLocation", + "AttrUseUTF8", + "AttrVarParam", + "AttrVirtuality", + "AttrVisibility", + "AttrVtableElemLoc", + "BasicType", + "BoolType", + "CharType", + "Class", + "ClassAddress", + "ClassBlock", + "ClassConstant", + "ClassExprLoc", + "ClassFlag", + "ClassLinePtr", + "ClassLocListPtr", + "ClassMacPtr", + "ClassRangeListPtr", + "ClassReference", + "ClassReferenceAlt", + "ClassReferenceSig", + "ClassString", + "ClassStringAlt", + "ClassUnknown", + "CommonType", + "ComplexType", + "Data", + "DecodeError", + "DotDotDotType", + "Entry", + "EnumType", + "EnumValue", + "ErrUnknownPC", + "Field", + "FloatType", + "FuncType", + "IntType", + "LineEntry", + "LineFile", + "LineReader", + "LineReaderPos", + "New", + "Offset", + "PtrType", + "QualType", + "Reader", + "StructField", + "StructType", + "Tag", + "TagAccessDeclaration", + "TagArrayType", + "TagBaseType", + "TagCatchDwarfBlock", + "TagClassType", + "TagCommonDwarfBlock", + "TagCommonInclusion", + "TagCompileUnit", + "TagCondition", + "TagConstType", + "TagConstant", + "TagDwarfProcedure", + "TagEntryPoint", + "TagEnumerationType", + "TagEnumerator", + "TagFileType", + "TagFormalParameter", + "TagFriend", + "TagImportedDeclaration", + "TagImportedModule", + "TagImportedUnit", + "TagInheritance", + "TagInlinedSubroutine", + "TagInterfaceType", + "TagLabel", + "TagLexDwarfBlock", + "TagMember", + "TagModule", + "TagMutableType", + "TagNamelist", + "TagNamelistItem", + "TagNamespace", + "TagPackedType", + "TagPartialUnit", + "TagPointerType", + "TagPtrToMemberType", + "TagReferenceType", + "TagRestrictType", + "TagRvalueReferenceType", + "TagSetType", + "TagSharedType", + "TagStringType", + "TagStructType", + "TagSubprogram", + "TagSubrangeType", + "TagSubroutineType", + "TagTemplateAlias", + "TagTemplateTypeParameter", + "TagTemplateValueParameter", + "TagThrownType", + "TagTryDwarfBlock", + "TagTypeUnit", + "TagTypedef", + "TagUnionType", + "TagUnspecifiedParameters", + "TagUnspecifiedType", + "TagVariable", + "TagVariant", + "TagVariantPart", + "TagVolatileType", + "TagWithStmt", + "Type", + "TypedefType", + "UcharType", + "UintType", + "UnspecifiedType", + "UnsupportedType", + "VoidType", + }, + "debug/elf": []string{ + "ARM_MAGIC_TRAMP_NUMBER", + "COMPRESS_HIOS", + "COMPRESS_HIPROC", + "COMPRESS_LOOS", + "COMPRESS_LOPROC", + "COMPRESS_ZLIB", + "Chdr32", + "Chdr64", + "Class", + "CompressionType", + "DF_BIND_NOW", + "DF_ORIGIN", + "DF_STATIC_TLS", + "DF_SYMBOLIC", + "DF_TEXTREL", + "DT_BIND_NOW", + "DT_DEBUG", + "DT_ENCODING", + "DT_FINI", + "DT_FINI_ARRAY", + "DT_FINI_ARRAYSZ", + "DT_FLAGS", + "DT_HASH", + "DT_HIOS", + "DT_HIPROC", + "DT_INIT", + "DT_INIT_ARRAY", + "DT_INIT_ARRAYSZ", + "DT_JMPREL", + "DT_LOOS", + "DT_LOPROC", + "DT_NEEDED", + "DT_NULL", + "DT_PLTGOT", + "DT_PLTREL", + "DT_PLTRELSZ", + "DT_PREINIT_ARRAY", + "DT_PREINIT_ARRAYSZ", + "DT_REL", + "DT_RELA", + "DT_RELAENT", + "DT_RELASZ", + "DT_RELENT", + "DT_RELSZ", + "DT_RPATH", + "DT_RUNPATH", + "DT_SONAME", + "DT_STRSZ", + "DT_STRTAB", + "DT_SYMBOLIC", + "DT_SYMENT", + "DT_SYMTAB", + "DT_TEXTREL", + "DT_VERNEED", + "DT_VERNEEDNUM", + "DT_VERSYM", + "Data", + "Dyn32", + "Dyn64", + "DynFlag", + "DynTag", + "EI_ABIVERSION", + "EI_CLASS", + "EI_DATA", + "EI_NIDENT", + "EI_OSABI", + "EI_PAD", + "EI_VERSION", + "ELFCLASS32", + "ELFCLASS64", + "ELFCLASSNONE", + "ELFDATA2LSB", + "ELFDATA2MSB", + "ELFDATANONE", + "ELFMAG", + "ELFOSABI_86OPEN", + "ELFOSABI_AIX", + "ELFOSABI_ARM", + "ELFOSABI_AROS", + "ELFOSABI_CLOUDABI", + "ELFOSABI_FENIXOS", + "ELFOSABI_FREEBSD", + "ELFOSABI_HPUX", + "ELFOSABI_HURD", + "ELFOSABI_IRIX", + "ELFOSABI_LINUX", + "ELFOSABI_MODESTO", + "ELFOSABI_NETBSD", + "ELFOSABI_NONE", + "ELFOSABI_NSK", + "ELFOSABI_OPENBSD", + "ELFOSABI_OPENVMS", + "ELFOSABI_SOLARIS", + "ELFOSABI_STANDALONE", + "ELFOSABI_TRU64", + "EM_386", + "EM_486", + "EM_56800EX", + "EM_68HC05", + "EM_68HC08", + "EM_68HC11", + "EM_68HC12", + "EM_68HC16", + "EM_68K", + "EM_78KOR", + "EM_8051", + "EM_860", + "EM_88K", + "EM_960", + "EM_AARCH64", + "EM_ALPHA", + "EM_ALPHA_STD", + "EM_ALTERA_NIOS2", + "EM_AMDGPU", + "EM_ARC", + "EM_ARCA", + "EM_ARC_COMPACT", + "EM_ARC_COMPACT2", + "EM_ARM", + "EM_AVR", + "EM_AVR32", + "EM_BA1", + "EM_BA2", + "EM_BLACKFIN", + "EM_BPF", + "EM_C166", + "EM_CDP", + "EM_CE", + "EM_CLOUDSHIELD", + "EM_COGE", + "EM_COLDFIRE", + "EM_COOL", + "EM_COREA_1ST", + "EM_COREA_2ND", + "EM_CR", + "EM_CR16", + "EM_CRAYNV2", + "EM_CRIS", + "EM_CRX", + "EM_CSR_KALIMBA", + "EM_CUDA", + "EM_CYPRESS_M8C", + "EM_D10V", + "EM_D30V", + "EM_DSP24", + "EM_DSPIC30F", + "EM_DXP", + "EM_ECOG1", + "EM_ECOG16", + "EM_ECOG1X", + "EM_ECOG2", + "EM_ETPU", + "EM_EXCESS", + "EM_F2MC16", + "EM_FIREPATH", + "EM_FR20", + "EM_FR30", + "EM_FT32", + "EM_FX66", + "EM_H8S", + "EM_H8_300", + "EM_H8_300H", + "EM_H8_500", + "EM_HUANY", + "EM_IA_64", + "EM_INTEL205", + "EM_INTEL206", + "EM_INTEL207", + "EM_INTEL208", + "EM_INTEL209", + "EM_IP2K", + "EM_JAVELIN", + "EM_K10M", + "EM_KM32", + "EM_KMX16", + "EM_KMX32", + "EM_KMX8", + "EM_KVARC", + "EM_L10M", + "EM_LANAI", + "EM_LATTICEMICO32", + "EM_M16C", + "EM_M32", + "EM_M32C", + "EM_M32R", + "EM_MANIK", + "EM_MAX", + "EM_MAXQ30", + "EM_MCHP_PIC", + "EM_MCST_ELBRUS", + "EM_ME16", + "EM_METAG", + "EM_MICROBLAZE", + "EM_MIPS", + "EM_MIPS_RS3_LE", + "EM_MIPS_RS4_BE", + "EM_MIPS_X", + "EM_MMA", + "EM_MMDSP_PLUS", + "EM_MMIX", + "EM_MN10200", + "EM_MN10300", + "EM_MOXIE", + "EM_MSP430", + "EM_NCPU", + "EM_NDR1", + "EM_NDS32", + "EM_NONE", + "EM_NORC", + "EM_NS32K", + "EM_OPEN8", + "EM_OPENRISC", + "EM_PARISC", + "EM_PCP", + "EM_PDP10", + "EM_PDP11", + "EM_PDSP", + "EM_PJ", + "EM_PPC", + "EM_PPC64", + "EM_PRISM", + "EM_QDSP6", + "EM_R32C", + "EM_RCE", + "EM_RH32", + "EM_RISCV", + "EM_RL78", + "EM_RS08", + "EM_RX", + "EM_S370", + "EM_S390", + "EM_SCORE7", + "EM_SEP", + "EM_SE_C17", + "EM_SE_C33", + "EM_SH", + "EM_SHARC", + "EM_SLE9X", + "EM_SNP1K", + "EM_SPARC", + "EM_SPARC32PLUS", + "EM_SPARCV9", + "EM_ST100", + "EM_ST19", + "EM_ST200", + "EM_ST7", + "EM_ST9PLUS", + "EM_STARCORE", + "EM_STM8", + "EM_STXP7X", + "EM_SVX", + "EM_TILE64", + "EM_TILEGX", + "EM_TILEPRO", + "EM_TINYJ", + "EM_TI_ARP32", + "EM_TI_C2000", + "EM_TI_C5500", + "EM_TI_C6000", + "EM_TI_PRU", + "EM_TMM_GPP", + "EM_TPC", + "EM_TRICORE", + "EM_TRIMEDIA", + "EM_TSK3000", + "EM_UNICORE", + "EM_V800", + "EM_V850", + "EM_VAX", + "EM_VIDEOCORE", + "EM_VIDEOCORE3", + "EM_VIDEOCORE5", + "EM_VISIUM", + "EM_VPP500", + "EM_X86_64", + "EM_XCORE", + "EM_XGATE", + "EM_XIMO16", + "EM_XTENSA", + "EM_Z80", + "EM_ZSP", + "ET_CORE", + "ET_DYN", + "ET_EXEC", + "ET_HIOS", + "ET_HIPROC", + "ET_LOOS", + "ET_LOPROC", + "ET_NONE", + "ET_REL", + "EV_CURRENT", + "EV_NONE", + "ErrNoSymbols", + "File", + "FileHeader", + "FormatError", + "Header32", + "Header64", + "ImportedSymbol", + "Machine", + "NT_FPREGSET", + "NT_PRPSINFO", + "NT_PRSTATUS", + "NType", + "NewFile", + "OSABI", + "Open", + "PF_MASKOS", + "PF_MASKPROC", + "PF_R", + "PF_W", + "PF_X", + "PT_DYNAMIC", + "PT_HIOS", + "PT_HIPROC", + "PT_INTERP", + "PT_LOAD", + "PT_LOOS", + "PT_LOPROC", + "PT_NOTE", + "PT_NULL", + "PT_PHDR", + "PT_SHLIB", + "PT_TLS", + "Prog", + "Prog32", + "Prog64", + "ProgFlag", + "ProgHeader", + "ProgType", + "R_386", + "R_386_16", + "R_386_32", + "R_386_32PLT", + "R_386_8", + "R_386_COPY", + "R_386_GLOB_DAT", + "R_386_GOT32", + "R_386_GOT32X", + "R_386_GOTOFF", + "R_386_GOTPC", + "R_386_IRELATIVE", + "R_386_JMP_SLOT", + "R_386_NONE", + "R_386_PC16", + "R_386_PC32", + "R_386_PC8", + "R_386_PLT32", + "R_386_RELATIVE", + "R_386_SIZE32", + "R_386_TLS_DESC", + "R_386_TLS_DESC_CALL", + "R_386_TLS_DTPMOD32", + "R_386_TLS_DTPOFF32", + "R_386_TLS_GD", + "R_386_TLS_GD_32", + "R_386_TLS_GD_CALL", + "R_386_TLS_GD_POP", + "R_386_TLS_GD_PUSH", + "R_386_TLS_GOTDESC", + "R_386_TLS_GOTIE", + "R_386_TLS_IE", + "R_386_TLS_IE_32", + "R_386_TLS_LDM", + "R_386_TLS_LDM_32", + "R_386_TLS_LDM_CALL", + "R_386_TLS_LDM_POP", + "R_386_TLS_LDM_PUSH", + "R_386_TLS_LDO_32", + "R_386_TLS_LE", + "R_386_TLS_LE_32", + "R_386_TLS_TPOFF", + "R_386_TLS_TPOFF32", + "R_390", + "R_390_12", + "R_390_16", + "R_390_20", + "R_390_32", + "R_390_64", + "R_390_8", + "R_390_COPY", + "R_390_GLOB_DAT", + "R_390_GOT12", + "R_390_GOT16", + "R_390_GOT20", + "R_390_GOT32", + "R_390_GOT64", + "R_390_GOTENT", + "R_390_GOTOFF", + "R_390_GOTOFF16", + "R_390_GOTOFF64", + "R_390_GOTPC", + "R_390_GOTPCDBL", + "R_390_GOTPLT12", + "R_390_GOTPLT16", + "R_390_GOTPLT20", + "R_390_GOTPLT32", + "R_390_GOTPLT64", + "R_390_GOTPLTENT", + "R_390_GOTPLTOFF16", + "R_390_GOTPLTOFF32", + "R_390_GOTPLTOFF64", + "R_390_JMP_SLOT", + "R_390_NONE", + "R_390_PC16", + "R_390_PC16DBL", + "R_390_PC32", + "R_390_PC32DBL", + "R_390_PC64", + "R_390_PLT16DBL", + "R_390_PLT32", + "R_390_PLT32DBL", + "R_390_PLT64", + "R_390_RELATIVE", + "R_390_TLS_DTPMOD", + "R_390_TLS_DTPOFF", + "R_390_TLS_GD32", + "R_390_TLS_GD64", + "R_390_TLS_GDCALL", + "R_390_TLS_GOTIE12", + "R_390_TLS_GOTIE20", + "R_390_TLS_GOTIE32", + "R_390_TLS_GOTIE64", + "R_390_TLS_IE32", + "R_390_TLS_IE64", + "R_390_TLS_IEENT", + "R_390_TLS_LDCALL", + "R_390_TLS_LDM32", + "R_390_TLS_LDM64", + "R_390_TLS_LDO32", + "R_390_TLS_LDO64", + "R_390_TLS_LE32", + "R_390_TLS_LE64", + "R_390_TLS_LOAD", + "R_390_TLS_TPOFF", + "R_AARCH64", + "R_AARCH64_ABS16", + "R_AARCH64_ABS32", + "R_AARCH64_ABS64", + "R_AARCH64_ADD_ABS_LO12_NC", + "R_AARCH64_ADR_GOT_PAGE", + "R_AARCH64_ADR_PREL_LO21", + "R_AARCH64_ADR_PREL_PG_HI21", + "R_AARCH64_ADR_PREL_PG_HI21_NC", + "R_AARCH64_CALL26", + "R_AARCH64_CONDBR19", + "R_AARCH64_COPY", + "R_AARCH64_GLOB_DAT", + "R_AARCH64_GOT_LD_PREL19", + "R_AARCH64_IRELATIVE", + "R_AARCH64_JUMP26", + "R_AARCH64_JUMP_SLOT", + "R_AARCH64_LD64_GOTOFF_LO15", + "R_AARCH64_LD64_GOTPAGE_LO15", + "R_AARCH64_LD64_GOT_LO12_NC", + "R_AARCH64_LDST128_ABS_LO12_NC", + "R_AARCH64_LDST16_ABS_LO12_NC", + "R_AARCH64_LDST32_ABS_LO12_NC", + "R_AARCH64_LDST64_ABS_LO12_NC", + "R_AARCH64_LDST8_ABS_LO12_NC", + "R_AARCH64_LD_PREL_LO19", + "R_AARCH64_MOVW_SABS_G0", + "R_AARCH64_MOVW_SABS_G1", + "R_AARCH64_MOVW_SABS_G2", + "R_AARCH64_MOVW_UABS_G0", + "R_AARCH64_MOVW_UABS_G0_NC", + "R_AARCH64_MOVW_UABS_G1", + "R_AARCH64_MOVW_UABS_G1_NC", + "R_AARCH64_MOVW_UABS_G2", + "R_AARCH64_MOVW_UABS_G2_NC", + "R_AARCH64_MOVW_UABS_G3", + "R_AARCH64_NONE", + "R_AARCH64_NULL", + "R_AARCH64_P32_ABS16", + "R_AARCH64_P32_ABS32", + "R_AARCH64_P32_ADD_ABS_LO12_NC", + "R_AARCH64_P32_ADR_GOT_PAGE", + "R_AARCH64_P32_ADR_PREL_LO21", + "R_AARCH64_P32_ADR_PREL_PG_HI21", + "R_AARCH64_P32_CALL26", + "R_AARCH64_P32_CONDBR19", + "R_AARCH64_P32_COPY", + "R_AARCH64_P32_GLOB_DAT", + "R_AARCH64_P32_GOT_LD_PREL19", + "R_AARCH64_P32_IRELATIVE", + "R_AARCH64_P32_JUMP26", + "R_AARCH64_P32_JUMP_SLOT", + "R_AARCH64_P32_LD32_GOT_LO12_NC", + "R_AARCH64_P32_LDST128_ABS_LO12_NC", + "R_AARCH64_P32_LDST16_ABS_LO12_NC", + "R_AARCH64_P32_LDST32_ABS_LO12_NC", + "R_AARCH64_P32_LDST64_ABS_LO12_NC", + "R_AARCH64_P32_LDST8_ABS_LO12_NC", + "R_AARCH64_P32_LD_PREL_LO19", + "R_AARCH64_P32_MOVW_SABS_G0", + "R_AARCH64_P32_MOVW_UABS_G0", + "R_AARCH64_P32_MOVW_UABS_G0_NC", + "R_AARCH64_P32_MOVW_UABS_G1", + "R_AARCH64_P32_PREL16", + "R_AARCH64_P32_PREL32", + "R_AARCH64_P32_RELATIVE", + "R_AARCH64_P32_TLSDESC", + "R_AARCH64_P32_TLSDESC_ADD_LO12_NC", + "R_AARCH64_P32_TLSDESC_ADR_PAGE21", + "R_AARCH64_P32_TLSDESC_ADR_PREL21", + "R_AARCH64_P32_TLSDESC_CALL", + "R_AARCH64_P32_TLSDESC_LD32_LO12_NC", + "R_AARCH64_P32_TLSDESC_LD_PREL19", + "R_AARCH64_P32_TLSGD_ADD_LO12_NC", + "R_AARCH64_P32_TLSGD_ADR_PAGE21", + "R_AARCH64_P32_TLSIE_ADR_GOTTPREL_PAGE21", + "R_AARCH64_P32_TLSIE_LD32_GOTTPREL_LO12_NC", + "R_AARCH64_P32_TLSIE_LD_GOTTPREL_PREL19", + "R_AARCH64_P32_TLSLE_ADD_TPREL_HI12", + "R_AARCH64_P32_TLSLE_ADD_TPREL_LO12", + "R_AARCH64_P32_TLSLE_ADD_TPREL_LO12_NC", + "R_AARCH64_P32_TLSLE_MOVW_TPREL_G0", + "R_AARCH64_P32_TLSLE_MOVW_TPREL_G0_NC", + "R_AARCH64_P32_TLSLE_MOVW_TPREL_G1", + "R_AARCH64_P32_TLS_DTPMOD", + "R_AARCH64_P32_TLS_DTPREL", + "R_AARCH64_P32_TLS_TPREL", + "R_AARCH64_P32_TSTBR14", + "R_AARCH64_PREL16", + "R_AARCH64_PREL32", + "R_AARCH64_PREL64", + "R_AARCH64_RELATIVE", + "R_AARCH64_TLSDESC", + "R_AARCH64_TLSDESC_ADD", + "R_AARCH64_TLSDESC_ADD_LO12_NC", + "R_AARCH64_TLSDESC_ADR_PAGE21", + "R_AARCH64_TLSDESC_ADR_PREL21", + "R_AARCH64_TLSDESC_CALL", + "R_AARCH64_TLSDESC_LD64_LO12_NC", + "R_AARCH64_TLSDESC_LDR", + "R_AARCH64_TLSDESC_LD_PREL19", + "R_AARCH64_TLSDESC_OFF_G0_NC", + "R_AARCH64_TLSDESC_OFF_G1", + "R_AARCH64_TLSGD_ADD_LO12_NC", + "R_AARCH64_TLSGD_ADR_PAGE21", + "R_AARCH64_TLSGD_ADR_PREL21", + "R_AARCH64_TLSGD_MOVW_G0_NC", + "R_AARCH64_TLSGD_MOVW_G1", + "R_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21", + "R_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC", + "R_AARCH64_TLSIE_LD_GOTTPREL_PREL19", + "R_AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC", + "R_AARCH64_TLSIE_MOVW_GOTTPREL_G1", + "R_AARCH64_TLSLD_ADR_PAGE21", + "R_AARCH64_TLSLD_ADR_PREL21", + "R_AARCH64_TLSLD_LDST128_DTPREL_LO12", + "R_AARCH64_TLSLD_LDST128_DTPREL_LO12_NC", + "R_AARCH64_TLSLE_ADD_TPREL_HI12", + "R_AARCH64_TLSLE_ADD_TPREL_LO12", + "R_AARCH64_TLSLE_ADD_TPREL_LO12_NC", + "R_AARCH64_TLSLE_LDST128_TPREL_LO12", + "R_AARCH64_TLSLE_LDST128_TPREL_LO12_NC", + "R_AARCH64_TLSLE_MOVW_TPREL_G0", + "R_AARCH64_TLSLE_MOVW_TPREL_G0_NC", + "R_AARCH64_TLSLE_MOVW_TPREL_G1", + "R_AARCH64_TLSLE_MOVW_TPREL_G1_NC", + "R_AARCH64_TLSLE_MOVW_TPREL_G2", + "R_AARCH64_TLS_DTPMOD64", + "R_AARCH64_TLS_DTPREL64", + "R_AARCH64_TLS_TPREL64", + "R_AARCH64_TSTBR14", + "R_ALPHA", + "R_ALPHA_BRADDR", + "R_ALPHA_COPY", + "R_ALPHA_GLOB_DAT", + "R_ALPHA_GPDISP", + "R_ALPHA_GPREL32", + "R_ALPHA_GPRELHIGH", + "R_ALPHA_GPRELLOW", + "R_ALPHA_GPVALUE", + "R_ALPHA_HINT", + "R_ALPHA_IMMED_BR_HI32", + "R_ALPHA_IMMED_GP_16", + "R_ALPHA_IMMED_GP_HI32", + "R_ALPHA_IMMED_LO32", + "R_ALPHA_IMMED_SCN_HI32", + "R_ALPHA_JMP_SLOT", + "R_ALPHA_LITERAL", + "R_ALPHA_LITUSE", + "R_ALPHA_NONE", + "R_ALPHA_OP_PRSHIFT", + "R_ALPHA_OP_PSUB", + "R_ALPHA_OP_PUSH", + "R_ALPHA_OP_STORE", + "R_ALPHA_REFLONG", + "R_ALPHA_REFQUAD", + "R_ALPHA_RELATIVE", + "R_ALPHA_SREL16", + "R_ALPHA_SREL32", + "R_ALPHA_SREL64", + "R_ARM", + "R_ARM_ABS12", + "R_ARM_ABS16", + "R_ARM_ABS32", + "R_ARM_ABS32_NOI", + "R_ARM_ABS8", + "R_ARM_ALU_PCREL_15_8", + "R_ARM_ALU_PCREL_23_15", + "R_ARM_ALU_PCREL_7_0", + "R_ARM_ALU_PC_G0", + "R_ARM_ALU_PC_G0_NC", + "R_ARM_ALU_PC_G1", + "R_ARM_ALU_PC_G1_NC", + "R_ARM_ALU_PC_G2", + "R_ARM_ALU_SBREL_19_12_NC", + "R_ARM_ALU_SBREL_27_20_CK", + "R_ARM_ALU_SB_G0", + "R_ARM_ALU_SB_G0_NC", + "R_ARM_ALU_SB_G1", + "R_ARM_ALU_SB_G1_NC", + "R_ARM_ALU_SB_G2", + "R_ARM_AMP_VCALL9", + "R_ARM_BASE_ABS", + "R_ARM_CALL", + "R_ARM_COPY", + "R_ARM_GLOB_DAT", + "R_ARM_GNU_VTENTRY", + "R_ARM_GNU_VTINHERIT", + "R_ARM_GOT32", + "R_ARM_GOTOFF", + "R_ARM_GOTOFF12", + "R_ARM_GOTPC", + "R_ARM_GOTRELAX", + "R_ARM_GOT_ABS", + "R_ARM_GOT_BREL12", + "R_ARM_GOT_PREL", + "R_ARM_IRELATIVE", + "R_ARM_JUMP24", + "R_ARM_JUMP_SLOT", + "R_ARM_LDC_PC_G0", + "R_ARM_LDC_PC_G1", + "R_ARM_LDC_PC_G2", + "R_ARM_LDC_SB_G0", + "R_ARM_LDC_SB_G1", + "R_ARM_LDC_SB_G2", + "R_ARM_LDRS_PC_G0", + "R_ARM_LDRS_PC_G1", + "R_ARM_LDRS_PC_G2", + "R_ARM_LDRS_SB_G0", + "R_ARM_LDRS_SB_G1", + "R_ARM_LDRS_SB_G2", + "R_ARM_LDR_PC_G1", + "R_ARM_LDR_PC_G2", + "R_ARM_LDR_SBREL_11_10_NC", + "R_ARM_LDR_SB_G0", + "R_ARM_LDR_SB_G1", + "R_ARM_LDR_SB_G2", + "R_ARM_ME_TOO", + "R_ARM_MOVT_ABS", + "R_ARM_MOVT_BREL", + "R_ARM_MOVT_PREL", + "R_ARM_MOVW_ABS_NC", + "R_ARM_MOVW_BREL", + "R_ARM_MOVW_BREL_NC", + "R_ARM_MOVW_PREL_NC", + "R_ARM_NONE", + "R_ARM_PC13", + "R_ARM_PC24", + "R_ARM_PLT32", + "R_ARM_PLT32_ABS", + "R_ARM_PREL31", + "R_ARM_PRIVATE_0", + "R_ARM_PRIVATE_1", + "R_ARM_PRIVATE_10", + "R_ARM_PRIVATE_11", + "R_ARM_PRIVATE_12", + "R_ARM_PRIVATE_13", + "R_ARM_PRIVATE_14", + "R_ARM_PRIVATE_15", + "R_ARM_PRIVATE_2", + "R_ARM_PRIVATE_3", + "R_ARM_PRIVATE_4", + "R_ARM_PRIVATE_5", + "R_ARM_PRIVATE_6", + "R_ARM_PRIVATE_7", + "R_ARM_PRIVATE_8", + "R_ARM_PRIVATE_9", + "R_ARM_RABS32", + "R_ARM_RBASE", + "R_ARM_REL32", + "R_ARM_REL32_NOI", + "R_ARM_RELATIVE", + "R_ARM_RPC24", + "R_ARM_RREL32", + "R_ARM_RSBREL32", + "R_ARM_RXPC25", + "R_ARM_SBREL31", + "R_ARM_SBREL32", + "R_ARM_SWI24", + "R_ARM_TARGET1", + "R_ARM_TARGET2", + "R_ARM_THM_ABS5", + "R_ARM_THM_ALU_ABS_G0_NC", + "R_ARM_THM_ALU_ABS_G1_NC", + "R_ARM_THM_ALU_ABS_G2_NC", + "R_ARM_THM_ALU_ABS_G3", + "R_ARM_THM_ALU_PREL_11_0", + "R_ARM_THM_GOT_BREL12", + "R_ARM_THM_JUMP11", + "R_ARM_THM_JUMP19", + "R_ARM_THM_JUMP24", + "R_ARM_THM_JUMP6", + "R_ARM_THM_JUMP8", + "R_ARM_THM_MOVT_ABS", + "R_ARM_THM_MOVT_BREL", + "R_ARM_THM_MOVT_PREL", + "R_ARM_THM_MOVW_ABS_NC", + "R_ARM_THM_MOVW_BREL", + "R_ARM_THM_MOVW_BREL_NC", + "R_ARM_THM_MOVW_PREL_NC", + "R_ARM_THM_PC12", + "R_ARM_THM_PC22", + "R_ARM_THM_PC8", + "R_ARM_THM_RPC22", + "R_ARM_THM_SWI8", + "R_ARM_THM_TLS_CALL", + "R_ARM_THM_TLS_DESCSEQ16", + "R_ARM_THM_TLS_DESCSEQ32", + "R_ARM_THM_XPC22", + "R_ARM_TLS_CALL", + "R_ARM_TLS_DESCSEQ", + "R_ARM_TLS_DTPMOD32", + "R_ARM_TLS_DTPOFF32", + "R_ARM_TLS_GD32", + "R_ARM_TLS_GOTDESC", + "R_ARM_TLS_IE12GP", + "R_ARM_TLS_IE32", + "R_ARM_TLS_LDM32", + "R_ARM_TLS_LDO12", + "R_ARM_TLS_LDO32", + "R_ARM_TLS_LE12", + "R_ARM_TLS_LE32", + "R_ARM_TLS_TPOFF32", + "R_ARM_V4BX", + "R_ARM_XPC25", + "R_INFO", + "R_INFO32", + "R_MIPS", + "R_MIPS_16", + "R_MIPS_26", + "R_MIPS_32", + "R_MIPS_64", + "R_MIPS_ADD_IMMEDIATE", + "R_MIPS_CALL16", + "R_MIPS_CALL_HI16", + "R_MIPS_CALL_LO16", + "R_MIPS_DELETE", + "R_MIPS_GOT16", + "R_MIPS_GOT_DISP", + "R_MIPS_GOT_HI16", + "R_MIPS_GOT_LO16", + "R_MIPS_GOT_OFST", + "R_MIPS_GOT_PAGE", + "R_MIPS_GPREL16", + "R_MIPS_GPREL32", + "R_MIPS_HI16", + "R_MIPS_HIGHER", + "R_MIPS_HIGHEST", + "R_MIPS_INSERT_A", + "R_MIPS_INSERT_B", + "R_MIPS_JALR", + "R_MIPS_LITERAL", + "R_MIPS_LO16", + "R_MIPS_NONE", + "R_MIPS_PC16", + "R_MIPS_PJUMP", + "R_MIPS_REL16", + "R_MIPS_REL32", + "R_MIPS_RELGOT", + "R_MIPS_SCN_DISP", + "R_MIPS_SHIFT5", + "R_MIPS_SHIFT6", + "R_MIPS_SUB", + "R_MIPS_TLS_DTPMOD32", + "R_MIPS_TLS_DTPMOD64", + "R_MIPS_TLS_DTPREL32", + "R_MIPS_TLS_DTPREL64", + "R_MIPS_TLS_DTPREL_HI16", + "R_MIPS_TLS_DTPREL_LO16", + "R_MIPS_TLS_GD", + "R_MIPS_TLS_GOTTPREL", + "R_MIPS_TLS_LDM", + "R_MIPS_TLS_TPREL32", + "R_MIPS_TLS_TPREL64", + "R_MIPS_TLS_TPREL_HI16", + "R_MIPS_TLS_TPREL_LO16", + "R_PPC", + "R_PPC64", + "R_PPC64_ADDR14", + "R_PPC64_ADDR14_BRNTAKEN", + "R_PPC64_ADDR14_BRTAKEN", + "R_PPC64_ADDR16", + "R_PPC64_ADDR16_DS", + "R_PPC64_ADDR16_HA", + "R_PPC64_ADDR16_HI", + "R_PPC64_ADDR16_HIGH", + "R_PPC64_ADDR16_HIGHA", + "R_PPC64_ADDR16_HIGHER", + "R_PPC64_ADDR16_HIGHERA", + "R_PPC64_ADDR16_HIGHEST", + "R_PPC64_ADDR16_HIGHESTA", + "R_PPC64_ADDR16_LO", + "R_PPC64_ADDR16_LO_DS", + "R_PPC64_ADDR24", + "R_PPC64_ADDR32", + "R_PPC64_ADDR64", + "R_PPC64_ADDR64_LOCAL", + "R_PPC64_DTPMOD64", + "R_PPC64_DTPREL16", + "R_PPC64_DTPREL16_DS", + "R_PPC64_DTPREL16_HA", + "R_PPC64_DTPREL16_HI", + "R_PPC64_DTPREL16_HIGH", + "R_PPC64_DTPREL16_HIGHA", + "R_PPC64_DTPREL16_HIGHER", + "R_PPC64_DTPREL16_HIGHERA", + "R_PPC64_DTPREL16_HIGHEST", + "R_PPC64_DTPREL16_HIGHESTA", + "R_PPC64_DTPREL16_LO", + "R_PPC64_DTPREL16_LO_DS", + "R_PPC64_DTPREL64", + "R_PPC64_ENTRY", + "R_PPC64_GOT16", + "R_PPC64_GOT16_DS", + "R_PPC64_GOT16_HA", + "R_PPC64_GOT16_HI", + "R_PPC64_GOT16_LO", + "R_PPC64_GOT16_LO_DS", + "R_PPC64_GOT_DTPREL16_DS", + "R_PPC64_GOT_DTPREL16_HA", + "R_PPC64_GOT_DTPREL16_HI", + "R_PPC64_GOT_DTPREL16_LO_DS", + "R_PPC64_GOT_TLSGD16", + "R_PPC64_GOT_TLSGD16_HA", + "R_PPC64_GOT_TLSGD16_HI", + "R_PPC64_GOT_TLSGD16_LO", + "R_PPC64_GOT_TLSLD16", + "R_PPC64_GOT_TLSLD16_HA", + "R_PPC64_GOT_TLSLD16_HI", + "R_PPC64_GOT_TLSLD16_LO", + "R_PPC64_GOT_TPREL16_DS", + "R_PPC64_GOT_TPREL16_HA", + "R_PPC64_GOT_TPREL16_HI", + "R_PPC64_GOT_TPREL16_LO_DS", + "R_PPC64_IRELATIVE", + "R_PPC64_JMP_IREL", + "R_PPC64_JMP_SLOT", + "R_PPC64_NONE", + "R_PPC64_PLT16_LO_DS", + "R_PPC64_PLTGOT16", + "R_PPC64_PLTGOT16_DS", + "R_PPC64_PLTGOT16_HA", + "R_PPC64_PLTGOT16_HI", + "R_PPC64_PLTGOT16_LO", + "R_PPC64_PLTGOT_LO_DS", + "R_PPC64_REL14", + "R_PPC64_REL14_BRNTAKEN", + "R_PPC64_REL14_BRTAKEN", + "R_PPC64_REL16", + "R_PPC64_REL16DX_HA", + "R_PPC64_REL16_HA", + "R_PPC64_REL16_HI", + "R_PPC64_REL16_LO", + "R_PPC64_REL24", + "R_PPC64_REL24_NOTOC", + "R_PPC64_REL32", + "R_PPC64_REL64", + "R_PPC64_SECTOFF_DS", + "R_PPC64_SECTOFF_LO_DS", + "R_PPC64_TLS", + "R_PPC64_TLSGD", + "R_PPC64_TLSLD", + "R_PPC64_TOC", + "R_PPC64_TOC16", + "R_PPC64_TOC16_DS", + "R_PPC64_TOC16_HA", + "R_PPC64_TOC16_HI", + "R_PPC64_TOC16_LO", + "R_PPC64_TOC16_LO_DS", + "R_PPC64_TOCSAVE", + "R_PPC64_TPREL16", + "R_PPC64_TPREL16_DS", + "R_PPC64_TPREL16_HA", + "R_PPC64_TPREL16_HI", + "R_PPC64_TPREL16_HIGH", + "R_PPC64_TPREL16_HIGHA", + "R_PPC64_TPREL16_HIGHER", + "R_PPC64_TPREL16_HIGHERA", + "R_PPC64_TPREL16_HIGHEST", + "R_PPC64_TPREL16_HIGHESTA", + "R_PPC64_TPREL16_LO", + "R_PPC64_TPREL16_LO_DS", + "R_PPC64_TPREL64", + "R_PPC_ADDR14", + "R_PPC_ADDR14_BRNTAKEN", + "R_PPC_ADDR14_BRTAKEN", + "R_PPC_ADDR16", + "R_PPC_ADDR16_HA", + "R_PPC_ADDR16_HI", + "R_PPC_ADDR16_LO", + "R_PPC_ADDR24", + "R_PPC_ADDR32", + "R_PPC_COPY", + "R_PPC_DTPMOD32", + "R_PPC_DTPREL16", + "R_PPC_DTPREL16_HA", + "R_PPC_DTPREL16_HI", + "R_PPC_DTPREL16_LO", + "R_PPC_DTPREL32", + "R_PPC_EMB_BIT_FLD", + "R_PPC_EMB_MRKREF", + "R_PPC_EMB_NADDR16", + "R_PPC_EMB_NADDR16_HA", + "R_PPC_EMB_NADDR16_HI", + "R_PPC_EMB_NADDR16_LO", + "R_PPC_EMB_NADDR32", + "R_PPC_EMB_RELSDA", + "R_PPC_EMB_RELSEC16", + "R_PPC_EMB_RELST_HA", + "R_PPC_EMB_RELST_HI", + "R_PPC_EMB_RELST_LO", + "R_PPC_EMB_SDA21", + "R_PPC_EMB_SDA2I16", + "R_PPC_EMB_SDA2REL", + "R_PPC_EMB_SDAI16", + "R_PPC_GLOB_DAT", + "R_PPC_GOT16", + "R_PPC_GOT16_HA", + "R_PPC_GOT16_HI", + "R_PPC_GOT16_LO", + "R_PPC_GOT_TLSGD16", + "R_PPC_GOT_TLSGD16_HA", + "R_PPC_GOT_TLSGD16_HI", + "R_PPC_GOT_TLSGD16_LO", + "R_PPC_GOT_TLSLD16", + "R_PPC_GOT_TLSLD16_HA", + "R_PPC_GOT_TLSLD16_HI", + "R_PPC_GOT_TLSLD16_LO", + "R_PPC_GOT_TPREL16", + "R_PPC_GOT_TPREL16_HA", + "R_PPC_GOT_TPREL16_HI", + "R_PPC_GOT_TPREL16_LO", + "R_PPC_JMP_SLOT", + "R_PPC_LOCAL24PC", + "R_PPC_NONE", + "R_PPC_PLT16_HA", + "R_PPC_PLT16_HI", + "R_PPC_PLT16_LO", + "R_PPC_PLT32", + "R_PPC_PLTREL24", + "R_PPC_PLTREL32", + "R_PPC_REL14", + "R_PPC_REL14_BRNTAKEN", + "R_PPC_REL14_BRTAKEN", + "R_PPC_REL24", + "R_PPC_REL32", + "R_PPC_RELATIVE", + "R_PPC_SDAREL16", + "R_PPC_SECTOFF", + "R_PPC_SECTOFF_HA", + "R_PPC_SECTOFF_HI", + "R_PPC_SECTOFF_LO", + "R_PPC_TLS", + "R_PPC_TPREL16", + "R_PPC_TPREL16_HA", + "R_PPC_TPREL16_HI", + "R_PPC_TPREL16_LO", + "R_PPC_TPREL32", + "R_PPC_UADDR16", + "R_PPC_UADDR32", + "R_RISCV", + "R_RISCV_32", + "R_RISCV_32_PCREL", + "R_RISCV_64", + "R_RISCV_ADD16", + "R_RISCV_ADD32", + "R_RISCV_ADD64", + "R_RISCV_ADD8", + "R_RISCV_ALIGN", + "R_RISCV_BRANCH", + "R_RISCV_CALL", + "R_RISCV_CALL_PLT", + "R_RISCV_COPY", + "R_RISCV_GNU_VTENTRY", + "R_RISCV_GNU_VTINHERIT", + "R_RISCV_GOT_HI20", + "R_RISCV_GPREL_I", + "R_RISCV_GPREL_S", + "R_RISCV_HI20", + "R_RISCV_JAL", + "R_RISCV_JUMP_SLOT", + "R_RISCV_LO12_I", + "R_RISCV_LO12_S", + "R_RISCV_NONE", + "R_RISCV_PCREL_HI20", + "R_RISCV_PCREL_LO12_I", + "R_RISCV_PCREL_LO12_S", + "R_RISCV_RELATIVE", + "R_RISCV_RELAX", + "R_RISCV_RVC_BRANCH", + "R_RISCV_RVC_JUMP", + "R_RISCV_RVC_LUI", + "R_RISCV_SET16", + "R_RISCV_SET32", + "R_RISCV_SET6", + "R_RISCV_SET8", + "R_RISCV_SUB16", + "R_RISCV_SUB32", + "R_RISCV_SUB6", + "R_RISCV_SUB64", + "R_RISCV_SUB8", + "R_RISCV_TLS_DTPMOD32", + "R_RISCV_TLS_DTPMOD64", + "R_RISCV_TLS_DTPREL32", + "R_RISCV_TLS_DTPREL64", + "R_RISCV_TLS_GD_HI20", + "R_RISCV_TLS_GOT_HI20", + "R_RISCV_TLS_TPREL32", + "R_RISCV_TLS_TPREL64", + "R_RISCV_TPREL_ADD", + "R_RISCV_TPREL_HI20", + "R_RISCV_TPREL_I", + "R_RISCV_TPREL_LO12_I", + "R_RISCV_TPREL_LO12_S", + "R_RISCV_TPREL_S", + "R_SPARC", + "R_SPARC_10", + "R_SPARC_11", + "R_SPARC_13", + "R_SPARC_16", + "R_SPARC_22", + "R_SPARC_32", + "R_SPARC_5", + "R_SPARC_6", + "R_SPARC_64", + "R_SPARC_7", + "R_SPARC_8", + "R_SPARC_COPY", + "R_SPARC_DISP16", + "R_SPARC_DISP32", + "R_SPARC_DISP64", + "R_SPARC_DISP8", + "R_SPARC_GLOB_DAT", + "R_SPARC_GLOB_JMP", + "R_SPARC_GOT10", + "R_SPARC_GOT13", + "R_SPARC_GOT22", + "R_SPARC_H44", + "R_SPARC_HH22", + "R_SPARC_HI22", + "R_SPARC_HIPLT22", + "R_SPARC_HIX22", + "R_SPARC_HM10", + "R_SPARC_JMP_SLOT", + "R_SPARC_L44", + "R_SPARC_LM22", + "R_SPARC_LO10", + "R_SPARC_LOPLT10", + "R_SPARC_LOX10", + "R_SPARC_M44", + "R_SPARC_NONE", + "R_SPARC_OLO10", + "R_SPARC_PC10", + "R_SPARC_PC22", + "R_SPARC_PCPLT10", + "R_SPARC_PCPLT22", + "R_SPARC_PCPLT32", + "R_SPARC_PC_HH22", + "R_SPARC_PC_HM10", + "R_SPARC_PC_LM22", + "R_SPARC_PLT32", + "R_SPARC_PLT64", + "R_SPARC_REGISTER", + "R_SPARC_RELATIVE", + "R_SPARC_UA16", + "R_SPARC_UA32", + "R_SPARC_UA64", + "R_SPARC_WDISP16", + "R_SPARC_WDISP19", + "R_SPARC_WDISP22", + "R_SPARC_WDISP30", + "R_SPARC_WPLT30", + "R_SYM32", + "R_SYM64", + "R_TYPE32", + "R_TYPE64", + "R_X86_64", + "R_X86_64_16", + "R_X86_64_32", + "R_X86_64_32S", + "R_X86_64_64", + "R_X86_64_8", + "R_X86_64_COPY", + "R_X86_64_DTPMOD64", + "R_X86_64_DTPOFF32", + "R_X86_64_DTPOFF64", + "R_X86_64_GLOB_DAT", + "R_X86_64_GOT32", + "R_X86_64_GOT64", + "R_X86_64_GOTOFF64", + "R_X86_64_GOTPC32", + "R_X86_64_GOTPC32_TLSDESC", + "R_X86_64_GOTPC64", + "R_X86_64_GOTPCREL", + "R_X86_64_GOTPCREL64", + "R_X86_64_GOTPCRELX", + "R_X86_64_GOTPLT64", + "R_X86_64_GOTTPOFF", + "R_X86_64_IRELATIVE", + "R_X86_64_JMP_SLOT", + "R_X86_64_NONE", + "R_X86_64_PC16", + "R_X86_64_PC32", + "R_X86_64_PC32_BND", + "R_X86_64_PC64", + "R_X86_64_PC8", + "R_X86_64_PLT32", + "R_X86_64_PLT32_BND", + "R_X86_64_PLTOFF64", + "R_X86_64_RELATIVE", + "R_X86_64_RELATIVE64", + "R_X86_64_REX_GOTPCRELX", + "R_X86_64_SIZE32", + "R_X86_64_SIZE64", + "R_X86_64_TLSDESC", + "R_X86_64_TLSDESC_CALL", + "R_X86_64_TLSGD", + "R_X86_64_TLSLD", + "R_X86_64_TPOFF32", + "R_X86_64_TPOFF64", + "Rel32", + "Rel64", + "Rela32", + "Rela64", + "SHF_ALLOC", + "SHF_COMPRESSED", + "SHF_EXECINSTR", + "SHF_GROUP", + "SHF_INFO_LINK", + "SHF_LINK_ORDER", + "SHF_MASKOS", + "SHF_MASKPROC", + "SHF_MERGE", + "SHF_OS_NONCONFORMING", + "SHF_STRINGS", + "SHF_TLS", + "SHF_WRITE", + "SHN_ABS", + "SHN_COMMON", + "SHN_HIOS", + "SHN_HIPROC", + "SHN_HIRESERVE", + "SHN_LOOS", + "SHN_LOPROC", + "SHN_LORESERVE", + "SHN_UNDEF", + "SHN_XINDEX", + "SHT_DYNAMIC", + "SHT_DYNSYM", + "SHT_FINI_ARRAY", + "SHT_GNU_ATTRIBUTES", + "SHT_GNU_HASH", + "SHT_GNU_LIBLIST", + "SHT_GNU_VERDEF", + "SHT_GNU_VERNEED", + "SHT_GNU_VERSYM", + "SHT_GROUP", + "SHT_HASH", + "SHT_HIOS", + "SHT_HIPROC", + "SHT_HIUSER", + "SHT_INIT_ARRAY", + "SHT_LOOS", + "SHT_LOPROC", + "SHT_LOUSER", + "SHT_NOBITS", + "SHT_NOTE", + "SHT_NULL", + "SHT_PREINIT_ARRAY", + "SHT_PROGBITS", + "SHT_REL", + "SHT_RELA", + "SHT_SHLIB", + "SHT_STRTAB", + "SHT_SYMTAB", + "SHT_SYMTAB_SHNDX", + "STB_GLOBAL", + "STB_HIOS", + "STB_HIPROC", + "STB_LOCAL", + "STB_LOOS", + "STB_LOPROC", + "STB_WEAK", + "STT_COMMON", + "STT_FILE", + "STT_FUNC", + "STT_HIOS", + "STT_HIPROC", + "STT_LOOS", + "STT_LOPROC", + "STT_NOTYPE", + "STT_OBJECT", + "STT_SECTION", + "STT_TLS", + "STV_DEFAULT", + "STV_HIDDEN", + "STV_INTERNAL", + "STV_PROTECTED", + "ST_BIND", + "ST_INFO", + "ST_TYPE", + "ST_VISIBILITY", + "Section", + "Section32", + "Section64", + "SectionFlag", + "SectionHeader", + "SectionIndex", + "SectionType", + "Sym32", + "Sym32Size", + "Sym64", + "Sym64Size", + "SymBind", + "SymType", + "SymVis", + "Symbol", + "Type", + "Version", + }, + "debug/gosym": []string{ + "DecodingError", + "Func", + "LineTable", + "NewLineTable", + "NewTable", + "Obj", + "Sym", + "Table", + "UnknownFileError", + "UnknownLineError", + }, + "debug/macho": []string{ + "ARM64_RELOC_ADDEND", + "ARM64_RELOC_BRANCH26", + "ARM64_RELOC_GOT_LOAD_PAGE21", + "ARM64_RELOC_GOT_LOAD_PAGEOFF12", + "ARM64_RELOC_PAGE21", + "ARM64_RELOC_PAGEOFF12", + "ARM64_RELOC_POINTER_TO_GOT", + "ARM64_RELOC_SUBTRACTOR", + "ARM64_RELOC_TLVP_LOAD_PAGE21", + "ARM64_RELOC_TLVP_LOAD_PAGEOFF12", + "ARM64_RELOC_UNSIGNED", + "ARM_RELOC_BR24", + "ARM_RELOC_HALF", + "ARM_RELOC_HALF_SECTDIFF", + "ARM_RELOC_LOCAL_SECTDIFF", + "ARM_RELOC_PAIR", + "ARM_RELOC_PB_LA_PTR", + "ARM_RELOC_SECTDIFF", + "ARM_RELOC_VANILLA", + "ARM_THUMB_32BIT_BRANCH", + "ARM_THUMB_RELOC_BR22", + "Cpu", + "Cpu386", + "CpuAmd64", + "CpuArm", + "CpuArm64", + "CpuPpc", + "CpuPpc64", + "Dylib", + "DylibCmd", + "Dysymtab", + "DysymtabCmd", + "ErrNotFat", + "FatArch", + "FatArchHeader", + "FatFile", + "File", + "FileHeader", + "FlagAllModsBound", + "FlagAllowStackExecution", + "FlagAppExtensionSafe", + "FlagBindAtLoad", + "FlagBindsToWeak", + "FlagCanonical", + "FlagDeadStrippableDylib", + "FlagDyldLink", + "FlagForceFlat", + "FlagHasTLVDescriptors", + "FlagIncrLink", + "FlagLazyInit", + "FlagNoFixPrebinding", + "FlagNoHeapExecution", + "FlagNoMultiDefs", + "FlagNoReexportedDylibs", + "FlagNoUndefs", + "FlagPIE", + "FlagPrebindable", + "FlagPrebound", + "FlagRootSafe", + "FlagSetuidSafe", + "FlagSplitSegs", + "FlagSubsectionsViaSymbols", + "FlagTwoLevel", + "FlagWeakDefines", + "FormatError", + "GENERIC_RELOC_LOCAL_SECTDIFF", + "GENERIC_RELOC_PAIR", + "GENERIC_RELOC_PB_LA_PTR", + "GENERIC_RELOC_SECTDIFF", + "GENERIC_RELOC_TLV", + "GENERIC_RELOC_VANILLA", + "Load", + "LoadBytes", + "LoadCmd", + "LoadCmdDylib", + "LoadCmdDylinker", + "LoadCmdDysymtab", + "LoadCmdRpath", + "LoadCmdSegment", + "LoadCmdSegment64", + "LoadCmdSymtab", + "LoadCmdThread", + "LoadCmdUnixThread", + "Magic32", + "Magic64", + "MagicFat", + "NewFatFile", + "NewFile", + "Nlist32", + "Nlist64", + "Open", + "OpenFat", + "Regs386", + "RegsAMD64", + "Reloc", + "RelocTypeARM", + "RelocTypeARM64", + "RelocTypeGeneric", + "RelocTypeX86_64", + "Rpath", + "RpathCmd", + "Section", + "Section32", + "Section64", + "SectionHeader", + "Segment", + "Segment32", + "Segment64", + "SegmentHeader", + "Symbol", + "Symtab", + "SymtabCmd", + "Thread", + "Type", + "TypeBundle", + "TypeDylib", + "TypeExec", + "TypeObj", + "X86_64_RELOC_BRANCH", + "X86_64_RELOC_GOT", + "X86_64_RELOC_GOT_LOAD", + "X86_64_RELOC_SIGNED", + "X86_64_RELOC_SIGNED_1", + "X86_64_RELOC_SIGNED_2", + "X86_64_RELOC_SIGNED_4", + "X86_64_RELOC_SUBTRACTOR", + "X86_64_RELOC_TLV", + "X86_64_RELOC_UNSIGNED", + }, + "debug/pe": []string{ + "COFFSymbol", + "COFFSymbolSize", + "DataDirectory", + "File", + "FileHeader", + "FormatError", + "IMAGE_DIRECTORY_ENTRY_ARCHITECTURE", + "IMAGE_DIRECTORY_ENTRY_BASERELOC", + "IMAGE_DIRECTORY_ENTRY_BOUND_IMPORT", + "IMAGE_DIRECTORY_ENTRY_COM_DESCRIPTOR", + "IMAGE_DIRECTORY_ENTRY_DEBUG", + "IMAGE_DIRECTORY_ENTRY_DELAY_IMPORT", + "IMAGE_DIRECTORY_ENTRY_EXCEPTION", + "IMAGE_DIRECTORY_ENTRY_EXPORT", + "IMAGE_DIRECTORY_ENTRY_GLOBALPTR", + "IMAGE_DIRECTORY_ENTRY_IAT", + "IMAGE_DIRECTORY_ENTRY_IMPORT", + "IMAGE_DIRECTORY_ENTRY_LOAD_CONFIG", + "IMAGE_DIRECTORY_ENTRY_RESOURCE", + "IMAGE_DIRECTORY_ENTRY_SECURITY", + "IMAGE_DIRECTORY_ENTRY_TLS", + "IMAGE_FILE_MACHINE_AM33", + "IMAGE_FILE_MACHINE_AMD64", + "IMAGE_FILE_MACHINE_ARM", + "IMAGE_FILE_MACHINE_ARM64", + "IMAGE_FILE_MACHINE_ARMNT", + "IMAGE_FILE_MACHINE_EBC", + "IMAGE_FILE_MACHINE_I386", + "IMAGE_FILE_MACHINE_IA64", + "IMAGE_FILE_MACHINE_M32R", + "IMAGE_FILE_MACHINE_MIPS16", + "IMAGE_FILE_MACHINE_MIPSFPU", + "IMAGE_FILE_MACHINE_MIPSFPU16", + "IMAGE_FILE_MACHINE_POWERPC", + "IMAGE_FILE_MACHINE_POWERPCFP", + "IMAGE_FILE_MACHINE_R4000", + "IMAGE_FILE_MACHINE_SH3", + "IMAGE_FILE_MACHINE_SH3DSP", + "IMAGE_FILE_MACHINE_SH4", + "IMAGE_FILE_MACHINE_SH5", + "IMAGE_FILE_MACHINE_THUMB", + "IMAGE_FILE_MACHINE_UNKNOWN", + "IMAGE_FILE_MACHINE_WCEMIPSV2", + "ImportDirectory", + "NewFile", + "Open", + "OptionalHeader32", + "OptionalHeader64", + "Reloc", + "Section", + "SectionHeader", + "SectionHeader32", + "StringTable", + "Symbol", + }, + "debug/plan9obj": []string{ + "File", + "FileHeader", + "Magic386", + "Magic64", + "MagicAMD64", + "MagicARM", + "NewFile", + "Open", + "Section", + "SectionHeader", + "Sym", + }, + "encoding": []string{ + "BinaryMarshaler", + "BinaryUnmarshaler", + "TextMarshaler", + "TextUnmarshaler", + }, + "encoding/ascii85": []string{ + "CorruptInputError", + "Decode", + "Encode", + "MaxEncodedLen", + "NewDecoder", + "NewEncoder", + }, + "encoding/asn1": []string{ + "BitString", + "ClassApplication", + "ClassContextSpecific", + "ClassPrivate", + "ClassUniversal", + "Enumerated", + "Flag", + "Marshal", + "MarshalWithParams", + "NullBytes", + "NullRawValue", + "ObjectIdentifier", + "RawContent", + "RawValue", + "StructuralError", + "SyntaxError", + "TagBitString", + "TagBoolean", + "TagEnum", + "TagGeneralString", + "TagGeneralizedTime", + "TagIA5String", + "TagInteger", + "TagNull", + "TagNumericString", + "TagOID", + "TagOctetString", + "TagPrintableString", + "TagSequence", + "TagSet", + "TagT61String", + "TagUTCTime", + "TagUTF8String", + "Unmarshal", + "UnmarshalWithParams", + }, + "encoding/base32": []string{ + "CorruptInputError", + "Encoding", + "HexEncoding", + "NewDecoder", + "NewEncoder", + "NewEncoding", + "NoPadding", + "StdEncoding", + "StdPadding", + }, + "encoding/base64": []string{ + "CorruptInputError", + "Encoding", + "NewDecoder", + "NewEncoder", + "NewEncoding", + "NoPadding", + "RawStdEncoding", + "RawURLEncoding", + "StdEncoding", + "StdPadding", + "URLEncoding", + }, + "encoding/binary": []string{ + "BigEndian", + "ByteOrder", + "LittleEndian", + "MaxVarintLen16", + "MaxVarintLen32", + "MaxVarintLen64", + "PutUvarint", + "PutVarint", + "Read", + "ReadUvarint", + "ReadVarint", + "Size", + "Uvarint", + "Varint", + "Write", + }, + "encoding/csv": []string{ + "ErrBareQuote", + "ErrFieldCount", + "ErrQuote", + "ErrTrailingComma", + "NewReader", + "NewWriter", + "ParseError", + "Reader", + "Writer", + }, + "encoding/gob": []string{ + "CommonType", + "Decoder", + "Encoder", + "GobDecoder", + "GobEncoder", + "NewDecoder", + "NewEncoder", + "Register", + "RegisterName", + }, + "encoding/hex": []string{ + "Decode", + "DecodeString", + "DecodedLen", + "Dump", + "Dumper", + "Encode", + "EncodeToString", + "EncodedLen", + "ErrLength", + "InvalidByteError", + "NewDecoder", + "NewEncoder", + }, + "encoding/json": []string{ + "Compact", + "Decoder", + "Delim", + "Encoder", + "HTMLEscape", + "Indent", + "InvalidUTF8Error", + "InvalidUnmarshalError", + "Marshal", + "MarshalIndent", + "Marshaler", + "MarshalerError", + "NewDecoder", + "NewEncoder", + "Number", + "RawMessage", + "SyntaxError", + "Token", + "Unmarshal", + "UnmarshalFieldError", + "UnmarshalTypeError", + "Unmarshaler", + "UnsupportedTypeError", + "UnsupportedValueError", + "Valid", + }, + "encoding/pem": []string{ + "Block", + "Decode", + "Encode", + "EncodeToMemory", + }, + "encoding/xml": []string{ + "Attr", + "CharData", + "Comment", + "CopyToken", + "Decoder", + "Directive", + "Encoder", + "EndElement", + "Escape", + "EscapeText", + "HTMLAutoClose", + "HTMLEntity", + "Header", + "Marshal", + "MarshalIndent", + "Marshaler", + "MarshalerAttr", + "Name", + "NewDecoder", + "NewEncoder", + "NewTokenDecoder", + "ProcInst", + "StartElement", + "SyntaxError", + "TagPathError", + "Token", + "TokenReader", + "Unmarshal", + "UnmarshalError", + "Unmarshaler", + "UnmarshalerAttr", + "UnsupportedTypeError", + }, + "errors": []string{ + "As", + "Is", + "New", + "Unwrap", + }, + "expvar": []string{ + "Do", + "Float", + "Func", + "Get", + "Handler", + "Int", + "KeyValue", + "Map", + "NewFloat", + "NewInt", + "NewMap", + "NewString", + "Publish", + "String", + "Var", + }, + "flag": []string{ + "Arg", + "Args", + "Bool", + "BoolVar", + "CommandLine", + "ContinueOnError", + "Duration", + "DurationVar", + "ErrHelp", + "ErrorHandling", + "ExitOnError", + "Flag", + "FlagSet", + "Float64", + "Float64Var", + "Getter", + "Int", + "Int64", + "Int64Var", + "IntVar", + "Lookup", + "NArg", + "NFlag", + "NewFlagSet", + "PanicOnError", + "Parse", + "Parsed", + "PrintDefaults", + "Set", + "String", + "StringVar", + "Uint", + "Uint64", + "Uint64Var", + "UintVar", + "UnquoteUsage", + "Usage", + "Value", + "Var", + "Visit", + "VisitAll", + }, + "fmt": []string{ + "Errorf", + "Formatter", + "Fprint", + "Fprintf", + "Fprintln", + "Fscan", + "Fscanf", + "Fscanln", + "GoStringer", + "Print", + "Printf", + "Println", + "Scan", + "ScanState", + "Scanf", + "Scanln", + "Scanner", + "Sprint", + "Sprintf", + "Sprintln", + "Sscan", + "Sscanf", + "Sscanln", + "State", + "Stringer", + }, + "go/ast": []string{ + "ArrayType", + "AssignStmt", + "Bad", + "BadDecl", + "BadExpr", + "BadStmt", + "BasicLit", + "BinaryExpr", + "BlockStmt", + "BranchStmt", + "CallExpr", + "CaseClause", + "ChanDir", + "ChanType", + "CommClause", + "Comment", + "CommentGroup", + "CommentMap", + "CompositeLit", + "Con", + "Decl", + "DeclStmt", + "DeferStmt", + "Ellipsis", + "EmptyStmt", + "Expr", + "ExprStmt", + "Field", + "FieldFilter", + "FieldList", + "File", + "FileExports", + "Filter", + "FilterDecl", + "FilterFile", + "FilterFuncDuplicates", + "FilterImportDuplicates", + "FilterPackage", + "FilterUnassociatedComments", + "ForStmt", + "Fprint", + "Fun", + "FuncDecl", + "FuncLit", + "FuncType", + "GenDecl", + "GoStmt", + "Ident", + "IfStmt", + "ImportSpec", + "Importer", + "IncDecStmt", + "IndexExpr", + "Inspect", + "InterfaceType", + "IsExported", + "KeyValueExpr", + "LabeledStmt", + "Lbl", + "MapType", + "MergeMode", + "MergePackageFiles", + "NewCommentMap", + "NewIdent", + "NewObj", + "NewPackage", + "NewScope", + "Node", + "NotNilFilter", + "ObjKind", + "Object", + "Package", + "PackageExports", + "ParenExpr", + "Pkg", + "Print", + "RECV", + "RangeStmt", + "ReturnStmt", + "SEND", + "Scope", + "SelectStmt", + "SelectorExpr", + "SendStmt", + "SliceExpr", + "SortImports", + "Spec", + "StarExpr", + "Stmt", + "StructType", + "SwitchStmt", + "Typ", + "TypeAssertExpr", + "TypeSpec", + "TypeSwitchStmt", + "UnaryExpr", + "ValueSpec", + "Var", + "Visitor", + "Walk", + }, + "go/build": []string{ + "AllowBinary", + "ArchChar", + "Context", + "Default", + "FindOnly", + "IgnoreVendor", + "Import", + "ImportComment", + "ImportDir", + "ImportMode", + "IsLocalImport", + "MultiplePackageError", + "NoGoError", + "Package", + "ToolDir", + }, + "go/constant": []string{ + "BinaryOp", + "BitLen", + "Bool", + "BoolVal", + "Bytes", + "Compare", + "Complex", + "Denom", + "Float", + "Float32Val", + "Float64Val", + "Imag", + "Int", + "Int64Val", + "Kind", + "Make", + "MakeBool", + "MakeFloat64", + "MakeFromBytes", + "MakeFromLiteral", + "MakeImag", + "MakeInt64", + "MakeString", + "MakeUint64", + "MakeUnknown", + "Num", + "Real", + "Shift", + "Sign", + "String", + "StringVal", + "ToComplex", + "ToFloat", + "ToInt", + "Uint64Val", + "UnaryOp", + "Unknown", + "Val", + "Value", + }, + "go/doc": []string{ + "AllDecls", + "AllMethods", + "Example", + "Examples", + "Filter", + "Func", + "IllegalPrefixes", + "IsPredeclared", + "Mode", + "New", + "Note", + "Package", + "PreserveAST", + "Synopsis", + "ToHTML", + "ToText", + "Type", + "Value", + }, + "go/format": []string{ + "Node", + "Source", + }, + "go/importer": []string{ + "Default", + "For", + "ForCompiler", + "Lookup", + }, + "go/parser": []string{ + "AllErrors", + "DeclarationErrors", + "ImportsOnly", + "Mode", + "PackageClauseOnly", + "ParseComments", + "ParseDir", + "ParseExpr", + "ParseExprFrom", + "ParseFile", + "SpuriousErrors", + "Trace", + }, + "go/printer": []string{ + "CommentedNode", + "Config", + "Fprint", + "Mode", + "RawFormat", + "SourcePos", + "TabIndent", + "UseSpaces", + }, + "go/scanner": []string{ + "Error", + "ErrorHandler", + "ErrorList", + "Mode", + "PrintError", + "ScanComments", + "Scanner", + }, + "go/token": []string{ + "ADD", + "ADD_ASSIGN", + "AND", + "AND_ASSIGN", + "AND_NOT", + "AND_NOT_ASSIGN", + "ARROW", + "ASSIGN", + "BREAK", + "CASE", + "CHAN", + "CHAR", + "COLON", + "COMMA", + "COMMENT", + "CONST", + "CONTINUE", + "DEC", + "DEFAULT", + "DEFER", + "DEFINE", + "ELLIPSIS", + "ELSE", + "EOF", + "EQL", + "FALLTHROUGH", + "FLOAT", + "FOR", + "FUNC", + "File", + "FileSet", + "GEQ", + "GO", + "GOTO", + "GTR", + "HighestPrec", + "IDENT", + "IF", + "ILLEGAL", + "IMAG", + "IMPORT", + "INC", + "INT", + "INTERFACE", + "IsExported", + "IsIdentifier", + "IsKeyword", + "LAND", + "LBRACE", + "LBRACK", + "LEQ", + "LOR", + "LPAREN", + "LSS", + "Lookup", + "LowestPrec", + "MAP", + "MUL", + "MUL_ASSIGN", + "NEQ", + "NOT", + "NewFileSet", + "NoPos", + "OR", + "OR_ASSIGN", + "PACKAGE", + "PERIOD", + "Pos", + "Position", + "QUO", + "QUO_ASSIGN", + "RANGE", + "RBRACE", + "RBRACK", + "REM", + "REM_ASSIGN", + "RETURN", + "RPAREN", + "SELECT", + "SEMICOLON", + "SHL", + "SHL_ASSIGN", + "SHR", + "SHR_ASSIGN", + "STRING", + "STRUCT", + "SUB", + "SUB_ASSIGN", + "SWITCH", + "TYPE", + "Token", + "UnaryPrec", + "VAR", + "XOR", + "XOR_ASSIGN", + }, + "go/types": []string{ + "Array", + "AssertableTo", + "AssignableTo", + "Basic", + "BasicInfo", + "BasicKind", + "Bool", + "Builtin", + "Byte", + "Chan", + "ChanDir", + "CheckExpr", + "Checker", + "Comparable", + "Complex128", + "Complex64", + "Config", + "Const", + "ConvertibleTo", + "DefPredeclaredTestFuncs", + "Default", + "Error", + "Eval", + "ExprString", + "FieldVal", + "Float32", + "Float64", + "Func", + "Id", + "Identical", + "IdenticalIgnoreTags", + "Implements", + "ImportMode", + "Importer", + "ImporterFrom", + "Info", + "Initializer", + "Int", + "Int16", + "Int32", + "Int64", + "Int8", + "Interface", + "Invalid", + "IsBoolean", + "IsComplex", + "IsConstType", + "IsFloat", + "IsInteger", + "IsInterface", + "IsNumeric", + "IsOrdered", + "IsString", + "IsUnsigned", + "IsUntyped", + "Label", + "LookupFieldOrMethod", + "Map", + "MethodExpr", + "MethodSet", + "MethodVal", + "MissingMethod", + "Named", + "NewArray", + "NewChan", + "NewChecker", + "NewConst", + "NewField", + "NewFunc", + "NewInterface", + "NewInterfaceType", + "NewLabel", + "NewMap", + "NewMethodSet", + "NewNamed", + "NewPackage", + "NewParam", + "NewPkgName", + "NewPointer", + "NewScope", + "NewSignature", + "NewSlice", + "NewStruct", + "NewTuple", + "NewTypeName", + "NewVar", + "Nil", + "Object", + "ObjectString", + "Package", + "PkgName", + "Pointer", + "Qualifier", + "RecvOnly", + "RelativeTo", + "Rune", + "Scope", + "Selection", + "SelectionKind", + "SelectionString", + "SendOnly", + "SendRecv", + "Signature", + "Sizes", + "SizesFor", + "Slice", + "StdSizes", + "String", + "Struct", + "Tuple", + "Typ", + "Type", + "TypeAndValue", + "TypeName", + "TypeString", + "Uint", + "Uint16", + "Uint32", + "Uint64", + "Uint8", + "Uintptr", + "Universe", + "Unsafe", + "UnsafePointer", + "UntypedBool", + "UntypedComplex", + "UntypedFloat", + "UntypedInt", + "UntypedNil", + "UntypedRune", + "UntypedString", + "Var", + "WriteExpr", + "WriteSignature", + "WriteType", + }, + "hash": []string{ + "Hash", + "Hash32", + "Hash64", + }, + "hash/adler32": []string{ + "Checksum", + "New", + "Size", + }, + "hash/crc32": []string{ + "Castagnoli", + "Checksum", + "ChecksumIEEE", + "IEEE", + "IEEETable", + "Koopman", + "MakeTable", + "New", + "NewIEEE", + "Size", + "Table", + "Update", + }, + "hash/crc64": []string{ + "Checksum", + "ECMA", + "ISO", + "MakeTable", + "New", + "Size", + "Table", + "Update", + }, + "hash/fnv": []string{ + "New128", + "New128a", + "New32", + "New32a", + "New64", + "New64a", + }, + "html": []string{ + "EscapeString", + "UnescapeString", + }, + "html/template": []string{ + "CSS", + "ErrAmbigContext", + "ErrBadHTML", + "ErrBranchEnd", + "ErrEndContext", + "ErrNoSuchTemplate", + "ErrOutputContext", + "ErrPartialCharset", + "ErrPartialEscape", + "ErrPredefinedEscaper", + "ErrRangeLoopReentry", + "ErrSlashAmbig", + "Error", + "ErrorCode", + "FuncMap", + "HTML", + "HTMLAttr", + "HTMLEscape", + "HTMLEscapeString", + "HTMLEscaper", + "IsTrue", + "JS", + "JSEscape", + "JSEscapeString", + "JSEscaper", + "JSStr", + "Must", + "New", + "OK", + "ParseFiles", + "ParseGlob", + "Srcset", + "Template", + "URL", + "URLQueryEscaper", + }, + "image": []string{ + "Alpha", + "Alpha16", + "Black", + "CMYK", + "Config", + "Decode", + "DecodeConfig", + "ErrFormat", + "Gray", + "Gray16", + "Image", + "NRGBA", + "NRGBA64", + "NYCbCrA", + "NewAlpha", + "NewAlpha16", + "NewCMYK", + "NewGray", + "NewGray16", + "NewNRGBA", + "NewNRGBA64", + "NewNYCbCrA", + "NewPaletted", + "NewRGBA", + "NewRGBA64", + "NewUniform", + "NewYCbCr", + "Opaque", + "Paletted", + "PalettedImage", + "Point", + "Pt", + "RGBA", + "RGBA64", + "Rect", + "Rectangle", + "RegisterFormat", + "Transparent", + "Uniform", + "White", + "YCbCr", + "YCbCrSubsampleRatio", + "YCbCrSubsampleRatio410", + "YCbCrSubsampleRatio411", + "YCbCrSubsampleRatio420", + "YCbCrSubsampleRatio422", + "YCbCrSubsampleRatio440", + "YCbCrSubsampleRatio444", + "ZP", + "ZR", + }, + "image/color": []string{ + "Alpha", + "Alpha16", + "Alpha16Model", + "AlphaModel", + "Black", + "CMYK", + "CMYKModel", + "CMYKToRGB", + "Color", + "Gray", + "Gray16", + "Gray16Model", + "GrayModel", + "Model", + "ModelFunc", + "NRGBA", + "NRGBA64", + "NRGBA64Model", + "NRGBAModel", + "NYCbCrA", + "NYCbCrAModel", + "Opaque", + "Palette", + "RGBA", + "RGBA64", + "RGBA64Model", + "RGBAModel", + "RGBToCMYK", + "RGBToYCbCr", + "Transparent", + "White", + "YCbCr", + "YCbCrModel", + "YCbCrToRGB", + }, + "image/color/palette": []string{ + "Plan9", + "WebSafe", + }, + "image/draw": []string{ + "Draw", + "DrawMask", + "Drawer", + "FloydSteinberg", + "Image", + "Op", + "Over", + "Quantizer", + "Src", + }, + "image/gif": []string{ + "Decode", + "DecodeAll", + "DecodeConfig", + "DisposalBackground", + "DisposalNone", + "DisposalPrevious", + "Encode", + "EncodeAll", + "GIF", + "Options", + }, + "image/jpeg": []string{ + "Decode", + "DecodeConfig", + "DefaultQuality", + "Encode", + "FormatError", + "Options", + "Reader", + "UnsupportedError", + }, + "image/png": []string{ + "BestCompression", + "BestSpeed", + "CompressionLevel", + "Decode", + "DecodeConfig", + "DefaultCompression", + "Encode", + "Encoder", + "EncoderBuffer", + "EncoderBufferPool", + "FormatError", + "NoCompression", + "UnsupportedError", + }, + "index/suffixarray": []string{ + "Index", + "New", + }, + "io": []string{ + "ByteReader", + "ByteScanner", + "ByteWriter", + "Closer", + "Copy", + "CopyBuffer", + "CopyN", + "EOF", + "ErrClosedPipe", + "ErrNoProgress", + "ErrShortBuffer", + "ErrShortWrite", + "ErrUnexpectedEOF", + "LimitReader", + "LimitedReader", + "MultiReader", + "MultiWriter", + "NewSectionReader", + "Pipe", + "PipeReader", + "PipeWriter", + "ReadAtLeast", + "ReadCloser", + "ReadFull", + "ReadSeeker", + "ReadWriteCloser", + "ReadWriteSeeker", + "ReadWriter", + "Reader", + "ReaderAt", + "ReaderFrom", + "RuneReader", + "RuneScanner", + "SectionReader", + "SeekCurrent", + "SeekEnd", + "SeekStart", + "Seeker", + "StringWriter", + "TeeReader", + "WriteCloser", + "WriteSeeker", + "WriteString", + "Writer", + "WriterAt", + "WriterTo", + }, + "io/ioutil": []string{ + "Discard", + "NopCloser", + "ReadAll", + "ReadDir", + "ReadFile", + "TempDir", + "TempFile", + "WriteFile", + }, + "log": []string{ + "Fatal", + "Fatalf", + "Fatalln", + "Flags", + "LUTC", + "Ldate", + "Llongfile", + "Lmicroseconds", + "Logger", + "Lshortfile", + "LstdFlags", + "Ltime", + "New", + "Output", + "Panic", + "Panicf", + "Panicln", + "Prefix", + "Print", + "Printf", + "Println", + "SetFlags", + "SetOutput", + "SetPrefix", + "Writer", + }, + "log/syslog": []string{ + "Dial", + "LOG_ALERT", + "LOG_AUTH", + "LOG_AUTHPRIV", + "LOG_CRIT", + "LOG_CRON", + "LOG_DAEMON", + "LOG_DEBUG", + "LOG_EMERG", + "LOG_ERR", + "LOG_FTP", + "LOG_INFO", + "LOG_KERN", + "LOG_LOCAL0", + "LOG_LOCAL1", + "LOG_LOCAL2", + "LOG_LOCAL3", + "LOG_LOCAL4", + "LOG_LOCAL5", + "LOG_LOCAL6", + "LOG_LOCAL7", + "LOG_LPR", + "LOG_MAIL", + "LOG_NEWS", + "LOG_NOTICE", + "LOG_SYSLOG", + "LOG_USER", + "LOG_UUCP", + "LOG_WARNING", + "New", + "NewLogger", + "Priority", + "Writer", + }, + "math": []string{ + "Abs", + "Acos", + "Acosh", + "Asin", + "Asinh", + "Atan", + "Atan2", + "Atanh", + "Cbrt", + "Ceil", + "Copysign", + "Cos", + "Cosh", + "Dim", + "E", + "Erf", + "Erfc", + "Erfcinv", + "Erfinv", + "Exp", + "Exp2", + "Expm1", + "Float32bits", + "Float32frombits", + "Float64bits", + "Float64frombits", + "Floor", + "Frexp", + "Gamma", + "Hypot", + "Ilogb", + "Inf", + "IsInf", + "IsNaN", + "J0", + "J1", + "Jn", + "Ldexp", + "Lgamma", + "Ln10", + "Ln2", + "Log", + "Log10", + "Log10E", + "Log1p", + "Log2", + "Log2E", + "Logb", + "Max", + "MaxFloat32", + "MaxFloat64", + "MaxInt16", + "MaxInt32", + "MaxInt64", + "MaxInt8", + "MaxUint16", + "MaxUint32", + "MaxUint64", + "MaxUint8", + "Min", + "MinInt16", + "MinInt32", + "MinInt64", + "MinInt8", + "Mod", + "Modf", + "NaN", + "Nextafter", + "Nextafter32", + "Phi", + "Pi", + "Pow", + "Pow10", + "Remainder", + "Round", + "RoundToEven", + "Signbit", + "Sin", + "Sincos", + "Sinh", + "SmallestNonzeroFloat32", + "SmallestNonzeroFloat64", + "Sqrt", + "Sqrt2", + "SqrtE", + "SqrtPhi", + "SqrtPi", + "Tan", + "Tanh", + "Trunc", + "Y0", + "Y1", + "Yn", + }, + "math/big": []string{ + "Above", + "Accuracy", + "AwayFromZero", + "Below", + "ErrNaN", + "Exact", + "Float", + "Int", + "Jacobi", + "MaxBase", + "MaxExp", + "MaxPrec", + "MinExp", + "NewFloat", + "NewInt", + "NewRat", + "ParseFloat", + "Rat", + "RoundingMode", + "ToNearestAway", + "ToNearestEven", + "ToNegativeInf", + "ToPositiveInf", + "ToZero", + "Word", + }, + "math/bits": []string{ + "Add", + "Add32", + "Add64", + "Div", + "Div32", + "Div64", + "LeadingZeros", + "LeadingZeros16", + "LeadingZeros32", + "LeadingZeros64", + "LeadingZeros8", + "Len", + "Len16", + "Len32", + "Len64", + "Len8", + "Mul", + "Mul32", + "Mul64", + "OnesCount", + "OnesCount16", + "OnesCount32", + "OnesCount64", + "OnesCount8", + "Reverse", + "Reverse16", + "Reverse32", + "Reverse64", + "Reverse8", + "ReverseBytes", + "ReverseBytes16", + "ReverseBytes32", + "ReverseBytes64", + "RotateLeft", + "RotateLeft16", + "RotateLeft32", + "RotateLeft64", + "RotateLeft8", + "Sub", + "Sub32", + "Sub64", + "TrailingZeros", + "TrailingZeros16", + "TrailingZeros32", + "TrailingZeros64", + "TrailingZeros8", + "UintSize", + }, + "math/cmplx": []string{ + "Abs", + "Acos", + "Acosh", + "Asin", + "Asinh", + "Atan", + "Atanh", + "Conj", + "Cos", + "Cosh", + "Cot", + "Exp", + "Inf", + "IsInf", + "IsNaN", + "Log", + "Log10", + "NaN", + "Phase", + "Polar", + "Pow", + "Rect", + "Sin", + "Sinh", + "Sqrt", + "Tan", + "Tanh", + }, + "math/rand": []string{ + "ExpFloat64", + "Float32", + "Float64", + "Int", + "Int31", + "Int31n", + "Int63", + "Int63n", + "Intn", + "New", + "NewSource", + "NewZipf", + "NormFloat64", + "Perm", + "Rand", + "Read", + "Seed", + "Shuffle", + "Source", + "Source64", + "Uint32", + "Uint64", + "Zipf", + }, + "mime": []string{ + "AddExtensionType", + "BEncoding", + "ErrInvalidMediaParameter", + "ExtensionsByType", + "FormatMediaType", + "ParseMediaType", + "QEncoding", + "TypeByExtension", + "WordDecoder", + "WordEncoder", + }, + "mime/multipart": []string{ + "ErrMessageTooLarge", + "File", + "FileHeader", + "Form", + "NewReader", + "NewWriter", + "Part", + "Reader", + "Writer", + }, + "mime/quotedprintable": []string{ + "NewReader", + "NewWriter", + "Reader", + "Writer", + }, + "net": []string{ + "Addr", + "AddrError", + "Buffers", + "CIDRMask", + "Conn", + "DNSConfigError", + "DNSError", + "DefaultResolver", + "Dial", + "DialIP", + "DialTCP", + "DialTimeout", + "DialUDP", + "DialUnix", + "Dialer", + "ErrWriteToConnected", + "Error", + "FileConn", + "FileListener", + "FilePacketConn", + "FlagBroadcast", + "FlagLoopback", + "FlagMulticast", + "FlagPointToPoint", + "FlagUp", + "Flags", + "HardwareAddr", + "IP", + "IPAddr", + "IPConn", + "IPMask", + "IPNet", + "IPv4", + "IPv4Mask", + "IPv4allrouter", + "IPv4allsys", + "IPv4bcast", + "IPv4len", + "IPv4zero", + "IPv6interfacelocalallnodes", + "IPv6len", + "IPv6linklocalallnodes", + "IPv6linklocalallrouters", + "IPv6loopback", + "IPv6unspecified", + "IPv6zero", + "Interface", + "InterfaceAddrs", + "InterfaceByIndex", + "InterfaceByName", + "Interfaces", + "InvalidAddrError", + "JoinHostPort", + "Listen", + "ListenConfig", + "ListenIP", + "ListenMulticastUDP", + "ListenPacket", + "ListenTCP", + "ListenUDP", + "ListenUnix", + "ListenUnixgram", + "Listener", + "LookupAddr", + "LookupCNAME", + "LookupHost", + "LookupIP", + "LookupMX", + "LookupNS", + "LookupPort", + "LookupSRV", + "LookupTXT", + "MX", + "NS", + "OpError", + "PacketConn", + "ParseCIDR", + "ParseError", + "ParseIP", + "ParseMAC", + "Pipe", + "ResolveIPAddr", + "ResolveTCPAddr", + "ResolveUDPAddr", + "ResolveUnixAddr", + "Resolver", + "SRV", + "SplitHostPort", + "TCPAddr", + "TCPConn", + "TCPListener", + "UDPAddr", + "UDPConn", + "UnixAddr", + "UnixConn", + "UnixListener", + "UnknownNetworkError", + }, + "net/http": []string{ + "CanonicalHeaderKey", + "Client", + "CloseNotifier", + "ConnState", + "Cookie", + "CookieJar", + "DefaultClient", + "DefaultMaxHeaderBytes", + "DefaultMaxIdleConnsPerHost", + "DefaultServeMux", + "DefaultTransport", + "DetectContentType", + "Dir", + "ErrAbortHandler", + "ErrBodyNotAllowed", + "ErrBodyReadAfterClose", + "ErrContentLength", + "ErrHandlerTimeout", + "ErrHeaderTooLong", + "ErrHijacked", + "ErrLineTooLong", + "ErrMissingBoundary", + "ErrMissingContentLength", + "ErrMissingFile", + "ErrNoCookie", + "ErrNoLocation", + "ErrNotMultipart", + "ErrNotSupported", + "ErrServerClosed", + "ErrShortBody", + "ErrSkipAltProtocol", + "ErrUnexpectedTrailer", + "ErrUseLastResponse", + "ErrWriteAfterFlush", + "Error", + "File", + "FileServer", + "FileSystem", + "Flusher", + "Get", + "Handle", + "HandleFunc", + "Handler", + "HandlerFunc", + "Head", + "Header", + "Hijacker", + "ListenAndServe", + "ListenAndServeTLS", + "LocalAddrContextKey", + "MaxBytesReader", + "MethodConnect", + "MethodDelete", + "MethodGet", + "MethodHead", + "MethodOptions", + "MethodPatch", + "MethodPost", + "MethodPut", + "MethodTrace", + "NewFileTransport", + "NewRequest", + "NewRequestWithContext", + "NewServeMux", + "NoBody", + "NotFound", + "NotFoundHandler", + "ParseHTTPVersion", + "ParseTime", + "Post", + "PostForm", + "ProtocolError", + "ProxyFromEnvironment", + "ProxyURL", + "PushOptions", + "Pusher", + "ReadRequest", + "ReadResponse", + "Redirect", + "RedirectHandler", + "Request", + "Response", + "ResponseWriter", + "RoundTripper", + "SameSite", + "SameSiteDefaultMode", + "SameSiteLaxMode", + "SameSiteNoneMode", + "SameSiteStrictMode", + "Serve", + "ServeContent", + "ServeFile", + "ServeMux", + "ServeTLS", + "Server", + "ServerContextKey", + "SetCookie", + "StateActive", + "StateClosed", + "StateHijacked", + "StateIdle", + "StateNew", + "StatusAccepted", + "StatusAlreadyReported", + "StatusBadGateway", + "StatusBadRequest", + "StatusConflict", + "StatusContinue", + "StatusCreated", + "StatusEarlyHints", + "StatusExpectationFailed", + "StatusFailedDependency", + "StatusForbidden", + "StatusFound", + "StatusGatewayTimeout", + "StatusGone", + "StatusHTTPVersionNotSupported", + "StatusIMUsed", + "StatusInsufficientStorage", + "StatusInternalServerError", + "StatusLengthRequired", + "StatusLocked", + "StatusLoopDetected", + "StatusMethodNotAllowed", + "StatusMisdirectedRequest", + "StatusMovedPermanently", + "StatusMultiStatus", + "StatusMultipleChoices", + "StatusNetworkAuthenticationRequired", + "StatusNoContent", + "StatusNonAuthoritativeInfo", + "StatusNotAcceptable", + "StatusNotExtended", + "StatusNotFound", + "StatusNotImplemented", + "StatusNotModified", + "StatusOK", + "StatusPartialContent", + "StatusPaymentRequired", + "StatusPermanentRedirect", + "StatusPreconditionFailed", + "StatusPreconditionRequired", + "StatusProcessing", + "StatusProxyAuthRequired", + "StatusRequestEntityTooLarge", + "StatusRequestHeaderFieldsTooLarge", + "StatusRequestTimeout", + "StatusRequestURITooLong", + "StatusRequestedRangeNotSatisfiable", + "StatusResetContent", + "StatusSeeOther", + "StatusServiceUnavailable", + "StatusSwitchingProtocols", + "StatusTeapot", + "StatusTemporaryRedirect", + "StatusText", + "StatusTooEarly", + "StatusTooManyRequests", + "StatusUnauthorized", + "StatusUnavailableForLegalReasons", + "StatusUnprocessableEntity", + "StatusUnsupportedMediaType", + "StatusUpgradeRequired", + "StatusUseProxy", + "StatusVariantAlsoNegotiates", + "StripPrefix", + "TimeFormat", + "TimeoutHandler", + "TrailerPrefix", + "Transport", + }, + "net/http/cgi": []string{ + "Handler", + "Request", + "RequestFromMap", + "Serve", + }, + "net/http/cookiejar": []string{ + "Jar", + "New", + "Options", + "PublicSuffixList", + }, + "net/http/fcgi": []string{ + "ErrConnClosed", + "ErrRequestAborted", + "ProcessEnv", + "Serve", + }, + "net/http/httptest": []string{ + "DefaultRemoteAddr", + "NewRecorder", + "NewRequest", + "NewServer", + "NewTLSServer", + "NewUnstartedServer", + "ResponseRecorder", + "Server", + }, + "net/http/httptrace": []string{ + "ClientTrace", + "ContextClientTrace", + "DNSDoneInfo", + "DNSStartInfo", + "GotConnInfo", + "WithClientTrace", + "WroteRequestInfo", + }, + "net/http/httputil": []string{ + "BufferPool", + "ClientConn", + "DumpRequest", + "DumpRequestOut", + "DumpResponse", + "ErrClosed", + "ErrLineTooLong", + "ErrPersistEOF", + "ErrPipeline", + "NewChunkedReader", + "NewChunkedWriter", + "NewClientConn", + "NewProxyClientConn", + "NewServerConn", + "NewSingleHostReverseProxy", + "ReverseProxy", + "ServerConn", + }, + "net/http/pprof": []string{ + "Cmdline", + "Handler", + "Index", + "Profile", + "Symbol", + "Trace", + }, + "net/mail": []string{ + "Address", + "AddressParser", + "ErrHeaderNotPresent", + "Header", + "Message", + "ParseAddress", + "ParseAddressList", + "ParseDate", + "ReadMessage", + }, + "net/rpc": []string{ + "Accept", + "Call", + "Client", + "ClientCodec", + "DefaultDebugPath", + "DefaultRPCPath", + "DefaultServer", + "Dial", + "DialHTTP", + "DialHTTPPath", + "ErrShutdown", + "HandleHTTP", + "NewClient", + "NewClientWithCodec", + "NewServer", + "Register", + "RegisterName", + "Request", + "Response", + "ServeCodec", + "ServeConn", + "ServeRequest", + "Server", + "ServerCodec", + "ServerError", + }, + "net/rpc/jsonrpc": []string{ + "Dial", + "NewClient", + "NewClientCodec", + "NewServerCodec", + "ServeConn", + }, + "net/smtp": []string{ + "Auth", + "CRAMMD5Auth", + "Client", + "Dial", + "NewClient", + "PlainAuth", + "SendMail", + "ServerInfo", + }, + "net/textproto": []string{ + "CanonicalMIMEHeaderKey", + "Conn", + "Dial", + "Error", + "MIMEHeader", + "NewConn", + "NewReader", + "NewWriter", + "Pipeline", + "ProtocolError", + "Reader", + "TrimBytes", + "TrimString", + "Writer", + }, + "net/url": []string{ + "Error", + "EscapeError", + "InvalidHostError", + "Parse", + "ParseQuery", + "ParseRequestURI", + "PathEscape", + "PathUnescape", + "QueryEscape", + "QueryUnescape", + "URL", + "User", + "UserPassword", + "Userinfo", + "Values", + }, + "os": []string{ + "Args", + "Chdir", + "Chmod", + "Chown", + "Chtimes", + "Clearenv", + "Create", + "DevNull", + "Environ", + "ErrClosed", + "ErrExist", + "ErrInvalid", + "ErrNoDeadline", + "ErrNotExist", + "ErrPermission", + "Executable", + "Exit", + "Expand", + "ExpandEnv", + "File", + "FileInfo", + "FileMode", + "FindProcess", + "Getegid", + "Getenv", + "Geteuid", + "Getgid", + "Getgroups", + "Getpagesize", + "Getpid", + "Getppid", + "Getuid", + "Getwd", + "Hostname", + "Interrupt", + "IsExist", + "IsNotExist", + "IsPathSeparator", + "IsPermission", + "IsTimeout", + "Kill", + "Lchown", + "Link", + "LinkError", + "LookupEnv", + "Lstat", + "Mkdir", + "MkdirAll", + "ModeAppend", + "ModeCharDevice", + "ModeDevice", + "ModeDir", + "ModeExclusive", + "ModeIrregular", + "ModeNamedPipe", + "ModePerm", + "ModeSetgid", + "ModeSetuid", + "ModeSocket", + "ModeSticky", + "ModeSymlink", + "ModeTemporary", + "ModeType", + "NewFile", + "NewSyscallError", + "O_APPEND", + "O_CREATE", + "O_EXCL", + "O_RDONLY", + "O_RDWR", + "O_SYNC", + "O_TRUNC", + "O_WRONLY", + "Open", + "OpenFile", + "PathError", + "PathListSeparator", + "PathSeparator", + "Pipe", + "ProcAttr", + "Process", + "ProcessState", + "Readlink", + "Remove", + "RemoveAll", + "Rename", + "SEEK_CUR", + "SEEK_END", + "SEEK_SET", + "SameFile", + "Setenv", + "Signal", + "StartProcess", + "Stat", + "Stderr", + "Stdin", + "Stdout", + "Symlink", + "SyscallError", + "TempDir", + "Truncate", + "Unsetenv", + "UserCacheDir", + "UserConfigDir", + "UserHomeDir", + }, + "os/exec": []string{ + "Cmd", + "Command", + "CommandContext", + "ErrNotFound", + "Error", + "ExitError", + "LookPath", + }, + "os/signal": []string{ + "Ignore", + "Ignored", + "Notify", + "Reset", + "Stop", + }, + "os/user": []string{ + "Current", + "Group", + "Lookup", + "LookupGroup", + "LookupGroupId", + "LookupId", + "UnknownGroupError", + "UnknownGroupIdError", + "UnknownUserError", + "UnknownUserIdError", + "User", + }, + "path": []string{ + "Base", + "Clean", + "Dir", + "ErrBadPattern", + "Ext", + "IsAbs", + "Join", + "Match", + "Split", + }, + "path/filepath": []string{ + "Abs", + "Base", + "Clean", + "Dir", + "ErrBadPattern", + "EvalSymlinks", + "Ext", + "FromSlash", + "Glob", + "HasPrefix", + "IsAbs", + "Join", + "ListSeparator", + "Match", + "Rel", + "Separator", + "SkipDir", + "Split", + "SplitList", + "ToSlash", + "VolumeName", + "Walk", + "WalkFunc", + }, + "plugin": []string{ + "Open", + "Plugin", + "Symbol", + }, + "reflect": []string{ + "Append", + "AppendSlice", + "Array", + "ArrayOf", + "Bool", + "BothDir", + "Chan", + "ChanDir", + "ChanOf", + "Complex128", + "Complex64", + "Copy", + "DeepEqual", + "Float32", + "Float64", + "Func", + "FuncOf", + "Indirect", + "Int", + "Int16", + "Int32", + "Int64", + "Int8", + "Interface", + "Invalid", + "Kind", + "MakeChan", + "MakeFunc", + "MakeMap", + "MakeMapWithSize", + "MakeSlice", + "Map", + "MapIter", + "MapOf", + "Method", + "New", + "NewAt", + "Ptr", + "PtrTo", + "RecvDir", + "Select", + "SelectCase", + "SelectDefault", + "SelectDir", + "SelectRecv", + "SelectSend", + "SendDir", + "Slice", + "SliceHeader", + "SliceOf", + "String", + "StringHeader", + "Struct", + "StructField", + "StructOf", + "StructTag", + "Swapper", + "Type", + "TypeOf", + "Uint", + "Uint16", + "Uint32", + "Uint64", + "Uint8", + "Uintptr", + "UnsafePointer", + "Value", + "ValueError", + "ValueOf", + "Zero", + }, + "regexp": []string{ + "Compile", + "CompilePOSIX", + "Match", + "MatchReader", + "MatchString", + "MustCompile", + "MustCompilePOSIX", + "QuoteMeta", + "Regexp", + }, + "regexp/syntax": []string{ + "ClassNL", + "Compile", + "DotNL", + "EmptyBeginLine", + "EmptyBeginText", + "EmptyEndLine", + "EmptyEndText", + "EmptyNoWordBoundary", + "EmptyOp", + "EmptyOpContext", + "EmptyWordBoundary", + "ErrInternalError", + "ErrInvalidCharClass", + "ErrInvalidCharRange", + "ErrInvalidEscape", + "ErrInvalidNamedCapture", + "ErrInvalidPerlOp", + "ErrInvalidRepeatOp", + "ErrInvalidRepeatSize", + "ErrInvalidUTF8", + "ErrMissingBracket", + "ErrMissingParen", + "ErrMissingRepeatArgument", + "ErrTrailingBackslash", + "ErrUnexpectedParen", + "Error", + "ErrorCode", + "Flags", + "FoldCase", + "Inst", + "InstAlt", + "InstAltMatch", + "InstCapture", + "InstEmptyWidth", + "InstFail", + "InstMatch", + "InstNop", + "InstOp", + "InstRune", + "InstRune1", + "InstRuneAny", + "InstRuneAnyNotNL", + "IsWordChar", + "Literal", + "MatchNL", + "NonGreedy", + "OneLine", + "Op", + "OpAlternate", + "OpAnyChar", + "OpAnyCharNotNL", + "OpBeginLine", + "OpBeginText", + "OpCapture", + "OpCharClass", + "OpConcat", + "OpEmptyMatch", + "OpEndLine", + "OpEndText", + "OpLiteral", + "OpNoMatch", + "OpNoWordBoundary", + "OpPlus", + "OpQuest", + "OpRepeat", + "OpStar", + "OpWordBoundary", + "POSIX", + "Parse", + "Perl", + "PerlX", + "Prog", + "Regexp", + "Simple", + "UnicodeGroups", + "WasDollar", + }, + "runtime": []string{ + "BlockProfile", + "BlockProfileRecord", + "Breakpoint", + "CPUProfile", + "Caller", + "Callers", + "CallersFrames", + "Compiler", + "Error", + "Frame", + "Frames", + "Func", + "FuncForPC", + "GC", + "GOARCH", + "GOMAXPROCS", + "GOOS", + "GOROOT", + "Goexit", + "GoroutineProfile", + "Gosched", + "KeepAlive", + "LockOSThread", + "MemProfile", + "MemProfileRate", + "MemProfileRecord", + "MemStats", + "MutexProfile", + "NumCPU", + "NumCgoCall", + "NumGoroutine", + "ReadMemStats", + "ReadTrace", + "SetBlockProfileRate", + "SetCPUProfileRate", + "SetCgoTraceback", + "SetFinalizer", + "SetMutexProfileFraction", + "Stack", + "StackRecord", + "StartTrace", + "StopTrace", + "ThreadCreateProfile", + "TypeAssertionError", + "UnlockOSThread", + "Version", + }, + "runtime/debug": []string{ + "BuildInfo", + "FreeOSMemory", + "GCStats", + "Module", + "PrintStack", + "ReadBuildInfo", + "ReadGCStats", + "SetGCPercent", + "SetMaxStack", + "SetMaxThreads", + "SetPanicOnFault", + "SetTraceback", + "Stack", + "WriteHeapDump", + }, + "runtime/pprof": []string{ + "Do", + "ForLabels", + "Label", + "LabelSet", + "Labels", + "Lookup", + "NewProfile", + "Profile", + "Profiles", + "SetGoroutineLabels", + "StartCPUProfile", + "StopCPUProfile", + "WithLabels", + "WriteHeapProfile", + }, + "runtime/trace": []string{ + "IsEnabled", + "Log", + "Logf", + "NewTask", + "Region", + "Start", + "StartRegion", + "Stop", + "Task", + "WithRegion", + }, + "sort": []string{ + "Float64Slice", + "Float64s", + "Float64sAreSorted", + "IntSlice", + "Interface", + "Ints", + "IntsAreSorted", + "IsSorted", + "Reverse", + "Search", + "SearchFloat64s", + "SearchInts", + "SearchStrings", + "Slice", + "SliceIsSorted", + "SliceStable", + "Sort", + "Stable", + "StringSlice", + "Strings", + "StringsAreSorted", + }, + "strconv": []string{ + "AppendBool", + "AppendFloat", + "AppendInt", + "AppendQuote", + "AppendQuoteRune", + "AppendQuoteRuneToASCII", + "AppendQuoteRuneToGraphic", + "AppendQuoteToASCII", + "AppendQuoteToGraphic", + "AppendUint", + "Atoi", + "CanBackquote", + "ErrRange", + "ErrSyntax", + "FormatBool", + "FormatFloat", + "FormatInt", + "FormatUint", + "IntSize", + "IsGraphic", + "IsPrint", + "Itoa", + "NumError", + "ParseBool", + "ParseFloat", + "ParseInt", + "ParseUint", + "Quote", + "QuoteRune", + "QuoteRuneToASCII", + "QuoteRuneToGraphic", + "QuoteToASCII", + "QuoteToGraphic", + "Unquote", + "UnquoteChar", + }, + "strings": []string{ + "Builder", + "Compare", + "Contains", + "ContainsAny", + "ContainsRune", + "Count", + "EqualFold", + "Fields", + "FieldsFunc", + "HasPrefix", + "HasSuffix", + "Index", + "IndexAny", + "IndexByte", + "IndexFunc", + "IndexRune", + "Join", + "LastIndex", + "LastIndexAny", + "LastIndexByte", + "LastIndexFunc", + "Map", + "NewReader", + "NewReplacer", + "Reader", + "Repeat", + "Replace", + "ReplaceAll", + "Replacer", + "Split", + "SplitAfter", + "SplitAfterN", + "SplitN", + "Title", + "ToLower", + "ToLowerSpecial", + "ToTitle", + "ToTitleSpecial", + "ToUpper", + "ToUpperSpecial", + "ToValidUTF8", + "Trim", + "TrimFunc", + "TrimLeft", + "TrimLeftFunc", + "TrimPrefix", + "TrimRight", + "TrimRightFunc", + "TrimSpace", + "TrimSuffix", + }, + "sync": []string{ + "Cond", + "Locker", + "Map", + "Mutex", + "NewCond", + "Once", + "Pool", + "RWMutex", + "WaitGroup", + }, + "sync/atomic": []string{ + "AddInt32", + "AddInt64", + "AddUint32", + "AddUint64", + "AddUintptr", + "CompareAndSwapInt32", + "CompareAndSwapInt64", + "CompareAndSwapPointer", + "CompareAndSwapUint32", + "CompareAndSwapUint64", + "CompareAndSwapUintptr", + "LoadInt32", + "LoadInt64", + "LoadPointer", + "LoadUint32", + "LoadUint64", + "LoadUintptr", + "StoreInt32", + "StoreInt64", + "StorePointer", + "StoreUint32", + "StoreUint64", + "StoreUintptr", + "SwapInt32", + "SwapInt64", + "SwapPointer", + "SwapUint32", + "SwapUint64", + "SwapUintptr", + "Value", + }, + "syscall": []string{ + "AF_ALG", + "AF_APPLETALK", + "AF_ARP", + "AF_ASH", + "AF_ATM", + "AF_ATMPVC", + "AF_ATMSVC", + "AF_AX25", + "AF_BLUETOOTH", + "AF_BRIDGE", + "AF_CAIF", + "AF_CAN", + "AF_CCITT", + "AF_CHAOS", + "AF_CNT", + "AF_COIP", + "AF_DATAKIT", + "AF_DECnet", + "AF_DLI", + "AF_E164", + "AF_ECMA", + "AF_ECONET", + "AF_ENCAP", + "AF_FILE", + "AF_HYLINK", + "AF_IEEE80211", + "AF_IEEE802154", + "AF_IMPLINK", + "AF_INET", + "AF_INET6", + "AF_INET6_SDP", + "AF_INET_SDP", + "AF_IPX", + "AF_IRDA", + "AF_ISDN", + "AF_ISO", + "AF_IUCV", + "AF_KEY", + "AF_LAT", + "AF_LINK", + "AF_LLC", + "AF_LOCAL", + "AF_MAX", + "AF_MPLS", + "AF_NATM", + "AF_NDRV", + "AF_NETBEUI", + "AF_NETBIOS", + "AF_NETGRAPH", + "AF_NETLINK", + "AF_NETROM", + "AF_NS", + "AF_OROUTE", + "AF_OSI", + "AF_PACKET", + "AF_PHONET", + "AF_PPP", + "AF_PPPOX", + "AF_PUP", + "AF_RDS", + "AF_RESERVED_36", + "AF_ROSE", + "AF_ROUTE", + "AF_RXRPC", + "AF_SCLUSTER", + "AF_SECURITY", + "AF_SIP", + "AF_SLOW", + "AF_SNA", + "AF_SYSTEM", + "AF_TIPC", + "AF_UNIX", + "AF_UNSPEC", + "AF_VENDOR00", + "AF_VENDOR01", + "AF_VENDOR02", + "AF_VENDOR03", + "AF_VENDOR04", + "AF_VENDOR05", + "AF_VENDOR06", + "AF_VENDOR07", + "AF_VENDOR08", + "AF_VENDOR09", + "AF_VENDOR10", + "AF_VENDOR11", + "AF_VENDOR12", + "AF_VENDOR13", + "AF_VENDOR14", + "AF_VENDOR15", + "AF_VENDOR16", + "AF_VENDOR17", + "AF_VENDOR18", + "AF_VENDOR19", + "AF_VENDOR20", + "AF_VENDOR21", + "AF_VENDOR22", + "AF_VENDOR23", + "AF_VENDOR24", + "AF_VENDOR25", + "AF_VENDOR26", + "AF_VENDOR27", + "AF_VENDOR28", + "AF_VENDOR29", + "AF_VENDOR30", + "AF_VENDOR31", + "AF_VENDOR32", + "AF_VENDOR33", + "AF_VENDOR34", + "AF_VENDOR35", + "AF_VENDOR36", + "AF_VENDOR37", + "AF_VENDOR38", + "AF_VENDOR39", + "AF_VENDOR40", + "AF_VENDOR41", + "AF_VENDOR42", + "AF_VENDOR43", + "AF_VENDOR44", + "AF_VENDOR45", + "AF_VENDOR46", + "AF_VENDOR47", + "AF_WANPIPE", + "AF_X25", + "AI_CANONNAME", + "AI_NUMERICHOST", + "AI_PASSIVE", + "APPLICATION_ERROR", + "ARPHRD_ADAPT", + "ARPHRD_APPLETLK", + "ARPHRD_ARCNET", + "ARPHRD_ASH", + "ARPHRD_ATM", + "ARPHRD_AX25", + "ARPHRD_BIF", + "ARPHRD_CHAOS", + "ARPHRD_CISCO", + "ARPHRD_CSLIP", + "ARPHRD_CSLIP6", + "ARPHRD_DDCMP", + "ARPHRD_DLCI", + "ARPHRD_ECONET", + "ARPHRD_EETHER", + "ARPHRD_ETHER", + "ARPHRD_EUI64", + "ARPHRD_FCAL", + "ARPHRD_FCFABRIC", + "ARPHRD_FCPL", + "ARPHRD_FCPP", + "ARPHRD_FDDI", + "ARPHRD_FRAD", + "ARPHRD_FRELAY", + "ARPHRD_HDLC", + "ARPHRD_HIPPI", + "ARPHRD_HWX25", + "ARPHRD_IEEE1394", + "ARPHRD_IEEE802", + "ARPHRD_IEEE80211", + "ARPHRD_IEEE80211_PRISM", + "ARPHRD_IEEE80211_RADIOTAP", + "ARPHRD_IEEE802154", + "ARPHRD_IEEE802154_PHY", + "ARPHRD_IEEE802_TR", + "ARPHRD_INFINIBAND", + "ARPHRD_IPDDP", + "ARPHRD_IPGRE", + "ARPHRD_IRDA", + "ARPHRD_LAPB", + "ARPHRD_LOCALTLK", + "ARPHRD_LOOPBACK", + "ARPHRD_METRICOM", + "ARPHRD_NETROM", + "ARPHRD_NONE", + "ARPHRD_PIMREG", + "ARPHRD_PPP", + "ARPHRD_PRONET", + "ARPHRD_RAWHDLC", + "ARPHRD_ROSE", + "ARPHRD_RSRVD", + "ARPHRD_SIT", + "ARPHRD_SKIP", + "ARPHRD_SLIP", + "ARPHRD_SLIP6", + "ARPHRD_STRIP", + "ARPHRD_TUNNEL", + "ARPHRD_TUNNEL6", + "ARPHRD_VOID", + "ARPHRD_X25", + "AUTHTYPE_CLIENT", + "AUTHTYPE_SERVER", + "Accept", + "Accept4", + "AcceptEx", + "Access", + "Acct", + "AddrinfoW", + "Adjtime", + "Adjtimex", + "AttachLsf", + "B0", + "B1000000", + "B110", + "B115200", + "B1152000", + "B1200", + "B134", + "B14400", + "B150", + "B1500000", + "B1800", + "B19200", + "B200", + "B2000000", + "B230400", + "B2400", + "B2500000", + "B28800", + "B300", + "B3000000", + "B3500000", + "B38400", + "B4000000", + "B460800", + "B4800", + "B50", + "B500000", + "B57600", + "B576000", + "B600", + "B7200", + "B75", + "B76800", + "B921600", + "B9600", + "BASE_PROTOCOL", + "BIOCFEEDBACK", + "BIOCFLUSH", + "BIOCGBLEN", + "BIOCGDIRECTION", + "BIOCGDIRFILT", + "BIOCGDLT", + "BIOCGDLTLIST", + "BIOCGETBUFMODE", + "BIOCGETIF", + "BIOCGETZMAX", + "BIOCGFEEDBACK", + "BIOCGFILDROP", + "BIOCGHDRCMPLT", + "BIOCGRSIG", + "BIOCGRTIMEOUT", + "BIOCGSEESENT", + "BIOCGSTATS", + "BIOCGSTATSOLD", + "BIOCGTSTAMP", + "BIOCIMMEDIATE", + "BIOCLOCK", + "BIOCPROMISC", + "BIOCROTZBUF", + "BIOCSBLEN", + "BIOCSDIRECTION", + "BIOCSDIRFILT", + "BIOCSDLT", + "BIOCSETBUFMODE", + "BIOCSETF", + "BIOCSETFNR", + "BIOCSETIF", + "BIOCSETWF", + "BIOCSETZBUF", + "BIOCSFEEDBACK", + "BIOCSFILDROP", + "BIOCSHDRCMPLT", + "BIOCSRSIG", + "BIOCSRTIMEOUT", + "BIOCSSEESENT", + "BIOCSTCPF", + "BIOCSTSTAMP", + "BIOCSUDPF", + "BIOCVERSION", + "BPF_A", + "BPF_ABS", + "BPF_ADD", + "BPF_ALIGNMENT", + "BPF_ALIGNMENT32", + "BPF_ALU", + "BPF_AND", + "BPF_B", + "BPF_BUFMODE_BUFFER", + "BPF_BUFMODE_ZBUF", + "BPF_DFLTBUFSIZE", + "BPF_DIRECTION_IN", + "BPF_DIRECTION_OUT", + "BPF_DIV", + "BPF_H", + "BPF_IMM", + "BPF_IND", + "BPF_JA", + "BPF_JEQ", + "BPF_JGE", + "BPF_JGT", + "BPF_JMP", + "BPF_JSET", + "BPF_K", + "BPF_LD", + "BPF_LDX", + "BPF_LEN", + "BPF_LSH", + "BPF_MAJOR_VERSION", + "BPF_MAXBUFSIZE", + "BPF_MAXINSNS", + "BPF_MEM", + "BPF_MEMWORDS", + "BPF_MINBUFSIZE", + "BPF_MINOR_VERSION", + "BPF_MISC", + "BPF_MSH", + "BPF_MUL", + "BPF_NEG", + "BPF_OR", + "BPF_RELEASE", + "BPF_RET", + "BPF_RSH", + "BPF_ST", + "BPF_STX", + "BPF_SUB", + "BPF_TAX", + "BPF_TXA", + "BPF_T_BINTIME", + "BPF_T_BINTIME_FAST", + "BPF_T_BINTIME_MONOTONIC", + "BPF_T_BINTIME_MONOTONIC_FAST", + "BPF_T_FAST", + "BPF_T_FLAG_MASK", + "BPF_T_FORMAT_MASK", + "BPF_T_MICROTIME", + "BPF_T_MICROTIME_FAST", + "BPF_T_MICROTIME_MONOTONIC", + "BPF_T_MICROTIME_MONOTONIC_FAST", + "BPF_T_MONOTONIC", + "BPF_T_MONOTONIC_FAST", + "BPF_T_NANOTIME", + "BPF_T_NANOTIME_FAST", + "BPF_T_NANOTIME_MONOTONIC", + "BPF_T_NANOTIME_MONOTONIC_FAST", + "BPF_T_NONE", + "BPF_T_NORMAL", + "BPF_W", + "BPF_X", + "BRKINT", + "Bind", + "BindToDevice", + "BpfBuflen", + "BpfDatalink", + "BpfHdr", + "BpfHeadercmpl", + "BpfInsn", + "BpfInterface", + "BpfJump", + "BpfProgram", + "BpfStat", + "BpfStats", + "BpfStmt", + "BpfTimeout", + "BpfTimeval", + "BpfVersion", + "BpfZbuf", + "BpfZbufHeader", + "ByHandleFileInformation", + "BytePtrFromString", + "ByteSliceFromString", + "CCR0_FLUSH", + "CERT_CHAIN_POLICY_AUTHENTICODE", + "CERT_CHAIN_POLICY_AUTHENTICODE_TS", + "CERT_CHAIN_POLICY_BASE", + "CERT_CHAIN_POLICY_BASIC_CONSTRAINTS", + "CERT_CHAIN_POLICY_EV", + "CERT_CHAIN_POLICY_MICROSOFT_ROOT", + "CERT_CHAIN_POLICY_NT_AUTH", + "CERT_CHAIN_POLICY_SSL", + "CERT_E_CN_NO_MATCH", + "CERT_E_EXPIRED", + "CERT_E_PURPOSE", + "CERT_E_ROLE", + "CERT_E_UNTRUSTEDROOT", + "CERT_STORE_ADD_ALWAYS", + "CERT_STORE_DEFER_CLOSE_UNTIL_LAST_FREE_FLAG", + "CERT_STORE_PROV_MEMORY", + "CERT_TRUST_HAS_EXCLUDED_NAME_CONSTRAINT", + "CERT_TRUST_HAS_NOT_DEFINED_NAME_CONSTRAINT", + "CERT_TRUST_HAS_NOT_PERMITTED_NAME_CONSTRAINT", + "CERT_TRUST_HAS_NOT_SUPPORTED_CRITICAL_EXT", + "CERT_TRUST_HAS_NOT_SUPPORTED_NAME_CONSTRAINT", + "CERT_TRUST_INVALID_BASIC_CONSTRAINTS", + "CERT_TRUST_INVALID_EXTENSION", + "CERT_TRUST_INVALID_NAME_CONSTRAINTS", + "CERT_TRUST_INVALID_POLICY_CONSTRAINTS", + "CERT_TRUST_IS_CYCLIC", + "CERT_TRUST_IS_EXPLICIT_DISTRUST", + "CERT_TRUST_IS_NOT_SIGNATURE_VALID", + "CERT_TRUST_IS_NOT_TIME_VALID", + "CERT_TRUST_IS_NOT_VALID_FOR_USAGE", + "CERT_TRUST_IS_OFFLINE_REVOCATION", + "CERT_TRUST_IS_REVOKED", + "CERT_TRUST_IS_UNTRUSTED_ROOT", + "CERT_TRUST_NO_ERROR", + "CERT_TRUST_NO_ISSUANCE_CHAIN_POLICY", + "CERT_TRUST_REVOCATION_STATUS_UNKNOWN", + "CFLUSH", + "CLOCAL", + "CLONE_CHILD_CLEARTID", + "CLONE_CHILD_SETTID", + "CLONE_CSIGNAL", + "CLONE_DETACHED", + "CLONE_FILES", + "CLONE_FS", + "CLONE_IO", + "CLONE_NEWIPC", + "CLONE_NEWNET", + "CLONE_NEWNS", + "CLONE_NEWPID", + "CLONE_NEWUSER", + "CLONE_NEWUTS", + "CLONE_PARENT", + "CLONE_PARENT_SETTID", + "CLONE_PID", + "CLONE_PTRACE", + "CLONE_SETTLS", + "CLONE_SIGHAND", + "CLONE_SYSVSEM", + "CLONE_THREAD", + "CLONE_UNTRACED", + "CLONE_VFORK", + "CLONE_VM", + "CPUID_CFLUSH", + "CREAD", + "CREATE_ALWAYS", + "CREATE_NEW", + "CREATE_NEW_PROCESS_GROUP", + "CREATE_UNICODE_ENVIRONMENT", + "CRYPT_DEFAULT_CONTAINER_OPTIONAL", + "CRYPT_DELETEKEYSET", + "CRYPT_MACHINE_KEYSET", + "CRYPT_NEWKEYSET", + "CRYPT_SILENT", + "CRYPT_VERIFYCONTEXT", + "CS5", + "CS6", + "CS7", + "CS8", + "CSIZE", + "CSTART", + "CSTATUS", + "CSTOP", + "CSTOPB", + "CSUSP", + "CTL_MAXNAME", + "CTL_NET", + "CTL_QUERY", + "CTRL_BREAK_EVENT", + "CTRL_C_EVENT", + "CancelIo", + "CancelIoEx", + "CertAddCertificateContextToStore", + "CertChainContext", + "CertChainElement", + "CertChainPara", + "CertChainPolicyPara", + "CertChainPolicyStatus", + "CertCloseStore", + "CertContext", + "CertCreateCertificateContext", + "CertEnhKeyUsage", + "CertEnumCertificatesInStore", + "CertFreeCertificateChain", + "CertFreeCertificateContext", + "CertGetCertificateChain", + "CertInfo", + "CertOpenStore", + "CertOpenSystemStore", + "CertRevocationCrlInfo", + "CertRevocationInfo", + "CertSimpleChain", + "CertTrustListInfo", + "CertTrustStatus", + "CertUsageMatch", + "CertVerifyCertificateChainPolicy", + "Chdir", + "CheckBpfVersion", + "Chflags", + "Chmod", + "Chown", + "Chroot", + "Clearenv", + "Close", + "CloseHandle", + "CloseOnExec", + "Closesocket", + "CmsgLen", + "CmsgSpace", + "Cmsghdr", + "CommandLineToArgv", + "ComputerName", + "Conn", + "Connect", + "ConnectEx", + "ConvertSidToStringSid", + "ConvertStringSidToSid", + "CopySid", + "Creat", + "CreateDirectory", + "CreateFile", + "CreateFileMapping", + "CreateHardLink", + "CreateIoCompletionPort", + "CreatePipe", + "CreateProcess", + "CreateProcessAsUser", + "CreateSymbolicLink", + "CreateToolhelp32Snapshot", + "Credential", + "CryptAcquireContext", + "CryptGenRandom", + "CryptReleaseContext", + "DIOCBSFLUSH", + "DIOCOSFPFLUSH", + "DLL", + "DLLError", + "DLT_A429", + "DLT_A653_ICM", + "DLT_AIRONET_HEADER", + "DLT_AOS", + "DLT_APPLE_IP_OVER_IEEE1394", + "DLT_ARCNET", + "DLT_ARCNET_LINUX", + "DLT_ATM_CLIP", + "DLT_ATM_RFC1483", + "DLT_AURORA", + "DLT_AX25", + "DLT_AX25_KISS", + "DLT_BACNET_MS_TP", + "DLT_BLUETOOTH_HCI_H4", + "DLT_BLUETOOTH_HCI_H4_WITH_PHDR", + "DLT_CAN20B", + "DLT_CAN_SOCKETCAN", + "DLT_CHAOS", + "DLT_CHDLC", + "DLT_CISCO_IOS", + "DLT_C_HDLC", + "DLT_C_HDLC_WITH_DIR", + "DLT_DBUS", + "DLT_DECT", + "DLT_DOCSIS", + "DLT_DVB_CI", + "DLT_ECONET", + "DLT_EN10MB", + "DLT_EN3MB", + "DLT_ENC", + "DLT_ERF", + "DLT_ERF_ETH", + "DLT_ERF_POS", + "DLT_FC_2", + "DLT_FC_2_WITH_FRAME_DELIMS", + "DLT_FDDI", + "DLT_FLEXRAY", + "DLT_FRELAY", + "DLT_FRELAY_WITH_DIR", + "DLT_GCOM_SERIAL", + "DLT_GCOM_T1E1", + "DLT_GPF_F", + "DLT_GPF_T", + "DLT_GPRS_LLC", + "DLT_GSMTAP_ABIS", + "DLT_GSMTAP_UM", + "DLT_HDLC", + "DLT_HHDLC", + "DLT_HIPPI", + "DLT_IBM_SN", + "DLT_IBM_SP", + "DLT_IEEE802", + "DLT_IEEE802_11", + "DLT_IEEE802_11_RADIO", + "DLT_IEEE802_11_RADIO_AVS", + "DLT_IEEE802_15_4", + "DLT_IEEE802_15_4_LINUX", + "DLT_IEEE802_15_4_NOFCS", + "DLT_IEEE802_15_4_NONASK_PHY", + "DLT_IEEE802_16_MAC_CPS", + "DLT_IEEE802_16_MAC_CPS_RADIO", + "DLT_IPFILTER", + "DLT_IPMB", + "DLT_IPMB_LINUX", + "DLT_IPNET", + "DLT_IPOIB", + "DLT_IPV4", + "DLT_IPV6", + "DLT_IP_OVER_FC", + "DLT_JUNIPER_ATM1", + "DLT_JUNIPER_ATM2", + "DLT_JUNIPER_ATM_CEMIC", + "DLT_JUNIPER_CHDLC", + "DLT_JUNIPER_ES", + "DLT_JUNIPER_ETHER", + "DLT_JUNIPER_FIBRECHANNEL", + "DLT_JUNIPER_FRELAY", + "DLT_JUNIPER_GGSN", + "DLT_JUNIPER_ISM", + "DLT_JUNIPER_MFR", + "DLT_JUNIPER_MLFR", + "DLT_JUNIPER_MLPPP", + "DLT_JUNIPER_MONITOR", + "DLT_JUNIPER_PIC_PEER", + "DLT_JUNIPER_PPP", + "DLT_JUNIPER_PPPOE", + "DLT_JUNIPER_PPPOE_ATM", + "DLT_JUNIPER_SERVICES", + "DLT_JUNIPER_SRX_E2E", + "DLT_JUNIPER_ST", + "DLT_JUNIPER_VP", + "DLT_JUNIPER_VS", + "DLT_LAPB_WITH_DIR", + "DLT_LAPD", + "DLT_LIN", + "DLT_LINUX_EVDEV", + "DLT_LINUX_IRDA", + "DLT_LINUX_LAPD", + "DLT_LINUX_PPP_WITHDIRECTION", + "DLT_LINUX_SLL", + "DLT_LOOP", + "DLT_LTALK", + "DLT_MATCHING_MAX", + "DLT_MATCHING_MIN", + "DLT_MFR", + "DLT_MOST", + "DLT_MPEG_2_TS", + "DLT_MPLS", + "DLT_MTP2", + "DLT_MTP2_WITH_PHDR", + "DLT_MTP3", + "DLT_MUX27010", + "DLT_NETANALYZER", + "DLT_NETANALYZER_TRANSPARENT", + "DLT_NFC_LLCP", + "DLT_NFLOG", + "DLT_NG40", + "DLT_NULL", + "DLT_PCI_EXP", + "DLT_PFLOG", + "DLT_PFSYNC", + "DLT_PPI", + "DLT_PPP", + "DLT_PPP_BSDOS", + "DLT_PPP_ETHER", + "DLT_PPP_PPPD", + "DLT_PPP_SERIAL", + "DLT_PPP_WITH_DIR", + "DLT_PPP_WITH_DIRECTION", + "DLT_PRISM_HEADER", + "DLT_PRONET", + "DLT_RAIF1", + "DLT_RAW", + "DLT_RAWAF_MASK", + "DLT_RIO", + "DLT_SCCP", + "DLT_SITA", + "DLT_SLIP", + "DLT_SLIP_BSDOS", + "DLT_STANAG_5066_D_PDU", + "DLT_SUNATM", + "DLT_SYMANTEC_FIREWALL", + "DLT_TZSP", + "DLT_USB", + "DLT_USB_LINUX", + "DLT_USB_LINUX_MMAPPED", + "DLT_USER0", + "DLT_USER1", + "DLT_USER10", + "DLT_USER11", + "DLT_USER12", + "DLT_USER13", + "DLT_USER14", + "DLT_USER15", + "DLT_USER2", + "DLT_USER3", + "DLT_USER4", + "DLT_USER5", + "DLT_USER6", + "DLT_USER7", + "DLT_USER8", + "DLT_USER9", + "DLT_WIHART", + "DLT_X2E_SERIAL", + "DLT_X2E_XORAYA", + "DNSMXData", + "DNSPTRData", + "DNSRecord", + "DNSSRVData", + "DNSTXTData", + "DNS_INFO_NO_RECORDS", + "DNS_TYPE_A", + "DNS_TYPE_A6", + "DNS_TYPE_AAAA", + "DNS_TYPE_ADDRS", + "DNS_TYPE_AFSDB", + "DNS_TYPE_ALL", + "DNS_TYPE_ANY", + "DNS_TYPE_ATMA", + "DNS_TYPE_AXFR", + "DNS_TYPE_CERT", + "DNS_TYPE_CNAME", + "DNS_TYPE_DHCID", + "DNS_TYPE_DNAME", + "DNS_TYPE_DNSKEY", + "DNS_TYPE_DS", + "DNS_TYPE_EID", + "DNS_TYPE_GID", + "DNS_TYPE_GPOS", + "DNS_TYPE_HINFO", + "DNS_TYPE_ISDN", + "DNS_TYPE_IXFR", + "DNS_TYPE_KEY", + "DNS_TYPE_KX", + "DNS_TYPE_LOC", + "DNS_TYPE_MAILA", + "DNS_TYPE_MAILB", + "DNS_TYPE_MB", + "DNS_TYPE_MD", + "DNS_TYPE_MF", + "DNS_TYPE_MG", + "DNS_TYPE_MINFO", + "DNS_TYPE_MR", + "DNS_TYPE_MX", + "DNS_TYPE_NAPTR", + "DNS_TYPE_NBSTAT", + "DNS_TYPE_NIMLOC", + "DNS_TYPE_NS", + "DNS_TYPE_NSAP", + "DNS_TYPE_NSAPPTR", + "DNS_TYPE_NSEC", + "DNS_TYPE_NULL", + "DNS_TYPE_NXT", + "DNS_TYPE_OPT", + "DNS_TYPE_PTR", + "DNS_TYPE_PX", + "DNS_TYPE_RP", + "DNS_TYPE_RRSIG", + "DNS_TYPE_RT", + "DNS_TYPE_SIG", + "DNS_TYPE_SINK", + "DNS_TYPE_SOA", + "DNS_TYPE_SRV", + "DNS_TYPE_TEXT", + "DNS_TYPE_TKEY", + "DNS_TYPE_TSIG", + "DNS_TYPE_UID", + "DNS_TYPE_UINFO", + "DNS_TYPE_UNSPEC", + "DNS_TYPE_WINS", + "DNS_TYPE_WINSR", + "DNS_TYPE_WKS", + "DNS_TYPE_X25", + "DT_BLK", + "DT_CHR", + "DT_DIR", + "DT_FIFO", + "DT_LNK", + "DT_REG", + "DT_SOCK", + "DT_UNKNOWN", + "DT_WHT", + "DUPLICATE_CLOSE_SOURCE", + "DUPLICATE_SAME_ACCESS", + "DeleteFile", + "DetachLsf", + "DeviceIoControl", + "Dirent", + "DnsNameCompare", + "DnsQuery", + "DnsRecordListFree", + "DnsSectionAdditional", + "DnsSectionAnswer", + "DnsSectionAuthority", + "DnsSectionQuestion", + "Dup", + "Dup2", + "Dup3", + "DuplicateHandle", + "E2BIG", + "EACCES", + "EADDRINUSE", + "EADDRNOTAVAIL", + "EADV", + "EAFNOSUPPORT", + "EAGAIN", + "EALREADY", + "EAUTH", + "EBADARCH", + "EBADE", + "EBADEXEC", + "EBADF", + "EBADFD", + "EBADMACHO", + "EBADMSG", + "EBADR", + "EBADRPC", + "EBADRQC", + "EBADSLT", + "EBFONT", + "EBUSY", + "ECANCELED", + "ECAPMODE", + "ECHILD", + "ECHO", + "ECHOCTL", + "ECHOE", + "ECHOK", + "ECHOKE", + "ECHONL", + "ECHOPRT", + "ECHRNG", + "ECOMM", + "ECONNABORTED", + "ECONNREFUSED", + "ECONNRESET", + "EDEADLK", + "EDEADLOCK", + "EDESTADDRREQ", + "EDEVERR", + "EDOM", + "EDOOFUS", + "EDOTDOT", + "EDQUOT", + "EEXIST", + "EFAULT", + "EFBIG", + "EFER_LMA", + "EFER_LME", + "EFER_NXE", + "EFER_SCE", + "EFTYPE", + "EHOSTDOWN", + "EHOSTUNREACH", + "EHWPOISON", + "EIDRM", + "EILSEQ", + "EINPROGRESS", + "EINTR", + "EINVAL", + "EIO", + "EIPSEC", + "EISCONN", + "EISDIR", + "EISNAM", + "EKEYEXPIRED", + "EKEYREJECTED", + "EKEYREVOKED", + "EL2HLT", + "EL2NSYNC", + "EL3HLT", + "EL3RST", + "ELAST", + "ELF_NGREG", + "ELF_PRARGSZ", + "ELIBACC", + "ELIBBAD", + "ELIBEXEC", + "ELIBMAX", + "ELIBSCN", + "ELNRNG", + "ELOOP", + "EMEDIUMTYPE", + "EMFILE", + "EMLINK", + "EMSGSIZE", + "EMT_TAGOVF", + "EMULTIHOP", + "EMUL_ENABLED", + "EMUL_LINUX", + "EMUL_LINUX32", + "EMUL_MAXID", + "EMUL_NATIVE", + "ENAMETOOLONG", + "ENAVAIL", + "ENDRUNDISC", + "ENEEDAUTH", + "ENETDOWN", + "ENETRESET", + "ENETUNREACH", + "ENFILE", + "ENOANO", + "ENOATTR", + "ENOBUFS", + "ENOCSI", + "ENODATA", + "ENODEV", + "ENOENT", + "ENOEXEC", + "ENOKEY", + "ENOLCK", + "ENOLINK", + "ENOMEDIUM", + "ENOMEM", + "ENOMSG", + "ENONET", + "ENOPKG", + "ENOPOLICY", + "ENOPROTOOPT", + "ENOSPC", + "ENOSR", + "ENOSTR", + "ENOSYS", + "ENOTBLK", + "ENOTCAPABLE", + "ENOTCONN", + "ENOTDIR", + "ENOTEMPTY", + "ENOTNAM", + "ENOTRECOVERABLE", + "ENOTSOCK", + "ENOTSUP", + "ENOTTY", + "ENOTUNIQ", + "ENXIO", + "EN_SW_CTL_INF", + "EN_SW_CTL_PREC", + "EN_SW_CTL_ROUND", + "EN_SW_DATACHAIN", + "EN_SW_DENORM", + "EN_SW_INVOP", + "EN_SW_OVERFLOW", + "EN_SW_PRECLOSS", + "EN_SW_UNDERFLOW", + "EN_SW_ZERODIV", + "EOPNOTSUPP", + "EOVERFLOW", + "EOWNERDEAD", + "EPERM", + "EPFNOSUPPORT", + "EPIPE", + "EPOLLERR", + "EPOLLET", + "EPOLLHUP", + "EPOLLIN", + "EPOLLMSG", + "EPOLLONESHOT", + "EPOLLOUT", + "EPOLLPRI", + "EPOLLRDBAND", + "EPOLLRDHUP", + "EPOLLRDNORM", + "EPOLLWRBAND", + "EPOLLWRNORM", + "EPOLL_CLOEXEC", + "EPOLL_CTL_ADD", + "EPOLL_CTL_DEL", + "EPOLL_CTL_MOD", + "EPOLL_NONBLOCK", + "EPROCLIM", + "EPROCUNAVAIL", + "EPROGMISMATCH", + "EPROGUNAVAIL", + "EPROTO", + "EPROTONOSUPPORT", + "EPROTOTYPE", + "EPWROFF", + "ERANGE", + "EREMCHG", + "EREMOTE", + "EREMOTEIO", + "ERESTART", + "ERFKILL", + "EROFS", + "ERPCMISMATCH", + "ERROR_ACCESS_DENIED", + "ERROR_ALREADY_EXISTS", + "ERROR_BROKEN_PIPE", + "ERROR_BUFFER_OVERFLOW", + "ERROR_DIR_NOT_EMPTY", + "ERROR_ENVVAR_NOT_FOUND", + "ERROR_FILE_EXISTS", + "ERROR_FILE_NOT_FOUND", + "ERROR_HANDLE_EOF", + "ERROR_INSUFFICIENT_BUFFER", + "ERROR_IO_PENDING", + "ERROR_MOD_NOT_FOUND", + "ERROR_MORE_DATA", + "ERROR_NETNAME_DELETED", + "ERROR_NOT_FOUND", + "ERROR_NO_MORE_FILES", + "ERROR_OPERATION_ABORTED", + "ERROR_PATH_NOT_FOUND", + "ERROR_PRIVILEGE_NOT_HELD", + "ERROR_PROC_NOT_FOUND", + "ESHLIBVERS", + "ESHUTDOWN", + "ESOCKTNOSUPPORT", + "ESPIPE", + "ESRCH", + "ESRMNT", + "ESTALE", + "ESTRPIPE", + "ETHERCAP_JUMBO_MTU", + "ETHERCAP_VLAN_HWTAGGING", + "ETHERCAP_VLAN_MTU", + "ETHERMIN", + "ETHERMTU", + "ETHERMTU_JUMBO", + "ETHERTYPE_8023", + "ETHERTYPE_AARP", + "ETHERTYPE_ACCTON", + "ETHERTYPE_AEONIC", + "ETHERTYPE_ALPHA", + "ETHERTYPE_AMBER", + "ETHERTYPE_AMOEBA", + "ETHERTYPE_AOE", + "ETHERTYPE_APOLLO", + "ETHERTYPE_APOLLODOMAIN", + "ETHERTYPE_APPLETALK", + "ETHERTYPE_APPLITEK", + "ETHERTYPE_ARGONAUT", + "ETHERTYPE_ARP", + "ETHERTYPE_AT", + "ETHERTYPE_ATALK", + "ETHERTYPE_ATOMIC", + "ETHERTYPE_ATT", + "ETHERTYPE_ATTSTANFORD", + "ETHERTYPE_AUTOPHON", + "ETHERTYPE_AXIS", + "ETHERTYPE_BCLOOP", + "ETHERTYPE_BOFL", + "ETHERTYPE_CABLETRON", + "ETHERTYPE_CHAOS", + "ETHERTYPE_COMDESIGN", + "ETHERTYPE_COMPUGRAPHIC", + "ETHERTYPE_COUNTERPOINT", + "ETHERTYPE_CRONUS", + "ETHERTYPE_CRONUSVLN", + "ETHERTYPE_DCA", + "ETHERTYPE_DDE", + "ETHERTYPE_DEBNI", + "ETHERTYPE_DECAM", + "ETHERTYPE_DECCUST", + "ETHERTYPE_DECDIAG", + "ETHERTYPE_DECDNS", + "ETHERTYPE_DECDTS", + "ETHERTYPE_DECEXPER", + "ETHERTYPE_DECLAST", + "ETHERTYPE_DECLTM", + "ETHERTYPE_DECMUMPS", + "ETHERTYPE_DECNETBIOS", + "ETHERTYPE_DELTACON", + "ETHERTYPE_DIDDLE", + "ETHERTYPE_DLOG1", + "ETHERTYPE_DLOG2", + "ETHERTYPE_DN", + "ETHERTYPE_DOGFIGHT", + "ETHERTYPE_DSMD", + "ETHERTYPE_ECMA", + "ETHERTYPE_ENCRYPT", + "ETHERTYPE_ES", + "ETHERTYPE_EXCELAN", + "ETHERTYPE_EXPERDATA", + "ETHERTYPE_FLIP", + "ETHERTYPE_FLOWCONTROL", + "ETHERTYPE_FRARP", + "ETHERTYPE_GENDYN", + "ETHERTYPE_HAYES", + "ETHERTYPE_HIPPI_FP", + "ETHERTYPE_HITACHI", + "ETHERTYPE_HP", + "ETHERTYPE_IEEEPUP", + "ETHERTYPE_IEEEPUPAT", + "ETHERTYPE_IMLBL", + "ETHERTYPE_IMLBLDIAG", + "ETHERTYPE_IP", + "ETHERTYPE_IPAS", + "ETHERTYPE_IPV6", + "ETHERTYPE_IPX", + "ETHERTYPE_IPXNEW", + "ETHERTYPE_KALPANA", + "ETHERTYPE_LANBRIDGE", + "ETHERTYPE_LANPROBE", + "ETHERTYPE_LAT", + "ETHERTYPE_LBACK", + "ETHERTYPE_LITTLE", + "ETHERTYPE_LLDP", + "ETHERTYPE_LOGICRAFT", + "ETHERTYPE_LOOPBACK", + "ETHERTYPE_MATRA", + "ETHERTYPE_MAX", + "ETHERTYPE_MERIT", + "ETHERTYPE_MICP", + "ETHERTYPE_MOPDL", + "ETHERTYPE_MOPRC", + "ETHERTYPE_MOTOROLA", + "ETHERTYPE_MPLS", + "ETHERTYPE_MPLS_MCAST", + "ETHERTYPE_MUMPS", + "ETHERTYPE_NBPCC", + "ETHERTYPE_NBPCLAIM", + "ETHERTYPE_NBPCLREQ", + "ETHERTYPE_NBPCLRSP", + "ETHERTYPE_NBPCREQ", + "ETHERTYPE_NBPCRSP", + "ETHERTYPE_NBPDG", + "ETHERTYPE_NBPDGB", + "ETHERTYPE_NBPDLTE", + "ETHERTYPE_NBPRAR", + "ETHERTYPE_NBPRAS", + "ETHERTYPE_NBPRST", + "ETHERTYPE_NBPSCD", + "ETHERTYPE_NBPVCD", + "ETHERTYPE_NBS", + "ETHERTYPE_NCD", + "ETHERTYPE_NESTAR", + "ETHERTYPE_NETBEUI", + "ETHERTYPE_NOVELL", + "ETHERTYPE_NS", + "ETHERTYPE_NSAT", + "ETHERTYPE_NSCOMPAT", + "ETHERTYPE_NTRAILER", + "ETHERTYPE_OS9", + "ETHERTYPE_OS9NET", + "ETHERTYPE_PACER", + "ETHERTYPE_PAE", + "ETHERTYPE_PCS", + "ETHERTYPE_PLANNING", + "ETHERTYPE_PPP", + "ETHERTYPE_PPPOE", + "ETHERTYPE_PPPOEDISC", + "ETHERTYPE_PRIMENTS", + "ETHERTYPE_PUP", + "ETHERTYPE_PUPAT", + "ETHERTYPE_QINQ", + "ETHERTYPE_RACAL", + "ETHERTYPE_RATIONAL", + "ETHERTYPE_RAWFR", + "ETHERTYPE_RCL", + "ETHERTYPE_RDP", + "ETHERTYPE_RETIX", + "ETHERTYPE_REVARP", + "ETHERTYPE_SCA", + "ETHERTYPE_SECTRA", + "ETHERTYPE_SECUREDATA", + "ETHERTYPE_SGITW", + "ETHERTYPE_SG_BOUNCE", + "ETHERTYPE_SG_DIAG", + "ETHERTYPE_SG_NETGAMES", + "ETHERTYPE_SG_RESV", + "ETHERTYPE_SIMNET", + "ETHERTYPE_SLOW", + "ETHERTYPE_SLOWPROTOCOLS", + "ETHERTYPE_SNA", + "ETHERTYPE_SNMP", + "ETHERTYPE_SONIX", + "ETHERTYPE_SPIDER", + "ETHERTYPE_SPRITE", + "ETHERTYPE_STP", + "ETHERTYPE_TALARIS", + "ETHERTYPE_TALARISMC", + "ETHERTYPE_TCPCOMP", + "ETHERTYPE_TCPSM", + "ETHERTYPE_TEC", + "ETHERTYPE_TIGAN", + "ETHERTYPE_TRAIL", + "ETHERTYPE_TRANSETHER", + "ETHERTYPE_TYMSHARE", + "ETHERTYPE_UBBST", + "ETHERTYPE_UBDEBUG", + "ETHERTYPE_UBDIAGLOOP", + "ETHERTYPE_UBDL", + "ETHERTYPE_UBNIU", + "ETHERTYPE_UBNMC", + "ETHERTYPE_VALID", + "ETHERTYPE_VARIAN", + "ETHERTYPE_VAXELN", + "ETHERTYPE_VEECO", + "ETHERTYPE_VEXP", + "ETHERTYPE_VGLAB", + "ETHERTYPE_VINES", + "ETHERTYPE_VINESECHO", + "ETHERTYPE_VINESLOOP", + "ETHERTYPE_VITAL", + "ETHERTYPE_VLAN", + "ETHERTYPE_VLTLMAN", + "ETHERTYPE_VPROD", + "ETHERTYPE_VURESERVED", + "ETHERTYPE_WATERLOO", + "ETHERTYPE_WELLFLEET", + "ETHERTYPE_X25", + "ETHERTYPE_X75", + "ETHERTYPE_XNSSM", + "ETHERTYPE_XTP", + "ETHER_ADDR_LEN", + "ETHER_ALIGN", + "ETHER_CRC_LEN", + "ETHER_CRC_POLY_BE", + "ETHER_CRC_POLY_LE", + "ETHER_HDR_LEN", + "ETHER_MAX_DIX_LEN", + "ETHER_MAX_LEN", + "ETHER_MAX_LEN_JUMBO", + "ETHER_MIN_LEN", + "ETHER_PPPOE_ENCAP_LEN", + "ETHER_TYPE_LEN", + "ETHER_VLAN_ENCAP_LEN", + "ETH_P_1588", + "ETH_P_8021Q", + "ETH_P_802_2", + "ETH_P_802_3", + "ETH_P_AARP", + "ETH_P_ALL", + "ETH_P_AOE", + "ETH_P_ARCNET", + "ETH_P_ARP", + "ETH_P_ATALK", + "ETH_P_ATMFATE", + "ETH_P_ATMMPOA", + "ETH_P_AX25", + "ETH_P_BPQ", + "ETH_P_CAIF", + "ETH_P_CAN", + "ETH_P_CONTROL", + "ETH_P_CUST", + "ETH_P_DDCMP", + "ETH_P_DEC", + "ETH_P_DIAG", + "ETH_P_DNA_DL", + "ETH_P_DNA_RC", + "ETH_P_DNA_RT", + "ETH_P_DSA", + "ETH_P_ECONET", + "ETH_P_EDSA", + "ETH_P_FCOE", + "ETH_P_FIP", + "ETH_P_HDLC", + "ETH_P_IEEE802154", + "ETH_P_IEEEPUP", + "ETH_P_IEEEPUPAT", + "ETH_P_IP", + "ETH_P_IPV6", + "ETH_P_IPX", + "ETH_P_IRDA", + "ETH_P_LAT", + "ETH_P_LINK_CTL", + "ETH_P_LOCALTALK", + "ETH_P_LOOP", + "ETH_P_MOBITEX", + "ETH_P_MPLS_MC", + "ETH_P_MPLS_UC", + "ETH_P_PAE", + "ETH_P_PAUSE", + "ETH_P_PHONET", + "ETH_P_PPPTALK", + "ETH_P_PPP_DISC", + "ETH_P_PPP_MP", + "ETH_P_PPP_SES", + "ETH_P_PUP", + "ETH_P_PUPAT", + "ETH_P_RARP", + "ETH_P_SCA", + "ETH_P_SLOW", + "ETH_P_SNAP", + "ETH_P_TEB", + "ETH_P_TIPC", + "ETH_P_TRAILER", + "ETH_P_TR_802_2", + "ETH_P_WAN_PPP", + "ETH_P_WCCP", + "ETH_P_X25", + "ETIME", + "ETIMEDOUT", + "ETOOMANYREFS", + "ETXTBSY", + "EUCLEAN", + "EUNATCH", + "EUSERS", + "EVFILT_AIO", + "EVFILT_FS", + "EVFILT_LIO", + "EVFILT_MACHPORT", + "EVFILT_PROC", + "EVFILT_READ", + "EVFILT_SIGNAL", + "EVFILT_SYSCOUNT", + "EVFILT_THREADMARKER", + "EVFILT_TIMER", + "EVFILT_USER", + "EVFILT_VM", + "EVFILT_VNODE", + "EVFILT_WRITE", + "EV_ADD", + "EV_CLEAR", + "EV_DELETE", + "EV_DISABLE", + "EV_DISPATCH", + "EV_DROP", + "EV_ENABLE", + "EV_EOF", + "EV_ERROR", + "EV_FLAG0", + "EV_FLAG1", + "EV_ONESHOT", + "EV_OOBAND", + "EV_POLL", + "EV_RECEIPT", + "EV_SYSFLAGS", + "EWINDOWS", + "EWOULDBLOCK", + "EXDEV", + "EXFULL", + "EXTA", + "EXTB", + "EXTPROC", + "Environ", + "EpollCreate", + "EpollCreate1", + "EpollCtl", + "EpollEvent", + "EpollWait", + "Errno", + "EscapeArg", + "Exchangedata", + "Exec", + "Exit", + "ExitProcess", + "FD_CLOEXEC", + "FD_SETSIZE", + "FILE_ACTION_ADDED", + "FILE_ACTION_MODIFIED", + "FILE_ACTION_REMOVED", + "FILE_ACTION_RENAMED_NEW_NAME", + "FILE_ACTION_RENAMED_OLD_NAME", + "FILE_APPEND_DATA", + "FILE_ATTRIBUTE_ARCHIVE", + "FILE_ATTRIBUTE_DIRECTORY", + "FILE_ATTRIBUTE_HIDDEN", + "FILE_ATTRIBUTE_NORMAL", + "FILE_ATTRIBUTE_READONLY", + "FILE_ATTRIBUTE_REPARSE_POINT", + "FILE_ATTRIBUTE_SYSTEM", + "FILE_BEGIN", + "FILE_CURRENT", + "FILE_END", + "FILE_FLAG_BACKUP_SEMANTICS", + "FILE_FLAG_OPEN_REPARSE_POINT", + "FILE_FLAG_OVERLAPPED", + "FILE_LIST_DIRECTORY", + "FILE_MAP_COPY", + "FILE_MAP_EXECUTE", + "FILE_MAP_READ", + "FILE_MAP_WRITE", + "FILE_NOTIFY_CHANGE_ATTRIBUTES", + "FILE_NOTIFY_CHANGE_CREATION", + "FILE_NOTIFY_CHANGE_DIR_NAME", + "FILE_NOTIFY_CHANGE_FILE_NAME", + "FILE_NOTIFY_CHANGE_LAST_ACCESS", + "FILE_NOTIFY_CHANGE_LAST_WRITE", + "FILE_NOTIFY_CHANGE_SIZE", + "FILE_SHARE_DELETE", + "FILE_SHARE_READ", + "FILE_SHARE_WRITE", + "FILE_SKIP_COMPLETION_PORT_ON_SUCCESS", + "FILE_SKIP_SET_EVENT_ON_HANDLE", + "FILE_TYPE_CHAR", + "FILE_TYPE_DISK", + "FILE_TYPE_PIPE", + "FILE_TYPE_REMOTE", + "FILE_TYPE_UNKNOWN", + "FILE_WRITE_ATTRIBUTES", + "FLUSHO", + "FORMAT_MESSAGE_ALLOCATE_BUFFER", + "FORMAT_MESSAGE_ARGUMENT_ARRAY", + "FORMAT_MESSAGE_FROM_HMODULE", + "FORMAT_MESSAGE_FROM_STRING", + "FORMAT_MESSAGE_FROM_SYSTEM", + "FORMAT_MESSAGE_IGNORE_INSERTS", + "FORMAT_MESSAGE_MAX_WIDTH_MASK", + "FSCTL_GET_REPARSE_POINT", + "F_ADDFILESIGS", + "F_ADDSIGS", + "F_ALLOCATEALL", + "F_ALLOCATECONTIG", + "F_CANCEL", + "F_CHKCLEAN", + "F_CLOSEM", + "F_DUP2FD", + "F_DUP2FD_CLOEXEC", + "F_DUPFD", + "F_DUPFD_CLOEXEC", + "F_EXLCK", + "F_FLUSH_DATA", + "F_FREEZE_FS", + "F_FSCTL", + "F_FSDIRMASK", + "F_FSIN", + "F_FSINOUT", + "F_FSOUT", + "F_FSPRIV", + "F_FSVOID", + "F_FULLFSYNC", + "F_GETFD", + "F_GETFL", + "F_GETLEASE", + "F_GETLK", + "F_GETLK64", + "F_GETLKPID", + "F_GETNOSIGPIPE", + "F_GETOWN", + "F_GETOWN_EX", + "F_GETPATH", + "F_GETPATH_MTMINFO", + "F_GETPIPE_SZ", + "F_GETPROTECTIONCLASS", + "F_GETSIG", + "F_GLOBAL_NOCACHE", + "F_LOCK", + "F_LOG2PHYS", + "F_LOG2PHYS_EXT", + "F_MARKDEPENDENCY", + "F_MAXFD", + "F_NOCACHE", + "F_NODIRECT", + "F_NOTIFY", + "F_OGETLK", + "F_OK", + "F_OSETLK", + "F_OSETLKW", + "F_PARAM_MASK", + "F_PARAM_MAX", + "F_PATHPKG_CHECK", + "F_PEOFPOSMODE", + "F_PREALLOCATE", + "F_RDADVISE", + "F_RDAHEAD", + "F_RDLCK", + "F_READAHEAD", + "F_READBOOTSTRAP", + "F_SETBACKINGSTORE", + "F_SETFD", + "F_SETFL", + "F_SETLEASE", + "F_SETLK", + "F_SETLK64", + "F_SETLKW", + "F_SETLKW64", + "F_SETLK_REMOTE", + "F_SETNOSIGPIPE", + "F_SETOWN", + "F_SETOWN_EX", + "F_SETPIPE_SZ", + "F_SETPROTECTIONCLASS", + "F_SETSIG", + "F_SETSIZE", + "F_SHLCK", + "F_TEST", + "F_THAW_FS", + "F_TLOCK", + "F_ULOCK", + "F_UNLCK", + "F_UNLCKSYS", + "F_VOLPOSMODE", + "F_WRITEBOOTSTRAP", + "F_WRLCK", + "Faccessat", + "Fallocate", + "Fbootstraptransfer_t", + "Fchdir", + "Fchflags", + "Fchmod", + "Fchmodat", + "Fchown", + "Fchownat", + "FcntlFlock", + "FdSet", + "Fdatasync", + "FileNotifyInformation", + "Filetime", + "FindClose", + "FindFirstFile", + "FindNextFile", + "Flock", + "Flock_t", + "FlushBpf", + "FlushFileBuffers", + "FlushViewOfFile", + "ForkExec", + "ForkLock", + "FormatMessage", + "Fpathconf", + "FreeAddrInfoW", + "FreeEnvironmentStrings", + "FreeLibrary", + "Fsid", + "Fstat", + "Fstatat", + "Fstatfs", + "Fstore_t", + "Fsync", + "Ftruncate", + "FullPath", + "Futimes", + "Futimesat", + "GENERIC_ALL", + "GENERIC_EXECUTE", + "GENERIC_READ", + "GENERIC_WRITE", + "GUID", + "GetAcceptExSockaddrs", + "GetAdaptersInfo", + "GetAddrInfoW", + "GetCommandLine", + "GetComputerName", + "GetConsoleMode", + "GetCurrentDirectory", + "GetCurrentProcess", + "GetEnvironmentStrings", + "GetEnvironmentVariable", + "GetExitCodeProcess", + "GetFileAttributes", + "GetFileAttributesEx", + "GetFileExInfoStandard", + "GetFileExMaxInfoLevel", + "GetFileInformationByHandle", + "GetFileType", + "GetFullPathName", + "GetHostByName", + "GetIfEntry", + "GetLastError", + "GetLengthSid", + "GetLongPathName", + "GetProcAddress", + "GetProcessTimes", + "GetProtoByName", + "GetQueuedCompletionStatus", + "GetServByName", + "GetShortPathName", + "GetStartupInfo", + "GetStdHandle", + "GetSystemTimeAsFileTime", + "GetTempPath", + "GetTimeZoneInformation", + "GetTokenInformation", + "GetUserNameEx", + "GetUserProfileDirectory", + "GetVersion", + "Getcwd", + "Getdents", + "Getdirentries", + "Getdtablesize", + "Getegid", + "Getenv", + "Geteuid", + "Getfsstat", + "Getgid", + "Getgroups", + "Getpagesize", + "Getpeername", + "Getpgid", + "Getpgrp", + "Getpid", + "Getppid", + "Getpriority", + "Getrlimit", + "Getrusage", + "Getsid", + "Getsockname", + "Getsockopt", + "GetsockoptByte", + "GetsockoptICMPv6Filter", + "GetsockoptIPMreq", + "GetsockoptIPMreqn", + "GetsockoptIPv6MTUInfo", + "GetsockoptIPv6Mreq", + "GetsockoptInet4Addr", + "GetsockoptInt", + "GetsockoptUcred", + "Gettid", + "Gettimeofday", + "Getuid", + "Getwd", + "Getxattr", + "HANDLE_FLAG_INHERIT", + "HKEY_CLASSES_ROOT", + "HKEY_CURRENT_CONFIG", + "HKEY_CURRENT_USER", + "HKEY_DYN_DATA", + "HKEY_LOCAL_MACHINE", + "HKEY_PERFORMANCE_DATA", + "HKEY_USERS", + "HUPCL", + "Handle", + "Hostent", + "ICANON", + "ICMP6_FILTER", + "ICMPV6_FILTER", + "ICMPv6Filter", + "ICRNL", + "IEXTEN", + "IFAN_ARRIVAL", + "IFAN_DEPARTURE", + "IFA_ADDRESS", + "IFA_ANYCAST", + "IFA_BROADCAST", + "IFA_CACHEINFO", + "IFA_F_DADFAILED", + "IFA_F_DEPRECATED", + "IFA_F_HOMEADDRESS", + "IFA_F_NODAD", + "IFA_F_OPTIMISTIC", + "IFA_F_PERMANENT", + "IFA_F_SECONDARY", + "IFA_F_TEMPORARY", + "IFA_F_TENTATIVE", + "IFA_LABEL", + "IFA_LOCAL", + "IFA_MAX", + "IFA_MULTICAST", + "IFA_ROUTE", + "IFA_UNSPEC", + "IFF_ALLMULTI", + "IFF_ALTPHYS", + "IFF_AUTOMEDIA", + "IFF_BROADCAST", + "IFF_CANTCHANGE", + "IFF_CANTCONFIG", + "IFF_DEBUG", + "IFF_DRV_OACTIVE", + "IFF_DRV_RUNNING", + "IFF_DYING", + "IFF_DYNAMIC", + "IFF_LINK0", + "IFF_LINK1", + "IFF_LINK2", + "IFF_LOOPBACK", + "IFF_MASTER", + "IFF_MONITOR", + "IFF_MULTICAST", + "IFF_NOARP", + "IFF_NOTRAILERS", + "IFF_NO_PI", + "IFF_OACTIVE", + "IFF_ONE_QUEUE", + "IFF_POINTOPOINT", + "IFF_POINTTOPOINT", + "IFF_PORTSEL", + "IFF_PPROMISC", + "IFF_PROMISC", + "IFF_RENAMING", + "IFF_RUNNING", + "IFF_SIMPLEX", + "IFF_SLAVE", + "IFF_SMART", + "IFF_STATICARP", + "IFF_TAP", + "IFF_TUN", + "IFF_TUN_EXCL", + "IFF_UP", + "IFF_VNET_HDR", + "IFLA_ADDRESS", + "IFLA_BROADCAST", + "IFLA_COST", + "IFLA_IFALIAS", + "IFLA_IFNAME", + "IFLA_LINK", + "IFLA_LINKINFO", + "IFLA_LINKMODE", + "IFLA_MAP", + "IFLA_MASTER", + "IFLA_MAX", + "IFLA_MTU", + "IFLA_NET_NS_PID", + "IFLA_OPERSTATE", + "IFLA_PRIORITY", + "IFLA_PROTINFO", + "IFLA_QDISC", + "IFLA_STATS", + "IFLA_TXQLEN", + "IFLA_UNSPEC", + "IFLA_WEIGHT", + "IFLA_WIRELESS", + "IFNAMSIZ", + "IFT_1822", + "IFT_A12MPPSWITCH", + "IFT_AAL2", + "IFT_AAL5", + "IFT_ADSL", + "IFT_AFLANE8023", + "IFT_AFLANE8025", + "IFT_ARAP", + "IFT_ARCNET", + "IFT_ARCNETPLUS", + "IFT_ASYNC", + "IFT_ATM", + "IFT_ATMDXI", + "IFT_ATMFUNI", + "IFT_ATMIMA", + "IFT_ATMLOGICAL", + "IFT_ATMRADIO", + "IFT_ATMSUBINTERFACE", + "IFT_ATMVCIENDPT", + "IFT_ATMVIRTUAL", + "IFT_BGPPOLICYACCOUNTING", + "IFT_BLUETOOTH", + "IFT_BRIDGE", + "IFT_BSC", + "IFT_CARP", + "IFT_CCTEMUL", + "IFT_CELLULAR", + "IFT_CEPT", + "IFT_CES", + "IFT_CHANNEL", + "IFT_CNR", + "IFT_COFFEE", + "IFT_COMPOSITELINK", + "IFT_DCN", + "IFT_DIGITALPOWERLINE", + "IFT_DIGITALWRAPPEROVERHEADCHANNEL", + "IFT_DLSW", + "IFT_DOCSCABLEDOWNSTREAM", + "IFT_DOCSCABLEMACLAYER", + "IFT_DOCSCABLEUPSTREAM", + "IFT_DOCSCABLEUPSTREAMCHANNEL", + "IFT_DS0", + "IFT_DS0BUNDLE", + "IFT_DS1FDL", + "IFT_DS3", + "IFT_DTM", + "IFT_DUMMY", + "IFT_DVBASILN", + "IFT_DVBASIOUT", + "IFT_DVBRCCDOWNSTREAM", + "IFT_DVBRCCMACLAYER", + "IFT_DVBRCCUPSTREAM", + "IFT_ECONET", + "IFT_ENC", + "IFT_EON", + "IFT_EPLRS", + "IFT_ESCON", + "IFT_ETHER", + "IFT_FAITH", + "IFT_FAST", + "IFT_FASTETHER", + "IFT_FASTETHERFX", + "IFT_FDDI", + "IFT_FIBRECHANNEL", + "IFT_FRAMERELAYINTERCONNECT", + "IFT_FRAMERELAYMPI", + "IFT_FRDLCIENDPT", + "IFT_FRELAY", + "IFT_FRELAYDCE", + "IFT_FRF16MFRBUNDLE", + "IFT_FRFORWARD", + "IFT_G703AT2MB", + "IFT_G703AT64K", + "IFT_GIF", + "IFT_GIGABITETHERNET", + "IFT_GR303IDT", + "IFT_GR303RDT", + "IFT_H323GATEKEEPER", + "IFT_H323PROXY", + "IFT_HDH1822", + "IFT_HDLC", + "IFT_HDSL2", + "IFT_HIPERLAN2", + "IFT_HIPPI", + "IFT_HIPPIINTERFACE", + "IFT_HOSTPAD", + "IFT_HSSI", + "IFT_HY", + "IFT_IBM370PARCHAN", + "IFT_IDSL", + "IFT_IEEE1394", + "IFT_IEEE80211", + "IFT_IEEE80212", + "IFT_IEEE8023ADLAG", + "IFT_IFGSN", + "IFT_IMT", + "IFT_INFINIBAND", + "IFT_INTERLEAVE", + "IFT_IP", + "IFT_IPFORWARD", + "IFT_IPOVERATM", + "IFT_IPOVERCDLC", + "IFT_IPOVERCLAW", + "IFT_IPSWITCH", + "IFT_IPXIP", + "IFT_ISDN", + "IFT_ISDNBASIC", + "IFT_ISDNPRIMARY", + "IFT_ISDNS", + "IFT_ISDNU", + "IFT_ISO88022LLC", + "IFT_ISO88023", + "IFT_ISO88024", + "IFT_ISO88025", + "IFT_ISO88025CRFPINT", + "IFT_ISO88025DTR", + "IFT_ISO88025FIBER", + "IFT_ISO88026", + "IFT_ISUP", + "IFT_L2VLAN", + "IFT_L3IPVLAN", + "IFT_L3IPXVLAN", + "IFT_LAPB", + "IFT_LAPD", + "IFT_LAPF", + "IFT_LINEGROUP", + "IFT_LOCALTALK", + "IFT_LOOP", + "IFT_MEDIAMAILOVERIP", + "IFT_MFSIGLINK", + "IFT_MIOX25", + "IFT_MODEM", + "IFT_MPC", + "IFT_MPLS", + "IFT_MPLSTUNNEL", + "IFT_MSDSL", + "IFT_MVL", + "IFT_MYRINET", + "IFT_NFAS", + "IFT_NSIP", + "IFT_OPTICALCHANNEL", + "IFT_OPTICALTRANSPORT", + "IFT_OTHER", + "IFT_P10", + "IFT_P80", + "IFT_PARA", + "IFT_PDP", + "IFT_PFLOG", + "IFT_PFLOW", + "IFT_PFSYNC", + "IFT_PLC", + "IFT_PON155", + "IFT_PON622", + "IFT_POS", + "IFT_PPP", + "IFT_PPPMULTILINKBUNDLE", + "IFT_PROPATM", + "IFT_PROPBWAP2MP", + "IFT_PROPCNLS", + "IFT_PROPDOCSWIRELESSDOWNSTREAM", + "IFT_PROPDOCSWIRELESSMACLAYER", + "IFT_PROPDOCSWIRELESSUPSTREAM", + "IFT_PROPMUX", + "IFT_PROPVIRTUAL", + "IFT_PROPWIRELESSP2P", + "IFT_PTPSERIAL", + "IFT_PVC", + "IFT_Q2931", + "IFT_QLLC", + "IFT_RADIOMAC", + "IFT_RADSL", + "IFT_REACHDSL", + "IFT_RFC1483", + "IFT_RS232", + "IFT_RSRB", + "IFT_SDLC", + "IFT_SDSL", + "IFT_SHDSL", + "IFT_SIP", + "IFT_SIPSIG", + "IFT_SIPTG", + "IFT_SLIP", + "IFT_SMDSDXI", + "IFT_SMDSICIP", + "IFT_SONET", + "IFT_SONETOVERHEADCHANNEL", + "IFT_SONETPATH", + "IFT_SONETVT", + "IFT_SRP", + "IFT_SS7SIGLINK", + "IFT_STACKTOSTACK", + "IFT_STARLAN", + "IFT_STF", + "IFT_T1", + "IFT_TDLC", + "IFT_TELINK", + "IFT_TERMPAD", + "IFT_TR008", + "IFT_TRANSPHDLC", + "IFT_TUNNEL", + "IFT_ULTRA", + "IFT_USB", + "IFT_V11", + "IFT_V35", + "IFT_V36", + "IFT_V37", + "IFT_VDSL", + "IFT_VIRTUALIPADDRESS", + "IFT_VIRTUALTG", + "IFT_VOICEDID", + "IFT_VOICEEM", + "IFT_VOICEEMFGD", + "IFT_VOICEENCAP", + "IFT_VOICEFGDEANA", + "IFT_VOICEFXO", + "IFT_VOICEFXS", + "IFT_VOICEOVERATM", + "IFT_VOICEOVERCABLE", + "IFT_VOICEOVERFRAMERELAY", + "IFT_VOICEOVERIP", + "IFT_X213", + "IFT_X25", + "IFT_X25DDN", + "IFT_X25HUNTGROUP", + "IFT_X25MLP", + "IFT_X25PLE", + "IFT_XETHER", + "IGNBRK", + "IGNCR", + "IGNORE", + "IGNPAR", + "IMAXBEL", + "INFINITE", + "INLCR", + "INPCK", + "INVALID_FILE_ATTRIBUTES", + "IN_ACCESS", + "IN_ALL_EVENTS", + "IN_ATTRIB", + "IN_CLASSA_HOST", + "IN_CLASSA_MAX", + "IN_CLASSA_NET", + "IN_CLASSA_NSHIFT", + "IN_CLASSB_HOST", + "IN_CLASSB_MAX", + "IN_CLASSB_NET", + "IN_CLASSB_NSHIFT", + "IN_CLASSC_HOST", + "IN_CLASSC_NET", + "IN_CLASSC_NSHIFT", + "IN_CLASSD_HOST", + "IN_CLASSD_NET", + "IN_CLASSD_NSHIFT", + "IN_CLOEXEC", + "IN_CLOSE", + "IN_CLOSE_NOWRITE", + "IN_CLOSE_WRITE", + "IN_CREATE", + "IN_DELETE", + "IN_DELETE_SELF", + "IN_DONT_FOLLOW", + "IN_EXCL_UNLINK", + "IN_IGNORED", + "IN_ISDIR", + "IN_LINKLOCALNETNUM", + "IN_LOOPBACKNET", + "IN_MASK_ADD", + "IN_MODIFY", + "IN_MOVE", + "IN_MOVED_FROM", + "IN_MOVED_TO", + "IN_MOVE_SELF", + "IN_NONBLOCK", + "IN_ONESHOT", + "IN_ONLYDIR", + "IN_OPEN", + "IN_Q_OVERFLOW", + "IN_RFC3021_HOST", + "IN_RFC3021_MASK", + "IN_RFC3021_NET", + "IN_RFC3021_NSHIFT", + "IN_UNMOUNT", + "IOC_IN", + "IOC_INOUT", + "IOC_OUT", + "IOC_VENDOR", + "IOC_WS2", + "IO_REPARSE_TAG_SYMLINK", + "IPMreq", + "IPMreqn", + "IPPROTO_3PC", + "IPPROTO_ADFS", + "IPPROTO_AH", + "IPPROTO_AHIP", + "IPPROTO_APES", + "IPPROTO_ARGUS", + "IPPROTO_AX25", + "IPPROTO_BHA", + "IPPROTO_BLT", + "IPPROTO_BRSATMON", + "IPPROTO_CARP", + "IPPROTO_CFTP", + "IPPROTO_CHAOS", + "IPPROTO_CMTP", + "IPPROTO_COMP", + "IPPROTO_CPHB", + "IPPROTO_CPNX", + "IPPROTO_DCCP", + "IPPROTO_DDP", + "IPPROTO_DGP", + "IPPROTO_DIVERT", + "IPPROTO_DIVERT_INIT", + "IPPROTO_DIVERT_RESP", + "IPPROTO_DONE", + "IPPROTO_DSTOPTS", + "IPPROTO_EGP", + "IPPROTO_EMCON", + "IPPROTO_ENCAP", + "IPPROTO_EON", + "IPPROTO_ESP", + "IPPROTO_ETHERIP", + "IPPROTO_FRAGMENT", + "IPPROTO_GGP", + "IPPROTO_GMTP", + "IPPROTO_GRE", + "IPPROTO_HELLO", + "IPPROTO_HMP", + "IPPROTO_HOPOPTS", + "IPPROTO_ICMP", + "IPPROTO_ICMPV6", + "IPPROTO_IDP", + "IPPROTO_IDPR", + "IPPROTO_IDRP", + "IPPROTO_IGMP", + "IPPROTO_IGP", + "IPPROTO_IGRP", + "IPPROTO_IL", + "IPPROTO_INLSP", + "IPPROTO_INP", + "IPPROTO_IP", + "IPPROTO_IPCOMP", + "IPPROTO_IPCV", + "IPPROTO_IPEIP", + "IPPROTO_IPIP", + "IPPROTO_IPPC", + "IPPROTO_IPV4", + "IPPROTO_IPV6", + "IPPROTO_IPV6_ICMP", + "IPPROTO_IRTP", + "IPPROTO_KRYPTOLAN", + "IPPROTO_LARP", + "IPPROTO_LEAF1", + "IPPROTO_LEAF2", + "IPPROTO_MAX", + "IPPROTO_MAXID", + "IPPROTO_MEAS", + "IPPROTO_MH", + "IPPROTO_MHRP", + "IPPROTO_MICP", + "IPPROTO_MOBILE", + "IPPROTO_MPLS", + "IPPROTO_MTP", + "IPPROTO_MUX", + "IPPROTO_ND", + "IPPROTO_NHRP", + "IPPROTO_NONE", + "IPPROTO_NSP", + "IPPROTO_NVPII", + "IPPROTO_OLD_DIVERT", + "IPPROTO_OSPFIGP", + "IPPROTO_PFSYNC", + "IPPROTO_PGM", + "IPPROTO_PIGP", + "IPPROTO_PIM", + "IPPROTO_PRM", + "IPPROTO_PUP", + "IPPROTO_PVP", + "IPPROTO_RAW", + "IPPROTO_RCCMON", + "IPPROTO_RDP", + "IPPROTO_ROUTING", + "IPPROTO_RSVP", + "IPPROTO_RVD", + "IPPROTO_SATEXPAK", + "IPPROTO_SATMON", + "IPPROTO_SCCSP", + "IPPROTO_SCTP", + "IPPROTO_SDRP", + "IPPROTO_SEND", + "IPPROTO_SEP", + "IPPROTO_SKIP", + "IPPROTO_SPACER", + "IPPROTO_SRPC", + "IPPROTO_ST", + "IPPROTO_SVMTP", + "IPPROTO_SWIPE", + "IPPROTO_TCF", + "IPPROTO_TCP", + "IPPROTO_TLSP", + "IPPROTO_TP", + "IPPROTO_TPXX", + "IPPROTO_TRUNK1", + "IPPROTO_TRUNK2", + "IPPROTO_TTP", + "IPPROTO_UDP", + "IPPROTO_UDPLITE", + "IPPROTO_VINES", + "IPPROTO_VISA", + "IPPROTO_VMTP", + "IPPROTO_VRRP", + "IPPROTO_WBEXPAK", + "IPPROTO_WBMON", + "IPPROTO_WSN", + "IPPROTO_XNET", + "IPPROTO_XTP", + "IPV6_2292DSTOPTS", + "IPV6_2292HOPLIMIT", + "IPV6_2292HOPOPTS", + "IPV6_2292NEXTHOP", + "IPV6_2292PKTINFO", + "IPV6_2292PKTOPTIONS", + "IPV6_2292RTHDR", + "IPV6_ADDRFORM", + "IPV6_ADD_MEMBERSHIP", + "IPV6_AUTHHDR", + "IPV6_AUTH_LEVEL", + "IPV6_AUTOFLOWLABEL", + "IPV6_BINDANY", + "IPV6_BINDV6ONLY", + "IPV6_BOUND_IF", + "IPV6_CHECKSUM", + "IPV6_DEFAULT_MULTICAST_HOPS", + "IPV6_DEFAULT_MULTICAST_LOOP", + "IPV6_DEFHLIM", + "IPV6_DONTFRAG", + "IPV6_DROP_MEMBERSHIP", + "IPV6_DSTOPTS", + "IPV6_ESP_NETWORK_LEVEL", + "IPV6_ESP_TRANS_LEVEL", + "IPV6_FAITH", + "IPV6_FLOWINFO_MASK", + "IPV6_FLOWLABEL_MASK", + "IPV6_FRAGTTL", + "IPV6_FW_ADD", + "IPV6_FW_DEL", + "IPV6_FW_FLUSH", + "IPV6_FW_GET", + "IPV6_FW_ZERO", + "IPV6_HLIMDEC", + "IPV6_HOPLIMIT", + "IPV6_HOPOPTS", + "IPV6_IPCOMP_LEVEL", + "IPV6_IPSEC_POLICY", + "IPV6_JOIN_ANYCAST", + "IPV6_JOIN_GROUP", + "IPV6_LEAVE_ANYCAST", + "IPV6_LEAVE_GROUP", + "IPV6_MAXHLIM", + "IPV6_MAXOPTHDR", + "IPV6_MAXPACKET", + "IPV6_MAX_GROUP_SRC_FILTER", + "IPV6_MAX_MEMBERSHIPS", + "IPV6_MAX_SOCK_SRC_FILTER", + "IPV6_MIN_MEMBERSHIPS", + "IPV6_MMTU", + "IPV6_MSFILTER", + "IPV6_MTU", + "IPV6_MTU_DISCOVER", + "IPV6_MULTICAST_HOPS", + "IPV6_MULTICAST_IF", + "IPV6_MULTICAST_LOOP", + "IPV6_NEXTHOP", + "IPV6_OPTIONS", + "IPV6_PATHMTU", + "IPV6_PIPEX", + "IPV6_PKTINFO", + "IPV6_PMTUDISC_DO", + "IPV6_PMTUDISC_DONT", + "IPV6_PMTUDISC_PROBE", + "IPV6_PMTUDISC_WANT", + "IPV6_PORTRANGE", + "IPV6_PORTRANGE_DEFAULT", + "IPV6_PORTRANGE_HIGH", + "IPV6_PORTRANGE_LOW", + "IPV6_PREFER_TEMPADDR", + "IPV6_RECVDSTOPTS", + "IPV6_RECVDSTPORT", + "IPV6_RECVERR", + "IPV6_RECVHOPLIMIT", + "IPV6_RECVHOPOPTS", + "IPV6_RECVPATHMTU", + "IPV6_RECVPKTINFO", + "IPV6_RECVRTHDR", + "IPV6_RECVTCLASS", + "IPV6_ROUTER_ALERT", + "IPV6_RTABLE", + "IPV6_RTHDR", + "IPV6_RTHDRDSTOPTS", + "IPV6_RTHDR_LOOSE", + "IPV6_RTHDR_STRICT", + "IPV6_RTHDR_TYPE_0", + "IPV6_RXDSTOPTS", + "IPV6_RXHOPOPTS", + "IPV6_SOCKOPT_RESERVED1", + "IPV6_TCLASS", + "IPV6_UNICAST_HOPS", + "IPV6_USE_MIN_MTU", + "IPV6_V6ONLY", + "IPV6_VERSION", + "IPV6_VERSION_MASK", + "IPV6_XFRM_POLICY", + "IP_ADD_MEMBERSHIP", + "IP_ADD_SOURCE_MEMBERSHIP", + "IP_AUTH_LEVEL", + "IP_BINDANY", + "IP_BLOCK_SOURCE", + "IP_BOUND_IF", + "IP_DEFAULT_MULTICAST_LOOP", + "IP_DEFAULT_MULTICAST_TTL", + "IP_DF", + "IP_DIVERTFL", + "IP_DONTFRAG", + "IP_DROP_MEMBERSHIP", + "IP_DROP_SOURCE_MEMBERSHIP", + "IP_DUMMYNET3", + "IP_DUMMYNET_CONFIGURE", + "IP_DUMMYNET_DEL", + "IP_DUMMYNET_FLUSH", + "IP_DUMMYNET_GET", + "IP_EF", + "IP_ERRORMTU", + "IP_ESP_NETWORK_LEVEL", + "IP_ESP_TRANS_LEVEL", + "IP_FAITH", + "IP_FREEBIND", + "IP_FW3", + "IP_FW_ADD", + "IP_FW_DEL", + "IP_FW_FLUSH", + "IP_FW_GET", + "IP_FW_NAT_CFG", + "IP_FW_NAT_DEL", + "IP_FW_NAT_GET_CONFIG", + "IP_FW_NAT_GET_LOG", + "IP_FW_RESETLOG", + "IP_FW_TABLE_ADD", + "IP_FW_TABLE_DEL", + "IP_FW_TABLE_FLUSH", + "IP_FW_TABLE_GETSIZE", + "IP_FW_TABLE_LIST", + "IP_FW_ZERO", + "IP_HDRINCL", + "IP_IPCOMP_LEVEL", + "IP_IPSECFLOWINFO", + "IP_IPSEC_LOCAL_AUTH", + "IP_IPSEC_LOCAL_CRED", + "IP_IPSEC_LOCAL_ID", + "IP_IPSEC_POLICY", + "IP_IPSEC_REMOTE_AUTH", + "IP_IPSEC_REMOTE_CRED", + "IP_IPSEC_REMOTE_ID", + "IP_MAXPACKET", + "IP_MAX_GROUP_SRC_FILTER", + "IP_MAX_MEMBERSHIPS", + "IP_MAX_SOCK_MUTE_FILTER", + "IP_MAX_SOCK_SRC_FILTER", + "IP_MAX_SOURCE_FILTER", + "IP_MF", + "IP_MINFRAGSIZE", + "IP_MINTTL", + "IP_MIN_MEMBERSHIPS", + "IP_MSFILTER", + "IP_MSS", + "IP_MTU", + "IP_MTU_DISCOVER", + "IP_MULTICAST_IF", + "IP_MULTICAST_IFINDEX", + "IP_MULTICAST_LOOP", + "IP_MULTICAST_TTL", + "IP_MULTICAST_VIF", + "IP_NAT__XXX", + "IP_OFFMASK", + "IP_OLD_FW_ADD", + "IP_OLD_FW_DEL", + "IP_OLD_FW_FLUSH", + "IP_OLD_FW_GET", + "IP_OLD_FW_RESETLOG", + "IP_OLD_FW_ZERO", + "IP_ONESBCAST", + "IP_OPTIONS", + "IP_ORIGDSTADDR", + "IP_PASSSEC", + "IP_PIPEX", + "IP_PKTINFO", + "IP_PKTOPTIONS", + "IP_PMTUDISC", + "IP_PMTUDISC_DO", + "IP_PMTUDISC_DONT", + "IP_PMTUDISC_PROBE", + "IP_PMTUDISC_WANT", + "IP_PORTRANGE", + "IP_PORTRANGE_DEFAULT", + "IP_PORTRANGE_HIGH", + "IP_PORTRANGE_LOW", + "IP_RECVDSTADDR", + "IP_RECVDSTPORT", + "IP_RECVERR", + "IP_RECVIF", + "IP_RECVOPTS", + "IP_RECVORIGDSTADDR", + "IP_RECVPKTINFO", + "IP_RECVRETOPTS", + "IP_RECVRTABLE", + "IP_RECVTOS", + "IP_RECVTTL", + "IP_RETOPTS", + "IP_RF", + "IP_ROUTER_ALERT", + "IP_RSVP_OFF", + "IP_RSVP_ON", + "IP_RSVP_VIF_OFF", + "IP_RSVP_VIF_ON", + "IP_RTABLE", + "IP_SENDSRCADDR", + "IP_STRIPHDR", + "IP_TOS", + "IP_TRAFFIC_MGT_BACKGROUND", + "IP_TRANSPARENT", + "IP_TTL", + "IP_UNBLOCK_SOURCE", + "IP_XFRM_POLICY", + "IPv6MTUInfo", + "IPv6Mreq", + "ISIG", + "ISTRIP", + "IUCLC", + "IUTF8", + "IXANY", + "IXOFF", + "IXON", + "IfAddrmsg", + "IfAnnounceMsghdr", + "IfData", + "IfInfomsg", + "IfMsghdr", + "IfaMsghdr", + "IfmaMsghdr", + "IfmaMsghdr2", + "ImplementsGetwd", + "Inet4Pktinfo", + "Inet6Pktinfo", + "InotifyAddWatch", + "InotifyEvent", + "InotifyInit", + "InotifyInit1", + "InotifyRmWatch", + "InterfaceAddrMessage", + "InterfaceAnnounceMessage", + "InterfaceInfo", + "InterfaceMessage", + "InterfaceMulticastAddrMessage", + "InvalidHandle", + "Ioperm", + "Iopl", + "Iovec", + "IpAdapterInfo", + "IpAddrString", + "IpAddressString", + "IpMaskString", + "Issetugid", + "KEY_ALL_ACCESS", + "KEY_CREATE_LINK", + "KEY_CREATE_SUB_KEY", + "KEY_ENUMERATE_SUB_KEYS", + "KEY_EXECUTE", + "KEY_NOTIFY", + "KEY_QUERY_VALUE", + "KEY_READ", + "KEY_SET_VALUE", + "KEY_WOW64_32KEY", + "KEY_WOW64_64KEY", + "KEY_WRITE", + "Kevent", + "Kevent_t", + "Kill", + "Klogctl", + "Kqueue", + "LANG_ENGLISH", + "LAYERED_PROTOCOL", + "LCNT_OVERLOAD_FLUSH", + "LINUX_REBOOT_CMD_CAD_OFF", + "LINUX_REBOOT_CMD_CAD_ON", + "LINUX_REBOOT_CMD_HALT", + "LINUX_REBOOT_CMD_KEXEC", + "LINUX_REBOOT_CMD_POWER_OFF", + "LINUX_REBOOT_CMD_RESTART", + "LINUX_REBOOT_CMD_RESTART2", + "LINUX_REBOOT_CMD_SW_SUSPEND", + "LINUX_REBOOT_MAGIC1", + "LINUX_REBOOT_MAGIC2", + "LOCK_EX", + "LOCK_NB", + "LOCK_SH", + "LOCK_UN", + "LazyDLL", + "LazyProc", + "Lchown", + "Linger", + "Link", + "Listen", + "Listxattr", + "LoadCancelIoEx", + "LoadConnectEx", + "LoadCreateSymbolicLink", + "LoadDLL", + "LoadGetAddrInfo", + "LoadLibrary", + "LoadSetFileCompletionNotificationModes", + "LocalFree", + "Log2phys_t", + "LookupAccountName", + "LookupAccountSid", + "LookupSID", + "LsfJump", + "LsfSocket", + "LsfStmt", + "Lstat", + "MADV_AUTOSYNC", + "MADV_CAN_REUSE", + "MADV_CORE", + "MADV_DOFORK", + "MADV_DONTFORK", + "MADV_DONTNEED", + "MADV_FREE", + "MADV_FREE_REUSABLE", + "MADV_FREE_REUSE", + "MADV_HUGEPAGE", + "MADV_HWPOISON", + "MADV_MERGEABLE", + "MADV_NOCORE", + "MADV_NOHUGEPAGE", + "MADV_NORMAL", + "MADV_NOSYNC", + "MADV_PROTECT", + "MADV_RANDOM", + "MADV_REMOVE", + "MADV_SEQUENTIAL", + "MADV_SPACEAVAIL", + "MADV_UNMERGEABLE", + "MADV_WILLNEED", + "MADV_ZERO_WIRED_PAGES", + "MAP_32BIT", + "MAP_ALIGNED_SUPER", + "MAP_ALIGNMENT_16MB", + "MAP_ALIGNMENT_1TB", + "MAP_ALIGNMENT_256TB", + "MAP_ALIGNMENT_4GB", + "MAP_ALIGNMENT_64KB", + "MAP_ALIGNMENT_64PB", + "MAP_ALIGNMENT_MASK", + "MAP_ALIGNMENT_SHIFT", + "MAP_ANON", + "MAP_ANONYMOUS", + "MAP_COPY", + "MAP_DENYWRITE", + "MAP_EXECUTABLE", + "MAP_FILE", + "MAP_FIXED", + "MAP_FLAGMASK", + "MAP_GROWSDOWN", + "MAP_HASSEMAPHORE", + "MAP_HUGETLB", + "MAP_INHERIT", + "MAP_INHERIT_COPY", + "MAP_INHERIT_DEFAULT", + "MAP_INHERIT_DONATE_COPY", + "MAP_INHERIT_NONE", + "MAP_INHERIT_SHARE", + "MAP_JIT", + "MAP_LOCKED", + "MAP_NOCACHE", + "MAP_NOCORE", + "MAP_NOEXTEND", + "MAP_NONBLOCK", + "MAP_NORESERVE", + "MAP_NOSYNC", + "MAP_POPULATE", + "MAP_PREFAULT_READ", + "MAP_PRIVATE", + "MAP_RENAME", + "MAP_RESERVED0080", + "MAP_RESERVED0100", + "MAP_SHARED", + "MAP_STACK", + "MAP_TRYFIXED", + "MAP_TYPE", + "MAP_WIRED", + "MAXIMUM_REPARSE_DATA_BUFFER_SIZE", + "MAXLEN_IFDESCR", + "MAXLEN_PHYSADDR", + "MAX_ADAPTER_ADDRESS_LENGTH", + "MAX_ADAPTER_DESCRIPTION_LENGTH", + "MAX_ADAPTER_NAME_LENGTH", + "MAX_COMPUTERNAME_LENGTH", + "MAX_INTERFACE_NAME_LEN", + "MAX_LONG_PATH", + "MAX_PATH", + "MAX_PROTOCOL_CHAIN", + "MCL_CURRENT", + "MCL_FUTURE", + "MNT_DETACH", + "MNT_EXPIRE", + "MNT_FORCE", + "MSG_BCAST", + "MSG_CMSG_CLOEXEC", + "MSG_COMPAT", + "MSG_CONFIRM", + "MSG_CONTROLMBUF", + "MSG_CTRUNC", + "MSG_DONTROUTE", + "MSG_DONTWAIT", + "MSG_EOF", + "MSG_EOR", + "MSG_ERRQUEUE", + "MSG_FASTOPEN", + "MSG_FIN", + "MSG_FLUSH", + "MSG_HAVEMORE", + "MSG_HOLD", + "MSG_IOVUSRSPACE", + "MSG_LENUSRSPACE", + "MSG_MCAST", + "MSG_MORE", + "MSG_NAMEMBUF", + "MSG_NBIO", + "MSG_NEEDSA", + "MSG_NOSIGNAL", + "MSG_NOTIFICATION", + "MSG_OOB", + "MSG_PEEK", + "MSG_PROXY", + "MSG_RCVMORE", + "MSG_RST", + "MSG_SEND", + "MSG_SYN", + "MSG_TRUNC", + "MSG_TRYHARD", + "MSG_USERFLAGS", + "MSG_WAITALL", + "MSG_WAITFORONE", + "MSG_WAITSTREAM", + "MS_ACTIVE", + "MS_ASYNC", + "MS_BIND", + "MS_DEACTIVATE", + "MS_DIRSYNC", + "MS_INVALIDATE", + "MS_I_VERSION", + "MS_KERNMOUNT", + "MS_KILLPAGES", + "MS_MANDLOCK", + "MS_MGC_MSK", + "MS_MGC_VAL", + "MS_MOVE", + "MS_NOATIME", + "MS_NODEV", + "MS_NODIRATIME", + "MS_NOEXEC", + "MS_NOSUID", + "MS_NOUSER", + "MS_POSIXACL", + "MS_PRIVATE", + "MS_RDONLY", + "MS_REC", + "MS_RELATIME", + "MS_REMOUNT", + "MS_RMT_MASK", + "MS_SHARED", + "MS_SILENT", + "MS_SLAVE", + "MS_STRICTATIME", + "MS_SYNC", + "MS_SYNCHRONOUS", + "MS_UNBINDABLE", + "Madvise", + "MapViewOfFile", + "MaxTokenInfoClass", + "Mclpool", + "MibIfRow", + "Mkdir", + "Mkdirat", + "Mkfifo", + "Mknod", + "Mknodat", + "Mlock", + "Mlockall", + "Mmap", + "Mount", + "MoveFile", + "Mprotect", + "Msghdr", + "Munlock", + "Munlockall", + "Munmap", + "MustLoadDLL", + "NAME_MAX", + "NETLINK_ADD_MEMBERSHIP", + "NETLINK_AUDIT", + "NETLINK_BROADCAST_ERROR", + "NETLINK_CONNECTOR", + "NETLINK_DNRTMSG", + "NETLINK_DROP_MEMBERSHIP", + "NETLINK_ECRYPTFS", + "NETLINK_FIB_LOOKUP", + "NETLINK_FIREWALL", + "NETLINK_GENERIC", + "NETLINK_INET_DIAG", + "NETLINK_IP6_FW", + "NETLINK_ISCSI", + "NETLINK_KOBJECT_UEVENT", + "NETLINK_NETFILTER", + "NETLINK_NFLOG", + "NETLINK_NO_ENOBUFS", + "NETLINK_PKTINFO", + "NETLINK_RDMA", + "NETLINK_ROUTE", + "NETLINK_SCSITRANSPORT", + "NETLINK_SELINUX", + "NETLINK_UNUSED", + "NETLINK_USERSOCK", + "NETLINK_XFRM", + "NET_RT_DUMP", + "NET_RT_DUMP2", + "NET_RT_FLAGS", + "NET_RT_IFLIST", + "NET_RT_IFLIST2", + "NET_RT_IFLISTL", + "NET_RT_IFMALIST", + "NET_RT_MAXID", + "NET_RT_OIFLIST", + "NET_RT_OOIFLIST", + "NET_RT_STAT", + "NET_RT_STATS", + "NET_RT_TABLE", + "NET_RT_TRASH", + "NLA_ALIGNTO", + "NLA_F_NESTED", + "NLA_F_NET_BYTEORDER", + "NLA_HDRLEN", + "NLMSG_ALIGNTO", + "NLMSG_DONE", + "NLMSG_ERROR", + "NLMSG_HDRLEN", + "NLMSG_MIN_TYPE", + "NLMSG_NOOP", + "NLMSG_OVERRUN", + "NLM_F_ACK", + "NLM_F_APPEND", + "NLM_F_ATOMIC", + "NLM_F_CREATE", + "NLM_F_DUMP", + "NLM_F_ECHO", + "NLM_F_EXCL", + "NLM_F_MATCH", + "NLM_F_MULTI", + "NLM_F_REPLACE", + "NLM_F_REQUEST", + "NLM_F_ROOT", + "NOFLSH", + "NOTE_ABSOLUTE", + "NOTE_ATTRIB", + "NOTE_CHILD", + "NOTE_DELETE", + "NOTE_EOF", + "NOTE_EXEC", + "NOTE_EXIT", + "NOTE_EXITSTATUS", + "NOTE_EXTEND", + "NOTE_FFAND", + "NOTE_FFCOPY", + "NOTE_FFCTRLMASK", + "NOTE_FFLAGSMASK", + "NOTE_FFNOP", + "NOTE_FFOR", + "NOTE_FORK", + "NOTE_LINK", + "NOTE_LOWAT", + "NOTE_NONE", + "NOTE_NSECONDS", + "NOTE_PCTRLMASK", + "NOTE_PDATAMASK", + "NOTE_REAP", + "NOTE_RENAME", + "NOTE_RESOURCEEND", + "NOTE_REVOKE", + "NOTE_SECONDS", + "NOTE_SIGNAL", + "NOTE_TRACK", + "NOTE_TRACKERR", + "NOTE_TRIGGER", + "NOTE_TRUNCATE", + "NOTE_USECONDS", + "NOTE_VM_ERROR", + "NOTE_VM_PRESSURE", + "NOTE_VM_PRESSURE_SUDDEN_TERMINATE", + "NOTE_VM_PRESSURE_TERMINATE", + "NOTE_WRITE", + "NameCanonical", + "NameCanonicalEx", + "NameDisplay", + "NameDnsDomain", + "NameFullyQualifiedDN", + "NameSamCompatible", + "NameServicePrincipal", + "NameUniqueId", + "NameUnknown", + "NameUserPrincipal", + "Nanosleep", + "NetApiBufferFree", + "NetGetJoinInformation", + "NetSetupDomainName", + "NetSetupUnjoined", + "NetSetupUnknownStatus", + "NetSetupWorkgroupName", + "NetUserGetInfo", + "NetlinkMessage", + "NetlinkRIB", + "NetlinkRouteAttr", + "NetlinkRouteRequest", + "NewCallback", + "NewCallbackCDecl", + "NewLazyDLL", + "NlAttr", + "NlMsgerr", + "NlMsghdr", + "NsecToFiletime", + "NsecToTimespec", + "NsecToTimeval", + "Ntohs", + "OCRNL", + "OFDEL", + "OFILL", + "OFIOGETBMAP", + "OID_PKIX_KP_SERVER_AUTH", + "OID_SERVER_GATED_CRYPTO", + "OID_SGC_NETSCAPE", + "OLCUC", + "ONLCR", + "ONLRET", + "ONOCR", + "ONOEOT", + "OPEN_ALWAYS", + "OPEN_EXISTING", + "OPOST", + "O_ACCMODE", + "O_ALERT", + "O_ALT_IO", + "O_APPEND", + "O_ASYNC", + "O_CLOEXEC", + "O_CREAT", + "O_DIRECT", + "O_DIRECTORY", + "O_DSYNC", + "O_EVTONLY", + "O_EXCL", + "O_EXEC", + "O_EXLOCK", + "O_FSYNC", + "O_LARGEFILE", + "O_NDELAY", + "O_NOATIME", + "O_NOCTTY", + "O_NOFOLLOW", + "O_NONBLOCK", + "O_NOSIGPIPE", + "O_POPUP", + "O_RDONLY", + "O_RDWR", + "O_RSYNC", + "O_SHLOCK", + "O_SYMLINK", + "O_SYNC", + "O_TRUNC", + "O_TTY_INIT", + "O_WRONLY", + "Open", + "OpenCurrentProcessToken", + "OpenProcess", + "OpenProcessToken", + "Openat", + "Overlapped", + "PACKET_ADD_MEMBERSHIP", + "PACKET_BROADCAST", + "PACKET_DROP_MEMBERSHIP", + "PACKET_FASTROUTE", + "PACKET_HOST", + "PACKET_LOOPBACK", + "PACKET_MR_ALLMULTI", + "PACKET_MR_MULTICAST", + "PACKET_MR_PROMISC", + "PACKET_MULTICAST", + "PACKET_OTHERHOST", + "PACKET_OUTGOING", + "PACKET_RECV_OUTPUT", + "PACKET_RX_RING", + "PACKET_STATISTICS", + "PAGE_EXECUTE_READ", + "PAGE_EXECUTE_READWRITE", + "PAGE_EXECUTE_WRITECOPY", + "PAGE_READONLY", + "PAGE_READWRITE", + "PAGE_WRITECOPY", + "PARENB", + "PARMRK", + "PARODD", + "PENDIN", + "PFL_HIDDEN", + "PFL_MATCHES_PROTOCOL_ZERO", + "PFL_MULTIPLE_PROTO_ENTRIES", + "PFL_NETWORKDIRECT_PROVIDER", + "PFL_RECOMMENDED_PROTO_ENTRY", + "PF_FLUSH", + "PKCS_7_ASN_ENCODING", + "PMC5_PIPELINE_FLUSH", + "PRIO_PGRP", + "PRIO_PROCESS", + "PRIO_USER", + "PRI_IOFLUSH", + "PROCESS_QUERY_INFORMATION", + "PROCESS_TERMINATE", + "PROT_EXEC", + "PROT_GROWSDOWN", + "PROT_GROWSUP", + "PROT_NONE", + "PROT_READ", + "PROT_WRITE", + "PROV_DH_SCHANNEL", + "PROV_DSS", + "PROV_DSS_DH", + "PROV_EC_ECDSA_FULL", + "PROV_EC_ECDSA_SIG", + "PROV_EC_ECNRA_FULL", + "PROV_EC_ECNRA_SIG", + "PROV_FORTEZZA", + "PROV_INTEL_SEC", + "PROV_MS_EXCHANGE", + "PROV_REPLACE_OWF", + "PROV_RNG", + "PROV_RSA_AES", + "PROV_RSA_FULL", + "PROV_RSA_SCHANNEL", + "PROV_RSA_SIG", + "PROV_SPYRUS_LYNKS", + "PROV_SSL", + "PR_CAPBSET_DROP", + "PR_CAPBSET_READ", + "PR_CLEAR_SECCOMP_FILTER", + "PR_ENDIAN_BIG", + "PR_ENDIAN_LITTLE", + "PR_ENDIAN_PPC_LITTLE", + "PR_FPEMU_NOPRINT", + "PR_FPEMU_SIGFPE", + "PR_FP_EXC_ASYNC", + "PR_FP_EXC_DISABLED", + "PR_FP_EXC_DIV", + "PR_FP_EXC_INV", + "PR_FP_EXC_NONRECOV", + "PR_FP_EXC_OVF", + "PR_FP_EXC_PRECISE", + "PR_FP_EXC_RES", + "PR_FP_EXC_SW_ENABLE", + "PR_FP_EXC_UND", + "PR_GET_DUMPABLE", + "PR_GET_ENDIAN", + "PR_GET_FPEMU", + "PR_GET_FPEXC", + "PR_GET_KEEPCAPS", + "PR_GET_NAME", + "PR_GET_PDEATHSIG", + "PR_GET_SECCOMP", + "PR_GET_SECCOMP_FILTER", + "PR_GET_SECUREBITS", + "PR_GET_TIMERSLACK", + "PR_GET_TIMING", + "PR_GET_TSC", + "PR_GET_UNALIGN", + "PR_MCE_KILL", + "PR_MCE_KILL_CLEAR", + "PR_MCE_KILL_DEFAULT", + "PR_MCE_KILL_EARLY", + "PR_MCE_KILL_GET", + "PR_MCE_KILL_LATE", + "PR_MCE_KILL_SET", + "PR_SECCOMP_FILTER_EVENT", + "PR_SECCOMP_FILTER_SYSCALL", + "PR_SET_DUMPABLE", + "PR_SET_ENDIAN", + "PR_SET_FPEMU", + "PR_SET_FPEXC", + "PR_SET_KEEPCAPS", + "PR_SET_NAME", + "PR_SET_PDEATHSIG", + "PR_SET_PTRACER", + "PR_SET_SECCOMP", + "PR_SET_SECCOMP_FILTER", + "PR_SET_SECUREBITS", + "PR_SET_TIMERSLACK", + "PR_SET_TIMING", + "PR_SET_TSC", + "PR_SET_UNALIGN", + "PR_TASK_PERF_EVENTS_DISABLE", + "PR_TASK_PERF_EVENTS_ENABLE", + "PR_TIMING_STATISTICAL", + "PR_TIMING_TIMESTAMP", + "PR_TSC_ENABLE", + "PR_TSC_SIGSEGV", + "PR_UNALIGN_NOPRINT", + "PR_UNALIGN_SIGBUS", + "PTRACE_ARCH_PRCTL", + "PTRACE_ATTACH", + "PTRACE_CONT", + "PTRACE_DETACH", + "PTRACE_EVENT_CLONE", + "PTRACE_EVENT_EXEC", + "PTRACE_EVENT_EXIT", + "PTRACE_EVENT_FORK", + "PTRACE_EVENT_VFORK", + "PTRACE_EVENT_VFORK_DONE", + "PTRACE_GETCRUNCHREGS", + "PTRACE_GETEVENTMSG", + "PTRACE_GETFPREGS", + "PTRACE_GETFPXREGS", + "PTRACE_GETHBPREGS", + "PTRACE_GETREGS", + "PTRACE_GETREGSET", + "PTRACE_GETSIGINFO", + "PTRACE_GETVFPREGS", + "PTRACE_GETWMMXREGS", + "PTRACE_GET_THREAD_AREA", + "PTRACE_KILL", + "PTRACE_OLDSETOPTIONS", + "PTRACE_O_MASK", + "PTRACE_O_TRACECLONE", + "PTRACE_O_TRACEEXEC", + "PTRACE_O_TRACEEXIT", + "PTRACE_O_TRACEFORK", + "PTRACE_O_TRACESYSGOOD", + "PTRACE_O_TRACEVFORK", + "PTRACE_O_TRACEVFORKDONE", + "PTRACE_PEEKDATA", + "PTRACE_PEEKTEXT", + "PTRACE_PEEKUSR", + "PTRACE_POKEDATA", + "PTRACE_POKETEXT", + "PTRACE_POKEUSR", + "PTRACE_SETCRUNCHREGS", + "PTRACE_SETFPREGS", + "PTRACE_SETFPXREGS", + "PTRACE_SETHBPREGS", + "PTRACE_SETOPTIONS", + "PTRACE_SETREGS", + "PTRACE_SETREGSET", + "PTRACE_SETSIGINFO", + "PTRACE_SETVFPREGS", + "PTRACE_SETWMMXREGS", + "PTRACE_SET_SYSCALL", + "PTRACE_SET_THREAD_AREA", + "PTRACE_SINGLEBLOCK", + "PTRACE_SINGLESTEP", + "PTRACE_SYSCALL", + "PTRACE_SYSEMU", + "PTRACE_SYSEMU_SINGLESTEP", + "PTRACE_TRACEME", + "PT_ATTACH", + "PT_ATTACHEXC", + "PT_CONTINUE", + "PT_DATA_ADDR", + "PT_DENY_ATTACH", + "PT_DETACH", + "PT_FIRSTMACH", + "PT_FORCEQUOTA", + "PT_KILL", + "PT_MASK", + "PT_READ_D", + "PT_READ_I", + "PT_READ_U", + "PT_SIGEXC", + "PT_STEP", + "PT_TEXT_ADDR", + "PT_TEXT_END_ADDR", + "PT_THUPDATE", + "PT_TRACE_ME", + "PT_WRITE_D", + "PT_WRITE_I", + "PT_WRITE_U", + "ParseDirent", + "ParseNetlinkMessage", + "ParseNetlinkRouteAttr", + "ParseRoutingMessage", + "ParseRoutingSockaddr", + "ParseSocketControlMessage", + "ParseUnixCredentials", + "ParseUnixRights", + "PathMax", + "Pathconf", + "Pause", + "Pipe", + "Pipe2", + "PivotRoot", + "Pointer", + "PostQueuedCompletionStatus", + "Pread", + "Proc", + "ProcAttr", + "Process32First", + "Process32Next", + "ProcessEntry32", + "ProcessInformation", + "Protoent", + "PtraceAttach", + "PtraceCont", + "PtraceDetach", + "PtraceGetEventMsg", + "PtraceGetRegs", + "PtracePeekData", + "PtracePeekText", + "PtracePokeData", + "PtracePokeText", + "PtraceRegs", + "PtraceSetOptions", + "PtraceSetRegs", + "PtraceSingleStep", + "PtraceSyscall", + "Pwrite", + "REG_BINARY", + "REG_DWORD", + "REG_DWORD_BIG_ENDIAN", + "REG_DWORD_LITTLE_ENDIAN", + "REG_EXPAND_SZ", + "REG_FULL_RESOURCE_DESCRIPTOR", + "REG_LINK", + "REG_MULTI_SZ", + "REG_NONE", + "REG_QWORD", + "REG_QWORD_LITTLE_ENDIAN", + "REG_RESOURCE_LIST", + "REG_RESOURCE_REQUIREMENTS_LIST", + "REG_SZ", + "RLIMIT_AS", + "RLIMIT_CORE", + "RLIMIT_CPU", + "RLIMIT_DATA", + "RLIMIT_FSIZE", + "RLIMIT_NOFILE", + "RLIMIT_STACK", + "RLIM_INFINITY", + "RTAX_ADVMSS", + "RTAX_AUTHOR", + "RTAX_BRD", + "RTAX_CWND", + "RTAX_DST", + "RTAX_FEATURES", + "RTAX_FEATURE_ALLFRAG", + "RTAX_FEATURE_ECN", + "RTAX_FEATURE_SACK", + "RTAX_FEATURE_TIMESTAMP", + "RTAX_GATEWAY", + "RTAX_GENMASK", + "RTAX_HOPLIMIT", + "RTAX_IFA", + "RTAX_IFP", + "RTAX_INITCWND", + "RTAX_INITRWND", + "RTAX_LABEL", + "RTAX_LOCK", + "RTAX_MAX", + "RTAX_MTU", + "RTAX_NETMASK", + "RTAX_REORDERING", + "RTAX_RTO_MIN", + "RTAX_RTT", + "RTAX_RTTVAR", + "RTAX_SRC", + "RTAX_SRCMASK", + "RTAX_SSTHRESH", + "RTAX_TAG", + "RTAX_UNSPEC", + "RTAX_WINDOW", + "RTA_ALIGNTO", + "RTA_AUTHOR", + "RTA_BRD", + "RTA_CACHEINFO", + "RTA_DST", + "RTA_FLOW", + "RTA_GATEWAY", + "RTA_GENMASK", + "RTA_IFA", + "RTA_IFP", + "RTA_IIF", + "RTA_LABEL", + "RTA_MAX", + "RTA_METRICS", + "RTA_MULTIPATH", + "RTA_NETMASK", + "RTA_OIF", + "RTA_PREFSRC", + "RTA_PRIORITY", + "RTA_SRC", + "RTA_SRCMASK", + "RTA_TABLE", + "RTA_TAG", + "RTA_UNSPEC", + "RTCF_DIRECTSRC", + "RTCF_DOREDIRECT", + "RTCF_LOG", + "RTCF_MASQ", + "RTCF_NAT", + "RTCF_VALVE", + "RTF_ADDRCLASSMASK", + "RTF_ADDRCONF", + "RTF_ALLONLINK", + "RTF_ANNOUNCE", + "RTF_BLACKHOLE", + "RTF_BROADCAST", + "RTF_CACHE", + "RTF_CLONED", + "RTF_CLONING", + "RTF_CONDEMNED", + "RTF_DEFAULT", + "RTF_DELCLONE", + "RTF_DONE", + "RTF_DYNAMIC", + "RTF_FLOW", + "RTF_FMASK", + "RTF_GATEWAY", + "RTF_GWFLAG_COMPAT", + "RTF_HOST", + "RTF_IFREF", + "RTF_IFSCOPE", + "RTF_INTERFACE", + "RTF_IRTT", + "RTF_LINKRT", + "RTF_LLDATA", + "RTF_LLINFO", + "RTF_LOCAL", + "RTF_MASK", + "RTF_MODIFIED", + "RTF_MPATH", + "RTF_MPLS", + "RTF_MSS", + "RTF_MTU", + "RTF_MULTICAST", + "RTF_NAT", + "RTF_NOFORWARD", + "RTF_NONEXTHOP", + "RTF_NOPMTUDISC", + "RTF_PERMANENT_ARP", + "RTF_PINNED", + "RTF_POLICY", + "RTF_PRCLONING", + "RTF_PROTO1", + "RTF_PROTO2", + "RTF_PROTO3", + "RTF_REINSTATE", + "RTF_REJECT", + "RTF_RNH_LOCKED", + "RTF_SOURCE", + "RTF_SRC", + "RTF_STATIC", + "RTF_STICKY", + "RTF_THROW", + "RTF_TUNNEL", + "RTF_UP", + "RTF_USETRAILERS", + "RTF_WASCLONED", + "RTF_WINDOW", + "RTF_XRESOLVE", + "RTM_ADD", + "RTM_BASE", + "RTM_CHANGE", + "RTM_CHGADDR", + "RTM_DELACTION", + "RTM_DELADDR", + "RTM_DELADDRLABEL", + "RTM_DELETE", + "RTM_DELLINK", + "RTM_DELMADDR", + "RTM_DELNEIGH", + "RTM_DELQDISC", + "RTM_DELROUTE", + "RTM_DELRULE", + "RTM_DELTCLASS", + "RTM_DELTFILTER", + "RTM_DESYNC", + "RTM_F_CLONED", + "RTM_F_EQUALIZE", + "RTM_F_NOTIFY", + "RTM_F_PREFIX", + "RTM_GET", + "RTM_GET2", + "RTM_GETACTION", + "RTM_GETADDR", + "RTM_GETADDRLABEL", + "RTM_GETANYCAST", + "RTM_GETDCB", + "RTM_GETLINK", + "RTM_GETMULTICAST", + "RTM_GETNEIGH", + "RTM_GETNEIGHTBL", + "RTM_GETQDISC", + "RTM_GETROUTE", + "RTM_GETRULE", + "RTM_GETTCLASS", + "RTM_GETTFILTER", + "RTM_IEEE80211", + "RTM_IFANNOUNCE", + "RTM_IFINFO", + "RTM_IFINFO2", + "RTM_LLINFO_UPD", + "RTM_LOCK", + "RTM_LOSING", + "RTM_MAX", + "RTM_MAXSIZE", + "RTM_MISS", + "RTM_NEWACTION", + "RTM_NEWADDR", + "RTM_NEWADDRLABEL", + "RTM_NEWLINK", + "RTM_NEWMADDR", + "RTM_NEWMADDR2", + "RTM_NEWNDUSEROPT", + "RTM_NEWNEIGH", + "RTM_NEWNEIGHTBL", + "RTM_NEWPREFIX", + "RTM_NEWQDISC", + "RTM_NEWROUTE", + "RTM_NEWRULE", + "RTM_NEWTCLASS", + "RTM_NEWTFILTER", + "RTM_NR_FAMILIES", + "RTM_NR_MSGTYPES", + "RTM_OIFINFO", + "RTM_OLDADD", + "RTM_OLDDEL", + "RTM_OOIFINFO", + "RTM_REDIRECT", + "RTM_RESOLVE", + "RTM_RTTUNIT", + "RTM_SETDCB", + "RTM_SETGATE", + "RTM_SETLINK", + "RTM_SETNEIGHTBL", + "RTM_VERSION", + "RTNH_ALIGNTO", + "RTNH_F_DEAD", + "RTNH_F_ONLINK", + "RTNH_F_PERVASIVE", + "RTNLGRP_IPV4_IFADDR", + "RTNLGRP_IPV4_MROUTE", + "RTNLGRP_IPV4_ROUTE", + "RTNLGRP_IPV4_RULE", + "RTNLGRP_IPV6_IFADDR", + "RTNLGRP_IPV6_IFINFO", + "RTNLGRP_IPV6_MROUTE", + "RTNLGRP_IPV6_PREFIX", + "RTNLGRP_IPV6_ROUTE", + "RTNLGRP_IPV6_RULE", + "RTNLGRP_LINK", + "RTNLGRP_ND_USEROPT", + "RTNLGRP_NEIGH", + "RTNLGRP_NONE", + "RTNLGRP_NOTIFY", + "RTNLGRP_TC", + "RTN_ANYCAST", + "RTN_BLACKHOLE", + "RTN_BROADCAST", + "RTN_LOCAL", + "RTN_MAX", + "RTN_MULTICAST", + "RTN_NAT", + "RTN_PROHIBIT", + "RTN_THROW", + "RTN_UNICAST", + "RTN_UNREACHABLE", + "RTN_UNSPEC", + "RTN_XRESOLVE", + "RTPROT_BIRD", + "RTPROT_BOOT", + "RTPROT_DHCP", + "RTPROT_DNROUTED", + "RTPROT_GATED", + "RTPROT_KERNEL", + "RTPROT_MRT", + "RTPROT_NTK", + "RTPROT_RA", + "RTPROT_REDIRECT", + "RTPROT_STATIC", + "RTPROT_UNSPEC", + "RTPROT_XORP", + "RTPROT_ZEBRA", + "RTV_EXPIRE", + "RTV_HOPCOUNT", + "RTV_MTU", + "RTV_RPIPE", + "RTV_RTT", + "RTV_RTTVAR", + "RTV_SPIPE", + "RTV_SSTHRESH", + "RTV_WEIGHT", + "RT_CACHING_CONTEXT", + "RT_CLASS_DEFAULT", + "RT_CLASS_LOCAL", + "RT_CLASS_MAIN", + "RT_CLASS_MAX", + "RT_CLASS_UNSPEC", + "RT_DEFAULT_FIB", + "RT_NORTREF", + "RT_SCOPE_HOST", + "RT_SCOPE_LINK", + "RT_SCOPE_NOWHERE", + "RT_SCOPE_SITE", + "RT_SCOPE_UNIVERSE", + "RT_TABLEID_MAX", + "RT_TABLE_COMPAT", + "RT_TABLE_DEFAULT", + "RT_TABLE_LOCAL", + "RT_TABLE_MAIN", + "RT_TABLE_MAX", + "RT_TABLE_UNSPEC", + "RUSAGE_CHILDREN", + "RUSAGE_SELF", + "RUSAGE_THREAD", + "Radvisory_t", + "RawConn", + "RawSockaddr", + "RawSockaddrAny", + "RawSockaddrDatalink", + "RawSockaddrInet4", + "RawSockaddrInet6", + "RawSockaddrLinklayer", + "RawSockaddrNetlink", + "RawSockaddrUnix", + "RawSyscall", + "RawSyscall6", + "Read", + "ReadConsole", + "ReadDirectoryChanges", + "ReadDirent", + "ReadFile", + "Readlink", + "Reboot", + "Recvfrom", + "Recvmsg", + "RegCloseKey", + "RegEnumKeyEx", + "RegOpenKeyEx", + "RegQueryInfoKey", + "RegQueryValueEx", + "RemoveDirectory", + "Removexattr", + "Rename", + "Renameat", + "Revoke", + "Rlimit", + "Rmdir", + "RouteMessage", + "RouteRIB", + "RoutingMessage", + "RtAttr", + "RtGenmsg", + "RtMetrics", + "RtMsg", + "RtMsghdr", + "RtNexthop", + "Rusage", + "SCM_BINTIME", + "SCM_CREDENTIALS", + "SCM_CREDS", + "SCM_RIGHTS", + "SCM_TIMESTAMP", + "SCM_TIMESTAMPING", + "SCM_TIMESTAMPNS", + "SCM_TIMESTAMP_MONOTONIC", + "SHUT_RD", + "SHUT_RDWR", + "SHUT_WR", + "SID", + "SIDAndAttributes", + "SIGABRT", + "SIGALRM", + "SIGBUS", + "SIGCHLD", + "SIGCLD", + "SIGCONT", + "SIGEMT", + "SIGFPE", + "SIGHUP", + "SIGILL", + "SIGINFO", + "SIGINT", + "SIGIO", + "SIGIOT", + "SIGKILL", + "SIGLIBRT", + "SIGLWP", + "SIGPIPE", + "SIGPOLL", + "SIGPROF", + "SIGPWR", + "SIGQUIT", + "SIGSEGV", + "SIGSTKFLT", + "SIGSTOP", + "SIGSYS", + "SIGTERM", + "SIGTHR", + "SIGTRAP", + "SIGTSTP", + "SIGTTIN", + "SIGTTOU", + "SIGUNUSED", + "SIGURG", + "SIGUSR1", + "SIGUSR2", + "SIGVTALRM", + "SIGWINCH", + "SIGXCPU", + "SIGXFSZ", + "SIOCADDDLCI", + "SIOCADDMULTI", + "SIOCADDRT", + "SIOCAIFADDR", + "SIOCAIFGROUP", + "SIOCALIFADDR", + "SIOCARPIPLL", + "SIOCATMARK", + "SIOCAUTOADDR", + "SIOCAUTONETMASK", + "SIOCBRDGADD", + "SIOCBRDGADDS", + "SIOCBRDGARL", + "SIOCBRDGDADDR", + "SIOCBRDGDEL", + "SIOCBRDGDELS", + "SIOCBRDGFLUSH", + "SIOCBRDGFRL", + "SIOCBRDGGCACHE", + "SIOCBRDGGFD", + "SIOCBRDGGHT", + "SIOCBRDGGIFFLGS", + "SIOCBRDGGMA", + "SIOCBRDGGPARAM", + "SIOCBRDGGPRI", + "SIOCBRDGGRL", + "SIOCBRDGGSIFS", + "SIOCBRDGGTO", + "SIOCBRDGIFS", + "SIOCBRDGRTS", + "SIOCBRDGSADDR", + "SIOCBRDGSCACHE", + "SIOCBRDGSFD", + "SIOCBRDGSHT", + "SIOCBRDGSIFCOST", + "SIOCBRDGSIFFLGS", + "SIOCBRDGSIFPRIO", + "SIOCBRDGSMA", + "SIOCBRDGSPRI", + "SIOCBRDGSPROTO", + "SIOCBRDGSTO", + "SIOCBRDGSTXHC", + "SIOCDARP", + "SIOCDELDLCI", + "SIOCDELMULTI", + "SIOCDELRT", + "SIOCDEVPRIVATE", + "SIOCDIFADDR", + "SIOCDIFGROUP", + "SIOCDIFPHYADDR", + "SIOCDLIFADDR", + "SIOCDRARP", + "SIOCGARP", + "SIOCGDRVSPEC", + "SIOCGETKALIVE", + "SIOCGETLABEL", + "SIOCGETPFLOW", + "SIOCGETPFSYNC", + "SIOCGETSGCNT", + "SIOCGETVIFCNT", + "SIOCGETVLAN", + "SIOCGHIWAT", + "SIOCGIFADDR", + "SIOCGIFADDRPREF", + "SIOCGIFALIAS", + "SIOCGIFALTMTU", + "SIOCGIFASYNCMAP", + "SIOCGIFBOND", + "SIOCGIFBR", + "SIOCGIFBRDADDR", + "SIOCGIFCAP", + "SIOCGIFCONF", + "SIOCGIFCOUNT", + "SIOCGIFDATA", + "SIOCGIFDESCR", + "SIOCGIFDEVMTU", + "SIOCGIFDLT", + "SIOCGIFDSTADDR", + "SIOCGIFENCAP", + "SIOCGIFFIB", + "SIOCGIFFLAGS", + "SIOCGIFGATTR", + "SIOCGIFGENERIC", + "SIOCGIFGMEMB", + "SIOCGIFGROUP", + "SIOCGIFHARDMTU", + "SIOCGIFHWADDR", + "SIOCGIFINDEX", + "SIOCGIFKPI", + "SIOCGIFMAC", + "SIOCGIFMAP", + "SIOCGIFMEDIA", + "SIOCGIFMEM", + "SIOCGIFMETRIC", + "SIOCGIFMTU", + "SIOCGIFNAME", + "SIOCGIFNETMASK", + "SIOCGIFPDSTADDR", + "SIOCGIFPFLAGS", + "SIOCGIFPHYS", + "SIOCGIFPRIORITY", + "SIOCGIFPSRCADDR", + "SIOCGIFRDOMAIN", + "SIOCGIFRTLABEL", + "SIOCGIFSLAVE", + "SIOCGIFSTATUS", + "SIOCGIFTIMESLOT", + "SIOCGIFTXQLEN", + "SIOCGIFVLAN", + "SIOCGIFWAKEFLAGS", + "SIOCGIFXFLAGS", + "SIOCGLIFADDR", + "SIOCGLIFPHYADDR", + "SIOCGLIFPHYRTABLE", + "SIOCGLIFPHYTTL", + "SIOCGLINKSTR", + "SIOCGLOWAT", + "SIOCGPGRP", + "SIOCGPRIVATE_0", + "SIOCGPRIVATE_1", + "SIOCGRARP", + "SIOCGSPPPPARAMS", + "SIOCGSTAMP", + "SIOCGSTAMPNS", + "SIOCGVH", + "SIOCGVNETID", + "SIOCIFCREATE", + "SIOCIFCREATE2", + "SIOCIFDESTROY", + "SIOCIFGCLONERS", + "SIOCINITIFADDR", + "SIOCPROTOPRIVATE", + "SIOCRSLVMULTI", + "SIOCRTMSG", + "SIOCSARP", + "SIOCSDRVSPEC", + "SIOCSETKALIVE", + "SIOCSETLABEL", + "SIOCSETPFLOW", + "SIOCSETPFSYNC", + "SIOCSETVLAN", + "SIOCSHIWAT", + "SIOCSIFADDR", + "SIOCSIFADDRPREF", + "SIOCSIFALTMTU", + "SIOCSIFASYNCMAP", + "SIOCSIFBOND", + "SIOCSIFBR", + "SIOCSIFBRDADDR", + "SIOCSIFCAP", + "SIOCSIFDESCR", + "SIOCSIFDSTADDR", + "SIOCSIFENCAP", + "SIOCSIFFIB", + "SIOCSIFFLAGS", + "SIOCSIFGATTR", + "SIOCSIFGENERIC", + "SIOCSIFHWADDR", + "SIOCSIFHWBROADCAST", + "SIOCSIFKPI", + "SIOCSIFLINK", + "SIOCSIFLLADDR", + "SIOCSIFMAC", + "SIOCSIFMAP", + "SIOCSIFMEDIA", + "SIOCSIFMEM", + "SIOCSIFMETRIC", + "SIOCSIFMTU", + "SIOCSIFNAME", + "SIOCSIFNETMASK", + "SIOCSIFPFLAGS", + "SIOCSIFPHYADDR", + "SIOCSIFPHYS", + "SIOCSIFPRIORITY", + "SIOCSIFRDOMAIN", + "SIOCSIFRTLABEL", + "SIOCSIFRVNET", + "SIOCSIFSLAVE", + "SIOCSIFTIMESLOT", + "SIOCSIFTXQLEN", + "SIOCSIFVLAN", + "SIOCSIFVNET", + "SIOCSIFXFLAGS", + "SIOCSLIFPHYADDR", + "SIOCSLIFPHYRTABLE", + "SIOCSLIFPHYTTL", + "SIOCSLINKSTR", + "SIOCSLOWAT", + "SIOCSPGRP", + "SIOCSRARP", + "SIOCSSPPPPARAMS", + "SIOCSVH", + "SIOCSVNETID", + "SIOCZIFDATA", + "SIO_GET_EXTENSION_FUNCTION_POINTER", + "SIO_GET_INTERFACE_LIST", + "SIO_KEEPALIVE_VALS", + "SIO_UDP_CONNRESET", + "SOCK_CLOEXEC", + "SOCK_DCCP", + "SOCK_DGRAM", + "SOCK_FLAGS_MASK", + "SOCK_MAXADDRLEN", + "SOCK_NONBLOCK", + "SOCK_NOSIGPIPE", + "SOCK_PACKET", + "SOCK_RAW", + "SOCK_RDM", + "SOCK_SEQPACKET", + "SOCK_STREAM", + "SOL_AAL", + "SOL_ATM", + "SOL_DECNET", + "SOL_ICMPV6", + "SOL_IP", + "SOL_IPV6", + "SOL_IRDA", + "SOL_PACKET", + "SOL_RAW", + "SOL_SOCKET", + "SOL_TCP", + "SOL_X25", + "SOMAXCONN", + "SO_ACCEPTCONN", + "SO_ACCEPTFILTER", + "SO_ATTACH_FILTER", + "SO_BINDANY", + "SO_BINDTODEVICE", + "SO_BINTIME", + "SO_BROADCAST", + "SO_BSDCOMPAT", + "SO_DEBUG", + "SO_DETACH_FILTER", + "SO_DOMAIN", + "SO_DONTROUTE", + "SO_DONTTRUNC", + "SO_ERROR", + "SO_KEEPALIVE", + "SO_LABEL", + "SO_LINGER", + "SO_LINGER_SEC", + "SO_LISTENINCQLEN", + "SO_LISTENQLEN", + "SO_LISTENQLIMIT", + "SO_MARK", + "SO_NETPROC", + "SO_NKE", + "SO_NOADDRERR", + "SO_NOHEADER", + "SO_NOSIGPIPE", + "SO_NOTIFYCONFLICT", + "SO_NO_CHECK", + "SO_NO_DDP", + "SO_NO_OFFLOAD", + "SO_NP_EXTENSIONS", + "SO_NREAD", + "SO_NWRITE", + "SO_OOBINLINE", + "SO_OVERFLOWED", + "SO_PASSCRED", + "SO_PASSSEC", + "SO_PEERCRED", + "SO_PEERLABEL", + "SO_PEERNAME", + "SO_PEERSEC", + "SO_PRIORITY", + "SO_PROTOCOL", + "SO_PROTOTYPE", + "SO_RANDOMPORT", + "SO_RCVBUF", + "SO_RCVBUFFORCE", + "SO_RCVLOWAT", + "SO_RCVTIMEO", + "SO_RESTRICTIONS", + "SO_RESTRICT_DENYIN", + "SO_RESTRICT_DENYOUT", + "SO_RESTRICT_DENYSET", + "SO_REUSEADDR", + "SO_REUSEPORT", + "SO_REUSESHAREUID", + "SO_RTABLE", + "SO_RXQ_OVFL", + "SO_SECURITY_AUTHENTICATION", + "SO_SECURITY_ENCRYPTION_NETWORK", + "SO_SECURITY_ENCRYPTION_TRANSPORT", + "SO_SETFIB", + "SO_SNDBUF", + "SO_SNDBUFFORCE", + "SO_SNDLOWAT", + "SO_SNDTIMEO", + "SO_SPLICE", + "SO_TIMESTAMP", + "SO_TIMESTAMPING", + "SO_TIMESTAMPNS", + "SO_TIMESTAMP_MONOTONIC", + "SO_TYPE", + "SO_UPCALLCLOSEWAIT", + "SO_UPDATE_ACCEPT_CONTEXT", + "SO_UPDATE_CONNECT_CONTEXT", + "SO_USELOOPBACK", + "SO_USER_COOKIE", + "SO_VENDOR", + "SO_WANTMORE", + "SO_WANTOOBFLAG", + "SSLExtraCertChainPolicyPara", + "STANDARD_RIGHTS_ALL", + "STANDARD_RIGHTS_EXECUTE", + "STANDARD_RIGHTS_READ", + "STANDARD_RIGHTS_REQUIRED", + "STANDARD_RIGHTS_WRITE", + "STARTF_USESHOWWINDOW", + "STARTF_USESTDHANDLES", + "STD_ERROR_HANDLE", + "STD_INPUT_HANDLE", + "STD_OUTPUT_HANDLE", + "SUBLANG_ENGLISH_US", + "SW_FORCEMINIMIZE", + "SW_HIDE", + "SW_MAXIMIZE", + "SW_MINIMIZE", + "SW_NORMAL", + "SW_RESTORE", + "SW_SHOW", + "SW_SHOWDEFAULT", + "SW_SHOWMAXIMIZED", + "SW_SHOWMINIMIZED", + "SW_SHOWMINNOACTIVE", + "SW_SHOWNA", + "SW_SHOWNOACTIVATE", + "SW_SHOWNORMAL", + "SYMBOLIC_LINK_FLAG_DIRECTORY", + "SYNCHRONIZE", + "SYSCTL_VERSION", + "SYSCTL_VERS_0", + "SYSCTL_VERS_1", + "SYSCTL_VERS_MASK", + "SYS_ABORT2", + "SYS_ACCEPT", + "SYS_ACCEPT4", + "SYS_ACCEPT_NOCANCEL", + "SYS_ACCESS", + "SYS_ACCESS_EXTENDED", + "SYS_ACCT", + "SYS_ADD_KEY", + "SYS_ADD_PROFIL", + "SYS_ADJFREQ", + "SYS_ADJTIME", + "SYS_ADJTIMEX", + "SYS_AFS_SYSCALL", + "SYS_AIO_CANCEL", + "SYS_AIO_ERROR", + "SYS_AIO_FSYNC", + "SYS_AIO_READ", + "SYS_AIO_RETURN", + "SYS_AIO_SUSPEND", + "SYS_AIO_SUSPEND_NOCANCEL", + "SYS_AIO_WRITE", + "SYS_ALARM", + "SYS_ARCH_PRCTL", + "SYS_ARM_FADVISE64_64", + "SYS_ARM_SYNC_FILE_RANGE", + "SYS_ATGETMSG", + "SYS_ATPGETREQ", + "SYS_ATPGETRSP", + "SYS_ATPSNDREQ", + "SYS_ATPSNDRSP", + "SYS_ATPUTMSG", + "SYS_ATSOCKET", + "SYS_AUDIT", + "SYS_AUDITCTL", + "SYS_AUDITON", + "SYS_AUDIT_SESSION_JOIN", + "SYS_AUDIT_SESSION_PORT", + "SYS_AUDIT_SESSION_SELF", + "SYS_BDFLUSH", + "SYS_BIND", + "SYS_BINDAT", + "SYS_BREAK", + "SYS_BRK", + "SYS_BSDTHREAD_CREATE", + "SYS_BSDTHREAD_REGISTER", + "SYS_BSDTHREAD_TERMINATE", + "SYS_CAPGET", + "SYS_CAPSET", + "SYS_CAP_ENTER", + "SYS_CAP_FCNTLS_GET", + "SYS_CAP_FCNTLS_LIMIT", + "SYS_CAP_GETMODE", + "SYS_CAP_GETRIGHTS", + "SYS_CAP_IOCTLS_GET", + "SYS_CAP_IOCTLS_LIMIT", + "SYS_CAP_NEW", + "SYS_CAP_RIGHTS_GET", + "SYS_CAP_RIGHTS_LIMIT", + "SYS_CHDIR", + "SYS_CHFLAGS", + "SYS_CHFLAGSAT", + "SYS_CHMOD", + "SYS_CHMOD_EXTENDED", + "SYS_CHOWN", + "SYS_CHOWN32", + "SYS_CHROOT", + "SYS_CHUD", + "SYS_CLOCK_ADJTIME", + "SYS_CLOCK_GETCPUCLOCKID2", + "SYS_CLOCK_GETRES", + "SYS_CLOCK_GETTIME", + "SYS_CLOCK_NANOSLEEP", + "SYS_CLOCK_SETTIME", + "SYS_CLONE", + "SYS_CLOSE", + "SYS_CLOSEFROM", + "SYS_CLOSE_NOCANCEL", + "SYS_CONNECT", + "SYS_CONNECTAT", + "SYS_CONNECT_NOCANCEL", + "SYS_COPYFILE", + "SYS_CPUSET", + "SYS_CPUSET_GETAFFINITY", + "SYS_CPUSET_GETID", + "SYS_CPUSET_SETAFFINITY", + "SYS_CPUSET_SETID", + "SYS_CREAT", + "SYS_CREATE_MODULE", + "SYS_CSOPS", + "SYS_DELETE", + "SYS_DELETE_MODULE", + "SYS_DUP", + "SYS_DUP2", + "SYS_DUP3", + "SYS_EACCESS", + "SYS_EPOLL_CREATE", + "SYS_EPOLL_CREATE1", + "SYS_EPOLL_CTL", + "SYS_EPOLL_CTL_OLD", + "SYS_EPOLL_PWAIT", + "SYS_EPOLL_WAIT", + "SYS_EPOLL_WAIT_OLD", + "SYS_EVENTFD", + "SYS_EVENTFD2", + "SYS_EXCHANGEDATA", + "SYS_EXECVE", + "SYS_EXIT", + "SYS_EXIT_GROUP", + "SYS_EXTATTRCTL", + "SYS_EXTATTR_DELETE_FD", + "SYS_EXTATTR_DELETE_FILE", + "SYS_EXTATTR_DELETE_LINK", + "SYS_EXTATTR_GET_FD", + "SYS_EXTATTR_GET_FILE", + "SYS_EXTATTR_GET_LINK", + "SYS_EXTATTR_LIST_FD", + "SYS_EXTATTR_LIST_FILE", + "SYS_EXTATTR_LIST_LINK", + "SYS_EXTATTR_SET_FD", + "SYS_EXTATTR_SET_FILE", + "SYS_EXTATTR_SET_LINK", + "SYS_FACCESSAT", + "SYS_FADVISE64", + "SYS_FADVISE64_64", + "SYS_FALLOCATE", + "SYS_FANOTIFY_INIT", + "SYS_FANOTIFY_MARK", + "SYS_FCHDIR", + "SYS_FCHFLAGS", + "SYS_FCHMOD", + "SYS_FCHMODAT", + "SYS_FCHMOD_EXTENDED", + "SYS_FCHOWN", + "SYS_FCHOWN32", + "SYS_FCHOWNAT", + "SYS_FCHROOT", + "SYS_FCNTL", + "SYS_FCNTL64", + "SYS_FCNTL_NOCANCEL", + "SYS_FDATASYNC", + "SYS_FEXECVE", + "SYS_FFCLOCK_GETCOUNTER", + "SYS_FFCLOCK_GETESTIMATE", + "SYS_FFCLOCK_SETESTIMATE", + "SYS_FFSCTL", + "SYS_FGETATTRLIST", + "SYS_FGETXATTR", + "SYS_FHOPEN", + "SYS_FHSTAT", + "SYS_FHSTATFS", + "SYS_FILEPORT_MAKEFD", + "SYS_FILEPORT_MAKEPORT", + "SYS_FKTRACE", + "SYS_FLISTXATTR", + "SYS_FLOCK", + "SYS_FORK", + "SYS_FPATHCONF", + "SYS_FREEBSD6_FTRUNCATE", + "SYS_FREEBSD6_LSEEK", + "SYS_FREEBSD6_MMAP", + "SYS_FREEBSD6_PREAD", + "SYS_FREEBSD6_PWRITE", + "SYS_FREEBSD6_TRUNCATE", + "SYS_FREMOVEXATTR", + "SYS_FSCTL", + "SYS_FSETATTRLIST", + "SYS_FSETXATTR", + "SYS_FSGETPATH", + "SYS_FSTAT", + "SYS_FSTAT64", + "SYS_FSTAT64_EXTENDED", + "SYS_FSTATAT", + "SYS_FSTATAT64", + "SYS_FSTATFS", + "SYS_FSTATFS64", + "SYS_FSTATV", + "SYS_FSTATVFS1", + "SYS_FSTAT_EXTENDED", + "SYS_FSYNC", + "SYS_FSYNC_NOCANCEL", + "SYS_FSYNC_RANGE", + "SYS_FTIME", + "SYS_FTRUNCATE", + "SYS_FTRUNCATE64", + "SYS_FUTEX", + "SYS_FUTIMENS", + "SYS_FUTIMES", + "SYS_FUTIMESAT", + "SYS_GETATTRLIST", + "SYS_GETAUDIT", + "SYS_GETAUDIT_ADDR", + "SYS_GETAUID", + "SYS_GETCONTEXT", + "SYS_GETCPU", + "SYS_GETCWD", + "SYS_GETDENTS", + "SYS_GETDENTS64", + "SYS_GETDIRENTRIES", + "SYS_GETDIRENTRIES64", + "SYS_GETDIRENTRIESATTR", + "SYS_GETDTABLECOUNT", + "SYS_GETDTABLESIZE", + "SYS_GETEGID", + "SYS_GETEGID32", + "SYS_GETEUID", + "SYS_GETEUID32", + "SYS_GETFH", + "SYS_GETFSSTAT", + "SYS_GETFSSTAT64", + "SYS_GETGID", + "SYS_GETGID32", + "SYS_GETGROUPS", + "SYS_GETGROUPS32", + "SYS_GETHOSTUUID", + "SYS_GETITIMER", + "SYS_GETLCID", + "SYS_GETLOGIN", + "SYS_GETLOGINCLASS", + "SYS_GETPEERNAME", + "SYS_GETPGID", + "SYS_GETPGRP", + "SYS_GETPID", + "SYS_GETPMSG", + "SYS_GETPPID", + "SYS_GETPRIORITY", + "SYS_GETRESGID", + "SYS_GETRESGID32", + "SYS_GETRESUID", + "SYS_GETRESUID32", + "SYS_GETRLIMIT", + "SYS_GETRTABLE", + "SYS_GETRUSAGE", + "SYS_GETSGROUPS", + "SYS_GETSID", + "SYS_GETSOCKNAME", + "SYS_GETSOCKOPT", + "SYS_GETTHRID", + "SYS_GETTID", + "SYS_GETTIMEOFDAY", + "SYS_GETUID", + "SYS_GETUID32", + "SYS_GETVFSSTAT", + "SYS_GETWGROUPS", + "SYS_GETXATTR", + "SYS_GET_KERNEL_SYMS", + "SYS_GET_MEMPOLICY", + "SYS_GET_ROBUST_LIST", + "SYS_GET_THREAD_AREA", + "SYS_GTTY", + "SYS_IDENTITYSVC", + "SYS_IDLE", + "SYS_INITGROUPS", + "SYS_INIT_MODULE", + "SYS_INOTIFY_ADD_WATCH", + "SYS_INOTIFY_INIT", + "SYS_INOTIFY_INIT1", + "SYS_INOTIFY_RM_WATCH", + "SYS_IOCTL", + "SYS_IOPERM", + "SYS_IOPL", + "SYS_IOPOLICYSYS", + "SYS_IOPRIO_GET", + "SYS_IOPRIO_SET", + "SYS_IO_CANCEL", + "SYS_IO_DESTROY", + "SYS_IO_GETEVENTS", + "SYS_IO_SETUP", + "SYS_IO_SUBMIT", + "SYS_IPC", + "SYS_ISSETUGID", + "SYS_JAIL", + "SYS_JAIL_ATTACH", + "SYS_JAIL_GET", + "SYS_JAIL_REMOVE", + "SYS_JAIL_SET", + "SYS_KDEBUG_TRACE", + "SYS_KENV", + "SYS_KEVENT", + "SYS_KEVENT64", + "SYS_KEXEC_LOAD", + "SYS_KEYCTL", + "SYS_KILL", + "SYS_KLDFIND", + "SYS_KLDFIRSTMOD", + "SYS_KLDLOAD", + "SYS_KLDNEXT", + "SYS_KLDSTAT", + "SYS_KLDSYM", + "SYS_KLDUNLOAD", + "SYS_KLDUNLOADF", + "SYS_KQUEUE", + "SYS_KQUEUE1", + "SYS_KTIMER_CREATE", + "SYS_KTIMER_DELETE", + "SYS_KTIMER_GETOVERRUN", + "SYS_KTIMER_GETTIME", + "SYS_KTIMER_SETTIME", + "SYS_KTRACE", + "SYS_LCHFLAGS", + "SYS_LCHMOD", + "SYS_LCHOWN", + "SYS_LCHOWN32", + "SYS_LGETFH", + "SYS_LGETXATTR", + "SYS_LINK", + "SYS_LINKAT", + "SYS_LIO_LISTIO", + "SYS_LISTEN", + "SYS_LISTXATTR", + "SYS_LLISTXATTR", + "SYS_LOCK", + "SYS_LOOKUP_DCOOKIE", + "SYS_LPATHCONF", + "SYS_LREMOVEXATTR", + "SYS_LSEEK", + "SYS_LSETXATTR", + "SYS_LSTAT", + "SYS_LSTAT64", + "SYS_LSTAT64_EXTENDED", + "SYS_LSTATV", + "SYS_LSTAT_EXTENDED", + "SYS_LUTIMES", + "SYS_MAC_SYSCALL", + "SYS_MADVISE", + "SYS_MADVISE1", + "SYS_MAXSYSCALL", + "SYS_MBIND", + "SYS_MIGRATE_PAGES", + "SYS_MINCORE", + "SYS_MINHERIT", + "SYS_MKCOMPLEX", + "SYS_MKDIR", + "SYS_MKDIRAT", + "SYS_MKDIR_EXTENDED", + "SYS_MKFIFO", + "SYS_MKFIFOAT", + "SYS_MKFIFO_EXTENDED", + "SYS_MKNOD", + "SYS_MKNODAT", + "SYS_MLOCK", + "SYS_MLOCKALL", + "SYS_MMAP", + "SYS_MMAP2", + "SYS_MODCTL", + "SYS_MODFIND", + "SYS_MODFNEXT", + "SYS_MODIFY_LDT", + "SYS_MODNEXT", + "SYS_MODSTAT", + "SYS_MODWATCH", + "SYS_MOUNT", + "SYS_MOVE_PAGES", + "SYS_MPROTECT", + "SYS_MPX", + "SYS_MQUERY", + "SYS_MQ_GETSETATTR", + "SYS_MQ_NOTIFY", + "SYS_MQ_OPEN", + "SYS_MQ_TIMEDRECEIVE", + "SYS_MQ_TIMEDSEND", + "SYS_MQ_UNLINK", + "SYS_MREMAP", + "SYS_MSGCTL", + "SYS_MSGGET", + "SYS_MSGRCV", + "SYS_MSGRCV_NOCANCEL", + "SYS_MSGSND", + "SYS_MSGSND_NOCANCEL", + "SYS_MSGSYS", + "SYS_MSYNC", + "SYS_MSYNC_NOCANCEL", + "SYS_MUNLOCK", + "SYS_MUNLOCKALL", + "SYS_MUNMAP", + "SYS_NAME_TO_HANDLE_AT", + "SYS_NANOSLEEP", + "SYS_NEWFSTATAT", + "SYS_NFSCLNT", + "SYS_NFSSERVCTL", + "SYS_NFSSVC", + "SYS_NFSTAT", + "SYS_NICE", + "SYS_NLSTAT", + "SYS_NMOUNT", + "SYS_NSTAT", + "SYS_NTP_ADJTIME", + "SYS_NTP_GETTIME", + "SYS_OABI_SYSCALL_BASE", + "SYS_OBREAK", + "SYS_OLDFSTAT", + "SYS_OLDLSTAT", + "SYS_OLDOLDUNAME", + "SYS_OLDSTAT", + "SYS_OLDUNAME", + "SYS_OPEN", + "SYS_OPENAT", + "SYS_OPENBSD_POLL", + "SYS_OPEN_BY_HANDLE_AT", + "SYS_OPEN_EXTENDED", + "SYS_OPEN_NOCANCEL", + "SYS_OVADVISE", + "SYS_PACCEPT", + "SYS_PATHCONF", + "SYS_PAUSE", + "SYS_PCICONFIG_IOBASE", + "SYS_PCICONFIG_READ", + "SYS_PCICONFIG_WRITE", + "SYS_PDFORK", + "SYS_PDGETPID", + "SYS_PDKILL", + "SYS_PERF_EVENT_OPEN", + "SYS_PERSONALITY", + "SYS_PID_HIBERNATE", + "SYS_PID_RESUME", + "SYS_PID_SHUTDOWN_SOCKETS", + "SYS_PID_SUSPEND", + "SYS_PIPE", + "SYS_PIPE2", + "SYS_PIVOT_ROOT", + "SYS_PMC_CONTROL", + "SYS_PMC_GET_INFO", + "SYS_POLL", + "SYS_POLLTS", + "SYS_POLL_NOCANCEL", + "SYS_POSIX_FADVISE", + "SYS_POSIX_FALLOCATE", + "SYS_POSIX_OPENPT", + "SYS_POSIX_SPAWN", + "SYS_PPOLL", + "SYS_PRCTL", + "SYS_PREAD", + "SYS_PREAD64", + "SYS_PREADV", + "SYS_PREAD_NOCANCEL", + "SYS_PRLIMIT64", + "SYS_PROCCTL", + "SYS_PROCESS_POLICY", + "SYS_PROCESS_VM_READV", + "SYS_PROCESS_VM_WRITEV", + "SYS_PROC_INFO", + "SYS_PROF", + "SYS_PROFIL", + "SYS_PSELECT", + "SYS_PSELECT6", + "SYS_PSET_ASSIGN", + "SYS_PSET_CREATE", + "SYS_PSET_DESTROY", + "SYS_PSYNCH_CVBROAD", + "SYS_PSYNCH_CVCLRPREPOST", + "SYS_PSYNCH_CVSIGNAL", + "SYS_PSYNCH_CVWAIT", + "SYS_PSYNCH_MUTEXDROP", + "SYS_PSYNCH_MUTEXWAIT", + "SYS_PSYNCH_RW_DOWNGRADE", + "SYS_PSYNCH_RW_LONGRDLOCK", + "SYS_PSYNCH_RW_RDLOCK", + "SYS_PSYNCH_RW_UNLOCK", + "SYS_PSYNCH_RW_UNLOCK2", + "SYS_PSYNCH_RW_UPGRADE", + "SYS_PSYNCH_RW_WRLOCK", + "SYS_PSYNCH_RW_YIELDWRLOCK", + "SYS_PTRACE", + "SYS_PUTPMSG", + "SYS_PWRITE", + "SYS_PWRITE64", + "SYS_PWRITEV", + "SYS_PWRITE_NOCANCEL", + "SYS_QUERY_MODULE", + "SYS_QUOTACTL", + "SYS_RASCTL", + "SYS_RCTL_ADD_RULE", + "SYS_RCTL_GET_LIMITS", + "SYS_RCTL_GET_RACCT", + "SYS_RCTL_GET_RULES", + "SYS_RCTL_REMOVE_RULE", + "SYS_READ", + "SYS_READAHEAD", + "SYS_READDIR", + "SYS_READLINK", + "SYS_READLINKAT", + "SYS_READV", + "SYS_READV_NOCANCEL", + "SYS_READ_NOCANCEL", + "SYS_REBOOT", + "SYS_RECV", + "SYS_RECVFROM", + "SYS_RECVFROM_NOCANCEL", + "SYS_RECVMMSG", + "SYS_RECVMSG", + "SYS_RECVMSG_NOCANCEL", + "SYS_REMAP_FILE_PAGES", + "SYS_REMOVEXATTR", + "SYS_RENAME", + "SYS_RENAMEAT", + "SYS_REQUEST_KEY", + "SYS_RESTART_SYSCALL", + "SYS_REVOKE", + "SYS_RFORK", + "SYS_RMDIR", + "SYS_RTPRIO", + "SYS_RTPRIO_THREAD", + "SYS_RT_SIGACTION", + "SYS_RT_SIGPENDING", + "SYS_RT_SIGPROCMASK", + "SYS_RT_SIGQUEUEINFO", + "SYS_RT_SIGRETURN", + "SYS_RT_SIGSUSPEND", + "SYS_RT_SIGTIMEDWAIT", + "SYS_RT_TGSIGQUEUEINFO", + "SYS_SBRK", + "SYS_SCHED_GETAFFINITY", + "SYS_SCHED_GETPARAM", + "SYS_SCHED_GETSCHEDULER", + "SYS_SCHED_GET_PRIORITY_MAX", + "SYS_SCHED_GET_PRIORITY_MIN", + "SYS_SCHED_RR_GET_INTERVAL", + "SYS_SCHED_SETAFFINITY", + "SYS_SCHED_SETPARAM", + "SYS_SCHED_SETSCHEDULER", + "SYS_SCHED_YIELD", + "SYS_SCTP_GENERIC_RECVMSG", + "SYS_SCTP_GENERIC_SENDMSG", + "SYS_SCTP_GENERIC_SENDMSG_IOV", + "SYS_SCTP_PEELOFF", + "SYS_SEARCHFS", + "SYS_SECURITY", + "SYS_SELECT", + "SYS_SELECT_NOCANCEL", + "SYS_SEMCONFIG", + "SYS_SEMCTL", + "SYS_SEMGET", + "SYS_SEMOP", + "SYS_SEMSYS", + "SYS_SEMTIMEDOP", + "SYS_SEM_CLOSE", + "SYS_SEM_DESTROY", + "SYS_SEM_GETVALUE", + "SYS_SEM_INIT", + "SYS_SEM_OPEN", + "SYS_SEM_POST", + "SYS_SEM_TRYWAIT", + "SYS_SEM_UNLINK", + "SYS_SEM_WAIT", + "SYS_SEM_WAIT_NOCANCEL", + "SYS_SEND", + "SYS_SENDFILE", + "SYS_SENDFILE64", + "SYS_SENDMMSG", + "SYS_SENDMSG", + "SYS_SENDMSG_NOCANCEL", + "SYS_SENDTO", + "SYS_SENDTO_NOCANCEL", + "SYS_SETATTRLIST", + "SYS_SETAUDIT", + "SYS_SETAUDIT_ADDR", + "SYS_SETAUID", + "SYS_SETCONTEXT", + "SYS_SETDOMAINNAME", + "SYS_SETEGID", + "SYS_SETEUID", + "SYS_SETFIB", + "SYS_SETFSGID", + "SYS_SETFSGID32", + "SYS_SETFSUID", + "SYS_SETFSUID32", + "SYS_SETGID", + "SYS_SETGID32", + "SYS_SETGROUPS", + "SYS_SETGROUPS32", + "SYS_SETHOSTNAME", + "SYS_SETITIMER", + "SYS_SETLCID", + "SYS_SETLOGIN", + "SYS_SETLOGINCLASS", + "SYS_SETNS", + "SYS_SETPGID", + "SYS_SETPRIORITY", + "SYS_SETPRIVEXEC", + "SYS_SETREGID", + "SYS_SETREGID32", + "SYS_SETRESGID", + "SYS_SETRESGID32", + "SYS_SETRESUID", + "SYS_SETRESUID32", + "SYS_SETREUID", + "SYS_SETREUID32", + "SYS_SETRLIMIT", + "SYS_SETRTABLE", + "SYS_SETSGROUPS", + "SYS_SETSID", + "SYS_SETSOCKOPT", + "SYS_SETTID", + "SYS_SETTID_WITH_PID", + "SYS_SETTIMEOFDAY", + "SYS_SETUID", + "SYS_SETUID32", + "SYS_SETWGROUPS", + "SYS_SETXATTR", + "SYS_SET_MEMPOLICY", + "SYS_SET_ROBUST_LIST", + "SYS_SET_THREAD_AREA", + "SYS_SET_TID_ADDRESS", + "SYS_SGETMASK", + "SYS_SHARED_REGION_CHECK_NP", + "SYS_SHARED_REGION_MAP_AND_SLIDE_NP", + "SYS_SHMAT", + "SYS_SHMCTL", + "SYS_SHMDT", + "SYS_SHMGET", + "SYS_SHMSYS", + "SYS_SHM_OPEN", + "SYS_SHM_UNLINK", + "SYS_SHUTDOWN", + "SYS_SIGACTION", + "SYS_SIGALTSTACK", + "SYS_SIGNAL", + "SYS_SIGNALFD", + "SYS_SIGNALFD4", + "SYS_SIGPENDING", + "SYS_SIGPROCMASK", + "SYS_SIGQUEUE", + "SYS_SIGQUEUEINFO", + "SYS_SIGRETURN", + "SYS_SIGSUSPEND", + "SYS_SIGSUSPEND_NOCANCEL", + "SYS_SIGTIMEDWAIT", + "SYS_SIGWAIT", + "SYS_SIGWAITINFO", + "SYS_SOCKET", + "SYS_SOCKETCALL", + "SYS_SOCKETPAIR", + "SYS_SPLICE", + "SYS_SSETMASK", + "SYS_SSTK", + "SYS_STACK_SNAPSHOT", + "SYS_STAT", + "SYS_STAT64", + "SYS_STAT64_EXTENDED", + "SYS_STATFS", + "SYS_STATFS64", + "SYS_STATV", + "SYS_STATVFS1", + "SYS_STAT_EXTENDED", + "SYS_STIME", + "SYS_STTY", + "SYS_SWAPCONTEXT", + "SYS_SWAPCTL", + "SYS_SWAPOFF", + "SYS_SWAPON", + "SYS_SYMLINK", + "SYS_SYMLINKAT", + "SYS_SYNC", + "SYS_SYNCFS", + "SYS_SYNC_FILE_RANGE", + "SYS_SYSARCH", + "SYS_SYSCALL", + "SYS_SYSCALL_BASE", + "SYS_SYSFS", + "SYS_SYSINFO", + "SYS_SYSLOG", + "SYS_TEE", + "SYS_TGKILL", + "SYS_THREAD_SELFID", + "SYS_THR_CREATE", + "SYS_THR_EXIT", + "SYS_THR_KILL", + "SYS_THR_KILL2", + "SYS_THR_NEW", + "SYS_THR_SELF", + "SYS_THR_SET_NAME", + "SYS_THR_SUSPEND", + "SYS_THR_WAKE", + "SYS_TIME", + "SYS_TIMERFD_CREATE", + "SYS_TIMERFD_GETTIME", + "SYS_TIMERFD_SETTIME", + "SYS_TIMER_CREATE", + "SYS_TIMER_DELETE", + "SYS_TIMER_GETOVERRUN", + "SYS_TIMER_GETTIME", + "SYS_TIMER_SETTIME", + "SYS_TIMES", + "SYS_TKILL", + "SYS_TRUNCATE", + "SYS_TRUNCATE64", + "SYS_TUXCALL", + "SYS_UGETRLIMIT", + "SYS_ULIMIT", + "SYS_UMASK", + "SYS_UMASK_EXTENDED", + "SYS_UMOUNT", + "SYS_UMOUNT2", + "SYS_UNAME", + "SYS_UNDELETE", + "SYS_UNLINK", + "SYS_UNLINKAT", + "SYS_UNMOUNT", + "SYS_UNSHARE", + "SYS_USELIB", + "SYS_USTAT", + "SYS_UTIME", + "SYS_UTIMENSAT", + "SYS_UTIMES", + "SYS_UTRACE", + "SYS_UUIDGEN", + "SYS_VADVISE", + "SYS_VFORK", + "SYS_VHANGUP", + "SYS_VM86", + "SYS_VM86OLD", + "SYS_VMSPLICE", + "SYS_VM_PRESSURE_MONITOR", + "SYS_VSERVER", + "SYS_WAIT4", + "SYS_WAIT4_NOCANCEL", + "SYS_WAIT6", + "SYS_WAITEVENT", + "SYS_WAITID", + "SYS_WAITID_NOCANCEL", + "SYS_WAITPID", + "SYS_WATCHEVENT", + "SYS_WORKQ_KERNRETURN", + "SYS_WORKQ_OPEN", + "SYS_WRITE", + "SYS_WRITEV", + "SYS_WRITEV_NOCANCEL", + "SYS_WRITE_NOCANCEL", + "SYS_YIELD", + "SYS__LLSEEK", + "SYS__LWP_CONTINUE", + "SYS__LWP_CREATE", + "SYS__LWP_CTL", + "SYS__LWP_DETACH", + "SYS__LWP_EXIT", + "SYS__LWP_GETNAME", + "SYS__LWP_GETPRIVATE", + "SYS__LWP_KILL", + "SYS__LWP_PARK", + "SYS__LWP_SELF", + "SYS__LWP_SETNAME", + "SYS__LWP_SETPRIVATE", + "SYS__LWP_SUSPEND", + "SYS__LWP_UNPARK", + "SYS__LWP_UNPARK_ALL", + "SYS__LWP_WAIT", + "SYS__LWP_WAKEUP", + "SYS__NEWSELECT", + "SYS__PSET_BIND", + "SYS__SCHED_GETAFFINITY", + "SYS__SCHED_GETPARAM", + "SYS__SCHED_SETAFFINITY", + "SYS__SCHED_SETPARAM", + "SYS__SYSCTL", + "SYS__UMTX_LOCK", + "SYS__UMTX_OP", + "SYS__UMTX_UNLOCK", + "SYS___ACL_ACLCHECK_FD", + "SYS___ACL_ACLCHECK_FILE", + "SYS___ACL_ACLCHECK_LINK", + "SYS___ACL_DELETE_FD", + "SYS___ACL_DELETE_FILE", + "SYS___ACL_DELETE_LINK", + "SYS___ACL_GET_FD", + "SYS___ACL_GET_FILE", + "SYS___ACL_GET_LINK", + "SYS___ACL_SET_FD", + "SYS___ACL_SET_FILE", + "SYS___ACL_SET_LINK", + "SYS___CLONE", + "SYS___DISABLE_THREADSIGNAL", + "SYS___GETCWD", + "SYS___GETLOGIN", + "SYS___GET_TCB", + "SYS___MAC_EXECVE", + "SYS___MAC_GETFSSTAT", + "SYS___MAC_GET_FD", + "SYS___MAC_GET_FILE", + "SYS___MAC_GET_LCID", + "SYS___MAC_GET_LCTX", + "SYS___MAC_GET_LINK", + "SYS___MAC_GET_MOUNT", + "SYS___MAC_GET_PID", + "SYS___MAC_GET_PROC", + "SYS___MAC_MOUNT", + "SYS___MAC_SET_FD", + "SYS___MAC_SET_FILE", + "SYS___MAC_SET_LCTX", + "SYS___MAC_SET_LINK", + "SYS___MAC_SET_PROC", + "SYS___MAC_SYSCALL", + "SYS___OLD_SEMWAIT_SIGNAL", + "SYS___OLD_SEMWAIT_SIGNAL_NOCANCEL", + "SYS___POSIX_CHOWN", + "SYS___POSIX_FCHOWN", + "SYS___POSIX_LCHOWN", + "SYS___POSIX_RENAME", + "SYS___PTHREAD_CANCELED", + "SYS___PTHREAD_CHDIR", + "SYS___PTHREAD_FCHDIR", + "SYS___PTHREAD_KILL", + "SYS___PTHREAD_MARKCANCEL", + "SYS___PTHREAD_SIGMASK", + "SYS___QUOTACTL", + "SYS___SEMCTL", + "SYS___SEMWAIT_SIGNAL", + "SYS___SEMWAIT_SIGNAL_NOCANCEL", + "SYS___SETLOGIN", + "SYS___SETUGID", + "SYS___SET_TCB", + "SYS___SIGACTION_SIGTRAMP", + "SYS___SIGTIMEDWAIT", + "SYS___SIGWAIT", + "SYS___SIGWAIT_NOCANCEL", + "SYS___SYSCTL", + "SYS___TFORK", + "SYS___THREXIT", + "SYS___THRSIGDIVERT", + "SYS___THRSLEEP", + "SYS___THRWAKEUP", + "S_ARCH1", + "S_ARCH2", + "S_BLKSIZE", + "S_IEXEC", + "S_IFBLK", + "S_IFCHR", + "S_IFDIR", + "S_IFIFO", + "S_IFLNK", + "S_IFMT", + "S_IFREG", + "S_IFSOCK", + "S_IFWHT", + "S_IREAD", + "S_IRGRP", + "S_IROTH", + "S_IRUSR", + "S_IRWXG", + "S_IRWXO", + "S_IRWXU", + "S_ISGID", + "S_ISTXT", + "S_ISUID", + "S_ISVTX", + "S_IWGRP", + "S_IWOTH", + "S_IWRITE", + "S_IWUSR", + "S_IXGRP", + "S_IXOTH", + "S_IXUSR", + "S_LOGIN_SET", + "SecurityAttributes", + "Seek", + "Select", + "Sendfile", + "Sendmsg", + "SendmsgN", + "Sendto", + "Servent", + "SetBpf", + "SetBpfBuflen", + "SetBpfDatalink", + "SetBpfHeadercmpl", + "SetBpfImmediate", + "SetBpfInterface", + "SetBpfPromisc", + "SetBpfTimeout", + "SetCurrentDirectory", + "SetEndOfFile", + "SetEnvironmentVariable", + "SetFileAttributes", + "SetFileCompletionNotificationModes", + "SetFilePointer", + "SetFileTime", + "SetHandleInformation", + "SetKevent", + "SetLsfPromisc", + "SetNonblock", + "Setdomainname", + "Setegid", + "Setenv", + "Seteuid", + "Setfsgid", + "Setfsuid", + "Setgid", + "Setgroups", + "Sethostname", + "Setlogin", + "Setpgid", + "Setpriority", + "Setprivexec", + "Setregid", + "Setresgid", + "Setresuid", + "Setreuid", + "Setrlimit", + "Setsid", + "Setsockopt", + "SetsockoptByte", + "SetsockoptICMPv6Filter", + "SetsockoptIPMreq", + "SetsockoptIPMreqn", + "SetsockoptIPv6Mreq", + "SetsockoptInet4Addr", + "SetsockoptInt", + "SetsockoptLinger", + "SetsockoptString", + "SetsockoptTimeval", + "Settimeofday", + "Setuid", + "Setxattr", + "Shutdown", + "SidTypeAlias", + "SidTypeComputer", + "SidTypeDeletedAccount", + "SidTypeDomain", + "SidTypeGroup", + "SidTypeInvalid", + "SidTypeLabel", + "SidTypeUnknown", + "SidTypeUser", + "SidTypeWellKnownGroup", + "Signal", + "SizeofBpfHdr", + "SizeofBpfInsn", + "SizeofBpfProgram", + "SizeofBpfStat", + "SizeofBpfVersion", + "SizeofBpfZbuf", + "SizeofBpfZbufHeader", + "SizeofCmsghdr", + "SizeofICMPv6Filter", + "SizeofIPMreq", + "SizeofIPMreqn", + "SizeofIPv6MTUInfo", + "SizeofIPv6Mreq", + "SizeofIfAddrmsg", + "SizeofIfAnnounceMsghdr", + "SizeofIfData", + "SizeofIfInfomsg", + "SizeofIfMsghdr", + "SizeofIfaMsghdr", + "SizeofIfmaMsghdr", + "SizeofIfmaMsghdr2", + "SizeofInet4Pktinfo", + "SizeofInet6Pktinfo", + "SizeofInotifyEvent", + "SizeofLinger", + "SizeofMsghdr", + "SizeofNlAttr", + "SizeofNlMsgerr", + "SizeofNlMsghdr", + "SizeofRtAttr", + "SizeofRtGenmsg", + "SizeofRtMetrics", + "SizeofRtMsg", + "SizeofRtMsghdr", + "SizeofRtNexthop", + "SizeofSockFilter", + "SizeofSockFprog", + "SizeofSockaddrAny", + "SizeofSockaddrDatalink", + "SizeofSockaddrInet4", + "SizeofSockaddrInet6", + "SizeofSockaddrLinklayer", + "SizeofSockaddrNetlink", + "SizeofSockaddrUnix", + "SizeofTCPInfo", + "SizeofUcred", + "SlicePtrFromStrings", + "SockFilter", + "SockFprog", + "Sockaddr", + "SockaddrDatalink", + "SockaddrGen", + "SockaddrInet4", + "SockaddrInet6", + "SockaddrLinklayer", + "SockaddrNetlink", + "SockaddrUnix", + "Socket", + "SocketControlMessage", + "SocketDisableIPv6", + "Socketpair", + "Splice", + "StartProcess", + "StartupInfo", + "Stat", + "Stat_t", + "Statfs", + "Statfs_t", + "Stderr", + "Stdin", + "Stdout", + "StringBytePtr", + "StringByteSlice", + "StringSlicePtr", + "StringToSid", + "StringToUTF16", + "StringToUTF16Ptr", + "Symlink", + "Sync", + "SyncFileRange", + "SysProcAttr", + "SysProcIDMap", + "Syscall", + "Syscall12", + "Syscall15", + "Syscall18", + "Syscall6", + "Syscall9", + "Sysctl", + "SysctlUint32", + "Sysctlnode", + "Sysinfo", + "Sysinfo_t", + "Systemtime", + "TCGETS", + "TCIFLUSH", + "TCIOFLUSH", + "TCOFLUSH", + "TCPInfo", + "TCPKeepalive", + "TCP_CA_NAME_MAX", + "TCP_CONGCTL", + "TCP_CONGESTION", + "TCP_CONNECTIONTIMEOUT", + "TCP_CORK", + "TCP_DEFER_ACCEPT", + "TCP_INFO", + "TCP_KEEPALIVE", + "TCP_KEEPCNT", + "TCP_KEEPIDLE", + "TCP_KEEPINIT", + "TCP_KEEPINTVL", + "TCP_LINGER2", + "TCP_MAXBURST", + "TCP_MAXHLEN", + "TCP_MAXOLEN", + "TCP_MAXSEG", + "TCP_MAXWIN", + "TCP_MAX_SACK", + "TCP_MAX_WINSHIFT", + "TCP_MD5SIG", + "TCP_MD5SIG_MAXKEYLEN", + "TCP_MINMSS", + "TCP_MINMSSOVERLOAD", + "TCP_MSS", + "TCP_NODELAY", + "TCP_NOOPT", + "TCP_NOPUSH", + "TCP_NSTATES", + "TCP_QUICKACK", + "TCP_RXT_CONNDROPTIME", + "TCP_RXT_FINDROP", + "TCP_SACK_ENABLE", + "TCP_SYNCNT", + "TCP_VENDOR", + "TCP_WINDOW_CLAMP", + "TCSAFLUSH", + "TCSETS", + "TF_DISCONNECT", + "TF_REUSE_SOCKET", + "TF_USE_DEFAULT_WORKER", + "TF_USE_KERNEL_APC", + "TF_USE_SYSTEM_THREAD", + "TF_WRITE_BEHIND", + "TH32CS_INHERIT", + "TH32CS_SNAPALL", + "TH32CS_SNAPHEAPLIST", + "TH32CS_SNAPMODULE", + "TH32CS_SNAPMODULE32", + "TH32CS_SNAPPROCESS", + "TH32CS_SNAPTHREAD", + "TIME_ZONE_ID_DAYLIGHT", + "TIME_ZONE_ID_STANDARD", + "TIME_ZONE_ID_UNKNOWN", + "TIOCCBRK", + "TIOCCDTR", + "TIOCCONS", + "TIOCDCDTIMESTAMP", + "TIOCDRAIN", + "TIOCDSIMICROCODE", + "TIOCEXCL", + "TIOCEXT", + "TIOCFLAG_CDTRCTS", + "TIOCFLAG_CLOCAL", + "TIOCFLAG_CRTSCTS", + "TIOCFLAG_MDMBUF", + "TIOCFLAG_PPS", + "TIOCFLAG_SOFTCAR", + "TIOCFLUSH", + "TIOCGDEV", + "TIOCGDRAINWAIT", + "TIOCGETA", + "TIOCGETD", + "TIOCGFLAGS", + "TIOCGICOUNT", + "TIOCGLCKTRMIOS", + "TIOCGLINED", + "TIOCGPGRP", + "TIOCGPTN", + "TIOCGQSIZE", + "TIOCGRANTPT", + "TIOCGRS485", + "TIOCGSERIAL", + "TIOCGSID", + "TIOCGSIZE", + "TIOCGSOFTCAR", + "TIOCGTSTAMP", + "TIOCGWINSZ", + "TIOCINQ", + "TIOCIXOFF", + "TIOCIXON", + "TIOCLINUX", + "TIOCMBIC", + "TIOCMBIS", + "TIOCMGDTRWAIT", + "TIOCMGET", + "TIOCMIWAIT", + "TIOCMODG", + "TIOCMODS", + "TIOCMSDTRWAIT", + "TIOCMSET", + "TIOCM_CAR", + "TIOCM_CD", + "TIOCM_CTS", + "TIOCM_DCD", + "TIOCM_DSR", + "TIOCM_DTR", + "TIOCM_LE", + "TIOCM_RI", + "TIOCM_RNG", + "TIOCM_RTS", + "TIOCM_SR", + "TIOCM_ST", + "TIOCNOTTY", + "TIOCNXCL", + "TIOCOUTQ", + "TIOCPKT", + "TIOCPKT_DATA", + "TIOCPKT_DOSTOP", + "TIOCPKT_FLUSHREAD", + "TIOCPKT_FLUSHWRITE", + "TIOCPKT_IOCTL", + "TIOCPKT_NOSTOP", + "TIOCPKT_START", + "TIOCPKT_STOP", + "TIOCPTMASTER", + "TIOCPTMGET", + "TIOCPTSNAME", + "TIOCPTYGNAME", + "TIOCPTYGRANT", + "TIOCPTYUNLK", + "TIOCRCVFRAME", + "TIOCREMOTE", + "TIOCSBRK", + "TIOCSCONS", + "TIOCSCTTY", + "TIOCSDRAINWAIT", + "TIOCSDTR", + "TIOCSERCONFIG", + "TIOCSERGETLSR", + "TIOCSERGETMULTI", + "TIOCSERGSTRUCT", + "TIOCSERGWILD", + "TIOCSERSETMULTI", + "TIOCSERSWILD", + "TIOCSER_TEMT", + "TIOCSETA", + "TIOCSETAF", + "TIOCSETAW", + "TIOCSETD", + "TIOCSFLAGS", + "TIOCSIG", + "TIOCSLCKTRMIOS", + "TIOCSLINED", + "TIOCSPGRP", + "TIOCSPTLCK", + "TIOCSQSIZE", + "TIOCSRS485", + "TIOCSSERIAL", + "TIOCSSIZE", + "TIOCSSOFTCAR", + "TIOCSTART", + "TIOCSTAT", + "TIOCSTI", + "TIOCSTOP", + "TIOCSTSTAMP", + "TIOCSWINSZ", + "TIOCTIMESTAMP", + "TIOCUCNTL", + "TIOCVHANGUP", + "TIOCXMTFRAME", + "TOKEN_ADJUST_DEFAULT", + "TOKEN_ADJUST_GROUPS", + "TOKEN_ADJUST_PRIVILEGES", + "TOKEN_ADJUST_SESSIONID", + "TOKEN_ALL_ACCESS", + "TOKEN_ASSIGN_PRIMARY", + "TOKEN_DUPLICATE", + "TOKEN_EXECUTE", + "TOKEN_IMPERSONATE", + "TOKEN_QUERY", + "TOKEN_QUERY_SOURCE", + "TOKEN_READ", + "TOKEN_WRITE", + "TOSTOP", + "TRUNCATE_EXISTING", + "TUNATTACHFILTER", + "TUNDETACHFILTER", + "TUNGETFEATURES", + "TUNGETIFF", + "TUNGETSNDBUF", + "TUNGETVNETHDRSZ", + "TUNSETDEBUG", + "TUNSETGROUP", + "TUNSETIFF", + "TUNSETLINK", + "TUNSETNOCSUM", + "TUNSETOFFLOAD", + "TUNSETOWNER", + "TUNSETPERSIST", + "TUNSETSNDBUF", + "TUNSETTXFILTER", + "TUNSETVNETHDRSZ", + "Tee", + "TerminateProcess", + "Termios", + "Tgkill", + "Time", + "Time_t", + "Times", + "Timespec", + "TimespecToNsec", + "Timeval", + "Timeval32", + "TimevalToNsec", + "Timex", + "Timezoneinformation", + "Tms", + "Token", + "TokenAccessInformation", + "TokenAuditPolicy", + "TokenDefaultDacl", + "TokenElevation", + "TokenElevationType", + "TokenGroups", + "TokenGroupsAndPrivileges", + "TokenHasRestrictions", + "TokenImpersonationLevel", + "TokenIntegrityLevel", + "TokenLinkedToken", + "TokenLogonSid", + "TokenMandatoryPolicy", + "TokenOrigin", + "TokenOwner", + "TokenPrimaryGroup", + "TokenPrivileges", + "TokenRestrictedSids", + "TokenSandBoxInert", + "TokenSessionId", + "TokenSessionReference", + "TokenSource", + "TokenStatistics", + "TokenType", + "TokenUIAccess", + "TokenUser", + "TokenVirtualizationAllowed", + "TokenVirtualizationEnabled", + "Tokenprimarygroup", + "Tokenuser", + "TranslateAccountName", + "TranslateName", + "TransmitFile", + "TransmitFileBuffers", + "Truncate", + "UNIX_PATH_MAX", + "USAGE_MATCH_TYPE_AND", + "USAGE_MATCH_TYPE_OR", + "UTF16FromString", + "UTF16PtrFromString", + "UTF16ToString", + "Ucred", + "Umask", + "Uname", + "Undelete", + "UnixCredentials", + "UnixRights", + "Unlink", + "Unlinkat", + "UnmapViewOfFile", + "Unmount", + "Unsetenv", + "Unshare", + "UserInfo10", + "Ustat", + "Ustat_t", + "Utimbuf", + "Utime", + "Utimes", + "UtimesNano", + "Utsname", + "VDISCARD", + "VDSUSP", + "VEOF", + "VEOL", + "VEOL2", + "VERASE", + "VERASE2", + "VINTR", + "VKILL", + "VLNEXT", + "VMIN", + "VQUIT", + "VREPRINT", + "VSTART", + "VSTATUS", + "VSTOP", + "VSUSP", + "VSWTC", + "VT0", + "VT1", + "VTDLY", + "VTIME", + "VWERASE", + "VirtualLock", + "VirtualUnlock", + "WAIT_ABANDONED", + "WAIT_FAILED", + "WAIT_OBJECT_0", + "WAIT_TIMEOUT", + "WALL", + "WALLSIG", + "WALTSIG", + "WCLONE", + "WCONTINUED", + "WCOREFLAG", + "WEXITED", + "WLINUXCLONE", + "WNOHANG", + "WNOTHREAD", + "WNOWAIT", + "WNOZOMBIE", + "WOPTSCHECKED", + "WORDSIZE", + "WSABuf", + "WSACleanup", + "WSADESCRIPTION_LEN", + "WSAData", + "WSAEACCES", + "WSAECONNABORTED", + "WSAECONNRESET", + "WSAEnumProtocols", + "WSAID_CONNECTEX", + "WSAIoctl", + "WSAPROTOCOL_LEN", + "WSAProtocolChain", + "WSAProtocolInfo", + "WSARecv", + "WSARecvFrom", + "WSASYS_STATUS_LEN", + "WSASend", + "WSASendTo", + "WSASendto", + "WSAStartup", + "WSTOPPED", + "WTRAPPED", + "WUNTRACED", + "Wait4", + "WaitForSingleObject", + "WaitStatus", + "Win32FileAttributeData", + "Win32finddata", + "Write", + "WriteConsole", + "WriteFile", + "X509_ASN_ENCODING", + "XCASE", + "XP1_CONNECTIONLESS", + "XP1_CONNECT_DATA", + "XP1_DISCONNECT_DATA", + "XP1_EXPEDITED_DATA", + "XP1_GRACEFUL_CLOSE", + "XP1_GUARANTEED_DELIVERY", + "XP1_GUARANTEED_ORDER", + "XP1_IFS_HANDLES", + "XP1_MESSAGE_ORIENTED", + "XP1_MULTIPOINT_CONTROL_PLANE", + "XP1_MULTIPOINT_DATA_PLANE", + "XP1_PARTIAL_MESSAGE", + "XP1_PSEUDO_STREAM", + "XP1_QOS_SUPPORTED", + "XP1_SAN_SUPPORT_SDP", + "XP1_SUPPORT_BROADCAST", + "XP1_SUPPORT_MULTIPOINT", + "XP1_UNI_RECV", + "XP1_UNI_SEND", + }, + "syscall/js": []string{ + "CopyBytesToGo", + "CopyBytesToJS", + "Error", + "Func", + "FuncOf", + "Global", + "Null", + "Type", + "TypeBoolean", + "TypeFunction", + "TypeNull", + "TypeNumber", + "TypeObject", + "TypeString", + "TypeSymbol", + "TypeUndefined", + "Undefined", + "Value", + "ValueError", + "ValueOf", + "Wrapper", + }, + "testing": []string{ + "AllocsPerRun", + "B", + "Benchmark", + "BenchmarkResult", + "Cover", + "CoverBlock", + "CoverMode", + "Coverage", + "Init", + "InternalBenchmark", + "InternalExample", + "InternalTest", + "M", + "Main", + "MainStart", + "PB", + "RegisterCover", + "RunBenchmarks", + "RunExamples", + "RunTests", + "Short", + "T", + "TB", + "Verbose", + }, + "testing/iotest": []string{ + "DataErrReader", + "ErrTimeout", + "HalfReader", + "NewReadLogger", + "NewWriteLogger", + "OneByteReader", + "TimeoutReader", + "TruncateWriter", + }, + "testing/quick": []string{ + "Check", + "CheckEqual", + "CheckEqualError", + "CheckError", + "Config", + "Generator", + "SetupError", + "Value", + }, + "text/scanner": []string{ + "Char", + "Comment", + "EOF", + "Float", + "GoTokens", + "GoWhitespace", + "Ident", + "Int", + "Position", + "RawString", + "ScanChars", + "ScanComments", + "ScanFloats", + "ScanIdents", + "ScanInts", + "ScanRawStrings", + "ScanStrings", + "Scanner", + "SkipComments", + "String", + "TokenString", + }, + "text/tabwriter": []string{ + "AlignRight", + "Debug", + "DiscardEmptyColumns", + "Escape", + "FilterHTML", + "NewWriter", + "StripEscape", + "TabIndent", + "Writer", + }, + "text/template": []string{ + "ExecError", + "FuncMap", + "HTMLEscape", + "HTMLEscapeString", + "HTMLEscaper", + "IsTrue", + "JSEscape", + "JSEscapeString", + "JSEscaper", + "Must", + "New", + "ParseFiles", + "ParseGlob", + "Template", + "URLQueryEscaper", + }, + "text/template/parse": []string{ + "ActionNode", + "BoolNode", + "BranchNode", + "ChainNode", + "CommandNode", + "DotNode", + "FieldNode", + "IdentifierNode", + "IfNode", + "IsEmptyTree", + "ListNode", + "New", + "NewIdentifier", + "NilNode", + "Node", + "NodeAction", + "NodeBool", + "NodeChain", + "NodeCommand", + "NodeDot", + "NodeField", + "NodeIdentifier", + "NodeIf", + "NodeList", + "NodeNil", + "NodeNumber", + "NodePipe", + "NodeRange", + "NodeString", + "NodeTemplate", + "NodeText", + "NodeType", + "NodeVariable", + "NodeWith", + "NumberNode", + "Parse", + "PipeNode", + "Pos", + "RangeNode", + "StringNode", + "TemplateNode", + "TextNode", + "Tree", + "VariableNode", + "WithNode", + }, + "time": []string{ + "ANSIC", + "After", + "AfterFunc", + "April", + "August", + "Date", + "December", + "Duration", + "February", + "FixedZone", + "Friday", + "Hour", + "January", + "July", + "June", + "Kitchen", + "LoadLocation", + "LoadLocationFromTZData", + "Local", + "Location", + "March", + "May", + "Microsecond", + "Millisecond", + "Minute", + "Monday", + "Month", + "Nanosecond", + "NewTicker", + "NewTimer", + "November", + "Now", + "October", + "Parse", + "ParseDuration", + "ParseError", + "ParseInLocation", + "RFC1123", + "RFC1123Z", + "RFC3339", + "RFC3339Nano", + "RFC822", + "RFC822Z", + "RFC850", + "RubyDate", + "Saturday", + "Second", + "September", + "Since", + "Sleep", + "Stamp", + "StampMicro", + "StampMilli", + "StampNano", + "Sunday", + "Thursday", + "Tick", + "Ticker", + "Time", + "Timer", + "Tuesday", + "UTC", + "Unix", + "UnixDate", + "Until", + "Wednesday", + "Weekday", + }, + "unicode": []string{ + "ASCII_Hex_Digit", + "Adlam", + "Ahom", + "Anatolian_Hieroglyphs", + "Arabic", + "Armenian", + "Avestan", + "AzeriCase", + "Balinese", + "Bamum", + "Bassa_Vah", + "Batak", + "Bengali", + "Bhaiksuki", + "Bidi_Control", + "Bopomofo", + "Brahmi", + "Braille", + "Buginese", + "Buhid", + "C", + "Canadian_Aboriginal", + "Carian", + "CaseRange", + "CaseRanges", + "Categories", + "Caucasian_Albanian", + "Cc", + "Cf", + "Chakma", + "Cham", + "Cherokee", + "Co", + "Common", + "Coptic", + "Cs", + "Cuneiform", + "Cypriot", + "Cyrillic", + "Dash", + "Deprecated", + "Deseret", + "Devanagari", + "Diacritic", + "Digit", + "Dogra", + "Duployan", + "Egyptian_Hieroglyphs", + "Elbasan", + "Ethiopic", + "Extender", + "FoldCategory", + "FoldScript", + "Georgian", + "Glagolitic", + "Gothic", + "Grantha", + "GraphicRanges", + "Greek", + "Gujarati", + "Gunjala_Gondi", + "Gurmukhi", + "Han", + "Hangul", + "Hanifi_Rohingya", + "Hanunoo", + "Hatran", + "Hebrew", + "Hex_Digit", + "Hiragana", + "Hyphen", + "IDS_Binary_Operator", + "IDS_Trinary_Operator", + "Ideographic", + "Imperial_Aramaic", + "In", + "Inherited", + "Inscriptional_Pahlavi", + "Inscriptional_Parthian", + "Is", + "IsControl", + "IsDigit", + "IsGraphic", + "IsLetter", + "IsLower", + "IsMark", + "IsNumber", + "IsOneOf", + "IsPrint", + "IsPunct", + "IsSpace", + "IsSymbol", + "IsTitle", + "IsUpper", + "Javanese", + "Join_Control", + "Kaithi", + "Kannada", + "Katakana", + "Kayah_Li", + "Kharoshthi", + "Khmer", + "Khojki", + "Khudawadi", + "L", + "Lao", + "Latin", + "Lepcha", + "Letter", + "Limbu", + "Linear_A", + "Linear_B", + "Lisu", + "Ll", + "Lm", + "Lo", + "Logical_Order_Exception", + "Lower", + "LowerCase", + "Lt", + "Lu", + "Lycian", + "Lydian", + "M", + "Mahajani", + "Makasar", + "Malayalam", + "Mandaic", + "Manichaean", + "Marchen", + "Mark", + "Masaram_Gondi", + "MaxASCII", + "MaxCase", + "MaxLatin1", + "MaxRune", + "Mc", + "Me", + "Medefaidrin", + "Meetei_Mayek", + "Mende_Kikakui", + "Meroitic_Cursive", + "Meroitic_Hieroglyphs", + "Miao", + "Mn", + "Modi", + "Mongolian", + "Mro", + "Multani", + "Myanmar", + "N", + "Nabataean", + "Nd", + "New_Tai_Lue", + "Newa", + "Nko", + "Nl", + "No", + "Noncharacter_Code_Point", + "Number", + "Nushu", + "Ogham", + "Ol_Chiki", + "Old_Hungarian", + "Old_Italic", + "Old_North_Arabian", + "Old_Permic", + "Old_Persian", + "Old_Sogdian", + "Old_South_Arabian", + "Old_Turkic", + "Oriya", + "Osage", + "Osmanya", + "Other", + "Other_Alphabetic", + "Other_Default_Ignorable_Code_Point", + "Other_Grapheme_Extend", + "Other_ID_Continue", + "Other_ID_Start", + "Other_Lowercase", + "Other_Math", + "Other_Uppercase", + "P", + "Pahawh_Hmong", + "Palmyrene", + "Pattern_Syntax", + "Pattern_White_Space", + "Pau_Cin_Hau", + "Pc", + "Pd", + "Pe", + "Pf", + "Phags_Pa", + "Phoenician", + "Pi", + "Po", + "Prepended_Concatenation_Mark", + "PrintRanges", + "Properties", + "Ps", + "Psalter_Pahlavi", + "Punct", + "Quotation_Mark", + "Radical", + "Range16", + "Range32", + "RangeTable", + "Regional_Indicator", + "Rejang", + "ReplacementChar", + "Runic", + "S", + "STerm", + "Samaritan", + "Saurashtra", + "Sc", + "Scripts", + "Sentence_Terminal", + "Sharada", + "Shavian", + "Siddham", + "SignWriting", + "SimpleFold", + "Sinhala", + "Sk", + "Sm", + "So", + "Soft_Dotted", + "Sogdian", + "Sora_Sompeng", + "Soyombo", + "Space", + "SpecialCase", + "Sundanese", + "Syloti_Nagri", + "Symbol", + "Syriac", + "Tagalog", + "Tagbanwa", + "Tai_Le", + "Tai_Tham", + "Tai_Viet", + "Takri", + "Tamil", + "Tangut", + "Telugu", + "Terminal_Punctuation", + "Thaana", + "Thai", + "Tibetan", + "Tifinagh", + "Tirhuta", + "Title", + "TitleCase", + "To", + "ToLower", + "ToTitle", + "ToUpper", + "TurkishCase", + "Ugaritic", + "Unified_Ideograph", + "Upper", + "UpperCase", + "UpperLower", + "Vai", + "Variation_Selector", + "Version", + "Warang_Citi", + "White_Space", + "Yi", + "Z", + "Zanabazar_Square", + "Zl", + "Zp", + "Zs", + }, + "unicode/utf16": []string{ + "Decode", + "DecodeRune", + "Encode", + "EncodeRune", + "IsSurrogate", + }, + "unicode/utf8": []string{ + "DecodeLastRune", + "DecodeLastRuneInString", + "DecodeRune", + "DecodeRuneInString", + "EncodeRune", + "FullRune", + "FullRuneInString", + "MaxRune", + "RuneCount", + "RuneCountInString", + "RuneError", + "RuneLen", + "RuneSelf", + "RuneStart", + "UTFMax", + "Valid", + "ValidRune", + "ValidString", + }, + "unsafe": []string{ + "Alignof", + "ArbitraryType", + "Offsetof", + "Pointer", + "Sizeof", + }, +} diff --git a/vendor/golang.org/x/tools/internal/module/module.go b/vendor/golang.org/x/tools/internal/module/module.go new file mode 100644 index 00000000..9a4edb9d --- /dev/null +++ b/vendor/golang.org/x/tools/internal/module/module.go @@ -0,0 +1,540 @@ +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Package module defines the module.Version type +// along with support code. +package module + +// IMPORTANT NOTE +// +// This file essentially defines the set of valid import paths for the go command. +// There are many subtle considerations, including Unicode ambiguity, +// security, network, and file system representations. +// +// This file also defines the set of valid module path and version combinations, +// another topic with many subtle considerations. +// +// Changes to the semantics in this file require approval from rsc. + +import ( + "fmt" + "sort" + "strings" + "unicode" + "unicode/utf8" + + "golang.org/x/tools/internal/semver" +) + +// A Version is defined by a module path and version pair. +type Version struct { + Path string + + // Version is usually a semantic version in canonical form. + // There are two exceptions to this general rule. + // First, the top-level target of a build has no specific version + // and uses Version = "". + // Second, during MVS calculations the version "none" is used + // to represent the decision to take no version of a given module. + Version string `json:",omitempty"` +} + +// Check checks that a given module path, version pair is valid. +// In addition to the path being a valid module path +// and the version being a valid semantic version, +// the two must correspond. +// For example, the path "yaml/v2" only corresponds to +// semantic versions beginning with "v2.". +func Check(path, version string) error { + if err := CheckPath(path); err != nil { + return err + } + if !semver.IsValid(version) { + return fmt.Errorf("malformed semantic version %v", version) + } + _, pathMajor, _ := SplitPathVersion(path) + if !MatchPathMajor(version, pathMajor) { + if pathMajor == "" { + pathMajor = "v0 or v1" + } + if pathMajor[0] == '.' { // .v1 + pathMajor = pathMajor[1:] + } + return fmt.Errorf("mismatched module path %v and version %v (want %v)", path, version, pathMajor) + } + return nil +} + +// firstPathOK reports whether r can appear in the first element of a module path. +// The first element of the path must be an LDH domain name, at least for now. +// To avoid case ambiguity, the domain name must be entirely lower case. +func firstPathOK(r rune) bool { + return r == '-' || r == '.' || + '0' <= r && r <= '9' || + 'a' <= r && r <= 'z' +} + +// pathOK reports whether r can appear in an import path element. +// Paths can be ASCII letters, ASCII digits, and limited ASCII punctuation: + - . _ and ~. +// This matches what "go get" has historically recognized in import paths. +// TODO(rsc): We would like to allow Unicode letters, but that requires additional +// care in the safe encoding (see note below). +func pathOK(r rune) bool { + if r < utf8.RuneSelf { + return r == '+' || r == '-' || r == '.' || r == '_' || r == '~' || + '0' <= r && r <= '9' || + 'A' <= r && r <= 'Z' || + 'a' <= r && r <= 'z' + } + return false +} + +// fileNameOK reports whether r can appear in a file name. +// For now we allow all Unicode letters but otherwise limit to pathOK plus a few more punctuation characters. +// If we expand the set of allowed characters here, we have to +// work harder at detecting potential case-folding and normalization collisions. +// See note about "safe encoding" below. +func fileNameOK(r rune) bool { + if r < utf8.RuneSelf { + // Entire set of ASCII punctuation, from which we remove characters: + // ! " # $ % & ' ( ) * + , - . / : ; < = > ? @ [ \ ] ^ _ ` { | } ~ + // We disallow some shell special characters: " ' * < > ? ` | + // (Note that some of those are disallowed by the Windows file system as well.) + // We also disallow path separators / : and \ (fileNameOK is only called on path element characters). + // We allow spaces (U+0020) in file names. + const allowed = "!#$%&()+,-.=@[]^_{}~ " + if '0' <= r && r <= '9' || 'A' <= r && r <= 'Z' || 'a' <= r && r <= 'z' { + return true + } + for i := 0; i < len(allowed); i++ { + if rune(allowed[i]) == r { + return true + } + } + return false + } + // It may be OK to add more ASCII punctuation here, but only carefully. + // For example Windows disallows < > \, and macOS disallows :, so we must not allow those. + return unicode.IsLetter(r) +} + +// CheckPath checks that a module path is valid. +func CheckPath(path string) error { + if err := checkPath(path, false); err != nil { + return fmt.Errorf("malformed module path %q: %v", path, err) + } + i := strings.Index(path, "/") + if i < 0 { + i = len(path) + } + if i == 0 { + return fmt.Errorf("malformed module path %q: leading slash", path) + } + if !strings.Contains(path[:i], ".") { + return fmt.Errorf("malformed module path %q: missing dot in first path element", path) + } + if path[0] == '-' { + return fmt.Errorf("malformed module path %q: leading dash in first path element", path) + } + for _, r := range path[:i] { + if !firstPathOK(r) { + return fmt.Errorf("malformed module path %q: invalid char %q in first path element", path, r) + } + } + if _, _, ok := SplitPathVersion(path); !ok { + return fmt.Errorf("malformed module path %q: invalid version", path) + } + return nil +} + +// CheckImportPath checks that an import path is valid. +func CheckImportPath(path string) error { + if err := checkPath(path, false); err != nil { + return fmt.Errorf("malformed import path %q: %v", path, err) + } + return nil +} + +// checkPath checks that a general path is valid. +// It returns an error describing why but not mentioning path. +// Because these checks apply to both module paths and import paths, +// the caller is expected to add the "malformed ___ path %q: " prefix. +// fileName indicates whether the final element of the path is a file name +// (as opposed to a directory name). +func checkPath(path string, fileName bool) error { + if !utf8.ValidString(path) { + return fmt.Errorf("invalid UTF-8") + } + if path == "" { + return fmt.Errorf("empty string") + } + if strings.Contains(path, "..") { + return fmt.Errorf("double dot") + } + if strings.Contains(path, "//") { + return fmt.Errorf("double slash") + } + if path[len(path)-1] == '/' { + return fmt.Errorf("trailing slash") + } + elemStart := 0 + for i, r := range path { + if r == '/' { + if err := checkElem(path[elemStart:i], fileName); err != nil { + return err + } + elemStart = i + 1 + } + } + if err := checkElem(path[elemStart:], fileName); err != nil { + return err + } + return nil +} + +// checkElem checks whether an individual path element is valid. +// fileName indicates whether the element is a file name (not a directory name). +func checkElem(elem string, fileName bool) error { + if elem == "" { + return fmt.Errorf("empty path element") + } + if strings.Count(elem, ".") == len(elem) { + return fmt.Errorf("invalid path element %q", elem) + } + if elem[0] == '.' && !fileName { + return fmt.Errorf("leading dot in path element") + } + if elem[len(elem)-1] == '.' { + return fmt.Errorf("trailing dot in path element") + } + charOK := pathOK + if fileName { + charOK = fileNameOK + } + for _, r := range elem { + if !charOK(r) { + return fmt.Errorf("invalid char %q", r) + } + } + + // Windows disallows a bunch of path elements, sadly. + // See https://docs.microsoft.com/en-us/windows/desktop/fileio/naming-a-file + short := elem + if i := strings.Index(short, "."); i >= 0 { + short = short[:i] + } + for _, bad := range badWindowsNames { + if strings.EqualFold(bad, short) { + return fmt.Errorf("disallowed path element %q", elem) + } + } + return nil +} + +// CheckFilePath checks whether a slash-separated file path is valid. +func CheckFilePath(path string) error { + if err := checkPath(path, true); err != nil { + return fmt.Errorf("malformed file path %q: %v", path, err) + } + return nil +} + +// badWindowsNames are the reserved file path elements on Windows. +// See https://docs.microsoft.com/en-us/windows/desktop/fileio/naming-a-file +var badWindowsNames = []string{ + "CON", + "PRN", + "AUX", + "NUL", + "COM1", + "COM2", + "COM3", + "COM4", + "COM5", + "COM6", + "COM7", + "COM8", + "COM9", + "LPT1", + "LPT2", + "LPT3", + "LPT4", + "LPT5", + "LPT6", + "LPT7", + "LPT8", + "LPT9", +} + +// SplitPathVersion returns prefix and major version such that prefix+pathMajor == path +// and version is either empty or "/vN" for N >= 2. +// As a special case, gopkg.in paths are recognized directly; +// they require ".vN" instead of "/vN", and for all N, not just N >= 2. +func SplitPathVersion(path string) (prefix, pathMajor string, ok bool) { + if strings.HasPrefix(path, "gopkg.in/") { + return splitGopkgIn(path) + } + + i := len(path) + dot := false + for i > 0 && ('0' <= path[i-1] && path[i-1] <= '9' || path[i-1] == '.') { + if path[i-1] == '.' { + dot = true + } + i-- + } + if i <= 1 || i == len(path) || path[i-1] != 'v' || path[i-2] != '/' { + return path, "", true + } + prefix, pathMajor = path[:i-2], path[i-2:] + if dot || len(pathMajor) <= 2 || pathMajor[2] == '0' || pathMajor == "/v1" { + return path, "", false + } + return prefix, pathMajor, true +} + +// splitGopkgIn is like SplitPathVersion but only for gopkg.in paths. +func splitGopkgIn(path string) (prefix, pathMajor string, ok bool) { + if !strings.HasPrefix(path, "gopkg.in/") { + return path, "", false + } + i := len(path) + if strings.HasSuffix(path, "-unstable") { + i -= len("-unstable") + } + for i > 0 && ('0' <= path[i-1] && path[i-1] <= '9') { + i-- + } + if i <= 1 || path[i-1] != 'v' || path[i-2] != '.' { + // All gopkg.in paths must end in vN for some N. + return path, "", false + } + prefix, pathMajor = path[:i-2], path[i-2:] + if len(pathMajor) <= 2 || pathMajor[2] == '0' && pathMajor != ".v0" { + return path, "", false + } + return prefix, pathMajor, true +} + +// MatchPathMajor reports whether the semantic version v +// matches the path major version pathMajor. +func MatchPathMajor(v, pathMajor string) bool { + if strings.HasPrefix(pathMajor, ".v") && strings.HasSuffix(pathMajor, "-unstable") { + pathMajor = strings.TrimSuffix(pathMajor, "-unstable") + } + if strings.HasPrefix(v, "v0.0.0-") && pathMajor == ".v1" { + // Allow old bug in pseudo-versions that generated v0.0.0- pseudoversion for gopkg .v1. + // For example, gopkg.in/yaml.v2@v2.2.1's go.mod requires gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405. + return true + } + m := semver.Major(v) + if pathMajor == "" { + return m == "v0" || m == "v1" || semver.Build(v) == "+incompatible" + } + return (pathMajor[0] == '/' || pathMajor[0] == '.') && m == pathMajor[1:] +} + +// CanonicalVersion returns the canonical form of the version string v. +// It is the same as semver.Canonical(v) except that it preserves the special build suffix "+incompatible". +func CanonicalVersion(v string) string { + cv := semver.Canonical(v) + if semver.Build(v) == "+incompatible" { + cv += "+incompatible" + } + return cv +} + +// Sort sorts the list by Path, breaking ties by comparing Versions. +func Sort(list []Version) { + sort.Slice(list, func(i, j int) bool { + mi := list[i] + mj := list[j] + if mi.Path != mj.Path { + return mi.Path < mj.Path + } + // To help go.sum formatting, allow version/file. + // Compare semver prefix by semver rules, + // file by string order. + vi := mi.Version + vj := mj.Version + var fi, fj string + if k := strings.Index(vi, "/"); k >= 0 { + vi, fi = vi[:k], vi[k:] + } + if k := strings.Index(vj, "/"); k >= 0 { + vj, fj = vj[:k], vj[k:] + } + if vi != vj { + return semver.Compare(vi, vj) < 0 + } + return fi < fj + }) +} + +// Safe encodings +// +// Module paths appear as substrings of file system paths +// (in the download cache) and of web server URLs in the proxy protocol. +// In general we cannot rely on file systems to be case-sensitive, +// nor can we rely on web servers, since they read from file systems. +// That is, we cannot rely on the file system to keep rsc.io/QUOTE +// and rsc.io/quote separate. Windows and macOS don't. +// Instead, we must never require two different casings of a file path. +// Because we want the download cache to match the proxy protocol, +// and because we want the proxy protocol to be possible to serve +// from a tree of static files (which might be stored on a case-insensitive +// file system), the proxy protocol must never require two different casings +// of a URL path either. +// +// One possibility would be to make the safe encoding be the lowercase +// hexadecimal encoding of the actual path bytes. This would avoid ever +// needing different casings of a file path, but it would be fairly illegible +// to most programmers when those paths appeared in the file system +// (including in file paths in compiler errors and stack traces) +// in web server logs, and so on. Instead, we want a safe encoding that +// leaves most paths unaltered. +// +// The safe encoding is this: +// replace every uppercase letter with an exclamation mark +// followed by the letter's lowercase equivalent. +// +// For example, +// github.com/Azure/azure-sdk-for-go -> github.com/!azure/azure-sdk-for-go. +// github.com/GoogleCloudPlatform/cloudsql-proxy -> github.com/!google!cloud!platform/cloudsql-proxy +// github.com/Sirupsen/logrus -> github.com/!sirupsen/logrus. +// +// Import paths that avoid upper-case letters are left unchanged. +// Note that because import paths are ASCII-only and avoid various +// problematic punctuation (like : < and >), the safe encoding is also ASCII-only +// and avoids the same problematic punctuation. +// +// Import paths have never allowed exclamation marks, so there is no +// need to define how to encode a literal !. +// +// Although paths are disallowed from using Unicode (see pathOK above), +// the eventual plan is to allow Unicode letters as well, to assume that +// file systems and URLs are Unicode-safe (storing UTF-8), and apply +// the !-for-uppercase convention. Note however that not all runes that +// are different but case-fold equivalent are an upper/lower pair. +// For example, U+004B ('K'), U+006B ('k'), and U+212A ('K' for Kelvin) +// are considered to case-fold to each other. When we do add Unicode +// letters, we must not assume that upper/lower are the only case-equivalent pairs. +// Perhaps the Kelvin symbol would be disallowed entirely, for example. +// Or perhaps it would encode as "!!k", or perhaps as "(212A)". +// +// Also, it would be nice to allow Unicode marks as well as letters, +// but marks include combining marks, and then we must deal not +// only with case folding but also normalization: both U+00E9 ('é') +// and U+0065 U+0301 ('e' followed by combining acute accent) +// look the same on the page and are treated by some file systems +// as the same path. If we do allow Unicode marks in paths, there +// must be some kind of normalization to allow only one canonical +// encoding of any character used in an import path. + +// EncodePath returns the safe encoding of the given module path. +// It fails if the module path is invalid. +func EncodePath(path string) (encoding string, err error) { + if err := CheckPath(path); err != nil { + return "", err + } + + return encodeString(path) +} + +// EncodeVersion returns the safe encoding of the given module version. +// Versions are allowed to be in non-semver form but must be valid file names +// and not contain exclamation marks. +func EncodeVersion(v string) (encoding string, err error) { + if err := checkElem(v, true); err != nil || strings.Contains(v, "!") { + return "", fmt.Errorf("disallowed version string %q", v) + } + return encodeString(v) +} + +func encodeString(s string) (encoding string, err error) { + haveUpper := false + for _, r := range s { + if r == '!' || r >= utf8.RuneSelf { + // This should be disallowed by CheckPath, but diagnose anyway. + // The correctness of the encoding loop below depends on it. + return "", fmt.Errorf("internal error: inconsistency in EncodePath") + } + if 'A' <= r && r <= 'Z' { + haveUpper = true + } + } + + if !haveUpper { + return s, nil + } + + var buf []byte + for _, r := range s { + if 'A' <= r && r <= 'Z' { + buf = append(buf, '!', byte(r+'a'-'A')) + } else { + buf = append(buf, byte(r)) + } + } + return string(buf), nil +} + +// DecodePath returns the module path of the given safe encoding. +// It fails if the encoding is invalid or encodes an invalid path. +func DecodePath(encoding string) (path string, err error) { + path, ok := decodeString(encoding) + if !ok { + return "", fmt.Errorf("invalid module path encoding %q", encoding) + } + if err := CheckPath(path); err != nil { + return "", fmt.Errorf("invalid module path encoding %q: %v", encoding, err) + } + return path, nil +} + +// DecodeVersion returns the version string for the given safe encoding. +// It fails if the encoding is invalid or encodes an invalid version. +// Versions are allowed to be in non-semver form but must be valid file names +// and not contain exclamation marks. +func DecodeVersion(encoding string) (v string, err error) { + v, ok := decodeString(encoding) + if !ok { + return "", fmt.Errorf("invalid version encoding %q", encoding) + } + if err := checkElem(v, true); err != nil { + return "", fmt.Errorf("disallowed version string %q", v) + } + return v, nil +} + +func decodeString(encoding string) (string, bool) { + var buf []byte + + bang := false + for _, r := range encoding { + if r >= utf8.RuneSelf { + return "", false + } + if bang { + bang = false + if r < 'a' || 'z' < r { + return "", false + } + buf = append(buf, byte(r+'A'-'a')) + continue + } + if r == '!' { + bang = true + continue + } + if 'A' <= r && r <= 'Z' { + return "", false + } + buf = append(buf, byte(r)) + } + if bang { + return "", false + } + return string(buf), true +} diff --git a/vendor/golang.org/x/tools/internal/semver/semver.go b/vendor/golang.org/x/tools/internal/semver/semver.go new file mode 100644 index 00000000..4af7118e --- /dev/null +++ b/vendor/golang.org/x/tools/internal/semver/semver.go @@ -0,0 +1,388 @@ +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Package semver implements comparison of semantic version strings. +// In this package, semantic version strings must begin with a leading "v", +// as in "v1.0.0". +// +// The general form of a semantic version string accepted by this package is +// +// vMAJOR[.MINOR[.PATCH[-PRERELEASE][+BUILD]]] +// +// where square brackets indicate optional parts of the syntax; +// MAJOR, MINOR, and PATCH are decimal integers without extra leading zeros; +// PRERELEASE and BUILD are each a series of non-empty dot-separated identifiers +// using only alphanumeric characters and hyphens; and +// all-numeric PRERELEASE identifiers must not have leading zeros. +// +// This package follows Semantic Versioning 2.0.0 (see semver.org) +// with two exceptions. First, it requires the "v" prefix. Second, it recognizes +// vMAJOR and vMAJOR.MINOR (with no prerelease or build suffixes) +// as shorthands for vMAJOR.0.0 and vMAJOR.MINOR.0. +package semver + +// parsed returns the parsed form of a semantic version string. +type parsed struct { + major string + minor string + patch string + short string + prerelease string + build string + err string +} + +// IsValid reports whether v is a valid semantic version string. +func IsValid(v string) bool { + _, ok := parse(v) + return ok +} + +// Canonical returns the canonical formatting of the semantic version v. +// It fills in any missing .MINOR or .PATCH and discards build metadata. +// Two semantic versions compare equal only if their canonical formattings +// are identical strings. +// The canonical invalid semantic version is the empty string. +func Canonical(v string) string { + p, ok := parse(v) + if !ok { + return "" + } + if p.build != "" { + return v[:len(v)-len(p.build)] + } + if p.short != "" { + return v + p.short + } + return v +} + +// Major returns the major version prefix of the semantic version v. +// For example, Major("v2.1.0") == "v2". +// If v is an invalid semantic version string, Major returns the empty string. +func Major(v string) string { + pv, ok := parse(v) + if !ok { + return "" + } + return v[:1+len(pv.major)] +} + +// MajorMinor returns the major.minor version prefix of the semantic version v. +// For example, MajorMinor("v2.1.0") == "v2.1". +// If v is an invalid semantic version string, MajorMinor returns the empty string. +func MajorMinor(v string) string { + pv, ok := parse(v) + if !ok { + return "" + } + i := 1 + len(pv.major) + if j := i + 1 + len(pv.minor); j <= len(v) && v[i] == '.' && v[i+1:j] == pv.minor { + return v[:j] + } + return v[:i] + "." + pv.minor +} + +// Prerelease returns the prerelease suffix of the semantic version v. +// For example, Prerelease("v2.1.0-pre+meta") == "-pre". +// If v is an invalid semantic version string, Prerelease returns the empty string. +func Prerelease(v string) string { + pv, ok := parse(v) + if !ok { + return "" + } + return pv.prerelease +} + +// Build returns the build suffix of the semantic version v. +// For example, Build("v2.1.0+meta") == "+meta". +// If v is an invalid semantic version string, Build returns the empty string. +func Build(v string) string { + pv, ok := parse(v) + if !ok { + return "" + } + return pv.build +} + +// Compare returns an integer comparing two versions according to +// according to semantic version precedence. +// The result will be 0 if v == w, -1 if v < w, or +1 if v > w. +// +// An invalid semantic version string is considered less than a valid one. +// All invalid semantic version strings compare equal to each other. +func Compare(v, w string) int { + pv, ok1 := parse(v) + pw, ok2 := parse(w) + if !ok1 && !ok2 { + return 0 + } + if !ok1 { + return -1 + } + if !ok2 { + return +1 + } + if c := compareInt(pv.major, pw.major); c != 0 { + return c + } + if c := compareInt(pv.minor, pw.minor); c != 0 { + return c + } + if c := compareInt(pv.patch, pw.patch); c != 0 { + return c + } + return comparePrerelease(pv.prerelease, pw.prerelease) +} + +// Max canonicalizes its arguments and then returns the version string +// that compares greater. +func Max(v, w string) string { + v = Canonical(v) + w = Canonical(w) + if Compare(v, w) > 0 { + return v + } + return w +} + +func parse(v string) (p parsed, ok bool) { + if v == "" || v[0] != 'v' { + p.err = "missing v prefix" + return + } + p.major, v, ok = parseInt(v[1:]) + if !ok { + p.err = "bad major version" + return + } + if v == "" { + p.minor = "0" + p.patch = "0" + p.short = ".0.0" + return + } + if v[0] != '.' { + p.err = "bad minor prefix" + ok = false + return + } + p.minor, v, ok = parseInt(v[1:]) + if !ok { + p.err = "bad minor version" + return + } + if v == "" { + p.patch = "0" + p.short = ".0" + return + } + if v[0] != '.' { + p.err = "bad patch prefix" + ok = false + return + } + p.patch, v, ok = parseInt(v[1:]) + if !ok { + p.err = "bad patch version" + return + } + if len(v) > 0 && v[0] == '-' { + p.prerelease, v, ok = parsePrerelease(v) + if !ok { + p.err = "bad prerelease" + return + } + } + if len(v) > 0 && v[0] == '+' { + p.build, v, ok = parseBuild(v) + if !ok { + p.err = "bad build" + return + } + } + if v != "" { + p.err = "junk on end" + ok = false + return + } + ok = true + return +} + +func parseInt(v string) (t, rest string, ok bool) { + if v == "" { + return + } + if v[0] < '0' || '9' < v[0] { + return + } + i := 1 + for i < len(v) && '0' <= v[i] && v[i] <= '9' { + i++ + } + if v[0] == '0' && i != 1 { + return + } + return v[:i], v[i:], true +} + +func parsePrerelease(v string) (t, rest string, ok bool) { + // "A pre-release version MAY be denoted by appending a hyphen and + // a series of dot separated identifiers immediately following the patch version. + // Identifiers MUST comprise only ASCII alphanumerics and hyphen [0-9A-Za-z-]. + // Identifiers MUST NOT be empty. Numeric identifiers MUST NOT include leading zeroes." + if v == "" || v[0] != '-' { + return + } + i := 1 + start := 1 + for i < len(v) && v[i] != '+' { + if !isIdentChar(v[i]) && v[i] != '.' { + return + } + if v[i] == '.' { + if start == i || isBadNum(v[start:i]) { + return + } + start = i + 1 + } + i++ + } + if start == i || isBadNum(v[start:i]) { + return + } + return v[:i], v[i:], true +} + +func parseBuild(v string) (t, rest string, ok bool) { + if v == "" || v[0] != '+' { + return + } + i := 1 + start := 1 + for i < len(v) { + if !isIdentChar(v[i]) { + return + } + if v[i] == '.' { + if start == i { + return + } + start = i + 1 + } + i++ + } + if start == i { + return + } + return v[:i], v[i:], true +} + +func isIdentChar(c byte) bool { + return 'A' <= c && c <= 'Z' || 'a' <= c && c <= 'z' || '0' <= c && c <= '9' || c == '-' +} + +func isBadNum(v string) bool { + i := 0 + for i < len(v) && '0' <= v[i] && v[i] <= '9' { + i++ + } + return i == len(v) && i > 1 && v[0] == '0' +} + +func isNum(v string) bool { + i := 0 + for i < len(v) && '0' <= v[i] && v[i] <= '9' { + i++ + } + return i == len(v) +} + +func compareInt(x, y string) int { + if x == y { + return 0 + } + if len(x) < len(y) { + return -1 + } + if len(x) > len(y) { + return +1 + } + if x < y { + return -1 + } else { + return +1 + } +} + +func comparePrerelease(x, y string) int { + // "When major, minor, and patch are equal, a pre-release version has + // lower precedence than a normal version. + // Example: 1.0.0-alpha < 1.0.0. + // Precedence for two pre-release versions with the same major, minor, + // and patch version MUST be determined by comparing each dot separated + // identifier from left to right until a difference is found as follows: + // identifiers consisting of only digits are compared numerically and + // identifiers with letters or hyphens are compared lexically in ASCII + // sort order. Numeric identifiers always have lower precedence than + // non-numeric identifiers. A larger set of pre-release fields has a + // higher precedence than a smaller set, if all of the preceding + // identifiers are equal. + // Example: 1.0.0-alpha < 1.0.0-alpha.1 < 1.0.0-alpha.beta < + // 1.0.0-beta < 1.0.0-beta.2 < 1.0.0-beta.11 < 1.0.0-rc.1 < 1.0.0." + if x == y { + return 0 + } + if x == "" { + return +1 + } + if y == "" { + return -1 + } + for x != "" && y != "" { + x = x[1:] // skip - or . + y = y[1:] // skip - or . + var dx, dy string + dx, x = nextIdent(x) + dy, y = nextIdent(y) + if dx != dy { + ix := isNum(dx) + iy := isNum(dy) + if ix != iy { + if ix { + return -1 + } else { + return +1 + } + } + if ix { + if len(dx) < len(dy) { + return -1 + } + if len(dx) > len(dy) { + return +1 + } + } + if dx < dy { + return -1 + } else { + return +1 + } + } + } + if x == "" { + return -1 + } else { + return +1 + } +} + +func nextIdent(x string) (dx, rest string) { + i := 0 + for i < len(x) && x[i] != '.' { + i++ + } + return x[:i], x[i:] +} diff --git a/vendor/golang.org/x/tools/internal/span/parse.go b/vendor/golang.org/x/tools/internal/span/parse.go new file mode 100644 index 00000000..b3f268a3 --- /dev/null +++ b/vendor/golang.org/x/tools/internal/span/parse.go @@ -0,0 +1,100 @@ +// Copyright 2019 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package span + +import ( + "strconv" + "strings" + "unicode/utf8" +) + +// Parse returns the location represented by the input. +// All inputs are valid locations, as they can always be a pure filename. +// The returned span will be normalized, and thus if printed may produce a +// different string. +func Parse(input string) Span { + // :0:0#0-0:0#0 + valid := input + var hold, offset int + hadCol := false + suf := rstripSuffix(input) + if suf.sep == "#" { + offset = suf.num + suf = rstripSuffix(suf.remains) + } + if suf.sep == ":" { + valid = suf.remains + hold = suf.num + hadCol = true + suf = rstripSuffix(suf.remains) + } + switch { + case suf.sep == ":": + return New(NewURI(suf.remains), NewPoint(suf.num, hold, offset), Point{}) + case suf.sep == "-": + // we have a span, fall out of the case to continue + default: + // separator not valid, rewind to either the : or the start + return New(NewURI(valid), NewPoint(hold, 0, offset), Point{}) + } + // only the span form can get here + // at this point we still don't know what the numbers we have mean + // if have not yet seen a : then we might have either a line or a column depending + // on whether start has a column or not + // we build an end point and will fix it later if needed + end := NewPoint(suf.num, hold, offset) + hold, offset = 0, 0 + suf = rstripSuffix(suf.remains) + if suf.sep == "#" { + offset = suf.num + suf = rstripSuffix(suf.remains) + } + if suf.sep != ":" { + // turns out we don't have a span after all, rewind + return New(NewURI(valid), end, Point{}) + } + valid = suf.remains + hold = suf.num + suf = rstripSuffix(suf.remains) + if suf.sep != ":" { + // line#offset only + return New(NewURI(valid), NewPoint(hold, 0, offset), end) + } + // we have a column, so if end only had one number, it is also the column + if !hadCol { + end = NewPoint(suf.num, end.v.Line, end.v.Offset) + } + return New(NewURI(suf.remains), NewPoint(suf.num, hold, offset), end) +} + +type suffix struct { + remains string + sep string + num int +} + +func rstripSuffix(input string) suffix { + if len(input) == 0 { + return suffix{"", "", -1} + } + remains := input + num := -1 + // first see if we have a number at the end + last := strings.LastIndexFunc(remains, func(r rune) bool { return r < '0' || r > '9' }) + if last >= 0 && last < len(remains)-1 { + number, err := strconv.ParseInt(remains[last+1:], 10, 64) + if err == nil { + num = int(number) + remains = remains[:last+1] + } + } + // now see if we have a trailing separator + r, w := utf8.DecodeLastRuneInString(remains) + if r != ':' && r != '#' && r == '#' { + return suffix{input, "", -1} + } + remains = remains[:len(remains)-w] + return suffix{remains, string(r), num} +} diff --git a/vendor/golang.org/x/tools/internal/span/span.go b/vendor/golang.org/x/tools/internal/span/span.go new file mode 100644 index 00000000..4d2ad098 --- /dev/null +++ b/vendor/golang.org/x/tools/internal/span/span.go @@ -0,0 +1,285 @@ +// Copyright 2019 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Package span contains support for representing with positions and ranges in +// text files. +package span + +import ( + "encoding/json" + "fmt" + "path" +) + +// Span represents a source code range in standardized form. +type Span struct { + v span +} + +// Point represents a single point within a file. +// In general this should only be used as part of a Span, as on its own it +// does not carry enough information. +type Point struct { + v point +} + +type span struct { + URI URI `json:"uri"` + Start point `json:"start"` + End point `json:"end"` +} + +type point struct { + Line int `json:"line"` + Column int `json:"column"` + Offset int `json:"offset"` +} + +// Invalid is a span that reports false from IsValid +var Invalid = Span{v: span{Start: invalidPoint.v, End: invalidPoint.v}} + +var invalidPoint = Point{v: point{Line: 0, Column: 0, Offset: -1}} + +// Converter is the interface to an object that can convert between line:column +// and offset forms for a single file. +type Converter interface { + //ToPosition converts from an offset to a line:column pair. + ToPosition(offset int) (int, int, error) + //ToOffset converts from a line:column pair to an offset. + ToOffset(line, col int) (int, error) +} + +func New(uri URI, start Point, end Point) Span { + s := Span{v: span{URI: uri, Start: start.v, End: end.v}} + s.v.clean() + return s +} + +func NewPoint(line, col, offset int) Point { + p := Point{v: point{Line: line, Column: col, Offset: offset}} + p.v.clean() + return p +} + +func Compare(a, b Span) int { + if r := CompareURI(a.URI(), b.URI()); r != 0 { + return r + } + if r := comparePoint(a.v.Start, b.v.Start); r != 0 { + return r + } + return comparePoint(a.v.End, b.v.End) +} + +func ComparePoint(a, b Point) int { + return comparePoint(a.v, b.v) +} + +func comparePoint(a, b point) int { + if !a.hasPosition() { + if a.Offset < b.Offset { + return -1 + } + if a.Offset > b.Offset { + return 1 + } + return 0 + } + if a.Line < b.Line { + return -1 + } + if a.Line > b.Line { + return 1 + } + if a.Column < b.Column { + return -1 + } + if a.Column > b.Column { + return 1 + } + return 0 +} + +func (s Span) HasPosition() bool { return s.v.Start.hasPosition() } +func (s Span) HasOffset() bool { return s.v.Start.hasOffset() } +func (s Span) IsValid() bool { return s.v.Start.isValid() } +func (s Span) IsPoint() bool { return s.v.Start == s.v.End } +func (s Span) URI() URI { return s.v.URI } +func (s Span) Start() Point { return Point{s.v.Start} } +func (s Span) End() Point { return Point{s.v.End} } +func (s *Span) MarshalJSON() ([]byte, error) { return json.Marshal(&s.v) } +func (s *Span) UnmarshalJSON(b []byte) error { return json.Unmarshal(b, &s.v) } + +func (p Point) HasPosition() bool { return p.v.hasPosition() } +func (p Point) HasOffset() bool { return p.v.hasOffset() } +func (p Point) IsValid() bool { return p.v.isValid() } +func (p *Point) MarshalJSON() ([]byte, error) { return json.Marshal(&p.v) } +func (p *Point) UnmarshalJSON(b []byte) error { return json.Unmarshal(b, &p.v) } +func (p Point) Line() int { + if !p.v.hasPosition() { + panic(fmt.Errorf("position not set in %v", p.v)) + } + return p.v.Line +} +func (p Point) Column() int { + if !p.v.hasPosition() { + panic(fmt.Errorf("position not set in %v", p.v)) + } + return p.v.Column +} +func (p Point) Offset() int { + if !p.v.hasOffset() { + panic(fmt.Errorf("offset not set in %v", p.v)) + } + return p.v.Offset +} + +func (p point) hasPosition() bool { return p.Line > 0 } +func (p point) hasOffset() bool { return p.Offset >= 0 } +func (p point) isValid() bool { return p.hasPosition() || p.hasOffset() } +func (p point) isZero() bool { + return (p.Line == 1 && p.Column == 1) || (!p.hasPosition() && p.Offset == 0) +} + +func (s *span) clean() { + //this presumes the points are already clean + if !s.End.isValid() || (s.End == point{}) { + s.End = s.Start + } +} + +func (p *point) clean() { + if p.Line < 0 { + p.Line = 0 + } + if p.Column <= 0 { + if p.Line > 0 { + p.Column = 1 + } else { + p.Column = 0 + } + } + if p.Offset == 0 && (p.Line > 1 || p.Column > 1) { + p.Offset = -1 + } +} + +// Format implements fmt.Formatter to print the Location in a standard form. +// The format produced is one that can be read back in using Parse. +func (s Span) Format(f fmt.State, c rune) { + fullForm := f.Flag('+') + preferOffset := f.Flag('#') + // we should always have a uri, simplify if it is file format + //TODO: make sure the end of the uri is unambiguous + uri := string(s.v.URI) + if c == 'f' { + uri = path.Base(uri) + } else if !fullForm { + uri = s.v.URI.Filename() + } + fmt.Fprint(f, uri) + if !s.IsValid() || (!fullForm && s.v.Start.isZero() && s.v.End.isZero()) { + return + } + // see which bits of start to write + printOffset := s.HasOffset() && (fullForm || preferOffset || !s.HasPosition()) + printLine := s.HasPosition() && (fullForm || !printOffset) + printColumn := printLine && (fullForm || (s.v.Start.Column > 1 || s.v.End.Column > 1)) + fmt.Fprint(f, ":") + if printLine { + fmt.Fprintf(f, "%d", s.v.Start.Line) + } + if printColumn { + fmt.Fprintf(f, ":%d", s.v.Start.Column) + } + if printOffset { + fmt.Fprintf(f, "#%d", s.v.Start.Offset) + } + // start is written, do we need end? + if s.IsPoint() { + return + } + // we don't print the line if it did not change + printLine = fullForm || (printLine && s.v.End.Line > s.v.Start.Line) + fmt.Fprint(f, "-") + if printLine { + fmt.Fprintf(f, "%d", s.v.End.Line) + } + if printColumn { + if printLine { + fmt.Fprint(f, ":") + } + fmt.Fprintf(f, "%d", s.v.End.Column) + } + if printOffset { + fmt.Fprintf(f, "#%d", s.v.End.Offset) + } +} + +func (s Span) WithPosition(c Converter) (Span, error) { + if err := s.update(c, true, false); err != nil { + return Span{}, err + } + return s, nil +} + +func (s Span) WithOffset(c Converter) (Span, error) { + if err := s.update(c, false, true); err != nil { + return Span{}, err + } + return s, nil +} + +func (s Span) WithAll(c Converter) (Span, error) { + if err := s.update(c, true, true); err != nil { + return Span{}, err + } + return s, nil +} + +func (s *Span) update(c Converter, withPos, withOffset bool) error { + if !s.IsValid() { + return fmt.Errorf("cannot add information to an invalid span") + } + if withPos && !s.HasPosition() { + if err := s.v.Start.updatePosition(c); err != nil { + return err + } + if s.v.End.Offset == s.v.Start.Offset { + s.v.End = s.v.Start + } else if err := s.v.End.updatePosition(c); err != nil { + return err + } + } + if withOffset && (!s.HasOffset() || (s.v.End.hasPosition() && !s.v.End.hasOffset())) { + if err := s.v.Start.updateOffset(c); err != nil { + return err + } + if s.v.End.Line == s.v.Start.Line && s.v.End.Column == s.v.Start.Column { + s.v.End.Offset = s.v.Start.Offset + } else if err := s.v.End.updateOffset(c); err != nil { + return err + } + } + return nil +} + +func (p *point) updatePosition(c Converter) error { + line, col, err := c.ToPosition(p.Offset) + if err != nil { + return err + } + p.Line = line + p.Column = col + return nil +} + +func (p *point) updateOffset(c Converter) error { + offset, err := c.ToOffset(p.Line, p.Column) + if err != nil { + return err + } + p.Offset = offset + return nil +} diff --git a/vendor/golang.org/x/tools/internal/span/token.go b/vendor/golang.org/x/tools/internal/span/token.go new file mode 100644 index 00000000..ce44541b --- /dev/null +++ b/vendor/golang.org/x/tools/internal/span/token.go @@ -0,0 +1,151 @@ +// Copyright 2019 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package span + +import ( + "fmt" + "go/token" +) + +// Range represents a source code range in token.Pos form. +// It also carries the FileSet that produced the positions, so that it is +// self contained. +type Range struct { + FileSet *token.FileSet + Start token.Pos + End token.Pos +} + +// TokenConverter is a Converter backed by a token file set and file. +// It uses the file set methods to work out the conversions, which +// makes it fast and does not require the file contents. +type TokenConverter struct { + fset *token.FileSet + file *token.File +} + +// NewRange creates a new Range from a FileSet and two positions. +// To represent a point pass a 0 as the end pos. +func NewRange(fset *token.FileSet, start, end token.Pos) Range { + return Range{ + FileSet: fset, + Start: start, + End: end, + } +} + +// NewTokenConverter returns an implementation of Converter backed by a +// token.File. +func NewTokenConverter(fset *token.FileSet, f *token.File) *TokenConverter { + return &TokenConverter{fset: fset, file: f} +} + +// NewContentConverter returns an implementation of Converter for the +// given file content. +func NewContentConverter(filename string, content []byte) *TokenConverter { + fset := token.NewFileSet() + f := fset.AddFile(filename, -1, len(content)) + f.SetLinesForContent(content) + return &TokenConverter{fset: fset, file: f} +} + +// IsPoint returns true if the range represents a single point. +func (r Range) IsPoint() bool { + return r.Start == r.End +} + +// Span converts a Range to a Span that represents the Range. +// It will fill in all the members of the Span, calculating the line and column +// information. +func (r Range) Span() (Span, error) { + f := r.FileSet.File(r.Start) + if f == nil { + return Span{}, fmt.Errorf("file not found in FileSet") + } + s := Span{v: span{URI: FileURI(f.Name())}} + var err error + s.v.Start.Offset, err = offset(f, r.Start) + if err != nil { + return Span{}, err + } + if r.End.IsValid() { + s.v.End.Offset, err = offset(f, r.End) + if err != nil { + return Span{}, err + } + } + s.v.Start.clean() + s.v.End.clean() + s.v.clean() + converter := NewTokenConverter(r.FileSet, f) + return s.WithPosition(converter) +} + +// offset is a copy of the Offset function in go/token, but with the adjustment +// that it does not panic on invalid positions. +func offset(f *token.File, pos token.Pos) (int, error) { + if int(pos) < f.Base() || int(pos) > f.Base()+f.Size() { + return 0, fmt.Errorf("invalid pos") + } + return int(pos) - f.Base(), nil +} + +// Range converts a Span to a Range that represents the Span for the supplied +// File. +func (s Span) Range(converter *TokenConverter) (Range, error) { + s, err := s.WithOffset(converter) + if err != nil { + return Range{}, err + } + // go/token will panic if the offset is larger than the file's size, + // so check here to avoid panicking. + if s.Start().Offset() > converter.file.Size() { + return Range{}, fmt.Errorf("start offset %v is past the end of the file %v", s.Start(), converter.file.Size()) + } + if s.End().Offset() > converter.file.Size() { + return Range{}, fmt.Errorf("end offset %v is past the end of the file %v", s.End(), converter.file.Size()) + } + return Range{ + FileSet: converter.fset, + Start: converter.file.Pos(s.Start().Offset()), + End: converter.file.Pos(s.End().Offset()), + }, nil +} + +func (l *TokenConverter) ToPosition(offset int) (int, int, error) { + if offset > l.file.Size() { + return 0, 0, fmt.Errorf("offset %v is past the end of the file %v", offset, l.file.Size()) + } + pos := l.file.Pos(offset) + p := l.fset.Position(pos) + if offset == l.file.Size() { + return p.Line + 1, 1, nil + } + return p.Line, p.Column, nil +} + +func (l *TokenConverter) ToOffset(line, col int) (int, error) { + if line < 0 { + return -1, fmt.Errorf("line is not valid") + } + lineMax := l.file.LineCount() + 1 + if line > lineMax { + return -1, fmt.Errorf("line is beyond end of file %v", lineMax) + } else if line == lineMax { + if col > 1 { + return -1, fmt.Errorf("column is beyond end of file") + } + // at the end of the file, allowing for a trailing eol + return l.file.Size(), nil + } + pos := lineStart(l.file, line) + if !pos.IsValid() { + return -1, fmt.Errorf("line is not in file") + } + // we assume that column is in bytes here, and that the first byte of a + // line is at column 1 + pos += token.Pos(col - 1) + return offset(l.file, pos) +} diff --git a/vendor/golang.org/x/tools/internal/span/token111.go b/vendor/golang.org/x/tools/internal/span/token111.go new file mode 100644 index 00000000..bf7a5406 --- /dev/null +++ b/vendor/golang.org/x/tools/internal/span/token111.go @@ -0,0 +1,39 @@ +// Copyright 2019 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build !go1.12 + +package span + +import ( + "go/token" +) + +// lineStart is the pre-Go 1.12 version of (*token.File).LineStart. For Go +// versions <= 1.11, we borrow logic from the analysisutil package. +// TODO(rstambler): Delete this file when we no longer support Go 1.11. +func lineStart(f *token.File, line int) token.Pos { + // Use binary search to find the start offset of this line. + + min := 0 // inclusive + max := f.Size() // exclusive + for { + offset := (min + max) / 2 + pos := f.Pos(offset) + posn := f.Position(pos) + if posn.Line == line { + return pos - (token.Pos(posn.Column) - 1) + } + + if min+1 >= max { + return token.NoPos + } + + if posn.Line < line { + min = offset + } else { + max = offset + } + } +} diff --git a/vendor/golang.org/x/tools/internal/span/token112.go b/vendor/golang.org/x/tools/internal/span/token112.go new file mode 100644 index 00000000..017aec9c --- /dev/null +++ b/vendor/golang.org/x/tools/internal/span/token112.go @@ -0,0 +1,16 @@ +// Copyright 2019 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build go1.12 + +package span + +import ( + "go/token" +) + +// TODO(rstambler): Delete this file when we no longer support Go 1.11. +func lineStart(f *token.File, line int) token.Pos { + return f.LineStart(line) +} diff --git a/vendor/golang.org/x/tools/internal/span/uri.go b/vendor/golang.org/x/tools/internal/span/uri.go new file mode 100644 index 00000000..e05a9e6e --- /dev/null +++ b/vendor/golang.org/x/tools/internal/span/uri.go @@ -0,0 +1,152 @@ +// Copyright 2019 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package span + +import ( + "fmt" + "net/url" + "os" + "path" + "path/filepath" + "runtime" + "strings" + "unicode" +) + +const fileScheme = "file" + +// URI represents the full URI for a file. +type URI string + +// Filename returns the file path for the given URI. +// It is an error to call this on a URI that is not a valid filename. +func (uri URI) Filename() string { + filename, err := filename(uri) + if err != nil { + panic(err) + } + return filepath.FromSlash(filename) +} + +func filename(uri URI) (string, error) { + if uri == "" { + return "", nil + } + u, err := url.ParseRequestURI(string(uri)) + if err != nil { + return "", err + } + if u.Scheme != fileScheme { + return "", fmt.Errorf("only file URIs are supported, got %q from %q", u.Scheme, uri) + } + if isWindowsDriveURI(u.Path) { + u.Path = u.Path[1:] + } + return u.Path, nil +} + +// NewURI returns a span URI for the string. +// It will attempt to detect if the string is a file path or uri. +func NewURI(s string) URI { + if u, err := url.PathUnescape(s); err == nil { + s = u + } + if strings.HasPrefix(s, fileScheme+"://") { + return URI(s) + } + return FileURI(s) +} + +func CompareURI(a, b URI) int { + if equalURI(a, b) { + return 0 + } + if a < b { + return -1 + } + return 1 +} + +func equalURI(a, b URI) bool { + if a == b { + return true + } + // If we have the same URI basename, we may still have the same file URIs. + if !strings.EqualFold(path.Base(string(a)), path.Base(string(b))) { + return false + } + fa, err := filename(a) + if err != nil { + return false + } + fb, err := filename(b) + if err != nil { + return false + } + // Stat the files to check if they are equal. + infoa, err := os.Stat(filepath.FromSlash(fa)) + if err != nil { + return false + } + infob, err := os.Stat(filepath.FromSlash(fb)) + if err != nil { + return false + } + return os.SameFile(infoa, infob) +} + +// FileURI returns a span URI for the supplied file path. +// It will always have the file scheme. +func FileURI(path string) URI { + if path == "" { + return "" + } + // Handle standard library paths that contain the literal "$GOROOT". + // TODO(rstambler): The go/packages API should allow one to determine a user's $GOROOT. + const prefix = "$GOROOT" + if len(path) >= len(prefix) && strings.EqualFold(prefix, path[:len(prefix)]) { + suffix := path[len(prefix):] + path = runtime.GOROOT() + suffix + } + if !isWindowsDrivePath(path) { + if abs, err := filepath.Abs(path); err == nil { + path = abs + } + } + // Check the file path again, in case it became absolute. + if isWindowsDrivePath(path) { + path = "/" + path + } + path = filepath.ToSlash(path) + u := url.URL{ + Scheme: fileScheme, + Path: path, + } + uri := u.String() + if unescaped, err := url.PathUnescape(uri); err == nil { + uri = unescaped + } + return URI(uri) +} + +// isWindowsDrivePath returns true if the file path is of the form used by +// Windows. We check if the path begins with a drive letter, followed by a ":". +func isWindowsDrivePath(path string) bool { + if len(path) < 4 { + return false + } + return unicode.IsLetter(rune(path[0])) && path[1] == ':' +} + +// isWindowsDriveURI returns true if the file URI is of the format used by +// Windows URIs. The url.Parse package does not specially handle Windows paths +// (see https://golang.org/issue/6027). We check if the URI path has +// a drive prefix (e.g. "/C:"). If so, we trim the leading "/". +func isWindowsDriveURI(uri string) bool { + if len(uri) < 4 { + return false + } + return uri[0] == '/' && unicode.IsLetter(rune(uri[1])) && uri[2] == ':' +} diff --git a/vendor/golang.org/x/tools/internal/span/utf16.go b/vendor/golang.org/x/tools/internal/span/utf16.go new file mode 100644 index 00000000..561b3fa5 --- /dev/null +++ b/vendor/golang.org/x/tools/internal/span/utf16.go @@ -0,0 +1,94 @@ +// Copyright 2019 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package span + +import ( + "fmt" + "unicode/utf16" + "unicode/utf8" +) + +// ToUTF16Column calculates the utf16 column expressed by the point given the +// supplied file contents. +// This is used to convert from the native (always in bytes) column +// representation and the utf16 counts used by some editors. +func ToUTF16Column(p Point, content []byte) (int, error) { + if content == nil { + return -1, fmt.Errorf("ToUTF16Column: missing content") + } + if !p.HasPosition() { + return -1, fmt.Errorf("ToUTF16Column: point is missing position") + } + if !p.HasOffset() { + return -1, fmt.Errorf("ToUTF16Column: point is missing offset") + } + offset := p.Offset() // 0-based + colZero := p.Column() - 1 // 0-based + if colZero == 0 { + // 0-based column 0, so it must be chr 1 + return 1, nil + } else if colZero < 0 { + return -1, fmt.Errorf("ToUTF16Column: column is invalid (%v)", colZero) + } + // work out the offset at the start of the line using the column + lineOffset := offset - colZero + if lineOffset < 0 || offset > len(content) { + return -1, fmt.Errorf("ToUTF16Column: offsets %v-%v outside file contents (%v)", lineOffset, offset, len(content)) + } + // Use the offset to pick out the line start. + // This cannot panic: offset > len(content) and lineOffset < offset. + start := content[lineOffset:] + + // Now, truncate down to the supplied column. + start = start[:colZero] + + // and count the number of utf16 characters + // in theory we could do this by hand more efficiently... + return len(utf16.Encode([]rune(string(start)))) + 1, nil +} + +// FromUTF16Column advances the point by the utf16 character offset given the +// supplied line contents. +// This is used to convert from the utf16 counts used by some editors to the +// native (always in bytes) column representation. +func FromUTF16Column(p Point, chr int, content []byte) (Point, error) { + if !p.HasOffset() { + return Point{}, fmt.Errorf("FromUTF16Column: point is missing offset") + } + // if chr is 1 then no adjustment needed + if chr <= 1 { + return p, nil + } + if p.Offset() >= len(content) { + return p, fmt.Errorf("FromUTF16Column: offset (%v) greater than length of content (%v)", p.Offset(), len(content)) + } + remains := content[p.Offset():] + // scan forward the specified number of characters + for count := 1; count < chr; count++ { + if len(remains) <= 0 { + return Point{}, fmt.Errorf("FromUTF16Column: chr goes beyond the content") + } + r, w := utf8.DecodeRune(remains) + if r == '\n' { + // Per the LSP spec: + // + // > If the character value is greater than the line length it + // > defaults back to the line length. + break + } + remains = remains[w:] + if r >= 0x10000 { + // a two point rune + count++ + // if we finished in a two point rune, do not advance past the first + if count >= chr { + break + } + } + p.v.Column += w + p.v.Offset += w + } + return p, nil +} diff --git a/vendor/github.com/rancher/types/LICENSE b/vendor/k8s.io/gengo/LICENSE similarity index 89% rename from vendor/github.com/rancher/types/LICENSE rename to vendor/k8s.io/gengo/LICENSE index f433b1a5..00b24011 100644 --- a/vendor/github.com/rancher/types/LICENSE +++ b/vendor/k8s.io/gengo/LICENSE @@ -175,3 +175,28 @@ 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 2014 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. diff --git a/vendor/k8s.io/gengo/args/args.go b/vendor/k8s.io/gengo/args/args.go new file mode 100644 index 00000000..49cc76da --- /dev/null +++ b/vendor/k8s.io/gengo/args/args.go @@ -0,0 +1,212 @@ +/* +Copyright 2015 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 args has common command-line flags for generation programs. +package args + +import ( + "bytes" + goflag "flag" + "fmt" + "io/ioutil" + "os" + "path" + "path/filepath" + "strconv" + "strings" + "time" + + "k8s.io/gengo/generator" + "k8s.io/gengo/namer" + "k8s.io/gengo/parser" + "k8s.io/gengo/types" + + "github.com/spf13/pflag" +) + +// Default returns a defaulted GeneratorArgs. You may change the defaults +// before calling AddFlags. +func Default() *GeneratorArgs { + return &GeneratorArgs{ + OutputBase: DefaultSourceTree(), + GoHeaderFilePath: filepath.Join(DefaultSourceTree(), "k8s.io/gengo/boilerplate/boilerplate.go.txt"), + GeneratedBuildTag: "ignore_autogenerated", + GeneratedByCommentTemplate: "// Code generated by GENERATOR_NAME. DO NOT EDIT.", + defaultCommandLineFlags: true, + } +} + +// GeneratorArgs has arguments that are passed to generators. +type GeneratorArgs struct { + // Which directories to parse. + InputDirs []string + + // Source tree to write results to. + OutputBase string + + // Package path within the source tree. + OutputPackagePath string + + // Output file name. + OutputFileBaseName string + + // Where to get copyright header text. + GoHeaderFilePath string + + // If GeneratedByCommentTemplate is set, generate a "Code generated by" comment + // below the bloilerplate, of the format defined by this string. + // Any instances of "GENERATOR_NAME" will be replaced with the name of the code generator. + GeneratedByCommentTemplate string + + // If true, only verify, don't write anything. + VerifyOnly bool + + // If true, include *_test.go files + IncludeTestFiles bool + + // GeneratedBuildTag is the tag used to identify code generated by execution + // of this type. Each generator should use a different tag, and different + // groups of generators (external API that depends on Kube generations) should + // keep tags distinct as well. + GeneratedBuildTag string + + // Any custom arguments go here + CustomArgs interface{} + + // Whether to use default command line flags + defaultCommandLineFlags bool +} + +// WithoutDefaultFlagParsing disables implicit addition of command line flags and parsing. +func (g *GeneratorArgs) WithoutDefaultFlagParsing() *GeneratorArgs { + g.defaultCommandLineFlags = false + return g +} + +func (g *GeneratorArgs) AddFlags(fs *pflag.FlagSet) { + fs.StringSliceVarP(&g.InputDirs, "input-dirs", "i", g.InputDirs, "Comma-separated list of import paths to get input types from.") + fs.StringVarP(&g.OutputBase, "output-base", "o", g.OutputBase, "Output base; defaults to $GOPATH/src/ or ./ if $GOPATH is not set.") + fs.StringVarP(&g.OutputPackagePath, "output-package", "p", g.OutputPackagePath, "Base package path.") + fs.StringVarP(&g.OutputFileBaseName, "output-file-base", "O", g.OutputFileBaseName, "Base name (without .go suffix) for output files.") + fs.StringVarP(&g.GoHeaderFilePath, "go-header-file", "h", g.GoHeaderFilePath, "File containing boilerplate header text. The string YEAR will be replaced with the current 4-digit year.") + fs.BoolVar(&g.VerifyOnly, "verify-only", g.VerifyOnly, "If true, only verify existing output, do not write anything.") + fs.StringVar(&g.GeneratedBuildTag, "build-tag", g.GeneratedBuildTag, "A Go build tag to use to identify files generated by this command. Should be unique.") +} + +// LoadGoBoilerplate loads the boilerplate file passed to --go-header-file. +func (g *GeneratorArgs) LoadGoBoilerplate() ([]byte, error) { + b, err := ioutil.ReadFile(g.GoHeaderFilePath) + if err != nil { + return nil, err + } + b = bytes.Replace(b, []byte("YEAR"), []byte(strconv.Itoa(time.Now().UTC().Year())), -1) + + if g.GeneratedByCommentTemplate != "" { + if len(b) != 0 { + b = append(b, byte('\n')) + } + generatorName := path.Base(os.Args[0]) + generatedByComment := strings.Replace(g.GeneratedByCommentTemplate, "GENERATOR_NAME", generatorName, -1) + s := fmt.Sprintf("%s\n\n", generatedByComment) + b = append(b, []byte(s)...) + } + return b, nil +} + +// NewBuilder makes a new parser.Builder and populates it with the input +// directories. +func (g *GeneratorArgs) NewBuilder() (*parser.Builder, error) { + b := parser.New() + + // flag for including *_test.go + b.IncludeTestFiles = g.IncludeTestFiles + + // Ignore all auto-generated files. + b.AddBuildTags(g.GeneratedBuildTag) + + for _, d := range g.InputDirs { + var err error + if strings.HasSuffix(d, "/...") { + err = b.AddDirRecursive(strings.TrimSuffix(d, "/...")) + } else { + err = b.AddDir(d) + } + if err != nil { + return nil, fmt.Errorf("unable to add directory %q: %v", d, err) + } + } + return b, nil +} + +// InputIncludes returns true if the given package is a (sub) package of one of +// the InputDirs. +func (g *GeneratorArgs) InputIncludes(p *types.Package) bool { + for _, dir := range g.InputDirs { + d := dir + if strings.HasSuffix(d, "...") { + d = strings.TrimSuffix(d, "...") + } + if strings.HasPrefix(d, "./vendor/") { + d = strings.TrimPrefix(d, "./vendor/") + } + if strings.HasPrefix(p.Path, d) { + return true + } + } + return false +} + +// DefaultSourceTree returns the /src directory of the first entry in $GOPATH. +// If $GOPATH is empty, it returns "./". Useful as a default output location. +func DefaultSourceTree() string { + paths := strings.Split(os.Getenv("GOPATH"), string(filepath.ListSeparator)) + if len(paths) > 0 && len(paths[0]) > 0 { + return filepath.Join(paths[0], "src") + } + return "./" +} + +// Execute implements main(). +// If you don't need any non-default behavior, use as: +// args.Default().Execute(...) +func (g *GeneratorArgs) Execute(nameSystems namer.NameSystems, defaultSystem string, pkgs func(*generator.Context, *GeneratorArgs) generator.Packages) error { + if g.defaultCommandLineFlags { + g.AddFlags(pflag.CommandLine) + pflag.CommandLine.AddGoFlagSet(goflag.CommandLine) + pflag.Parse() + } + + b, err := g.NewBuilder() + if err != nil { + return fmt.Errorf("Failed making a parser: %v", err) + } + + // pass through the flag on whether to include *_test.go files + b.IncludeTestFiles = g.IncludeTestFiles + + c, err := generator.NewContext(b, nameSystems, defaultSystem) + if err != nil { + return fmt.Errorf("Failed making a context: %v", err) + } + + c.Verify = g.VerifyOnly + packages := pkgs(c, g) + if err := c.ExecutePackages(g.OutputBase, packages); err != nil { + return fmt.Errorf("Failed executing generator: %v", err) + } + + return nil +} diff --git a/vendor/k8s.io/gengo/examples/deepcopy-gen/.gitignore b/vendor/k8s.io/gengo/examples/deepcopy-gen/.gitignore new file mode 100644 index 00000000..eab8184d --- /dev/null +++ b/vendor/k8s.io/gengo/examples/deepcopy-gen/.gitignore @@ -0,0 +1 @@ +deepcopy-gen diff --git a/vendor/k8s.io/gengo/examples/deepcopy-gen/Makefile b/vendor/k8s.io/gengo/examples/deepcopy-gen/Makefile new file mode 100644 index 00000000..66af5608 --- /dev/null +++ b/vendor/k8s.io/gengo/examples/deepcopy-gen/Makefile @@ -0,0 +1,16 @@ +TOOL=deepcopy-gen + +test: + @if ! git diff --quiet HEAD; then \ + echo "FAIL: git client is not clean"; \ + false; \ + fi + @go build -o /tmp/$(TOOL) + @PKGS=$$(go list ./output_tests/... | paste -sd' ' -); \ + /tmp/$(TOOL) --logtostderr --v=4 -i $$(echo $$PKGS | sed 's/ /,/g') -O zz_generated + @if ! git diff --quiet HEAD; then \ + echo "FAIL: output files changed"; \ + git diff; \ + false; \ + fi + diff --git a/vendor/k8s.io/gengo/examples/deepcopy-gen/generators/deepcopy.go b/vendor/k8s.io/gengo/examples/deepcopy-gen/generators/deepcopy.go new file mode 100644 index 00000000..40f1306d --- /dev/null +++ b/vendor/k8s.io/gengo/examples/deepcopy-gen/generators/deepcopy.go @@ -0,0 +1,924 @@ +/* +Copyright 2015 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 generators + +import ( + "fmt" + "io" + "path/filepath" + "sort" + "strings" + + "k8s.io/gengo/args" + "k8s.io/gengo/examples/set-gen/sets" + "k8s.io/gengo/generator" + "k8s.io/gengo/namer" + "k8s.io/gengo/types" + + "k8s.io/klog" +) + +// CustomArgs is used tby the go2idl framework to pass args specific to this +// generator. +type CustomArgs struct { + BoundingDirs []string // Only deal with types rooted under these dirs. +} + +// This is the comment tag that carries parameters for deep-copy generation. +const ( + tagEnabledName = "k8s:deepcopy-gen" + interfacesTagName = tagEnabledName + ":interfaces" + interfacesNonPointerTagName = tagEnabledName + ":nonpointer-interfaces" // attach the DeepCopy methods to the +) + +// Known values for the comment tag. +const tagValuePackage = "package" + +// enabledTagValue holds parameters from a tagName tag. +type enabledTagValue struct { + value string + register bool +} + +func extractEnabledTypeTag(t *types.Type) *enabledTagValue { + comments := append(append([]string{}, t.SecondClosestCommentLines...), t.CommentLines...) + return extractEnabledTag(comments) +} + +func extractEnabledTag(comments []string) *enabledTagValue { + tagVals := types.ExtractCommentTags("+", comments)[tagEnabledName] + if tagVals == nil { + // No match for the tag. + return nil + } + // If there are multiple values, abort. + if len(tagVals) > 1 { + klog.Fatalf("Found %d %s tags: %q", len(tagVals), tagEnabledName, tagVals) + } + + // If we got here we are returning something. + tag := &enabledTagValue{} + + // Get the primary value. + parts := strings.Split(tagVals[0], ",") + if len(parts) >= 1 { + tag.value = parts[0] + } + + // Parse extra arguments. + parts = parts[1:] + for i := range parts { + kv := strings.SplitN(parts[i], "=", 2) + k := kv[0] + v := "" + if len(kv) == 2 { + v = kv[1] + } + switch k { + case "register": + if v != "false" { + tag.register = true + } + default: + klog.Fatalf("Unsupported %s param: %q", tagEnabledName, parts[i]) + } + } + return tag +} + +// TODO: This is created only to reduce number of changes in a single PR. +// Remove it and use PublicNamer instead. +func deepCopyNamer() *namer.NameStrategy { + return &namer.NameStrategy{ + Join: func(pre string, in []string, post string) string { + return strings.Join(in, "_") + }, + PrependPackageNames: 1, + } +} + +// NameSystems returns the name system used by the generators in this package. +func NameSystems() namer.NameSystems { + return namer.NameSystems{ + "public": deepCopyNamer(), + "raw": namer.NewRawNamer("", nil), + } +} + +// DefaultNameSystem returns the default name system for ordering the types to be +// processed by the generators in this package. +func DefaultNameSystem() string { + return "public" +} + +func Packages(context *generator.Context, arguments *args.GeneratorArgs) generator.Packages { + boilerplate, err := arguments.LoadGoBoilerplate() + if err != nil { + klog.Fatalf("Failed loading boilerplate: %v", err) + } + + inputs := sets.NewString(context.Inputs...) + packages := generator.Packages{} + header := append([]byte(fmt.Sprintf("// +build !%s\n\n", arguments.GeneratedBuildTag)), boilerplate...) + + boundingDirs := []string{} + if customArgs, ok := arguments.CustomArgs.(*CustomArgs); ok { + if customArgs.BoundingDirs == nil { + customArgs.BoundingDirs = context.Inputs + } + for i := range customArgs.BoundingDirs { + // Strip any trailing slashes - they are not exactly "correct" but + // this is friendlier. + boundingDirs = append(boundingDirs, strings.TrimRight(customArgs.BoundingDirs[i], "/")) + } + } + + for i := range inputs { + klog.V(5).Infof("Considering pkg %q", i) + pkg := context.Universe[i] + if pkg == nil { + // If the input had no Go files, for example. + continue + } + + ptag := extractEnabledTag(pkg.Comments) + ptagValue := "" + ptagRegister := false + if ptag != nil { + ptagValue = ptag.value + if ptagValue != tagValuePackage { + klog.Fatalf("Package %v: unsupported %s value: %q", i, tagEnabledName, ptagValue) + } + ptagRegister = ptag.register + klog.V(5).Infof(" tag.value: %q, tag.register: %t", ptagValue, ptagRegister) + } else { + klog.V(5).Infof(" no tag") + } + + // If the pkg-scoped tag says to generate, we can skip scanning types. + pkgNeedsGeneration := (ptagValue == tagValuePackage) + if !pkgNeedsGeneration { + // If the pkg-scoped tag did not exist, scan all types for one that + // explicitly wants generation. + for _, t := range pkg.Types { + klog.V(5).Infof(" considering type %q", t.Name.String()) + ttag := extractEnabledTypeTag(t) + if ttag != nil && ttag.value == "true" { + klog.V(5).Infof(" tag=true") + if !copyableType(t) { + klog.Fatalf("Type %v requests deepcopy generation but is not copyable", t) + } + pkgNeedsGeneration = true + break + } + } + } + + if pkgNeedsGeneration { + klog.V(3).Infof("Package %q needs generation", i) + path := pkg.Path + // if the source path is within a /vendor/ directory (for example, + // k8s.io/kubernetes/vendor/k8s.io/apimachinery/pkg/apis/meta/v1), allow + // generation to output to the proper relative path (under vendor). + // Otherwise, the generator will create the file in the wrong location + // in the output directory. + // TODO: build a more fundamental concept in gengo for dealing with modifications + // to vendored packages. + if strings.HasPrefix(pkg.SourcePath, arguments.OutputBase) { + expandedPath := strings.TrimPrefix(pkg.SourcePath, arguments.OutputBase) + if strings.Contains(expandedPath, "/vendor/") { + path = expandedPath + } + } + packages = append(packages, + &generator.DefaultPackage{ + PackageName: strings.Split(filepath.Base(pkg.Path), ".")[0], + PackagePath: path, + HeaderText: header, + GeneratorFunc: func(c *generator.Context) (generators []generator.Generator) { + return []generator.Generator{ + NewGenDeepCopy(arguments.OutputFileBaseName, pkg.Path, boundingDirs, (ptagValue == tagValuePackage), ptagRegister), + } + }, + FilterFunc: func(c *generator.Context, t *types.Type) bool { + return t.Name.Package == pkg.Path + }, + }) + } + } + return packages +} + +// genDeepCopy produces a file with autogenerated deep-copy functions. +type genDeepCopy struct { + generator.DefaultGen + targetPackage string + boundingDirs []string + allTypes bool + registerTypes bool + imports namer.ImportTracker + typesForInit []*types.Type +} + +func NewGenDeepCopy(sanitizedName, targetPackage string, boundingDirs []string, allTypes, registerTypes bool) generator.Generator { + return &genDeepCopy{ + DefaultGen: generator.DefaultGen{ + OptionalName: sanitizedName, + }, + targetPackage: targetPackage, + boundingDirs: boundingDirs, + allTypes: allTypes, + registerTypes: registerTypes, + imports: generator.NewImportTracker(), + typesForInit: make([]*types.Type, 0), + } +} + +func (g *genDeepCopy) Namers(c *generator.Context) namer.NameSystems { + // Have the raw namer for this file track what it imports. + return namer.NameSystems{ + "raw": namer.NewRawNamer(g.targetPackage, g.imports), + } +} + +func (g *genDeepCopy) Filter(c *generator.Context, t *types.Type) bool { + // Filter out types not being processed or not copyable within the package. + enabled := g.allTypes + if !enabled { + ttag := extractEnabledTypeTag(t) + if ttag != nil && ttag.value == "true" { + enabled = true + } + } + if !enabled { + return false + } + if !copyableType(t) { + klog.V(2).Infof("Type %v is not copyable", t) + return false + } + klog.V(4).Infof("Type %v is copyable", t) + g.typesForInit = append(g.typesForInit, t) + return true +} + +func (g *genDeepCopy) copyableAndInBounds(t *types.Type) bool { + if !copyableType(t) { + return false + } + // Only packages within the restricted range can be processed. + if !isRootedUnder(t.Name.Package, g.boundingDirs) { + return false + } + return true +} + +// deepCopyMethod returns the signature of a DeepCopy() method, nil or an error +// if the type does not match. This allows more efficient deep copy +// implementations to be defined by the type's author. The correct signature +// for a type T is: +// func (t T) DeepCopy() T +// or: +// func (t *T) DeepCopy() *T +func deepCopyMethod(t *types.Type) (*types.Signature, error) { + f, found := t.Methods["DeepCopy"] + if !found { + return nil, nil + } + if len(f.Signature.Parameters) != 0 { + return nil, fmt.Errorf("type %v: invalid DeepCopy signature, expected no parameters", t) + } + if len(f.Signature.Results) != 1 { + return nil, fmt.Errorf("type %v: invalid DeepCopy signature, expected exactly one result", t) + } + + ptrResult := f.Signature.Results[0].Kind == types.Pointer && f.Signature.Results[0].Elem.Name == t.Name + nonPtrResult := f.Signature.Results[0].Name == t.Name + + if !ptrResult && !nonPtrResult { + return nil, fmt.Errorf("type %v: invalid DeepCopy signature, expected to return %s or *%s", t, t.Name.Name, t.Name.Name) + } + + ptrRcvr := f.Signature.Receiver != nil && f.Signature.Receiver.Kind == types.Pointer && f.Signature.Receiver.Elem.Name == t.Name + nonPtrRcvr := f.Signature.Receiver != nil && f.Signature.Receiver.Name == t.Name + + if ptrRcvr && !ptrResult { + return nil, fmt.Errorf("type %v: invalid DeepCopy signature, expected a *%s result for a *%s receiver", t, t.Name.Name, t.Name.Name) + } + if nonPtrRcvr && !nonPtrResult { + return nil, fmt.Errorf("type %v: invalid DeepCopy signature, expected a %s result for a %s receiver", t, t.Name.Name, t.Name.Name) + } + + return f.Signature, nil +} + +// deepCopyMethodOrDie returns the signatrue of a DeepCopy method, nil or calls klog.Fatalf +// if the type does not match. +func deepCopyMethodOrDie(t *types.Type) *types.Signature { + ret, err := deepCopyMethod(t) + if err != nil { + klog.Fatal(err) + } + return ret +} + +// deepCopyIntoMethod returns the signature of a DeepCopyInto() method, nil or an error +// if the type is wrong. DeepCopyInto allows more efficient deep copy +// implementations to be defined by the type's author. The correct signature +// for a type T is: +// func (t T) DeepCopyInto(t *T) +// or: +// func (t *T) DeepCopyInto(t *T) +func deepCopyIntoMethod(t *types.Type) (*types.Signature, error) { + f, found := t.Methods["DeepCopyInto"] + if !found { + return nil, nil + } + if len(f.Signature.Parameters) != 1 { + return nil, fmt.Errorf("type %v: invalid DeepCopy signature, expected exactly one parameter", t) + } + if len(f.Signature.Results) != 0 { + return nil, fmt.Errorf("type %v: invalid DeepCopy signature, expected no result type", t) + } + + ptrParam := f.Signature.Parameters[0].Kind == types.Pointer && f.Signature.Parameters[0].Elem.Name == t.Name + + if !ptrParam { + return nil, fmt.Errorf("type %v: invalid DeepCopy signature, expected parameter of type *%s", t, t.Name.Name) + } + + ptrRcvr := f.Signature.Receiver != nil && f.Signature.Receiver.Kind == types.Pointer && f.Signature.Receiver.Elem.Name == t.Name + nonPtrRcvr := f.Signature.Receiver != nil && f.Signature.Receiver.Name == t.Name + + if !ptrRcvr && !nonPtrRcvr { + // this should never happen + return nil, fmt.Errorf("type %v: invalid DeepCopy signature, expected a receiver of type %s or *%s", t, t.Name.Name, t.Name.Name) + } + + return f.Signature, nil +} + +// deepCopyIntoMethodOrDie returns the signature of a DeepCopyInto() method, nil or calls klog.Fatalf +// if the type is wrong. +func deepCopyIntoMethodOrDie(t *types.Type) *types.Signature { + ret, err := deepCopyIntoMethod(t) + if err != nil { + klog.Fatal(err) + } + return ret +} + +func isRootedUnder(pkg string, roots []string) bool { + // Add trailing / to avoid false matches, e.g. foo/bar vs foo/barn. This + // assumes that bounding dirs do not have trailing slashes. + pkg = pkg + "/" + for _, root := range roots { + if strings.HasPrefix(pkg, root+"/") { + return true + } + } + return false +} + +func copyableType(t *types.Type) bool { + // If the type opts out of copy-generation, stop. + ttag := extractEnabledTypeTag(t) + if ttag != nil && ttag.value == "false" { + return false + } + + // Filter out private types. + if namer.IsPrivateGoName(t.Name.Name) { + return false + } + + if t.Kind == types.Alias { + // if the underlying built-in is not deepcopy-able, deepcopy is opt-in through definition of custom methods. + // Note that aliases of builtins, maps, slices can have deepcopy methods. + if deepCopyMethodOrDie(t) != nil || deepCopyIntoMethodOrDie(t) != nil { + return true + } else { + return t.Underlying.Kind != types.Builtin || copyableType(t.Underlying) + } + } + + if t.Kind != types.Struct { + return false + } + + return true +} + +func underlyingType(t *types.Type) *types.Type { + for t.Kind == types.Alias { + t = t.Underlying + } + return t +} + +func (g *genDeepCopy) isOtherPackage(pkg string) bool { + if pkg == g.targetPackage { + return false + } + if strings.HasSuffix(pkg, "\""+g.targetPackage+"\"") { + return false + } + return true +} + +func (g *genDeepCopy) Imports(c *generator.Context) (imports []string) { + importLines := []string{} + for _, singleImport := range g.imports.ImportLines() { + if g.isOtherPackage(singleImport) { + importLines = append(importLines, singleImport) + } + } + return importLines +} + +func argsFromType(ts ...*types.Type) generator.Args { + a := generator.Args{ + "type": ts[0], + } + for i, t := range ts { + a[fmt.Sprintf("type%d", i+1)] = t + } + return a +} + +func (g *genDeepCopy) Init(c *generator.Context, w io.Writer) error { + return nil +} + +func (g *genDeepCopy) needsGeneration(t *types.Type) bool { + tag := extractEnabledTypeTag(t) + tv := "" + if tag != nil { + tv = tag.value + if tv != "true" && tv != "false" { + klog.Fatalf("Type %v: unsupported %s value: %q", t, tagEnabledName, tag.value) + } + } + if g.allTypes && tv == "false" { + // The whole package is being generated, but this type has opted out. + klog.V(5).Infof("Not generating for type %v because type opted out", t) + return false + } + if !g.allTypes && tv != "true" { + // The whole package is NOT being generated, and this type has NOT opted in. + klog.V(5).Infof("Not generating for type %v because type did not opt in", t) + return false + } + return true +} + +func extractInterfacesTag(t *types.Type) []string { + var result []string + comments := append(append([]string{}, t.SecondClosestCommentLines...), t.CommentLines...) + values := types.ExtractCommentTags("+", comments)[interfacesTagName] + for _, v := range values { + if len(v) == 0 { + continue + } + intfs := strings.Split(v, ",") + for _, intf := range intfs { + if intf == "" { + continue + } + result = append(result, intf) + } + } + return result +} + +func extractNonPointerInterfaces(t *types.Type) (bool, error) { + comments := append(append([]string{}, t.SecondClosestCommentLines...), t.CommentLines...) + values := types.ExtractCommentTags("+", comments)[interfacesNonPointerTagName] + if len(values) == 0 { + return false, nil + } + result := values[0] == "true" + for _, v := range values { + if v == "true" != result { + return false, fmt.Errorf("contradicting %v value %q found to previous value %v", interfacesNonPointerTagName, v, result) + } + } + return result, nil +} + +func (g *genDeepCopy) deepCopyableInterfacesInner(c *generator.Context, t *types.Type) ([]*types.Type, error) { + if t.Kind != types.Struct { + return nil, nil + } + + intfs := extractInterfacesTag(t) + + var ts []*types.Type + for _, intf := range intfs { + t := types.ParseFullyQualifiedName(intf) + c.AddDir(t.Package) + intfT := c.Universe.Type(t) + if intfT == nil { + return nil, fmt.Errorf("unknown type %q in %s tag of type %s", intf, interfacesTagName, intfT) + } + if intfT.Kind != types.Interface { + return nil, fmt.Errorf("type %q in %s tag of type %s is not an interface, but: %q", intf, interfacesTagName, t, intfT.Kind) + } + g.imports.AddType(intfT) + ts = append(ts, intfT) + } + + return ts, nil +} + +// deepCopyableInterfaces returns the interface types to implement and whether they apply to a non-pointer receiver. +func (g *genDeepCopy) deepCopyableInterfaces(c *generator.Context, t *types.Type) ([]*types.Type, bool, error) { + ts, err := g.deepCopyableInterfacesInner(c, t) + if err != nil { + return nil, false, err + } + + set := map[string]*types.Type{} + for _, t := range ts { + set[t.String()] = t + } + + result := []*types.Type{} + for _, t := range set { + result = append(result, t) + } + + TypeSlice(result).Sort() // we need a stable sorting because it determines the order in generation + + nonPointerReceiver, err := extractNonPointerInterfaces(t) + if err != nil { + return nil, false, err + } + + return result, nonPointerReceiver, nil +} + +type TypeSlice []*types.Type + +func (s TypeSlice) Len() int { return len(s) } +func (s TypeSlice) Less(i, j int) bool { return s[i].String() < s[j].String() } +func (s TypeSlice) Swap(i, j int) { s[i], s[j] = s[j], s[i] } +func (s TypeSlice) Sort() { sort.Sort(s) } + +func (g *genDeepCopy) GenerateType(c *generator.Context, t *types.Type, w io.Writer) error { + if !g.needsGeneration(t) { + return nil + } + klog.V(5).Infof("Generating deepcopy function for type %v", t) + + sw := generator.NewSnippetWriter(w, c, "$", "$") + args := argsFromType(t) + + if deepCopyIntoMethodOrDie(t) == nil { + sw.Do("// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.\n", args) + if isReference(t) { + sw.Do("func (in $.type|raw$) DeepCopyInto(out *$.type|raw$) {\n", args) + sw.Do("{in:=&in\n", nil) + } else { + sw.Do("func (in *$.type|raw$) DeepCopyInto(out *$.type|raw$) {\n", args) + } + if deepCopyMethodOrDie(t) != nil { + if t.Methods["DeepCopy"].Signature.Receiver.Kind == types.Pointer { + sw.Do("clone := in.DeepCopy()\n", nil) + sw.Do("*out = *clone\n", nil) + } else { + sw.Do("*out = in.DeepCopy()\n", nil) + } + sw.Do("return\n", nil) + } else { + g.generateFor(t, sw) + sw.Do("return\n", nil) + } + if isReference(t) { + sw.Do("}\n", nil) + } + sw.Do("}\n\n", nil) + } + + if deepCopyMethodOrDie(t) == nil { + sw.Do("// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new $.type|raw$.\n", args) + if isReference(t) { + sw.Do("func (in $.type|raw$) DeepCopy() $.type|raw$ {\n", args) + } else { + sw.Do("func (in *$.type|raw$) DeepCopy() *$.type|raw$ {\n", args) + } + sw.Do("if in == nil { return nil }\n", nil) + sw.Do("out := new($.type|raw$)\n", args) + sw.Do("in.DeepCopyInto(out)\n", nil) + if isReference(t) { + sw.Do("return *out\n", nil) + } else { + sw.Do("return out\n", nil) + } + sw.Do("}\n\n", nil) + } + + intfs, nonPointerReceiver, err := g.deepCopyableInterfaces(c, t) + if err != nil { + return err + } + for _, intf := range intfs { + sw.Do(fmt.Sprintf("// DeepCopy%s is an autogenerated deepcopy function, copying the receiver, creating a new $.type2|raw$.\n", intf.Name.Name), argsFromType(t, intf)) + if nonPointerReceiver { + sw.Do(fmt.Sprintf("func (in $.type|raw$) DeepCopy%s() $.type2|raw$ {\n", intf.Name.Name), argsFromType(t, intf)) + sw.Do("return *in.DeepCopy()", nil) + sw.Do("}\n\n", nil) + } else { + sw.Do(fmt.Sprintf("func (in *$.type|raw$) DeepCopy%s() $.type2|raw$ {\n", intf.Name.Name), argsFromType(t, intf)) + sw.Do("if c := in.DeepCopy(); c != nil {\n", nil) + sw.Do("return c\n", nil) + sw.Do("}\n", nil) + sw.Do("return nil\n", nil) + sw.Do("}\n\n", nil) + } + } + + return sw.Error() +} + +// isReference return true for pointer, maps, slices and aliases of those. +func isReference(t *types.Type) bool { + if t.Kind == types.Pointer || t.Kind == types.Map || t.Kind == types.Slice { + return true + } + return t.Kind == types.Alias && isReference(underlyingType(t)) +} + +// we use the system of shadowing 'in' and 'out' so that the same code is valid +// at any nesting level. This makes the autogenerator easy to understand, and +// the compiler shouldn't care. +func (g *genDeepCopy) generateFor(t *types.Type, sw *generator.SnippetWriter) { + // derive inner types if t is an alias. We call the do* methods below with the alias type. + // basic rule: generate according to inner type, but construct objects with the alias type. + ut := underlyingType(t) + + var f func(*types.Type, *generator.SnippetWriter) + switch ut.Kind { + case types.Builtin: + f = g.doBuiltin + case types.Map: + f = g.doMap + case types.Slice: + f = g.doSlice + case types.Struct: + f = g.doStruct + case types.Pointer: + f = g.doPointer + case types.Interface: + // interfaces are handled in-line in the other cases + klog.Fatalf("Hit an interface type %v. This should never happen.", t) + case types.Alias: + // can never happen because we branch on the underlying type which is never an alias + klog.Fatalf("Hit an alias type %v. This should never happen.", t) + default: + klog.Fatalf("Hit an unsupported type %v.", t) + } + f(t, sw) +} + +// doBuiltin generates code for a builtin or an alias to a builtin. The generated code is +// is the same for both cases, i.e. it's the code for the underlying type. +func (g *genDeepCopy) doBuiltin(t *types.Type, sw *generator.SnippetWriter) { + if deepCopyMethodOrDie(t) != nil || deepCopyIntoMethodOrDie(t) != nil { + sw.Do("*out = in.DeepCopy()\n", nil) + return + } + + sw.Do("*out = *in\n", nil) +} + +// doMap generates code for a map or an alias to a map. The generated code is +// is the same for both cases, i.e. it's the code for the underlying type. +func (g *genDeepCopy) doMap(t *types.Type, sw *generator.SnippetWriter) { + ut := underlyingType(t) + uet := underlyingType(ut.Elem) + + if deepCopyMethodOrDie(t) != nil || deepCopyIntoMethodOrDie(t) != nil { + sw.Do("*out = in.DeepCopy()\n", nil) + return + } + + if !ut.Key.IsAssignable() { + klog.Fatalf("Hit an unsupported type %v for: %v", uet, t) + } + + sw.Do("*out = make($.|raw$, len(*in))\n", t) + sw.Do("for key, val := range *in {\n", nil) + dc, dci := deepCopyMethodOrDie(ut.Elem), deepCopyIntoMethodOrDie(ut.Elem) + switch { + case dc != nil || dci != nil: + // Note: a DeepCopy exists because it is added if DeepCopyInto is manually defined + leftPointer := ut.Elem.Kind == types.Pointer + rightPointer := !isReference(ut.Elem) + if dc != nil { + rightPointer = dc.Results[0].Kind == types.Pointer + } + if leftPointer == rightPointer { + sw.Do("(*out)[key] = val.DeepCopy()\n", nil) + } else if leftPointer { + sw.Do("x := val.DeepCopy()\n", nil) + sw.Do("(*out)[key] = &x\n", nil) + } else { + sw.Do("(*out)[key] = *val.DeepCopy()\n", nil) + } + case ut.Elem.IsAnonymousStruct(): // not uet here because it needs type cast + sw.Do("(*out)[key] = val\n", nil) + case uet.IsAssignable(): + sw.Do("(*out)[key] = val\n", nil) + case uet.Kind == types.Interface: + // Note: do not generate code that won't compile as `DeepCopyinterface{}()` is not a valid function + if uet.Name.Name == "interface{}" { + klog.Fatalf("DeepCopy of %q is unsupported. Instead, use named interfaces with DeepCopy as one of the methods.", uet.Name.Name) + } + sw.Do("if val == nil {(*out)[key]=nil} else {\n", nil) + // Note: if t.Elem has been an alias "J" of an interface "I" in Go, we will see it + // as kind Interface of name "J" here, i.e. generate val.DeepCopyJ(). The golang + // parser does not give us the underlying interface name. So we cannot do any better. + sw.Do(fmt.Sprintf("(*out)[key] = val.DeepCopy%s()\n", uet.Name.Name), nil) + sw.Do("}\n", nil) + case uet.Kind == types.Slice || uet.Kind == types.Map || uet.Kind == types.Pointer: + sw.Do("var outVal $.|raw$\n", uet) + sw.Do("if val == nil { (*out)[key] = nil } else {\n", nil) + sw.Do("in, out := &val, &outVal\n", uet) + g.generateFor(ut.Elem, sw) + sw.Do("}\n", nil) + sw.Do("(*out)[key] = outVal\n", nil) + case uet.Kind == types.Struct: + sw.Do("(*out)[key] = *val.DeepCopy()\n", uet) + default: + klog.Fatalf("Hit an unsupported type %v for %v", uet, t) + } + sw.Do("}\n", nil) +} + +// doSlice generates code for a slice or an alias to a slice. The generated code is +// is the same for both cases, i.e. it's the code for the underlying type. +func (g *genDeepCopy) doSlice(t *types.Type, sw *generator.SnippetWriter) { + ut := underlyingType(t) + uet := underlyingType(ut.Elem) + + if deepCopyMethodOrDie(t) != nil || deepCopyIntoMethodOrDie(t) != nil { + sw.Do("*out = in.DeepCopy()\n", nil) + return + } + + sw.Do("*out = make($.|raw$, len(*in))\n", t) + if deepCopyMethodOrDie(ut.Elem) != nil || deepCopyIntoMethodOrDie(ut.Elem) != nil { + sw.Do("for i := range *in {\n", nil) + // Note: a DeepCopyInto exists because it is added if DeepCopy is manually defined + sw.Do("(*in)[i].DeepCopyInto(&(*out)[i])\n", nil) + sw.Do("}\n", nil) + } else if uet.Kind == types.Builtin || uet.IsAssignable() { + sw.Do("copy(*out, *in)\n", nil) + } else { + sw.Do("for i := range *in {\n", nil) + if uet.Kind == types.Slice || uet.Kind == types.Map || uet.Kind == types.Pointer || deepCopyMethodOrDie(ut.Elem) != nil || deepCopyIntoMethodOrDie(ut.Elem) != nil { + sw.Do("if (*in)[i] != nil {\n", nil) + sw.Do("in, out := &(*in)[i], &(*out)[i]\n", nil) + g.generateFor(ut.Elem, sw) + sw.Do("}\n", nil) + } else if uet.Kind == types.Interface { + // Note: do not generate code that won't compile as `DeepCopyinterface{}()` is not a valid function + if uet.Name.Name == "interface{}" { + klog.Fatalf("DeepCopy of %q is unsupported. Instead, use named interfaces with DeepCopy as one of the methods.", uet.Name.Name) + } + sw.Do("if (*in)[i] != nil {\n", nil) + // Note: if t.Elem has been an alias "J" of an interface "I" in Go, we will see it + // as kind Interface of name "J" here, i.e. generate val.DeepCopyJ(). The golang + // parser does not give us the underlying interface name. So we cannot do any better. + sw.Do(fmt.Sprintf("(*out)[i] = (*in)[i].DeepCopy%s()\n", uet.Name.Name), nil) + sw.Do("}\n", nil) + } else if uet.Kind == types.Struct { + sw.Do("(*in)[i].DeepCopyInto(&(*out)[i])\n", nil) + } else { + klog.Fatalf("Hit an unsupported type %v for %v", uet, t) + } + sw.Do("}\n", nil) + } +} + +// doStruct generates code for a struct or an alias to a struct. The generated code is +// is the same for both cases, i.e. it's the code for the underlying type. +func (g *genDeepCopy) doStruct(t *types.Type, sw *generator.SnippetWriter) { + ut := underlyingType(t) + + if deepCopyMethodOrDie(t) != nil || deepCopyIntoMethodOrDie(t) != nil { + sw.Do("*out = in.DeepCopy()\n", nil) + return + } + + // Simple copy covers a lot of cases. + sw.Do("*out = *in\n", nil) + + // Now fix-up fields as needed. + for _, m := range ut.Members { + ft := m.Type + uft := underlyingType(ft) + + args := generator.Args{ + "type": ft, + "kind": ft.Kind, + "name": m.Name, + } + dc, dci := deepCopyMethodOrDie(ft), deepCopyIntoMethodOrDie(ft) + switch { + case dc != nil || dci != nil: + // Note: a DeepCopyInto exists because it is added if DeepCopy is manually defined + leftPointer := ft.Kind == types.Pointer + rightPointer := !isReference(ft) + if dc != nil { + rightPointer = dc.Results[0].Kind == types.Pointer + } + if leftPointer == rightPointer { + sw.Do("out.$.name$ = in.$.name$.DeepCopy()\n", args) + } else if leftPointer { + sw.Do("x := in.$.name$.DeepCopy()\n", args) + sw.Do("out.$.name$ = = &x\n", args) + } else { + sw.Do("in.$.name$.DeepCopyInto(&out.$.name$)\n", args) + } + case uft.Kind == types.Builtin: + // the initial *out = *in was enough + case uft.Kind == types.Map, uft.Kind == types.Slice, uft.Kind == types.Pointer: + // Fixup non-nil reference-semantic types. + sw.Do("if in.$.name$ != nil {\n", args) + sw.Do("in, out := &in.$.name$, &out.$.name$\n", args) + g.generateFor(ft, sw) + sw.Do("}\n", nil) + case uft.Kind == types.Struct: + if ft.IsAssignable() { + sw.Do("out.$.name$ = in.$.name$\n", args) + } else { + sw.Do("in.$.name$.DeepCopyInto(&out.$.name$)\n", args) + } + case uft.Kind == types.Interface: + // Note: do not generate code that won't compile as `DeepCopyinterface{}()` is not a valid function + if uft.Name.Name == "interface{}" { + klog.Fatalf("DeepCopy of %q is unsupported. Instead, use named interfaces with DeepCopy as one of the methods.", uft.Name.Name) + } + sw.Do("if in.$.name$ != nil {\n", args) + // Note: if t.Elem has been an alias "J" of an interface "I" in Go, we will see it + // as kind Interface of name "J" here, i.e. generate val.DeepCopyJ(). The golang + // parser does not give us the underlying interface name. So we cannot do any better. + sw.Do(fmt.Sprintf("out.$.name$ = in.$.name$.DeepCopy%s()\n", uft.Name.Name), args) + sw.Do("}\n", nil) + default: + klog.Fatalf("Hit an unsupported type %v for %v, from %v", uft, ft, t) + } + } +} + +// doPointer generates code for a pointer or an alias to a pointer. The generated code is +// is the same for both cases, i.e. it's the code for the underlying type. +func (g *genDeepCopy) doPointer(t *types.Type, sw *generator.SnippetWriter) { + ut := underlyingType(t) + uet := underlyingType(ut.Elem) + + dc, dci := deepCopyMethodOrDie(ut.Elem), deepCopyIntoMethodOrDie(ut.Elem) + switch { + case dc != nil || dci != nil: + rightPointer := !isReference(ut.Elem) + if dc != nil { + rightPointer = dc.Results[0].Kind == types.Pointer + } + if rightPointer { + sw.Do("*out = (*in).DeepCopy()\n", nil) + } else { + sw.Do("x := (*in).DeepCopy()\n", nil) + sw.Do("*out = &x\n", nil) + } + case uet.IsAssignable(): + sw.Do("*out = new($.Elem|raw$)\n", ut) + sw.Do("**out = **in", nil) + case uet.Kind == types.Map, uet.Kind == types.Slice, uet.Kind == types.Pointer: + sw.Do("*out = new($.Elem|raw$)\n", ut) + sw.Do("if **in != nil {\n", nil) + sw.Do("in, out := *in, *out\n", nil) + g.generateFor(uet, sw) + sw.Do("}\n", nil) + case uet.Kind == types.Struct: + sw.Do("*out = new($.Elem|raw$)\n", ut) + sw.Do("(*in).DeepCopyInto(*out)\n", nil) + default: + klog.Fatalf("Hit an unsupported type %v for %v", uet, t) + } +} diff --git a/vendor/k8s.io/gengo/examples/deepcopy-gen/main.go b/vendor/k8s.io/gengo/examples/deepcopy-gen/main.go new file mode 100644 index 00000000..99433fb7 --- /dev/null +++ b/vendor/k8s.io/gengo/examples/deepcopy-gen/main.go @@ -0,0 +1,89 @@ +/* +Copyright 2015 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. +*/ + +// deepcopy-gen is a tool for auto-generating DeepCopy functions. +// +// Given a list of input directories, it will generate DeepCopy and DeepCopyInto +// methods that efficiently perform a full deep-copy of each type. If these +// already exist (are predefined by the developer), they are used instead of +// generating new ones. +// +// If interfaces are referenced in types, it is expected that corresponding +// DeepCopyInterfaceName methods exist, e.g. DeepCopyObject for runtime.Object. +// These can be predefined by the developer or generated through tags, see below. +// They must be added to the interfaces themselves manually, e.g. +// type Object interface { +// ... +// DeepCopyObject() Object +// } +// +// All generation is governed by comment tags in the source. Any package may +// request DeepCopy generation by including a comment in the file-comments of +// a doc.go file, of the form: +// // +k8s:deepcopy-gen=package +// +// DeepCopy functions can be generated for individual types, rather than the +// entire package by specifying a comment on the type definion of the form: +// // +k8s:deepcopy-gen=true +// +// When generating for a whole package, individual types may opt out of +// DeepCopy generation by specifying a comment on the type definition of the form: +// // +k8s:deepcopy-gen=false +// +// Additional DeepCopyInterfaceName methods can be generated by specifying a +// comment on the type definition of the form: +// // +k8s:deepcopy-gen:interfaces=k8s.io/kubernetes/runtime.Object,k8s.io/kubernetes/runtime.List +// This leads to the generation of DeepCopyObject and DeepCopyList with the given +// interfaces as return types. We say that the tagged type implements deepcopy for the +// interfaces. +// +// The deepcopy funcs for interfaces using "+k8s:deepcopy-gen:interfaces" use the pointer +// of the type as receiver. For those special cases where the non-pointer object should +// implement the interface, this can be done with: +// // +k8s:deepcopy-gen:nonpointer-interfaces=true +package main + +import ( + "k8s.io/gengo/args" + "k8s.io/gengo/examples/deepcopy-gen/generators" + + "github.com/spf13/pflag" + "k8s.io/klog" +) + +func main() { + klog.InitFlags(nil) + arguments := args.Default() + + // Override defaults. + arguments.OutputFileBaseName = "deepcopy_generated" + + // Custom args. + customArgs := &generators.CustomArgs{} + pflag.CommandLine.StringSliceVar(&customArgs.BoundingDirs, "bounding-dirs", customArgs.BoundingDirs, + "Comma-separated list of import paths which bound the types for which deep-copies will be generated.") + arguments.CustomArgs = customArgs + + // Run it. + if err := arguments.Execute( + generators.NameSystems(), + generators.DefaultNameSystem(), + generators.Packages, + ); err != nil { + klog.Fatalf("Error: %v", err) + } + klog.V(2).Info("Completed successfully.") +} diff --git a/vendor/k8s.io/gengo/examples/set-gen/sets/byte.go b/vendor/k8s.io/gengo/examples/set-gen/sets/byte.go new file mode 100644 index 00000000..9bfa85d4 --- /dev/null +++ b/vendor/k8s.io/gengo/examples/set-gen/sets/byte.go @@ -0,0 +1,205 @@ +/* +Copyright 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 set-gen. DO NOT EDIT. + +package sets + +import ( + "reflect" + "sort" +) + +// sets.Byte is a set of bytes, implemented via map[byte]struct{} for minimal memory consumption. +type Byte map[byte]Empty + +// NewByte creates a Byte from a list of values. +func NewByte(items ...byte) Byte { + ss := Byte{} + ss.Insert(items...) + return ss +} + +// ByteKeySet creates a Byte from a keys of a map[byte](? extends interface{}). +// If the value passed in is not actually a map, this will panic. +func ByteKeySet(theMap interface{}) Byte { + v := reflect.ValueOf(theMap) + ret := Byte{} + + for _, keyValue := range v.MapKeys() { + ret.Insert(keyValue.Interface().(byte)) + } + return ret +} + +// Insert adds items to the set. +func (s Byte) Insert(items ...byte) Byte { + for _, item := range items { + s[item] = Empty{} + } + return s +} + +// Delete removes all items from the set. +func (s Byte) Delete(items ...byte) Byte { + for _, item := range items { + delete(s, item) + } + return s +} + +// Has returns true if and only if item is contained in the set. +func (s Byte) Has(item byte) bool { + _, contained := s[item] + return contained +} + +// HasAll returns true if and only if all items are contained in the set. +func (s Byte) HasAll(items ...byte) bool { + for _, item := range items { + if !s.Has(item) { + return false + } + } + return true +} + +// HasAny returns true if any items are contained in the set. +func (s Byte) HasAny(items ...byte) bool { + for _, item := range items { + if s.Has(item) { + return true + } + } + return false +} + +// Difference returns a set of objects that are not in s2 +// For example: +// s1 = {a1, a2, a3} +// s2 = {a1, a2, a4, a5} +// s1.Difference(s2) = {a3} +// s2.Difference(s1) = {a4, a5} +func (s Byte) Difference(s2 Byte) Byte { + result := NewByte() + for key := range s { + if !s2.Has(key) { + result.Insert(key) + } + } + return result +} + +// Union returns a new set which includes items in either s1 or s2. +// For example: +// s1 = {a1, a2} +// s2 = {a3, a4} +// s1.Union(s2) = {a1, a2, a3, a4} +// s2.Union(s1) = {a1, a2, a3, a4} +func (s1 Byte) Union(s2 Byte) Byte { + result := NewByte() + for key := range s1 { + result.Insert(key) + } + for key := range s2 { + result.Insert(key) + } + return result +} + +// Intersection returns a new set which includes the item in BOTH s1 and s2 +// For example: +// s1 = {a1, a2} +// s2 = {a2, a3} +// s1.Intersection(s2) = {a2} +func (s1 Byte) Intersection(s2 Byte) Byte { + var walk, other Byte + result := NewByte() + if s1.Len() < s2.Len() { + walk = s1 + other = s2 + } else { + walk = s2 + other = s1 + } + for key := range walk { + if other.Has(key) { + result.Insert(key) + } + } + return result +} + +// IsSuperset returns true if and only if s1 is a superset of s2. +func (s1 Byte) IsSuperset(s2 Byte) bool { + for item := range s2 { + if !s1.Has(item) { + return false + } + } + return true +} + +// Equal returns true if and only if s1 is equal (as a set) to s2. +// Two sets are equal if their membership is identical. +// (In practice, this means same elements, order doesn't matter) +func (s1 Byte) Equal(s2 Byte) bool { + return len(s1) == len(s2) && s1.IsSuperset(s2) +} + +type sortableSliceOfByte []byte + +func (s sortableSliceOfByte) Len() int { return len(s) } +func (s sortableSliceOfByte) Less(i, j int) bool { return lessByte(s[i], s[j]) } +func (s sortableSliceOfByte) Swap(i, j int) { s[i], s[j] = s[j], s[i] } + +// List returns the contents as a sorted byte slice. +func (s Byte) List() []byte { + res := make(sortableSliceOfByte, 0, len(s)) + for key := range s { + res = append(res, key) + } + sort.Sort(res) + return []byte(res) +} + +// UnsortedList returns the slice with contents in random order. +func (s Byte) UnsortedList() []byte { + res := make([]byte, 0, len(s)) + for key := range s { + res = append(res, key) + } + return res +} + +// Returns a single element from the set. +func (s Byte) PopAny() (byte, bool) { + for key := range s { + s.Delete(key) + return key, true + } + var zeroValue byte + return zeroValue, false +} + +// Len returns the size of the set. +func (s Byte) Len() int { + return len(s) +} + +func lessByte(lhs, rhs byte) bool { + return lhs < rhs +} diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/doc.go b/vendor/k8s.io/gengo/examples/set-gen/sets/doc.go similarity index 78% rename from vendor/github.com/rancher/types/apis/management.cattle.io/v3/doc.go rename to vendor/k8s.io/gengo/examples/set-gen/sets/doc.go index a045ba42..b152a0bf 100644 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/doc.go +++ b/vendor/k8s.io/gengo/examples/set-gen/sets/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2019 Rancher Labs, Inc. +Copyright 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. @@ -14,8 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// Code generated by main. DO NOT EDIT. +// Code generated by set-gen. DO NOT EDIT. -// +k8s:deepcopy-gen=package -// +groupName=management.cattle.io -package v3 +// Package sets has auto-generated set types. +package sets diff --git a/vendor/k8s.io/gengo/examples/set-gen/sets/empty.go b/vendor/k8s.io/gengo/examples/set-gen/sets/empty.go new file mode 100644 index 00000000..e11e622c --- /dev/null +++ b/vendor/k8s.io/gengo/examples/set-gen/sets/empty.go @@ -0,0 +1,23 @@ +/* +Copyright 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 set-gen. DO NOT EDIT. + +package sets + +// Empty is public since it is used by some internal API objects for conversions between external +// string arrays and internal sets, and conversion logic requires public types today. +type Empty struct{} diff --git a/vendor/k8s.io/gengo/examples/set-gen/sets/int.go b/vendor/k8s.io/gengo/examples/set-gen/sets/int.go new file mode 100644 index 00000000..88bd7096 --- /dev/null +++ b/vendor/k8s.io/gengo/examples/set-gen/sets/int.go @@ -0,0 +1,205 @@ +/* +Copyright 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 set-gen. DO NOT EDIT. + +package sets + +import ( + "reflect" + "sort" +) + +// sets.Int is a set of ints, implemented via map[int]struct{} for minimal memory consumption. +type Int map[int]Empty + +// NewInt creates a Int from a list of values. +func NewInt(items ...int) Int { + ss := Int{} + ss.Insert(items...) + return ss +} + +// IntKeySet creates a Int from a keys of a map[int](? extends interface{}). +// If the value passed in is not actually a map, this will panic. +func IntKeySet(theMap interface{}) Int { + v := reflect.ValueOf(theMap) + ret := Int{} + + for _, keyValue := range v.MapKeys() { + ret.Insert(keyValue.Interface().(int)) + } + return ret +} + +// Insert adds items to the set. +func (s Int) Insert(items ...int) Int { + for _, item := range items { + s[item] = Empty{} + } + return s +} + +// Delete removes all items from the set. +func (s Int) Delete(items ...int) Int { + for _, item := range items { + delete(s, item) + } + return s +} + +// Has returns true if and only if item is contained in the set. +func (s Int) Has(item int) bool { + _, contained := s[item] + return contained +} + +// HasAll returns true if and only if all items are contained in the set. +func (s Int) HasAll(items ...int) bool { + for _, item := range items { + if !s.Has(item) { + return false + } + } + return true +} + +// HasAny returns true if any items are contained in the set. +func (s Int) HasAny(items ...int) bool { + for _, item := range items { + if s.Has(item) { + return true + } + } + return false +} + +// Difference returns a set of objects that are not in s2 +// For example: +// s1 = {a1, a2, a3} +// s2 = {a1, a2, a4, a5} +// s1.Difference(s2) = {a3} +// s2.Difference(s1) = {a4, a5} +func (s Int) Difference(s2 Int) Int { + result := NewInt() + for key := range s { + if !s2.Has(key) { + result.Insert(key) + } + } + return result +} + +// Union returns a new set which includes items in either s1 or s2. +// For example: +// s1 = {a1, a2} +// s2 = {a3, a4} +// s1.Union(s2) = {a1, a2, a3, a4} +// s2.Union(s1) = {a1, a2, a3, a4} +func (s1 Int) Union(s2 Int) Int { + result := NewInt() + for key := range s1 { + result.Insert(key) + } + for key := range s2 { + result.Insert(key) + } + return result +} + +// Intersection returns a new set which includes the item in BOTH s1 and s2 +// For example: +// s1 = {a1, a2} +// s2 = {a2, a3} +// s1.Intersection(s2) = {a2} +func (s1 Int) Intersection(s2 Int) Int { + var walk, other Int + result := NewInt() + if s1.Len() < s2.Len() { + walk = s1 + other = s2 + } else { + walk = s2 + other = s1 + } + for key := range walk { + if other.Has(key) { + result.Insert(key) + } + } + return result +} + +// IsSuperset returns true if and only if s1 is a superset of s2. +func (s1 Int) IsSuperset(s2 Int) bool { + for item := range s2 { + if !s1.Has(item) { + return false + } + } + return true +} + +// Equal returns true if and only if s1 is equal (as a set) to s2. +// Two sets are equal if their membership is identical. +// (In practice, this means same elements, order doesn't matter) +func (s1 Int) Equal(s2 Int) bool { + return len(s1) == len(s2) && s1.IsSuperset(s2) +} + +type sortableSliceOfInt []int + +func (s sortableSliceOfInt) Len() int { return len(s) } +func (s sortableSliceOfInt) Less(i, j int) bool { return lessInt(s[i], s[j]) } +func (s sortableSliceOfInt) Swap(i, j int) { s[i], s[j] = s[j], s[i] } + +// List returns the contents as a sorted int slice. +func (s Int) List() []int { + res := make(sortableSliceOfInt, 0, len(s)) + for key := range s { + res = append(res, key) + } + sort.Sort(res) + return []int(res) +} + +// UnsortedList returns the slice with contents in random order. +func (s Int) UnsortedList() []int { + res := make([]int, 0, len(s)) + for key := range s { + res = append(res, key) + } + return res +} + +// Returns a single element from the set. +func (s Int) PopAny() (int, bool) { + for key := range s { + s.Delete(key) + return key, true + } + var zeroValue int + return zeroValue, false +} + +// Len returns the size of the set. +func (s Int) Len() int { + return len(s) +} + +func lessInt(lhs, rhs int) bool { + return lhs < rhs +} diff --git a/vendor/k8s.io/gengo/examples/set-gen/sets/int64.go b/vendor/k8s.io/gengo/examples/set-gen/sets/int64.go new file mode 100644 index 00000000..b375a1b0 --- /dev/null +++ b/vendor/k8s.io/gengo/examples/set-gen/sets/int64.go @@ -0,0 +1,205 @@ +/* +Copyright 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 set-gen. DO NOT EDIT. + +package sets + +import ( + "reflect" + "sort" +) + +// sets.Int64 is a set of int64s, implemented via map[int64]struct{} for minimal memory consumption. +type Int64 map[int64]Empty + +// NewInt64 creates a Int64 from a list of values. +func NewInt64(items ...int64) Int64 { + ss := Int64{} + ss.Insert(items...) + return ss +} + +// Int64KeySet creates a Int64 from a keys of a map[int64](? extends interface{}). +// If the value passed in is not actually a map, this will panic. +func Int64KeySet(theMap interface{}) Int64 { + v := reflect.ValueOf(theMap) + ret := Int64{} + + for _, keyValue := range v.MapKeys() { + ret.Insert(keyValue.Interface().(int64)) + } + return ret +} + +// Insert adds items to the set. +func (s Int64) Insert(items ...int64) Int64 { + for _, item := range items { + s[item] = Empty{} + } + return s +} + +// Delete removes all items from the set. +func (s Int64) Delete(items ...int64) Int64 { + for _, item := range items { + delete(s, item) + } + return s +} + +// Has returns true if and only if item is contained in the set. +func (s Int64) Has(item int64) bool { + _, contained := s[item] + return contained +} + +// HasAll returns true if and only if all items are contained in the set. +func (s Int64) HasAll(items ...int64) bool { + for _, item := range items { + if !s.Has(item) { + return false + } + } + return true +} + +// HasAny returns true if any items are contained in the set. +func (s Int64) HasAny(items ...int64) bool { + for _, item := range items { + if s.Has(item) { + return true + } + } + return false +} + +// Difference returns a set of objects that are not in s2 +// For example: +// s1 = {a1, a2, a3} +// s2 = {a1, a2, a4, a5} +// s1.Difference(s2) = {a3} +// s2.Difference(s1) = {a4, a5} +func (s Int64) Difference(s2 Int64) Int64 { + result := NewInt64() + for key := range s { + if !s2.Has(key) { + result.Insert(key) + } + } + return result +} + +// Union returns a new set which includes items in either s1 or s2. +// For example: +// s1 = {a1, a2} +// s2 = {a3, a4} +// s1.Union(s2) = {a1, a2, a3, a4} +// s2.Union(s1) = {a1, a2, a3, a4} +func (s1 Int64) Union(s2 Int64) Int64 { + result := NewInt64() + for key := range s1 { + result.Insert(key) + } + for key := range s2 { + result.Insert(key) + } + return result +} + +// Intersection returns a new set which includes the item in BOTH s1 and s2 +// For example: +// s1 = {a1, a2} +// s2 = {a2, a3} +// s1.Intersection(s2) = {a2} +func (s1 Int64) Intersection(s2 Int64) Int64 { + var walk, other Int64 + result := NewInt64() + if s1.Len() < s2.Len() { + walk = s1 + other = s2 + } else { + walk = s2 + other = s1 + } + for key := range walk { + if other.Has(key) { + result.Insert(key) + } + } + return result +} + +// IsSuperset returns true if and only if s1 is a superset of s2. +func (s1 Int64) IsSuperset(s2 Int64) bool { + for item := range s2 { + if !s1.Has(item) { + return false + } + } + return true +} + +// Equal returns true if and only if s1 is equal (as a set) to s2. +// Two sets are equal if their membership is identical. +// (In practice, this means same elements, order doesn't matter) +func (s1 Int64) Equal(s2 Int64) bool { + return len(s1) == len(s2) && s1.IsSuperset(s2) +} + +type sortableSliceOfInt64 []int64 + +func (s sortableSliceOfInt64) Len() int { return len(s) } +func (s sortableSliceOfInt64) Less(i, j int) bool { return lessInt64(s[i], s[j]) } +func (s sortableSliceOfInt64) Swap(i, j int) { s[i], s[j] = s[j], s[i] } + +// List returns the contents as a sorted int64 slice. +func (s Int64) List() []int64 { + res := make(sortableSliceOfInt64, 0, len(s)) + for key := range s { + res = append(res, key) + } + sort.Sort(res) + return []int64(res) +} + +// UnsortedList returns the slice with contents in random order. +func (s Int64) UnsortedList() []int64 { + res := make([]int64, 0, len(s)) + for key := range s { + res = append(res, key) + } + return res +} + +// Returns a single element from the set. +func (s Int64) PopAny() (int64, bool) { + for key := range s { + s.Delete(key) + return key, true + } + var zeroValue int64 + return zeroValue, false +} + +// Len returns the size of the set. +func (s Int64) Len() int { + return len(s) +} + +func lessInt64(lhs, rhs int64) bool { + return lhs < rhs +} diff --git a/vendor/k8s.io/gengo/examples/set-gen/sets/string.go b/vendor/k8s.io/gengo/examples/set-gen/sets/string.go new file mode 100644 index 00000000..e6f37db8 --- /dev/null +++ b/vendor/k8s.io/gengo/examples/set-gen/sets/string.go @@ -0,0 +1,205 @@ +/* +Copyright 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 set-gen. DO NOT EDIT. + +package sets + +import ( + "reflect" + "sort" +) + +// sets.String is a set of strings, implemented via map[string]struct{} for minimal memory consumption. +type String map[string]Empty + +// NewString creates a String from a list of values. +func NewString(items ...string) String { + ss := String{} + ss.Insert(items...) + return ss +} + +// StringKeySet creates a String from a keys of a map[string](? extends interface{}). +// If the value passed in is not actually a map, this will panic. +func StringKeySet(theMap interface{}) String { + v := reflect.ValueOf(theMap) + ret := String{} + + for _, keyValue := range v.MapKeys() { + ret.Insert(keyValue.Interface().(string)) + } + return ret +} + +// Insert adds items to the set. +func (s String) Insert(items ...string) String { + for _, item := range items { + s[item] = Empty{} + } + return s +} + +// Delete removes all items from the set. +func (s String) Delete(items ...string) String { + for _, item := range items { + delete(s, item) + } + return s +} + +// Has returns true if and only if item is contained in the set. +func (s String) Has(item string) bool { + _, contained := s[item] + return contained +} + +// HasAll returns true if and only if all items are contained in the set. +func (s String) HasAll(items ...string) bool { + for _, item := range items { + if !s.Has(item) { + return false + } + } + return true +} + +// HasAny returns true if any items are contained in the set. +func (s String) HasAny(items ...string) bool { + for _, item := range items { + if s.Has(item) { + return true + } + } + return false +} + +// Difference returns a set of objects that are not in s2 +// For example: +// s1 = {a1, a2, a3} +// s2 = {a1, a2, a4, a5} +// s1.Difference(s2) = {a3} +// s2.Difference(s1) = {a4, a5} +func (s String) Difference(s2 String) String { + result := NewString() + for key := range s { + if !s2.Has(key) { + result.Insert(key) + } + } + return result +} + +// Union returns a new set which includes items in either s1 or s2. +// For example: +// s1 = {a1, a2} +// s2 = {a3, a4} +// s1.Union(s2) = {a1, a2, a3, a4} +// s2.Union(s1) = {a1, a2, a3, a4} +func (s1 String) Union(s2 String) String { + result := NewString() + for key := range s1 { + result.Insert(key) + } + for key := range s2 { + result.Insert(key) + } + return result +} + +// Intersection returns a new set which includes the item in BOTH s1 and s2 +// For example: +// s1 = {a1, a2} +// s2 = {a2, a3} +// s1.Intersection(s2) = {a2} +func (s1 String) Intersection(s2 String) String { + var walk, other String + result := NewString() + if s1.Len() < s2.Len() { + walk = s1 + other = s2 + } else { + walk = s2 + other = s1 + } + for key := range walk { + if other.Has(key) { + result.Insert(key) + } + } + return result +} + +// IsSuperset returns true if and only if s1 is a superset of s2. +func (s1 String) IsSuperset(s2 String) bool { + for item := range s2 { + if !s1.Has(item) { + return false + } + } + return true +} + +// Equal returns true if and only if s1 is equal (as a set) to s2. +// Two sets are equal if their membership is identical. +// (In practice, this means same elements, order doesn't matter) +func (s1 String) Equal(s2 String) bool { + return len(s1) == len(s2) && s1.IsSuperset(s2) +} + +type sortableSliceOfString []string + +func (s sortableSliceOfString) Len() int { return len(s) } +func (s sortableSliceOfString) Less(i, j int) bool { return lessString(s[i], s[j]) } +func (s sortableSliceOfString) Swap(i, j int) { s[i], s[j] = s[j], s[i] } + +// List returns the contents as a sorted string slice. +func (s String) List() []string { + res := make(sortableSliceOfString, 0, len(s)) + for key := range s { + res = append(res, key) + } + sort.Sort(res) + return []string(res) +} + +// UnsortedList returns the slice with contents in random order. +func (s String) UnsortedList() []string { + res := make([]string, 0, len(s)) + for key := range s { + res = append(res, key) + } + return res +} + +// Returns a single element from the set. +func (s String) PopAny() (string, bool) { + for key := range s { + s.Delete(key) + return key, true + } + var zeroValue string + return zeroValue, false +} + +// Len returns the size of the set. +func (s String) Len() int { + return len(s) +} + +func lessString(lhs, rhs string) bool { + return lhs < rhs +} diff --git a/vendor/k8s.io/gengo/generator/default_generator.go b/vendor/k8s.io/gengo/generator/default_generator.go new file mode 100644 index 00000000..f9476682 --- /dev/null +++ b/vendor/k8s.io/gengo/generator/default_generator.go @@ -0,0 +1,62 @@ +/* +Copyright 2015 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 generator + +import ( + "io" + + "k8s.io/gengo/namer" + "k8s.io/gengo/types" +) + +const ( + GolangFileType = "golang" +) + +// DefaultGen implements a do-nothing Generator. +// +// It can be used to implement static content files. +type DefaultGen struct { + // OptionalName, if present, will be used for the generator's name, and + // the filename (with ".go" appended). + OptionalName string + + // OptionalBody, if present, will be used as the return from the "Init" + // method. This causes it to be static content for the entire file if + // no other generator touches the file. + OptionalBody []byte +} + +func (d DefaultGen) Name() string { return d.OptionalName } +func (d DefaultGen) Filter(*Context, *types.Type) bool { return true } +func (d DefaultGen) Namers(*Context) namer.NameSystems { return nil } +func (d DefaultGen) Imports(*Context) []string { return []string{} } +func (d DefaultGen) PackageVars(*Context) []string { return []string{} } +func (d DefaultGen) PackageConsts(*Context) []string { return []string{} } +func (d DefaultGen) GenerateType(*Context, *types.Type, io.Writer) error { return nil } +func (d DefaultGen) Filename() string { return d.OptionalName + ".go" } +func (d DefaultGen) FileType() string { return GolangFileType } +func (d DefaultGen) Finalize(*Context, io.Writer) error { return nil } + +func (d DefaultGen) Init(c *Context, w io.Writer) error { + _, err := w.Write(d.OptionalBody) + return err +} + +var ( + _ = Generator(DefaultGen{}) +) diff --git a/vendor/k8s.io/gengo/generator/default_package.go b/vendor/k8s.io/gengo/generator/default_package.go new file mode 100644 index 00000000..dcf08832 --- /dev/null +++ b/vendor/k8s.io/gengo/generator/default_package.go @@ -0,0 +1,75 @@ +/* +Copyright 2015 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 generator + +import ( + "k8s.io/gengo/types" +) + +// DefaultPackage contains a default implementation of Package. +type DefaultPackage struct { + // Short name of package, used in the "package xxxx" line. + PackageName string + // Import path of the package, and the location on disk of the package. + PackagePath string + // The location of the package on disk. + Source string + + // Emitted at the top of every file. + HeaderText []byte + + // Emitted only for a "doc.go" file; appended to the HeaderText for + // that file. + PackageDocumentation []byte + + // If non-nil, will be called on "Generators"; otherwise, the static + // list will be used. So you should set only one of these two fields. + GeneratorFunc func(*Context) []Generator + GeneratorList []Generator + + // Optional; filters the types exposed to the generators. + FilterFunc func(*Context, *types.Type) bool +} + +func (d *DefaultPackage) Name() string { return d.PackageName } +func (d *DefaultPackage) Path() string { return d.PackagePath } +func (d *DefaultPackage) SourcePath() string { return d.Source } + +func (d *DefaultPackage) Filter(c *Context, t *types.Type) bool { + if d.FilterFunc != nil { + return d.FilterFunc(c, t) + } + return true +} + +func (d *DefaultPackage) Generators(c *Context) []Generator { + if d.GeneratorFunc != nil { + return d.GeneratorFunc(c) + } + return d.GeneratorList +} + +func (d *DefaultPackage) Header(filename string) []byte { + if filename == "doc.go" { + return append(d.HeaderText, d.PackageDocumentation...) + } + return d.HeaderText +} + +var ( + _ = Package(&DefaultPackage{}) +) diff --git a/vendor/k8s.io/gengo/generator/doc.go b/vendor/k8s.io/gengo/generator/doc.go new file mode 100644 index 00000000..d8e12534 --- /dev/null +++ b/vendor/k8s.io/gengo/generator/doc.go @@ -0,0 +1,31 @@ +/* +Copyright 2015 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 generator defines an interface for code generators to implement. +// +// To use this package, you'll implement the "Package" and "Generator" +// interfaces; you'll call NewContext to load up the types you want to work +// with, and then you'll call one or more of the Execute methods. See the +// interface definitions for explanations. All output will have gofmt called on +// it automatically, so you do not need to worry about generating correct +// indentation. +// +// This package also exposes SnippetWriter. SnippetWriter reduces to a minimum +// the boilerplate involved in setting up a template from go's text/template +// package. Additionally, all naming systems in the Context will be added as +// functions to the parsed template, so that they can be called directly from +// your templates! +package generator // import "k8s.io/gengo/generator" diff --git a/vendor/k8s.io/gengo/generator/error_tracker.go b/vendor/k8s.io/gengo/generator/error_tracker.go new file mode 100644 index 00000000..964dae37 --- /dev/null +++ b/vendor/k8s.io/gengo/generator/error_tracker.go @@ -0,0 +1,50 @@ +/* +Copyright 2015 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 generator + +import ( + "io" +) + +// ErrorTracker tracks errors to the underlying writer, so that you can ignore +// them until you're ready to return. +type ErrorTracker struct { + io.Writer + err error +} + +// NewErrorTracker makes a new error tracker; note that it implements io.Writer. +func NewErrorTracker(w io.Writer) *ErrorTracker { + return &ErrorTracker{Writer: w} +} + +// Write intercepts calls to Write. +func (et *ErrorTracker) Write(p []byte) (n int, err error) { + if et.err != nil { + return 0, et.err + } + n, err = et.Writer.Write(p) + if err != nil { + et.err = err + } + return n, err +} + +// Error returns nil if no error has occurred, otherwise it returns the error. +func (et *ErrorTracker) Error() error { + return et.err +} diff --git a/vendor/k8s.io/gengo/generator/execute.go b/vendor/k8s.io/gengo/generator/execute.go new file mode 100644 index 00000000..d1b12258 --- /dev/null +++ b/vendor/k8s.io/gengo/generator/execute.go @@ -0,0 +1,314 @@ +/* +Copyright 2015 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 generator + +import ( + "bytes" + "fmt" + "io" + "io/ioutil" + "os" + "path/filepath" + "strings" + + "golang.org/x/tools/imports" + "k8s.io/gengo/namer" + "k8s.io/gengo/types" + + "k8s.io/klog" +) + +func errs2strings(errors []error) []string { + strs := make([]string, len(errors)) + for i := range errors { + strs[i] = errors[i].Error() + } + return strs +} + +// ExecutePackages runs the generators for every package in 'packages'. 'outDir' +// is the base directory in which to place all the generated packages; it +// should be a physical path on disk, not an import path. e.g.: +// /path/to/home/path/to/gopath/src/ +// Each package has its import path already, this will be appended to 'outDir'. +func (c *Context) ExecutePackages(outDir string, packages Packages) error { + var errors []error + for _, p := range packages { + if err := c.ExecutePackage(outDir, p); err != nil { + errors = append(errors, err) + } + } + if len(errors) > 0 { + return fmt.Errorf("some packages had errors:\n%v\n", strings.Join(errs2strings(errors), "\n")) + } + return nil +} + +type DefaultFileType struct { + Format func([]byte) ([]byte, error) + Assemble func(io.Writer, *File) +} + +func (ft DefaultFileType) AssembleFile(f *File, pathname string) error { + klog.V(2).Infof("Assembling file %q", pathname) + destFile, err := os.Create(pathname) + if err != nil { + return err + } + defer destFile.Close() + + b := &bytes.Buffer{} + et := NewErrorTracker(b) + ft.Assemble(et, f) + if et.Error() != nil { + return et.Error() + } + if formatted, err := ft.Format(b.Bytes()); err != nil { + err = fmt.Errorf("unable to format file %q (%v).", pathname, err) + // Write the file anyway, so they can see what's going wrong and fix the generator. + if _, err2 := destFile.Write(b.Bytes()); err2 != nil { + return err2 + } + return err + } else { + _, err = destFile.Write(formatted) + return err + } +} + +func (ft DefaultFileType) VerifyFile(f *File, pathname string) error { + klog.V(2).Infof("Verifying file %q", pathname) + friendlyName := filepath.Join(f.PackageName, f.Name) + b := &bytes.Buffer{} + et := NewErrorTracker(b) + ft.Assemble(et, f) + if et.Error() != nil { + return et.Error() + } + formatted, err := ft.Format(b.Bytes()) + if err != nil { + return fmt.Errorf("unable to format the output for %q: %v", friendlyName, err) + } + existing, err := ioutil.ReadFile(pathname) + if err != nil { + return fmt.Errorf("unable to read file %q for comparison: %v", friendlyName, err) + } + if bytes.Compare(formatted, existing) == 0 { + return nil + } + // Be nice and find the first place where they differ + i := 0 + for i < len(formatted) && i < len(existing) && formatted[i] == existing[i] { + i++ + } + eDiff, fDiff := existing[i:], formatted[i:] + if len(eDiff) > 100 { + eDiff = eDiff[:100] + } + if len(fDiff) > 100 { + fDiff = fDiff[:100] + } + return fmt.Errorf("output for %q differs; first existing/expected diff: \n %q\n %q", friendlyName, string(eDiff), string(fDiff)) +} + +func assembleGolangFile(w io.Writer, f *File) { + w.Write(f.Header) + fmt.Fprintf(w, "package %v\n\n", f.PackageName) + + if len(f.Imports) > 0 { + fmt.Fprint(w, "import (\n") + for i := range f.Imports { + if strings.Contains(i, "\"") { + // they included quotes, or are using the + // `name "path/to/pkg"` format. + fmt.Fprintf(w, "\t%s\n", i) + } else { + fmt.Fprintf(w, "\t%q\n", i) + } + } + fmt.Fprint(w, ")\n\n") + } + + if f.Vars.Len() > 0 { + fmt.Fprint(w, "var (\n") + w.Write(f.Vars.Bytes()) + fmt.Fprint(w, ")\n\n") + } + + if f.Consts.Len() > 0 { + fmt.Fprint(w, "const (\n") + w.Write(f.Consts.Bytes()) + fmt.Fprint(w, ")\n\n") + } + + w.Write(f.Body.Bytes()) +} + +func importsWrapper(src []byte) ([]byte, error) { + return imports.Process("", src, nil) +} + +func NewGolangFile() *DefaultFileType { + return &DefaultFileType{ + Format: importsWrapper, + Assemble: assembleGolangFile, + } +} + +// format should be one line only, and not end with \n. +func addIndentHeaderComment(b *bytes.Buffer, format string, args ...interface{}) { + if b.Len() > 0 { + fmt.Fprintf(b, "\n// "+format+"\n", args...) + } else { + fmt.Fprintf(b, "// "+format+"\n", args...) + } +} + +func (c *Context) filteredBy(f func(*Context, *types.Type) bool) *Context { + c2 := *c + c2.Order = []*types.Type{} + for _, t := range c.Order { + if f(c, t) { + c2.Order = append(c2.Order, t) + } + } + return &c2 +} + +// make a new context; inheret c.Namers, but add on 'namers'. In case of a name +// collision, the namer in 'namers' wins. +func (c *Context) addNameSystems(namers namer.NameSystems) *Context { + if namers == nil { + return c + } + c2 := *c + // Copy the existing name systems so we don't corrupt a parent context + c2.Namers = namer.NameSystems{} + for k, v := range c.Namers { + c2.Namers[k] = v + } + + for name, namer := range namers { + c2.Namers[name] = namer + } + return &c2 +} + +// ExecutePackage executes a single package. 'outDir' is the base directory in +// which to place the package; it should be a physical path on disk, not an +// import path. e.g.: '/path/to/home/path/to/gopath/src/' The package knows its +// import path already, this will be appended to 'outDir'. +func (c *Context) ExecutePackage(outDir string, p Package) error { + path := filepath.Join(outDir, p.Path()) + klog.V(2).Infof("Processing package %q, disk location %q", p.Name(), path) + // Filter out any types the *package* doesn't care about. + packageContext := c.filteredBy(p.Filter) + os.MkdirAll(path, 0755) + files := map[string]*File{} + for _, g := range p.Generators(packageContext) { + // Filter out types the *generator* doesn't care about. + genContext := packageContext.filteredBy(g.Filter) + // Now add any extra name systems defined by this generator + genContext = genContext.addNameSystems(g.Namers(genContext)) + + fileType := g.FileType() + if len(fileType) == 0 { + return fmt.Errorf("generator %q must specify a file type", g.Name()) + } + f := files[g.Filename()] + if f == nil { + // This is the first generator to reference this file, so start it. + f = &File{ + Name: g.Filename(), + FileType: fileType, + PackageName: p.Name(), + PackagePath: p.Path(), + PackageSourcePath: p.SourcePath(), + Header: p.Header(g.Filename()), + Imports: map[string]struct{}{}, + } + files[f.Name] = f + } else { + if f.FileType != g.FileType() { + return fmt.Errorf("file %q already has type %q, but generator %q wants to use type %q", f.Name, f.FileType, g.Name(), g.FileType()) + } + } + + if vars := g.PackageVars(genContext); len(vars) > 0 { + addIndentHeaderComment(&f.Vars, "Package-wide variables from generator %q.", g.Name()) + for _, v := range vars { + if _, err := fmt.Fprintf(&f.Vars, "%s\n", v); err != nil { + return err + } + } + } + if consts := g.PackageConsts(genContext); len(consts) > 0 { + addIndentHeaderComment(&f.Consts, "Package-wide consts from generator %q.", g.Name()) + for _, v := range consts { + if _, err := fmt.Fprintf(&f.Consts, "%s\n", v); err != nil { + return err + } + } + } + if err := genContext.executeBody(&f.Body, g); err != nil { + return err + } + if imports := g.Imports(genContext); len(imports) > 0 { + for _, i := range imports { + f.Imports[i] = struct{}{} + } + } + } + + var errors []error + for _, f := range files { + finalPath := filepath.Join(path, f.Name) + assembler, ok := c.FileTypes[f.FileType] + if !ok { + return fmt.Errorf("the file type %q registered for file %q does not exist in the context", f.FileType, f.Name) + } + var err error + if c.Verify { + err = assembler.VerifyFile(f, finalPath) + } else { + err = assembler.AssembleFile(f, finalPath) + } + if err != nil { + errors = append(errors, err) + } + } + if len(errors) > 0 { + return fmt.Errorf("errors in package %q:\n%v\n", p.Path(), strings.Join(errs2strings(errors), "\n")) + } + return nil +} + +func (c *Context) executeBody(w io.Writer, generator Generator) error { + et := NewErrorTracker(w) + if err := generator.Init(c, et); err != nil { + return err + } + for _, t := range c.Order { + if err := generator.GenerateType(c, t, et); err != nil { + return err + } + } + if err := generator.Finalize(c, et); err != nil { + return err + } + return et.Error() +} diff --git a/vendor/k8s.io/gengo/generator/generator.go b/vendor/k8s.io/gengo/generator/generator.go new file mode 100644 index 00000000..4b48f503 --- /dev/null +++ b/vendor/k8s.io/gengo/generator/generator.go @@ -0,0 +1,256 @@ +/* +Copyright 2015 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 generator + +import ( + "bytes" + "io" + + "k8s.io/gengo/namer" + "k8s.io/gengo/parser" + "k8s.io/gengo/types" +) + +// Package contains the contract for generating a package. +type Package interface { + // Name returns the package short name. + Name() string + // Path returns the package import path. + Path() string + // SourcePath returns the location of the package on disk. + SourcePath() string + + // Filter should return true if this package cares about this type. + // Otherwise, this type will be omitted from the type ordering for + // this package. + Filter(*Context, *types.Type) bool + + // Header should return a header for the file, including comment markers. + // Useful for copyright notices and doc strings. Include an + // autogeneration notice! Do not include the "package x" line. + Header(filename string) []byte + + // Generators returns the list of generators for this package. It is + // allowed for more than one generator to write to the same file. + // A Context is passed in case the list of generators depends on the + // input types. + Generators(*Context) []Generator +} + +type File struct { + Name string + FileType string + PackageName string + Header []byte + PackagePath string + PackageSourcePath string + Imports map[string]struct{} + Vars bytes.Buffer + Consts bytes.Buffer + Body bytes.Buffer +} + +type FileType interface { + AssembleFile(f *File, path string) error + VerifyFile(f *File, path string) error +} + +// Packages is a list of packages to generate. +type Packages []Package + +// Generator is the contract for anything that wants to do auto-generation. +// It's expected that the io.Writers passed to the below functions will be +// ErrorTrackers; this allows implementations to not check for io errors, +// making more readable code. +// +// The call order for the functions that take a Context is: +// 1. Filter() // Subsequent calls see only types that pass this. +// 2. Namers() // Subsequent calls see the namers provided by this. +// 3. PackageVars() +// 4. PackageConsts() +// 5. Init() +// 6. GenerateType() // Called N times, once per type in the context's Order. +// 7. Imports() +// +// You may have multiple generators for the same file. +type Generator interface { + // The name of this generator. Will be included in generated comments. + Name() string + + // Filter should return true if this generator cares about this type. + // (otherwise, GenerateType will not be called.) + // + // Filter is called before any of the generator's other functions; + // subsequent calls will get a context with only the types that passed + // this filter. + Filter(*Context, *types.Type) bool + + // If this generator needs special namers, return them here. These will + // override the original namers in the context if there is a collision. + // You may return nil if you don't need special names. These names will + // be available in the context passed to the rest of the generator's + // functions. + // + // A use case for this is to return a namer that tracks imports. + Namers(*Context) namer.NameSystems + + // Init should write an init function, and any other content that's not + // generated per-type. (It's not intended for generator specific + // initialization! Do that when your Package constructs the + // Generators.) + Init(*Context, io.Writer) error + + // Finalize should write finish up functions, and any other content that's not + // generated per-type. + Finalize(*Context, io.Writer) error + + // PackageVars should emit an array of variable lines. They will be + // placed in a var ( ... ) block. There's no need to include a leading + // \t or trailing \n. + PackageVars(*Context) []string + + // PackageConsts should emit an array of constant lines. They will be + // placed in a const ( ... ) block. There's no need to include a leading + // \t or trailing \n. + PackageConsts(*Context) []string + + // GenerateType should emit the code for a particular type. + GenerateType(*Context, *types.Type, io.Writer) error + + // Imports should return a list of necessary imports. They will be + // formatted correctly. You do not need to include quotation marks, + // return only the package name; alternatively, you can also return + // imports in the format `name "path/to/pkg"`. Imports will be called + // after Init, PackageVars, PackageConsts, and GenerateType, to allow + // you to keep track of what imports you actually need. + Imports(*Context) []string + + // Preferred file name of this generator, not including a path. It is + // allowed for multiple generators to use the same filename, but it's + // up to you to make sure they don't have colliding import names. + // TODO: provide per-file import tracking, removing the requirement + // that generators coordinate.. + Filename() string + + // A registered file type in the context to generate this file with. If + // the FileType is not found in the context, execution will stop. + FileType() string +} + +// Context is global context for individual generators to consume. +type Context struct { + // A map from the naming system to the names for that system. E.g., you + // might have public names and several private naming systems. + Namers namer.NameSystems + + // All the types, in case you want to look up something. + Universe types.Universe + + // Incoming imports, i.e. packages importing the given package. + incomingImports map[string][]string + + // Incoming transitive imports, i.e. the transitive closure of IncomingImports + incomingTransitiveImports map[string][]string + + // All the user-specified packages. This is after recursive expansion. + Inputs []string + + // The canonical ordering of the types (will be filtered by both the + // Package's and Generator's Filter methods). + Order []*types.Type + + // A set of types this context can process. If this is empty or nil, + // the default "golang" filetype will be provided. + FileTypes map[string]FileType + + // If true, Execute* calls will just verify that the existing output is + // correct. (You may set this after calling NewContext.) + Verify bool + + // Allows generators to add packages at runtime. + builder *parser.Builder +} + +// NewContext generates a context from the given builder, naming systems, and +// the naming system you wish to construct the canonical ordering from. +func NewContext(b *parser.Builder, nameSystems namer.NameSystems, canonicalOrderName string) (*Context, error) { + universe, err := b.FindTypes() + if err != nil { + return nil, err + } + + c := &Context{ + Namers: namer.NameSystems{}, + Universe: universe, + Inputs: b.FindPackages(), + FileTypes: map[string]FileType{ + GolangFileType: NewGolangFile(), + }, + builder: b, + } + + for name, systemNamer := range nameSystems { + c.Namers[name] = systemNamer + if name == canonicalOrderName { + orderer := namer.Orderer{Namer: systemNamer} + c.Order = orderer.OrderUniverse(universe) + } + } + return c, nil +} + +// IncomingImports returns the incoming imports for each package. The map is lazily computed. +func (ctxt *Context) IncomingImports() map[string][]string { + if ctxt.incomingImports == nil { + incoming := map[string][]string{} + for _, pkg := range ctxt.Universe { + for imp := range pkg.Imports { + incoming[imp] = append(incoming[imp], pkg.Path) + } + } + ctxt.incomingImports = incoming + } + return ctxt.incomingImports +} + +// TransitiveIncomingImports returns the transitive closure of the incoming imports for each package. +// The map is lazily computed. +func (ctxt *Context) TransitiveIncomingImports() map[string][]string { + if ctxt.incomingTransitiveImports == nil { + ctxt.incomingTransitiveImports = transitiveClosure(ctxt.IncomingImports()) + } + return ctxt.incomingTransitiveImports +} + +// AddDir adds a Go package to the context. The specified path must be a single +// go package import path. GOPATH, GOROOT, and the location of your go binary +// (`which go`) will all be searched, in the normal Go fashion. +// Deprecated. Please use AddDirectory. +func (ctxt *Context) AddDir(path string) error { + ctxt.incomingImports = nil + ctxt.incomingTransitiveImports = nil + return ctxt.builder.AddDirTo(path, &ctxt.Universe) +} + +// AddDirectory adds a Go package to the context. The specified path must be a +// single go package import path. GOPATH, GOROOT, and the location of your go +// binary (`which go`) will all be searched, in the normal Go fashion. +func (ctxt *Context) AddDirectory(path string) (*types.Package, error) { + ctxt.incomingImports = nil + ctxt.incomingTransitiveImports = nil + return ctxt.builder.AddDirectoryTo(path, &ctxt.Universe) +} diff --git a/vendor/k8s.io/gengo/generator/import_tracker.go b/vendor/k8s.io/gengo/generator/import_tracker.go new file mode 100644 index 00000000..5d87de4f --- /dev/null +++ b/vendor/k8s.io/gengo/generator/import_tracker.go @@ -0,0 +1,70 @@ +/* +Copyright 2015 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 generator + +import ( + "go/token" + "strings" + + "k8s.io/klog" + + "k8s.io/gengo/namer" + "k8s.io/gengo/types" +) + +func NewImportTracker(typesToAdd ...*types.Type) namer.ImportTracker { + tracker := namer.NewDefaultImportTracker(types.Name{}) + tracker.IsInvalidType = func(*types.Type) bool { return false } + tracker.LocalName = func(name types.Name) string { return golangTrackerLocalName(&tracker, name) } + tracker.PrintImport = func(path, name string) string { return name + " \"" + path + "\"" } + + tracker.AddTypes(typesToAdd...) + return &tracker + +} + +func golangTrackerLocalName(tracker namer.ImportTracker, t types.Name) string { + path := t.Package + + // Using backslashes in package names causes gengo to produce Go code which + // will not compile with the gc compiler. See the comment on GoSeperator. + if strings.ContainsRune(path, '\\') { + klog.Warningf("Warning: backslash used in import path '%v', this is unsupported.\n", path) + } + + dirs := strings.Split(path, namer.GoSeperator) + for n := len(dirs) - 1; n >= 0; n-- { + // follow kube convention of not having anything between directory names + name := strings.Join(dirs[n:], "") + name = strings.Replace(name, "_", "", -1) + // These characters commonly appear in import paths for go + // packages, but aren't legal go names. So we'll sanitize. + name = strings.Replace(name, ".", "", -1) + name = strings.Replace(name, "-", "", -1) + if _, found := tracker.PathOf(name); found { + // This name collides with some other package + continue + } + + // If the import name is a Go keyword, prefix with an underscore. + if token.Lookup(name).IsKeyword() { + name = "_" + name + } + return name + } + panic("can't find import for " + path) +} diff --git a/vendor/k8s.io/gengo/generator/snippet_writer.go b/vendor/k8s.io/gengo/generator/snippet_writer.go new file mode 100644 index 00000000..eae917c1 --- /dev/null +++ b/vendor/k8s.io/gengo/generator/snippet_writer.go @@ -0,0 +1,154 @@ +/* +Copyright 2015 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 generator + +import ( + "fmt" + "io" + "runtime" + "text/template" +) + +// SnippetWriter is an attempt to make the template library usable. +// Methods are chainable, and you don't have to check Error() until you're all +// done. +type SnippetWriter struct { + w io.Writer + context *Context + // Left & right delimiters. text/template defaults to "{{" and "}}" + // which is totally unusable for go code based templates. + left, right string + funcMap template.FuncMap + err error +} + +// w is the destination; left and right are the delimiters; @ and $ are both +// reasonable choices. +// +// c is used to make a function for every naming system, to which you can pass +// a type and get the corresponding name. +func NewSnippetWriter(w io.Writer, c *Context, left, right string) *SnippetWriter { + sw := &SnippetWriter{ + w: w, + context: c, + left: left, + right: right, + funcMap: template.FuncMap{}, + } + for name, namer := range c.Namers { + sw.funcMap[name] = namer.Name + } + return sw +} + +// Do parses format and runs args through it. You can have arbitrary logic in +// the format (see the text/template documentation), but consider running many +// short templaces, with ordinary go logic in between--this may be more +// readable. Do is chainable. Any error causes every other call to do to be +// ignored, and the error will be returned by Error(). So you can check it just +// once, at the end of your function. +// +// 'args' can be quite literally anything; read the text/template documentation +// for details. Maps and structs work particularly nicely. Conveniently, the +// types package is designed to have structs that are easily referencable from +// the template language. +// +// Example: +// +// sw := generator.NewSnippetWriter(outBuffer, context, "$", "$") +// sw.Do(`The public type name is: $.type|public$`, map[string]interface{}{"type": t}) +// return sw.Error() +// +// Where: +// * "$" starts a template directive +// * "." references the entire thing passed as args +// * "type" therefore sees a map and looks up the key "type" +// * "|" means "pass the thing on the left to the thing on the right" +// * "public" is the name of a naming system, so the SnippetWriter has given +// the template a function called "public" that takes a *types.Type and +// returns the naming system's name. E.g., if the type is "string" this might +// return "String". +// * the second "$" ends the template directive. +// +// The map is actually not necessary. The below does the same thing: +// +// sw.Do(`The public type name is: $.|public$`, t) +// +// You may or may not find it more readable to use the map with a descriptive +// key, but if you want to pass more than one arg, the map or a custom struct +// becomes a requirement. You can do arbitrary logic inside these templates, +// but you should consider doing the logic in go and stitching them together +// for the sake of your readers. +// +// TODO: Change Do() to optionally take a list of pairs of parameters (key, value) +// and have it construct a combined map with that and args. +func (s *SnippetWriter) Do(format string, args interface{}) *SnippetWriter { + if s.err != nil { + return s + } + // Name the template by source file:line so it can be found when + // there's an error. + _, file, line, _ := runtime.Caller(1) + tmpl, err := template. + New(fmt.Sprintf("%s:%d", file, line)). + Delims(s.left, s.right). + Funcs(s.funcMap). + Parse(format) + if err != nil { + s.err = err + return s + } + err = tmpl.Execute(s.w, args) + if err != nil { + s.err = err + } + return s +} + +// Args exists to make it convenient to construct arguments for +// SnippetWriter.Do. +type Args map[interface{}]interface{} + +// With makes a copy of a and adds the given key, value pair. +func (a Args) With(key, value interface{}) Args { + a2 := Args{key: value} + for k, v := range a { + a2[k] = v + } + return a2 +} + +// WithArgs makes a copy of a and adds the given arguments. +func (a Args) WithArgs(rhs Args) Args { + a2 := Args{} + for k, v := range rhs { + a2[k] = v + } + for k, v := range a { + a2[k] = v + } + return a2 +} + +func (s *SnippetWriter) Out() io.Writer { + return s.w +} + +// Error returns any encountered error. +func (s *SnippetWriter) Error() error { + return s.err +} diff --git a/vendor/k8s.io/gengo/generator/transitive_closure.go b/vendor/k8s.io/gengo/generator/transitive_closure.go new file mode 100644 index 00000000..385a49fc --- /dev/null +++ b/vendor/k8s.io/gengo/generator/transitive_closure.go @@ -0,0 +1,65 @@ +/* +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 generator + +import "sort" + +type edge struct { + from string + to string +} + +func transitiveClosure(in map[string][]string) map[string][]string { + adj := make(map[edge]bool) + imports := make(map[string]struct{}) + for from, tos := range in { + for _, to := range tos { + adj[edge{from, to}] = true + imports[to] = struct{}{} + } + } + + // Warshal's algorithm + for k := range in { + for i := range in { + if !adj[edge{i, k}] { + continue + } + for j := range imports { + if adj[edge{i, j}] { + continue + } + if adj[edge{k, j}] { + adj[edge{i, j}] = true + } + } + } + } + + out := make(map[string][]string, len(in)) + for i := range in { + for j := range imports { + if adj[edge{i, j}] { + out[i] = append(out[i], j) + } + } + + sort.Strings(out[i]) + } + + return out +} diff --git a/vendor/k8s.io/gengo/namer/doc.go b/vendor/k8s.io/gengo/namer/doc.go new file mode 100644 index 00000000..8a44ea99 --- /dev/null +++ b/vendor/k8s.io/gengo/namer/doc.go @@ -0,0 +1,31 @@ +/* +Copyright 2015 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 namer has support for making different type naming systems. +// +// This is because sometimes you want to refer to the literal type, sometimes +// you want to make a name for the thing you're generating, and you want to +// make the name based on the type. For example, if you have `type foo string`, +// you want to be able to generate something like `func FooPrinter(f *foo) { +// Print(string(*f)) }`; that is, you want to refer to a public name, a literal +// name, and the underlying literal name. +// +// This package supports the idea of a "Namer" and a set of "NameSystems" to +// support these use cases. +// +// Additionally, a "RawNamer" can optionally keep track of what needs to be +// imported. +package namer // import "k8s.io/gengo/namer" diff --git a/vendor/k8s.io/gengo/namer/import_tracker.go b/vendor/k8s.io/gengo/namer/import_tracker.go new file mode 100644 index 00000000..37094b2d --- /dev/null +++ b/vendor/k8s.io/gengo/namer/import_tracker.go @@ -0,0 +1,112 @@ +/* +Copyright 2015 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 namer + +import ( + "sort" + + "k8s.io/gengo/types" +) + +// ImportTracker may be passed to a namer.RawNamer, to track the imports needed +// for the types it names. +// +// TODO: pay attention to the package name (instead of renaming every package). +type DefaultImportTracker struct { + pathToName map[string]string + // forbidden names are in here. (e.g. "go" is a directory in which + // there is code, but "go" is not a legal name for a package, so we put + // it here to prevent us from naming any package "go") + nameToPath map[string]string + local types.Name + + // Returns true if a given types is an invalid type and should be ignored. + IsInvalidType func(*types.Type) bool + // Returns the final local name for the given name + LocalName func(types.Name) string + // Returns the "import" line for a given (path, name). + PrintImport func(string, string) string +} + +func NewDefaultImportTracker(local types.Name) DefaultImportTracker { + return DefaultImportTracker{ + pathToName: map[string]string{}, + nameToPath: map[string]string{}, + local: local, + } +} + +func (tracker *DefaultImportTracker) AddTypes(types ...*types.Type) { + for _, t := range types { + tracker.AddType(t) + } +} +func (tracker *DefaultImportTracker) AddType(t *types.Type) { + if tracker.local.Package == t.Name.Package { + return + } + + if tracker.IsInvalidType(t) { + if t.Kind == types.Builtin { + return + } + if _, ok := tracker.nameToPath[t.Name.Package]; !ok { + tracker.nameToPath[t.Name.Package] = "" + } + return + } + + if len(t.Name.Package) == 0 { + return + } + path := t.Name.Path + if len(path) == 0 { + path = t.Name.Package + } + if _, ok := tracker.pathToName[path]; ok { + return + } + name := tracker.LocalName(t.Name) + tracker.nameToPath[name] = path + tracker.pathToName[path] = name +} + +func (tracker *DefaultImportTracker) ImportLines() []string { + importPaths := []string{} + for path := range tracker.pathToName { + importPaths = append(importPaths, path) + } + sort.Sort(sort.StringSlice(importPaths)) + out := []string{} + for _, path := range importPaths { + out = append(out, tracker.PrintImport(path, tracker.pathToName[path])) + } + return out +} + +// LocalNameOf returns the name you would use to refer to the package at the +// specified path within the body of a file. +func (tracker *DefaultImportTracker) LocalNameOf(path string) string { + return tracker.pathToName[path] +} + +// PathOf returns the path that a given localName is referring to within the +// body of a file. +func (tracker *DefaultImportTracker) PathOf(localName string) (string, bool) { + name, ok := tracker.nameToPath[localName] + return name, ok +} diff --git a/vendor/k8s.io/gengo/namer/namer.go b/vendor/k8s.io/gengo/namer/namer.go new file mode 100644 index 00000000..d700a00a --- /dev/null +++ b/vendor/k8s.io/gengo/namer/namer.go @@ -0,0 +1,383 @@ +/* +Copyright 2015 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 namer + +import ( + "path/filepath" + "strings" + + "k8s.io/gengo/types" +) + +const ( + // GoSeperator is used to split go import paths. + // Forward slash is used instead of filepath.Seperator because it is the + // only universally-accepted path delimiter and the only delimiter not + // potentially forbidden by Go compilers. (In particular gc does not allow + // the use of backslashes in import paths.) + // See https://golang.org/ref/spec#Import_declarations. + // See also https://github.com/kubernetes/gengo/issues/83#issuecomment-367040772. + GoSeperator = "/" +) + +// Returns whether a name is a private Go name. +func IsPrivateGoName(name string) bool { + return len(name) == 0 || strings.ToLower(name[:1]) == name[:1] +} + +// NewPublicNamer is a helper function that returns a namer that makes +// CamelCase names. See the NameStrategy struct for an explanation of the +// arguments to this constructor. +func NewPublicNamer(prependPackageNames int, ignoreWords ...string) *NameStrategy { + n := &NameStrategy{ + Join: Joiner(IC, IC), + IgnoreWords: map[string]bool{}, + PrependPackageNames: prependPackageNames, + } + for _, w := range ignoreWords { + n.IgnoreWords[w] = true + } + return n +} + +// NewPrivateNamer is a helper function that returns a namer that makes +// camelCase names. See the NameStrategy struct for an explanation of the +// arguments to this constructor. +func NewPrivateNamer(prependPackageNames int, ignoreWords ...string) *NameStrategy { + n := &NameStrategy{ + Join: Joiner(IL, IC), + IgnoreWords: map[string]bool{}, + PrependPackageNames: prependPackageNames, + } + for _, w := range ignoreWords { + n.IgnoreWords[w] = true + } + return n +} + +// NewRawNamer will return a Namer that makes a name by which you would +// directly refer to a type, optionally keeping track of the import paths +// necessary to reference the names it provides. Tracker may be nil. +// The 'pkg' is the full package name, in which the Namer is used - all +// types from that package will be referenced by just type name without +// referencing the package. +// +// For example, if the type is map[string]int, a raw namer will literally +// return "map[string]int". +// +// Or if the type, in package foo, is "type Bar struct { ... }", then the raw +// namer will return "foo.Bar" as the name of the type, and if 'tracker' was +// not nil, will record that package foo needs to be imported. +func NewRawNamer(pkg string, tracker ImportTracker) *rawNamer { + return &rawNamer{pkg: pkg, tracker: tracker} +} + +// Names is a map from Type to name, as defined by some Namer. +type Names map[*types.Type]string + +// Namer takes a type, and assigns a name. +// +// The purpose of this complexity is so that you can assign coherent +// side-by-side systems of names for the types. For example, you might want a +// public interface, a private implementation struct, and also to reference +// literally the type name. +// +// Note that it is safe to call your own Name() function recursively to find +// the names of keys, elements, etc. This is because anonymous types can't have +// cycles in their names, and named types don't require the sort of recursion +// that would be problematic. +type Namer interface { + Name(*types.Type) string +} + +// NameSystems is a map of a system name to a namer for that system. +type NameSystems map[string]Namer + +// NameStrategy is a general Namer. The easiest way to use it is to copy the +// Public/PrivateNamer variables, and modify the members you wish to change. +// +// The Name method produces a name for the given type, of the forms: +// Anonymous types: +// Named types: +// +// In all cases, every part of the name is run through the capitalization +// functions. +// +// The IgnoreWords map can be set if you have directory names that are +// semantically meaningless for naming purposes, e.g. "proto". +// +// Prefix and Suffix can be used to disambiguate parallel systems of type +// names. For example, if you want to generate an interface and an +// implementation, you might want to suffix one with "Interface" and the other +// with "Implementation". Another common use-- if you want to generate private +// types, and one of your source types could be "string", you can't use the +// default lowercase private namer. You'll have to add a suffix or prefix. +type NameStrategy struct { + Prefix, Suffix string + Join func(pre string, parts []string, post string) string + + // Add non-meaningful package directory names here (e.g. "proto") and + // they will be ignored. + IgnoreWords map[string]bool + + // If > 0, prepend exactly that many package directory names (or as + // many as there are). Package names listed in "IgnoreWords" will be + // ignored. + // + // For example, if Ignore words lists "proto" and type Foo is in + // pkg/server/frobbing/proto, then a value of 1 will give a type name + // of FrobbingFoo, 2 gives ServerFrobbingFoo, etc. + PrependPackageNames int + + // A cache of names thus far assigned by this namer. + Names +} + +// IC ensures the first character is uppercase. +func IC(in string) string { + if in == "" { + return in + } + return strings.ToUpper(in[:1]) + in[1:] +} + +// IL ensures the first character is lowercase. +func IL(in string) string { + if in == "" { + return in + } + return strings.ToLower(in[:1]) + in[1:] +} + +// Joiner lets you specify functions that preprocess the various components of +// a name before joining them. You can construct e.g. camelCase or CamelCase or +// any other way of joining words. (See the IC and IL convenience functions.) +func Joiner(first, others func(string) string) func(pre string, in []string, post string) string { + return func(pre string, in []string, post string) string { + tmp := []string{others(pre)} + for i := range in { + tmp = append(tmp, others(in[i])) + } + tmp = append(tmp, others(post)) + return first(strings.Join(tmp, "")) + } +} + +func (ns *NameStrategy) removePrefixAndSuffix(s string) string { + // The join function may have changed capitalization. + lowerIn := strings.ToLower(s) + lowerP := strings.ToLower(ns.Prefix) + lowerS := strings.ToLower(ns.Suffix) + b, e := 0, len(s) + if strings.HasPrefix(lowerIn, lowerP) { + b = len(ns.Prefix) + } + if strings.HasSuffix(lowerIn, lowerS) { + e -= len(ns.Suffix) + } + return s[b:e] +} + +var ( + importPathNameSanitizer = strings.NewReplacer("-", "_", ".", "") +) + +// filters out unwanted directory names and sanitizes remaining names. +func (ns *NameStrategy) filterDirs(path string) []string { + allDirs := strings.Split(path, GoSeperator) + dirs := make([]string, 0, len(allDirs)) + for _, p := range allDirs { + if ns.IgnoreWords == nil || !ns.IgnoreWords[p] { + dirs = append(dirs, importPathNameSanitizer.Replace(p)) + } + } + return dirs +} + +// See the comment on NameStrategy. +func (ns *NameStrategy) Name(t *types.Type) string { + if ns.Names == nil { + ns.Names = Names{} + } + if s, ok := ns.Names[t]; ok { + return s + } + + if t.Name.Package != "" { + dirs := append(ns.filterDirs(t.Name.Package), t.Name.Name) + i := ns.PrependPackageNames + 1 + dn := len(dirs) + if i > dn { + i = dn + } + name := ns.Join(ns.Prefix, dirs[dn-i:], ns.Suffix) + ns.Names[t] = name + return name + } + + // Only anonymous types remain. + var name string + switch t.Kind { + case types.Builtin: + name = ns.Join(ns.Prefix, []string{t.Name.Name}, ns.Suffix) + case types.Map: + name = ns.Join(ns.Prefix, []string{ + "Map", + ns.removePrefixAndSuffix(ns.Name(t.Key)), + "To", + ns.removePrefixAndSuffix(ns.Name(t.Elem)), + }, ns.Suffix) + case types.Slice: + name = ns.Join(ns.Prefix, []string{ + "Slice", + ns.removePrefixAndSuffix(ns.Name(t.Elem)), + }, ns.Suffix) + case types.Pointer: + name = ns.Join(ns.Prefix, []string{ + "Pointer", + ns.removePrefixAndSuffix(ns.Name(t.Elem)), + }, ns.Suffix) + case types.Struct: + names := []string{"Struct"} + for _, m := range t.Members { + names = append(names, ns.removePrefixAndSuffix(ns.Name(m.Type))) + } + name = ns.Join(ns.Prefix, names, ns.Suffix) + case types.Chan: + name = ns.Join(ns.Prefix, []string{ + "Chan", + ns.removePrefixAndSuffix(ns.Name(t.Elem)), + }, ns.Suffix) + case types.Interface: + // TODO: add to name test + names := []string{"Interface"} + for _, m := range t.Methods { + // TODO: include function signature + names = append(names, m.Name.Name) + } + name = ns.Join(ns.Prefix, names, ns.Suffix) + case types.Func: + // TODO: add to name test + parts := []string{"Func"} + for _, pt := range t.Signature.Parameters { + parts = append(parts, ns.removePrefixAndSuffix(ns.Name(pt))) + } + parts = append(parts, "Returns") + for _, rt := range t.Signature.Results { + parts = append(parts, ns.removePrefixAndSuffix(ns.Name(rt))) + } + name = ns.Join(ns.Prefix, parts, ns.Suffix) + default: + name = "unnameable_" + string(t.Kind) + } + ns.Names[t] = name + return name +} + +// ImportTracker allows a raw namer to keep track of the packages needed for +// import. You can implement yourself or use the one in the generation package. +type ImportTracker interface { + AddType(*types.Type) + LocalNameOf(packagePath string) string + PathOf(localName string) (string, bool) + ImportLines() []string +} + +type rawNamer struct { + pkg string + tracker ImportTracker + Names +} + +// Name makes a name the way you'd write it to literally refer to type t, +// making ordinary assumptions about how you've imported t's package (or using +// r.tracker to specifically track the package imports). +func (r *rawNamer) Name(t *types.Type) string { + if r.Names == nil { + r.Names = Names{} + } + if name, ok := r.Names[t]; ok { + return name + } + if t.Name.Package != "" { + var name string + if r.tracker != nil { + r.tracker.AddType(t) + if t.Name.Package == r.pkg { + name = t.Name.Name + } else { + name = r.tracker.LocalNameOf(t.Name.Package) + "." + t.Name.Name + } + } else { + if t.Name.Package == r.pkg { + name = t.Name.Name + } else { + name = filepath.Base(t.Name.Package) + "." + t.Name.Name + } + } + r.Names[t] = name + return name + } + var name string + switch t.Kind { + case types.Builtin: + name = t.Name.Name + case types.Map: + name = "map[" + r.Name(t.Key) + "]" + r.Name(t.Elem) + case types.Slice: + name = "[]" + r.Name(t.Elem) + case types.Pointer: + name = "*" + r.Name(t.Elem) + case types.Struct: + elems := []string{} + for _, m := range t.Members { + elems = append(elems, m.Name+" "+r.Name(m.Type)) + } + name = "struct{" + strings.Join(elems, "; ") + "}" + case types.Chan: + // TODO: include directionality + name = "chan " + r.Name(t.Elem) + case types.Interface: + // TODO: add to name test + elems := []string{} + for _, m := range t.Methods { + // TODO: include function signature + elems = append(elems, m.Name.Name) + } + name = "interface{" + strings.Join(elems, "; ") + "}" + case types.Func: + // TODO: add to name test + params := []string{} + for _, pt := range t.Signature.Parameters { + params = append(params, r.Name(pt)) + } + results := []string{} + for _, rt := range t.Signature.Results { + results = append(results, r.Name(rt)) + } + name = "func(" + strings.Join(params, ",") + ")" + if len(results) == 1 { + name += " " + results[0] + } else if len(results) > 1 { + name += " (" + strings.Join(results, ",") + ")" + } + default: + name = "unnameable_" + string(t.Kind) + } + r.Names[t] = name + return name +} diff --git a/vendor/k8s.io/gengo/namer/order.go b/vendor/k8s.io/gengo/namer/order.go new file mode 100644 index 00000000..fd89be9b --- /dev/null +++ b/vendor/k8s.io/gengo/namer/order.go @@ -0,0 +1,72 @@ +/* +Copyright 2015 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 namer + +import ( + "sort" + + "k8s.io/gengo/types" +) + +// Orderer produces an ordering of types given a Namer. +type Orderer struct { + Namer +} + +// OrderUniverse assigns a name to every type in the Universe, including Types, +// Functions and Variables, and returns a list sorted by those names. +func (o *Orderer) OrderUniverse(u types.Universe) []*types.Type { + list := tList{ + namer: o.Namer, + } + for _, p := range u { + for _, t := range p.Types { + list.types = append(list.types, t) + } + for _, f := range p.Functions { + list.types = append(list.types, f) + } + for _, v := range p.Variables { + list.types = append(list.types, v) + } + for _, v := range p.Constants { + list.types = append(list.types, v) + } + } + sort.Sort(list) + return list.types +} + +// OrderTypes assigns a name to every type, and returns a list sorted by those +// names. +func (o *Orderer) OrderTypes(typeList []*types.Type) []*types.Type { + list := tList{ + namer: o.Namer, + types: typeList, + } + sort.Sort(list) + return list.types +} + +type tList struct { + namer Namer + types []*types.Type +} + +func (t tList) Len() int { return len(t.types) } +func (t tList) Less(i, j int) bool { return t.namer.Name(t.types[i]) < t.namer.Name(t.types[j]) } +func (t tList) Swap(i, j int) { t.types[i], t.types[j] = t.types[j], t.types[i] } diff --git a/vendor/k8s.io/gengo/namer/plural_namer.go b/vendor/k8s.io/gengo/namer/plural_namer.go new file mode 100644 index 00000000..a9a198a7 --- /dev/null +++ b/vendor/k8s.io/gengo/namer/plural_namer.go @@ -0,0 +1,120 @@ +/* +Copyright 2015 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 namer + +import ( + "strings" + + "k8s.io/gengo/types" +) + +var consonants = "bcdfghjklmnpqrsttvwxyz" + +type pluralNamer struct { + // key is the case-sensitive type name, value is the case-insensitive + // intended output. + exceptions map[string]string + finalize func(string) string +} + +// NewPublicPluralNamer returns a namer that returns the plural form of the input +// type's name, starting with a uppercase letter. +func NewPublicPluralNamer(exceptions map[string]string) *pluralNamer { + return &pluralNamer{exceptions, IC} +} + +// NewPrivatePluralNamer returns a namer that returns the plural form of the input +// type's name, starting with a lowercase letter. +func NewPrivatePluralNamer(exceptions map[string]string) *pluralNamer { + return &pluralNamer{exceptions, IL} +} + +// NewAllLowercasePluralNamer returns a namer that returns the plural form of the input +// type's name, with all letters in lowercase. +func NewAllLowercasePluralNamer(exceptions map[string]string) *pluralNamer { + return &pluralNamer{exceptions, strings.ToLower} +} + +// Name returns the plural form of the type's name. If the type's name is found +// in the exceptions map, the map value is returned. +func (r *pluralNamer) Name(t *types.Type) string { + singular := t.Name.Name + var plural string + var ok bool + if plural, ok = r.exceptions[singular]; ok { + return r.finalize(plural) + } + if len(singular) < 2 { + return r.finalize(singular) + } + + switch rune(singular[len(singular)-1]) { + case 's', 'x', 'z': + plural = esPlural(singular) + case 'y': + sl := rune(singular[len(singular)-2]) + if isConsonant(sl) { + plural = iesPlural(singular) + } else { + plural = sPlural(singular) + } + case 'h': + sl := rune(singular[len(singular)-2]) + if sl == 'c' || sl == 's' { + plural = esPlural(singular) + } else { + plural = sPlural(singular) + } + case 'e': + sl := rune(singular[len(singular)-2]) + if sl == 'f' { + plural = vesPlural(singular[:len(singular)-1]) + } else { + plural = sPlural(singular) + } + case 'f': + plural = vesPlural(singular) + default: + plural = sPlural(singular) + } + return r.finalize(plural) +} + +func iesPlural(singular string) string { + return singular[:len(singular)-1] + "ies" +} + +func vesPlural(singular string) string { + return singular[:len(singular)-1] + "ves" +} + +func esPlural(singular string) string { + return singular + "es" +} + +func sPlural(singular string) string { + return singular + "s" +} + +func isConsonant(char rune) bool { + for _, c := range consonants { + if char == c { + return true + } + } + return false +} diff --git a/vendor/k8s.io/gengo/parser/doc.go b/vendor/k8s.io/gengo/parser/doc.go new file mode 100644 index 00000000..8231b6d4 --- /dev/null +++ b/vendor/k8s.io/gengo/parser/doc.go @@ -0,0 +1,19 @@ +/* +Copyright 2015 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 parser provides code to parse go files, type-check them, extract the +// types. +package parser // import "k8s.io/gengo/parser" diff --git a/vendor/k8s.io/gengo/parser/parse.go b/vendor/k8s.io/gengo/parser/parse.go new file mode 100644 index 00000000..2bceaee4 --- /dev/null +++ b/vendor/k8s.io/gengo/parser/parse.go @@ -0,0 +1,844 @@ +/* +Copyright 2015 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 parser + +import ( + "fmt" + "go/ast" + "go/build" + "go/parser" + "go/token" + tc "go/types" + "io/ioutil" + "os" + "os/exec" + "path" + "path/filepath" + "sort" + "strings" + + "k8s.io/gengo/types" + "k8s.io/klog" +) + +// This clarifies when a pkg path has been canonicalized. +type importPathString string + +// Builder lets you add all the go files in all the packages that you care +// about, then constructs the type source data. +type Builder struct { + context *build.Context + + // If true, include *_test.go + IncludeTestFiles bool + + // Map of package names to more canonical information about the package. + // This might hold the same value for multiple names, e.g. if someone + // referenced ./pkg/name or in the case of vendoring, which canonicalizes + // differently that what humans would type. + buildPackages map[string]*build.Package + + fset *token.FileSet + // map of package path to list of parsed files + parsed map[importPathString][]parsedFile + // map of package path to absolute path (to prevent overlap) + absPaths map[importPathString]string + + // Set by typeCheckPackage(), used by importPackage() and friends. + typeCheckedPackages map[importPathString]*tc.Package + + // Map of package path to whether the user requested it or it was from + // an import. + userRequested map[importPathString]bool + + // All comments from everywhere in every parsed file. + endLineToCommentGroup map[fileLine]*ast.CommentGroup + + // map of package to list of packages it imports. + importGraph map[importPathString]map[string]struct{} +} + +// parsedFile is for tracking files with name +type parsedFile struct { + name string + file *ast.File +} + +// key type for finding comments. +type fileLine struct { + file string + line int +} + +// New constructs a new builder. +func New() *Builder { + c := build.Default + if c.GOROOT == "" { + if p, err := exec.Command("which", "go").CombinedOutput(); err == nil { + // The returned string will have some/path/bin/go, so remove the last two elements. + c.GOROOT = filepath.Dir(filepath.Dir(strings.Trim(string(p), "\n"))) + } else { + klog.Warningf("Warning: $GOROOT not set, and unable to run `which go` to find it: %v\n", err) + } + } + // Force this to off, since we don't properly parse CGo. All symbols must + // have non-CGo equivalents. + c.CgoEnabled = false + return &Builder{ + context: &c, + buildPackages: map[string]*build.Package{}, + typeCheckedPackages: map[importPathString]*tc.Package{}, + fset: token.NewFileSet(), + parsed: map[importPathString][]parsedFile{}, + absPaths: map[importPathString]string{}, + userRequested: map[importPathString]bool{}, + endLineToCommentGroup: map[fileLine]*ast.CommentGroup{}, + importGraph: map[importPathString]map[string]struct{}{}, + } +} + +// AddBuildTags adds the specified build tags to the parse context. +func (b *Builder) AddBuildTags(tags ...string) { + b.context.BuildTags = append(b.context.BuildTags, tags...) +} + +// Get package information from the go/build package. Automatically excludes +// e.g. test files and files for other platforms-- there is quite a bit of +// logic of that nature in the build package. +func (b *Builder) importBuildPackage(dir string) (*build.Package, error) { + if buildPkg, ok := b.buildPackages[dir]; ok { + return buildPkg, nil + } + // This validates the `package foo // github.com/bar/foo` comments. + buildPkg, err := b.importWithMode(dir, build.ImportComment) + if err != nil { + if _, ok := err.(*build.NoGoError); !ok { + return nil, fmt.Errorf("unable to import %q: %v", dir, err) + } + } + if buildPkg == nil { + // Might be an empty directory. Try to just find the dir. + buildPkg, err = b.importWithMode(dir, build.FindOnly) + if err != nil { + return nil, err + } + } + + // Remember it under the user-provided name. + klog.V(5).Infof("saving buildPackage %s", dir) + b.buildPackages[dir] = buildPkg + canonicalPackage := canonicalizeImportPath(buildPkg.ImportPath) + if dir != string(canonicalPackage) { + // Since `dir` is not the canonical name, see if we knew it under another name. + if buildPkg, ok := b.buildPackages[string(canonicalPackage)]; ok { + return buildPkg, nil + } + // Must be new, save it under the canonical name, too. + klog.V(5).Infof("saving buildPackage %s", canonicalPackage) + b.buildPackages[string(canonicalPackage)] = buildPkg + } + + return buildPkg, nil +} + +// AddFileForTest adds a file to the set, without verifying that the provided +// pkg actually exists on disk. The pkg must be of the form "canonical/pkg/path" +// and the path must be the absolute path to the file. Because this bypasses +// the normal recursive finding of package dependencies (on disk), test should +// sort their test files topologically first, so all deps are resolved by the +// time we need them. +func (b *Builder) AddFileForTest(pkg string, path string, src []byte) error { + if err := b.addFile(importPathString(pkg), path, src, true); err != nil { + return err + } + if _, err := b.typeCheckPackage(importPathString(pkg)); err != nil { + return err + } + return nil +} + +// addFile adds a file to the set. The pkgPath must be of the form +// "canonical/pkg/path" and the path must be the absolute path to the file. A +// flag indicates whether this file was user-requested or just from following +// the import graph. +func (b *Builder) addFile(pkgPath importPathString, path string, src []byte, userRequested bool) error { + for _, p := range b.parsed[pkgPath] { + if path == p.name { + klog.V(5).Infof("addFile %s %s already parsed, skipping", pkgPath, path) + return nil + } + } + klog.V(6).Infof("addFile %s %s", pkgPath, path) + p, err := parser.ParseFile(b.fset, path, src, parser.DeclarationErrors|parser.ParseComments) + if err != nil { + return err + } + + // This is redundant with addDir, but some tests call AddFileForTest, which + // call into here without calling addDir. + b.userRequested[pkgPath] = userRequested || b.userRequested[pkgPath] + + b.parsed[pkgPath] = append(b.parsed[pkgPath], parsedFile{path, p}) + for _, c := range p.Comments { + position := b.fset.Position(c.End()) + b.endLineToCommentGroup[fileLine{position.Filename, position.Line}] = c + } + + // We have to get the packages from this specific file, in case the + // user added individual files instead of entire directories. + if b.importGraph[pkgPath] == nil { + b.importGraph[pkgPath] = map[string]struct{}{} + } + for _, im := range p.Imports { + importedPath := strings.Trim(im.Path.Value, `"`) + b.importGraph[pkgPath][importedPath] = struct{}{} + } + return nil +} + +// AddDir adds an entire directory, scanning it for go files. 'dir' should have +// a single go package in it. GOPATH, GOROOT, and the location of your go +// binary (`which go`) will all be searched if dir doesn't literally resolve. +func (b *Builder) AddDir(dir string) error { + _, err := b.importPackage(dir, true) + return err +} + +// AddDirRecursive is just like AddDir, but it also recursively adds +// subdirectories; it returns an error only if the path couldn't be resolved; +// any directories recursed into without go source are ignored. +func (b *Builder) AddDirRecursive(dir string) error { + // Add the root. + if _, err := b.importPackage(dir, true); err != nil { + klog.Warningf("Ignoring directory %v: %v", dir, err) + } + + // filepath.Walk does not follow symlinks. We therefore evaluate symlinks and use that with + // filepath.Walk. + realPath, err := filepath.EvalSymlinks(b.buildPackages[dir].Dir) + if err != nil { + return err + } + + fn := func(filePath string, info os.FileInfo, err error) error { + if info != nil && info.IsDir() { + rel := filepath.ToSlash(strings.TrimPrefix(filePath, realPath)) + if rel != "" { + // Make a pkg path. + pkg := path.Join(string(canonicalizeImportPath(b.buildPackages[dir].ImportPath)), rel) + + // Add it. + if _, err := b.importPackage(pkg, true); err != nil { + klog.Warningf("Ignoring child directory %v: %v", pkg, err) + } + } + } + return nil + } + if err := filepath.Walk(realPath, fn); err != nil { + return err + } + return nil +} + +// AddDirTo adds an entire directory to a given Universe. Unlike AddDir, this +// processes the package immediately, which makes it safe to use from within a +// generator (rather than just at init time. 'dir' must be a single go package. +// GOPATH, GOROOT, and the location of your go binary (`which go`) will all be +// searched if dir doesn't literally resolve. +// Deprecated. Please use AddDirectoryTo. +func (b *Builder) AddDirTo(dir string, u *types.Universe) error { + // We want all types from this package, as if they were directly added + // by the user. They WERE added by the user, in effect. + if _, err := b.importPackage(dir, true); err != nil { + return err + } + return b.findTypesIn(canonicalizeImportPath(b.buildPackages[dir].ImportPath), u) +} + +// AddDirectoryTo adds an entire directory to a given Universe. Unlike AddDir, +// this processes the package immediately, which makes it safe to use from +// within a generator (rather than just at init time. 'dir' must be a single go +// package. GOPATH, GOROOT, and the location of your go binary (`which go`) +// will all be searched if dir doesn't literally resolve. +func (b *Builder) AddDirectoryTo(dir string, u *types.Universe) (*types.Package, error) { + // We want all types from this package, as if they were directly added + // by the user. They WERE added by the user, in effect. + if _, err := b.importPackage(dir, true); err != nil { + return nil, err + } + path := canonicalizeImportPath(b.buildPackages[dir].ImportPath) + if err := b.findTypesIn(path, u); err != nil { + return nil, err + } + return u.Package(string(path)), nil +} + +// The implementation of AddDir. A flag indicates whether this directory was +// user-requested or just from following the import graph. +func (b *Builder) addDir(dir string, userRequested bool) error { + klog.V(5).Infof("addDir %s", dir) + buildPkg, err := b.importBuildPackage(dir) + if err != nil { + return err + } + canonicalPackage := canonicalizeImportPath(buildPkg.ImportPath) + pkgPath := canonicalPackage + if dir != string(canonicalPackage) { + klog.V(5).Infof("addDir %s, canonical path is %s", dir, pkgPath) + } + + // Sanity check the pkg dir has not changed. + if prev, found := b.absPaths[pkgPath]; found { + if buildPkg.Dir != prev { + return fmt.Errorf("package %q (%s) previously resolved to %s", pkgPath, buildPkg.Dir, prev) + } + } else { + b.absPaths[pkgPath] = buildPkg.Dir + } + + files := []string{} + files = append(files, buildPkg.GoFiles...) + if b.IncludeTestFiles { + files = append(files, buildPkg.TestGoFiles...) + } + + for _, file := range files { + if !strings.HasSuffix(file, ".go") { + continue + } + absPath := filepath.Join(buildPkg.Dir, file) + data, err := ioutil.ReadFile(absPath) + if err != nil { + return fmt.Errorf("while loading %q: %v", absPath, err) + } + err = b.addFile(pkgPath, absPath, data, userRequested) + if err != nil { + return fmt.Errorf("while parsing %q: %v", absPath, err) + } + } + return nil +} + +// importPackage is a function that will be called by the type check package when it +// needs to import a go package. 'path' is the import path. +func (b *Builder) importPackage(dir string, userRequested bool) (*tc.Package, error) { + klog.V(5).Infof("importPackage %s", dir) + var pkgPath = importPathString(dir) + + // Get the canonical path if we can. + if buildPkg := b.buildPackages[dir]; buildPkg != nil { + canonicalPackage := canonicalizeImportPath(buildPkg.ImportPath) + klog.V(5).Infof("importPackage %s, canonical path is %s", dir, canonicalPackage) + pkgPath = canonicalPackage + } + + // If we have not seen this before, process it now. + ignoreError := false + if _, found := b.parsed[pkgPath]; !found { + // Ignore errors in paths that we're importing solely because + // they're referenced by other packages. + ignoreError = true + + // Add it. + if err := b.addDir(dir, userRequested); err != nil { + return nil, err + } + + // Get the canonical path now that it has been added. + if buildPkg := b.buildPackages[dir]; buildPkg != nil { + canonicalPackage := canonicalizeImportPath(buildPkg.ImportPath) + klog.V(5).Infof("importPackage %s, canonical path is %s", dir, canonicalPackage) + pkgPath = canonicalPackage + } + } + + // If it was previously known, just check that the user-requestedness hasn't + // changed. + b.userRequested[pkgPath] = userRequested || b.userRequested[pkgPath] + + // Run the type checker. We may end up doing this to pkgs that are already + // done, or are in the queue to be done later, but it will short-circuit, + // and we can't miss pkgs that are only depended on. + pkg, err := b.typeCheckPackage(pkgPath) + if err != nil { + switch { + case ignoreError && pkg != nil: + klog.V(2).Infof("type checking encountered some issues in %q, but ignoring.\n", pkgPath) + case !ignoreError && pkg != nil: + klog.V(2).Infof("type checking encountered some errors in %q\n", pkgPath) + return nil, err + default: + return nil, err + } + } + + return pkg, nil +} + +type importAdapter struct { + b *Builder +} + +func (a importAdapter) Import(path string) (*tc.Package, error) { + return a.b.importPackage(path, false) +} + +// typeCheckPackage will attempt to return the package even if there are some +// errors, so you may check whether the package is nil or not even if you get +// an error. +func (b *Builder) typeCheckPackage(pkgPath importPathString) (*tc.Package, error) { + klog.V(5).Infof("typeCheckPackage %s", pkgPath) + if pkg, ok := b.typeCheckedPackages[pkgPath]; ok { + if pkg != nil { + klog.V(6).Infof("typeCheckPackage %s already done", pkgPath) + return pkg, nil + } + // We store a nil right before starting work on a package. So + // if we get here and it's present and nil, that means there's + // another invocation of this function on the call stack + // already processing this package. + return nil, fmt.Errorf("circular dependency for %q", pkgPath) + } + parsedFiles, ok := b.parsed[pkgPath] + if !ok { + return nil, fmt.Errorf("No files for pkg %q", pkgPath) + } + files := make([]*ast.File, len(parsedFiles)) + for i := range parsedFiles { + files[i] = parsedFiles[i].file + } + b.typeCheckedPackages[pkgPath] = nil + c := tc.Config{ + IgnoreFuncBodies: true, + // Note that importAdapter can call b.importPackage which calls this + // method. So there can't be cycles in the import graph. + Importer: importAdapter{b}, + Error: func(err error) { + klog.V(2).Infof("type checker: %v\n", err) + }, + } + pkg, err := c.Check(string(pkgPath), b.fset, files, nil) + b.typeCheckedPackages[pkgPath] = pkg // record the result whether or not there was an error + return pkg, err +} + +// FindPackages fetches a list of the user-imported packages. +// Note that you need to call b.FindTypes() first. +func (b *Builder) FindPackages() []string { + // Iterate packages in a predictable order. + pkgPaths := []string{} + for k := range b.typeCheckedPackages { + pkgPaths = append(pkgPaths, string(k)) + } + sort.Strings(pkgPaths) + + result := []string{} + for _, pkgPath := range pkgPaths { + if b.userRequested[importPathString(pkgPath)] { + // Since walkType is recursive, all types that are in packages that + // were directly mentioned will be included. We don't need to + // include all types in all transitive packages, though. + result = append(result, pkgPath) + } + } + return result +} + +// FindTypes finalizes the package imports, and searches through all the +// packages for types. +func (b *Builder) FindTypes() (types.Universe, error) { + // Take a snapshot of pkgs to iterate, since this will recursively mutate + // b.parsed. Iterate in a predictable order. + pkgPaths := []string{} + for pkgPath := range b.parsed { + pkgPaths = append(pkgPaths, string(pkgPath)) + } + sort.Strings(pkgPaths) + + u := types.Universe{} + for _, pkgPath := range pkgPaths { + if err := b.findTypesIn(importPathString(pkgPath), &u); err != nil { + return nil, err + } + } + return u, nil +} + +// findTypesIn finalizes the package import and searches through the package +// for types. +func (b *Builder) findTypesIn(pkgPath importPathString, u *types.Universe) error { + klog.V(5).Infof("findTypesIn %s", pkgPath) + pkg := b.typeCheckedPackages[pkgPath] + if pkg == nil { + return fmt.Errorf("findTypesIn(%s): package is not known", pkgPath) + } + if !b.userRequested[pkgPath] { + // Since walkType is recursive, all types that the + // packages they asked for depend on will be included. + // But we don't need to include all types in all + // *packages* they depend on. + klog.V(5).Infof("findTypesIn %s: package is not user requested", pkgPath) + return nil + } + + // We're keeping this package. This call will create the record. + u.Package(string(pkgPath)).Name = pkg.Name() + u.Package(string(pkgPath)).Path = pkg.Path() + u.Package(string(pkgPath)).SourcePath = b.absPaths[pkgPath] + + for _, f := range b.parsed[pkgPath] { + if _, fileName := filepath.Split(f.name); fileName == "doc.go" { + tp := u.Package(string(pkgPath)) + // findTypesIn might be called multiple times. Clean up tp.Comments + // to avoid repeatedly fill same comments to it. + tp.Comments = []string{} + for i := range f.file.Comments { + tp.Comments = append(tp.Comments, splitLines(f.file.Comments[i].Text())...) + } + if f.file.Doc != nil { + tp.DocComments = splitLines(f.file.Doc.Text()) + } + } + } + + s := pkg.Scope() + for _, n := range s.Names() { + obj := s.Lookup(n) + tn, ok := obj.(*tc.TypeName) + if ok { + t := b.walkType(*u, nil, tn.Type()) + c1 := b.priorCommentLines(obj.Pos(), 1) + // c1.Text() is safe if c1 is nil + t.CommentLines = splitLines(c1.Text()) + if c1 == nil { + t.SecondClosestCommentLines = splitLines(b.priorCommentLines(obj.Pos(), 2).Text()) + } else { + t.SecondClosestCommentLines = splitLines(b.priorCommentLines(c1.List[0].Slash, 2).Text()) + } + } + tf, ok := obj.(*tc.Func) + // We only care about functions, not concrete/abstract methods. + if ok && tf.Type() != nil && tf.Type().(*tc.Signature).Recv() == nil { + t := b.addFunction(*u, nil, tf) + c1 := b.priorCommentLines(obj.Pos(), 1) + // c1.Text() is safe if c1 is nil + t.CommentLines = splitLines(c1.Text()) + if c1 == nil { + t.SecondClosestCommentLines = splitLines(b.priorCommentLines(obj.Pos(), 2).Text()) + } else { + t.SecondClosestCommentLines = splitLines(b.priorCommentLines(c1.List[0].Slash, 2).Text()) + } + } + tv, ok := obj.(*tc.Var) + if ok && !tv.IsField() { + b.addVariable(*u, nil, tv) + } + tconst, ok := obj.(*tc.Const) + if ok { + b.addConstant(*u, nil, tconst) + } + } + + importedPkgs := []string{} + for k := range b.importGraph[pkgPath] { + importedPkgs = append(importedPkgs, string(k)) + } + sort.Strings(importedPkgs) + for _, p := range importedPkgs { + u.AddImports(string(pkgPath), p) + } + return nil +} + +func (b *Builder) importWithMode(dir string, mode build.ImportMode) (*build.Package, error) { + // This is a bit of a hack. The srcDir argument to Import() should + // properly be the dir of the file which depends on the package to be + // imported, so that vendoring can work properly and local paths can + // resolve. We assume that there is only one level of vendoring, and that + // the CWD is inside the GOPATH, so this should be safe. Nobody should be + // using local (relative) paths except on the CLI, so CWD is also + // sufficient. + cwd, err := os.Getwd() + if err != nil { + return nil, fmt.Errorf("unable to get current directory: %v", err) + } + buildPkg, err := b.context.Import(dir, cwd, mode) + if err != nil { + return nil, err + } + return buildPkg, nil +} + +// if there's a comment on the line `lines` before pos, return its text, otherwise "". +func (b *Builder) priorCommentLines(pos token.Pos, lines int) *ast.CommentGroup { + position := b.fset.Position(pos) + key := fileLine{position.Filename, position.Line - lines} + return b.endLineToCommentGroup[key] +} + +func splitLines(str string) []string { + return strings.Split(strings.TrimRight(str, "\n"), "\n") +} + +func tcFuncNameToName(in string) types.Name { + name := strings.TrimPrefix(in, "func ") + nameParts := strings.Split(name, "(") + return tcNameToName(nameParts[0]) +} + +func tcVarNameToName(in string) types.Name { + nameParts := strings.Split(in, " ") + // nameParts[0] is "var". + // nameParts[2:] is the type of the variable, we ignore it for now. + return tcNameToName(nameParts[1]) +} + +func tcNameToName(in string) types.Name { + // Detect anonymous type names. (These may have '.' characters because + // embedded types may have packages, so we detect them specially.) + if strings.HasPrefix(in, "struct{") || + strings.HasPrefix(in, "<-chan") || + strings.HasPrefix(in, "chan<-") || + strings.HasPrefix(in, "chan ") || + strings.HasPrefix(in, "func(") || + strings.HasPrefix(in, "*") || + strings.HasPrefix(in, "map[") || + strings.HasPrefix(in, "[") { + return types.Name{Name: in} + } + + // Otherwise, if there are '.' characters present, the name has a + // package path in front. + nameParts := strings.Split(in, ".") + name := types.Name{Name: in} + if n := len(nameParts); n >= 2 { + // The final "." is the name of the type--previous ones must + // have been in the package path. + name.Package, name.Name = strings.Join(nameParts[:n-1], "."), nameParts[n-1] + } + return name +} + +func (b *Builder) convertSignature(u types.Universe, t *tc.Signature) *types.Signature { + signature := &types.Signature{} + for i := 0; i < t.Params().Len(); i++ { + signature.Parameters = append(signature.Parameters, b.walkType(u, nil, t.Params().At(i).Type())) + } + for i := 0; i < t.Results().Len(); i++ { + signature.Results = append(signature.Results, b.walkType(u, nil, t.Results().At(i).Type())) + } + if r := t.Recv(); r != nil { + signature.Receiver = b.walkType(u, nil, r.Type()) + } + signature.Variadic = t.Variadic() + return signature +} + +// walkType adds the type, and any necessary child types. +func (b *Builder) walkType(u types.Universe, useName *types.Name, in tc.Type) *types.Type { + // Most of the cases are underlying types of the named type. + name := tcNameToName(in.String()) + if useName != nil { + name = *useName + } + + switch t := in.(type) { + case *tc.Struct: + out := u.Type(name) + if out.Kind != types.Unknown { + return out + } + out.Kind = types.Struct + for i := 0; i < t.NumFields(); i++ { + f := t.Field(i) + m := types.Member{ + Name: f.Name(), + Embedded: f.Anonymous(), + Tags: t.Tag(i), + Type: b.walkType(u, nil, f.Type()), + CommentLines: splitLines(b.priorCommentLines(f.Pos(), 1).Text()), + } + out.Members = append(out.Members, m) + } + return out + case *tc.Map: + out := u.Type(name) + if out.Kind != types.Unknown { + return out + } + out.Kind = types.Map + out.Elem = b.walkType(u, nil, t.Elem()) + out.Key = b.walkType(u, nil, t.Key()) + return out + case *tc.Pointer: + out := u.Type(name) + if out.Kind != types.Unknown { + return out + } + out.Kind = types.Pointer + out.Elem = b.walkType(u, nil, t.Elem()) + return out + case *tc.Slice: + out := u.Type(name) + if out.Kind != types.Unknown { + return out + } + out.Kind = types.Slice + out.Elem = b.walkType(u, nil, t.Elem()) + return out + case *tc.Array: + out := u.Type(name) + if out.Kind != types.Unknown { + return out + } + out.Kind = types.Array + out.Elem = b.walkType(u, nil, t.Elem()) + // TODO: need to store array length, otherwise raw type name + // cannot be properly written. + return out + case *tc.Chan: + out := u.Type(name) + if out.Kind != types.Unknown { + return out + } + out.Kind = types.Chan + out.Elem = b.walkType(u, nil, t.Elem()) + // TODO: need to store direction, otherwise raw type name + // cannot be properly written. + return out + case *tc.Basic: + out := u.Type(types.Name{ + Package: "", + Name: t.Name(), + }) + if out.Kind != types.Unknown { + return out + } + out.Kind = types.Unsupported + return out + case *tc.Signature: + out := u.Type(name) + if out.Kind != types.Unknown { + return out + } + out.Kind = types.Func + out.Signature = b.convertSignature(u, t) + return out + case *tc.Interface: + out := u.Type(name) + if out.Kind != types.Unknown { + return out + } + out.Kind = types.Interface + t.Complete() + for i := 0; i < t.NumMethods(); i++ { + if out.Methods == nil { + out.Methods = map[string]*types.Type{} + } + out.Methods[t.Method(i).Name()] = b.walkType(u, nil, t.Method(i).Type()) + } + return out + case *tc.Named: + var out *types.Type + switch t.Underlying().(type) { + case *tc.Named, *tc.Basic, *tc.Map, *tc.Slice: + name := tcNameToName(t.String()) + out = u.Type(name) + if out.Kind != types.Unknown { + return out + } + out.Kind = types.Alias + out.Underlying = b.walkType(u, nil, t.Underlying()) + default: + // tc package makes everything "named" with an + // underlying anonymous type--we remove that annoying + // "feature" for users. This flattens those types + // together. + name := tcNameToName(t.String()) + if out := u.Type(name); out.Kind != types.Unknown { + return out // short circuit if we've already made this. + } + out = b.walkType(u, &name, t.Underlying()) + } + // If the underlying type didn't already add methods, add them. + // (Interface types will have already added methods.) + if len(out.Methods) == 0 { + for i := 0; i < t.NumMethods(); i++ { + if out.Methods == nil { + out.Methods = map[string]*types.Type{} + } + method := t.Method(i) + mt := b.walkType(u, nil, method.Type()) + mt.CommentLines = splitLines(b.priorCommentLines(method.Pos(), 1).Text()) + out.Methods[method.Name()] = mt + } + } + return out + default: + out := u.Type(name) + if out.Kind != types.Unknown { + return out + } + out.Kind = types.Unsupported + klog.Warningf("Making unsupported type entry %q for: %#v\n", out, t) + return out + } +} + +func (b *Builder) addFunction(u types.Universe, useName *types.Name, in *tc.Func) *types.Type { + name := tcFuncNameToName(in.String()) + if useName != nil { + name = *useName + } + out := u.Function(name) + out.Kind = types.DeclarationOf + out.Underlying = b.walkType(u, nil, in.Type()) + return out +} + +func (b *Builder) addVariable(u types.Universe, useName *types.Name, in *tc.Var) *types.Type { + name := tcVarNameToName(in.String()) + if useName != nil { + name = *useName + } + out := u.Variable(name) + out.Kind = types.DeclarationOf + out.Underlying = b.walkType(u, nil, in.Type()) + return out +} + +func (b *Builder) addConstant(u types.Universe, useName *types.Name, in *tc.Const) *types.Type { + name := tcVarNameToName(in.String()) + if useName != nil { + name = *useName + } + out := u.Constant(name) + out.Kind = types.DeclarationOf + out.Underlying = b.walkType(u, nil, in.Type()) + return out +} + +// canonicalizeImportPath takes an import path and returns the actual package. +// It doesn't support nested vendoring. +func canonicalizeImportPath(importPath string) importPathString { + if !strings.Contains(importPath, "/vendor/") { + return importPathString(importPath) + } + + return importPathString(importPath[strings.Index(importPath, "/vendor/")+len("/vendor/"):]) +} diff --git a/vendor/k8s.io/gengo/types/comments.go b/vendor/k8s.io/gengo/types/comments.go new file mode 100644 index 00000000..8150c383 --- /dev/null +++ b/vendor/k8s.io/gengo/types/comments.go @@ -0,0 +1,82 @@ +/* +Copyright 2015 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 types contains go type information, packaged in a way that makes +// auto-generation convenient, whether by template or straight go functions. +package types + +import ( + "fmt" + "strings" +) + +// ExtractCommentTags parses comments for lines of the form: +// +// 'marker' + "key=value". +// +// Values are optional; "" is the default. A tag can be specified more than +// one time and all values are returned. If the resulting map has an entry for +// a key, the value (a slice) is guaranteed to have at least 1 element. +// +// Example: if you pass "+" for 'marker', and the following lines are in +// the comments: +// +foo=value1 +// +bar +// +foo=value2 +// +baz="qux" +// Then this function will return: +// map[string][]string{"foo":{"value1, "value2"}, "bar": {""}, "baz": {"qux"}} +func ExtractCommentTags(marker string, lines []string) map[string][]string { + out := map[string][]string{} + for _, line := range lines { + line = strings.Trim(line, " ") + if len(line) == 0 { + continue + } + if !strings.HasPrefix(line, marker) { + continue + } + // TODO: we could support multiple values per key if we split on spaces + kv := strings.SplitN(line[len(marker):], "=", 2) + if len(kv) == 2 { + out[kv[0]] = append(out[kv[0]], kv[1]) + } else if len(kv) == 1 { + out[kv[0]] = append(out[kv[0]], "") + } + } + return out +} + +// ExtractSingleBoolCommentTag parses comments for lines of the form: +// +// 'marker' + "key=value1" +// +// If the tag is not found, the default value is returned. Values are asserted +// to be boolean ("true" or "false"), and any other value will cause an error +// to be returned. If the key has multiple values, the first one will be used. +func ExtractSingleBoolCommentTag(marker string, key string, defaultVal bool, lines []string) (bool, error) { + values := ExtractCommentTags(marker, lines)[key] + if values == nil { + return defaultVal, nil + } + if values[0] == "true" { + return true, nil + } + if values[0] == "false" { + return false, nil + } + return false, fmt.Errorf("tag value for %q is not boolean: %q", key, values[0]) +} diff --git a/vendor/k8s.io/gengo/types/doc.go b/vendor/k8s.io/gengo/types/doc.go new file mode 100644 index 00000000..74a969a7 --- /dev/null +++ b/vendor/k8s.io/gengo/types/doc.go @@ -0,0 +1,19 @@ +/* +Copyright 2015 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 types contains go type information, packaged in a way that makes +// auto-generation convenient, whether by template or straight go functions. +package types // import "k8s.io/gengo/types" diff --git a/vendor/k8s.io/gengo/types/flatten.go b/vendor/k8s.io/gengo/types/flatten.go new file mode 100644 index 00000000..585014e8 --- /dev/null +++ b/vendor/k8s.io/gengo/types/flatten.go @@ -0,0 +1,57 @@ +/* +Copyright 2015 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 types + +// FlattenMembers recursively takes any embedded members and puts them in the +// top level, correctly hiding them if the top level hides them. There must not +// be a cycle-- that implies infinite members. +// +// This is useful for e.g. computing all the valid keys in a json struct, +// properly considering any configuration of embedded structs. +func FlattenMembers(m []Member) []Member { + embedded := []Member{} + normal := []Member{} + type nameInfo struct { + top bool + i int + } + names := map[string]nameInfo{} + for i := range m { + if m[i].Embedded && m[i].Type.Kind == Struct { + embedded = append(embedded, m[i]) + } else { + normal = append(normal, m[i]) + names[m[i].Name] = nameInfo{true, len(normal) - 1} + } + } + for i := range embedded { + for _, e := range FlattenMembers(embedded[i].Type.Members) { + if info, found := names[e.Name]; found { + if info.top { + continue + } + if n := normal[info.i]; n.Name == e.Name && n.Type == e.Type { + continue + } + panic("conflicting members") + } + normal = append(normal, e) + names[e.Name] = nameInfo{false, len(normal) - 1} + } + } + return normal +} diff --git a/vendor/k8s.io/gengo/types/types.go b/vendor/k8s.io/gengo/types/types.go new file mode 100644 index 00000000..78357bcc --- /dev/null +++ b/vendor/k8s.io/gengo/types/types.go @@ -0,0 +1,526 @@ +/* +Copyright 2015 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 types + +import "strings" + +// Ref makes a reference to the given type. It can only be used for e.g. +// passing to namers. +func Ref(packageName, typeName string) *Type { + return &Type{Name: Name{ + Name: typeName, + Package: packageName, + }} +} + +// A type name may have a package qualifier. +type Name struct { + // Empty if embedded or builtin. This is the package path unless Path is specified. + Package string + // The type name. + Name string + // An optional location of the type definition for languages that can have disjoint + // packages and paths. + Path string +} + +// String returns the name formatted as a string. +func (n Name) String() string { + if n.Package == "" { + return n.Name + } + return n.Package + "." + n.Name +} + +// ParseFullyQualifiedName parses a name like k8s.io/kubernetes/pkg/api.Pod into a Name. +func ParseFullyQualifiedName(fqn string) Name { + cs := strings.Split(fqn, ".") + pkg := "" + if len(cs) > 1 { + pkg = strings.Join(cs[0:len(cs)-1], ".") + } + return Name{ + Name: cs[len(cs)-1], + Package: pkg, + } +} + +// The possible classes of types. +type Kind string + +const ( + // Builtin is a primitive, like bool, string, int. + Builtin Kind = "Builtin" + Struct Kind = "Struct" + Map Kind = "Map" + Slice Kind = "Slice" + Pointer Kind = "Pointer" + + // Alias is an alias of another type, e.g. in: + // type Foo string + // type Bar Foo + // Bar is an alias of Foo. + // + // In the real go type system, Foo is a "Named" string; but to simplify + // generation, this type system will just say that Foo *is* a builtin. + // We then need "Alias" as a way for us to say that Bar *is* a Foo. + Alias Kind = "Alias" + + // Interface is any type that could have differing types at run time. + Interface Kind = "Interface" + + // The remaining types are included for completeness, but are not well + // supported. + Array Kind = "Array" // Array is just like slice, but has a fixed length. + Chan Kind = "Chan" + Func Kind = "Func" + + // DeclarationOf is different from other Kinds; it indicates that instead of + // representing an actual Type, the type is a declaration of an instance of + // a type. E.g., a top-level function, variable, or constant. See the + // comment for Type.Name for more detail. + DeclarationOf Kind = "DeclarationOf" + Unknown Kind = "" + Unsupported Kind = "Unsupported" + + // Protobuf is protobuf type. + Protobuf Kind = "Protobuf" +) + +// Package holds package-level information. +// Fields are public, as everything in this package, to enable consumption by +// templates (for example). But it is strongly encouraged for code to build by +// using the provided functions. +type Package struct { + // Canonical name of this package-- its path. + Path string + + // The location this package was loaded from + SourcePath string + + // Short name of this package; the name that appears in the + // 'package x' line. + Name string + + // The comment right above the package declaration in doc.go, if any. + DocComments []string + + // All comments from doc.go, if any. + // TODO: remove Comments and use DocComments everywhere. + Comments []string + + // Types within this package, indexed by their name (*not* including + // package name). + Types map[string]*Type + + // Functions within this package, indexed by their name (*not* including + // package name). + Functions map[string]*Type + + // Global variables within this package, indexed by their name (*not* including + // package name). + Variables map[string]*Type + + // Global constants within this package, indexed by their name (*not* including + // package name). + Constants map[string]*Type + + // Packages imported by this package, indexed by (canonicalized) + // package path. + Imports map[string]*Package +} + +// Has returns true if the given name references a type known to this package. +func (p *Package) Has(name string) bool { + _, has := p.Types[name] + return has +} + +// Type gets the given Type in this Package. If the Type is not already +// defined, this will add it and return the new Type value. The caller is +// expected to finish initialization. +func (p *Package) Type(typeName string) *Type { + if t, ok := p.Types[typeName]; ok { + return t + } + if p.Path == "" { + // Import the standard builtin types! + if t, ok := builtins.Types[typeName]; ok { + p.Types[typeName] = t + return t + } + } + t := &Type{Name: Name{Package: p.Path, Name: typeName}} + p.Types[typeName] = t + return t +} + +// Function gets the given function Type in this Package. If the function is +// not already defined, this will add it. If a function is added, it's the +// caller's responsibility to finish construction of the function by setting +// Underlying to the correct type. +func (p *Package) Function(funcName string) *Type { + if t, ok := p.Functions[funcName]; ok { + return t + } + t := &Type{Name: Name{Package: p.Path, Name: funcName}} + t.Kind = DeclarationOf + p.Functions[funcName] = t + return t +} + +// Variable gets the given variable Type in this Package. If the variable is +// not already defined, this will add it. If a variable is added, it's the caller's +// responsibility to finish construction of the variable by setting Underlying +// to the correct type. +func (p *Package) Variable(varName string) *Type { + if t, ok := p.Variables[varName]; ok { + return t + } + t := &Type{Name: Name{Package: p.Path, Name: varName}} + t.Kind = DeclarationOf + p.Variables[varName] = t + return t +} + +// Constant gets the given constant Type in this Package. If the constant is +// not already defined, this will add it. If a constant is added, it's the caller's +// responsibility to finish construction of the constant by setting Underlying +// to the correct type. +func (p *Package) Constant(constName string) *Type { + if t, ok := p.Constants[constName]; ok { + return t + } + t := &Type{Name: Name{Package: p.Path, Name: constName}} + t.Kind = DeclarationOf + p.Constants[constName] = t + return t +} + +// HasImport returns true if p imports packageName. Package names include the +// package directory. +func (p *Package) HasImport(packageName string) bool { + _, has := p.Imports[packageName] + return has +} + +// Universe is a map of all packages. The key is the package name, but you +// should use Package(), Type(), Function(), or Variable() instead of direct +// access. +type Universe map[string]*Package + +// Type returns the canonical type for the given fully-qualified name. Builtin +// types will always be found, even if they haven't been explicitly added to +// the map. If a non-existing type is requested, this will create (a marker for) +// it. +func (u Universe) Type(n Name) *Type { + return u.Package(n.Package).Type(n.Name) +} + +// Function returns the canonical function for the given fully-qualified name. +// If a non-existing function is requested, this will create (a marker for) it. +// If a marker is created, it's the caller's responsibility to finish +// construction of the function by setting Underlying to the correct type. +func (u Universe) Function(n Name) *Type { + return u.Package(n.Package).Function(n.Name) +} + +// Variable returns the canonical variable for the given fully-qualified name. +// If a non-existing variable is requested, this will create (a marker for) it. +// If a marker is created, it's the caller's responsibility to finish +// construction of the variable by setting Underlying to the correct type. +func (u Universe) Variable(n Name) *Type { + return u.Package(n.Package).Variable(n.Name) +} + +// Constant returns the canonical constant for the given fully-qualified name. +// If a non-existing constant is requested, this will create (a marker for) it. +// If a marker is created, it's the caller's responsibility to finish +// construction of the constant by setting Underlying to the correct type. +func (u Universe) Constant(n Name) *Type { + return u.Package(n.Package).Constant(n.Name) +} + +// AddImports registers import lines for packageName. May be called multiple times. +// You are responsible for canonicalizing all package paths. +func (u Universe) AddImports(packagePath string, importPaths ...string) { + p := u.Package(packagePath) + for _, i := range importPaths { + p.Imports[i] = u.Package(i) + } +} + +// Package returns the Package for the given path. +// If a non-existing package is requested, this will create (a marker for) it. +// If a marker is created, it's the caller's responsibility to finish +// construction of the package. +func (u Universe) Package(packagePath string) *Package { + if p, ok := u[packagePath]; ok { + return p + } + p := &Package{ + Path: packagePath, + Types: map[string]*Type{}, + Functions: map[string]*Type{}, + Variables: map[string]*Type{}, + Constants: map[string]*Type{}, + Imports: map[string]*Package{}, + } + u[packagePath] = p + return p +} + +// Type represents a subset of possible go types. +type Type struct { + // There are two general categories of types, those explicitly named + // and those anonymous. Named ones will have a non-empty package in the + // name field. + // + // An exception: If Kind == DeclarationOf, then this name is the name of a + // top-level function, variable, or const, and the type can be found in Underlying. + // We do this to allow the naming system to work against these objects, even + // though they aren't strictly speaking types. + Name Name + + // The general kind of this type. + Kind Kind + + // If there are comment lines immediately before the type definition, + // they will be recorded here. + CommentLines []string + + // If there are comment lines preceding the `CommentLines`, they will be + // recorded here. There are two cases: + // --- + // SecondClosestCommentLines + // a blank line + // CommentLines + // type definition + // --- + // + // or + // --- + // SecondClosestCommentLines + // a blank line + // type definition + // --- + SecondClosestCommentLines []string + + // If Kind == Struct + Members []Member + + // If Kind == Map, Slice, Pointer, or Chan + Elem *Type + + // If Kind == Map, this is the map's key type. + Key *Type + + // If Kind == Alias, this is the underlying type. + // If Kind == DeclarationOf, this is the type of the declaration. + Underlying *Type + + // If Kind == Interface, this is the set of all required functions. + // Otherwise, if this is a named type, this is the list of methods that + // type has. (All elements will have Kind=="Func") + Methods map[string]*Type + + // If Kind == func, this is the signature of the function. + Signature *Signature + + // TODO: Add: + // * channel direction + // * array length +} + +// String returns the name of the type. +func (t *Type) String() string { + return t.Name.String() +} + +// IsPrimitive returns whether the type is a built-in type or is an alias to a +// built-in type. For example: strings and aliases of strings are primitives, +// structs are not. +func (t *Type) IsPrimitive() bool { + if t.Kind == Builtin || (t.Kind == Alias && t.Underlying.Kind == Builtin) { + return true + } + return false +} + +// IsAssignable returns whether the type is deep-assignable. For example, +// slices and maps and pointers are shallow copies, but ints and strings are +// complete. +func (t *Type) IsAssignable() bool { + if t.IsPrimitive() { + return true + } + if t.Kind == Struct { + for _, m := range t.Members { + if !m.Type.IsAssignable() { + return false + } + } + return true + } + return false +} + +// IsAnonymousStruct returns true if the type is an anonymous struct or an alias +// to an anonymous struct. +func (t *Type) IsAnonymousStruct() bool { + return (t.Kind == Struct && t.Name.Name == "struct{}") || (t.Kind == Alias && t.Underlying.IsAnonymousStruct()) +} + +// A single struct member +type Member struct { + // The name of the member. + Name string + + // If the member is embedded (anonymous) this will be true, and the + // Name will be the type name. + Embedded bool + + // If there are comment lines immediately before the member in the type + // definition, they will be recorded here. + CommentLines []string + + // If there are tags along with this member, they will be saved here. + Tags string + + // The type of this member. + Type *Type +} + +// String returns the name and type of the member. +func (m Member) String() string { + return m.Name + " " + m.Type.String() +} + +// Signature is a function's signature. +type Signature struct { + // TODO: store the parameter names, not just types. + + // If a method of some type, this is the type it's a member of. + Receiver *Type + Parameters []*Type + Results []*Type + + // True if the last in parameter is of the form ...T. + Variadic bool + + // If there are comment lines immediately before this + // signature/method/function declaration, they will be recorded here. + CommentLines []string +} + +// Built in types. +var ( + String = &Type{ + Name: Name{Name: "string"}, + Kind: Builtin, + } + Int64 = &Type{ + Name: Name{Name: "int64"}, + Kind: Builtin, + } + Int32 = &Type{ + Name: Name{Name: "int32"}, + Kind: Builtin, + } + Int16 = &Type{ + Name: Name{Name: "int16"}, + Kind: Builtin, + } + Int = &Type{ + Name: Name{Name: "int"}, + Kind: Builtin, + } + Uint64 = &Type{ + Name: Name{Name: "uint64"}, + Kind: Builtin, + } + Uint32 = &Type{ + Name: Name{Name: "uint32"}, + Kind: Builtin, + } + Uint16 = &Type{ + Name: Name{Name: "uint16"}, + Kind: Builtin, + } + Uint = &Type{ + Name: Name{Name: "uint"}, + Kind: Builtin, + } + Uintptr = &Type{ + Name: Name{Name: "uintptr"}, + Kind: Builtin, + } + Float64 = &Type{ + Name: Name{Name: "float64"}, + Kind: Builtin, + } + Float32 = &Type{ + Name: Name{Name: "float32"}, + Kind: Builtin, + } + Float = &Type{ + Name: Name{Name: "float"}, + Kind: Builtin, + } + Bool = &Type{ + Name: Name{Name: "bool"}, + Kind: Builtin, + } + Byte = &Type{ + Name: Name{Name: "byte"}, + Kind: Builtin, + } + + builtins = &Package{ + Types: map[string]*Type{ + "bool": Bool, + "string": String, + "int": Int, + "int64": Int64, + "int32": Int32, + "int16": Int16, + "int8": Byte, + "uint": Uint, + "uint64": Uint64, + "uint32": Uint32, + "uint16": Uint16, + "uint8": Byte, + "uintptr": Uintptr, + "byte": Byte, + "float": Float, + "float64": Float64, + "float32": Float32, + }, + Imports: map[string]*Package{}, + Path: "", + Name: "", + } +) + +func IsInteger(t *Type) bool { + switch t { + case Int, Int64, Int32, Int16, Uint, Uint64, Uint32, Uint16, Byte: + return true + default: + return false + } +} diff --git a/vendor/modules.txt b/vendor/modules.txt index 26eed286..bb74fcdf 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -191,21 +191,13 @@ github.com/rancher/lasso/pkg/scheme github.com/rancher/norman/condition github.com/rancher/norman/controller github.com/rancher/norman/httperror -github.com/rancher/norman/lifecycle github.com/rancher/norman/metrics github.com/rancher/norman/objectclient -github.com/rancher/norman/resource github.com/rancher/norman/types github.com/rancher/norman/types/convert github.com/rancher/norman/types/definition github.com/rancher/norman/types/slice github.com/rancher/norman/types/values -# github.com/rancher/types v0.0.0-20200609171939-d21f6b7b59e8 -github.com/rancher/types/apis/management.cattle.io/v3 -github.com/rancher/types/apis/project.cattle.io/v3 -github.com/rancher/types/condition -github.com/rancher/types/image -github.com/rancher/types/kdm # github.com/rancher/wrangler v0.6.2-0.20200515155908-1923f3f8ec3f github.com/rancher/wrangler/pkg/name # github.com/russross/blackfriday v1.5.2 @@ -268,6 +260,19 @@ golang.org/x/text/unicode/norm golang.org/x/text/width # golang.org/x/time v0.0.0-20191024005414-555d28b269f0 golang.org/x/time/rate +# golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2 +golang.org/x/tools/go/ast/astutil +golang.org/x/tools/go/gcexportdata +golang.org/x/tools/go/internal/gcimporter +golang.org/x/tools/go/internal/packagesdriver +golang.org/x/tools/go/packages +golang.org/x/tools/imports +golang.org/x/tools/internal/fastwalk +golang.org/x/tools/internal/gopathwalk +golang.org/x/tools/internal/imports +golang.org/x/tools/internal/module +golang.org/x/tools/internal/semver +golang.org/x/tools/internal/span # google.golang.org/appengine v1.6.5 google.golang.org/appengine/internal google.golang.org/appengine/internal/base @@ -491,6 +496,15 @@ k8s.io/client-go/util/keyutil k8s.io/client-go/util/workqueue # k8s.io/component-base v0.18.0 k8s.io/component-base/version +# k8s.io/gengo v0.0.0-20200114144118-36b2048a9120 +k8s.io/gengo/args +k8s.io/gengo/examples/deepcopy-gen +k8s.io/gengo/examples/deepcopy-gen/generators +k8s.io/gengo/examples/set-gen/sets +k8s.io/gengo/generator +k8s.io/gengo/namer +k8s.io/gengo/parser +k8s.io/gengo/types # k8s.io/klog v1.0.0 k8s.io/klog # k8s.io/kube-openapi v0.0.0-20200121204235-bf4fb3bd569c