Skip to content
This repository has been archived by the owner on Jun 22, 2024. It is now read-only.

Commit

Permalink
fix: fixed kubeadmin issue (#16)
Browse files Browse the repository at this point in the history
* fix: fixed kubeadmin issue

* ci: fixed missing contex

* ci: updated svu version

* ci: updated release preview

* ci: more updates

* chore: ready for merge
  • Loading branch information
karl-cardenas-coding authored Oct 21, 2023
1 parent ed48e3c commit 283bd85
Show file tree
Hide file tree
Showing 6 changed files with 114 additions and 29 deletions.
11 changes: 8 additions & 3 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ permissions:

env:
GITHUB_TOKEN: ${{ github.token }}
SVU_VERSION: 1.10.2
SVU_VERSION: 1.11.0

jobs:
tag:
Expand Down Expand Up @@ -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' }}
Expand All @@ -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
Expand Down
86 changes: 83 additions & 3 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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

Expand All @@ -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]
Expand All @@ -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

Expand All @@ -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
Expand Down
34 changes: 17 additions & 17 deletions deployment/terraform/.terraform.lock.hcl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions deployment/terraform/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

| Name | Version |
|------|---------|
| <a name="requirement_random"></a> [random](#requirement\_random) | >= 3.5.0 |
| <a name="requirement_spectrocloud"></a> [spectrocloud](#requirement\_spectrocloud) | >= 0.14.0 |
| <a name="requirement_random"></a> [random](#requirement\_random) | >= 3.5.1 |
| <a name="requirement_spectrocloud"></a> [spectrocloud](#requirement\_spectrocloud) | >= 0.16.0 |

## Providers

| Name | Version |
|------|---------|
| <a name="provider_random"></a> [random](#provider\_random) | 3.5.1 |
| <a name="provider_spectrocloud"></a> [spectrocloud](#provider\_spectrocloud) | 0.14.0 |
| <a name="provider_spectrocloud"></a> [spectrocloud](#provider\_spectrocloud) | 0.16.0 |

## Modules

Expand Down Expand Up @@ -38,7 +38,7 @@ No modules.
| <a name="input_cluster-group-name"></a> [cluster-group-name](#input\_cluster-group-name) | The name of the cluster group to use for the virtual cluster | `string` | `"beehive"` | no |
| <a name="input_cluster_name"></a> [cluster\_name](#input\_cluster\_name) | The name of the cluster to create. | `string` | `"cluster-1"` | no |
| <a name="input_cluster_resources"></a> [cluster\_resources](#input\_cluster\_resources) | The resources to allocate to the virtual cluster | <pre>map(object({<br> max_cpu = number<br> max_mem_in_mb = number<br> min_cpu = number<br> min_mem_in_mb = number<br> max_storage_in_gb = string<br> min_storage_in_gb = string<br> }))</pre> | <pre>{<br> "resources": {<br> "max_cpu": 6,<br> "max_mem_in_mb": 6144,<br> "max_storage_in_gb": "6",<br> "min_cpu": 0,<br> "min_mem_in_mb": 0,<br> "min_storage_in_gb": "0"<br> }<br>}</pre> | no |
| <a name="input_image"></a> [image](#input\_image) | The Spectromate image to deploy. | `string` | `"ghcr.io/spectrocloud/spectromate:v1.0.1"` | no |
| <a name="input_image"></a> [image](#input\_image) | The Spectromate image to deploy. | `string` | `"ghcr.io/spectrocloud/spectromate:v1.0.2"` | no |
| <a name="input_mendable_api_key"></a> [mendable\_api\_key](#input\_mendable\_api\_key) | The value of the Mendable API Key. Set using TF\_VAR environment variable. | `string` | n/a | yes |
| <a name="input_project"></a> [project](#input\_project) | The name of the Spectro Cloud project to use. | `string` | `"Default"` | no |
| <a name="input_redis_database_volume_size"></a> [redis\_database\_volume\_size](#input\_redis\_database\_volume\_size) | The size of the Redis database volume in GiB. | `string` | `"3"` | no |
Expand Down
2 changes: 1 addition & 1 deletion deployment/terraform/output.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion deployment/terraform/provider.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
terraform {
required_providers {
spectrocloud = {
version = ">= 0.15.0"
version = ">= 0.16.0"
source = "spectrocloud/spectrocloud"
}
random = {
Expand Down

0 comments on commit 283bd85

Please sign in to comment.