├── .gitignore ├── Cargo.lock ├── Cargo.toml ├── README.md └── src └── main.rs /.gitignore: -------------------------------------------------------------------------------- 1 | target 2 | .vscode -------------------------------------------------------------------------------- /Cargo.lock: -------------------------------------------------------------------------------- 1 | # This file is automatically @generated by Cargo. 2 | # It is not intended for manual editing. 3 | version = 3 4 | 5 | [[package]] 6 | name = "ahash" 7 | version = "0.8.2" 8 | source = "registry+https://github.com/rust-lang/crates.io-index" 9 | checksum = "bf6ccdb167abbf410dcb915cabd428929d7f6a04980b54a11f26a39f1c7f7107" 10 | dependencies = [ 11 | "cfg-if", 12 | "getrandom", 13 | "once_cell", 14 | "version_check", 15 | ] 16 | 17 | [[package]] 18 | name = "android_system_properties" 19 | version = "0.1.5" 20 | source = "registry+https://github.com/rust-lang/crates.io-index" 21 | checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" 22 | dependencies = [ 23 | "libc", 24 | ] 25 | 26 | [[package]] 27 | name = "anyhow" 28 | version = "1.0.66" 29 | source = "registry+https://github.com/rust-lang/crates.io-index" 30 | checksum = "216261ddc8289130e551ddcd5ce8a064710c0d064a4d2895c67151c92b5443f6" 31 | 32 | [[package]] 33 | name = "autocfg" 34 | version = "1.1.0" 35 | source = "registry+https://github.com/rust-lang/crates.io-index" 36 | checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" 37 | 38 | [[package]] 39 | name = "backoff" 40 | version = "0.4.0" 41 | source = "registry+https://github.com/rust-lang/crates.io-index" 42 | checksum = "b62ddb9cb1ec0a098ad4bbf9344d0713fa193ae1a80af55febcff2627b6a00c1" 43 | dependencies = [ 44 | "getrandom", 45 | "instant", 46 | "rand", 47 | ] 48 | 49 | [[package]] 50 | name = "base64" 51 | version = "0.13.1" 52 | source = "registry+https://github.com/rust-lang/crates.io-index" 53 | checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" 54 | 55 | [[package]] 56 | name = "bitflags" 57 | version = "1.3.2" 58 | source = "registry+https://github.com/rust-lang/crates.io-index" 59 | checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" 60 | 61 | [[package]] 62 | name = "bumpalo" 63 | version = "3.11.1" 64 | source = "registry+https://github.com/rust-lang/crates.io-index" 65 | checksum = "572f695136211188308f16ad2ca5c851a712c464060ae6974944458eb83880ba" 66 | 67 | [[package]] 68 | name = "bytes" 69 | version = "1.3.0" 70 | source = "registry+https://github.com/rust-lang/crates.io-index" 71 | checksum = "dfb24e866b15a1af2a1b663f10c6b6b8f397a84aadb828f12e5b289ec23a3a3c" 72 | 73 | [[package]] 74 | name = "cc" 75 | version = "1.0.78" 76 | source = "registry+https://github.com/rust-lang/crates.io-index" 77 | checksum = "a20104e2335ce8a659d6dd92a51a767a0c062599c73b343fd152cb401e828c3d" 78 | 79 | [[package]] 80 | name = "cfg-if" 81 | version = "1.0.0" 82 | source = "registry+https://github.com/rust-lang/crates.io-index" 83 | checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" 84 | 85 | [[package]] 86 | name = "chrono" 87 | version = "0.4.23" 88 | source = "registry+https://github.com/rust-lang/crates.io-index" 89 | checksum = "16b0a3d9ed01224b22057780a37bb8c5dbfe1be8ba48678e7bf57ec4b385411f" 90 | dependencies = [ 91 | "iana-time-zone", 92 | "num-integer", 93 | "num-traits", 94 | "serde", 95 | "winapi", 96 | ] 97 | 98 | [[package]] 99 | name = "clap" 100 | version = "4.0.29" 101 | source = "registry+https://github.com/rust-lang/crates.io-index" 102 | checksum = "4d63b9e9c07271b9957ad22c173bae2a4d9a81127680962039296abcd2f8251d" 103 | dependencies = [ 104 | "bitflags", 105 | "clap_derive", 106 | "clap_lex", 107 | "is-terminal", 108 | "once_cell", 109 | "strsim", 110 | "termcolor", 111 | ] 112 | 113 | [[package]] 114 | name = "clap_derive" 115 | version = "4.0.21" 116 | source = "registry+https://github.com/rust-lang/crates.io-index" 117 | checksum = "0177313f9f02afc995627906bbd8967e2be069f5261954222dac78290c2b9014" 118 | dependencies = [ 119 | "heck", 120 | "proc-macro-error", 121 | "proc-macro2", 122 | "quote", 123 | "syn", 124 | ] 125 | 126 | [[package]] 127 | name = "clap_lex" 128 | version = "0.3.0" 129 | source = "registry+https://github.com/rust-lang/crates.io-index" 130 | checksum = "0d4198f73e42b4936b35b5bb248d81d2b595ecb170da0bac7655c54eedfa8da8" 131 | dependencies = [ 132 | "os_str_bytes", 133 | ] 134 | 135 | [[package]] 136 | name = "codespan-reporting" 137 | version = "0.11.1" 138 | source = "registry+https://github.com/rust-lang/crates.io-index" 139 | checksum = "3538270d33cc669650c4b093848450d380def10c331d38c768e34cac80576e6e" 140 | dependencies = [ 141 | "termcolor", 142 | "unicode-width", 143 | ] 144 | 145 | [[package]] 146 | name = "core-foundation-sys" 147 | version = "0.8.3" 148 | source = "registry+https://github.com/rust-lang/crates.io-index" 149 | checksum = "5827cebf4670468b8772dd191856768aedcb1b0278a04f989f7766351917b9dc" 150 | 151 | [[package]] 152 | name = "cxx" 153 | version = "1.0.83" 154 | source = "registry+https://github.com/rust-lang/crates.io-index" 155 | checksum = "bdf07d07d6531bfcdbe9b8b739b104610c6508dcc4d63b410585faf338241daf" 156 | dependencies = [ 157 | "cc", 158 | "cxxbridge-flags", 159 | "cxxbridge-macro", 160 | "link-cplusplus", 161 | ] 162 | 163 | [[package]] 164 | name = "cxx-build" 165 | version = "1.0.83" 166 | source = "registry+https://github.com/rust-lang/crates.io-index" 167 | checksum = "d2eb5b96ecdc99f72657332953d4d9c50135af1bac34277801cc3937906ebd39" 168 | dependencies = [ 169 | "cc", 170 | "codespan-reporting", 171 | "once_cell", 172 | "proc-macro2", 173 | "quote", 174 | "scratch", 175 | "syn", 176 | ] 177 | 178 | [[package]] 179 | name = "cxxbridge-flags" 180 | version = "1.0.83" 181 | source = "registry+https://github.com/rust-lang/crates.io-index" 182 | checksum = "ac040a39517fd1674e0f32177648334b0f4074625b5588a64519804ba0553b12" 183 | 184 | [[package]] 185 | name = "cxxbridge-macro" 186 | version = "1.0.83" 187 | source = "registry+https://github.com/rust-lang/crates.io-index" 188 | checksum = "1362b0ddcfc4eb0a1f57b68bd77dd99f0e826958a96abd0ae9bd092e114ffed6" 189 | dependencies = [ 190 | "proc-macro2", 191 | "quote", 192 | "syn", 193 | ] 194 | 195 | [[package]] 196 | name = "darling" 197 | version = "0.14.2" 198 | source = "registry+https://github.com/rust-lang/crates.io-index" 199 | checksum = "b0dd3cd20dc6b5a876612a6e5accfe7f3dd883db6d07acfbf14c128f61550dfa" 200 | dependencies = [ 201 | "darling_core", 202 | "darling_macro", 203 | ] 204 | 205 | [[package]] 206 | name = "darling_core" 207 | version = "0.14.2" 208 | source = "registry+https://github.com/rust-lang/crates.io-index" 209 | checksum = "a784d2ccaf7c98501746bf0be29b2022ba41fd62a2e622af997a03e9f972859f" 210 | dependencies = [ 211 | "fnv", 212 | "ident_case", 213 | "proc-macro2", 214 | "quote", 215 | "strsim", 216 | "syn", 217 | ] 218 | 219 | [[package]] 220 | name = "darling_macro" 221 | version = "0.14.2" 222 | source = "registry+https://github.com/rust-lang/crates.io-index" 223 | checksum = "7618812407e9402654622dd402b0a89dff9ba93badd6540781526117b92aab7e" 224 | dependencies = [ 225 | "darling_core", 226 | "quote", 227 | "syn", 228 | ] 229 | 230 | [[package]] 231 | name = "derivative" 232 | version = "2.2.0" 233 | source = "registry+https://github.com/rust-lang/crates.io-index" 234 | checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" 235 | dependencies = [ 236 | "proc-macro2", 237 | "quote", 238 | "syn", 239 | ] 240 | 241 | [[package]] 242 | name = "dirs-next" 243 | version = "2.0.0" 244 | source = "registry+https://github.com/rust-lang/crates.io-index" 245 | checksum = "b98cf8ebf19c3d1b223e151f99a4f9f0690dca41414773390fc824184ac833e1" 246 | dependencies = [ 247 | "cfg-if", 248 | "dirs-sys-next", 249 | ] 250 | 251 | [[package]] 252 | name = "dirs-sys-next" 253 | version = "0.1.2" 254 | source = "registry+https://github.com/rust-lang/crates.io-index" 255 | checksum = "4ebda144c4fe02d1f7ea1a7d9641b6fc6b580adcfa024ae48797ecdeb6825b4d" 256 | dependencies = [ 257 | "libc", 258 | "redox_users", 259 | "winapi", 260 | ] 261 | 262 | [[package]] 263 | name = "dyn-clone" 264 | version = "1.0.9" 265 | source = "registry+https://github.com/rust-lang/crates.io-index" 266 | checksum = "4f94fa09c2aeea5b8839e414b7b841bf429fd25b9c522116ac97ee87856d88b2" 267 | 268 | [[package]] 269 | name = "either" 270 | version = "1.8.0" 271 | source = "registry+https://github.com/rust-lang/crates.io-index" 272 | checksum = "90e5c1c8368803113bf0c9584fc495a58b86dc8a29edbf8fe877d21d9507e797" 273 | 274 | [[package]] 275 | name = "errno" 276 | version = "0.2.8" 277 | source = "registry+https://github.com/rust-lang/crates.io-index" 278 | checksum = "f639046355ee4f37944e44f60642c6f3a7efa3cf6b78c78a0d989a8ce6c396a1" 279 | dependencies = [ 280 | "errno-dragonfly", 281 | "libc", 282 | "winapi", 283 | ] 284 | 285 | [[package]] 286 | name = "errno-dragonfly" 287 | version = "0.1.2" 288 | source = "registry+https://github.com/rust-lang/crates.io-index" 289 | checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf" 290 | dependencies = [ 291 | "cc", 292 | "libc", 293 | ] 294 | 295 | [[package]] 296 | name = "fnv" 297 | version = "1.0.7" 298 | source = "registry+https://github.com/rust-lang/crates.io-index" 299 | checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" 300 | 301 | [[package]] 302 | name = "foreign-types" 303 | version = "0.3.2" 304 | source = "registry+https://github.com/rust-lang/crates.io-index" 305 | checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" 306 | dependencies = [ 307 | "foreign-types-shared", 308 | ] 309 | 310 | [[package]] 311 | name = "foreign-types-shared" 312 | version = "0.1.1" 313 | source = "registry+https://github.com/rust-lang/crates.io-index" 314 | checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" 315 | 316 | [[package]] 317 | name = "form_urlencoded" 318 | version = "1.1.0" 319 | source = "registry+https://github.com/rust-lang/crates.io-index" 320 | checksum = "a9c384f161156f5260c24a097c56119f9be8c798586aecc13afbcbe7b7e26bf8" 321 | dependencies = [ 322 | "percent-encoding", 323 | ] 324 | 325 | [[package]] 326 | name = "futures" 327 | version = "0.3.25" 328 | source = "registry+https://github.com/rust-lang/crates.io-index" 329 | checksum = "38390104763dc37a5145a53c29c63c1290b5d316d6086ec32c293f6736051bb0" 330 | dependencies = [ 331 | "futures-channel", 332 | "futures-core", 333 | "futures-executor", 334 | "futures-io", 335 | "futures-sink", 336 | "futures-task", 337 | "futures-util", 338 | ] 339 | 340 | [[package]] 341 | name = "futures-channel" 342 | version = "0.3.25" 343 | source = "registry+https://github.com/rust-lang/crates.io-index" 344 | checksum = "52ba265a92256105f45b719605a571ffe2d1f0fea3807304b522c1d778f79eed" 345 | dependencies = [ 346 | "futures-core", 347 | "futures-sink", 348 | ] 349 | 350 | [[package]] 351 | name = "futures-core" 352 | version = "0.3.25" 353 | source = "registry+https://github.com/rust-lang/crates.io-index" 354 | checksum = "04909a7a7e4633ae6c4a9ab280aeb86da1236243a77b694a49eacd659a4bd3ac" 355 | 356 | [[package]] 357 | name = "futures-executor" 358 | version = "0.3.25" 359 | source = "registry+https://github.com/rust-lang/crates.io-index" 360 | checksum = "7acc85df6714c176ab5edf386123fafe217be88c0840ec11f199441134a074e2" 361 | dependencies = [ 362 | "futures-core", 363 | "futures-task", 364 | "futures-util", 365 | ] 366 | 367 | [[package]] 368 | name = "futures-io" 369 | version = "0.3.25" 370 | source = "registry+https://github.com/rust-lang/crates.io-index" 371 | checksum = "00f5fb52a06bdcadeb54e8d3671f8888a39697dcb0b81b23b55174030427f4eb" 372 | 373 | [[package]] 374 | name = "futures-macro" 375 | version = "0.3.25" 376 | source = "registry+https://github.com/rust-lang/crates.io-index" 377 | checksum = "bdfb8ce053d86b91919aad980c220b1fb8401a9394410e1c289ed7e66b61835d" 378 | dependencies = [ 379 | "proc-macro2", 380 | "quote", 381 | "syn", 382 | ] 383 | 384 | [[package]] 385 | name = "futures-sink" 386 | version = "0.3.25" 387 | source = "registry+https://github.com/rust-lang/crates.io-index" 388 | checksum = "39c15cf1a4aa79df40f1bb462fb39676d0ad9e366c2a33b590d7c66f4f81fcf9" 389 | 390 | [[package]] 391 | name = "futures-task" 392 | version = "0.3.25" 393 | source = "registry+https://github.com/rust-lang/crates.io-index" 394 | checksum = "2ffb393ac5d9a6eaa9d3fdf37ae2776656b706e200c8e16b1bdb227f5198e6ea" 395 | 396 | [[package]] 397 | name = "futures-util" 398 | version = "0.3.25" 399 | source = "registry+https://github.com/rust-lang/crates.io-index" 400 | checksum = "197676987abd2f9cadff84926f410af1c183608d36641465df73ae8211dc65d6" 401 | dependencies = [ 402 | "futures-channel", 403 | "futures-core", 404 | "futures-io", 405 | "futures-macro", 406 | "futures-sink", 407 | "futures-task", 408 | "memchr", 409 | "pin-project-lite", 410 | "pin-utils", 411 | "slab", 412 | ] 413 | 414 | [[package]] 415 | name = "getrandom" 416 | version = "0.2.8" 417 | source = "registry+https://github.com/rust-lang/crates.io-index" 418 | checksum = "c05aeb6a22b8f62540c194aac980f2115af067bfe15a0734d7277a768d396b31" 419 | dependencies = [ 420 | "cfg-if", 421 | "libc", 422 | "wasi", 423 | ] 424 | 425 | [[package]] 426 | name = "hashbrown" 427 | version = "0.12.3" 428 | source = "registry+https://github.com/rust-lang/crates.io-index" 429 | checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" 430 | 431 | [[package]] 432 | name = "heck" 433 | version = "0.4.0" 434 | source = "registry+https://github.com/rust-lang/crates.io-index" 435 | checksum = "2540771e65fc8cb83cd6e8a237f70c319bd5c29f78ed1084ba5d50eeac86f7f9" 436 | 437 | [[package]] 438 | name = "hermit-abi" 439 | version = "0.1.19" 440 | source = "registry+https://github.com/rust-lang/crates.io-index" 441 | checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" 442 | dependencies = [ 443 | "libc", 444 | ] 445 | 446 | [[package]] 447 | name = "hermit-abi" 448 | version = "0.2.6" 449 | source = "registry+https://github.com/rust-lang/crates.io-index" 450 | checksum = "ee512640fe35acbfb4bb779db6f0d80704c2cacfa2e39b601ef3e3f47d1ae4c7" 451 | dependencies = [ 452 | "libc", 453 | ] 454 | 455 | [[package]] 456 | name = "http" 457 | version = "0.2.8" 458 | source = "registry+https://github.com/rust-lang/crates.io-index" 459 | checksum = "75f43d41e26995c17e71ee126451dd3941010b0514a81a9d11f3b341debc2399" 460 | dependencies = [ 461 | "bytes", 462 | "fnv", 463 | "itoa", 464 | ] 465 | 466 | [[package]] 467 | name = "http-body" 468 | version = "0.4.5" 469 | source = "registry+https://github.com/rust-lang/crates.io-index" 470 | checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" 471 | dependencies = [ 472 | "bytes", 473 | "http", 474 | "pin-project-lite", 475 | ] 476 | 477 | [[package]] 478 | name = "http-range-header" 479 | version = "0.3.0" 480 | source = "registry+https://github.com/rust-lang/crates.io-index" 481 | checksum = "0bfe8eed0a9285ef776bb792479ea3834e8b94e13d615c2f66d03dd50a435a29" 482 | 483 | [[package]] 484 | name = "httparse" 485 | version = "1.8.0" 486 | source = "registry+https://github.com/rust-lang/crates.io-index" 487 | checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" 488 | 489 | [[package]] 490 | name = "httpdate" 491 | version = "1.0.2" 492 | source = "registry+https://github.com/rust-lang/crates.io-index" 493 | checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421" 494 | 495 | [[package]] 496 | name = "hyper" 497 | version = "0.14.23" 498 | source = "registry+https://github.com/rust-lang/crates.io-index" 499 | checksum = "034711faac9d2166cb1baf1a2fb0b60b1f277f8492fd72176c17f3515e1abd3c" 500 | dependencies = [ 501 | "bytes", 502 | "futures-channel", 503 | "futures-core", 504 | "futures-util", 505 | "http", 506 | "http-body", 507 | "httparse", 508 | "httpdate", 509 | "itoa", 510 | "pin-project-lite", 511 | "socket2", 512 | "tokio", 513 | "tower-service", 514 | "tracing", 515 | "want", 516 | ] 517 | 518 | [[package]] 519 | name = "hyper-openssl" 520 | version = "0.9.2" 521 | source = "registry+https://github.com/rust-lang/crates.io-index" 522 | checksum = "d6ee5d7a8f718585d1c3c61dfde28ef5b0bb14734b4db13f5ada856cdc6c612b" 523 | dependencies = [ 524 | "http", 525 | "hyper", 526 | "linked_hash_set", 527 | "once_cell", 528 | "openssl", 529 | "openssl-sys", 530 | "parking_lot", 531 | "tokio", 532 | "tokio-openssl", 533 | "tower-layer", 534 | ] 535 | 536 | [[package]] 537 | name = "hyper-timeout" 538 | version = "0.4.1" 539 | source = "registry+https://github.com/rust-lang/crates.io-index" 540 | checksum = "bbb958482e8c7be4bc3cf272a766a2b0bf1a6755e7a6ae777f017a31d11b13b1" 541 | dependencies = [ 542 | "hyper", 543 | "pin-project-lite", 544 | "tokio", 545 | "tokio-io-timeout", 546 | ] 547 | 548 | [[package]] 549 | name = "iana-time-zone" 550 | version = "0.1.53" 551 | source = "registry+https://github.com/rust-lang/crates.io-index" 552 | checksum = "64c122667b287044802d6ce17ee2ddf13207ed924c712de9a66a5814d5b64765" 553 | dependencies = [ 554 | "android_system_properties", 555 | "core-foundation-sys", 556 | "iana-time-zone-haiku", 557 | "js-sys", 558 | "wasm-bindgen", 559 | "winapi", 560 | ] 561 | 562 | [[package]] 563 | name = "iana-time-zone-haiku" 564 | version = "0.1.1" 565 | source = "registry+https://github.com/rust-lang/crates.io-index" 566 | checksum = "0703ae284fc167426161c2e3f1da3ea71d94b21bedbcc9494e92b28e334e3dca" 567 | dependencies = [ 568 | "cxx", 569 | "cxx-build", 570 | ] 571 | 572 | [[package]] 573 | name = "ident_case" 574 | version = "1.0.1" 575 | source = "registry+https://github.com/rust-lang/crates.io-index" 576 | checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" 577 | 578 | [[package]] 579 | name = "idna" 580 | version = "0.3.0" 581 | source = "registry+https://github.com/rust-lang/crates.io-index" 582 | checksum = "e14ddfc70884202db2244c223200c204c2bda1bc6e0998d11b5e024d657209e6" 583 | dependencies = [ 584 | "unicode-bidi", 585 | "unicode-normalization", 586 | ] 587 | 588 | [[package]] 589 | name = "indexmap" 590 | version = "1.9.2" 591 | source = "registry+https://github.com/rust-lang/crates.io-index" 592 | checksum = "1885e79c1fc4b10f0e172c475f458b7f7b93061064d98c3293e98c5ba0c8b399" 593 | dependencies = [ 594 | "autocfg", 595 | "hashbrown", 596 | ] 597 | 598 | [[package]] 599 | name = "instant" 600 | version = "0.1.12" 601 | source = "registry+https://github.com/rust-lang/crates.io-index" 602 | checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" 603 | dependencies = [ 604 | "cfg-if", 605 | ] 606 | 607 | [[package]] 608 | name = "io-lifetimes" 609 | version = "1.0.3" 610 | source = "registry+https://github.com/rust-lang/crates.io-index" 611 | checksum = "46112a93252b123d31a119a8d1a1ac19deac4fac6e0e8b0df58f0d4e5870e63c" 612 | dependencies = [ 613 | "libc", 614 | "windows-sys", 615 | ] 616 | 617 | [[package]] 618 | name = "is-terminal" 619 | version = "0.4.1" 620 | source = "registry+https://github.com/rust-lang/crates.io-index" 621 | checksum = "927609f78c2913a6f6ac3c27a4fe87f43e2a35367c0c4b0f8265e8f49a104330" 622 | dependencies = [ 623 | "hermit-abi 0.2.6", 624 | "io-lifetimes", 625 | "rustix", 626 | "windows-sys", 627 | ] 628 | 629 | [[package]] 630 | name = "itoa" 631 | version = "1.0.4" 632 | source = "registry+https://github.com/rust-lang/crates.io-index" 633 | checksum = "4217ad341ebadf8d8e724e264f13e593e0648f5b3e94b3896a5df283be015ecc" 634 | 635 | [[package]] 636 | name = "js-sys" 637 | version = "0.3.60" 638 | source = "registry+https://github.com/rust-lang/crates.io-index" 639 | checksum = "49409df3e3bf0856b916e2ceaca09ee28e6871cf7d9ce97a692cacfdb2a25a47" 640 | dependencies = [ 641 | "wasm-bindgen", 642 | ] 643 | 644 | [[package]] 645 | name = "json-patch" 646 | version = "0.3.0" 647 | source = "registry+https://github.com/rust-lang/crates.io-index" 648 | checksum = "e712e62827c382a77b87f590532febb1f8b2fdbc3eefa1ee37fe7281687075ef" 649 | dependencies = [ 650 | "serde", 651 | "serde_json", 652 | "thiserror", 653 | "treediff", 654 | ] 655 | 656 | [[package]] 657 | name = "jsonpath_lib" 658 | version = "0.3.0" 659 | source = "registry+https://github.com/rust-lang/crates.io-index" 660 | checksum = "eaa63191d68230cccb81c5aa23abd53ed64d83337cacbb25a7b8c7979523774f" 661 | dependencies = [ 662 | "log", 663 | "serde", 664 | "serde_json", 665 | ] 666 | 667 | [[package]] 668 | name = "k8s-openapi" 669 | version = "0.16.0" 670 | source = "registry+https://github.com/rust-lang/crates.io-index" 671 | checksum = "6d9455388f4977de4d0934efa9f7d36296295537d774574113a20f6082de03da" 672 | dependencies = [ 673 | "base64", 674 | "bytes", 675 | "chrono", 676 | "http", 677 | "percent-encoding", 678 | "serde", 679 | "serde-value", 680 | "serde_json", 681 | "url", 682 | ] 683 | 684 | [[package]] 685 | name = "kube" 686 | version = "0.77.0" 687 | source = "registry+https://github.com/rust-lang/crates.io-index" 688 | checksum = "9ba77b857a9581e3d1cb1165f9cb1d1732d65ce52642498addae8fa2c6d5e037" 689 | dependencies = [ 690 | "k8s-openapi", 691 | "kube-client", 692 | "kube-core", 693 | "kube-derive", 694 | "kube-runtime", 695 | ] 696 | 697 | [[package]] 698 | name = "kube-client" 699 | version = "0.77.0" 700 | source = "registry+https://github.com/rust-lang/crates.io-index" 701 | checksum = "e80db3ca107e89da5f7eae37ea5274e06cefdcf9689d0ebd5ec3575a6f983e4e" 702 | dependencies = [ 703 | "base64", 704 | "bytes", 705 | "chrono", 706 | "dirs-next", 707 | "either", 708 | "futures", 709 | "http", 710 | "http-body", 711 | "hyper", 712 | "hyper-openssl", 713 | "hyper-timeout", 714 | "jsonpath_lib", 715 | "k8s-openapi", 716 | "kube-core", 717 | "openssl", 718 | "pem", 719 | "pin-project", 720 | "secrecy", 721 | "serde", 722 | "serde_json", 723 | "serde_yaml", 724 | "thiserror", 725 | "tokio", 726 | "tokio-util", 727 | "tower", 728 | "tower-http", 729 | "tracing", 730 | ] 731 | 732 | [[package]] 733 | name = "kube-core" 734 | version = "0.77.0" 735 | source = "registry+https://github.com/rust-lang/crates.io-index" 736 | checksum = "fce686d2fbdaf6cb18d19cdb0692e9485dd9945f79f944b8772bdb2a07e8d39d" 737 | dependencies = [ 738 | "chrono", 739 | "form_urlencoded", 740 | "http", 741 | "json-patch", 742 | "k8s-openapi", 743 | "once_cell", 744 | "schemars", 745 | "serde", 746 | "serde_json", 747 | "thiserror", 748 | ] 749 | 750 | [[package]] 751 | name = "kube-derive" 752 | version = "0.77.0" 753 | source = "registry+https://github.com/rust-lang/crates.io-index" 754 | checksum = "93ef49d30d03c5de8041e2ab5dc421d671d6225ffd53975571d4a5b18d5e50fb" 755 | dependencies = [ 756 | "darling", 757 | "proc-macro2", 758 | "quote", 759 | "serde_json", 760 | "syn", 761 | ] 762 | 763 | [[package]] 764 | name = "kube-runtime" 765 | version = "0.77.0" 766 | source = "registry+https://github.com/rust-lang/crates.io-index" 767 | checksum = "acc59ede459fd8e944ab1e6ff798aca83188b08aeb44e8c3d6f028db2d74233c" 768 | dependencies = [ 769 | "ahash", 770 | "backoff", 771 | "derivative", 772 | "futures", 773 | "json-patch", 774 | "k8s-openapi", 775 | "kube-client", 776 | "parking_lot", 777 | "pin-project", 778 | "serde", 779 | "serde_json", 780 | "smallvec", 781 | "thiserror", 782 | "tokio", 783 | "tokio-util", 784 | "tracing", 785 | ] 786 | 787 | [[package]] 788 | name = "lazy_static" 789 | version = "1.4.0" 790 | source = "registry+https://github.com/rust-lang/crates.io-index" 791 | checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" 792 | 793 | [[package]] 794 | name = "libc" 795 | version = "0.2.138" 796 | source = "registry+https://github.com/rust-lang/crates.io-index" 797 | checksum = "db6d7e329c562c5dfab7a46a2afabc8b987ab9a4834c9d1ca04dc54c1546cef8" 798 | 799 | [[package]] 800 | name = "link-cplusplus" 801 | version = "1.0.7" 802 | source = "registry+https://github.com/rust-lang/crates.io-index" 803 | checksum = "9272ab7b96c9046fbc5bc56c06c117cb639fe2d509df0c421cad82d2915cf369" 804 | dependencies = [ 805 | "cc", 806 | ] 807 | 808 | [[package]] 809 | name = "linked-hash-map" 810 | version = "0.5.6" 811 | source = "registry+https://github.com/rust-lang/crates.io-index" 812 | checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" 813 | 814 | [[package]] 815 | name = "linked_hash_set" 816 | version = "0.1.4" 817 | source = "registry+https://github.com/rust-lang/crates.io-index" 818 | checksum = "47186c6da4d81ca383c7c47c1bfc80f4b95f4720514d860a5407aaf4233f9588" 819 | dependencies = [ 820 | "linked-hash-map", 821 | ] 822 | 823 | [[package]] 824 | name = "linux-raw-sys" 825 | version = "0.1.4" 826 | source = "registry+https://github.com/rust-lang/crates.io-index" 827 | checksum = "f051f77a7c8e6957c0696eac88f26b0117e54f52d3fc682ab19397a8812846a4" 828 | 829 | [[package]] 830 | name = "lock_api" 831 | version = "0.4.9" 832 | source = "registry+https://github.com/rust-lang/crates.io-index" 833 | checksum = "435011366fe56583b16cf956f9df0095b405b82d76425bc8981c0e22e60ec4df" 834 | dependencies = [ 835 | "autocfg", 836 | "scopeguard", 837 | ] 838 | 839 | [[package]] 840 | name = "log" 841 | version = "0.4.17" 842 | source = "registry+https://github.com/rust-lang/crates.io-index" 843 | checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" 844 | dependencies = [ 845 | "cfg-if", 846 | ] 847 | 848 | [[package]] 849 | name = "memchr" 850 | version = "2.5.0" 851 | source = "registry+https://github.com/rust-lang/crates.io-index" 852 | checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" 853 | 854 | [[package]] 855 | name = "mio" 856 | version = "0.8.5" 857 | source = "registry+https://github.com/rust-lang/crates.io-index" 858 | checksum = "e5d732bc30207a6423068df043e3d02e0735b155ad7ce1a6f76fe2baa5b158de" 859 | dependencies = [ 860 | "libc", 861 | "log", 862 | "wasi", 863 | "windows-sys", 864 | ] 865 | 866 | [[package]] 867 | name = "nu-ansi-term" 868 | version = "0.46.0" 869 | source = "registry+https://github.com/rust-lang/crates.io-index" 870 | checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84" 871 | dependencies = [ 872 | "overload", 873 | "winapi", 874 | ] 875 | 876 | [[package]] 877 | name = "num-integer" 878 | version = "0.1.45" 879 | source = "registry+https://github.com/rust-lang/crates.io-index" 880 | checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" 881 | dependencies = [ 882 | "autocfg", 883 | "num-traits", 884 | ] 885 | 886 | [[package]] 887 | name = "num-traits" 888 | version = "0.2.15" 889 | source = "registry+https://github.com/rust-lang/crates.io-index" 890 | checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" 891 | dependencies = [ 892 | "autocfg", 893 | ] 894 | 895 | [[package]] 896 | name = "num_cpus" 897 | version = "1.14.0" 898 | source = "registry+https://github.com/rust-lang/crates.io-index" 899 | checksum = "f6058e64324c71e02bc2b150e4f3bc8286db6c83092132ffa3f6b1eab0f9def5" 900 | dependencies = [ 901 | "hermit-abi 0.1.19", 902 | "libc", 903 | ] 904 | 905 | [[package]] 906 | name = "once_cell" 907 | version = "1.16.0" 908 | source = "registry+https://github.com/rust-lang/crates.io-index" 909 | checksum = "86f0b0d4bf799edbc74508c1e8bf170ff5f41238e5f8225603ca7caaae2b7860" 910 | 911 | [[package]] 912 | name = "openssl" 913 | version = "0.10.44" 914 | source = "registry+https://github.com/rust-lang/crates.io-index" 915 | checksum = "29d971fd5722fec23977260f6e81aa67d2f22cadbdc2aa049f1022d9a3be1566" 916 | dependencies = [ 917 | "bitflags", 918 | "cfg-if", 919 | "foreign-types", 920 | "libc", 921 | "once_cell", 922 | "openssl-macros", 923 | "openssl-sys", 924 | ] 925 | 926 | [[package]] 927 | name = "openssl-macros" 928 | version = "0.1.0" 929 | source = "registry+https://github.com/rust-lang/crates.io-index" 930 | checksum = "b501e44f11665960c7e7fcf062c7d96a14ade4aa98116c004b2e37b5be7d736c" 931 | dependencies = [ 932 | "proc-macro2", 933 | "quote", 934 | "syn", 935 | ] 936 | 937 | [[package]] 938 | name = "openssl-sys" 939 | version = "0.9.79" 940 | source = "registry+https://github.com/rust-lang/crates.io-index" 941 | checksum = "5454462c0eced1e97f2ec09036abc8da362e66802f66fd20f86854d9d8cbcbc4" 942 | dependencies = [ 943 | "autocfg", 944 | "cc", 945 | "libc", 946 | "pkg-config", 947 | "vcpkg", 948 | ] 949 | 950 | [[package]] 951 | name = "ordered-float" 952 | version = "2.10.0" 953 | source = "registry+https://github.com/rust-lang/crates.io-index" 954 | checksum = "7940cf2ca942593318d07fcf2596cdca60a85c9e7fab408a5e21a4f9dcd40d87" 955 | dependencies = [ 956 | "num-traits", 957 | ] 958 | 959 | [[package]] 960 | name = "os_str_bytes" 961 | version = "6.4.1" 962 | source = "registry+https://github.com/rust-lang/crates.io-index" 963 | checksum = "9b7820b9daea5457c9f21c69448905d723fbd21136ccf521748f23fd49e723ee" 964 | 965 | [[package]] 966 | name = "overload" 967 | version = "0.1.1" 968 | source = "registry+https://github.com/rust-lang/crates.io-index" 969 | checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" 970 | 971 | [[package]] 972 | name = "parking_lot" 973 | version = "0.12.1" 974 | source = "registry+https://github.com/rust-lang/crates.io-index" 975 | checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" 976 | dependencies = [ 977 | "lock_api", 978 | "parking_lot_core", 979 | ] 980 | 981 | [[package]] 982 | name = "parking_lot_core" 983 | version = "0.9.5" 984 | source = "registry+https://github.com/rust-lang/crates.io-index" 985 | checksum = "7ff9f3fef3968a3ec5945535ed654cb38ff72d7495a25619e2247fb15a2ed9ba" 986 | dependencies = [ 987 | "cfg-if", 988 | "libc", 989 | "redox_syscall", 990 | "smallvec", 991 | "windows-sys", 992 | ] 993 | 994 | [[package]] 995 | name = "pem" 996 | version = "1.1.0" 997 | source = "registry+https://github.com/rust-lang/crates.io-index" 998 | checksum = "03c64931a1a212348ec4f3b4362585eca7159d0d09cbdf4a7f74f02173596fd4" 999 | dependencies = [ 1000 | "base64", 1001 | ] 1002 | 1003 | [[package]] 1004 | name = "percent-encoding" 1005 | version = "2.2.0" 1006 | source = "registry+https://github.com/rust-lang/crates.io-index" 1007 | checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e" 1008 | 1009 | [[package]] 1010 | name = "pin-project" 1011 | version = "1.0.12" 1012 | source = "registry+https://github.com/rust-lang/crates.io-index" 1013 | checksum = "ad29a609b6bcd67fee905812e544992d216af9d755757c05ed2d0e15a74c6ecc" 1014 | dependencies = [ 1015 | "pin-project-internal", 1016 | ] 1017 | 1018 | [[package]] 1019 | name = "pin-project-internal" 1020 | version = "1.0.12" 1021 | source = "registry+https://github.com/rust-lang/crates.io-index" 1022 | checksum = "069bdb1e05adc7a8990dce9cc75370895fbe4e3d58b9b73bf1aee56359344a55" 1023 | dependencies = [ 1024 | "proc-macro2", 1025 | "quote", 1026 | "syn", 1027 | ] 1028 | 1029 | [[package]] 1030 | name = "pin-project-lite" 1031 | version = "0.2.9" 1032 | source = "registry+https://github.com/rust-lang/crates.io-index" 1033 | checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" 1034 | 1035 | [[package]] 1036 | name = "pin-utils" 1037 | version = "0.1.0" 1038 | source = "registry+https://github.com/rust-lang/crates.io-index" 1039 | checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" 1040 | 1041 | [[package]] 1042 | name = "pkg-config" 1043 | version = "0.3.26" 1044 | source = "registry+https://github.com/rust-lang/crates.io-index" 1045 | checksum = "6ac9a59f73473f1b8d852421e59e64809f025994837ef743615c6d0c5b305160" 1046 | 1047 | [[package]] 1048 | name = "ppv-lite86" 1049 | version = "0.2.17" 1050 | source = "registry+https://github.com/rust-lang/crates.io-index" 1051 | checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" 1052 | 1053 | [[package]] 1054 | name = "proc-macro-error" 1055 | version = "1.0.4" 1056 | source = "registry+https://github.com/rust-lang/crates.io-index" 1057 | checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" 1058 | dependencies = [ 1059 | "proc-macro-error-attr", 1060 | "proc-macro2", 1061 | "quote", 1062 | "syn", 1063 | "version_check", 1064 | ] 1065 | 1066 | [[package]] 1067 | name = "proc-macro-error-attr" 1068 | version = "1.0.4" 1069 | source = "registry+https://github.com/rust-lang/crates.io-index" 1070 | checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" 1071 | dependencies = [ 1072 | "proc-macro2", 1073 | "quote", 1074 | "version_check", 1075 | ] 1076 | 1077 | [[package]] 1078 | name = "proc-macro2" 1079 | version = "1.0.47" 1080 | source = "registry+https://github.com/rust-lang/crates.io-index" 1081 | checksum = "5ea3d908b0e36316caf9e9e2c4625cdde190a7e6f440d794667ed17a1855e725" 1082 | dependencies = [ 1083 | "unicode-ident", 1084 | ] 1085 | 1086 | [[package]] 1087 | name = "quote" 1088 | version = "1.0.21" 1089 | source = "registry+https://github.com/rust-lang/crates.io-index" 1090 | checksum = "bbe448f377a7d6961e30f5955f9b8d106c3f5e449d493ee1b125c1d43c2b5179" 1091 | dependencies = [ 1092 | "proc-macro2", 1093 | ] 1094 | 1095 | [[package]] 1096 | name = "rand" 1097 | version = "0.8.5" 1098 | source = "registry+https://github.com/rust-lang/crates.io-index" 1099 | checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" 1100 | dependencies = [ 1101 | "libc", 1102 | "rand_chacha", 1103 | "rand_core", 1104 | ] 1105 | 1106 | [[package]] 1107 | name = "rand_chacha" 1108 | version = "0.3.1" 1109 | source = "registry+https://github.com/rust-lang/crates.io-index" 1110 | checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" 1111 | dependencies = [ 1112 | "ppv-lite86", 1113 | "rand_core", 1114 | ] 1115 | 1116 | [[package]] 1117 | name = "rand_core" 1118 | version = "0.6.4" 1119 | source = "registry+https://github.com/rust-lang/crates.io-index" 1120 | checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" 1121 | dependencies = [ 1122 | "getrandom", 1123 | ] 1124 | 1125 | [[package]] 1126 | name = "redox_syscall" 1127 | version = "0.2.16" 1128 | source = "registry+https://github.com/rust-lang/crates.io-index" 1129 | checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" 1130 | dependencies = [ 1131 | "bitflags", 1132 | ] 1133 | 1134 | [[package]] 1135 | name = "redox_users" 1136 | version = "0.4.3" 1137 | source = "registry+https://github.com/rust-lang/crates.io-index" 1138 | checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b" 1139 | dependencies = [ 1140 | "getrandom", 1141 | "redox_syscall", 1142 | "thiserror", 1143 | ] 1144 | 1145 | [[package]] 1146 | name = "rust-operator" 1147 | version = "0.1.0" 1148 | dependencies = [ 1149 | "anyhow", 1150 | "backoff", 1151 | "clap", 1152 | "futures", 1153 | "k8s-openapi", 1154 | "kube", 1155 | "log", 1156 | "schemars", 1157 | "serde", 1158 | "serde_json", 1159 | "serde_yaml", 1160 | "thiserror", 1161 | "tokio", 1162 | "tracing", 1163 | "tracing-subscriber", 1164 | ] 1165 | 1166 | [[package]] 1167 | name = "rustix" 1168 | version = "0.36.5" 1169 | source = "registry+https://github.com/rust-lang/crates.io-index" 1170 | checksum = "a3807b5d10909833d3e9acd1eb5fb988f79376ff10fce42937de71a449c4c588" 1171 | dependencies = [ 1172 | "bitflags", 1173 | "errno", 1174 | "io-lifetimes", 1175 | "libc", 1176 | "linux-raw-sys", 1177 | "windows-sys", 1178 | ] 1179 | 1180 | [[package]] 1181 | name = "ryu" 1182 | version = "1.0.11" 1183 | source = "registry+https://github.com/rust-lang/crates.io-index" 1184 | checksum = "4501abdff3ae82a1c1b477a17252eb69cee9e66eb915c1abaa4f44d873df9f09" 1185 | 1186 | [[package]] 1187 | name = "schemars" 1188 | version = "0.8.11" 1189 | source = "registry+https://github.com/rust-lang/crates.io-index" 1190 | checksum = "2a5fb6c61f29e723026dc8e923d94c694313212abbecbbe5f55a7748eec5b307" 1191 | dependencies = [ 1192 | "dyn-clone", 1193 | "schemars_derive", 1194 | "serde", 1195 | "serde_json", 1196 | ] 1197 | 1198 | [[package]] 1199 | name = "schemars_derive" 1200 | version = "0.8.11" 1201 | source = "registry+https://github.com/rust-lang/crates.io-index" 1202 | checksum = "f188d036977451159430f3b8dc82ec76364a42b7e289c2b18a9a18f4470058e9" 1203 | dependencies = [ 1204 | "proc-macro2", 1205 | "quote", 1206 | "serde_derive_internals", 1207 | "syn", 1208 | ] 1209 | 1210 | [[package]] 1211 | name = "scopeguard" 1212 | version = "1.1.0" 1213 | source = "registry+https://github.com/rust-lang/crates.io-index" 1214 | checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" 1215 | 1216 | [[package]] 1217 | name = "scratch" 1218 | version = "1.0.2" 1219 | source = "registry+https://github.com/rust-lang/crates.io-index" 1220 | checksum = "9c8132065adcfd6e02db789d9285a0deb2f3fcb04002865ab67d5fb103533898" 1221 | 1222 | [[package]] 1223 | name = "secrecy" 1224 | version = "0.8.0" 1225 | source = "registry+https://github.com/rust-lang/crates.io-index" 1226 | checksum = "9bd1c54ea06cfd2f6b63219704de0b9b4f72dcc2b8fdef820be6cd799780e91e" 1227 | dependencies = [ 1228 | "serde", 1229 | "zeroize", 1230 | ] 1231 | 1232 | [[package]] 1233 | name = "serde" 1234 | version = "1.0.150" 1235 | source = "registry+https://github.com/rust-lang/crates.io-index" 1236 | checksum = "e326c9ec8042f1b5da33252c8a37e9ffbd2c9bef0155215b6e6c80c790e05f91" 1237 | dependencies = [ 1238 | "serde_derive", 1239 | ] 1240 | 1241 | [[package]] 1242 | name = "serde-value" 1243 | version = "0.7.0" 1244 | source = "registry+https://github.com/rust-lang/crates.io-index" 1245 | checksum = "f3a1a3341211875ef120e117ea7fd5228530ae7e7036a779fdc9117be6b3282c" 1246 | dependencies = [ 1247 | "ordered-float", 1248 | "serde", 1249 | ] 1250 | 1251 | [[package]] 1252 | name = "serde_derive" 1253 | version = "1.0.150" 1254 | source = "registry+https://github.com/rust-lang/crates.io-index" 1255 | checksum = "42a3df25b0713732468deadad63ab9da1f1fd75a48a15024b50363f128db627e" 1256 | dependencies = [ 1257 | "proc-macro2", 1258 | "quote", 1259 | "syn", 1260 | ] 1261 | 1262 | [[package]] 1263 | name = "serde_derive_internals" 1264 | version = "0.26.0" 1265 | source = "registry+https://github.com/rust-lang/crates.io-index" 1266 | checksum = "85bf8229e7920a9f636479437026331ce11aa132b4dde37d121944a44d6e5f3c" 1267 | dependencies = [ 1268 | "proc-macro2", 1269 | "quote", 1270 | "syn", 1271 | ] 1272 | 1273 | [[package]] 1274 | name = "serde_json" 1275 | version = "1.0.89" 1276 | source = "registry+https://github.com/rust-lang/crates.io-index" 1277 | checksum = "020ff22c755c2ed3f8cf162dbb41a7268d934702f3ed3631656ea597e08fc3db" 1278 | dependencies = [ 1279 | "indexmap", 1280 | "itoa", 1281 | "ryu", 1282 | "serde", 1283 | ] 1284 | 1285 | [[package]] 1286 | name = "serde_yaml" 1287 | version = "0.8.26" 1288 | source = "registry+https://github.com/rust-lang/crates.io-index" 1289 | checksum = "578a7433b776b56a35785ed5ce9a7e777ac0598aac5a6dd1b4b18a307c7fc71b" 1290 | dependencies = [ 1291 | "indexmap", 1292 | "ryu", 1293 | "serde", 1294 | "yaml-rust", 1295 | ] 1296 | 1297 | [[package]] 1298 | name = "sharded-slab" 1299 | version = "0.1.4" 1300 | source = "registry+https://github.com/rust-lang/crates.io-index" 1301 | checksum = "900fba806f70c630b0a382d0d825e17a0f19fcd059a2ade1ff237bcddf446b31" 1302 | dependencies = [ 1303 | "lazy_static", 1304 | ] 1305 | 1306 | [[package]] 1307 | name = "signal-hook-registry" 1308 | version = "1.4.0" 1309 | source = "registry+https://github.com/rust-lang/crates.io-index" 1310 | checksum = "e51e73328dc4ac0c7ccbda3a494dfa03df1de2f46018127f60c693f2648455b0" 1311 | dependencies = [ 1312 | "libc", 1313 | ] 1314 | 1315 | [[package]] 1316 | name = "slab" 1317 | version = "0.4.7" 1318 | source = "registry+https://github.com/rust-lang/crates.io-index" 1319 | checksum = "4614a76b2a8be0058caa9dbbaf66d988527d86d003c11a94fbd335d7661edcef" 1320 | dependencies = [ 1321 | "autocfg", 1322 | ] 1323 | 1324 | [[package]] 1325 | name = "smallvec" 1326 | version = "1.10.0" 1327 | source = "registry+https://github.com/rust-lang/crates.io-index" 1328 | checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" 1329 | 1330 | [[package]] 1331 | name = "socket2" 1332 | version = "0.4.7" 1333 | source = "registry+https://github.com/rust-lang/crates.io-index" 1334 | checksum = "02e2d2db9033d13a1567121ddd7a095ee144db4e1ca1b1bda3419bc0da294ebd" 1335 | dependencies = [ 1336 | "libc", 1337 | "winapi", 1338 | ] 1339 | 1340 | [[package]] 1341 | name = "strsim" 1342 | version = "0.10.0" 1343 | source = "registry+https://github.com/rust-lang/crates.io-index" 1344 | checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" 1345 | 1346 | [[package]] 1347 | name = "syn" 1348 | version = "1.0.105" 1349 | source = "registry+https://github.com/rust-lang/crates.io-index" 1350 | checksum = "60b9b43d45702de4c839cb9b51d9f529c5dd26a4aff255b42b1ebc03e88ee908" 1351 | dependencies = [ 1352 | "proc-macro2", 1353 | "quote", 1354 | "unicode-ident", 1355 | ] 1356 | 1357 | [[package]] 1358 | name = "termcolor" 1359 | version = "1.1.3" 1360 | source = "registry+https://github.com/rust-lang/crates.io-index" 1361 | checksum = "bab24d30b911b2376f3a13cc2cd443142f0c81dda04c118693e35b3835757755" 1362 | dependencies = [ 1363 | "winapi-util", 1364 | ] 1365 | 1366 | [[package]] 1367 | name = "thiserror" 1368 | version = "1.0.37" 1369 | source = "registry+https://github.com/rust-lang/crates.io-index" 1370 | checksum = "10deb33631e3c9018b9baf9dcbbc4f737320d2b576bac10f6aefa048fa407e3e" 1371 | dependencies = [ 1372 | "thiserror-impl", 1373 | ] 1374 | 1375 | [[package]] 1376 | name = "thiserror-impl" 1377 | version = "1.0.37" 1378 | source = "registry+https://github.com/rust-lang/crates.io-index" 1379 | checksum = "982d17546b47146b28f7c22e3d08465f6b8903d0ea13c1660d9d84a6e7adcdbb" 1380 | dependencies = [ 1381 | "proc-macro2", 1382 | "quote", 1383 | "syn", 1384 | ] 1385 | 1386 | [[package]] 1387 | name = "thread_local" 1388 | version = "1.1.4" 1389 | source = "registry+https://github.com/rust-lang/crates.io-index" 1390 | checksum = "5516c27b78311c50bf42c071425c560ac799b11c30b31f87e3081965fe5e0180" 1391 | dependencies = [ 1392 | "once_cell", 1393 | ] 1394 | 1395 | [[package]] 1396 | name = "tinyvec" 1397 | version = "1.6.0" 1398 | source = "registry+https://github.com/rust-lang/crates.io-index" 1399 | checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" 1400 | dependencies = [ 1401 | "tinyvec_macros", 1402 | ] 1403 | 1404 | [[package]] 1405 | name = "tinyvec_macros" 1406 | version = "0.1.0" 1407 | source = "registry+https://github.com/rust-lang/crates.io-index" 1408 | checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" 1409 | 1410 | [[package]] 1411 | name = "tokio" 1412 | version = "1.23.0" 1413 | source = "registry+https://github.com/rust-lang/crates.io-index" 1414 | checksum = "eab6d665857cc6ca78d6e80303a02cea7a7851e85dfbd77cbdc09bd129f1ef46" 1415 | dependencies = [ 1416 | "autocfg", 1417 | "libc", 1418 | "mio", 1419 | "num_cpus", 1420 | "pin-project-lite", 1421 | "signal-hook-registry", 1422 | "socket2", 1423 | "tokio-macros", 1424 | "windows-sys", 1425 | ] 1426 | 1427 | [[package]] 1428 | name = "tokio-io-timeout" 1429 | version = "1.2.0" 1430 | source = "registry+https://github.com/rust-lang/crates.io-index" 1431 | checksum = "30b74022ada614a1b4834de765f9bb43877f910cc8ce4be40e89042c9223a8bf" 1432 | dependencies = [ 1433 | "pin-project-lite", 1434 | "tokio", 1435 | ] 1436 | 1437 | [[package]] 1438 | name = "tokio-macros" 1439 | version = "1.8.2" 1440 | source = "registry+https://github.com/rust-lang/crates.io-index" 1441 | checksum = "d266c00fde287f55d3f1c3e96c500c362a2b8c695076ec180f27918820bc6df8" 1442 | dependencies = [ 1443 | "proc-macro2", 1444 | "quote", 1445 | "syn", 1446 | ] 1447 | 1448 | [[package]] 1449 | name = "tokio-openssl" 1450 | version = "0.6.3" 1451 | source = "registry+https://github.com/rust-lang/crates.io-index" 1452 | checksum = "c08f9ffb7809f1b20c1b398d92acf4cc719874b3b2b2d9ea2f09b4a80350878a" 1453 | dependencies = [ 1454 | "futures-util", 1455 | "openssl", 1456 | "openssl-sys", 1457 | "tokio", 1458 | ] 1459 | 1460 | [[package]] 1461 | name = "tokio-util" 1462 | version = "0.7.4" 1463 | source = "registry+https://github.com/rust-lang/crates.io-index" 1464 | checksum = "0bb2e075f03b3d66d8d8785356224ba688d2906a371015e225beeb65ca92c740" 1465 | dependencies = [ 1466 | "bytes", 1467 | "futures-core", 1468 | "futures-sink", 1469 | "pin-project-lite", 1470 | "slab", 1471 | "tokio", 1472 | "tracing", 1473 | ] 1474 | 1475 | [[package]] 1476 | name = "tower" 1477 | version = "0.4.13" 1478 | source = "registry+https://github.com/rust-lang/crates.io-index" 1479 | checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" 1480 | dependencies = [ 1481 | "futures-core", 1482 | "futures-util", 1483 | "pin-project", 1484 | "pin-project-lite", 1485 | "tokio", 1486 | "tokio-util", 1487 | "tower-layer", 1488 | "tower-service", 1489 | "tracing", 1490 | ] 1491 | 1492 | [[package]] 1493 | name = "tower-http" 1494 | version = "0.3.5" 1495 | source = "registry+https://github.com/rust-lang/crates.io-index" 1496 | checksum = "f873044bf02dd1e8239e9c1293ea39dad76dc594ec16185d0a1bf31d8dc8d858" 1497 | dependencies = [ 1498 | "base64", 1499 | "bitflags", 1500 | "bytes", 1501 | "futures-core", 1502 | "futures-util", 1503 | "http", 1504 | "http-body", 1505 | "http-range-header", 1506 | "pin-project-lite", 1507 | "tower-layer", 1508 | "tower-service", 1509 | "tracing", 1510 | ] 1511 | 1512 | [[package]] 1513 | name = "tower-layer" 1514 | version = "0.3.2" 1515 | source = "registry+https://github.com/rust-lang/crates.io-index" 1516 | checksum = "c20c8dbed6283a09604c3e69b4b7eeb54e298b8a600d4d5ecb5ad39de609f1d0" 1517 | 1518 | [[package]] 1519 | name = "tower-service" 1520 | version = "0.3.2" 1521 | source = "registry+https://github.com/rust-lang/crates.io-index" 1522 | checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" 1523 | 1524 | [[package]] 1525 | name = "tracing" 1526 | version = "0.1.37" 1527 | source = "registry+https://github.com/rust-lang/crates.io-index" 1528 | checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" 1529 | dependencies = [ 1530 | "cfg-if", 1531 | "log", 1532 | "pin-project-lite", 1533 | "tracing-attributes", 1534 | "tracing-core", 1535 | ] 1536 | 1537 | [[package]] 1538 | name = "tracing-attributes" 1539 | version = "0.1.23" 1540 | source = "registry+https://github.com/rust-lang/crates.io-index" 1541 | checksum = "4017f8f45139870ca7e672686113917c71c7a6e02d4924eda67186083c03081a" 1542 | dependencies = [ 1543 | "proc-macro2", 1544 | "quote", 1545 | "syn", 1546 | ] 1547 | 1548 | [[package]] 1549 | name = "tracing-core" 1550 | version = "0.1.30" 1551 | source = "registry+https://github.com/rust-lang/crates.io-index" 1552 | checksum = "24eb03ba0eab1fd845050058ce5e616558e8f8d8fca633e6b163fe25c797213a" 1553 | dependencies = [ 1554 | "once_cell", 1555 | "valuable", 1556 | ] 1557 | 1558 | [[package]] 1559 | name = "tracing-log" 1560 | version = "0.1.3" 1561 | source = "registry+https://github.com/rust-lang/crates.io-index" 1562 | checksum = "78ddad33d2d10b1ed7eb9d1f518a5674713876e97e5bb9b7345a7984fbb4f922" 1563 | dependencies = [ 1564 | "lazy_static", 1565 | "log", 1566 | "tracing-core", 1567 | ] 1568 | 1569 | [[package]] 1570 | name = "tracing-subscriber" 1571 | version = "0.3.16" 1572 | source = "registry+https://github.com/rust-lang/crates.io-index" 1573 | checksum = "a6176eae26dd70d0c919749377897b54a9276bd7061339665dd68777926b5a70" 1574 | dependencies = [ 1575 | "nu-ansi-term", 1576 | "sharded-slab", 1577 | "smallvec", 1578 | "thread_local", 1579 | "tracing-core", 1580 | "tracing-log", 1581 | ] 1582 | 1583 | [[package]] 1584 | name = "treediff" 1585 | version = "4.0.2" 1586 | source = "registry+https://github.com/rust-lang/crates.io-index" 1587 | checksum = "52984d277bdf2a751072b5df30ec0377febdb02f7696d64c2d7d54630bac4303" 1588 | dependencies = [ 1589 | "serde_json", 1590 | ] 1591 | 1592 | [[package]] 1593 | name = "try-lock" 1594 | version = "0.2.3" 1595 | source = "registry+https://github.com/rust-lang/crates.io-index" 1596 | checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642" 1597 | 1598 | [[package]] 1599 | name = "unicode-bidi" 1600 | version = "0.3.8" 1601 | source = "registry+https://github.com/rust-lang/crates.io-index" 1602 | checksum = "099b7128301d285f79ddd55b9a83d5e6b9e97c92e0ea0daebee7263e932de992" 1603 | 1604 | [[package]] 1605 | name = "unicode-ident" 1606 | version = "1.0.5" 1607 | source = "registry+https://github.com/rust-lang/crates.io-index" 1608 | checksum = "6ceab39d59e4c9499d4e5a8ee0e2735b891bb7308ac83dfb4e80cad195c9f6f3" 1609 | 1610 | [[package]] 1611 | name = "unicode-normalization" 1612 | version = "0.1.22" 1613 | source = "registry+https://github.com/rust-lang/crates.io-index" 1614 | checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" 1615 | dependencies = [ 1616 | "tinyvec", 1617 | ] 1618 | 1619 | [[package]] 1620 | name = "unicode-width" 1621 | version = "0.1.10" 1622 | source = "registry+https://github.com/rust-lang/crates.io-index" 1623 | checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" 1624 | 1625 | [[package]] 1626 | name = "url" 1627 | version = "2.3.1" 1628 | source = "registry+https://github.com/rust-lang/crates.io-index" 1629 | checksum = "0d68c799ae75762b8c3fe375feb6600ef5602c883c5d21eb51c09f22b83c4643" 1630 | dependencies = [ 1631 | "form_urlencoded", 1632 | "idna", 1633 | "percent-encoding", 1634 | ] 1635 | 1636 | [[package]] 1637 | name = "valuable" 1638 | version = "0.1.0" 1639 | source = "registry+https://github.com/rust-lang/crates.io-index" 1640 | checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" 1641 | 1642 | [[package]] 1643 | name = "vcpkg" 1644 | version = "0.2.15" 1645 | source = "registry+https://github.com/rust-lang/crates.io-index" 1646 | checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" 1647 | 1648 | [[package]] 1649 | name = "version_check" 1650 | version = "0.9.4" 1651 | source = "registry+https://github.com/rust-lang/crates.io-index" 1652 | checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" 1653 | 1654 | [[package]] 1655 | name = "want" 1656 | version = "0.3.0" 1657 | source = "registry+https://github.com/rust-lang/crates.io-index" 1658 | checksum = "1ce8a968cb1cd110d136ff8b819a556d6fb6d919363c61534f6860c7eb172ba0" 1659 | dependencies = [ 1660 | "log", 1661 | "try-lock", 1662 | ] 1663 | 1664 | [[package]] 1665 | name = "wasi" 1666 | version = "0.11.0+wasi-snapshot-preview1" 1667 | source = "registry+https://github.com/rust-lang/crates.io-index" 1668 | checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" 1669 | 1670 | [[package]] 1671 | name = "wasm-bindgen" 1672 | version = "0.2.83" 1673 | source = "registry+https://github.com/rust-lang/crates.io-index" 1674 | checksum = "eaf9f5aceeec8be17c128b2e93e031fb8a4d469bb9c4ae2d7dc1888b26887268" 1675 | dependencies = [ 1676 | "cfg-if", 1677 | "wasm-bindgen-macro", 1678 | ] 1679 | 1680 | [[package]] 1681 | name = "wasm-bindgen-backend" 1682 | version = "0.2.83" 1683 | source = "registry+https://github.com/rust-lang/crates.io-index" 1684 | checksum = "4c8ffb332579b0557b52d268b91feab8df3615f265d5270fec2a8c95b17c1142" 1685 | dependencies = [ 1686 | "bumpalo", 1687 | "log", 1688 | "once_cell", 1689 | "proc-macro2", 1690 | "quote", 1691 | "syn", 1692 | "wasm-bindgen-shared", 1693 | ] 1694 | 1695 | [[package]] 1696 | name = "wasm-bindgen-macro" 1697 | version = "0.2.83" 1698 | source = "registry+https://github.com/rust-lang/crates.io-index" 1699 | checksum = "052be0f94026e6cbc75cdefc9bae13fd6052cdcaf532fa6c45e7ae33a1e6c810" 1700 | dependencies = [ 1701 | "quote", 1702 | "wasm-bindgen-macro-support", 1703 | ] 1704 | 1705 | [[package]] 1706 | name = "wasm-bindgen-macro-support" 1707 | version = "0.2.83" 1708 | source = "registry+https://github.com/rust-lang/crates.io-index" 1709 | checksum = "07bc0c051dc5f23e307b13285f9d75df86bfdf816c5721e573dec1f9b8aa193c" 1710 | dependencies = [ 1711 | "proc-macro2", 1712 | "quote", 1713 | "syn", 1714 | "wasm-bindgen-backend", 1715 | "wasm-bindgen-shared", 1716 | ] 1717 | 1718 | [[package]] 1719 | name = "wasm-bindgen-shared" 1720 | version = "0.2.83" 1721 | source = "registry+https://github.com/rust-lang/crates.io-index" 1722 | checksum = "1c38c045535d93ec4f0b4defec448e4291638ee608530863b1e2ba115d4fff7f" 1723 | 1724 | [[package]] 1725 | name = "winapi" 1726 | version = "0.3.9" 1727 | source = "registry+https://github.com/rust-lang/crates.io-index" 1728 | checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" 1729 | dependencies = [ 1730 | "winapi-i686-pc-windows-gnu", 1731 | "winapi-x86_64-pc-windows-gnu", 1732 | ] 1733 | 1734 | [[package]] 1735 | name = "winapi-i686-pc-windows-gnu" 1736 | version = "0.4.0" 1737 | source = "registry+https://github.com/rust-lang/crates.io-index" 1738 | checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" 1739 | 1740 | [[package]] 1741 | name = "winapi-util" 1742 | version = "0.1.5" 1743 | source = "registry+https://github.com/rust-lang/crates.io-index" 1744 | checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" 1745 | dependencies = [ 1746 | "winapi", 1747 | ] 1748 | 1749 | [[package]] 1750 | name = "winapi-x86_64-pc-windows-gnu" 1751 | version = "0.4.0" 1752 | source = "registry+https://github.com/rust-lang/crates.io-index" 1753 | checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" 1754 | 1755 | [[package]] 1756 | name = "windows-sys" 1757 | version = "0.42.0" 1758 | source = "registry+https://github.com/rust-lang/crates.io-index" 1759 | checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" 1760 | dependencies = [ 1761 | "windows_aarch64_gnullvm", 1762 | "windows_aarch64_msvc", 1763 | "windows_i686_gnu", 1764 | "windows_i686_msvc", 1765 | "windows_x86_64_gnu", 1766 | "windows_x86_64_gnullvm", 1767 | "windows_x86_64_msvc", 1768 | ] 1769 | 1770 | [[package]] 1771 | name = "windows_aarch64_gnullvm" 1772 | version = "0.42.0" 1773 | source = "registry+https://github.com/rust-lang/crates.io-index" 1774 | checksum = "41d2aa71f6f0cbe00ae5167d90ef3cfe66527d6f613ca78ac8024c3ccab9a19e" 1775 | 1776 | [[package]] 1777 | name = "windows_aarch64_msvc" 1778 | version = "0.42.0" 1779 | source = "registry+https://github.com/rust-lang/crates.io-index" 1780 | checksum = "dd0f252f5a35cac83d6311b2e795981f5ee6e67eb1f9a7f64eb4500fbc4dcdb4" 1781 | 1782 | [[package]] 1783 | name = "windows_i686_gnu" 1784 | version = "0.42.0" 1785 | source = "registry+https://github.com/rust-lang/crates.io-index" 1786 | checksum = "fbeae19f6716841636c28d695375df17562ca208b2b7d0dc47635a50ae6c5de7" 1787 | 1788 | [[package]] 1789 | name = "windows_i686_msvc" 1790 | version = "0.42.0" 1791 | source = "registry+https://github.com/rust-lang/crates.io-index" 1792 | checksum = "84c12f65daa39dd2babe6e442988fc329d6243fdce47d7d2d155b8d874862246" 1793 | 1794 | [[package]] 1795 | name = "windows_x86_64_gnu" 1796 | version = "0.42.0" 1797 | source = "registry+https://github.com/rust-lang/crates.io-index" 1798 | checksum = "bf7b1b21b5362cbc318f686150e5bcea75ecedc74dd157d874d754a2ca44b0ed" 1799 | 1800 | [[package]] 1801 | name = "windows_x86_64_gnullvm" 1802 | version = "0.42.0" 1803 | source = "registry+https://github.com/rust-lang/crates.io-index" 1804 | checksum = "09d525d2ba30eeb3297665bd434a54297e4170c7f1a44cad4ef58095b4cd2028" 1805 | 1806 | [[package]] 1807 | name = "windows_x86_64_msvc" 1808 | version = "0.42.0" 1809 | source = "registry+https://github.com/rust-lang/crates.io-index" 1810 | checksum = "f40009d85759725a34da6d89a94e63d7bdc50a862acf0dbc7c8e488f1edcb6f5" 1811 | 1812 | [[package]] 1813 | name = "yaml-rust" 1814 | version = "0.4.5" 1815 | source = "registry+https://github.com/rust-lang/crates.io-index" 1816 | checksum = "56c1936c4cc7a1c9ab21a1ebb602eb942ba868cbd44a99cb7cdc5892335e1c85" 1817 | dependencies = [ 1818 | "linked-hash-map", 1819 | ] 1820 | 1821 | [[package]] 1822 | name = "zeroize" 1823 | version = "1.5.7" 1824 | source = "registry+https://github.com/rust-lang/crates.io-index" 1825 | checksum = "c394b5bd0c6f669e7275d9c20aa90ae064cb22e75a1cad54e1b34088034b149f" 1826 | -------------------------------------------------------------------------------- /Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "rust-operator" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 7 | 8 | [dependencies] 9 | kube = { version = "0.77.0", features = ["runtime", "derive"] } 10 | k8s-openapi = { version = "0.16.0", features = ["v1_25"] } 11 | clap = { version = "4.0", features = ["derive"] } 12 | tokio = { version = "1.23.0", features = ["macros", "rt-multi-thread", "signal"] } 13 | backoff = "0.4.0" 14 | futures = "0.3.18" 15 | anyhow = "1.0.51" 16 | log = "0.4.14" 17 | tracing = "0.1.29" 18 | thiserror = "1.0.30" 19 | schemars = "0.8.6" 20 | tracing-subscriber = "0.3.1" 21 | serde = { version = "1.0.130", features = ["derive"] } 22 | serde_json = "1.0.68" 23 | serde_yaml = "0.8.21" -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # rust-operator 2 | 3 | A simple K8s operator written in Rust. 4 | This operator will keep a a custom resource up to date with the configuration of your kubernetes nodes. 5 | It is a tech demo to demonstrate: 6 | - Custom resource creation 7 | - Watchers 8 | - API Create commands 9 | - Kube-rs 10 | 11 | -------------------------------------------------------------------------------- /src/main.rs: -------------------------------------------------------------------------------- 1 | //! Generated types support documentation 2 | #![deny(missing_docs)] 3 | use anyhow::Ok; 4 | use schemars::JsonSchema; 5 | use futures::{pin_mut, TryStreamExt}; 6 | 7 | use serde::{Deserialize, Serialize}; 8 | use tracing::*; 9 | use apiexts::CustomResourceDefinition; 10 | use k8s_openapi::{apiextensions_apiserver::pkg::apis::apiextensions::v1 as apiexts, serde, api::core::v1::Node}; 11 | 12 | use kube::{ 13 | api::{Api, Patch, PatchParams, ResourceExt,ListParams}, 14 | runtime::wait::{await_condition, conditions}, 15 | runtime::{watcher, WatchStreamExt}, 16 | Client, CustomResource, CustomResourceExt, 17 | }; 18 | 19 | // TopologyCRD 20 | #[derive(CustomResource, Deserialize, Serialize, Clone, Debug, JsonSchema)] 21 | #[kube(group = "cnskunkworks.dev", version = "v1", kind = "Topology", namespaced)] 22 | #[kube(status = "TopologyStatus")] 23 | #[kube(scale = r#"{"specReplicasPath":".spec.replicas", "statusReplicasPath":".status.replicas"}"#)] 24 | struct TopologySpec { 25 | pub name: String, 26 | pub nodes: Vec, 27 | } 28 | 29 | #[derive(Deserialize, Serialize, Clone, Debug, Default, JsonSchema)] 30 | struct TopologyStatus { 31 | pub is_bad: bool, 32 | } 33 | 34 | const crdName : &str = "topologies.cnskunkworks.dev"; 35 | 36 | #[tokio::main] 37 | async fn main() -> anyhow::Result<()> { 38 | tracing_subscriber::fmt::init(); 39 | let client = Client::try_default().await?; 40 | 41 | let ssapply = PatchParams::apply("topology_apply").force(); 42 | // 0. Ensure the CRD is installed, could do this once 43 | let crds: Api = Api::all(client.clone()); 44 | info!("Creating crd: {}", serde_yaml::to_string(&Topology::crd())?); 45 | crds.patch(crdName, &ssapply, &Patch::Apply(Topology::crd())) 46 | .await?; 47 | 48 | info!("Waiting for the api-server to accept the CRD"); 49 | let establish = await_condition(crds, crdName, conditions::is_crd_established()); 50 | let _ = tokio::time::timeout(std::time::Duration::from_secs(10), establish).await?; 51 | 52 | // Let's get the current node topology 53 | let nodes: Api = Api::all(client.clone()); 54 | // New client copy to inject our resource 55 | let topologys: Api = Api::default_namespaced(client.clone()); 56 | 57 | let spec = create_spec(nodes).await; 58 | 59 | let tt = topologys.patch("default", &ssapply, 60 | &Patch::Apply(&Topology::new("default", spec))).await?; 61 | 62 | info!("Applied 1 {}: {:?}", tt.name_any(), tt.spec); 63 | 64 | 65 | // watch the topology resources 66 | let obs = watcher(topologys, ListParams::default()).applied_objects(); 67 | pin_mut!(obs); 68 | while let Some(o) = obs.try_next().await? { 69 | match o { 70 | Node => { 71 | let nodes: Api = Api::all(client.clone()); 72 | let spec = create_spec(nodes.clone()).await; 73 | let topologys: Api = Api::default_namespaced(client.clone()); 74 | 75 | let tt = topologys.patch("default", 76 | &ssapply, 77 | &Patch::Apply(&Topology::new("default", 78 | spec))).await?; 79 | } 80 | 81 | 82 | } 83 | } 84 | 85 | Ok(()) 86 | } 87 | async fn create_spec(nodes: Api) -> TopologySpec { 88 | 89 | let node_list = nodes.list(&ListParams::default()).await.unwrap(); 90 | let mut node_names = Vec::new(); 91 | for node in node_list { 92 | node_names.push(node.metadata.name.unwrap()); 93 | } 94 | return TopologySpec { 95 | name: "default".to_string(), 96 | nodes: node_names, 97 | }; 98 | } --------------------------------------------------------------------------------