Skip to content
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

[BUGFIX] - Revision Variables #896

Open
wants to merge 53 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
d35f36f
Bump k8s.io/code-generator from 0.27.2 to 0.27.3 (#834)
dependabot[bot] Jun 15, 2023
ee60cc4
Bump k8s.io/apimachinery from 0.27.2 to 0.27.3 (#839)
dependabot[bot] Jun 16, 2023
0a184b7
Bump golang.org/x/tools from 0.9.3 to 0.10.0 (#842)
dependabot[bot] Jun 19, 2023
d4557c3
Bump docker/build-push-action from 4.1.0 to 4.1.1 (#841)
dependabot[bot] Jun 19, 2023
0fb1572
Bump docker/metadata-action from 4.5.0 to 4.6.0 (#840)
dependabot[bot] Jun 19, 2023
9519f4b
[FEATURE] - Cloud Resource and Module Plans (#824)
gambol99 Jun 19, 2023
6f345bb
Bump github.com/golangci/golangci-lint from 1.53.2 to 1.53.3 (#844)
dependabot[bot] Jun 20, 2023
77edb46
[IMAGES] - Checkov Image Update (#846)
github-actions[bot] Jun 20, 2023
ca1f77d
[FEATURE] - Create Revision Command (#847)
gambol99 Jun 20, 2023
c7c7f0a
Bump github.com/aws/aws-sdk-go from 1.44.281 to 1.44.285 (#845)
dependabot[bot] Jun 20, 2023
376df46
[FEATURE] - Enable Default Variables Injection (#848)
gambol99 Jun 20, 2023
cf3c361
Bump github.com/prometheus/client_golang from 1.15.1 to 1.16.0 (#850)
dependabot[bot] Jun 21, 2023
4b2897e
[FEATURE] - Update Proection for Revisions in Use (#851)
gambol99 Jun 21, 2023
51f6cc9
[FEATURE] - Cloud Resource Update Available (#852)
gambol99 Jun 21, 2023
61c1f6c
[CLI] - Create Workflow Command (#853)
gambol99 Jun 21, 2023
edff135
[FEATURE] - CLI Get Command (#854)
gambol99 Jun 21, 2023
be38462
[FEATURE] - Convert Command (#855)
gambol99 Jun 21, 2023
5e0fb3a
[FEATURE] - Cloud Resources Reconciles on Plan Changes (#856)
gambol99 Jun 21, 2023
9eff26e
[CLI] - Moving Commands Under Create (#857)
gambol99 Jun 21, 2023
5462205
[BUILD] - Allowing Framework to be Overriden (#858)
gambol99 Jun 21, 2023
2e92d7a
[API] - Adding Type Field to Revision Inputs (#859)
gambol99 Jun 21, 2023
6b2c773
[APIS] - Fixing Revision JSON Tags (#860)
gambol99 Jun 21, 2023
0549629
[BUGFIX] - Revision Template Plan Name Default (#861)
gambol99 Jun 21, 2023
d9a61e9
Bump github.com/onsi/ginkgo/v2 from 2.10.0 to 2.11.0 (#862)
dependabot[bot] Jun 22, 2023
c850361
Bump github.com/aws/aws-sdk-go from 1.44.285 to 1.44.288 (#863)
dependabot[bot] Jun 23, 2023
a0eb0fd
[BUGFIX] - Configuration Resource Status (#864)
gambol99 Jun 23, 2023
dea3078
[APIS] - Adding Types Fields to Revision Input (#865)
gambol99 Jun 23, 2023
e2f120b
[FEATURE] - Verify Revision CLI (#866)
gambol99 Jun 23, 2023
8f634cb
[FEATURE] - Revisions in Use Metric (#867)
gambol99 Jun 23, 2023
de3ddfe
[FEATURE] - Adding Convenience Aliases for Delete & Apply (#868)
gambol99 Jun 24, 2023
f4e4a63
[BUGFIX] - Generating Checkov Policy Per Constraint (#869)
gambol99 Jun 24, 2023
303e218
[BUGFIX] - Fix Deletion of Temporary Directory (#870)
gambol99 Jun 25, 2023
b0a76a6
[FEATURE] - Ignore Local Directories on Module Policy Verification (#…
gambol99 Jun 25, 2023
107c663
Bump github.com/aws/aws-sdk-go from 1.44.288 to 1.44.289 (#872)
dependabot[bot] Jun 26, 2023
913714d
[E2E] - Cloud Resource E2E (#873)
gambol99 Jun 26, 2023
259cef4
[BUGFIX] - Bypass Update Protection on Revision (#874)
gambol99 Jun 26, 2023
d4c3194
[E2E] - Cloud Resource E2E (#875)
gambol99 Jun 26, 2023
51e70c8
[E2E] - Azure Integration Testing (#876)
gambol99 Jun 26, 2023
5ae697a
Bump sigs.k8s.io/controller-runtime from 0.14.6 to 0.15.0 (#771)
dependabot[bot] Jun 26, 2023
84e8dc3
Bump k8s.io/client-go from 0.26.3 to 0.27.3 (#836)
dependabot[bot] Jun 26, 2023
6b8b2f9
Bump k8s.io/apiextensions-apiserver from 0.26.3 to 0.27.3 (#835)
dependabot[bot] Jun 26, 2023
33502dc
Bump k8s.io/cli-runtime from 0.26.3 to 0.27.3 (#849)
dependabot[bot] Jun 26, 2023
d22e838
Bump mvdan.cc/sh/v3 from 3.6.0 to 3.7.0 (#878)
dependabot[bot] Jun 27, 2023
ecd2743
Bump github.com/aws/aws-sdk-go from 1.44.289 to 1.44.290 (#877)
dependabot[bot] Jun 27, 2023
cba0489
Bump github.com/aws/aws-sdk-go from 1.44.290 to 1.44.291 (#881)
dependabot[bot] Jun 28, 2023
e40e62a
Bump github.com/aws/aws-sdk-go from 1.44.291 to 1.44.293 (#883)
dependabot[bot] Jun 30, 2023
8bd29be
[IMAGES] - Fixing Checkov Image Automation (#884)
gambol99 Jun 30, 2023
5a5b5e1
[IMAGES] - Infracost Image Update (#879)
github-actions[bot] Jun 30, 2023
77e77e5
[CLI] - Adding Drift Detection to Columns (#886)
gambol99 Jul 3, 2023
83c5b28
Bump github.com/aws/aws-sdk-go from 1.44.293 to 1.44.295 (#887)
dependabot[bot] Jul 4, 2023
a11ba58
Bump golang.org/x/tools from 0.10.0 to 0.11.0 (#892)
dependabot[bot] Jul 7, 2023
89f0fc0
Bump github.com/aws/aws-sdk-go from 1.44.295 to 1.44.297 (#894)
dependabot[bot] Jul 7, 2023
106dbb1
[BUGFIX] - Revision Variables
gambol99 Jul 10, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 2 additions & 2 deletions .github/workflows/e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Build
uses: docker/build-push-action@v4.1.0
uses: docker/build-push-action@v4.1.1
with:
context: .
file: images/Dockerfile.controller
Expand All @@ -71,7 +71,7 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Build
uses: docker/build-push-action@v4.1.0
uses: docker/build-push-action@v4.1.1
with:
context: .
file: images/Dockerfile.executor
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/images.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
fi
- name: Docker Metadata
id: docker_meta
uses: docker/metadata-action@v4.5.0
uses: docker/metadata-action@v4.6.0
with:
images: |
ghcr.io/appvia/terranetes-${{ matrix.image }}
Expand All @@ -51,7 +51,7 @@ jobs:
tags: |
type=raw,value=${{ steps.get_image_tag.outputs.image_tag }}
- name: Build & Push
uses: docker/build-push-action@v4.1.0
uses: docker/build-push-action@v4.1.1
with:
build-args: VERSION=${{ steps.get_image_tag.outputs.image_tag }}
context: .
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ jobs:
with:
cloud: aws

# e2e-azure:
# uses: ./.github/workflows/e2e.yaml
# secrets: inherit
# with:
# cloud: azurerm
e2e-azure:
uses: ./.github/workflows/e2e.yaml
secrets: inherit
with:
cloud: azurerm

e2e-google:
uses: ./.github/workflows/e2e.yaml
Expand All @@ -29,14 +29,14 @@ jobs:
needs:
- e2e-aws
- e2e-google
# - e2e-azure
- e2e-azure
uses: ./.github/workflows/images.yaml
secrets: inherit

release:
needs:
- e2e-aws
# - e2e-azure
- e2e-azure
- e2e-google
name: Github Release
runs-on: ubuntu-latest
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/versions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ jobs:
if [[ "${{ matrix.image }}" == "infracost/infracost" ]]; then
export IMAGE="${{ matrix.image }}:ci-${VERSION##v}"
fi
if [[ "${{ matrix.image }}" == "bridgecrew/checkov" ]]; then
export IMAGE="${{ matrix.image }}:${VERSION}-pyston
fi

yq e '.${{ matrix.value }} = strenv(IMAGE)' -i charts/terranetes-controller/values.yaml
- name: Raise Pull Request
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ out
me.yml
me.yaml
tmp/
TODO
TODO.md

# Terraform Related
terraform.tfstate
Expand Down
4 changes: 1 addition & 3 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ linters:
- errname
- errorlint
- exportloopref
- goconst
- gocyclo
- gosec
- gosimple
Expand All @@ -42,7 +43,6 @@ linters-settings:
desc: deprecated in go1.16

gosimple:
go: "1.17"
checks:
- all

Expand All @@ -53,12 +53,10 @@ linters-settings:
- shadow

staticcheck:
go: "1.17"
checks:
- all

stylecheck:
go: "1.17"
checks:
- all
- -ST1003
Expand Down
10 changes: 10 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ apis: golang
@$(MAKE) controller-gen
@$(MAKE) register-gen
@$(MAKE) schema-gen
@$(MAKE) mock-gen
@$(MAKE) gofmt

check-apis: apis
Expand All @@ -62,6 +63,11 @@ check-api-sync:
exit 1; \
fi

mock-gen:
@echo "--> Generating Mocks"
@go run github.com/golang/mock/mockgen -package mocks github.com/aws/aws-sdk-go/service/ec2/ec2iface EC2API > pkg/utils/preload/eks/mocks/ec2_zz.go
@go run github.com/golang/mock/mockgen -package mocks github.com/aws/aws-sdk-go/service/eks/eksiface EKSAPI > pkg/utils/preload/eks/mocks/eks_zz.go

controller-gen:
@echo "--> Generating deepcopies, CRDs and webhooks"
@rm -rf charts/terranetes-controller/crds
Expand Down Expand Up @@ -248,6 +254,10 @@ check: test

### UTILITIES ###

develop-environment:
@echo "--> Creating a development environment"
@hack/create-development.sh

trigger-aws-e2e:
@echo "--> Triggering the e2e tests on ${GIT_BRANCH} branch (AWS)"
@gh workflow run e2e.yaml --ref ${GIT_BRANCH} -f cloud=aws -f use_helm=false -f version=ci
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,16 @@ spec:
- jsonPath: .spec.module
name: Module
type: string
- jsonPath: .spec.plan.name
name: Plan
priority: 1
type: string
- jsonPath: .spec.writeConnectionSecretToRef.name
name: Secret
type: string
- jsonPath: .spec.enableDriftDetection
name: Drift Detection
type: boolean
- jsonPath: .status.costs.monthly
name: Estimated
type: string
Expand Down Expand Up @@ -65,6 +72,19 @@ spec:
module:
description: Module is the URL to the source of the terraform module. The format of the URL is a direct implementation of terraform's module reference. Please see the following repository for more details https://github.com/hashicorp/go-getter
type: string
plan:
description: Plan is an optional reference to a plan this configuration is associated with. If not set and a policy exists to enforce a plan, the configuration will be rejected.
properties:
name:
description: Name is the name of the plan this configuration is associated with
type: string
revision:
description: Revision is the revision of the plan this configuration is associated with
type: string
required:
- name
- revision
type: object
providerRef:
description: ProviderRef is the reference to the provider which should be used to execute this configuration.
properties:
Expand Down Expand Up @@ -92,7 +112,7 @@ spec:
description: Key is the key in the secret which we should used for the value
type: string
name:
description: Name is the name which we use when injecting the value into the terraform code i.e. the secret maye contain data.DB_HOST but you call this database_hostname. Note, for backwards compatiability if no name is provided, we using the key at the name
description: Name is the name which we use when injecting the value into the terraform code i.e. the secret may contain data.DB_HOST but you call this database_hostname. Note, for backwards compatiability if no name is provided, we using the key at the name
type: string
optional:
description: Optional indicates the secret can be optional, i.e if the secret does not exist, or the key is not contained in the secret, we ignore the error
Expand Down Expand Up @@ -124,7 +144,6 @@ spec:
type: object
required:
- module
- providerRef
type: object
status:
description: ConfigurationStatus defines the observed state of a terraform
Expand Down
157 changes: 157 additions & 0 deletions charts/terranetes-controller/crds/terraform.appvia.io_plans.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,157 @@
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.11.4
name: plans.terraform.appvia.io
spec:
group: terraform.appvia.io
names:
categories:
- terraform
kind: Plan
listKind: PlanList
plural: plans
singular: plan
scope: Cluster
versions:
- additionalPrinterColumns:
- jsonPath: .status.latest.revision
name: Latest
type: string
- jsonPath: .metadata.creationTimestamp
name: Age
type: date
name: v1alpha1
schema:
openAPIV3Schema:
description: Plan is the schema for the plan type
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
type: string
kind:
description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
type: string
metadata:
type: object
spec:
description: PlanSpec defines the desired state for a context
properties:
revisions:
description: Revisions is a collection of revision associated with this plan
items:
description: PlanRevision is a reference to a revision of a plan existing in the system
properties:
name:
description: Name is the name of the revision containing the configuration
type: string
revision:
description: Revision is the version of the revision
type: string
required:
- name
- revision
type: object
type: array
type: object
status:
description: PlanStatus defines the observed state of a terraform
properties:
conditions:
description: Conditions represents the observations of the resource's current state.
items:
description: Condition is the current observed condition of some aspect of a resource
properties:
detail:
description: Detail is any additional human-readable detail to understand this condition, for example, the full underlying error which caused an issue
type: string
lastTransitionTime:
description: LastTransitionTime is the last time the condition transitioned from one status to another. This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable.
format: date-time
type: string
message:
description: Message is a human readable message indicating details about the transition. This may be an empty string.
maxLength: 32768
type: string
name:
description: Name is a human-readable name for this condition.
minLength: 1
type: string
observedGeneration:
description: ObservedGeneration represents the .metadata.generation that the condition was set based upon. For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date with respect to the current state of the instance.
format: int64
minimum: 0
type: integer
reason:
description: Reason contains a programmatic identifier indicating the reason for the condition's last transition. Producers of specific condition types may define expected values and meanings for this field, and whether the values are considered a guaranteed API. The value should be a CamelCase string. This field may not be empty.
maxLength: 1024
minLength: 1
pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$
type: string
status:
description: Status of the condition, one of True, False, Unknown.
enum:
- "True"
- "False"
- Unknown
type: string
type:
description: Type of condition in CamelCase or in foo.example.com/CamelCase. --- Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be useful (see .node.status.conditions), the ability to deconflict is important. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt)
maxLength: 316
pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
type: string
required:
- name
- reason
- status
- type
type: object
type: array
x-kubernetes-list-map-keys:
- type
x-kubernetes-list-type: map
lastReconcile:
description: LastReconcile describes the generation and time of the last reconciliation
properties:
generation:
description: Generation is the generation reconciled on the last reconciliation
format: int64
type: integer
time:
description: Time is the last time the resource was reconciled
format: date-time
type: string
type: object
lastSuccess:
description: LastSuccess descibes the generation and time of the last reconciliation which resulted in a Success status
properties:
generation:
description: Generation is the generation reconciled on the last reconciliation
format: int64
type: integer
time:
description: Time is the last time the resource was reconciled
format: date-time
type: string
type: object
latest:
description: Latest is the latest revision from this plan
properties:
name:
description: Name is the name of the revision containing the configuration
type: string
revision:
description: Revision is the version of the revision
type: string
required:
- name
- revision
type: object
type: object
type: object
served: true
storage: true
subresources:
status: {}
preserveUnknownFields: false
Loading