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

render profiles and data-collector upstreams correctly #1665

Merged
merged 1 commit into from
May 7, 2019

Conversation

sdelano
Copy link
Contributor

@sdelano sdelano commented May 6, 2019

when setting the configuration value insecure_addon_compat, the
chef-server library code does not render the secrets from the
secrets helper into the PrivateChef hash, which results specifically
in data_collector['token'] not showing up there. when configured
to proxy compliance profiles and the data-collector endpoint, however,
the nginx recipe was relying on this field being present for the
upstreams to be rendered into the config. this resulted in us never
rendering the correct upstreams in insecure_addon_compat mode.

this change makes it so that the profiles and data-collector upstreams
will always be rendered if their root_url is configured. if, by
chance, the user doesn't have the data_collector token secret set,
we'll now see a 401 response code and an error message instead of a
confusing and misleading 404.

Signed-off-by: Stephen Delano [email protected]

Issues Resolved

[List any existing issues this PR resolves, or any Discourse or
StackOverflow discussion that's relevant]

Internal support issue: https://getchef.zendesk.com/agent/tickets/21598

Check List

when setting the configuration value `insecure_addon_compat`, the
chef-server library code does not render the secrets from the
secrets helper into the PrivateChef hash, which results specifically
in `data_collector['token']` not showing up there. when configured
to proxy compliance profiles and the data-collector endpoint, however,
the nginx recipe was relying on this field being present for the
upstreams to be rendered into the config. this resulted in us never
rendering the correct upstreams in `insecure_addon_compat` mode.

this change makes it so that the profiles and data-collector upstreams
will always be rendered if their root_url is configured. if, by
chance, the user doesn't have the `data_collector token` secret set,
we'll now see a 401 response code and an error message instead of a
confusing and misleading 404.

Signed-off-by: Stephen Delano <[email protected]>
@sdelano sdelano requested a review from a team May 6, 2019 22:11
Copy link
Contributor

@markan markan left a comment

Choose a reason for hiding this comment

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

Generally +1. I'll kick off a CI run and if it's good we can merge.

@markan
Copy link
Contributor

markan commented May 7, 2019

Copy link
Contributor

@markan markan left a comment

Choose a reason for hiding this comment

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

Passes CI

@markan markan merged commit 23e0458 into master May 7, 2019
@chef-ci chef-ci deleted the sd/dc-token-addon-compat branch May 7, 2019 20:37
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.

2 participants