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

Generated config wraps directives on one line, not properly formatted .conf #5056

Closed
jasonwilliams14 opened this issue Feb 8, 2024 · 4 comments
Assignees
Labels
backlog Pull requests/issues that are backlog items bug An issue reporting a potential bug

Comments

@jasonwilliams14
Copy link
Contributor

jasonwilliams14 commented Feb 8, 2024

Description:

Moving from 3.x to 3.4.2, the generated .conf has wrapping configs with the directives inside the comments.
An example:

The new conf in 3.4.2:

set $resource_namespace "default";# geoip headersproxy_set_header X-GEOIP-COUNTRY "$geoip2_data_country_code";proxy_set_header X-GEOIP-CITY "$geoip2_data_city_name";# uri rewriteproxy_set_header x-original-prefix /;rewrite "^/coffeel(/.*)$" $1 break;# cacheproxy_cache [cache_path(http://<path>);proxy_cache_valid 200     120m;proxy_cache_valid any     1s;proxy_cache_lock on;proxy_cache_min_uses 1;proxy_cache_revalidate on;proxy_cache_use_stale error timeout http_500 http_502 http_503 http_504;proxy_cache_background_update on;#proxy_hide_header Cache-Control;add_header Last-Modified $upstream_http_date;# add security headersadd_header 'X-Content-Type-Options' 'nosniff';add_header 'Referrer-Policy' 'strict-origin-when-cross-origin';

The same .conf generated in 3.x:

location ~ "^/coffee/" {
        set $service "coffee";
        set $resource_type "virtualserverroute";
        set $resource_name "coffee";
        set $resource_namespace "coffee";
        # geoip headers
        proxy_set_header X-GEOIP-COUNTRY "$geoip2_data_country_code";
        proxy_set_header X-GEOIP-CITY "$geoip2_data_city_name";
        # uri rewrite
        proxy_set_header x-original-prefix /;
        rewrite "^/coffee(/.*)$" $1 break;
        # cache
        proxy_cache [coffee-cache](http://coffee);
        proxy_cache_valid 200     120m;
        proxy_cache_valid any     1s;
        proxy_cache_lock on;
        proxy_cache_min_uses 1;
        proxy_cache_revalidate on;
        proxy_cache_use_stale error timeout http_500 http_502 http_503 http_504;
        proxy_cache_background_update on;
        #proxy_hide_header Cache-Control;
        add_header Last-Modified $upstream_http_date;
        # add security headers
        add_header 'X-Content-Type-Options' 'nosniff';
        add_header 'Referrer-Policy' 'strict-origin-when-cross-origin';

To reproduce the issue:

I tested on 3.1.1, then on 3.4.0 to 3.4.2.
3.1.1 generated the .conf correctly, as the second item above.
The 3.4.x releases generated all the directives on the same line above.

Environment:
Kind, K3d and AKS

Tested versions:
3.1.1, 3.2, 3.3 and 3.4.0, 3.4.1 and 3.4.2

The problem only occurs on the 3.4.x release.

Possible related issues:

#4824
#5020

Copy link

github-actions bot commented Feb 8, 2024

Hi @jasonwilliams14 thanks for reporting!

Be sure to check out the docs and the Contributing Guidelines while you wait for a human to take a look at this 🙂

Cheers!

@jasonwilliams14 jasonwilliams14 changed the title Generated config wraps directives inside comments Generated config wraps directives on one line, not properly formatted .conf Feb 8, 2024
@jasonwilliams14 jasonwilliams14 added the bug An issue reporting a potential bug label Feb 8, 2024
@vepatel
Copy link
Contributor

vepatel commented Feb 9, 2024

@jasonwilliams14 looks like a duplicate of #4824

@j1m-ryan
Copy link

j1m-ryan commented Feb 9, 2024

The fix for this bug is now cherry picked into release-3.4, so will appear in 3.4.3

@jasonwilliams14
Copy link
Contributor Author

@jasonwilliams14 looks like a duplicate of #4824

yep, linked to it in the description.

@shaun-nx shaun-nx added the backlog Pull requests/issues that are backlog items label Feb 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backlog Pull requests/issues that are backlog items bug An issue reporting a potential bug
Projects
None yet
Development

No branches or pull requests

4 participants