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

deps: conftest 0.27.0 #1720

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ RUN AVAILABLE_TERRAFORM_VERSIONS="0.8.8 0.9.11 0.10.8 0.11.15 0.12.31 0.13.7 0.1
done && \
ln -s /usr/local/bin/tf/versions/${DEFAULT_TERRAFORM_VERSION}/terraform /usr/local/bin/terraform

ENV DEFAULT_CONFTEST_VERSION=0.25.0
ENV DEFAULT_CONFTEST_VERSION=0.26.0

RUN AVAILABLE_CONFTEST_VERSIONS="${DEFAULT_CONFTEST_VERSION}" && \
for VERSION in ${AVAILABLE_CONFTEST_VERSIONS}; do \
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.dev
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM runatlantis/atlantis:latest
COPY atlantis /usr/local/bin/atlantis
# TODO: remove this once we get this in the base image
ENV DEFAULT_CONFTEST_VERSION=0.25.0
ENV DEFAULT_CONFTEST_VERSION=0.26.0

WORKDIR /atlantis/src
19 changes: 4 additions & 15 deletions server/controllers/events/events_controller_e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ import (
. "github.com/runatlantis/atlantis/testing"
)

const ConftestVersion = "0.25.0"
const ConftestVersion = "0.26.0"

var applyLocker locking.ApplyLocker
var userConfig server.UserConfig
Expand All @@ -55,13 +55,6 @@ func (m *NoopTFDownloader) GetAny(dst, src string, opts ...getter.ClientOption)
return nil
}

type LocalConftestCache struct {
}

func (m *LocalConftestCache) Get(key *version.Version) (string, error) {
return exec.LookPath(fmt.Sprintf("conftest%s", ConftestVersion))
}

func TestGitHubWorkflow(t *testing.T) {

if testing.Short() {
Expand Down Expand Up @@ -805,7 +798,7 @@ func setupE2E(t *testing.T, repoDir string) (events_controllers.VCSEventsControl

if userConfig.EnablePolicyChecksFlag {
// need this to be set or we'll fail the policy check step
os.Setenv(policy.DefaultConftestVersionEnvKey, "0.25.0")
os.Setenv(policy.DefaultConftestVersionEnvKey, "0.26.0")
}

// Mocks.
Expand Down Expand Up @@ -900,10 +893,6 @@ func setupE2E(t *testing.T, repoDir string) (events_controllers.VCSEventsControl

conftextExec := policy.NewConfTestExecutorWorkflow(logger, binDir, &NoopTFDownloader{})

// swapping out version cache to something that always returns local contest
// binary
conftextExec.VersionCache = &LocalConftestCache{}

policyCheckRunner, err := runtime.NewPolicyCheckStepRunner(
conftestVersion,
conftextExec,
Expand Down Expand Up @@ -1261,9 +1250,9 @@ func mkSubDirs(t *testing.T) (string, string, string, func()) {
return tmp, binDir, cachedir, cleanup
}

// Will fail test if conftest isn't in path and isn't version >= 0.25.0
// Will fail test if conftest isn't in path and isn't version >= 0.26.0
func ensureRunningConftest(t *testing.T) {
localPath, err := exec.LookPath(fmt.Sprintf("conftest%s", ConftestVersion))
localPath, err := exec.LookPath("conftest")
if err != nil {
t.Logf("conftest >= %s must be installed to run this test", ConftestVersion)
t.FailNow()
Expand Down
4 changes: 2 additions & 2 deletions server/core/runtime/policy/conftest_client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ import (

func TestConfTestVersionDownloader(t *testing.T) {

version, _ := version.NewVersion("0.25.0")
version, _ := version.NewVersion("0.26.0")
destPath := "some/path"

fullURL := fmt.Sprintf("https://github.com/open-policy-agent/conftest/releases/download/v0.25.0/conftest_0.25.0_%s_x86_64.tar.gz?checksum=file:https://github.com/open-policy-agent/conftest/releases/download/v0.25.0/checksums.txt", strings.Title(runtime.GOOS))
fullURL := fmt.Sprintf("https://github.com/open-policy-agent/conftest/releases/download/v0.26.0/conftest_0.26.0_%s_x86_64.tar.gz?checksum=file:https://github.com/open-policy-agent/conftest/releases/download/v0.26.0/checksums.txt", strings.Title(runtime.GOOS))

RegisterMockTestingT(t)

Expand Down
2 changes: 1 addition & 1 deletion testing/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ RUN curl -LOks https://releases.hashicorp.com/terraform/${TERRAFORM_VERSION}/ter
rm terraform_${TERRAFORM_VERSION}_linux_amd64.zip

# Install conftest
ENV DEFAULT_CONFTEST_VERSION=0.25.0
ENV DEFAULT_CONFTEST_VERSION=0.26.0

RUN AVAILABLE_CONFTEST_VERSIONS="${DEFAULT_CONFTEST_VERSION}" && \
for VERSION in ${AVAILABLE_CONFTEST_VERSIONS}; do \
Expand Down