├── .github ├── fetch_version │ └── .releaserc.json └── workflows │ └── release.yml ├── .gitignore ├── .releaserc.json ├── Cargo.lock ├── Cargo.toml ├── README.md ├── renovate.json └── src ├── commands ├── context.rs ├── mod.rs └── namespace.rs ├── kubeconfig.rs └── main.rs /.github/fetch_version/.releaserc.json: -------------------------------------------------------------------------------- 1 | { 2 | "branches": ["master"], 3 | "plugins": ["@semantic-release/commit-analyzer", "@semantic-release/release-notes-generator"] 4 | } 5 | -------------------------------------------------------------------------------- /.github/workflows/release.yml: -------------------------------------------------------------------------------- 1 | name: Release Binary 2 | 3 | on: 4 | push: 5 | branches: 6 | - master 7 | 8 | jobs: 9 | get_next_version: 10 | runs-on: ubuntu-latest 11 | name: Fetch next version number 12 | steps: 13 | - uses: actions/checkout@v2 14 | - name: semantic release 15 | id: semantic 16 | uses: cycjimmy/semantic-release-action@v2 17 | with: 18 | dry_run: true 19 | working_directory: .github/fetch_version 20 | - run: echo ${{ steps.semantic.outputs.new_release_version }} 21 | - run: echo ${{ steps.semantic.outputs.new_release_published }} 22 | outputs: 23 | create_release: ${{ steps.semantic.outputs.new_release_published }} 24 | new_version: ${{ steps.semantic.outputs.new_release_version }} 25 | 26 | build_windows: 27 | needs: get_next_version 28 | if: needs.get_next_version.outputs.create_release == 'true' 29 | strategy: 30 | fail-fast: true 31 | matrix: 32 | include: 33 | - target: x86_64-pc-windows-msvc 34 | openssl_target: openssl:x64-windows-static-md 35 | name: Build ${{ matrix.target }} on windows 36 | runs-on: windows-latest 37 | steps: 38 | - uses: actions/checkout@v2 39 | 40 | - name: set new version number (${{ needs.get_next_version.outputs.new_version }}) 41 | run: (get-content -Path .\Cargo.toml) | %{$_ -replace "version = \`"0.0.0-development\`"","version = `"${{ needs.get_next_version.outputs.new_version }}`""} | set-content -Path .\Cargo.toml 42 | 43 | - name: install and setup vcpkg 44 | uses: lukka/run-vcpkg@v10.1 45 | with: 46 | vcpkgGitCommitId: b196dacc2f63f37bb75504c36c349042336749cb 47 | 48 | - name: setup openssl 49 | run: vcpkg install ${{ matrix.openssl_target }} 50 | 51 | - name: setup rust 52 | uses: actions-rs/toolchain@v1 53 | with: 54 | toolchain: stable 55 | target: ${{ matrix.target }} 56 | override: true 57 | 58 | - name: Build 59 | uses: actions-rs/cargo@v1 60 | with: 61 | command: build 62 | args: --release --target ${{ matrix.target }} 63 | 64 | - name: upload artifacts 65 | uses: actions/upload-artifact@v2 66 | with: 67 | name: ${{ matrix.target }} 68 | path: | 69 | target/${{ matrix.target }}/release/kuby.exe 70 | 71 | build_unix: 72 | needs: get_next_version 73 | if: needs.get_next_version.outputs.create_release == 'true' 74 | strategy: 75 | fail-fast: true 76 | matrix: 77 | include: 78 | - os: ubuntu-latest 79 | target: x86_64-unknown-linux-gnu 80 | name: Build ${{ matrix.target }} on ubuntu 81 | runs-on: ubuntu-latest 82 | steps: 83 | - uses: actions/checkout@v2 84 | 85 | - name: set new version number (${{ needs.get_next_version.outputs.new_version }}) 86 | run: sed -i -e 's/^version = .*/version = "${{ needs.get_next_version.outputs.new_version }}"/' Cargo.toml 87 | 88 | - name: setup rust 89 | uses: actions-rs/toolchain@v1 90 | with: 91 | toolchain: stable 92 | target: ${{ matrix.target }} 93 | override: true 94 | 95 | - name: Build 96 | uses: actions-rs/cargo@v1 97 | with: 98 | command: build 99 | args: --release --target ${{ matrix.target }} 100 | 101 | - name: upload artifacts 102 | uses: actions/upload-artifact@v2 103 | with: 104 | name: ${{ matrix.target }} 105 | path: | 106 | target/${{ matrix.target }}/release/kuby 107 | 108 | build_macos: 109 | needs: get_next_version 110 | if: needs.get_next_version.outputs.create_release == 'true' 111 | strategy: 112 | fail-fast: false 113 | matrix: 114 | include: 115 | - target: aarch64-apple-darwin 116 | - target: x86_64-apple-darwin 117 | name: Build ${{ matrix.target }} on macos 118 | runs-on: macos-latest 119 | steps: 120 | - uses: actions/checkout@v2 121 | 122 | - name: set new version number (${{ needs.get_next_version.outputs.new_version }}) 123 | run: sed -i -e 's/^version = .*/version = "${{ needs.get_next_version.outputs.new_version }}"/' Cargo.toml 124 | 125 | - name: setup rust 126 | uses: actions-rs/toolchain@v1 127 | with: 128 | toolchain: stable 129 | target: ${{ matrix.target }} 130 | override: true 131 | 132 | - name: Build 133 | uses: actions-rs/cargo@v1 134 | with: 135 | command: build 136 | use-cross: true 137 | args: --release --target ${{ matrix.target }} 138 | 139 | - name: upload artifacts 140 | uses: actions/upload-artifact@v2 141 | with: 142 | name: ${{ matrix.target }} 143 | path: | 144 | target/${{ matrix.target }}/release/kuby 145 | 146 | create_release: 147 | needs: 148 | - build_windows 149 | - build_unix 150 | - build_macos 151 | if: needs.get_next_version.outputs.create_release == 'true' 152 | name: Create release 153 | runs-on: ubuntu-latest 154 | steps: 155 | - uses: actions/checkout@v2 156 | - uses: actions/download-artifact@v3 157 | 158 | - name: package m1 apple 159 | uses: papeloto/action-zip@v1 160 | with: 161 | files: aarch64-apple-darwin/ 162 | dest: aarch64-apple-darwin.zip 163 | - name: package intel apple 164 | uses: papeloto/action-zip@v1 165 | with: 166 | files: x86_64-apple-darwin/ 167 | dest: x86_64-apple-darwin.zip 168 | - name: package windows x64 169 | uses: papeloto/action-zip@v1 170 | with: 171 | files: x86_64-pc-windows-msvc/ 172 | dest: x86_64-pc-windows-msvc.zip 173 | - name: package unix 174 | uses: papeloto/action-zip@v1 175 | with: 176 | files: x86_64-unknown-linux-gnu/ 177 | dest: x86_64-unknown-linux-gnu.zip 178 | 179 | - name: create release 180 | uses: cycjimmy/semantic-release-action@v2 181 | env: 182 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 183 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | -------------------------------------------------------------------------------- /.releaserc.json: -------------------------------------------------------------------------------- 1 | { 2 | "branches": ["master"], 3 | "plugins": [ 4 | "@semantic-release/commit-analyzer", 5 | "@semantic-release/release-notes-generator", 6 | [ 7 | "@semantic-release/github", 8 | { 9 | "assets": [ 10 | { 11 | "path": "./*.zip" 12 | } 13 | ] 14 | } 15 | ] 16 | ] 17 | } 18 | -------------------------------------------------------------------------------- /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 = "atty" 7 | version = "0.2.14" 8 | source = "registry+https://github.com/rust-lang/crates.io-index" 9 | checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" 10 | dependencies = [ 11 | "hermit-abi", 12 | "libc", 13 | "winapi", 14 | ] 15 | 16 | [[package]] 17 | name = "autocfg" 18 | version = "1.1.0" 19 | source = "registry+https://github.com/rust-lang/crates.io-index" 20 | checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" 21 | 22 | [[package]] 23 | name = "base64" 24 | version = "0.13.0" 25 | source = "registry+https://github.com/rust-lang/crates.io-index" 26 | checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" 27 | 28 | [[package]] 29 | name = "bitflags" 30 | version = "1.3.2" 31 | source = "registry+https://github.com/rust-lang/crates.io-index" 32 | checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" 33 | 34 | [[package]] 35 | name = "bytes" 36 | version = "1.1.0" 37 | source = "registry+https://github.com/rust-lang/crates.io-index" 38 | checksum = "c4872d67bab6358e59559027aa3b9157c53d9358c51423c17554809a8858e0f8" 39 | 40 | [[package]] 41 | name = "cc" 42 | version = "1.0.72" 43 | source = "registry+https://github.com/rust-lang/crates.io-index" 44 | checksum = "22a9137b95ea06864e018375b72adfb7db6e6f68cfc8df5a04d00288050485ee" 45 | 46 | [[package]] 47 | name = "cfg-if" 48 | version = "1.0.0" 49 | source = "registry+https://github.com/rust-lang/crates.io-index" 50 | checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" 51 | 52 | [[package]] 53 | name = "chrono" 54 | version = "0.4.19" 55 | source = "registry+https://github.com/rust-lang/crates.io-index" 56 | checksum = "670ad68c9088c2a963aaa298cb369688cf3f9465ce5e2d4ca10e6e0098a1ce73" 57 | dependencies = [ 58 | "libc", 59 | "num-integer", 60 | "num-traits", 61 | "serde", 62 | "winapi", 63 | ] 64 | 65 | [[package]] 66 | name = "clap" 67 | version = "3.0.14" 68 | source = "registry+https://github.com/rust-lang/crates.io-index" 69 | checksum = "b63edc3f163b3c71ec8aa23f9bd6070f77edbf3d1d198b164afa90ff00e4ec62" 70 | dependencies = [ 71 | "atty", 72 | "bitflags", 73 | "clap_derive", 74 | "indexmap", 75 | "lazy_static", 76 | "os_str_bytes", 77 | "strsim", 78 | "termcolor", 79 | "textwrap", 80 | ] 81 | 82 | [[package]] 83 | name = "clap_derive" 84 | version = "3.0.14" 85 | source = "registry+https://github.com/rust-lang/crates.io-index" 86 | checksum = "9a1132dc3944b31c20dd8b906b3a9f0a5d0243e092d59171414969657ac6aa85" 87 | dependencies = [ 88 | "heck", 89 | "proc-macro-error", 90 | "proc-macro2", 91 | "quote", 92 | "syn", 93 | ] 94 | 95 | [[package]] 96 | name = "colored" 97 | version = "2.0.0" 98 | source = "registry+https://github.com/rust-lang/crates.io-index" 99 | checksum = "b3616f750b84d8f0de8a58bda93e08e2a81ad3f523089b05f1dffecab48c6cbd" 100 | dependencies = [ 101 | "atty", 102 | "lazy_static", 103 | "winapi", 104 | ] 105 | 106 | [[package]] 107 | name = "console" 108 | version = "0.15.0" 109 | source = "registry+https://github.com/rust-lang/crates.io-index" 110 | checksum = "a28b32d32ca44b70c3e4acd7db1babf555fa026e385fb95f18028f88848b3c31" 111 | dependencies = [ 112 | "encode_unicode", 113 | "libc", 114 | "once_cell", 115 | "regex", 116 | "terminal_size", 117 | "unicode-width", 118 | "winapi", 119 | ] 120 | 121 | [[package]] 122 | name = "core-foundation" 123 | version = "0.9.3" 124 | source = "registry+https://github.com/rust-lang/crates.io-index" 125 | checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146" 126 | dependencies = [ 127 | "core-foundation-sys", 128 | "libc", 129 | ] 130 | 131 | [[package]] 132 | name = "core-foundation-sys" 133 | version = "0.8.3" 134 | source = "registry+https://github.com/rust-lang/crates.io-index" 135 | checksum = "5827cebf4670468b8772dd191856768aedcb1b0278a04f989f7766351917b9dc" 136 | 137 | [[package]] 138 | name = "dialoguer" 139 | version = "0.9.0" 140 | source = "registry+https://github.com/rust-lang/crates.io-index" 141 | checksum = "61579ada4ec0c6031cfac3f86fdba0d195a7ebeb5e36693bd53cb5999a25beeb" 142 | dependencies = [ 143 | "console", 144 | "lazy_static", 145 | "tempfile", 146 | "zeroize", 147 | ] 148 | 149 | [[package]] 150 | name = "dirs" 151 | version = "4.0.0" 152 | source = "registry+https://github.com/rust-lang/crates.io-index" 153 | checksum = "ca3aa72a6f96ea37bbc5aa912f6788242832f75369bdfdadcb0e38423f100059" 154 | dependencies = [ 155 | "dirs-sys", 156 | ] 157 | 158 | [[package]] 159 | name = "dirs-next" 160 | version = "2.0.0" 161 | source = "registry+https://github.com/rust-lang/crates.io-index" 162 | checksum = "b98cf8ebf19c3d1b223e151f99a4f9f0690dca41414773390fc824184ac833e1" 163 | dependencies = [ 164 | "cfg-if", 165 | "dirs-sys-next", 166 | ] 167 | 168 | [[package]] 169 | name = "dirs-sys" 170 | version = "0.3.6" 171 | source = "registry+https://github.com/rust-lang/crates.io-index" 172 | checksum = "03d86534ed367a67548dc68113a0f5db55432fdfbb6e6f9d77704397d95d5780" 173 | dependencies = [ 174 | "libc", 175 | "redox_users", 176 | "winapi", 177 | ] 178 | 179 | [[package]] 180 | name = "dirs-sys-next" 181 | version = "0.1.2" 182 | source = "registry+https://github.com/rust-lang/crates.io-index" 183 | checksum = "4ebda144c4fe02d1f7ea1a7d9641b6fc6b580adcfa024ae48797ecdeb6825b4d" 184 | dependencies = [ 185 | "libc", 186 | "redox_users", 187 | "winapi", 188 | ] 189 | 190 | [[package]] 191 | name = "either" 192 | version = "1.6.1" 193 | source = "registry+https://github.com/rust-lang/crates.io-index" 194 | checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457" 195 | 196 | [[package]] 197 | name = "encode_unicode" 198 | version = "0.3.6" 199 | source = "registry+https://github.com/rust-lang/crates.io-index" 200 | checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" 201 | 202 | [[package]] 203 | name = "fastrand" 204 | version = "1.7.0" 205 | source = "registry+https://github.com/rust-lang/crates.io-index" 206 | checksum = "c3fcf0cee53519c866c09b5de1f6c56ff9d647101f81c1964fa632e148896cdf" 207 | dependencies = [ 208 | "instant", 209 | ] 210 | 211 | [[package]] 212 | name = "fnv" 213 | version = "1.0.7" 214 | source = "registry+https://github.com/rust-lang/crates.io-index" 215 | checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" 216 | 217 | [[package]] 218 | name = "foreign-types" 219 | version = "0.3.2" 220 | source = "registry+https://github.com/rust-lang/crates.io-index" 221 | checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" 222 | dependencies = [ 223 | "foreign-types-shared", 224 | ] 225 | 226 | [[package]] 227 | name = "foreign-types-shared" 228 | version = "0.1.1" 229 | source = "registry+https://github.com/rust-lang/crates.io-index" 230 | checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" 231 | 232 | [[package]] 233 | name = "form_urlencoded" 234 | version = "1.0.1" 235 | source = "registry+https://github.com/rust-lang/crates.io-index" 236 | checksum = "5fc25a87fa4fd2094bffb06925852034d90a17f0d1e05197d4956d3555752191" 237 | dependencies = [ 238 | "matches", 239 | "percent-encoding", 240 | ] 241 | 242 | [[package]] 243 | name = "futures" 244 | version = "0.3.21" 245 | source = "registry+https://github.com/rust-lang/crates.io-index" 246 | checksum = "f73fe65f54d1e12b726f517d3e2135ca3125a437b6d998caf1962961f7172d9e" 247 | dependencies = [ 248 | "futures-channel", 249 | "futures-core", 250 | "futures-executor", 251 | "futures-io", 252 | "futures-sink", 253 | "futures-task", 254 | "futures-util", 255 | ] 256 | 257 | [[package]] 258 | name = "futures-channel" 259 | version = "0.3.21" 260 | source = "registry+https://github.com/rust-lang/crates.io-index" 261 | checksum = "c3083ce4b914124575708913bca19bfe887522d6e2e6d0952943f5eac4a74010" 262 | dependencies = [ 263 | "futures-core", 264 | "futures-sink", 265 | ] 266 | 267 | [[package]] 268 | name = "futures-core" 269 | version = "0.3.21" 270 | source = "registry+https://github.com/rust-lang/crates.io-index" 271 | checksum = "0c09fd04b7e4073ac7156a9539b57a484a8ea920f79c7c675d05d289ab6110d3" 272 | 273 | [[package]] 274 | name = "futures-executor" 275 | version = "0.3.21" 276 | source = "registry+https://github.com/rust-lang/crates.io-index" 277 | checksum = "9420b90cfa29e327d0429f19be13e7ddb68fa1cccb09d65e5706b8c7a749b8a6" 278 | dependencies = [ 279 | "futures-core", 280 | "futures-task", 281 | "futures-util", 282 | ] 283 | 284 | [[package]] 285 | name = "futures-io" 286 | version = "0.3.21" 287 | source = "registry+https://github.com/rust-lang/crates.io-index" 288 | checksum = "fc4045962a5a5e935ee2fdedaa4e08284547402885ab326734432bed5d12966b" 289 | 290 | [[package]] 291 | name = "futures-macro" 292 | version = "0.3.21" 293 | source = "registry+https://github.com/rust-lang/crates.io-index" 294 | checksum = "33c1e13800337f4d4d7a316bf45a567dbcb6ffe087f16424852d97e97a91f512" 295 | dependencies = [ 296 | "proc-macro2", 297 | "quote", 298 | "syn", 299 | ] 300 | 301 | [[package]] 302 | name = "futures-sink" 303 | version = "0.3.21" 304 | source = "registry+https://github.com/rust-lang/crates.io-index" 305 | checksum = "21163e139fa306126e6eedaf49ecdb4588f939600f0b1e770f4205ee4b7fa868" 306 | 307 | [[package]] 308 | name = "futures-task" 309 | version = "0.3.21" 310 | source = "registry+https://github.com/rust-lang/crates.io-index" 311 | checksum = "57c66a976bf5909d801bbef33416c41372779507e7a6b3a5e25e4749c58f776a" 312 | 313 | [[package]] 314 | name = "futures-util" 315 | version = "0.3.21" 316 | source = "registry+https://github.com/rust-lang/crates.io-index" 317 | checksum = "d8b7abd5d659d9b90c8cba917f6ec750a74e2dc23902ef9cd4cc8c8b22e6036a" 318 | dependencies = [ 319 | "futures-channel", 320 | "futures-core", 321 | "futures-io", 322 | "futures-macro", 323 | "futures-sink", 324 | "futures-task", 325 | "memchr", 326 | "pin-project-lite", 327 | "pin-utils", 328 | "slab", 329 | ] 330 | 331 | [[package]] 332 | name = "getrandom" 333 | version = "0.2.4" 334 | source = "registry+https://github.com/rust-lang/crates.io-index" 335 | checksum = "418d37c8b1d42553c93648be529cb70f920d3baf8ef469b74b9638df426e0b4c" 336 | dependencies = [ 337 | "cfg-if", 338 | "libc", 339 | "wasi", 340 | ] 341 | 342 | [[package]] 343 | name = "hashbrown" 344 | version = "0.11.2" 345 | source = "registry+https://github.com/rust-lang/crates.io-index" 346 | checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" 347 | 348 | [[package]] 349 | name = "heck" 350 | version = "0.4.0" 351 | source = "registry+https://github.com/rust-lang/crates.io-index" 352 | checksum = "2540771e65fc8cb83cd6e8a237f70c319bd5c29f78ed1084ba5d50eeac86f7f9" 353 | 354 | [[package]] 355 | name = "hermit-abi" 356 | version = "0.1.19" 357 | source = "registry+https://github.com/rust-lang/crates.io-index" 358 | checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" 359 | dependencies = [ 360 | "libc", 361 | ] 362 | 363 | [[package]] 364 | name = "http" 365 | version = "0.2.6" 366 | source = "registry+https://github.com/rust-lang/crates.io-index" 367 | checksum = "31f4c6746584866f0feabcc69893c5b51beef3831656a968ed7ae254cdc4fd03" 368 | dependencies = [ 369 | "bytes", 370 | "fnv", 371 | "itoa", 372 | ] 373 | 374 | [[package]] 375 | name = "http-body" 376 | version = "0.4.4" 377 | source = "registry+https://github.com/rust-lang/crates.io-index" 378 | checksum = "1ff4f84919677303da5f147645dbea6b1881f368d03ac84e1dc09031ebd7b2c6" 379 | dependencies = [ 380 | "bytes", 381 | "http", 382 | "pin-project-lite", 383 | ] 384 | 385 | [[package]] 386 | name = "http-range-header" 387 | version = "0.3.0" 388 | source = "registry+https://github.com/rust-lang/crates.io-index" 389 | checksum = "0bfe8eed0a9285ef776bb792479ea3834e8b94e13d615c2f66d03dd50a435a29" 390 | 391 | [[package]] 392 | name = "httparse" 393 | version = "1.6.0" 394 | source = "registry+https://github.com/rust-lang/crates.io-index" 395 | checksum = "9100414882e15fb7feccb4897e5f0ff0ff1ca7d1a86a23208ada4d7a18e6c6c4" 396 | 397 | [[package]] 398 | name = "httpdate" 399 | version = "1.0.2" 400 | source = "registry+https://github.com/rust-lang/crates.io-index" 401 | checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421" 402 | 403 | [[package]] 404 | name = "hyper" 405 | version = "0.14.17" 406 | source = "registry+https://github.com/rust-lang/crates.io-index" 407 | checksum = "043f0e083e9901b6cc658a77d1eb86f4fc650bbb977a4337dd63192826aa85dd" 408 | dependencies = [ 409 | "bytes", 410 | "futures-channel", 411 | "futures-core", 412 | "futures-util", 413 | "http", 414 | "http-body", 415 | "httparse", 416 | "httpdate", 417 | "itoa", 418 | "pin-project-lite", 419 | "socket2", 420 | "tokio", 421 | "tower-service", 422 | "tracing", 423 | "want", 424 | ] 425 | 426 | [[package]] 427 | name = "hyper-timeout" 428 | version = "0.4.1" 429 | source = "registry+https://github.com/rust-lang/crates.io-index" 430 | checksum = "bbb958482e8c7be4bc3cf272a766a2b0bf1a6755e7a6ae777f017a31d11b13b1" 431 | dependencies = [ 432 | "hyper", 433 | "pin-project-lite", 434 | "tokio", 435 | "tokio-io-timeout", 436 | ] 437 | 438 | [[package]] 439 | name = "hyper-tls" 440 | version = "0.5.0" 441 | source = "registry+https://github.com/rust-lang/crates.io-index" 442 | checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" 443 | dependencies = [ 444 | "bytes", 445 | "hyper", 446 | "native-tls", 447 | "tokio", 448 | "tokio-native-tls", 449 | ] 450 | 451 | [[package]] 452 | name = "idna" 453 | version = "0.2.3" 454 | source = "registry+https://github.com/rust-lang/crates.io-index" 455 | checksum = "418a0a6fab821475f634efe3ccc45c013f742efe03d853e8d3355d5cb850ecf8" 456 | dependencies = [ 457 | "matches", 458 | "unicode-bidi", 459 | "unicode-normalization", 460 | ] 461 | 462 | [[package]] 463 | name = "indexmap" 464 | version = "1.8.0" 465 | source = "registry+https://github.com/rust-lang/crates.io-index" 466 | checksum = "282a6247722caba404c065016bbfa522806e51714c34f5dfc3e4a3a46fcb4223" 467 | dependencies = [ 468 | "autocfg", 469 | "hashbrown", 470 | ] 471 | 472 | [[package]] 473 | name = "instant" 474 | version = "0.1.12" 475 | source = "registry+https://github.com/rust-lang/crates.io-index" 476 | checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" 477 | dependencies = [ 478 | "cfg-if", 479 | ] 480 | 481 | [[package]] 482 | name = "itoa" 483 | version = "1.0.1" 484 | source = "registry+https://github.com/rust-lang/crates.io-index" 485 | checksum = "1aab8fc367588b89dcee83ab0fd66b72b50b72fa1904d7095045ace2b0c81c35" 486 | 487 | [[package]] 488 | name = "jsonpath_lib" 489 | version = "0.3.0" 490 | source = "registry+https://github.com/rust-lang/crates.io-index" 491 | checksum = "eaa63191d68230cccb81c5aa23abd53ed64d83337cacbb25a7b8c7979523774f" 492 | dependencies = [ 493 | "log", 494 | "serde", 495 | "serde_json", 496 | ] 497 | 498 | [[package]] 499 | name = "k8s-openapi" 500 | version = "0.14.0" 501 | source = "registry+https://github.com/rust-lang/crates.io-index" 502 | checksum = "0489fc937cc7616a9abfa61bf39c250d7e32e1325ef028c8d9278dd24ea395b3" 503 | dependencies = [ 504 | "base64", 505 | "bytes", 506 | "chrono", 507 | "http", 508 | "percent-encoding", 509 | "serde", 510 | "serde-value", 511 | "serde_json", 512 | "url", 513 | ] 514 | 515 | [[package]] 516 | name = "kube" 517 | version = "0.69.0" 518 | source = "registry+https://github.com/rust-lang/crates.io-index" 519 | checksum = "1f06ab5c1d0d0bffbc96240728792fbe0f50139cf1320c285c8dc8eb0b4a09da" 520 | dependencies = [ 521 | "k8s-openapi", 522 | "kube-client", 523 | "kube-core", 524 | ] 525 | 526 | [[package]] 527 | name = "kube-client" 528 | version = "0.69.0" 529 | source = "registry+https://github.com/rust-lang/crates.io-index" 530 | checksum = "600ef6c2724d235b5fc725254e08d7bd1fd8de95976ca9c99d060b1cb7ce91e9" 531 | dependencies = [ 532 | "base64", 533 | "bytes", 534 | "chrono", 535 | "dirs-next", 536 | "either", 537 | "futures", 538 | "http", 539 | "http-body", 540 | "hyper", 541 | "hyper-timeout", 542 | "hyper-tls", 543 | "jsonpath_lib", 544 | "k8s-openapi", 545 | "kube-core", 546 | "openssl", 547 | "pem", 548 | "pin-project", 549 | "secrecy", 550 | "serde", 551 | "serde_json", 552 | "serde_yaml", 553 | "thiserror", 554 | "tokio", 555 | "tokio-native-tls", 556 | "tokio-util", 557 | "tower", 558 | "tower-http", 559 | "tracing", 560 | ] 561 | 562 | [[package]] 563 | name = "kube-core" 564 | version = "0.69.0" 565 | source = "registry+https://github.com/rust-lang/crates.io-index" 566 | checksum = "2a87945c0eccb682d387c3400c50c3bd8750d80127919a0a25119d68e7bd5d0a" 567 | dependencies = [ 568 | "chrono", 569 | "form_urlencoded", 570 | "http", 571 | "k8s-openapi", 572 | "once_cell", 573 | "serde", 574 | "serde_json", 575 | "thiserror", 576 | ] 577 | 578 | [[package]] 579 | name = "kuby" 580 | version = "0.0.0-development" 581 | dependencies = [ 582 | "clap", 583 | "colored", 584 | "dialoguer", 585 | "dirs", 586 | "k8s-openapi", 587 | "kube", 588 | "openssl-sys", 589 | "serde", 590 | "serde_yaml", 591 | "tokio", 592 | ] 593 | 594 | [[package]] 595 | name = "lazy_static" 596 | version = "1.4.0" 597 | source = "registry+https://github.com/rust-lang/crates.io-index" 598 | checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" 599 | 600 | [[package]] 601 | name = "libc" 602 | version = "0.2.117" 603 | source = "registry+https://github.com/rust-lang/crates.io-index" 604 | checksum = "e74d72e0f9b65b5b4ca49a346af3976df0f9c61d550727f349ecd559f251a26c" 605 | 606 | [[package]] 607 | name = "linked-hash-map" 608 | version = "0.5.4" 609 | source = "registry+https://github.com/rust-lang/crates.io-index" 610 | checksum = "7fb9b38af92608140b86b693604b9ffcc5824240a484d1ecd4795bacb2fe88f3" 611 | 612 | [[package]] 613 | name = "log" 614 | version = "0.4.14" 615 | source = "registry+https://github.com/rust-lang/crates.io-index" 616 | checksum = "51b9bbe6c47d51fc3e1a9b945965946b4c44142ab8792c50835a980d362c2710" 617 | dependencies = [ 618 | "cfg-if", 619 | ] 620 | 621 | [[package]] 622 | name = "matches" 623 | version = "0.1.9" 624 | source = "registry+https://github.com/rust-lang/crates.io-index" 625 | checksum = "a3e378b66a060d48947b590737b30a1be76706c8dd7b8ba0f2fe3989c68a853f" 626 | 627 | [[package]] 628 | name = "memchr" 629 | version = "2.4.1" 630 | source = "registry+https://github.com/rust-lang/crates.io-index" 631 | checksum = "308cc39be01b73d0d18f82a0e7b2a3df85245f84af96fdddc5d202d27e47b86a" 632 | 633 | [[package]] 634 | name = "mio" 635 | version = "0.7.14" 636 | source = "registry+https://github.com/rust-lang/crates.io-index" 637 | checksum = "8067b404fe97c70829f082dec8bcf4f71225d7eaea1d8645349cb76fa06205cc" 638 | dependencies = [ 639 | "libc", 640 | "log", 641 | "miow", 642 | "ntapi", 643 | "winapi", 644 | ] 645 | 646 | [[package]] 647 | name = "miow" 648 | version = "0.3.7" 649 | source = "registry+https://github.com/rust-lang/crates.io-index" 650 | checksum = "b9f1c5b025cda876f66ef43a113f91ebc9f4ccef34843000e0adf6ebbab84e21" 651 | dependencies = [ 652 | "winapi", 653 | ] 654 | 655 | [[package]] 656 | name = "native-tls" 657 | version = "0.2.8" 658 | source = "registry+https://github.com/rust-lang/crates.io-index" 659 | checksum = "48ba9f7719b5a0f42f338907614285fb5fd70e53858141f69898a1fb7203b24d" 660 | dependencies = [ 661 | "lazy_static", 662 | "libc", 663 | "log", 664 | "openssl", 665 | "openssl-probe", 666 | "openssl-sys", 667 | "schannel", 668 | "security-framework", 669 | "security-framework-sys", 670 | "tempfile", 671 | ] 672 | 673 | [[package]] 674 | name = "ntapi" 675 | version = "0.3.7" 676 | source = "registry+https://github.com/rust-lang/crates.io-index" 677 | checksum = "c28774a7fd2fbb4f0babd8237ce554b73af68021b5f695a3cebd6c59bac0980f" 678 | dependencies = [ 679 | "winapi", 680 | ] 681 | 682 | [[package]] 683 | name = "num-integer" 684 | version = "0.1.44" 685 | source = "registry+https://github.com/rust-lang/crates.io-index" 686 | checksum = "d2cc698a63b549a70bc047073d2949cce27cd1c7b0a4a862d08a8031bc2801db" 687 | dependencies = [ 688 | "autocfg", 689 | "num-traits", 690 | ] 691 | 692 | [[package]] 693 | name = "num-traits" 694 | version = "0.2.14" 695 | source = "registry+https://github.com/rust-lang/crates.io-index" 696 | checksum = "9a64b1ec5cda2586e284722486d802acf1f7dbdc623e2bfc57e65ca1cd099290" 697 | dependencies = [ 698 | "autocfg", 699 | ] 700 | 701 | [[package]] 702 | name = "num_cpus" 703 | version = "1.13.1" 704 | source = "registry+https://github.com/rust-lang/crates.io-index" 705 | checksum = "19e64526ebdee182341572e50e9ad03965aa510cd94427a4549448f285e957a1" 706 | dependencies = [ 707 | "hermit-abi", 708 | "libc", 709 | ] 710 | 711 | [[package]] 712 | name = "once_cell" 713 | version = "1.9.0" 714 | source = "registry+https://github.com/rust-lang/crates.io-index" 715 | checksum = "da32515d9f6e6e489d7bc9d84c71b060db7247dc035bbe44eac88cf87486d8d5" 716 | 717 | [[package]] 718 | name = "openssl" 719 | version = "0.10.38" 720 | source = "registry+https://github.com/rust-lang/crates.io-index" 721 | checksum = "0c7ae222234c30df141154f159066c5093ff73b63204dcda7121eb082fc56a95" 722 | dependencies = [ 723 | "bitflags", 724 | "cfg-if", 725 | "foreign-types", 726 | "libc", 727 | "once_cell", 728 | "openssl-sys", 729 | ] 730 | 731 | [[package]] 732 | name = "openssl-probe" 733 | version = "0.1.5" 734 | source = "registry+https://github.com/rust-lang/crates.io-index" 735 | checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" 736 | 737 | [[package]] 738 | name = "openssl-sys" 739 | version = "0.9.72" 740 | source = "registry+https://github.com/rust-lang/crates.io-index" 741 | checksum = "7e46109c383602735fa0a2e48dd2b7c892b048e1bf69e5c3b1d804b7d9c203cb" 742 | dependencies = [ 743 | "autocfg", 744 | "cc", 745 | "libc", 746 | "pkg-config", 747 | "vcpkg", 748 | ] 749 | 750 | [[package]] 751 | name = "ordered-float" 752 | version = "2.10.0" 753 | source = "registry+https://github.com/rust-lang/crates.io-index" 754 | checksum = "7940cf2ca942593318d07fcf2596cdca60a85c9e7fab408a5e21a4f9dcd40d87" 755 | dependencies = [ 756 | "num-traits", 757 | ] 758 | 759 | [[package]] 760 | name = "os_str_bytes" 761 | version = "6.0.0" 762 | source = "registry+https://github.com/rust-lang/crates.io-index" 763 | checksum = "8e22443d1643a904602595ba1cd8f7d896afe56d26712531c5ff73a15b2fbf64" 764 | dependencies = [ 765 | "memchr", 766 | ] 767 | 768 | [[package]] 769 | name = "pem" 770 | version = "1.0.2" 771 | source = "registry+https://github.com/rust-lang/crates.io-index" 772 | checksum = "e9a3b09a20e374558580a4914d3b7d89bd61b954a5a5e1dcbea98753addb1947" 773 | dependencies = [ 774 | "base64", 775 | ] 776 | 777 | [[package]] 778 | name = "percent-encoding" 779 | version = "2.1.0" 780 | source = "registry+https://github.com/rust-lang/crates.io-index" 781 | checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" 782 | 783 | [[package]] 784 | name = "pin-project" 785 | version = "1.0.10" 786 | source = "registry+https://github.com/rust-lang/crates.io-index" 787 | checksum = "58ad3879ad3baf4e44784bc6a718a8698867bb991f8ce24d1bcbe2cfb4c3a75e" 788 | dependencies = [ 789 | "pin-project-internal", 790 | ] 791 | 792 | [[package]] 793 | name = "pin-project-internal" 794 | version = "1.0.10" 795 | source = "registry+https://github.com/rust-lang/crates.io-index" 796 | checksum = "744b6f092ba29c3650faf274db506afd39944f48420f6c86b17cfe0ee1cb36bb" 797 | dependencies = [ 798 | "proc-macro2", 799 | "quote", 800 | "syn", 801 | ] 802 | 803 | [[package]] 804 | name = "pin-project-lite" 805 | version = "0.2.8" 806 | source = "registry+https://github.com/rust-lang/crates.io-index" 807 | checksum = "e280fbe77cc62c91527259e9442153f4688736748d24660126286329742b4c6c" 808 | 809 | [[package]] 810 | name = "pin-utils" 811 | version = "0.1.0" 812 | source = "registry+https://github.com/rust-lang/crates.io-index" 813 | checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" 814 | 815 | [[package]] 816 | name = "pkg-config" 817 | version = "0.3.24" 818 | source = "registry+https://github.com/rust-lang/crates.io-index" 819 | checksum = "58893f751c9b0412871a09abd62ecd2a00298c6c83befa223ef98c52aef40cbe" 820 | 821 | [[package]] 822 | name = "proc-macro-error" 823 | version = "1.0.4" 824 | source = "registry+https://github.com/rust-lang/crates.io-index" 825 | checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" 826 | dependencies = [ 827 | "proc-macro-error-attr", 828 | "proc-macro2", 829 | "quote", 830 | "syn", 831 | "version_check", 832 | ] 833 | 834 | [[package]] 835 | name = "proc-macro-error-attr" 836 | version = "1.0.4" 837 | source = "registry+https://github.com/rust-lang/crates.io-index" 838 | checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" 839 | dependencies = [ 840 | "proc-macro2", 841 | "quote", 842 | "version_check", 843 | ] 844 | 845 | [[package]] 846 | name = "proc-macro2" 847 | version = "1.0.36" 848 | source = "registry+https://github.com/rust-lang/crates.io-index" 849 | checksum = "c7342d5883fbccae1cc37a2353b09c87c9b0f3afd73f5fb9bba687a1f733b029" 850 | dependencies = [ 851 | "unicode-xid", 852 | ] 853 | 854 | [[package]] 855 | name = "quote" 856 | version = "1.0.15" 857 | source = "registry+https://github.com/rust-lang/crates.io-index" 858 | checksum = "864d3e96a899863136fc6e99f3d7cae289dafe43bf2c5ac19b70df7210c0a145" 859 | dependencies = [ 860 | "proc-macro2", 861 | ] 862 | 863 | [[package]] 864 | name = "redox_syscall" 865 | version = "0.2.10" 866 | source = "registry+https://github.com/rust-lang/crates.io-index" 867 | checksum = "8383f39639269cde97d255a32bdb68c047337295414940c68bdd30c2e13203ff" 868 | dependencies = [ 869 | "bitflags", 870 | ] 871 | 872 | [[package]] 873 | name = "redox_users" 874 | version = "0.4.0" 875 | source = "registry+https://github.com/rust-lang/crates.io-index" 876 | checksum = "528532f3d801c87aec9def2add9ca802fe569e44a544afe633765267840abe64" 877 | dependencies = [ 878 | "getrandom", 879 | "redox_syscall", 880 | ] 881 | 882 | [[package]] 883 | name = "regex" 884 | version = "1.5.4" 885 | source = "registry+https://github.com/rust-lang/crates.io-index" 886 | checksum = "d07a8629359eb56f1e2fb1652bb04212c072a87ba68546a04065d525673ac461" 887 | dependencies = [ 888 | "regex-syntax", 889 | ] 890 | 891 | [[package]] 892 | name = "regex-syntax" 893 | version = "0.6.25" 894 | source = "registry+https://github.com/rust-lang/crates.io-index" 895 | checksum = "f497285884f3fcff424ffc933e56d7cbca511def0c9831a7f9b5f6153e3cc89b" 896 | 897 | [[package]] 898 | name = "remove_dir_all" 899 | version = "0.5.3" 900 | source = "registry+https://github.com/rust-lang/crates.io-index" 901 | checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7" 902 | dependencies = [ 903 | "winapi", 904 | ] 905 | 906 | [[package]] 907 | name = "ryu" 908 | version = "1.0.9" 909 | source = "registry+https://github.com/rust-lang/crates.io-index" 910 | checksum = "73b4b750c782965c211b42f022f59af1fbceabdd026623714f104152f1ec149f" 911 | 912 | [[package]] 913 | name = "schannel" 914 | version = "0.1.19" 915 | source = "registry+https://github.com/rust-lang/crates.io-index" 916 | checksum = "8f05ba609c234e60bee0d547fe94a4c7e9da733d1c962cf6e59efa4cd9c8bc75" 917 | dependencies = [ 918 | "lazy_static", 919 | "winapi", 920 | ] 921 | 922 | [[package]] 923 | name = "secrecy" 924 | version = "0.8.0" 925 | source = "registry+https://github.com/rust-lang/crates.io-index" 926 | checksum = "9bd1c54ea06cfd2f6b63219704de0b9b4f72dcc2b8fdef820be6cd799780e91e" 927 | dependencies = [ 928 | "serde", 929 | "zeroize", 930 | ] 931 | 932 | [[package]] 933 | name = "security-framework" 934 | version = "2.6.1" 935 | source = "registry+https://github.com/rust-lang/crates.io-index" 936 | checksum = "2dc14f172faf8a0194a3aded622712b0de276821addc574fa54fc0a1167e10dc" 937 | dependencies = [ 938 | "bitflags", 939 | "core-foundation", 940 | "core-foundation-sys", 941 | "libc", 942 | "security-framework-sys", 943 | ] 944 | 945 | [[package]] 946 | name = "security-framework-sys" 947 | version = "2.6.1" 948 | source = "registry+https://github.com/rust-lang/crates.io-index" 949 | checksum = "0160a13a177a45bfb43ce71c01580998474f556ad854dcbca936dd2841a5c556" 950 | dependencies = [ 951 | "core-foundation-sys", 952 | "libc", 953 | ] 954 | 955 | [[package]] 956 | name = "serde" 957 | version = "1.0.136" 958 | source = "registry+https://github.com/rust-lang/crates.io-index" 959 | checksum = "ce31e24b01e1e524df96f1c2fdd054405f8d7376249a5110886fb4b658484789" 960 | dependencies = [ 961 | "serde_derive", 962 | ] 963 | 964 | [[package]] 965 | name = "serde-value" 966 | version = "0.7.0" 967 | source = "registry+https://github.com/rust-lang/crates.io-index" 968 | checksum = "f3a1a3341211875ef120e117ea7fd5228530ae7e7036a779fdc9117be6b3282c" 969 | dependencies = [ 970 | "ordered-float", 971 | "serde", 972 | ] 973 | 974 | [[package]] 975 | name = "serde_derive" 976 | version = "1.0.136" 977 | source = "registry+https://github.com/rust-lang/crates.io-index" 978 | checksum = "08597e7152fcd306f41838ed3e37be9eaeed2b61c42e2117266a554fab4662f9" 979 | dependencies = [ 980 | "proc-macro2", 981 | "quote", 982 | "syn", 983 | ] 984 | 985 | [[package]] 986 | name = "serde_json" 987 | version = "1.0.79" 988 | source = "registry+https://github.com/rust-lang/crates.io-index" 989 | checksum = "8e8d9fa5c3b304765ce1fd9c4c8a3de2c8db365a5b91be52f186efc675681d95" 990 | dependencies = [ 991 | "indexmap", 992 | "itoa", 993 | "ryu", 994 | "serde", 995 | ] 996 | 997 | [[package]] 998 | name = "serde_yaml" 999 | version = "0.8.23" 1000 | source = "registry+https://github.com/rust-lang/crates.io-index" 1001 | checksum = "a4a521f2940385c165a24ee286aa8599633d162077a54bdcae2a6fd5a7bfa7a0" 1002 | dependencies = [ 1003 | "indexmap", 1004 | "ryu", 1005 | "serde", 1006 | "yaml-rust", 1007 | ] 1008 | 1009 | [[package]] 1010 | name = "signal-hook-registry" 1011 | version = "1.4.0" 1012 | source = "registry+https://github.com/rust-lang/crates.io-index" 1013 | checksum = "e51e73328dc4ac0c7ccbda3a494dfa03df1de2f46018127f60c693f2648455b0" 1014 | dependencies = [ 1015 | "libc", 1016 | ] 1017 | 1018 | [[package]] 1019 | name = "slab" 1020 | version = "0.4.5" 1021 | source = "registry+https://github.com/rust-lang/crates.io-index" 1022 | checksum = "9def91fd1e018fe007022791f865d0ccc9b3a0d5001e01aabb8b40e46000afb5" 1023 | 1024 | [[package]] 1025 | name = "socket2" 1026 | version = "0.4.4" 1027 | source = "registry+https://github.com/rust-lang/crates.io-index" 1028 | checksum = "66d72b759436ae32898a2af0a14218dbf55efde3feeb170eb623637db85ee1e0" 1029 | dependencies = [ 1030 | "libc", 1031 | "winapi", 1032 | ] 1033 | 1034 | [[package]] 1035 | name = "strsim" 1036 | version = "0.10.0" 1037 | source = "registry+https://github.com/rust-lang/crates.io-index" 1038 | checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" 1039 | 1040 | [[package]] 1041 | name = "syn" 1042 | version = "1.0.86" 1043 | source = "registry+https://github.com/rust-lang/crates.io-index" 1044 | checksum = "8a65b3f4ffa0092e9887669db0eae07941f023991ab58ea44da8fe8e2d511c6b" 1045 | dependencies = [ 1046 | "proc-macro2", 1047 | "quote", 1048 | "unicode-xid", 1049 | ] 1050 | 1051 | [[package]] 1052 | name = "tempfile" 1053 | version = "3.3.0" 1054 | source = "registry+https://github.com/rust-lang/crates.io-index" 1055 | checksum = "5cdb1ef4eaeeaddc8fbd371e5017057064af0911902ef36b39801f67cc6d79e4" 1056 | dependencies = [ 1057 | "cfg-if", 1058 | "fastrand", 1059 | "libc", 1060 | "redox_syscall", 1061 | "remove_dir_all", 1062 | "winapi", 1063 | ] 1064 | 1065 | [[package]] 1066 | name = "termcolor" 1067 | version = "1.1.2" 1068 | source = "registry+https://github.com/rust-lang/crates.io-index" 1069 | checksum = "2dfed899f0eb03f32ee8c6a0aabdb8a7949659e3466561fc0adf54e26d88c5f4" 1070 | dependencies = [ 1071 | "winapi-util", 1072 | ] 1073 | 1074 | [[package]] 1075 | name = "terminal_size" 1076 | version = "0.1.17" 1077 | source = "registry+https://github.com/rust-lang/crates.io-index" 1078 | checksum = "633c1a546cee861a1a6d0dc69ebeca693bf4296661ba7852b9d21d159e0506df" 1079 | dependencies = [ 1080 | "libc", 1081 | "winapi", 1082 | ] 1083 | 1084 | [[package]] 1085 | name = "textwrap" 1086 | version = "0.14.2" 1087 | source = "registry+https://github.com/rust-lang/crates.io-index" 1088 | checksum = "0066c8d12af8b5acd21e00547c3797fde4e8677254a7ee429176ccebbe93dd80" 1089 | 1090 | [[package]] 1091 | name = "thiserror" 1092 | version = "1.0.30" 1093 | source = "registry+https://github.com/rust-lang/crates.io-index" 1094 | checksum = "854babe52e4df1653706b98fcfc05843010039b406875930a70e4d9644e5c417" 1095 | dependencies = [ 1096 | "thiserror-impl", 1097 | ] 1098 | 1099 | [[package]] 1100 | name = "thiserror-impl" 1101 | version = "1.0.30" 1102 | source = "registry+https://github.com/rust-lang/crates.io-index" 1103 | checksum = "aa32fd3f627f367fe16f893e2597ae3c05020f8bba2666a4e6ea73d377e5714b" 1104 | dependencies = [ 1105 | "proc-macro2", 1106 | "quote", 1107 | "syn", 1108 | ] 1109 | 1110 | [[package]] 1111 | name = "tinyvec" 1112 | version = "1.5.1" 1113 | source = "registry+https://github.com/rust-lang/crates.io-index" 1114 | checksum = "2c1c1d5a42b6245520c249549ec267180beaffcc0615401ac8e31853d4b6d8d2" 1115 | dependencies = [ 1116 | "tinyvec_macros", 1117 | ] 1118 | 1119 | [[package]] 1120 | name = "tinyvec_macros" 1121 | version = "0.1.0" 1122 | source = "registry+https://github.com/rust-lang/crates.io-index" 1123 | checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" 1124 | 1125 | [[package]] 1126 | name = "tokio" 1127 | version = "1.16.1" 1128 | source = "registry+https://github.com/rust-lang/crates.io-index" 1129 | checksum = "0c27a64b625de6d309e8c57716ba93021dccf1b3b5c97edd6d3dd2d2135afc0a" 1130 | dependencies = [ 1131 | "libc", 1132 | "mio", 1133 | "num_cpus", 1134 | "once_cell", 1135 | "pin-project-lite", 1136 | "signal-hook-registry", 1137 | "tokio-macros", 1138 | "winapi", 1139 | ] 1140 | 1141 | [[package]] 1142 | name = "tokio-io-timeout" 1143 | version = "1.2.0" 1144 | source = "registry+https://github.com/rust-lang/crates.io-index" 1145 | checksum = "30b74022ada614a1b4834de765f9bb43877f910cc8ce4be40e89042c9223a8bf" 1146 | dependencies = [ 1147 | "pin-project-lite", 1148 | "tokio", 1149 | ] 1150 | 1151 | [[package]] 1152 | name = "tokio-macros" 1153 | version = "1.7.0" 1154 | source = "registry+https://github.com/rust-lang/crates.io-index" 1155 | checksum = "b557f72f448c511a979e2564e55d74e6c4432fc96ff4f6241bc6bded342643b7" 1156 | dependencies = [ 1157 | "proc-macro2", 1158 | "quote", 1159 | "syn", 1160 | ] 1161 | 1162 | [[package]] 1163 | name = "tokio-native-tls" 1164 | version = "0.3.0" 1165 | source = "registry+https://github.com/rust-lang/crates.io-index" 1166 | checksum = "f7d995660bd2b7f8c1568414c1126076c13fbb725c40112dc0120b78eb9b717b" 1167 | dependencies = [ 1168 | "native-tls", 1169 | "tokio", 1170 | ] 1171 | 1172 | [[package]] 1173 | name = "tokio-util" 1174 | version = "0.6.9" 1175 | source = "registry+https://github.com/rust-lang/crates.io-index" 1176 | checksum = "9e99e1983e5d376cd8eb4b66604d2e99e79f5bd988c3055891dcd8c9e2604cc0" 1177 | dependencies = [ 1178 | "bytes", 1179 | "futures-core", 1180 | "futures-sink", 1181 | "log", 1182 | "pin-project-lite", 1183 | "tokio", 1184 | ] 1185 | 1186 | [[package]] 1187 | name = "tower" 1188 | version = "0.4.11" 1189 | source = "registry+https://github.com/rust-lang/crates.io-index" 1190 | checksum = "5651b5f6860a99bd1adb59dbfe1db8beb433e73709d9032b413a77e2fb7c066a" 1191 | dependencies = [ 1192 | "futures-core", 1193 | "futures-util", 1194 | "pin-project", 1195 | "pin-project-lite", 1196 | "tokio", 1197 | "tokio-util", 1198 | "tower-layer", 1199 | "tower-service", 1200 | "tracing", 1201 | ] 1202 | 1203 | [[package]] 1204 | name = "tower-http" 1205 | version = "0.2.2" 1206 | source = "registry+https://github.com/rust-lang/crates.io-index" 1207 | checksum = "33ed53e1fd082268841975cb39587fa9fca9a7a30da84f97818ef667c97f2872" 1208 | dependencies = [ 1209 | "base64", 1210 | "bitflags", 1211 | "bytes", 1212 | "futures-core", 1213 | "futures-util", 1214 | "http", 1215 | "http-body", 1216 | "http-range-header", 1217 | "pin-project-lite", 1218 | "tower-layer", 1219 | "tower-service", 1220 | "tracing", 1221 | ] 1222 | 1223 | [[package]] 1224 | name = "tower-layer" 1225 | version = "0.3.1" 1226 | source = "registry+https://github.com/rust-lang/crates.io-index" 1227 | checksum = "343bc9466d3fe6b0f960ef45960509f84480bf4fd96f92901afe7ff3df9d3a62" 1228 | 1229 | [[package]] 1230 | name = "tower-service" 1231 | version = "0.3.1" 1232 | source = "registry+https://github.com/rust-lang/crates.io-index" 1233 | checksum = "360dfd1d6d30e05fda32ace2c8c70e9c0a9da713275777f5a4dbb8a1893930c6" 1234 | 1235 | [[package]] 1236 | name = "tracing" 1237 | version = "0.1.30" 1238 | source = "registry+https://github.com/rust-lang/crates.io-index" 1239 | checksum = "2d8d93354fe2a8e50d5953f5ae2e47a3fc2ef03292e7ea46e3cc38f549525fb9" 1240 | dependencies = [ 1241 | "cfg-if", 1242 | "log", 1243 | "pin-project-lite", 1244 | "tracing-attributes", 1245 | "tracing-core", 1246 | ] 1247 | 1248 | [[package]] 1249 | name = "tracing-attributes" 1250 | version = "0.1.19" 1251 | source = "registry+https://github.com/rust-lang/crates.io-index" 1252 | checksum = "8276d9a4a3a558d7b7ad5303ad50b53d58264641b82914b7ada36bd762e7a716" 1253 | dependencies = [ 1254 | "proc-macro2", 1255 | "quote", 1256 | "syn", 1257 | ] 1258 | 1259 | [[package]] 1260 | name = "tracing-core" 1261 | version = "0.1.22" 1262 | source = "registry+https://github.com/rust-lang/crates.io-index" 1263 | checksum = "03cfcb51380632a72d3111cb8d3447a8d908e577d31beeac006f836383d29a23" 1264 | dependencies = [ 1265 | "lazy_static", 1266 | ] 1267 | 1268 | [[package]] 1269 | name = "try-lock" 1270 | version = "0.2.3" 1271 | source = "registry+https://github.com/rust-lang/crates.io-index" 1272 | checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642" 1273 | 1274 | [[package]] 1275 | name = "unicode-bidi" 1276 | version = "0.3.7" 1277 | source = "registry+https://github.com/rust-lang/crates.io-index" 1278 | checksum = "1a01404663e3db436ed2746d9fefef640d868edae3cceb81c3b8d5732fda678f" 1279 | 1280 | [[package]] 1281 | name = "unicode-normalization" 1282 | version = "0.1.19" 1283 | source = "registry+https://github.com/rust-lang/crates.io-index" 1284 | checksum = "d54590932941a9e9266f0832deed84ebe1bf2e4c9e4a3554d393d18f5e854bf9" 1285 | dependencies = [ 1286 | "tinyvec", 1287 | ] 1288 | 1289 | [[package]] 1290 | name = "unicode-width" 1291 | version = "0.1.9" 1292 | source = "registry+https://github.com/rust-lang/crates.io-index" 1293 | checksum = "3ed742d4ea2bd1176e236172c8429aaf54486e7ac098db29ffe6529e0ce50973" 1294 | 1295 | [[package]] 1296 | name = "unicode-xid" 1297 | version = "0.2.2" 1298 | source = "registry+https://github.com/rust-lang/crates.io-index" 1299 | checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3" 1300 | 1301 | [[package]] 1302 | name = "url" 1303 | version = "2.2.2" 1304 | source = "registry+https://github.com/rust-lang/crates.io-index" 1305 | checksum = "a507c383b2d33b5fc35d1861e77e6b383d158b2da5e14fe51b83dfedf6fd578c" 1306 | dependencies = [ 1307 | "form_urlencoded", 1308 | "idna", 1309 | "matches", 1310 | "percent-encoding", 1311 | ] 1312 | 1313 | [[package]] 1314 | name = "vcpkg" 1315 | version = "0.2.15" 1316 | source = "registry+https://github.com/rust-lang/crates.io-index" 1317 | checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" 1318 | 1319 | [[package]] 1320 | name = "version_check" 1321 | version = "0.9.4" 1322 | source = "registry+https://github.com/rust-lang/crates.io-index" 1323 | checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" 1324 | 1325 | [[package]] 1326 | name = "want" 1327 | version = "0.3.0" 1328 | source = "registry+https://github.com/rust-lang/crates.io-index" 1329 | checksum = "1ce8a968cb1cd110d136ff8b819a556d6fb6d919363c61534f6860c7eb172ba0" 1330 | dependencies = [ 1331 | "log", 1332 | "try-lock", 1333 | ] 1334 | 1335 | [[package]] 1336 | name = "wasi" 1337 | version = "0.10.2+wasi-snapshot-preview1" 1338 | source = "registry+https://github.com/rust-lang/crates.io-index" 1339 | checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" 1340 | 1341 | [[package]] 1342 | name = "winapi" 1343 | version = "0.3.9" 1344 | source = "registry+https://github.com/rust-lang/crates.io-index" 1345 | checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" 1346 | dependencies = [ 1347 | "winapi-i686-pc-windows-gnu", 1348 | "winapi-x86_64-pc-windows-gnu", 1349 | ] 1350 | 1351 | [[package]] 1352 | name = "winapi-i686-pc-windows-gnu" 1353 | version = "0.4.0" 1354 | source = "registry+https://github.com/rust-lang/crates.io-index" 1355 | checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" 1356 | 1357 | [[package]] 1358 | name = "winapi-util" 1359 | version = "0.1.5" 1360 | source = "registry+https://github.com/rust-lang/crates.io-index" 1361 | checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" 1362 | dependencies = [ 1363 | "winapi", 1364 | ] 1365 | 1366 | [[package]] 1367 | name = "winapi-x86_64-pc-windows-gnu" 1368 | version = "0.4.0" 1369 | source = "registry+https://github.com/rust-lang/crates.io-index" 1370 | checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" 1371 | 1372 | [[package]] 1373 | name = "yaml-rust" 1374 | version = "0.4.5" 1375 | source = "registry+https://github.com/rust-lang/crates.io-index" 1376 | checksum = "56c1936c4cc7a1c9ab21a1ebb602eb942ba868cbd44a99cb7cdc5892335e1c85" 1377 | dependencies = [ 1378 | "linked-hash-map", 1379 | ] 1380 | 1381 | [[package]] 1382 | name = "zeroize" 1383 | version = "1.5.2" 1384 | source = "registry+https://github.com/rust-lang/crates.io-index" 1385 | checksum = "7c88870063c39ee00ec285a2f8d6a966e5b6fb2becc4e8dac77ed0d370ed6006" 1386 | -------------------------------------------------------------------------------- /Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "kuby" 3 | version = "0.0.0-development" 4 | description = "Kubernetes config helpers and utilities." 5 | edition = "2021" 6 | 7 | [dependencies] 8 | clap = { version = "3.0.14", features = ["derive"] } 9 | colored = "2.0.0" 10 | dialoguer = "0.9.0" 11 | dirs = "4.0.0" 12 | k8s-openapi = { version = "0.14.0", features = ["v1_22"] } 13 | kube = { version = "0.69.0" } 14 | openssl-sys = "0.9.72" 15 | serde = "1.0" 16 | serde_yaml = "0.8" 17 | tokio = { version = "1.16.1", features = ["rt-multi-thread", "macros"] } 18 | 19 | [target.'cfg(all(target_arch = "aarch64", target_os = "macos"))'.dependencies] 20 | openssl-sys = { version = "0.9.72", features = ["vendored"] } 21 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # kubernetes-helpers [kuby] 2 | 3 | This is a command line helper for kubernetes. 4 | It does provide some helping commands and eases up deployments. 5 | 6 | ### Install 7 | 8 | Download the executable for your system from the releases page. 9 | Put it into a suitable place and for unix based systems, 10 | make it executable. 11 | 12 | ### Usage 13 | 14 | `kuby` -> Prints the help. 15 | 16 | Please read the usage help to get along with the tool :) 17 | 18 | Each command can be inspected by adding `--help` to the command. 19 | -------------------------------------------------------------------------------- /renovate.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://docs.renovatebot.com/renovate-schema.json", 3 | "extends": ["github>buehler/renovate-config"] 4 | } 5 | -------------------------------------------------------------------------------- /src/commands/context.rs: -------------------------------------------------------------------------------- 1 | use colored::Colorize; 2 | use dialoguer::theme::ColorfulTheme; 3 | use dialoguer::Select; 4 | 5 | use crate::kubeconfig::{load, save}; 6 | 7 | pub async fn context(name: &Option) -> Result<(), Box> { 8 | let mut config = load()?; 9 | let contexts: Vec = config.contexts.iter().map(|c| c.name.to_string()).collect(); 10 | let current_context = config.current_context.unwrap_or_else(|| "".to_string()); 11 | 12 | let new_context = match name { 13 | Some(name) => name.to_string(), 14 | None => { 15 | let selected = Select::with_theme(&ColorfulTheme::default()) 16 | .with_prompt(format!( 17 | "Select new context (current: {})", 18 | current_context.green() 19 | )) 20 | .default(0) 21 | .items(&contexts) 22 | .interact()?; 23 | contexts 24 | .get(selected) 25 | .unwrap_or(&"".to_string()) 26 | .to_string() 27 | } 28 | }; 29 | 30 | if current_context == new_context { 31 | println!("{} is already set as context.", current_context.green()); 32 | return Ok(()); 33 | } 34 | 35 | println!("Set {} as active context.", new_context.green()); 36 | config.current_context = Some(new_context); 37 | save(&config)?; 38 | 39 | Ok(()) 40 | } 41 | -------------------------------------------------------------------------------- /src/commands/mod.rs: -------------------------------------------------------------------------------- 1 | use clap::Subcommand; 2 | 3 | pub mod context; 4 | pub mod namespace; 5 | 6 | const CONTEXT_LONG_ABOUT: &str = r#"This command lets you switch your current Kubernetes context. 7 | When you provide a new context (via the name attribute) the new context 8 | is directly selected if possible. If you omit the name, 9 | a list of avilabile contexts is shown and you can select one."#; 10 | const NAMESPACE_LONG_ABOUT: &str = r#"This command lets you switch your current Kubernetes namespace. 11 | When you provide a new namespace (via the name attribute) the new namespace 12 | is directly selected if possible. If you omit the name, 13 | a list of avilabile namespaces is shown and you can select one."#; 14 | 15 | #[derive(Subcommand)] 16 | pub enum Commands { 17 | #[clap(about = "Directly switch a context or show a list of available context", long_about = CONTEXT_LONG_ABOUT)] 18 | #[clap(visible_alias = "ctx", visible_alias = "c")] 19 | Context { 20 | /// The new context to switch to. 21 | name: Option, 22 | }, 23 | #[clap(about = "Directly switch a namespace or show a list of available namespaces", long_about = NAMESPACE_LONG_ABOUT)] 24 | #[clap(visible_alias = "ns", visible_alias = "n")] 25 | Namespace { 26 | /// The new namespace to switch to. 27 | name: Option, 28 | }, 29 | } 30 | -------------------------------------------------------------------------------- /src/commands/namespace.rs: -------------------------------------------------------------------------------- 1 | use colored::Colorize; 2 | use dialoguer::theme::ColorfulTheme; 3 | use dialoguer::Select; 4 | use k8s_openapi::api::core::v1::Namespace; 5 | use kube::api::ListParams; 6 | use kube::{Api, Client}; 7 | 8 | use crate::kubeconfig::{load, save}; 9 | 10 | pub async fn namespace(name: &Option) -> Result<(), Box> { 11 | let mut config = load()?; 12 | let default_context = "".to_string(); 13 | let current_context_name = config.current_context.as_ref().unwrap_or(&default_context); 14 | let current_namespace = config 15 | .contexts 16 | .iter() 17 | .find(|&ctx| ctx.name == *current_context_name) 18 | .expect("No context with name found.") 19 | .clone() 20 | .context 21 | .namespace 22 | .unwrap_or_else(|| "default".to_string()); 23 | 24 | let new_namespace = match name { 25 | Some(name) => name.to_string(), 26 | None => { 27 | let client = Client::try_default().await?; 28 | let namespaces: Api = Api::all(client); 29 | let mut namespace_names = Vec::new(); 30 | 31 | for ns in namespaces.list(&ListParams::default()).await? { 32 | match ns.metadata.name { 33 | None => continue, 34 | Some(name) => namespace_names.push(name), 35 | } 36 | } 37 | 38 | let selected = Select::with_theme(&ColorfulTheme::default()) 39 | .with_prompt(format!( 40 | "Select new namespace (current: {})", 41 | current_namespace.green() 42 | )) 43 | .default(0) 44 | .items(&namespace_names) 45 | .interact()?; 46 | namespace_names 47 | .get(selected) 48 | .unwrap_or(&"".to_string()) 49 | .to_string() 50 | } 51 | }; 52 | 53 | if current_namespace == new_namespace { 54 | println!("{} is already set as namespace.", current_namespace.green()); 55 | return Ok(()); 56 | } 57 | 58 | println!("Set {} as active namespace.", new_namespace.green()); 59 | 60 | let mut new_contexts = Vec::new(); 61 | for mut ctx in config.contexts { 62 | if ctx.name != *current_context_name { 63 | new_contexts.push(ctx); 64 | continue; 65 | } 66 | 67 | ctx.context.namespace = Some(new_namespace.to_string()); 68 | new_contexts.push(ctx); 69 | } 70 | 71 | config.contexts = new_contexts; 72 | save(&config)?; 73 | 74 | Ok(()) 75 | } 76 | -------------------------------------------------------------------------------- /src/kubeconfig.rs: -------------------------------------------------------------------------------- 1 | use std::fs::File; 2 | use std::io::Write; 3 | use std::path::PathBuf; 4 | 5 | use kube::config::{Kubeconfig, KubeconfigError}; 6 | 7 | pub fn load() -> Result { 8 | Kubeconfig::read() 9 | } 10 | 11 | pub fn save(config: &Kubeconfig) -> Result<(), Box> { 12 | let yaml = serde_yaml::to_string(&config)?; 13 | let mut file = File::create(default_kube_path().expect("No default config path available."))?; 14 | file.write_all(yaml.as_bytes())?; 15 | 16 | Ok(()) 17 | } 18 | 19 | fn default_kube_path() -> Option { 20 | use dirs::home_dir; 21 | home_dir().map(|h| h.join(".kube").join("config")) 22 | } 23 | -------------------------------------------------------------------------------- /src/main.rs: -------------------------------------------------------------------------------- 1 | use clap::{AppSettings, Parser}; 2 | 3 | use crate::commands::context::context; 4 | use crate::commands::namespace::namespace; 5 | use crate::commands::Commands; 6 | 7 | mod commands; 8 | mod kubeconfig; 9 | 10 | #[derive(Parser)] 11 | #[clap(version, about, long_about = None)] 12 | #[clap(global_setting(AppSettings::PropagateVersion))] 13 | #[clap(global_setting(AppSettings::UseLongFormatForHelpSubcommand))] 14 | struct Cli { 15 | #[clap(subcommand)] 16 | command: Commands, 17 | } 18 | 19 | #[tokio::main] 20 | async fn main() -> Result<(), Box> { 21 | let cli = Cli::parse(); 22 | 23 | match &cli.command { 24 | Commands::Context { name } => context(name).await?, 25 | Commands::Namespace { name } => namespace(name).await?, 26 | } 27 | 28 | Ok(()) 29 | } 30 | --------------------------------------------------------------------------------