Skip to content

Commit

Permalink
feat: support env vars in OCI secrets (#88)
Browse files Browse the repository at this point in the history
## Description
Allow users to specify basic auth credentials _OR_ arbitrary environment
variables when configuring OCI registry secrets.

Other
- Add automation to ensure validator versions stay up-to-date
- Remove hacky 20s wait for plugins to being installing. Wait for plugin
conditions to appear on ValidatorConfig instead.

Requires:
- validator-labs/validator#333

---------

Signed-off-by: Tyler Gillson <tyler.gillson@gmail.com>
  • Loading branch information
TylerGillson authored Jul 21, 2024
1 parent c69e355 commit 584b3c7
Show file tree
Hide file tree
Showing 20 changed files with 1,269 additions and 195 deletions.
1 change: 1 addition & 0 deletions .gitleaksignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ e7156f3be822e9da88949cd9405e8eedde836e5f:tests/integration/_validator/testcases/
e7156f3be822e9da88949cd9405e8eedde836e5f:tests/integration/_validator/testcases/data/validator.yaml:generic-api-key:51
481cdf910c0bc555363ae4278b2f57a66a72ed6b:tests/integration/_validator/testcases/data/validator.yaml:generic-api-key:27
481cdf910c0bc555363ae4278b2f57a66a72ed6b:tests/integration/_validator/testcases/data/validator.yaml:generic-api-key:51
hack/validator.tmpl:generic-api-key:538
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ VERSION_SUFFIX ?= -dev
VERSION ?= 0.0.4${VERSION_SUFFIX} # x-release-please-version

##@ Build Targets

.PHONY: build
build: ## Build CLI
@echo "Building CLI binary..."
Expand All @@ -26,6 +27,10 @@ build-release: ## Build CLI for multiple platforms
manifests:
@$(INFO) manifests: no-op

reviewable-ext:
@$(INFO) Checking for validator version updates...
bash hack/update-versions.sh

##@ Test Targets

COVER_DIR=_build/cov
Expand Down
23 changes: 23 additions & 0 deletions hack/update-versions.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/usr/bin/env bash

function latestRelease {
release=$(gh release list --repo $1 -L 1 | head -n 2 | awk '{ print $1; }')
echo ${release:1}
}

function updateVersions {
envsubst < hack/versions.tmpl > pkg/config/versions.go
envsubst < hack/validator.tmpl > tests/integration/_validator/testcases/data/validator.yaml
echo "Updated versions.go & test data with latest validator versions."
}

export AWS_VERSION=$(latestRelease validator-labs/validator-plugin-aws)
export AZURE_VERSION=$(latestRelease validator-labs/validator-plugin-azure)
export KUBESCAPE_VERSION=$(latestRelease validator-labs/validator-plugin-kubescape)
export MAAS_VERSION=$(latestRelease validator-labs/validator-plugin-maas)
export NETWORK_VERSION=$(latestRelease validator-labs/validator-plugin-network)
export OCI_VERSION=$(latestRelease validator-labs/validator-plugin-oci)
export VSPHERE_VERSION=$(latestRelease validator-labs/validator-plugin-vsphere)
export VALIDATOR_VERSION=$(latestRelease validator-labs/validator)

updateVersions
Loading

0 comments on commit 584b3c7

Please sign in to comment.