From 283bd859d6bc8246abe5ef92ec6eec6ff7ec2c26 Mon Sep 17 00:00:00 2001 From: Karl Cardenas Date: Sat, 21 Oct 2023 16:31:14 -0700 Subject: [PATCH] fix: fixed kubeadmin issue (#16) * fix: fixed kubeadmin issue * ci: fixed missing contex * ci: updated svu version * ci: updated release preview * ci: more updates * chore: ready for merge --- .github/workflows/release.yaml | 11 ++- .github/workflows/test.yaml | 86 +++++++++++++++++++++++- deployment/terraform/.terraform.lock.hcl | 34 +++++----- deployment/terraform/README.md | 8 +-- deployment/terraform/output.tf | 2 +- deployment/terraform/provider.tf | 2 +- 6 files changed, 114 insertions(+), 29 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 3b7a0d9..53fd52a 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -12,7 +12,7 @@ permissions: env: GITHUB_TOKEN: ${{ github.token }} - SVU_VERSION: 1.10.2 + SVU_VERSION: 1.11.0 jobs: tag: @@ -64,6 +64,7 @@ jobs: echo "VERSION=$VERSION" >> $GITHUB_OUTPUT echo "PREV_VERSION=$PREV_VERSION" >> $GITHUB_OUTPUT + goreleaser: needs: [tag] if: ${{ needs.tag.outputs.SAME_VERSION == 'false' }} @@ -78,10 +79,14 @@ jobs: fetch-depth: 0 - run: git fetch --force --tags + - uses: actions/setup-go@v4 with: - check-latest: true - - uses: goreleaser/goreleaser-action@v4 + go-version: '1.21' + check-latest: true + + + - uses: goreleaser/goreleaser-action@v5 with: distribution: goreleaser args: release --clean diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 6728e6a..85a437f 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -10,6 +10,7 @@ env: GITHUB_TOKEN: ${{ github.token }} MENDABLE_API_KEY: ${{secrets.MENDABLE_API_KEY}} SLACK_SIGNING_SECRET: ${{secrets.SLACK_SIGNING_SECRET}} + SVU_VERSION: 1.11.0 concurrency: @@ -55,7 +56,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v4 with: - go-version: '1.20' + go-version: '1.21' check-latest: true id: go @@ -66,6 +67,85 @@ jobs: run: | go test -race ./... + release-preview: + needs: [run-ci] + runs-on: ubuntu-latest + + outputs: + VERSION: ${{ steps.tag.outputs.VERSION }} + PREV_VERSION: ${{ steps.tag.outputs.PREV_VERSION }} + SAME_VERSION: ${{ steps.tag.outputs.SAME_VERSION }} + + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: get-tags + run: git fetch --force --tags + + - name: Get svu + run: | + URL="https://github.com/caarlos0/svu/releases/download/v${SVU_VERSION}/svu_${SVU_VERSION}_linux_amd64.tar.gz" + wget --quiet $URL --output-document svu.tar.gz + tar -xzf svu.tar.gz + chmod +x svu + sudo mv svu /usr/local/bin/ + + - id: tag + run: | + VERSION=$(svu next --tag-mode all-branches) + PREV_VERSION=$(svu current --tag-mode all-branches) + + if [ "$VERSION" = "$PREV_VERSION" ]; then + echo "no new version detected" + SAME_VERSION=true + echo "SAME_VERSION=true" >> $GITHUB_OUTPUT + else + echo "new version detected" + SAME_VERSION=false + echo "SAME_VERSION=false" >> $GITHUB_OUTPUT + + # Check if the tag already exists before creating it + if git rev-parse "v$VERSION" >/dev/null 2>&1; then + echo "Tag v$VERSION already exists, skipping tag creation." + else + git tag "$VERSION" + git push --tags + fi + fi + + echo "VERSION=$VERSION" >> $GITHUB_OUTPUT + echo "PREV_VERSION=$PREV_VERSION" >> $GITHUB_OUTPUT + + goreleaser: + needs: [release-preview] + runs-on: ubuntu-latest + env: + GORELEASER_CURRENT_TAG: ${{ needs.tag.outputs.VERSION }} + GORELEASER_PREVIOUS_TAG: ${{ needs.tag.outputs.PREV_VERSION }} + + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - run: git fetch --force --tags + + - uses: actions/setup-go@v4 + with: + go-version: '1.21' + check-latest: true + + - uses: goreleaser/goreleaser-action@v5 + with: + distribution: goreleaser + args: release --clean --snapshot --skip-publish + version: latest + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + compile: name: Compile validation needs: [run-ci,linting] @@ -75,7 +155,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v4 with: - go-version: '1.20' + go-version: '1.21' check-latest: true id: go @@ -100,7 +180,7 @@ jobs: - uses: actions/setup-go@v4 with: - go-version: '1.20' + go-version: '1.21' check-latest: true - name: Set up QEMU diff --git a/deployment/terraform/.terraform.lock.hcl b/deployment/terraform/.terraform.lock.hcl index a1b39d9..436572a 100644 --- a/deployment/terraform/.terraform.lock.hcl +++ b/deployment/terraform/.terraform.lock.hcl @@ -21,23 +21,23 @@ provider "registry.terraform.io/hashicorp/random" { } provider "registry.terraform.io/spectrocloud/spectrocloud" { - version = "0.14.0" - constraints = ">= 0.13.0" + version = "0.16.0" + constraints = ">= 0.16.0" hashes = [ - "h1:z3PtqrferrykB6k1N6/3pdNJKEikVBhfSG98nyeaxR0=", - "zh:0abe7d29d0a0468af7dc025b858fa53390a1535576009cae6979186835abbb1b", - "zh:0f29ef59b8e524f9ae19c308f15d87afddd353daf7424e60f8dc523cd30113df", - "zh:11b415f3a0ea31fa2885e752cce752f2fc54ee62696bc8fcdd401be2dff492d8", - "zh:15592515880c7f3c2b709594d35ddadcf67acd299e6fd37e02435c4cd0d104a4", - "zh:1faaee8f2c2ce0aeeb03a3d2069bce51a2c2982f441fec01a13541236328f0ed", - "zh:20d047aee17d15e996d3db78e33cf47ff827e03d4806910a0de72d8ef64e66a8", - "zh:23cbf55220e0d4a738eddd641c816d13d9b4d170fa6c359d5569bea21d68eef3", - "zh:32a3c28c0c20f994fc0dc141727f763d7deac774b8b174510bd294746a7aa555", - "zh:52ea0795bec63d5f5519422485fab79c3454fdb258777c0cdce6580df8a147dd", - "zh:68a33a076c49a8ef850f5f7d98ce265f93f369c4369ec7d69dc8c01519c967d1", - "zh:7144a5bafb2adeadf7396cfaf15a1aaa757a5b2dfa651d60d7e6e45f4234cb39", - "zh:85d60cabeabafe9697bf8f44ba0770cdd09d56795043ee4600cca327b71e8c84", - "zh:b0a9579c51b159f23b5edabe2788989c885a3e2a9c54f7bc82f54784fd318486", - "zh:c2cb715d85166c153492c160d0c58d2095e0a761ff315c3788c0460993f0e7a5", + "h1:WmVbICMkXAx2W1Ie0Ed+dJybA7Wfs1VD+4BuJFYfuOQ=", + "zh:193b8b838dc67b0d54b950886af3bc401c34024ee2e6c246df8f7bb33884ab6f", + "zh:1d5f9092dbaef16a60e883b282485020ed466a69e18f4838f038a13432202dd1", + "zh:32736a8e1d1bdeecbc74a07cd35e8dfd61e184ea8727a46c5400953ec65921d7", + "zh:4eda07f059103639b9bb77e3102fc123fe2320a383c62ca030ec822730a1cebd", + "zh:52acf575a177bb7a91ad52915b18030c2cbe9694a260bbf5e63e1b8ba5676ecf", + "zh:69a6820ef7a8dcb8b4ef0b09635ac149874f7883ad86fc13eae0022d14bfd479", + "zh:7a1bee3166fd9a0154c1cb2576d57ddfb4c8c9d3962d069cd0e5da6115218049", + "zh:8afb9051122740562c58eb1b8f7c94e6d8d72f30e4f4dfdb8e946371e5a64fbb", + "zh:8bd9e1aa319b070ee0cfeddac67b710339d677b4965417e9dd79f25104c27cf8", + "zh:9ad3e1642e35875ad27bff116e12f699c4b4d95eac1e8d0375b0a249fbbf79dd", + "zh:a51c813f133012c134adeb290cdd75853eb9b496c206ac64dcd3c0e581a90e3e", + "zh:b4a3898d4e4d89a3af11d043db5a91852ba5bd1e10ec943a69f7a3d0cd9b637e", + "zh:bd0eee841e3aa1f19fbfe5723d5858e24e432883332c853cd5c7943915cce4f9", + "zh:f4247c256288352c676214c5029f636adbc69e9e6b76eaf5fb09120a116a197b", ] } diff --git a/deployment/terraform/README.md b/deployment/terraform/README.md index faafd0a..3d22cfe 100644 --- a/deployment/terraform/README.md +++ b/deployment/terraform/README.md @@ -2,15 +2,15 @@ | Name | Version | |------|---------| -| [random](#requirement\_random) | >= 3.5.0 | -| [spectrocloud](#requirement\_spectrocloud) | >= 0.14.0 | +| [random](#requirement\_random) | >= 3.5.1 | +| [spectrocloud](#requirement\_spectrocloud) | >= 0.16.0 | ## Providers | Name | Version | |------|---------| | [random](#provider\_random) | 3.5.1 | -| [spectrocloud](#provider\_spectrocloud) | 0.14.0 | +| [spectrocloud](#provider\_spectrocloud) | 0.16.0 | ## Modules @@ -38,7 +38,7 @@ No modules. | [cluster-group-name](#input\_cluster-group-name) | The name of the cluster group to use for the virtual cluster | `string` | `"beehive"` | no | | [cluster\_name](#input\_cluster\_name) | The name of the cluster to create. | `string` | `"cluster-1"` | no | | [cluster\_resources](#input\_cluster\_resources) | The resources to allocate to the virtual cluster |
map(object({
max_cpu = number
max_mem_in_mb = number
min_cpu = number
min_mem_in_mb = number
max_storage_in_gb = string
min_storage_in_gb = string
}))
|
{
"resources": {
"max_cpu": 6,
"max_mem_in_mb": 6144,
"max_storage_in_gb": "6",
"min_cpu": 0,
"min_mem_in_mb": 0,
"min_storage_in_gb": "0"
}
}
| no | -| [image](#input\_image) | The Spectromate image to deploy. | `string` | `"ghcr.io/spectrocloud/spectromate:v1.0.1"` | no | +| [image](#input\_image) | The Spectromate image to deploy. | `string` | `"ghcr.io/spectrocloud/spectromate:v1.0.2"` | no | | [mendable\_api\_key](#input\_mendable\_api\_key) | The value of the Mendable API Key. Set using TF\_VAR environment variable. | `string` | n/a | yes | | [project](#input\_project) | The name of the Spectro Cloud project to use. | `string` | `"Default"` | no | | [redis\_database\_volume\_size](#input\_redis\_database\_volume\_size) | The size of the Redis database volume in GiB. | `string` | `"3"` | no | diff --git a/deployment/terraform/output.tf b/deployment/terraform/output.tf index ab91900..b43d980 100644 --- a/deployment/terraform/output.tf +++ b/deployment/terraform/output.tf @@ -7,7 +7,7 @@ output "default_message" { output "kubeconfig" { - value = spectrocloud_virtual_cluster.cluster-1.kubeconfig + value = spectrocloud_virtual_cluster.cluster-1.admin_kube_config sensitive = true diff --git a/deployment/terraform/provider.tf b/deployment/terraform/provider.tf index e383e44..7daf0cf 100644 --- a/deployment/terraform/provider.tf +++ b/deployment/terraform/provider.tf @@ -4,7 +4,7 @@ terraform { required_providers { spectrocloud = { - version = ">= 0.15.0" + version = ">= 0.16.0" source = "spectrocloud/spectrocloud" } random = {