Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/IMPLEMENTING_CONTAINERS.md
Original file line number Diff line number Diff line change
Expand Up @@ -663,7 +663,7 @@ func (t *TomcatContainer) Supply() error {
return fmt.Errorf("failed to install Tomcat: %w", err)
}

t.context.Log.Info("Installed Tomcat version %s", dep.Version)
t.context.Log.Info("Installed Tomcat (%s)", dep.Version)

// Write profile.d script
depsIdx := t.context.Stager.DepsIdx()
Expand Down
4 changes: 2 additions & 2 deletions src/integration/dist_zip_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ func testDistZip(platform switchblade.Platform, fixtures string) func(*testing.T
Expect(err).NotTo(HaveOccurred(), logs.String)

Expect(logs.String()).To(ContainSubstring("Java Buildpack"))
Expect(logs.String()).To(ContainSubstring("Installing OpenJDK 8."))
Expect(logs.String()).To(ContainSubstring("Installing OpenJDK (8."))
Eventually(deployment).Should(matchers.Serve(Not(BeEmpty())))
})

Expand All @@ -84,7 +84,7 @@ func testDistZip(platform switchblade.Platform, fixtures string) func(*testing.T
Expect(err).NotTo(HaveOccurred(), logs.String)

Expect(logs.String()).To(ContainSubstring("Java Buildpack"))
Expect(logs.String()).To(ContainSubstring("Installing OpenJDK 17."))
Expect(logs.String()).To(ContainSubstring("Installing OpenJDK (17."))
Eventually(deployment).Should(matchers.Serve(Not(BeEmpty())))
})
})
Expand Down
2 changes: 1 addition & 1 deletion src/integration/ratpack_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ func testRatpack(platform switchblade.Platform, fixtures string) func(*testing.T
Expect(err).NotTo(HaveOccurred(), logs.String)

Expect(logs.String()).To(ContainSubstring("Java Buildpack"))
Expect(logs.String()).To(ContainSubstring("Installing OpenJDK 17."))
Expect(logs.String()).To(ContainSubstring("Installing OpenJDK (17."))
Eventually(deployment).Should(matchers.Serve(Not(BeEmpty())))
})
})
Expand Down
2 changes: 1 addition & 1 deletion src/integration/spring_boot_cli_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ func testSpringBootCLI(platform switchblade.Platform, fixtures string) func(*tes
Expect(err).NotTo(HaveOccurred(), logs.String)

Expect(logs.String()).To(ContainSubstring("Java Buildpack"))
Expect(logs.String()).To(ContainSubstring("Installing OpenJDK 17."))
Expect(logs.String()).To(ContainSubstring("Installing OpenJDK (17."))
Eventually(deployment).Should(matchers.Serve(Not(BeEmpty())))
})
})
Expand Down
26 changes: 13 additions & 13 deletions src/integration/tomcat_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ func testTomcat(platform switchblade.Platform, fixtures string) func(*testing.T,
Execute(name, filepath.Join(fixtures, "containers", "tomcat_javax"))
Expect(err).NotTo(HaveOccurred(), logs.String)

Expect(logs.String()).To(ContainSubstring("Installing OpenJDK 8."))
Expect(logs.String()).To(ContainSubstring("Installing OpenJDK (8."))
Expect(logs.String()).To(ContainSubstring("Tomcat 9"))
Eventually(deployment).Should(matchers.Serve(ContainSubstring("OK")))
})
Expand All @@ -184,7 +184,7 @@ func testTomcat(platform switchblade.Platform, fixtures string) func(*testing.T,
Execute(name, filepath.Join(fixtures, "containers", "tomcat_javax"))
Expect(err).NotTo(HaveOccurred(), logs.String)

Expect(logs.String()).To(ContainSubstring("Installing OpenJDK 11."))
Expect(logs.String()).To(ContainSubstring("Installing OpenJDK (11."))
Expect(logs.String()).To(ContainSubstring("Tomcat 9"))
Eventually(deployment).Should(matchers.Serve(ContainSubstring("OK")))
})
Expand All @@ -197,7 +197,7 @@ func testTomcat(platform switchblade.Platform, fixtures string) func(*testing.T,
Execute(name, filepath.Join(fixtures, "containers", "tomcat_javax"))
Expect(err).NotTo(HaveOccurred(), logs.String)

Expect(logs.String()).To(ContainSubstring("Installing OpenJDK 17."))
Expect(logs.String()).To(ContainSubstring("Installing OpenJDK (17."))
Expect(logs.String()).To(ContainSubstring("Tomcat 9"))
Eventually(deployment).Should(matchers.Serve(ContainSubstring("OK")))
})
Expand All @@ -223,7 +223,7 @@ func testTomcat(platform switchblade.Platform, fixtures string) func(*testing.T,
Execute(name, filepath.Join(fixtures, "containers", "tomcat_jakarta"))
Expect(err).NotTo(HaveOccurred(), logs.String)

Expect(logs.String()).To(ContainSubstring("Installing OpenJDK 11."))
Expect(logs.String()).To(ContainSubstring("Installing OpenJDK (11."))
Expect(logs.String()).To(ContainSubstring("Tomcat 10"))
Eventually(deployment).Should(matchers.Serve(ContainSubstring("OK")))
})
Expand All @@ -236,7 +236,7 @@ func testTomcat(platform switchblade.Platform, fixtures string) func(*testing.T,
Execute(name, filepath.Join(fixtures, "containers", "tomcat_jakarta"))
Expect(err).NotTo(HaveOccurred(), logs.String)

Expect(logs.String()).To(ContainSubstring("Installing OpenJDK 17."))
Expect(logs.String()).To(ContainSubstring("Installing OpenJDK (17."))
Expect(logs.String()).To(ContainSubstring("Tomcat 10"))
Eventually(deployment).Should(matchers.Serve(ContainSubstring("OK")))
})
Expand All @@ -257,7 +257,7 @@ func testTomcat(platform switchblade.Platform, fixtures string) func(*testing.T,

Expect(err).NotTo(HaveOccurred(), logs.String)

Expect(logs.String()).To(ContainSubstring("Installing OpenJDK 17."))
Expect(logs.String()).To(ContainSubstring("Installing OpenJDK (17."))
Expect(logs.String()).To(ContainSubstring("Tomcat 10.1."))
Eventually(deployment).Should(matchers.Serve(ContainSubstring("OK")))
})
Expand All @@ -274,7 +274,7 @@ func testTomcat(platform switchblade.Platform, fixtures string) func(*testing.T,

Expect(err).NotTo(HaveOccurred(), logs.String)

Expect(logs.String()).To(ContainSubstring("Installing OpenJDK 11."))
Expect(logs.String()).To(ContainSubstring("Installing OpenJDK (11."))
Expect(logs.String()).To(ContainSubstring("memory"))
Eventually(deployment).Should(matchers.Serve(ContainSubstring("OK")))
})
Expand Down Expand Up @@ -320,7 +320,7 @@ func testTomcat(platform switchblade.Platform, fixtures string) func(*testing.T,

Expect(err).NotTo(HaveOccurred(), logs.String)

Expect(logs.String()).To(ContainSubstring("Installing OpenJDK 21."))
Expect(logs.String()).To(ContainSubstring("Installing OpenJDK (21."))
Expect(logs.String()).To(ContainSubstring("Tomcat"))

// If deployment succeeds, it means:
Expand All @@ -343,7 +343,7 @@ func testTomcat(platform switchblade.Platform, fixtures string) func(*testing.T,

Expect(err).NotTo(HaveOccurred(), logs.String)

Expect(logs.String()).To(ContainSubstring("Installing OpenJDK 17."))
Expect(logs.String()).To(ContainSubstring("Installing OpenJDK (17."))
Eventually(deployment).Should(matchers.Serve(ContainSubstring("OK")))
})

Expand All @@ -356,7 +356,7 @@ func testTomcat(platform switchblade.Platform, fixtures string) func(*testing.T,

Expect(err).NotTo(HaveOccurred(), logs.String)

Expect(logs.String()).To(ContainSubstring("Installing OpenJDK 21."))
Expect(logs.String()).To(ContainSubstring("Installing OpenJDK (21."))
Eventually(deployment).Should(matchers.Serve(ContainSubstring("OK")))
})
})
Expand All @@ -371,7 +371,7 @@ func testTomcat(platform switchblade.Platform, fixtures string) func(*testing.T,

Expect(err).NotTo(HaveOccurred(), logs.String)

Expect(logs.String()).To(ContainSubstring("Installing SAP Machine 17."))
Expect(logs.String()).To(ContainSubstring("Installing SAP Machine (17."))
Eventually(deployment).Should(matchers.Serve(ContainSubstring("OK")))
})

Expand All @@ -384,7 +384,7 @@ func testTomcat(platform switchblade.Platform, fixtures string) func(*testing.T,

Expect(err).NotTo(HaveOccurred(), logs.String)

Expect(logs.String()).To(ContainSubstring("Installing SAP Machine 21."))
Expect(logs.String()).To(ContainSubstring("Installing SAP Machine (21."))
Eventually(deployment).Should(matchers.Serve(ContainSubstring("OK")))
})

Expand All @@ -397,7 +397,7 @@ func testTomcat(platform switchblade.Platform, fixtures string) func(*testing.T,

Expect(err).NotTo(HaveOccurred(), logs.String)

Expect(logs.String()).To(ContainSubstring("Installing SAP Machine 25."))
Expect(logs.String()).To(ContainSubstring("Installing SAP Machine (25."))
Eventually(deployment).Should(matchers.Serve(ContainSubstring("OK")))
})
})
Expand Down
2 changes: 1 addition & 1 deletion src/java/containers/tomcat.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ func (t *TomcatContainer) Supply() error {
return fmt.Errorf("failed to install Tomcat: %w", err)
}

t.context.Log.Info("Installed Tomcat version %s", dep.Version)
t.context.Log.Info("Installed Tomcat (%s)", dep.Version)

// Get buildpack index for multi-buildpack support
depsIdx := t.context.Stager.DepsIdx()
Expand Down
8 changes: 3 additions & 5 deletions src/java/finalize/finalize.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,14 +153,12 @@ func (f *Finalizer) finalizeJRE() error {
return fmt.Errorf("failed to finalize JRE %s: %w", f.JREName, err)
}

f.Log.Info("JRE finalization complete")
f.Log.Debug("JRE finalization complete")
return nil
}

// finalizeFrameworks finalizes framework components (APM agents, etc.)
func (f *Finalizer) finalizeFrameworks(ctx *common.Context) error {
f.Log.BeginStep("Finalizing frameworks")

registry := frameworks.NewRegistry(ctx)
registry.RegisterStandardFrameworks()

Expand All @@ -175,10 +173,10 @@ func (f *Finalizer) finalizeFrameworks(ctx *common.Context) error {
return nil
}

f.Log.Info("Finalizing frameworks: [%v]", strings.Join(frameworkNames, ","))
f.Log.BeginStep("Finalizing frameworks [%v]", strings.Join(frameworkNames, ", "))

for i, framework := range detectedFrameworks {
f.Log.Info("Finalizing framework: %s", frameworkNames[i])
f.Log.Debug("Finalizing framework: %s", frameworkNames[i])
if err := framework.Finalize(); err != nil {
f.Log.Warning("Failed to finalize framework %s: %s", frameworkNames[i], err.Error())
// Continue with other frameworks even if one fails
Expand Down
10 changes: 7 additions & 3 deletions src/java/frameworks/app_dynamics.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func (a *AppDynamicsFramework) findAppDynamicsAgent(agentDir string) (string, er

// Supply installs the AppDynamics agent
func (a *AppDynamicsFramework) Supply() error {
a.context.Log.BeginStep("Installing AppDynamics Agent")
a.context.Log.Debug("Installing AppDynamics Agent")

// Get AppDynamics agent dependency from manifest
dep, err := a.context.Manifest.DefaultVersion("appdynamics")
Expand All @@ -70,7 +70,7 @@ func (a *AppDynamicsFramework) Supply() error {
a.context.Log.Warning("Could not install default AppDynamics configuration: %s", err.Error())
}

a.context.Log.Info("Installed AppDynamics Agent version %s", dep.Version)
a.context.Log.Debug("Installed AppDynamics Agent version %s", dep.Version)
return nil
}

Expand Down Expand Up @@ -102,7 +102,7 @@ func (a *AppDynamicsFramework) installDefaultConfiguration(agentDir string) erro
return fmt.Errorf("failed to write app-agent-config.xml: %w", err)
}

a.context.Log.Info("Installed default AppDynamics configuration")
a.context.Log.Debug("Installed default AppDynamics configuration")
a.context.Log.Debug(" - app-agent-config.xml (agent settings and filters)")
return nil
}
Expand Down Expand Up @@ -189,3 +189,7 @@ func (a *AppDynamicsFramework) Finalize() error {
a.context.Log.Info("Configured AppDynamics Agent for runtime (priority 11)")
return nil
}

func (a *AppDynamicsFramework) DependencyIdentifier() string {
return "appdynamics"
}
2 changes: 1 addition & 1 deletion src/java/frameworks/aspectj_weaver_agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ func (a *AspectJWeaverAgentFramework) Finalize() error {
return fmt.Errorf("failed to write java_opts file: %w", err)
}

a.context.Log.Info("AspectJ Weaver Agent configured successfully (priority 12)")
a.context.Log.Debug("AspectJ Weaver Agent configured successfully (priority 12)")
return nil
}

Expand Down
10 changes: 7 additions & 3 deletions src/java/frameworks/azure_application_insights_agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ func (a *AzureApplicationInsightsAgentFramework) Detect() (string, error) {

// Supply downloads and installs the Azure Application Insights agent
func (a *AzureApplicationInsightsAgentFramework) Supply() error {
a.context.Log.BeginStep("Installing Azure Application Insights agent")
a.context.Log.Debug("Installing Azure Application Insights agent")

// Get dependency from manifest
dep, err := a.context.Manifest.DefaultVersion("azure-application-insights")
Expand Down Expand Up @@ -134,7 +134,7 @@ func (a *AzureApplicationInsightsAgentFramework) installDefaultConfiguration(age
return fmt.Errorf("failed to write AI-Agent.xml: %w", err)
}

a.context.Log.Info("Installed default Azure Application Insights configuration")
a.context.Log.Debug("Installed default Azure Application Insights configuration")
a.context.Log.Debug(" - AI-Agent.xml (instrumentation settings)")
return nil
}
Expand Down Expand Up @@ -185,7 +185,7 @@ func (a *AzureApplicationInsightsAgentFramework) Finalize() error {
return fmt.Errorf("failed to write JAVA_OPTS for Azure Application Insights: %w", err)
}

a.context.Log.Info("Azure Application Insights agent configured")
a.context.Log.Debug("Azure Application Insights agent configured")
return nil
}

Expand Down Expand Up @@ -289,3 +289,7 @@ func (a *AzureApplicationInsightsAgentFramework) constructJarPath(agentDir strin
a.jarPath = matches[0]
return nil
}

func (a *AzureApplicationInsightsAgentFramework) DependencyIdentifier() string {
return "azure-application-insights"
}
4 changes: 2 additions & 2 deletions src/java/frameworks/checkmarx_iast_agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ func (c *CheckmarxIASTAgentFramework) Detect() (string, error) {

// Supply downloads and installs the Checkmarx IAST agent
func (c *CheckmarxIASTAgentFramework) Supply() error {
c.context.Log.BeginStep("Installing Checkmarx IAST agent")
c.context.Log.Debug("Installing Checkmarx IAST agent")

// Get credentials from service binding
credentials := c.getCredentials()
Expand Down Expand Up @@ -126,7 +126,7 @@ func (c *CheckmarxIASTAgentFramework) Finalize() error {
return fmt.Errorf("failed to write JAVA_OPTS for Checkmarx IAST: %w", err)
}

c.context.Log.Info("Checkmarx IAST agent configured")
c.context.Log.Debug("Checkmarx IAST agent configured")
return nil
}

Expand Down
14 changes: 9 additions & 5 deletions src/java/frameworks/client_certificate_mapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func (c *ClientCertificateMapperFramework) Detect() (string, error) {

// Supply installs the client certificate mapper JAR
func (c *ClientCertificateMapperFramework) Supply() error {
c.context.Log.BeginStep("Installing Client Certificate Mapper")
c.context.Log.Debug("Installing Client Certificate Mapper")

// Get client-certificate-mapper dependency from manifest
dep, err := c.context.Manifest.DefaultVersion("client-certificate-mapper")
Expand All @@ -53,7 +53,7 @@ func (c *ClientCertificateMapperFramework) Supply() error {
return fmt.Errorf("failed to install Client Certificate Mapper: %w", err)
}

c.context.Log.Info("Installed Client Certificate Mapper version %s", dep.Version)
c.context.Log.Debug("Installed Client Certificate Mapper version %s", dep.Version)
return nil
}

Expand All @@ -71,15 +71,15 @@ func (c *ClientCertificateMapperFramework) Finalize() error {

depsIdx := c.context.Stager.DepsIdx()
runtimePath := fmt.Sprintf("$DEPS_DIR/%s/client_certificate_mapper/%s", depsIdx, filepath.Base(matches[0]))

profileScript := fmt.Sprintf("export CLASSPATH=\"%s${CLASSPATH:+:$CLASSPATH}\"\n", runtimePath)

if err := c.context.Stager.WriteProfileD("client_certificate_mapper.sh", profileScript); err != nil {
return fmt.Errorf("failed to write client_certificate_mapper.sh profile.d script: %w", err)
}

c.context.Log.Debug("Client Certificate Mapper JAR will be added to classpath at runtime: %s", runtimePath)

return nil
}

Expand Down Expand Up @@ -111,3 +111,7 @@ type clientCertificateMapperConfig struct {
func (c *clientCertificateMapperConfig) isEnabled() bool {
return c.Enabled
}

func (c *ClientCertificateMapperFramework) DependencyIdentifier() string {
return "client-certificate-mapper"
}
8 changes: 6 additions & 2 deletions src/java/frameworks/container_customizer.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ func (c *ContainerCustomizerFramework) hasSpringBootJars(buildDir string) bool {

// Supply installs the Container Customizer library
func (c *ContainerCustomizerFramework) Supply() error {
c.context.Log.BeginStep("Installing Container Customizer")
c.context.Log.Debug("Installing Container Customizer")

// Get container-customizer dependency from manifest
dep, err := c.context.Manifest.DefaultVersion("container-customizer")
Expand All @@ -93,7 +93,7 @@ func (c *ContainerCustomizerFramework) Supply() error {
return fmt.Errorf("failed to install Container Customizer: %w", err)
}

c.context.Log.Info("Installed Container Customizer version %s", dep.Version)
c.context.Log.Debug("Installed Container Customizer version %s", dep.Version)
return nil
}

Expand Down Expand Up @@ -134,3 +134,7 @@ export CLASSPATH="%s:${CLASSPATH:-}"

return nil
}

func (c *ContainerCustomizerFramework) DependencyIdentifier() string {
return "container-customizer"
}
8 changes: 6 additions & 2 deletions src/java/frameworks/container_security_provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func (c *ContainerSecurityProviderFramework) Detect() (string, error) {

// Supply installs the container security provider JAR
func (c *ContainerSecurityProviderFramework) Supply() error {
c.context.Log.BeginStep("Installing Container Security Provider")
c.context.Log.Debug("Installing Container Security Provider")

// Get container-security-provider dependency from manifest
dep, err := c.context.Manifest.DefaultVersion("container-security-provider")
Expand All @@ -42,7 +42,7 @@ func (c *ContainerSecurityProviderFramework) Supply() error {
return fmt.Errorf("failed to install Container Security Provider: %w", err)
}

c.context.Log.Info("Installed Container Security Provider version %s", dep.Version)
c.context.Log.Debug("Installed Container Security Provider version %s", dep.Version)
return nil
}

Expand Down Expand Up @@ -257,3 +257,7 @@ type containerSecurityProviderConfig struct {
KeyManagerEnabled string `yaml:"key_manager_enabled"`
TrustManagerEnabled string `yaml:"trust_manager_enabled"`
}

func (c *ContainerSecurityProviderFramework) DependencyIdentifier() string {
return "container-security-provider"
}
Loading