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

NLB-8186: identify directives as parameters in map blocks #134

Merged
merged 2 commits into from
Feb 19, 2025

Conversation

valyria257
Copy link
Collaborator

Proposed changes

Crossplane parses map-like directives by adding the parameters in their bodies to the payload
as Directives. However, the parameters within the map blocks are not valid nginx directives;
and therefore, it is useful to discern which Directive types that crossplane generates are
nginx directives or map parameters.

Checklist

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

  • I have read the CONTRIBUTING document
  • 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
  • I have updated any relevant documentation (README.md)

@valyria257 valyria257 requested a review from a team as a code owner February 18, 2025 18:04
types.go Outdated
Includes []int `json:"includes,omitempty"`
Block Directives `json:"block,omitempty"`
Comment *string `json:"comment,omitempty"`
MapBlockParameter bool `json:"mapBlockParameter,omitempty"`
Copy link
Contributor

Choose a reason for hiding this comment

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

do we need the getter? We could name this field IsMapBlockParameter?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Updated to IsMapBlockParameter and removed the getter

Crossplane parses map-like directives by adding the parameters in their bodies to the payload
as Directives. However, the parameters within the map blocks are not valid nginx directives;
and therefore, it is useful to discern which Directive types that crossplane generates are
nginx directives or map parameters.
From golangci-lint's changelog:
"[v1.64.2] is the last minor release of golangci-lint v1. The next release will be golangci-lint v2."

The repo's current golangci.yaml configuration contains deprecated fields which break when using v2.
This pins the golangci-lint version until we can update the configuration to be compatable with v2.
Copy link
Contributor

@ryepup ryepup left a comment

Choose a reason for hiding this comment

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

great commit messages, BTW!

@valyria257 valyria257 merged commit 457a6fa into main Feb 19, 2025
2 checks passed
@valyria257 valyria257 deleted the nlb-6186-map-args branch February 19, 2025 23:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants