Skip to content

Commit 833ed76

Browse files
Merge pull request #218 from wttech/components-check-aborting
Components check aborting
2 parents 0ebd0a0 + bbc6911 commit 833ed76

File tree

6 files changed

+46
-1
lines changed

6 files changed

+46
-1
lines changed

examples/docker/src/aem/default/etc/aem.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,15 @@ instance:
7272
timeout: 10m
7373
# Max time in which socket connection to instance should be established
7474
reachable:
75+
skip: false
7576
timeout: 3s
7677
# Bundle state tracking
7778
bundle_stable:
79+
skip: false
7880
symbolic_names_ignored: []
7981
# OSGi events tracking
8082
event_stable:
83+
skip: false
8184
# Topics indicating that instance is not stable
8285
topics_unstable:
8386
- "org/osgi/framework/ServiceEvent/*"
@@ -91,18 +94,26 @@ instance:
9194
received_max_age: 5s
9295
# OSGi components state tracking
9396
component_stable:
97+
skip: false
98+
abort: true
9499
pids_ignored: []
95100
pids_failed_activation: ["*"]
96101
pids_unsatisfied_reference: []
97102
# Sling Installer tracking
98103
installer:
104+
skip: false
99105
# JMX state checking
100106
state: true
101107
# Pause Installation nodes checking
102108
pause: true
103109
# Specific endpoints / paths (like login page)
104110
path_ready:
105111
timeout: 10s
112+
login_page:
113+
skip: false
114+
path: "/libs/granite/core/content/login.html"
115+
status_code: 200
116+
contained_text: QUICKSTART_HOMEPAGE
106117

107118
# Managed locally (set up automatically)
108119
local:

pkg/cfg/defaults.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ func (c *Config) setDefaults() {
6565
v.SetDefault("instance.check.event_stable.details_ignored", []string{"*.*MBean", "org.osgi.service.component.runtime.ServiceComponentRuntime", "java.util.ResourceBundle"})
6666

6767
v.SetDefault("instance.check.component_stable.skip", false)
68+
v.SetDefault("instance.check.component_stable.abort", true)
6869
v.SetDefault("instance.check.component_stable.pids_ignored", []string{})
6970
v.SetDefault("instance.check.component_stable.pids_failed_activation", []string{"*"})
7071
v.SetDefault("instance.check.component_stable.pids_unsatisfied_reference", []string{})

pkg/check.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,7 @@ func (c EventStableChecker) Check(_ CheckContext, instance Instance) CheckResult
187187

188188
type ComponentStableChecker struct {
189189
Skip bool
190+
Abort bool
190191
PIDsIgnored []string
191192
PIDsFailedActivation []string
192193
PIDsUnsatisfiedReference []string
@@ -197,6 +198,7 @@ func NewComponentStableChecker(opts *CheckOpts) ComponentStableChecker {
197198

198199
return ComponentStableChecker{
199200
Skip: cv.GetBool("instance.check.component_stable.skip"),
201+
Abort: cv.GetBool("instance.check.component_stable.abort"),
200202
PIDsIgnored: cv.GetStringSlice("instance.check.component_stable.pids_ignored"),
201203
PIDsFailedActivation: cv.GetStringSlice("instance.check.component_stable.pids_failed_activation"),
202204
PIDsUnsatisfiedReference: cv.GetStringSlice("instance.check.component_stable.pids_unsatisfied_reference"),
@@ -225,6 +227,7 @@ func (c ComponentStableChecker) Check(_ CheckContext, instance Instance) CheckRe
225227
message := fmt.Sprintf("some components failed activation (%d): '%s'", failedComponentCount, failedComponents[0].PID)
226228
return CheckResult{
227229
ok: false,
230+
abort: c.Abort,
228231
message: message,
229232
}
230233
}
@@ -237,6 +240,7 @@ func (c ComponentStableChecker) Check(_ CheckContext, instance Instance) CheckRe
237240
message := fmt.Sprintf("some components unsatisfied (%d): '%s'", unsatisfiedComponentCount, unsatisfiedComponents[0].PID)
238241
return CheckResult{
239242
ok: false,
243+
abort: c.Abort,
240244
message: message,
241245
}
242246
}

pkg/project/app_classic/aem/default/etc/aem.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,12 +74,15 @@ instance:
7474
timeout: 10m
7575
# Max time in which socket connection to instance should be established
7676
reachable:
77+
skip: false
7778
timeout: 3s
7879
# Bundle state tracking
7980
bundle_stable:
81+
skip: false
8082
symbolic_names_ignored: []
8183
# OSGi events tracking
8284
event_stable:
85+
skip: false
8386
# Topics indicating that instance is not stable
8487
topics_unstable:
8588
- "org/osgi/framework/ServiceEvent/*"
@@ -93,19 +96,26 @@ instance:
9396
received_max_age: 5s
9497
# OSGi components state tracking
9598
component_stable:
99+
skip: false
100+
abort: true
96101
pids_ignored: []
97102
pids_failed_activation: ["*"]
98103
pids_unsatisfied_reference: []
99104
# Sling Installer tracking
100105
installer:
106+
skip: false
101107
# JMX state checking
102108
state: true
103109
# Pause Installation nodes checking
104110
pause: true
105111
# Specific endpoints / paths (like login page)
106112
path_ready:
107113
timeout: 10s
108-
114+
login_page:
115+
skip: false
116+
path: "/libs/granite/core/content/login.html"
117+
status_code: 200
118+
contained_text: QUICKSTART_HOMEPAGE
109119

110120
# Managed locally (set up automatically)
111121
local:

pkg/project/app_cloud/aem/default/etc/aem.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,18 +93,26 @@ instance:
9393
received_max_age: 5s
9494
# OSGi components state tracking
9595
component_stable:
96+
skip: false
97+
abort: true
9698
pids_ignored: []
9799
pids_failed_activation: ["*"]
98100
pids_unsatisfied_reference: []
99101
# Sling Installer tracking
100102
installer:
103+
skip: false
101104
# JMX state checking
102105
state: true
103106
# Pause Installation nodes checking
104107
pause: true
105108
# Specific endpoints / paths (like login page)
106109
path_ready:
107110
timeout: 10s
111+
login_page:
112+
skip: false
113+
path: "/libs/granite/core/content/login.html"
114+
status_code: 200
115+
contained_text: QUICKSTART_HOMEPAGE
108116

109117
# Managed locally (set up automatically)
110118
local:

pkg/project/instance/aem/default/etc/aem.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,15 @@ instance:
7272
timeout: 10m
7373
# Max time in which socket connection to instance should be established
7474
reachable:
75+
skip: false
7576
timeout: 3s
7677
# Bundle state tracking
7778
bundle_stable:
79+
skip: false
7880
symbolic_names_ignored: []
7981
# OSGi events tracking
8082
event_stable:
83+
skip: false
8184
# Topics indicating that instance is not stable
8285
topics_unstable:
8386
- "org/osgi/framework/ServiceEvent/*"
@@ -91,18 +94,26 @@ instance:
9194
received_max_age: 5s
9295
# OSGi components state tracking
9396
component_stable:
97+
skip: false
98+
abort: true
9499
pids_ignored: []
95100
pids_failed_activation: ["*"]
96101
pids_unsatisfied_reference: []
97102
# Sling Installer tracking
98103
installer:
104+
skip: false
99105
# JMX state checking
100106
state: true
101107
# Pause Installation nodes checking
102108
pause: true
103109
# Specific endpoints / paths (like login page)
104110
path_ready:
105111
timeout: 10s
112+
login_page:
113+
skip: false
114+
path: "/libs/granite/core/content/login.html"
115+
status_code: 200
116+
contained_text: QUICKSTART_HOMEPAGE
106117

107118
# Managed locally (set up automatically)
108119
local:

0 commit comments

Comments
 (0)