Skip to content

Commit

Permalink
Allow halting on certificate errors
Browse files Browse the repository at this point in the history
When certificate errors are encountered, the fix is usually to restart
the affected pod. To allow this to happen automatically, add a
configuration setting for the Lighthouse agent.

The setting is disabled by default; it will be enabled by default by
the operator.

Signed-off-by: Stephen Kitt <[email protected]>
  • Loading branch information
skitt committed Oct 23, 2023
1 parent d4193c3 commit 237983d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 5 additions & 4 deletions pkg/agent/controller/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,11 @@ type Controller struct {
}

type AgentSpecification struct {
ClusterID string
Namespace string
GlobalnetEnabled bool `split_words:"true"`
Uninstall bool
ClusterID string
Namespace string
GlobalnetEnabled bool `split_words:"true"`
Uninstall bool
HaltOnCertificateError bool
}

type ServiceImportAggregator struct {
Expand Down
2 changes: 2 additions & 0 deletions pkg/agent/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,8 @@ func main() {
exitOnError(err, "Error processing env config for agent spec")
logger.Infof("AgentSpec: %#v", agentSpec)

util.AddCertificateErrorHandler(agentSpec.HaltOnCertificateError)

err = mcsv1a1.AddToScheme(scheme.Scheme)
exitOnError(err, "Error adding Multicluster v1alpha1 to the scheme")

Expand Down

0 comments on commit 237983d

Please sign in to comment.