Skip to content

Conversation

@john-david3
Copy link
Contributor

Proposed changes

  • Added two environment variables to the make dev target
    • One for the manifest file directory path and the other for the collector config path
  • Created new default value for the manifest directory
  • Removed the manifest file path from file_manager_service.go

Checklist

Before creating a PR, run through this checklist and mark each as complete.

  • I have read the CONTRIBUTING document
  • I have run make install-tools and have attached any dependency changes to this pull request
  • If applicable, I have added tests that prove my fix is effective or that my feature works
  • If applicable, I have checked that any relevant tests pass after adding my changes
  • If applicable, I have updated any relevant documentation (README.md)
  • If applicable, I have tested my cross-platform changes on Ubuntu 22, Redhat 8, SUSE 15 and FreeBSD 13

@john-david3 john-david3 self-assigned this Apr 30, 2025
@john-david3 john-david3 requested a review from a team as a code owner April 30, 2025 13:07
@github-actions github-actions bot added the chore Pull requests for routine tasks label Apr 30, 2025
@oCHRISo oCHRISo added the v3.x Issues and Pull Requests related to the major version v3 label May 13, 2025
Makefile Outdated
dev: ## Run agent executable
@echo "🚀 Running App"
$(GORUN) -ldflags=$(DEBUG_LDFLAGS) $(PROJECT_DIR)/$(PROJECT_FILE)
COLLECTOR_CONFIG_PATH=$(COLLECTOR_PATH) MANIFEST_DIR_PATH=$(MANIFEST_DIR) $(GORUN) -ldflags=$(DEBUG_LDFLAGS) $(PROJECT_DIR)/$(PROJECT_FILE)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
COLLECTOR_CONFIG_PATH=$(COLLECTOR_PATH) MANIFEST_DIR_PATH=$(MANIFEST_DIR) $(GORUN) -ldflags=$(DEBUG_LDFLAGS) $(PROJECT_DIR)/$(PROJECT_FILE)
NGINX_AGENT_COLLECTOR_CONFIG_PATH=$(COLLECTOR_PATH) NGINX_AGENT_MANIFEST_DIR_PATH=$(MANIFEST_DIR) $(GORUN) -ldflags=$(DEBUG_LDFLAGS) $(PROJECT_DIR)/$(PROJECT_FILE)

Shouldn't the env variables have the NGINX_AGENT_ prefix?

Copy link
Contributor Author

@john-david3 john-david3 Jun 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I might be wrong, but does viper not do this automatically in the registerFlags method in config.go:

viperInstance.SetEnvPrefix(EnvPrefix)

@john-david3 john-david3 merged commit 9f24720 into main Jun 10, 2025
23 checks passed
@john-david3 john-david3 deleted the make-dev-manifest-dir-var branch June 10, 2025 14:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore Pull requests for routine tasks v3.x Issues and Pull Requests related to the major version v3

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants