-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rename api key to agent api key #2814
Conversation
WalkthroughThe changes primarily revolve around renaming the Changes
TipsChat with CodeRabbit Bot (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review Status
Actionable comments generated: 3
Files ignored due to filter (6)
- docs/gen/config/extensions/fluxninja/extension-swagger.yaml
- manifests/charts/aperture-agent/crds/fluxninja.com_agents.yaml
- manifests/charts/aperture-agent/templates/agent-deployment.yaml
- manifests/charts/aperture-controller/crds/fluxninja.com_controllers.yaml
- operator/config/crd/bases/fluxninja.com_agents.yaml
- operator/config/crd/bases/fluxninja.com_controllers.yaml
Files selected for processing (17)
- docs/agent.md (1 hunks)
- docs/content/get-started/installation/agent/docker.md (1 hunks)
- docs/content/get-started/installation/agent/kubernetes/namespace-scoped/namespace-scoped.md (1 hunks)
- docs/content/get-started/self-hosting/agent.md (1 hunks)
- docs/content/reference/configuration/agent.md (1 hunks)
- docs/content/reference/configuration/controller.md (1 hunks)
- docs/content/reference/fluxninja.md (1 hunks)
- docs/controller.md (1 hunks)
- extensions/fluxninja/extconfig/extconfig.go (2 hunks)
- extensions/fluxninja/heartbeats/heartbeats.go (4 hunks)
- extensions/fluxninja/heartbeats/peers-watcher.go (1 hunks)
- extensions/fluxninja/heartbeats/provide.go (1 hunks)
- extensions/fluxninja/otel/otel_test.go (1 hunks)
- extensions/fluxninja/otel/provide.go (2 hunks)
- operator/controllers/agent/config_test.tpl (1 hunks)
- operator/controllers/utils.go (1 hunks)
- operator/controllers/utils_test.go (1 hunks)
Files skipped from review due to trivial changes (7)
- docs/content/get-started/installation/agent/docker.md
- docs/content/get-started/installation/agent/kubernetes/namespace-scoped/namespace-scoped.md
- docs/content/reference/fluxninja.md
- docs/controller.md
- extensions/fluxninja/heartbeats/provide.go
- operator/controllers/agent/config_test.tpl
- operator/controllers/utils.go
Additional comments (Suppressed): 14
docs/content/get-started/self-hosting/agent.md (1)
- 68-71: The
api_key
field has been renamed toagent_api_key
. Ensure that all references to this field in the codebase have been updated to reflect this change. Also, verify that the documentation and instructions have been updated to instruct users to useagent_api_key
instead ofapi_key
.extensions/fluxninja/otel/otel_test.go (1)
- 27-34: The key "api_key" has been renamed to "agent_api_key" in the configuration map. Ensure that all instances where this configuration is used have been updated to reflect this change.
extensions/fluxninja/heartbeats/peers-watcher.go (1)
- 34-43: The logic for checking the API key has been updated to first check for
AgentAPIKey
and then fall back toAPIKey
ifAgentAPIKey
is not available. This is a good approach for maintaining backward compatibility. However, ensure that all instances whereAPIKey
is used have been updated to this new logic.docs/agent.md (1)
- 782-788: The renaming of
APIKey
toAgentAPIKey
is reflected correctly in the documentation. Ensure that all references toAPIKey
in the documentation and code comments have been updated toAgentAPIKey
to maintain consistency.extensions/fluxninja/extconfig/extconfig.go (2)
26-35: The
APIKey
field has been deprecated and replaced withAgentAPIKey
. Ensure that all references toAPIKey
in the codebase have been updated toAgentAPIKey
where necessary. Also, make sure that the new fieldAgentAPIKey
is properly documented and the deprecation ofAPIKey
is communicated to the users.80-95: The logic for retrieving the API key has been updated to check for
AgentAPIKey
first and fall back toAPIKey
if not available. This is a good approach to maintain backward compatibility. However, ensure that this fallback logic is consistently applied throughout the codebase.extensions/fluxninja/heartbeats/heartbeats.go (4)
66-66: The
APIKey
field has been renamed toapiKey
. Ensure that all references to this field in the codebase have been updated to match the new name.84-87: The logic for retrieving the API key has been updated to check for
AgentAPIKey
first and fall back toAPIKey
if not available. This is a good approach to maintain backward compatibility.263-263: The
apiKey
is being added to the metadata of the outgoing context. Ensure that the receiving end of this context is expecting the key to beapiKey
and notAPIKey
.287-287: The
apiKey
is being added to the request header. Ensure that the server is expecting the key to beapiKey
and notAPIKey
.docs/content/reference/configuration/agent.md (1)
- 1433-1435: The deprecation of the old
APIKey
field is clearly mentioned. Ensure that all references to the oldAPIKey
field in the codebase have been updated toAgentAPIKey
. Also, verify that the fallback logic toAPIKey
is correctly implemented wherever necessary.extensions/fluxninja/otel/provide.go (2)
64-69: The function now checks for both
AgentAPIKey
andAPIKey
before returning. This is a good practice as it ensures that at least one of the keys is present before proceeding. However, ensure that the rest of the codebase is updated to handle the newAgentAPIKey
field and that it falls back toAPIKey
whenAgentAPIKey
is not available.226-237: The
apiKey
is now set toAgentAPIKey
if it's available, otherwise it falls back toAPIKey
. This is a good practice as it provides backward compatibility for systems that still useAPIKey
. However, ensure that theauthorization
header is correctly set in all requests that use this configuration.operator/controllers/utils_test.go (1)
- 637-638: The environment variable "APERTURE_AGENT_FLUXNINJA_API_KEY" has been renamed to "APERTURE_AGENT_FLUXNINJA_AGENT_KEY". Ensure that this change is reflected in all places where this environment variable is used, including documentation, scripts, and configuration files.
Please make sure that this change does not break backward compatibility for users upgrading their Aperture installations |
ee317c0
to
681f7cd
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review Status
Actionable comments generated: 2
Files ignored due to filter (6)
- docs/gen/config/extensions/fluxninja/extension-swagger.yaml
- manifests/charts/aperture-agent/crds/fluxninja.com_agents.yaml
- manifests/charts/aperture-agent/templates/agent-deployment.yaml
- manifests/charts/aperture-controller/crds/fluxninja.com_controllers.yaml
- operator/config/crd/bases/fluxninja.com_agents.yaml
- operator/config/crd/bases/fluxninja.com_controllers.yaml
Files selected for processing (17)
- docs/agent.md (1 hunks)
- docs/content/get-started/installation/agent/docker.md (1 hunks)
- docs/content/get-started/installation/agent/kubernetes/namespace-scoped/namespace-scoped.md (1 hunks)
- docs/content/get-started/self-hosting/agent.md (1 hunks)
- docs/content/reference/configuration/agent.md (1 hunks)
- docs/content/reference/configuration/controller.md (1 hunks)
- docs/content/reference/fluxninja.md (1 hunks)
- docs/controller.md (1 hunks)
- extensions/fluxninja/extconfig/extconfig.go (2 hunks)
- extensions/fluxninja/heartbeats/heartbeats.go (4 hunks)
- extensions/fluxninja/heartbeats/peers-watcher.go (1 hunks)
- extensions/fluxninja/heartbeats/provide.go (1 hunks)
- extensions/fluxninja/otel/otel_test.go (1 hunks)
- extensions/fluxninja/otel/provide.go (2 hunks)
- operator/controllers/agent/config_test.tpl (1 hunks)
- operator/controllers/utils.go (1 hunks)
- operator/controllers/utils_test.go (1 hunks)
Files skipped from review due to trivial changes (8)
- docs/content/get-started/installation/agent/docker.md
- docs/content/get-started/installation/agent/kubernetes/namespace-scoped/namespace-scoped.md
- docs/content/reference/configuration/agent.md
- docs/content/reference/configuration/controller.md
- docs/content/reference/fluxninja.md
- extensions/fluxninja/otel/otel_test.go
- operator/controllers/agent/config_test.tpl
- operator/controllers/utils.go
Additional comments (Suppressed): 12
docs/controller.md (1)
- 513-513: The
AgentAPIKey
field has been introduced to replace theAPIKey
field. Ensure that all references toAPIKey
in the codebase have been updated toAgentAPIKey
. Also, verify that the logic for retrieving the API key checksAgentAPIKey
first and falls back toAPIKey
for backward compatibility.operator/controllers/utils_test.go (1)
- 637-637: The environment variable
APERTURE_AGENT_FLUXNINJA_API_KEY
has been renamed toAPERTURE_AGENT_FLUXNINJA_AGENT_API_KEY
. Ensure that this change is reflected in all parts of the codebase where this environment variable is used. Also, verify that the new environment variable is set correctly in the deployment environment.extensions/fluxninja/heartbeats/heartbeats.go (4)
66-66: The
apiKey
field has been renamed fromAPIKey
. Ensure that all references to this field in the codebase have been updated to use the new name. This change is consistent with the PR summary, which mentions renamingAPIKey
toAgentAPIKey
across the codebase.84-88: The logic for retrieving the API key has been updated to check
AgentAPIKey
first and fall back toAPIKey
for backward compatibility. This is a good practice as it ensures that existing functionality will not break while allowing the use of the newAgentAPIKey
. However, it's important to ensure that the deprecation ofAPIKey
is clearly communicated to users and developers.264-265: The API key is added to the metadata of the outgoing context using the new
apiKey
field. Ensure that the server-side logic has been updated to retrieve the API key from the new field.288-288: The API key is added to the request header using the new
apiKey
field. Ensure that the server-side logic has been updated to retrieve the API key from the new field.docs/content/get-started/self-hosting/agent.md (1)
- 68-71: The
api_key
field has been replaced withagent_api_key
. Ensure that all references to this field in the codebase have been updated accordingly. Also, verify that the documentation and instructions have been updated to reflect this change.extensions/fluxninja/heartbeats/provide.go (1)
- 68-73: The function now checks for both
AgentAPIKey
andAPIKey
for backward compatibility. Ensure that all calls to this function throughout the codebase have been updated to match the new logic. Also, verify that the fallback mechanism toAPIKey
whenAgentAPIKey
is not available is working as expected.extensions/fluxninja/otel/provide.go (2)
64-70: The new hunk introduces a check for both
AgentAPIKey
andAPIKey
to ensure backward compatibility. This is a good practice as it allows the system to continue functioning with the oldAPIKey
if the newAgentAPIKey
is not available. However, it's important to ensure that the deprecation ofAPIKey
is communicated clearly to users and that a timeline for its removal is provided. This will encourage users to transition to the newAgentAPIKey
and prevent potential issues in the future whenAPIKey
is removed.227-234: The new hunk introduces a fallback mechanism to use the old
APIKey
if the newAgentAPIKey
is not available. This is a good practice for maintaining backward compatibility. However, it's important to ensure that theAgentAPIKey
is prioritized over theAPIKey
when both are available. This will encourage the use of the newAgentAPIKey
and ensure that the system transitions smoothly to the new key.extensions/fluxninja/extconfig/extconfig.go (2)
26-35: The renaming of
APIKey
toAgentAPIKey
is clear and the deprecation ofAPIKey
is well documented. However, ensure that all instances where this configuration is used have been updated to useAgentAPIKey
instead ofAPIKey
. Also, verify that the validation rules forAgentAPIKey
are correctly set up.80-96: The logic for falling back to
APIKey
ifAgentAPIKey
is not set is correctly implemented. However, ensure that this fallback logic is consistently applied across all instances where the API key is used. Also, consider adding a warning log message when the deprecatedAPIKey
is used to encourage users to switch toAgentAPIKey
.Suggested change:
func provideEtcdConfigOverride(extensionConfig *FluxNinjaExtensionConfig) *etcdclient.ConfigOverride { if extensionConfig.EnableCloudController { apiKey := extensionConfig.AgentAPIKey if apiKey == "" { //nolint:staticcheck // SA1019 read APIKey config for backward compatibility apiKey = extensionConfig.APIKey + log.Warn("APIKey is deprecated, please use AgentAPIKey instead.") } return &etcdclient.ConfigOverride{ Namespace: "", Endpoints: []string{extensionConfig.Endpoint}, PerRPCCredentials: perRPCHeaders{ headers: map[string]string{ "apiKey": apiKey, }, }, OverriderName: "fluxninja extension",
@tanveergill The extension config reads the old |
681f7cd
to
b55bb14
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review Status
Actionable comments generated: 1
Files ignored due to filter (6)
- docs/gen/config/extensions/fluxninja/extension-swagger.yaml
- manifests/charts/aperture-agent/crds/fluxninja.com_agents.yaml
- manifests/charts/aperture-agent/templates/agent-deployment.yaml
- manifests/charts/aperture-controller/crds/fluxninja.com_controllers.yaml
- operator/config/crd/bases/fluxninja.com_agents.yaml
- operator/config/crd/bases/fluxninja.com_controllers.yaml
Files selected for processing (18)
- docs/agent.md (1 hunks)
- docs/content/get-started/installation/agent/docker.md (1 hunks)
- docs/content/get-started/installation/agent/kubernetes/namespace-scoped/namespace-scoped.md (1 hunks)
- docs/content/get-started/self-hosting/agent.md (1 hunks)
- docs/content/reference/configuration/agent.md (1 hunks)
- docs/content/reference/configuration/controller.md (1 hunks)
- docs/content/reference/fluxninja.md (1 hunks)
- docs/controller.md (1 hunks)
- extensions/fluxninja/extconfig/extconfig.go (2 hunks)
- extensions/fluxninja/heartbeats/heartbeats.go (4 hunks)
- extensions/fluxninja/heartbeats/peers-watcher.go (1 hunks)
- extensions/fluxninja/heartbeats/provide.go (1 hunks)
- extensions/fluxninja/otel/otel_test.go (1 hunks)
- extensions/fluxninja/otel/provide.go (2 hunks)
- operator/controllers/agent/config_test.tpl (1 hunks)
- operator/controllers/controller/config_test.tpl (1 hunks)
- operator/controllers/utils.go (1 hunks)
- operator/controllers/utils_test.go (1 hunks)
Files skipped from review due to trivial changes (9)
- docs/content/get-started/installation/agent/docker.md
- docs/content/get-started/installation/agent/kubernetes/namespace-scoped/namespace-scoped.md
- docs/content/reference/configuration/agent.md
- docs/content/reference/configuration/controller.md
- docs/content/reference/fluxninja.md
- extensions/fluxninja/otel/otel_test.go
- operator/controllers/agent/config_test.tpl
- operator/controllers/controller/config_test.tpl
- operator/controllers/utils.go
Additional comments (Suppressed): 13
docs/content/get-started/self-hosting/agent.md (1)
- 68-71: The
api_key
field has been replaced withagent_api_key
. Ensure that all references to this field in the codebase have been updated to reflect this change. Also, verify that the users of the documentation are informed about this change to avoid confusion.docs/controller.md (1)
- 513-513: The
APIKey
field has been renamed toAgentAPIKey
. Ensure that all references to this field in the codebase have been updated to reflect this change. Also, verify that the new environment variable "APERTURE_AGENT_FLUXNINJA_AGENT_API_KEY" is being set correctly in the deployment environment.docs/agent.md (1)
- 782-788: The
APIKey
field has been renamed toAgentAPIKey
in the documentation as well. Ensure that all references toAPIKey
in the documentation have been updated toAgentAPIKey
to maintain consistency. Also, verify that the example usage and any code snippets in the documentation have been updated to reflect this change.extensions/fluxninja/otel/provide.go (2)
64-70: The new hunk checks for both
AgentAPIKey
andAPIKey
to ensure backward compatibility. This is a good practice as it allows the system to function correctly even if theAgentAPIKey
is not provided. However, it's important to ensure that the deprecation ofAPIKey
is communicated clearly to the users and a timeline for its complete removal is provided. This will encourage users to switch toAgentAPIKey
and prevent potential issues in the future.227-234: The new hunk first checks if
AgentAPIKey
is available and uses it if it is. IfAgentAPIKey
is not available, it falls back to usingAPIKey
. This is a good practice for maintaining backward compatibility. However, it's important to ensure that the system behaves correctly when bothAgentAPIKey
andAPIKey
are provided. It might be a good idea to add a check for this scenario and decide which key should be used in such cases.extensions/fluxninja/heartbeats/peers-watcher.go (1)
- 34-44: The new code checks for the presence of
AgentAPIKey
and uses it if available, otherwise it falls back to using theAPIKey
. This is a good approach for maintaining backward compatibility. However, it's important to ensure that the deprecation ofAPIKey
is clearly communicated to users and that a plan is in place for eventually removing this fallback logic. Also, make sure that all parts of the code that use this function are updated to handle the newAgentAPIKey
field.- apiKey := extensionConfig.AgentAPIKey - if apiKey == "" { - //nolint:staticcheck // SA1019 read APIKey config for backward compatibility - apiKey = extensionConfig.APIKey - } + apiKey, ok := extensionConfig.AgentAPIKey + if !ok { + //nolint:staticcheck // SA1019 read APIKey config for backward compatibility + apiKey, ok = extensionConfig.APIKey + if !ok { + return PeersOut{}, nil + } + }operator/controllers/utils_test.go (1)
- 637-637: The environment variable "APERTURE_AGENT_FLUXNINJA_API_KEY" has been renamed to "APERTURE_AGENT_FLUXNINJA_AGENT_API_KEY". Ensure that this change is reflected in all places where this environment variable is used, including any deployment scripts, configuration files, or documentation. Also, make sure that the new environment variable is set in the environment where the application is running.
extensions/fluxninja/extconfig/extconfig.go (2)
26-35: The
APIKey
field has been deprecated and replaced withAgentAPIKey
. Ensure that all references toAPIKey
in the codebase have been updated toAgentAPIKey
. Also, verify that the new fieldAgentAPIKey
is being properly validated and used in the rest of the codebase.80-96: The logic to check for the presence of
AgentAPIKey
and use it if available, otherwise fall back to using theAPIKey
field, ensures backward compatibility. However, it's important to note that theAPIKey
field is deprecated and should be removed in a future version.apiKey := extensionConfig.AgentAPIKey if apiKey == "" { //nolint:staticcheck // SA1019 read APIKey config for backward compatibility apiKey = extensionConfig.APIKey }This code block can be refactored to a separate function that returns the API key. This would improve the modularity and maintainability of the code.
func getAPIKey(extensionConfig *FluxNinjaExtensionConfig) string { apiKey := extensionConfig.AgentAPIKey if apiKey == "" { //nolint:staticcheck // SA1019 read APIKey config for backward compatibility apiKey = extensionConfig.APIKey } return apiKey }And then use this function in the
provideEtcdConfigOverride
function:apiKey := getAPIKey(extensionConfig)extensions/fluxninja/heartbeats/heartbeats.go (4)
66-66: The field
APIKey
has been renamed toapiKey
. Ensure that all references to this field in the codebase have been updated to match the new name. Also, note that the field name is now unexported (starts with a lowercase letter), which means it can't be accessed directly from other packages. If this field needs to be accessed from other packages, consider providing getter and setter methods.84-88: The code now checks for the presence of
AgentAPIKey
and uses it if available, otherwise falls back to using theAPIKey
field. This is a good approach for maintaining backward compatibility. However, it would be beneficial to log a deprecation warning when theAPIKey
field is used to encourage the transition toAgentAPIKey
.apiKey := extensionConfig.AgentAPIKey if apiKey == "" { //nolint:staticcheck // SA1019 read APIKey config for backward compatibility apiKey = extensionConfig.APIKey + if apiKey != "" { + log.Warn().Msg("The use of APIKey is deprecated. Please use AgentAPIKey instead.") + } }
264-264: The metadata key "apiKey" has been kept the same. Ensure that the server-side code that reads this metadata key is also updated to handle the case where the value could now be an "Agent Key" instead of an "API Key".
288-288: The HTTP header key "apiKey" has been kept the same. Ensure that the server-side code that reads this header key is also updated to handle the case where the value could now be an "Agent Key" instead of an "API Key".
b55bb14
to
7a108db
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review Status
Actionable comments generated: 3
Files ignored due to filter (6)
- docs/gen/config/extensions/fluxninja/extension-swagger.yaml
- manifests/charts/aperture-agent/crds/fluxninja.com_agents.yaml
- manifests/charts/aperture-agent/templates/agent-deployment.yaml
- manifests/charts/aperture-controller/crds/fluxninja.com_controllers.yaml
- operator/config/crd/bases/fluxninja.com_agents.yaml
- operator/config/crd/bases/fluxninja.com_controllers.yaml
Files selected for processing (18)
- docs/agent.md (1 hunks)
- docs/content/get-started/installation/agent/docker.md (1 hunks)
- docs/content/get-started/installation/agent/kubernetes/namespace-scoped/namespace-scoped.md (1 hunks)
- docs/content/get-started/self-hosting/agent.md (1 hunks)
- docs/content/reference/configuration/agent.md (1 hunks)
- docs/content/reference/configuration/controller.md (1 hunks)
- docs/content/reference/fluxninja.md (1 hunks)
- docs/controller.md (1 hunks)
- extensions/fluxninja/extconfig/extconfig.go (2 hunks)
- extensions/fluxninja/heartbeats/heartbeats.go (4 hunks)
- extensions/fluxninja/heartbeats/peers-watcher.go (1 hunks)
- extensions/fluxninja/heartbeats/provide.go (1 hunks)
- extensions/fluxninja/otel/otel_test.go (1 hunks)
- extensions/fluxninja/otel/provide.go (2 hunks)
- operator/controllers/agent/config_test.tpl (1 hunks)
- operator/controllers/controller/config_test.tpl (1 hunks)
- operator/controllers/utils.go (1 hunks)
- operator/controllers/utils_test.go (1 hunks)
Files skipped from review due to trivial changes (8)
- docs/content/get-started/installation/agent/docker.md
- docs/content/get-started/installation/agent/kubernetes/namespace-scoped/namespace-scoped.md
- docs/content/reference/configuration/agent.md
- docs/content/reference/configuration/controller.md
- docs/content/reference/fluxninja.md
- extensions/fluxninja/otel/otel_test.go
- operator/controllers/controller/config_test.tpl
- operator/controllers/utils.go
Additional comments (Suppressed): 12
docs/content/get-started/self-hosting/agent.md (1)
- 68-71: The
api_key
field has been renamed toagent_api_key
. Ensure that all references to this field in the codebase have been updated to reflect this change. Also, verify that the new environment variable "APERTURE_AGENT_FLUXNINJA_AGENT_API_KEY" is set correctly in the deployment environment.extensions/fluxninja/heartbeats/provide.go (1)
- 68-73: The logic for checking the
AgentAPIKey
andAPIKey
fields has been updated to support backward compatibility. The function now checks forAgentAPIKey
first and falls back toAPIKey
ifAgentAPIKey
is not set. This change is consistent with the PR summary and seems to be implemented correctly. However, ensure that all parts of the code that use these keys have been updated to reflect this change.docs/controller.md (1)
- 513-513: The
APIKey
field has been renamed toAgentAPIKey
. Ensure that all references to this field in the codebase have been updated to reflect this change. Also, verify that the new field name is correctly used in the configuration files and environment variables.extensions/fluxninja/otel/provide.go (2)
64-70: The new code checks for both
AgentAPIKey
andAPIKey
before returning. This is a good practice for backward compatibility. However, it's important to ensure that the rest of the codebase is updated to prioritizeAgentAPIKey
overAPIKey
where applicable. Also, consider adding a deprecation warning whenAPIKey
is used.227-234: The new code correctly prioritizes
AgentAPIKey
overAPIKey
for authorization. This is consistent with the changes made in the rest of the codebase. However, consider adding a deprecation warning whenAPIKey
is used.operator/controllers/agent/config_test.tpl (1)
- 48-54: The
api_key
field has been deprecated and replaced withagent_api_key
. However, the deprecatedapi_key
field is still present in the configuration for backward compatibility. Ensure that all references toapi_key
in the codebase have been updated toagent_api_key
and that the fallback logic correctly usesapi_key
ifagent_api_key
is not set. Also, verify that the changes are reflected in the documentation and user instructions.docs/agent.md (1)
- 782-788: The
APIKey
field has been renamed toAgentAPIKey
as per the changes mentioned in the pull request summary. Ensure that all references to this field in the codebase have been updated to reflect this change. Also, verify that the new environment variable "APERTURE_AGENT_FLUXNINJA_AGENT_API_KEY" is being used instead of the old one "APERTURE_AGENT_FLUXNINJA_API_KEY". This change should also be reflected in the configuration files whereapi_key
has been replaced withagent_api_key
.extensions/fluxninja/extconfig/extconfig.go (1)
- 26-35: The
APIKey
field has been deprecated and replaced withAgentAPIKey
. Ensure that all references toAPIKey
in the codebase have been updated toAgentAPIKey
. Also, verify that the new fieldAgentAPIKey
is being properly validated and used throughout the codebase.extensions/fluxninja/heartbeats/heartbeats.go (3)
66-66: The field
apiKey
has been renamed fromAPIKey
. Ensure that all references to this field in the codebase have been updated to match the new name. Also, verify that this change does not break any functionality that relies on the oldAPIKey
field.264-264: The metadata key has been kept as "apiKey" even though the field has been renamed to
apiKey
. If the server-side code also has been updated to look for "AgentAPIKey", this could cause issues. Please verify that the server-side code still expects the key to be "apiKey".288-288: The request header key has been kept as "apiKey" even though the field has been renamed to
apiKey
. If the server-side code also has been updated to look for "AgentAPIKey", this could cause issues. Please verify that the server-side code still expects the key to be "apiKey".operator/controllers/utils_test.go (1)
- 637-637: The environment variable "APERTURE_AGENT_FLUXNINJA_API_KEY" has been renamed to "APERTURE_AGENT_FLUXNINJA_AGENT_API_KEY". Ensure that this change is reflected in all places where this environment variable is used, including deployment scripts, CI/CD pipelines, and documentation.
7a108db
to
c35829d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review Status
Actionable comments generated: 6
Files ignored due to filter (6)
- docs/gen/config/extensions/fluxninja/extension-swagger.yaml
- manifests/charts/aperture-agent/crds/fluxninja.com_agents.yaml
- manifests/charts/aperture-agent/templates/agent-deployment.yaml
- manifests/charts/aperture-controller/crds/fluxninja.com_controllers.yaml
- operator/config/crd/bases/fluxninja.com_agents.yaml
- operator/config/crd/bases/fluxninja.com_controllers.yaml
Files selected for processing (18)
- docs/agent.md (1 hunks)
- docs/content/get-started/installation/agent/docker.md (1 hunks)
- docs/content/get-started/installation/agent/kubernetes/namespace-scoped/namespace-scoped.md (1 hunks)
- docs/content/get-started/self-hosting/agent.md (1 hunks)
- docs/content/reference/configuration/agent.md (1 hunks)
- docs/content/reference/configuration/controller.md (1 hunks)
- docs/content/reference/fluxninja.md (1 hunks)
- docs/controller.md (1 hunks)
- extensions/fluxninja/extconfig/extconfig.go (2 hunks)
- extensions/fluxninja/heartbeats/heartbeats.go (4 hunks)
- extensions/fluxninja/heartbeats/peers-watcher.go (1 hunks)
- extensions/fluxninja/heartbeats/provide.go (1 hunks)
- extensions/fluxninja/otel/otel_test.go (1 hunks)
- extensions/fluxninja/otel/provide.go (2 hunks)
- operator/controllers/agent/config_test.tpl (1 hunks)
- operator/controllers/controller/config_test.tpl (1 hunks)
- operator/controllers/utils.go (1 hunks)
- operator/controllers/utils_test.go (1 hunks)
Files skipped from review due to trivial changes (8)
- docs/content/get-started/installation/agent/docker.md
- docs/content/get-started/installation/agent/kubernetes/namespace-scoped/namespace-scoped.md
- docs/content/reference/configuration/agent.md
- docs/content/reference/fluxninja.md
- extensions/fluxninja/otel/otel_test.go
- operator/controllers/agent/config_test.tpl
- operator/controllers/controller/config_test.tpl
- operator/controllers/utils.go
Additional comments (Suppressed): 9
extensions/fluxninja/heartbeats/provide.go (1)
- 68-73: The logic for checking the API key has been updated to consider both
AgentAPIKey
andAPIKey
. This change is backward compatible as it falls back toAPIKey
ifAgentAPIKey
is not set. However, ensure that all instances where this function is called have been updated to pass the correct configuration object with the newAgentAPIKey
field.docs/content/get-started/self-hosting/agent.md (1)
- 68-71: The
api_key
field has been renamed toagent_api_key
. Ensure that all references to this field in the codebase have been updated to reflect this change. Also, verify that the configuration files have been updated accordingly.docs/controller.md (1)
- 513-513: The
AgentAPIKey
field has been introduced replacing theAPIKey
field. Ensure that all references toAPIKey
in the codebase have been updated toAgentAPIKey
. Also, verify that the change is reflected in the configuration files and environment variables.docs/content/reference/configuration/controller.md (1)
- 945-962: The changes in this hunk reflect the renaming of the
APIKey
field toAgentAPIKey
as mentioned in the PR summary. The oldAPIKey
field is marked as deprecated and the newAgentAPIKey
field is introduced. This change is consistent with the PR summary and seems to be correctly implemented. However, ensure that all references to the oldAPIKey
field in the codebase have been updated to use the newAgentAPIKey
field. Also, verify that the deprecation of theAPIKey
field does not break any existing functionality or integrations that rely on it.extensions/fluxninja/heartbeats/heartbeats.go (2)
66-66: The
APIKey
field has been renamed toapiKey
and its visibility has been changed from public to private. This change is good for encapsulation and data hiding, but ensure that there are no external dependencies on this field.84-88: The logic has been updated to check if
AgentAPIKey
is empty and falls back toAPIKey
for backward compatibility. This is a good practice to ensure that existing configurations continue to work.operator/controllers/utils_test.go (1)
- 637-637: The environment variable "APERTURE_AGENT_FLUXNINJA_API_KEY" has been renamed to "APERTURE_AGENT_FLUXNINJA_AGENT_API_KEY". Ensure that this change is reflected in all places where this environment variable is used, including any deployment scripts, CI/CD pipelines, and documentation. Also, verify that the new environment variable is set in the environment where the application is running.
extensions/fluxninja/otel/provide.go (1)
- 64-70: The new code checks if both
AgentAPIKey
andAPIKey
are empty before returning. This is a good approach for backward compatibility as it allows the use of the deprecatedAPIKey
ifAgentAPIKey
is not set. However, ensure that this fallback logic is clearly documented for users who may still be using the deprecatedAPIKey
.extensions/fluxninja/extconfig/extconfig.go (1)
- 26-34: The
APIKey
field has been deprecated and replaced withAgentAPIKey
. Ensure that all references toAPIKey
in the codebase have been updated toAgentAPIKey
. Also, verify that the new fieldAgentAPIKey
is being properly validated and handled in the rest of the codebase.
Description of change
Checklist
Summary by CodeRabbit
APIKey
has been renamed toAgentAPIKey
across the codebase to improve clarity and consistency. This change affects the schema definitions, configuration files, and environment variables.APIKey
toAgentAPIKey
. This includes installation instructions and configuration references.APIKey
to ensure backward compatibility. However, users are encouraged to start usingAgentAPIKey
for future configurations.These changes aim to make the software more intuitive and user-friendly by using more descriptive terminology.