Skip to content

Commit d6e7d50

Browse files
committed
[minor_change] Add resources and data-sources for hyperfabric_fabric, hyperfabric_node, hyperfabric_device, hyperfabric_connection, hyperfabric_bind_to_node, hyperfabric_vni, hyperfabric_vrf
0 parents  commit d6e7d50

File tree

3,294 files changed

+886613
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

3,294 files changed

+886613
-0
lines changed

.github/CODEOWNERS

Whitespace-only changes.

.github/dependabot.yml

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# See GitHub's documentation for more information on this file:
2+
# https://docs.github.com/en/code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/configuration-options-for-dependency-updates
3+
version: 2
4+
updates:
5+
- package-ecosystem: "gomod"
6+
directory: "/"
7+
schedule:
8+
interval: "daily"
9+
- package-ecosystem: "github-actions"
10+
directory: "/"
11+
schedule:
12+
interval: "daily"
13+
# TODO: Dependabot only updates hashicorp GHAs in the template repository, the following lines can be removed for consumers of this template
14+
allow:
15+
- dependency-name: "hashicorp/*"

.github/workflows/checks.yml

+89
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [master]
6+
pull_request:
7+
8+
permissions:
9+
# Permission for checking out code
10+
contents: read
11+
12+
jobs:
13+
build:
14+
name: Check & Build Provider
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v4
18+
- uses: actions/setup-go@v5
19+
with:
20+
go-version-file: 'go.mod'
21+
- run: chmod +x ./scripts/gofmtcheck.sh
22+
- name: gofmt Check
23+
run: ./scripts/gofmtcheck.sh
24+
- run: go mod tidy
25+
- run: go mod vendor
26+
- name: Check vendor for changes
27+
run: git diff --exit-code
28+
- name: Build
29+
run: go build -v
30+
31+
diff:
32+
name: Check Generated Code Difference
33+
runs-on: ubuntu-latest
34+
steps:
35+
- uses: actions/checkout@v4
36+
- uses: actions/setup-go@v5
37+
with:
38+
go-version-file: 'go.mod'
39+
- name: Generate provider code
40+
run: go generate
41+
- name: Check generated code for diffs
42+
run: git diff --exit-code
43+
44+
go-releaser:
45+
name: Dry-Run GoReleaser Check
46+
needs: [build, diff]
47+
runs-on: ubuntu-latest
48+
steps:
49+
- uses: actions/checkout@v4
50+
- name: Unshallow
51+
run: git fetch --prune --unshallow
52+
- uses: actions/setup-go@v5
53+
- name: Install GoReleaser
54+
uses: goreleaser/goreleaser-action@v6
55+
with:
56+
install-only: true
57+
version: latest
58+
- name: GoReleaser Release Check
59+
run: goreleaser release --skip=publish,sign --snapshot --clean
60+
61+
acceptance:
62+
name: Acceptance Tests
63+
if: github.repository_owner == 'cisco-open'
64+
needs: [build, diff]
65+
runs-on: ubuntu-latest
66+
env:
67+
HYPERFABRIC_TOKEN: 'TOKENTOKENTOKEN'
68+
concurrency:
69+
group: tf-hyperfabric-ci-test
70+
cancel-in-progress: false
71+
steps:
72+
- uses: actions/checkout@v4
73+
- uses: actions/setup-go@v5
74+
with:
75+
go-version-file: 'go.mod'
76+
- uses: hashicorp/setup-terraform@v3
77+
with:
78+
terraform_version: '1.7.*'
79+
terraform_wrapper: false
80+
- name: Terraform Acceptance Test
81+
run: go test github.com/cisco-open/terraform-provider-hyperfabric/internal/provider -v -race -timeout 300m -coverprofile=coverage.out -covermode=atomic
82+
env:
83+
TF_ACC: '1'
84+
TF_ACC_STATE_LINEAGE: '1'
85+
- name: Upload coverage to Codecov
86+
# Upload Coverage on latest only
87+
uses: codecov/codecov-action@v4
88+
with:
89+
token: ${{ secrets.CODECOV_TOKEN }}

.github/workflows/jira-issue-sync.yml

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Sync GitHub Issues & Pull Requests to Jira
2+
3+
on: [issues, issue_comment, pull_request]
4+
concurrency: jira_issues
5+
6+
jobs:
7+
sync_issues_to_jira:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v4
11+
12+
- name: Sync GitHub Issues & Pull Requests to Jira
13+
uses: ciscoecosystem/sync-jira-actions@v1.1
14+
with:
15+
sync_label: jira-sync
16+
status_field_id: 10740
17+
find_jira_retries: 0
18+
env:
19+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
20+
JIRA_PASS: ${{ secrets.JIRA_PASS }}
21+
JIRA_USER: ${{ secrets.JIRA_USER }}
22+
JIRA_URL: ${{ secrets.JIRA_URL }}
23+
JIRA_PROJECT: DCNE
24+
JIRA_COMPONENT: terraform-provider-hyperfabric
25+
JIRA_ISSUE_TYPE: GitHub Issue

.github/workflows/release.yml

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Terraform Provider release workflow.
2+
name: Release
3+
4+
# This GitHub action creates a release when a tag that matches the pattern
5+
# "v*" (e.g. v0.1.0) is created.
6+
on:
7+
push:
8+
tags:
9+
- 'v*'
10+
11+
# Releases need permissions to read and write the repository contents.
12+
# GitHub considers creating releases and uploading assets as writing contents.
13+
permissions:
14+
contents: write
15+
16+
jobs:
17+
goreleaser:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
21+
with:
22+
# Allow goreleaser to access older tag information.
23+
fetch-depth: 0
24+
- uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
25+
with:
26+
go-version-file: 'go.mod'
27+
cache: true
28+
- name: Import GPG key
29+
uses: crazy-max/ghaction-import-gpg@01dd5d3ca463c7f10f7f4f7b4f177225ac661ee4 # v6.1.0
30+
id: import_gpg
31+
with:
32+
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
33+
passphrase: ${{ secrets.PASSPHRASE }}
34+
- name: Run GoReleaser
35+
uses: goreleaser/goreleaser-action@7ec5c2b0c6cdda6e8bbb49444bc797dd33d74dd8 # v5.0.0
36+
with:
37+
args: release --clean
38+
env:
39+
# GitHub sets the GITHUB_TOKEN secret automatically.
40+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
41+
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }}

.github/workflows/release_pr.yml

+80
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
name: release_pr
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
jobs:
9+
release-pr:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v4
14+
- name: Unshallow
15+
run: git fetch --prune --unshallow
16+
17+
# git-cliff generates CHANGELOG.md
18+
- uses: actions/setup-python@v5
19+
with:
20+
python-version: '3.10'
21+
- run: pip install git-cliff typos
22+
- name: Check new changlog entry for version bump type
23+
id: type
24+
run: |
25+
changelog=$(git cliff --unreleased)
26+
case $changelog in
27+
*"BREAKING CHANGES:"* )
28+
echo "MAJOR"
29+
echo "bump="MAJOR: version change"" >> $GITHUB_OUTPUT
30+
;;
31+
*"IMPROVEMENTS:"* )
32+
echo "MINOR"
33+
echo "bump="MINOR: version change"" >> $GITHUB_OUTPUT
34+
;;
35+
*"DEPRECATIONS:"* )
36+
echo "MINOR"
37+
echo "bump="MINOR: version change"" >> $GITHUB_OUTPUT
38+
;;
39+
* )
40+
echo "PATCH"
41+
echo "bump="PATCH: version change"" >> $GITHUB_OUTPUT
42+
;;
43+
esac
44+
# The --with-commit inserts a commit message to git-cliff without it being in the history.
45+
# It is used here to dynamically add version bump commands.
46+
- name: Get next version
47+
id: vars
48+
run: echo "version=$(git cliff --bumped-version --with-commit "${{ steps.type.outputs.bump }}")" >> $GITHUB_OUTPUT
49+
- name: Generate changelog output
50+
run: git cliff --bump --unreleased --with-commit "${{ steps.type.outputs.bump }}"
51+
- name: Prepend new changelog entry
52+
run: git cliff --bump --unreleased -p CHANGELOG.md --with-commit "${{ steps.type.outputs.bump }}"
53+
54+
# Generate annotation_unsupported.go
55+
- uses: actions/setup-go@v5
56+
with:
57+
go-version-file: 'go.mod'
58+
- name: Generate annotation unsupported provider code
59+
run: go generate
60+
env:
61+
GEN_ANNOTATION_UNSUPPORTED: '1'
62+
63+
# Commit changes to release_pr branch
64+
- name: Set git config
65+
run: git config user.email "dcn-ecosystem@cisco.com" && git config user.name "dcn-ecosystem"
66+
- name: Commit
67+
run: git add -u && git status && git commit -m "[ignore] Update Changelog and annotation_unsupported.go for new release (${{ steps.vars.outputs.version }})"
68+
- name: Branch & Push
69+
run: git checkout -b release_pr && git push --set-upstream origin release_pr --force && git clean -f -d
70+
71+
# Create or update release PR
72+
- run: gh pr create --base master --head release_pr --title "Pre-Release PR (${{ steps.vars.outputs.version }})" --body ""
73+
id: pr
74+
continue-on-error: true
75+
env:
76+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
77+
- run: gh pr edit release_pr --title "Pre-Release PR (${{ steps.vars.outputs.version }})"
78+
if: steps.pr.outcome == 'failure'
79+
env:
80+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/test.yml

+87
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
# Terraform Provider testing workflow.
2+
name: Tests
3+
4+
# This GitHub action runs your tests for each pull request and push.
5+
# Optionally, you can turn it on using a schedule for regular testing.
6+
on:
7+
pull_request:
8+
paths-ignore:
9+
- 'README.md'
10+
push:
11+
paths-ignore:
12+
- 'README.md'
13+
14+
# Testing only needs permissions to read the repository contents.
15+
permissions:
16+
contents: read
17+
18+
jobs:
19+
# Ensure project builds before running testing matrix
20+
build:
21+
name: Build
22+
runs-on: ubuntu-latest
23+
timeout-minutes: 5
24+
steps:
25+
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
26+
- uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
27+
with:
28+
go-version-file: 'go.mod'
29+
cache: true
30+
- run: go mod download
31+
- run: go build -v .
32+
- name: Run linters
33+
uses: golangci/golangci-lint-action@3cfe3a4abbb849e10058ce4af15d205b6da42804 # v4.0.0
34+
with:
35+
version: latest
36+
37+
generate:
38+
runs-on: ubuntu-latest
39+
steps:
40+
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
41+
- uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
42+
with:
43+
go-version-file: 'go.mod'
44+
cache: true
45+
# Temporarily download Terraform 1.8 prerelease for function documentation support.
46+
# When Terraform 1.8.0 final is released, this can be removed.
47+
- uses: hashicorp/setup-terraform@a1502cd9e758c50496cc9ac5308c4843bcd56d36 # v3.0.0
48+
with:
49+
terraform_version: '1.8.0-alpha20240216'
50+
terraform_wrapper: false
51+
- run: go generate ./...
52+
- name: git diff
53+
run: |
54+
git diff --compact-summary --exit-code || \
55+
(echo; echo "Unexpected difference in directories after code generation. Run 'go generate ./...' command and commit."; exit 1)
56+
57+
# Run acceptance tests in a matrix with Terraform CLI versions
58+
test:
59+
name: Terraform Provider Acceptance Tests
60+
needs: build
61+
runs-on: ubuntu-latest
62+
timeout-minutes: 15
63+
strategy:
64+
fail-fast: false
65+
matrix:
66+
# list whatever Terraform versions here you would like to support
67+
terraform:
68+
- '1.0.*'
69+
- '1.1.*'
70+
- '1.2.*'
71+
- '1.3.*'
72+
- '1.4.*'
73+
steps:
74+
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
75+
- uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
76+
with:
77+
go-version-file: 'go.mod'
78+
cache: true
79+
- uses: hashicorp/setup-terraform@a1502cd9e758c50496cc9ac5308c4843bcd56d36 # v3.0.0
80+
with:
81+
terraform_version: ${{ matrix.terraform }}
82+
terraform_wrapper: false
83+
- run: go mod download
84+
- env:
85+
TF_ACC: "1"
86+
run: go test -v -cover ./internal/provider/
87+
timeout-minutes: 10

.gitignore

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
.DS_Store
2+
**/.vscode
3+
**/.terraform
4+
**/terraform.tfstate
5+
**/terraform.tfstate.backup
6+
**/terraform.tfplan
7+
**/terraform.tfstate
8+
**/.terraform.lock.hcl
9+
**/.idea
10+
11+
*.dll
12+
*.exe
13+
example.tf
14+
terraform.tfplan
15+
terraform.tfstate
16+
bin/
17+
dist/
18+
modules-dev/
19+
/pkg/
20+
website/.vagrant
21+
website/.bundle
22+
website/build
23+
website/node_modules
24+
.vagrant/
25+
*.backup
26+
.terraform/
27+
*.log
28+
*.bak
29+
*~
30+
.*.swp
31+
*.iml
32+
*.test
33+
*.iml
34+
35+
website/vendor
36+
37+
# Test exclusions
38+
!command/test-fixtures/**/*.tfstate
39+
!command/test-fixtures/**/.terraform/
40+
41+
# Keep windows files with windows line endings
42+
*.winfile eol=crlf
43+
44+
# Build file
45+
terraform-provider-hyperfabric

0 commit comments

Comments
 (0)