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
Fixes #29737 - Put smart proxy plugin local state into /var/lib/foreman-proxy #5197
Conversation
d0e176c
to
9d9c5dd
Compare
9d9c5dd
to
f1f8903
Compare
for some reason it seems to ignore the ansible repo, even though it was fixed yesterday |
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.
Looks like a valid bug, but we can improve it a bit more. It's part of https://github.com/theforeman/foreman-packaging/blob/rpm/develop/gem2rpm/smart_proxy_plugin.spec.erb so it's in every spec file for a smart proxy plugin.
@@ -11,14 +11,14 @@ | |||
|
|||
%global foreman_proxy_min_version 1.25 | |||
%global foreman_proxy_dir %{_root_datadir}/foreman-proxy | |||
%global foreman_proxy_statedir %{_root_localstatedir}/foreman-proxy | |||
%global foreman_proxy_statedir %{_root_localstatedir}/lib/foreman-proxy |
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.
Looks like f825335 introduced this so will need a cherry pick to 2.0. Prior to it, it was %{_localstatedir}/lib/foreman-proxy
. I think what was meant, was %{_sharedstatedir}
(see https://docs.fedoraproject.org/en-US/packaging-guidelines/RPMMacros/).
%global foreman_proxy_statedir %{_root_localstatedir}/lib/foreman-proxy | |
%global foreman_proxy_statedir %{_root_sharedstatedir}/foreman-proxy |
Note that the definition of _root_localstatedir
should also be changed a few lines above then.
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.
Would you mind changing it in the gem2rpm template too and packages/plugins/rubygem-smart_proxy_*/*.spec
so we're consistent? Otherwise we might see the same bug pop up again at some point in the future.
I don't mind. Should I also bump release versions in all the specs I touch? |
Yes, I think that would be good. |
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.
I think CI will shout at you for missing changelogs.
%{!?_root_sysconfdir:%global _root_sysconfdir %{_sysconfdir}} | ||
|
||
%global gem_name <%= spec.name %> | ||
%global plugin_name <%= spec.name.sub(/\Asmart_proxy_/, '') %> | ||
|
||
%global foreman_proxy_min_version 1.24 | ||
%global foreman_proxy_dir %{_root_datadir}/foreman-proxy | ||
%global foreman_proxy_statedir %{_root_localstatedir}/foreman-proxy | ||
%global foreman_proxy_statedir %{_root_sharedstatedir}/foreman-proxy | ||
%global foreman_proxy_bundlerd_dir %{foreman_proxy_dir}/bundler.d | ||
%global foreman_proxy_settingsd_dir %{_root_sysconfdir}/foreman-proxy/settings.d | ||
%global smart_proxy_dynflow_bundlerd_dir %{!?scl:/opt/theforeman/tfm/root}%{_datadir}/smart_proxy_dynflow_core/bundler.d |
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.
Unrelated, but @zjhuntin this looks like it might break on EL8
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.
Why is that?
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.
Doesn't this mean it'll be prefixed with /opt/theforeman/tfm/root
on EL8?
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.
Seems to be working as expected if you compare:
http://koji.katello.org/koji/rpminfo?rpmID=340390
http://koji.katello.org/koji/rpminfo?rpmID=340393
packages/plugins/rubygem-smart_proxy_salt_core/rubygem-smart_proxy_salt_core.spec
Outdated
Show resolved
Hide resolved
37af15e
to
560a5d6
Compare
@adamruzicka I missed a spot when updating the repoclosure, https://github.com/theforeman/foreman-packaging/blob/rpm/develop/package_manifest.yaml#L639 also needs added |
Looks like salt is failing:
Not sure how this ever built for EL8. |
@adamruzicka If you could update the salt plugin, we can get this in. The way we've been doing it is: |
%if 0%{?fedora} || 0%{?rhel} >= 8 | ||
sed -i 's|#!/usr/bin/env python|#!/usr/bin/python3|g' sbin/upload-salt-reports | ||
%endif |
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.
I think this needs to happen in the build phase. You're now modifying the source files, but in %install it's already %{gem_instdir}/sbin/upload-salt-reports
:
*** ERROR: ambiguous python shebang in /usr/share/gems/gems/smart_proxy_salt-3.1.1/sbin/upload-salt-reports: #!/usr/bin/env python. Change it to python3 (or python2) explicitly.
*** ERROR: ambiguous python shebang in /usr/sbin/upload-salt-reports: #!/usr/bin/env python. Change it to python3 (or python2) explicitly.
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.
Yeah, I noticed late at night it didn't have the desired effect. I'll have to spin up an environment for buidling packages to reduce rtt for this
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.
You can also submit a PR with just salt to get quicker testing.
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.
👍 If you want to just pull salt out of this PR and put it on its own we can get the bulk of the changes in and you can iterate faster.
and bump release versions
113199e
to
4cbbfd8
Compare
Took smart_proxy_salt out to deal with it separately |
No description provided.