File tree 2 files changed +8
-1
lines changed 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -679,7 +679,9 @@ func (t *TriggerDefinition) Apply(obj runtime.Object) error {
679
679
}
680
680
681
681
// use the canonical ImageChangeTrigger with nil From
682
- strategyTrigger .Auto = trigger .Auto
682
+ if strategyTrigger != nil {
683
+ strategyTrigger .Auto = trigger .Auto
684
+ }
683
685
if reflect .DeepEqual (strategyTrigger , & trigger ) {
684
686
change .From = nil
685
687
}
Original file line number Diff line number Diff line change @@ -20,6 +20,8 @@ os::cmd::expect_success 'oc new-app centos/ruby-22-centos7~https://github.com/op
20
20
os::cmd::expect_success ' oc get bc/ruby-hello-world'
21
21
os::cmd::expect_success ' oc get dc/ruby-hello-world'
22
22
23
+ os::cmd::expect_success " oc new-build --name=scratch --docker-image=scratch --dockerfile='FROM scratch'"
24
+
23
25
os::test::junit::declare_suite_start " cmd/triggers/buildconfigs"
24
26
# # Build configs
25
27
@@ -75,6 +77,9 @@ os::cmd::expect_success_and_not_text 'oc set triggers bc/ruby-hello-world' 'imag
75
77
os::cmd::expect_success_and_text ' oc set triggers bc --all' ' buildconfigs/ruby-hello-world.*image.*ruby-22-centos7:latest.*false'
76
78
os::cmd::expect_success_and_text ' oc set triggers bc --all --auto' ' updated'
77
79
os::cmd::expect_success_and_text ' oc set triggers bc --all' ' buildconfigs/ruby-hello-world.*image.*ruby-22-centos7:latest.*true'
80
+ # set a trigger on a build that doesn't have an imagestream strategy.from-image
81
+ os::cmd::expect_success_and_text ' oc set triggers bc/scratch --from-image=test:latest' ' updated'
82
+
78
83
os::test::junit::declare_suite_end
79
84
80
85
os::test::junit::declare_suite_start " cmd/triggers/deploymentconfigs"
You can’t perform that action at this time.
0 commit comments