MCPcopy Create free account
hub / github.com/cloudfoundry/java-buildpack / loadConfig

Method loadConfig

src/java/containers/tomcat.go:616–639  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

614}
615
616func (t *TomcatContainer) loadConfig() (*tomcatConfig, error) {
617 tConfig := tomcatConfig{
618 Tomcat: Tomcat{
619 Version: "",
620 ExternalConfigurationEnabled: false,
621 },
622 ExternalConfiguration: ExternalConfiguration{
623 Version: "",
624 RepositoryRoot: "",
625 },
626 AccessLoggingSupport: AccessLoggingSupport{
627 AccessLogging: "disabled",
628 },
629 }
630 config := os.Getenv("JBP_CONFIG_TOMCAT")
631 if config != "" {
632 yamlHandler := common.YamlHandler{}
633 // overlay JBP_CONFIG_TOMCAT over default values
634 if err := yamlHandler.Unmarshal([]byte(config), &tConfig); err != nil {
635 return nil, fmt.Errorf("failed to parse JBP_CONFIG_TOMCAT: %w", err)
636 }
637 }
638 return &tConfig, nil
639}
640
641type tomcatConfig struct {
642 Tomcat Tomcat `yaml:"tomcat"`

Callers 1

SupplyMethod · 0.95

Calls 1

UnmarshalMethod · 0.95

Tested by

no test coverage detected