Skip to content

Feature port forward range #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 47 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
368cb0a
Update hash generation (#108)
DaanHoogland Apr 20, 2024
e4c9861
[StepSecurity] ci: Harden GitHub Actions (#103)
step-security-bot Apr 26, 2024
ae7858c
chore(deps): update terraform sdk version
fabiomatavelli Mar 15, 2024
53f5191
chore: implement muxing for terraform sdk
fabiomatavelli Mar 15, 2024
5735094
ci: update go version
fabiomatavelli Mar 15, 2024
daca688
chore: add tagsToMap function
fabiomatavelli Mar 15, 2024
ae01a55
chore(deps): update cloudstack sdk to v2.15.0
fabiomatavelli Mar 15, 2024
aa872a3
chore: remove partials
fabiomatavelli Mar 15, 2024
b89c9f4
chore(tests): migrate to terraform-plugin-testing
fabiomatavelli Mar 15, 2024
86843ef
chore(tests): remove ExpectNonEmptyPlan
fabiomatavelli Mar 15, 2024
fd0731e
chore(tests): fixes indexes on TypeSet
fabiomatavelli Mar 15, 2024
81e5c55
ci: use go.mod to get go version
fabiomatavelli Mar 15, 2024
99ecdd4
ci: test multiple versions of terraform
fabiomatavelli Mar 15, 2024
1e1e211
chore(deps): update cloudstack sdk to v2.16.0
fabiomatavelli Mar 15, 2024
3bf94b7
ci: changes trigger for acceptance test
fabiomatavelli Mar 15, 2024
252e0b3
chore(tests): change hcl syntax
fabiomatavelli Mar 15, 2024
1edf0cf
fix: set vlan in private network
fabiomatavelli Mar 15, 2024
ce542ca
chore(tests): add display_text in cloudstack_network test to support …
fabiomatavelli Mar 15, 2024
14c382f
ci: ignore branch main on acceptance test
fabiomatavelli Mar 15, 2024
c4f792b
ci: remove branch restriction
fabiomatavelli Mar 15, 2024
1e6c4ba
chore(tests): fix network test
fabiomatavelli Mar 16, 2024
bed0afc
ci: fix trigger paths
fabiomatavelli Mar 16, 2024
ac95b5d
ci: update terraform action to v3
fabiomatavelli Mar 16, 2024
3e4f2ff
chore(tests): add mux server test
fabiomatavelli Mar 17, 2024
ccdd042
docs: update readme
fabiomatavelli Mar 17, 2024
9992df1
ci: remove eol terraform versions
fabiomatavelli Apr 26, 2024
348c1f3
ci: update cloustack versions
fabiomatavelli Apr 26, 2024
f247d09
ci: add terraform 1.8
fabiomatavelli Apr 26, 2024
5a612ad
ci: add reusable cloudstack-setup action
fabiomatavelli Apr 26, 2024
31903b5
ci: add opentofu acceptance test
fabiomatavelli Apr 27, 2024
4526a7b
ci: update actions
fabiomatavelli Apr 27, 2024
a2db5e1
ci: add final job
fabiomatavelli Apr 27, 2024
25d50d7
ci: add final job
fabiomatavelli Apr 27, 2024
2033b3f
fix: tests indentation
fabiomatavelli Jun 14, 2024
8e2b79f
chore: sets displaytext as name when null
fabiomatavelli Jun 14, 2024
05dc88b
Merge pull request #71 from fabiomatavelli/feature/update-sdk
kiranchavala Jun 21, 2024
5cc00a5
Update README.md
rohityadavcloud Jul 2, 2024
849dd54
Bump github.com/apache/cloudstack-go/v2 from 2.13.2 to 2.16.1 (#119)
dependabot[bot] Jul 2, 2024
b16c94f
chore: protect main branch with mandatory checks (#123)
fabiomatavelli Jul 2, 2024
37ebe49
ci: runs acc test on every change (#127)
fabiomatavelli Jul 2, 2024
bf3bcec
Update .asf.yaml (#128)
rohityadavcloud Jul 2, 2024
e6bcc74
feat: migrate to terraform plugin framework (#113)
fabiomatavelli Jul 25, 2024
3cb0d3a
ci: update terraform, opentofu and cloudstack versions (#130)
fabiomatavelli Jul 30, 2024
997dbb2
Fix: #117 - Allow Multiple SSH Keypairs (#122)
CodeBleu Jul 30, 2024
02058b4
fix: remove user-data conditional (#121)
fabiomatavelli Jul 30, 2024
a653531
added domainid parameter to account resource (#136)
kiranchavala Oct 20, 2024
84d4128
cloudstack: add port range support for port forwarding rules (#157)
mhdsulaimzed Jan 1, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .asf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,15 @@ github:
issues: true
projects: true

protected_branches:
main:
required_status_checks:
contexts:
- build
- all-jobs-passed

collaborators:
- kiranchavala
- vishesh92
- fabiomatavelli
- CodeBleu
130 changes: 130 additions & 0 deletions .github/workflows/acceptance.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.

name: Acceptance Test

on:
pull_request:
push:

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}-acceptance
cancel-in-progress: true

permissions:
contents: read

env:
CLOUDSTACK_API_URL: http://localhost:8080/client/api
CLOUDSTACK_VERSIONS: "['4.18.2.1', '4.19.0.2']"

jobs:
prepare-matrix:
runs-on: ubuntu-latest
outputs:
cloudstack-versions: ${{ steps.set-versions.outputs.cloudstack-versions }}
steps:
- name: Set versions
id: set-versions
run: |
echo "cloudstack-versions=${{ env.CLOUDSTACK_VERSIONS }}" >> $GITHUB_OUTPUT

acceptance-terraform:
name: Terraform ${{ matrix.terraform-version }} with Cloudstack ${{ matrix.cloudstack-version }}
needs: [prepare-matrix]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
- name: Configure Cloudstack v${{ matrix.cloudstack-version }}
uses: ./.github/workflows/setup-cloudstack
id: setup-cloudstack
with:
cloudstack-version: ${{ matrix.cloudstack-version }}
- uses: hashicorp/setup-terraform@v3
with:
terraform_version: ${{ matrix.terraform-version }}
terraform_wrapper: false
- name: Run acceptance test
env:
CLOUDSTACK_USER_ID: ${{ steps.setup-cloudstack.outputs.CLOUDSTACK_USER_ID }}
CLOUDSTACK_API_KEY: ${{ steps.setup-cloudstack.outputs.CLOUDSTACK_API_KEY }}
CLOUDSTACK_SECRET_KEY: ${{ steps.setup-cloudstack.outputs.CLOUDSTACK_SECRET_KEY }}
run: |
make testacc
services:
cloudstack-simulator:
image: apache/cloudstack-simulator:${{ matrix.cloudstack-version }}
ports:
- 8080:5050
strategy:
fail-fast: false
matrix:
terraform-version:
- '1.8.*'
- '1.9.*'
cloudstack-version: ${{ fromJson(needs.prepare-matrix.outputs.cloudstack-versions) }}

acceptance-opentofu:
name: OpenTofu ${{ matrix.opentofu-version }} with Cloudstack ${{ matrix.cloudstack-version }}
needs: [prepare-matrix]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
- name: Configure Cloudstack v${{ matrix.cloudstack-version }}
uses: ./.github/workflows/setup-cloudstack
id: setup-cloudstack
with:
cloudstack-version: ${{ matrix.cloudstack-version }}
- uses: opentofu/setup-opentofu@v1
with:
tofu_version: ${{ matrix.opentofu-version }}
- name: Run acceptance test
env:
CLOUDSTACK_USER_ID: ${{ steps.setup-cloudstack.outputs.CLOUDSTACK_USER_ID }}
CLOUDSTACK_API_KEY: ${{ steps.setup-cloudstack.outputs.CLOUDSTACK_API_KEY }}
CLOUDSTACK_SECRET_KEY: ${{ steps.setup-cloudstack.outputs.CLOUDSTACK_SECRET_KEY }}
run: |
make testacc
services:
cloudstack-simulator:
image: apache/cloudstack-simulator:${{ matrix.cloudstack-version }}
ports:
- 8080:5050
strategy:
fail-fast: false
matrix:
opentofu-version:
- '1.6.*'
- '1.7.*'
cloudstack-version: ${{ fromJson(needs.prepare-matrix.outputs.cloudstack-versions) }}

all-jobs-passed: # Will succeed if it is skipped
runs-on: ubuntu-latest
needs: [acceptance-terraform, acceptance-opentofu]
# Only run if any of the previous jobs failed
if: ${{ failure() }}
steps:
- name: Previous jobs failed
run: exit 1
32 changes: 17 additions & 15 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,22 +22,24 @@ on: [push, pull_request]
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

permissions:
contents: read

jobs:
build:
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v3

- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.19.x
- name: Build
run: |
make build
- name: Test
run: make test
- uses: actions/checkout@v3

- name: Set up Go
uses: actions/setup-go@v3
with:
go-version-file: 'go.mod'

- name: Build
run: |
make build

- name: Test
run: make test
83 changes: 83 additions & 0 deletions .github/workflows/setup-cloudstack/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.

name: Setup Cloudstack

inputs:
cloudstack-version:
description: 'Cloudstack version'
required: true
outputs:
CLOUDSTACK_USER_ID:
description: 'Cloudstack user id'
value: ${{ steps.setup-cloudstack.outputs.user_id }}
CLOUDSTACK_API_KEY:
description: 'Cloudstack api key'
value: ${{ steps.setup-cloudstack.outputs.api_key }}
CLOUDSTACK_SECRET_KEY:
description: 'Cloudstack secret key'
value: ${{ steps.setup-cloudstack.outputs.secret_key }}
CLOUDSTACK_API_URL:
description: 'Cloudstack API URL'
value: http://localhost:8080/client/api

runs:
using: composite
steps:
- name: Wait Cloudstack to be ready
shell: bash
run: |
echo "Starting Cloudstack health check"
T=0
until [ $T -gt 20 ] || curl -sfL http://localhost:8080 --output /dev/null
do
echo "Waiting for Cloudstack to be ready..."
((T+=1))
sleep 30
done
- name: Setting up Cloudstack
id: setup-cloudstack
shell: bash
run: |
docker exec $(docker container ls --format=json -l | jq -r .ID) python /root/tools/marvin/marvin/deployDataCenter.py -i /root/setup/dev/advanced.cfg
curl -sf --location "${CLOUDSTACK_API_URL}" \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'command=login' \
--data-urlencode 'username=admin' \
--data-urlencode 'password=password' \
--data-urlencode 'response=json' \
--data-urlencode 'domain=/' -j -c cookies.txt --output /dev/null

CLOUDSTACK_USER_ID=$(curl -fs "${CLOUDSTACK_API_URL}?command=listUsers&response=json" -b cookies.txt | jq -r '.listusersresponse.user[0].id')
CLOUDSTACK_API_KEY=$(curl -s "${CLOUDSTACK_API_URL}?command=getUserKeys&id=${CLOUDSTACK_USER_ID}&response=json" -b cookies.txt | jq -r '.getuserkeysresponse.userkeys.apikey')
CLOUDSTACK_SECRET_KEY=$(curl -fs "${CLOUDSTACK_API_URL}?command=getUserKeys&id=${CLOUDSTACK_USER_ID}&response=json" -b cookies.txt | jq -r '.getuserkeysresponse.userkeys.secretkey')

echo "::add-mask::$CLOUDSTACK_API_KEY"
echo "::add-mask::$CLOUDSTACK_SECRET_KEY"

echo "user_id=$CLOUDSTACK_USER_ID" >> $GITHUB_OUTPUT
echo "api_key=$CLOUDSTACK_API_KEY" >> $GITHUB_OUTPUT
echo "secret_key=$CLOUDSTACK_SECRET_KEY" >> $GITHUB_OUTPUT
- name: Install CMK
shell: bash
run: |
curl -sfL https://github.com/apache/cloudstack-cloudmonkey/releases/download/6.3.0/cmk.linux.x86-64 -o /usr/local/bin/cmk
chmod +x /usr/local/bin/cmk
- name: Create extra resources
shell: bash
run: |
cmk -u $CLOUDSTACK_API_URL -k $CLOUDSTACK_API_KEY -s $CLOUDSTACK_SECRET_KEY -o json create project name=terraform displaytext=terraform
90 changes: 0 additions & 90 deletions .github/workflows/testacc.yml

This file was deleted.

Loading