Skip to content

Commit

Permalink
Merge pull request #87 from newrelic-experimental/php-operator-cleanup
Browse files Browse the repository at this point in the history
fix: php agent codepath cleanup
  • Loading branch information
andrew-lozoya authored May 3, 2024
2 parents de7ef0d + af6947d commit 603ff6d
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ func main() {
pflag.StringVar(&autoInstrumentationNodeJS, "auto-instrumentation-nodejs-image", fmt.Sprintf("ghcr.io/newrelic-experimental/newrelic-agent-operator/instrumentation-nodejs:%s", v.AutoInstrumentationNodeJS), "The default New Relic NodeJS instrumentation image. This image is used when no image is specified in the CustomResource.")
pflag.StringVar(&autoInstrumentationPython, "auto-instrumentation-python-image", fmt.Sprintf("ghcr.io/newrelic-experimental/newrelic-agent-operator/instrumentation-python:%s", v.AutoInstrumentationPython), "The default New Relic Python instrumentation image. This image is used when no image is specified in the CustomResource.")
pflag.StringVar(&autoInstrumentationDotNet, "auto-instrumentation-dotnet-image", fmt.Sprintf("ghcr.io/newrelic-experimental/newrelic-agent-operator/instrumentation-dotnet:%s", v.AutoInstrumentationDotNet), "The default New Relic DotNet instrumentation image. This image is used when no image is specified in the CustomResource.")
pflag.StringVar(&autoInstrumentationPhp, "auto-instrumentation-php-image", fmt.Sprintf("ghcr.io/newrelic-experimental/newrelic-agent-operator/instrumentation-php:%s", v.AutoInstrumentationDotNet), "The default New Relic Php instrumentation image. This image is used when no image is specified in the CustomResource.")
pflag.StringVar(&autoInstrumentationPhp, "auto-instrumentation-php-image", fmt.Sprintf("ghcr.io/newrelic-experimental/newrelic-agent-operator/instrumentation-php:%s", v.AutoInstrumentationPhp), "The default New Relic Php instrumentation image. This image is used when no image is specified in the CustomResource.")
pflag.StringVar(&autoInstrumentationGo, "auto-instrumentation-go-image", fmt.Sprintf("ghcr.io/open-telemetry/opentelemetry-go-instrumentation/autoinstrumentation-go:%s", v.AutoInstrumentationGo), "The default Opentelemtry Go instrumentation image. This image is used when no image is specified in the CustomResource.")

pflag.StringArrayVar(&labelsFilter, "labels", []string{}, "Labels to filter away from propagating onto deploys")
Expand Down
2 changes: 1 addition & 1 deletion internal/config/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ func (c *Config) AutoInstrumentationDotNetImage() string {
return c.autoInstrumentationDotNetImage
}

// AutoInstrumentationDotNetImage returns New Relic DotNet auto-instrumentation container image.
// AutoInstrumentationPhpImage returns New Relic PHP auto-instrumentation container image.
func (c *Config) AutoInstrumentationPhpImage() string {
return c.autoInstrumentationPhpImage
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/instrumentation/php.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ func injectPhpagent(phpSpec v1alpha1.Php, pod corev1.Pod, index int) (corev1.Pod
return pod, nil
}

// setDotNetEnvVar function sets env var to the container if not exist already.
// setPhpEnvVar function sets env var to the container if not exist already.
// value of concatValues should be set to true if the env var supports multiple values separated by :.
// If it is set to false, the original container's env var value has priority.
func setPhpEnvVar(container *corev1.Container, envVarName string, envVarValue string, concatValues bool) {
Expand Down
2 changes: 1 addition & 1 deletion pkg/instrumentation/upgrade/upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ func (u *InstrumentationUpgrade) upgrade(_ context.Context, inst v1alpha1.Instru
// upgrade the image only if the image matches the annotation
if inst.Spec.Php.Image == autoInstPhp {
inst.Spec.Php.Image = u.DefaultAutoInstPhp
inst.Annotations[v1alpha1.AnnotationDefaultAutoInstrumentationDotNet] = u.DefaultAutoInstPhp
inst.Annotations[v1alpha1.AnnotationDefaultAutoInstrumentationPhp] = u.DefaultAutoInstPhp
}
}
autoInstGo := inst.Annotations[v1alpha1.AnnotationDefaultAutoInstrumentationGo]
Expand Down

0 comments on commit 603ff6d

Please sign in to comment.