Skip to content

Commit 99f86ff

Browse files
authored
Merge branch 'staging' into kubelet_disk_type_temp
2 parents 46c5010 + 62b0266 commit 99f86ff

38 files changed

+2373
-60
lines changed

.dockerignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,4 @@ docs/
22
*.md
33
*.txt
44
terraform.tfstate*
5-
examples/
65
.terraform/
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Copyright © 2025, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
name: Default Plan Unit Tests
5+
on:
6+
push:
7+
branches: ['**'] # '*' will cause the workflow to run on all commits to all branches.
8+
9+
jobs:
10+
go-tests:
11+
name: Default Plan Unit Tests
12+
runs-on: ubuntu-latest
13+
environment: terraformSecrets
14+
steps:
15+
- name: Checkout Repository
16+
uses: actions/checkout@v4
17+
- name: Build Docker Image
18+
run: docker build -t viya4-iac-azure:terratest -f Dockerfile.terratest .
19+
- name: Run Tests
20+
run: |
21+
docker run \
22+
-e TF_VAR_subscription_id=$TF_VAR_subscription_id \
23+
-e TF_VAR_tenant_id=$TF_VAR_tenant_id \
24+
-e TF_VAR_client_id=$TF_VAR_client_id \
25+
-e TF_VAR_client_secret=$TF_VAR_client_secret \
26+
-v $(pwd):/viya4-iac-azure \
27+
viya4-iac-azure:terratest -v
28+
env:
29+
# TF ENVIRONMENT
30+
TF_VAR_subscription_id: "${{ secrets.TF_VAR_SUBSCRIPTION_ID }}"
31+
TF_VAR_tenant_id: "${{ secrets.TF_VAR_TENANT_ID }}"
32+
TF_VAR_client_id: "${{ secrets.TF_VAR_CLIENT_ID }}"
33+
TF_VAR_client_secret: "${{ secrets.TF_VAR_CLIENT_SECRET }}"

.github/workflows/linter-analysis.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,12 @@ jobs:
4646
path: ~/.tflint.d/plugins
4747
key: ubuntu-latest-tflint-${{ hashFiles('.tflint.hcl') }}
4848

49+
- name: Setup Terraform
50+
uses: hashicorp/setup-terraform@v3
51+
with:
52+
terraform_version: "^1.10.5"
53+
terraform_wrapper: false
54+
4955
- name: Setup TFLint
5056
uses: terraform-linters/[email protected]
5157
with:

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,8 @@ terraform.tfvars
99
.terraform.lock.hcl
1010
.DS_Store
1111
sas_iac_buildinfo.yaml
12+
.idea
13+
.vscode
14+
test/bin
15+
test/pkg
16+
test/test_output

.pre-commit-config.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
default_stages: [pre-commit]
3+
repos:
4+
- repo: https://github.com/gitleaks/gitleaks
5+
rev: v8.23.3
6+
hooks:
7+
- id: gitleaks
8+
9+
ci:
10+
autofix_prs: false
11+
autoupdate_commit_msg: "chore: auto-update of pre-commit hooks"

CONTRIBUTING.md

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,27 @@
11
# How to Contribute
2-
We'd love to accept your patches and contributions to this project.
3-
We just ask that you follow our contribution guidelines when you do.
2+
This project is community-driven, and we'd love to accept your patches and contributions.
3+
We just ask that you follow our contribution guidelines when you do. Refer
4+
to the [Contributor Handbook](https://sassoftware.github.io/contributor-handbook.html)
5+
for guidance.
46

57
## Contributor License Agreement
68
Contributions to this project must be accompanied by a signed [Contributor Agreement](ContributorAgreement.txt).
7-
You (or your employer) retain the copyright to your contribution; this simply grants us permission to use and redistribute your contributions as part of the project.
9+
You (or your employer) retain the copyright to your contribution; this agreement simply grants
10+
us permission to use and redistribute your contributions as part of the project.
811

9-
## Code reviews
10-
All submissions to this project—including submissions from project members—require review.
11-
Our review process typically involves performing unit tests, development tests, integration tests, and security scans using internal SAS infrastructure.
12-
For this reason, we don’t often merge pull requests directly from GitHub.
12+
## Code Reviews
13+
All submissions to this project—including submissions from project members—require
14+
review. Our review process typically involves performing unit tests, development
15+
tests, integration tests, and security scans.
1316

14-
Instead, we work with submissions internally first, vetting them to ensure they meet our security and quality standards.
15-
We’ll do our best to work with contributors in public issues and pull requests; however, to ensure our code meets our internal compliance standards, we may need to incorporate your submission into a solution we push ourselves.
17+
## Pull Request Requirement
18+
All contributions (PRs) must be accompanied by passing unit and/or integration
19+
tests, following our [testing philosophy](./docs/user/TestingPhilosophy.md). If you are unfamiliar with this process,
20+
we are happy to help you navigate it by providing continuous collaboration within the pull request.
21+
All pull requests must also pass our linter analysis checks. Contributions might
22+
be subjected to security scans before they can be accepted.
1623

17-
This does not mean we don’t value or appreciate your contribution.
18-
We simply need to review your code internally before merging it.
19-
We work to ensure all contributors receive appropriate recognition for their contributions, at least by acknowledging them in our release notes.
24+
## Security Scans
25+
To ensure that all submissions meet our security and quality standards, we perform security
26+
scans using internal SAS infrastructure. Reporting of any Common Vulnerabilities and Exposures
27+
(CVEs) that are detected is not available in this project at this time.

Dockerfile

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
1-
ARG TERRAFORM_VERSION=1.9.6
2-
ARG AZURECLI_VERSION=2.64.0
1+
ARG TERRAFORM_VERSION=1.10.5
2+
ARG AZURECLI_VERSION=2.70.0
33

44
FROM hashicorp/terraform:$TERRAFORM_VERSION as terraform
55
FROM mcr.microsoft.com/azure-cli:$AZURECLI_VERSION
6-
ARG KUBECTL_VERSION=1.29.7
6+
ARG KUBECTL_VERSION=1.30.10
77

88
WORKDIR /viya4-iac-azure
99

1010
COPY --from=terraform /bin/terraform /bin/terraform
1111
COPY . .
1212

13-
RUN yum -y install git openssh jq which curl \
14-
&& yum clean all && rm -rf /var/cache/yum \
15-
&& curl -sLO https://storage.googleapis.com/kubernetes-release/release/v$KUBECTL_VERSION/bin/linux/amd64/kubectl \
13+
RUN tdnf -y install git which \
14+
&& tdnf clean all && rm -rf /var/cache/tdnf \
15+
&& curl -sLO https://dl.k8s.io/release/v$KUBECTL_VERSION/bin/linux/amd64/kubectl \
1616
&& chmod 755 ./kubectl /viya4-iac-azure/docker-entrypoint.sh \
1717
&& mv ./kubectl /usr/local/bin/kubectl \
18-
&& chmod g=u -R /etc/passwd /etc/group /viya4-iac-azure \
1918
&& git config --system --add safe.directory /viya4-iac-azure \
20-
&& terraform init
19+
&& terraform init \
20+
&& chmod g=u -R /etc/passwd /etc/group /viya4-iac-azure
2121

2222
ENV TF_VAR_iac_tooling=docker
2323
ENTRYPOINT ["/viya4-iac-azure/docker-entrypoint.sh"]

Dockerfile.terratest

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
FROM golang:1.23
2+
3+
# Install terraform from apt repository and terratest_log_parser
4+
RUN \
5+
apt-get update \
6+
&& apt-get install -y jq lsb-release \
7+
&& wget -O - https://apt.releases.hashicorp.com/gpg \
8+
| gpg --dearmor -o /usr/share/keyrings/hashicorp-archive-keyring.gpg \
9+
&& echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] https://apt.releases.hashicorp.com $(lsb_release -cs) main" \
10+
| tee /etc/apt/sources.list.d/hashicorp.list \
11+
&& apt update \
12+
&& apt install terraform \
13+
&& ssh-keygen -f ~/.ssh/id_rsa -P "" \
14+
&& go install github.com/gruntwork-io/terratest/cmd/terratest_log_parser@latest
15+
16+
WORKDIR /viya4-iac-azure/test
17+
18+
# Copy the test directory so it can install the go modules
19+
# during the docker build rather than the docker run
20+
COPY ./test ./
21+
RUN go mod tidy
22+
23+
ENTRYPOINT ["/viya4-iac-azure/test/terratest_docker_entrypoint.sh"]

Makefile

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Copyright © 2025, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
# from .github/workflows/default_plan_unit_tests.yml
5+
6+
IMAGE := viya4-iac-azure:terratest
7+
8+
buildTests:
9+
ifeq ($(shell docker images -q $(IMAGE) 2> /dev/null),)
10+
docker build -t $(IMAGE) -f Dockerfile.terratest .
11+
endif
12+
13+
checkEnv:
14+
ifndef TF_VAR_subscription_id
15+
$(error TF_VAR_subscription_id is undefined)
16+
endif
17+
ifndef TF_VAR_tenant_id
18+
$(error TF_VAR_tenant_id is undefined)
19+
endif
20+
ifndef TF_VAR_client_id
21+
$(error TF_VAR_client_id is undefined)
22+
endif
23+
ifndef TF_VAR_client_secret
24+
$(error TF_VAR_client_secret is undefined)
25+
endif
26+
27+
28+
runTests: checkEnv buildTests
29+
docker run -it --rm \
30+
-e TF_VAR_subscription_id=$(TF_VAR_subscription_id) \
31+
-e TF_VAR_tenant_id=$(TF_VAR_tenant_id) \
32+
-e TF_VAR_client_id=$(TF_VAR_client_id) \
33+
-e TF_VAR_client_secret=$(TF_VAR_client_secret) \
34+
$(IMAGE) -v
35+
36+
clean:
37+
docker image rm $(IMAGE)

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,10 @@ This project supports two options for running Terraform scripts:
5757
Access to an **Azure Subscription** and an [**Identity**](./docs/user/TerraformAzureAuthentication.md) with the *Contributor* role are required.
5858

5959
#### Terraform Requirements:
60-
- [Terraform](https://www.terraform.io/downloads.html) - v1.9.6
61-
- [kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl) - v1.29.7
60+
- [Terraform](https://www.terraform.io/downloads.html) - v1.10.5
61+
- [kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl) - v1.30.10
6262
- [jq](https://stedolan.github.io/jq/) - v1.6
63-
- [Azure CLI](https://docs.microsoft.com/en-us/cli/azure) - (optional - useful as an alternative to the Azure Portal) - v2.64.0
63+
- [Azure CLI](https://docs.microsoft.com/en-us/cli/azure) - (optional - useful as an alternative to the Azure Portal) - v2.70.0
6464

6565
#### Docker Requirements:
6666
- [Docker](https://docs.docker.com/get-docker/)

0 commit comments

Comments
 (0)