Skip to content
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

Fix: Initialise default namespaces map config #5424

Merged
merged 3 commits into from
Oct 10, 2023

Conversation

wildum
Copy link
Contributor

@wildum wildum commented Oct 10, 2023

PR Description

Initialise a map to prevent panic

@wildum wildum requested a review from a team as a code owner October 10, 2023 13:35
@wildum wildum requested a review from a team as a code owner October 10, 2023 14:07
@@ -97,7 +97,9 @@ func (ctrl *eventController) runError(ctx context.Context) error {
}

defaultNamespaces := map[string]cache.Config{}
defaultNamespaces[ctrl.task.Namespace] = cache.Config{}
if ctrl.task.Namespace != "" {
Copy link
Member

Choose a reason for hiding this comment

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

Should we not initialise the map if the string is empty (and move the initialization inside this if clause?

@tpaschalis tpaschalis requested a review from rfratto October 10, 2023 14:14
Copy link
Member

@tpaschalis tpaschalis left a comment

Choose a reason for hiding this comment

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

🛥️

@tpaschalis tpaschalis merged commit 37c40cc into main Oct 10, 2023
6 checks passed
@tpaschalis tpaschalis deleted the fix-uninitialised-map-cache-default-namespace branch October 10, 2023 14:21
tpaschalis pushed a commit to tpaschalis/agent that referenced this pull request Oct 10, 2023
tpaschalis added a commit that referenced this pull request Oct 10, 2023
(cherry picked from commit 37c40cc)

Co-authored-by: William Dumont <[email protected]>
@github-actions github-actions bot added the frozen-due-to-age Locked due to a period of inactivity. Please open new issues or PRs if more discussion is needed. label Feb 21, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 21, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
frozen-due-to-age Locked due to a period of inactivity. Please open new issues or PRs if more discussion is needed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants