parent
ef7d68660c
commit
49254dc97e
|
@ -2,9 +2,6 @@ package engine_test
|
|||
|
||||
import (
|
||||
"errors"
|
||||
"github.com/concourse/concourse/atc"
|
||||
"github.com/concourse/concourse/atc/policy"
|
||||
"github.com/concourse/concourse/atc/policy/policyfakes"
|
||||
"time"
|
||||
|
||||
. "github.com/onsi/ginkgo"
|
||||
|
@ -12,10 +9,14 @@ import (
|
|||
|
||||
"code.cloudfoundry.org/clock/fakeclock"
|
||||
"code.cloudfoundry.org/lager/lagertest"
|
||||
|
||||
"github.com/concourse/concourse/atc"
|
||||
"github.com/concourse/concourse/atc/db/dbfakes"
|
||||
"github.com/concourse/concourse/atc/engine"
|
||||
"github.com/concourse/concourse/atc/event"
|
||||
"github.com/concourse/concourse/atc/exec"
|
||||
"github.com/concourse/concourse/atc/policy"
|
||||
"github.com/concourse/concourse/atc/policy/policyfakes"
|
||||
"github.com/concourse/concourse/vars"
|
||||
)
|
||||
|
||||
|
|
|
@ -95,7 +95,6 @@ jobs:
|
|||
fakeDelegate *execfakes.FakeSetPipelineStepDelegate
|
||||
fakeDelegateFactory *execfakes.FakeSetPipelineStepDelegateFactory
|
||||
|
||||
//filter policy.Filter
|
||||
fakeAgent *policyfakes.FakeAgent
|
||||
|
||||
fakeArtifactStreamer *workerfakes.FakeArtifactStreamer
|
||||
|
@ -177,16 +176,10 @@ jobs:
|
|||
fakeTeamFactory.GetByIDReturns(fakeTeam)
|
||||
fakeBuildFactory.BuildReturns(fakeBuild, true, nil)
|
||||
|
||||
//filter = policy.Filter{
|
||||
// Actions: []string{policy.ActionRunSetPipeline},
|
||||
//}
|
||||
|
||||
fakeAgent = new(policyfakes.FakeAgent)
|
||||
fakeAgent.CheckReturns(policy.PassedPolicyCheck(), nil)
|
||||
fakePolicyAgentFactory.NewAgentReturns(fakeAgent, nil)
|
||||
|
||||
//fakeChecker, _ = policy.Initialize(testLogger, "some-cluster", "some-version", filter)
|
||||
|
||||
fakeArtifactStreamer = new(workerfakes.FakeArtifactStreamer)
|
||||
|
||||
spPlan = &atc.SetPipelinePlan{
|
||||
|
@ -571,56 +564,6 @@ jobs:
|
|||
})
|
||||
})
|
||||
})
|
||||
|
||||
//Context("when policy checker enabled", func() {
|
||||
// var fakeResult *policyfakes.FakePolicyCheckResult
|
||||
//
|
||||
// BeforeEach(func(){
|
||||
// fakeResult = new(policyfakes.FakePolicyCheckResult)
|
||||
// fakeResult.AllowedReturns(true)
|
||||
// fakeResult.ShouldBlockReturns(false)
|
||||
// fakeAgent.CheckReturns(fakeResult, nil)
|
||||
// })
|
||||
//
|
||||
// Context("policy check errors", func() {
|
||||
// BeforeEach(func() {
|
||||
// fakeAgent.CheckReturns(nil, fmt.Errorf("unexpected error"))
|
||||
// })
|
||||
//
|
||||
// It("should return error", func() {
|
||||
// Expect(stepErr).To(HaveOccurred())
|
||||
// Expect(stepErr.Error()).To(Equal("error checking policy enforcement"))
|
||||
// })
|
||||
// })
|
||||
//
|
||||
// Context("policy check fails", func() {
|
||||
// BeforeEach(func() {
|
||||
// fakeResult.AllowedReturns(false)
|
||||
// fakeResult.MessagesReturns([]string{"foo", "bar"})
|
||||
// })
|
||||
//
|
||||
// It("should return error", func() {
|
||||
// Expect(stepErr).To(HaveOccurred())
|
||||
// Expect(stepErr.Error()).To(Equal("policy check failed for set_pipeline: foo, bar"))
|
||||
// })
|
||||
// })
|
||||
//
|
||||
// Context("policy check succeeds", func() {
|
||||
// BeforeEach(func() {
|
||||
// fakeBuild.PipelineReturns(fakePipeline, true, nil)
|
||||
// fakeBuild.SavePipelineReturns(fakePipeline, false, nil)
|
||||
// spPlan.Team = ""
|
||||
// })
|
||||
//
|
||||
// It("should finish successfully", func() {
|
||||
// _, teamID, _, _, _ := fakeBuild.SavePipelineArgsForCall(0)
|
||||
// Expect(teamID).To(Equal(fakeTeam.ID()))
|
||||
// Expect(fakeDelegate.FinishedCallCount()).To(Equal(1))
|
||||
// _, succeeded := fakeDelegate.FinishedArgsForCall(0)
|
||||
// Expect(succeeded).To(BeTrue())
|
||||
// })
|
||||
// })
|
||||
//})
|
||||
})
|
||||
})
|
||||
})
|
||||
|
|
|
@ -35,14 +35,7 @@ services:
|
|||
CONCOURSE_CLUSTER_NAME: dev
|
||||
CONCOURSE_ENABLE_PIPELINE_INSTANCES: "true"
|
||||
CONCOURSE_ENABLE_ACROSS_STEP: "true"
|
||||
CONCOURSE_ENABLE_CACHE_STREAMED_VOLUMES: "false"
|
||||
#CONCOURSE_POLICY_CHECK_FILTER_HTTP_METHODS: PUT,POST
|
||||
#CONCOURSE_POLICY_CHECK_FILTER_ACTION: ListWorkers,ListContainers,UseImage,GetUser
|
||||
#CONCOURSE_POLICY_CHECK_FILTER_ACTION_SKIP: PausePipeline,UnpausePipeline
|
||||
#CONCOURSE_OPA_URL: http://192.168.1.12:8181/v1/data/concourse/decision
|
||||
#CONCOURSE_OPA_RESULT_ALLOWED_KEY: result.allow
|
||||
#CONCOURSE_OPA_RESULT_SHOULD_BLOCK_KEY: result.block
|
||||
#CONCOURSE_OPA_RESULT_MESSAGES_KEY: result.reason
|
||||
CONCOURSE_ENABLE_CACHE_STREAMED_VOLUMES: "true"
|
||||
|
||||
worker:
|
||||
build: .
|
||||
|
|
Loading…
Reference in New Issue