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 "system.provisionSystem" xmlrpc endpoint to calculate kickstart host properly (bsc#1215209) #7716

Merged
merged 3 commits into from
Oct 25, 2023

Conversation

meaksh
Copy link
Member

@meaksh meaksh commented Oct 19, 2023

What does this PR change?

This PR fixes an issue with system.provisionSystem endpoint, where the kickstart host that is used to generate tftpboot tree is calculated based on the hostname of the request, leading to wrongly assume localhost (and therefore generating wrong files) when connected to Uyuni XMLRPC API via localhost.

This PR makes this endpoint to use the same mechanism that the UI uses to calculate the kickstart host:

  • If request is done via an Uyuni Proxy -> use the first proxy address in the chain of Uyuni proxies.
  • Otherwise use default Cobbler host (Uyuni Server)

You can see the above mechanism implemented here: https://github.com/SUSE/spacewalk/blob/d4787b8757f0f5d2bbc56c5b325258349d56df09/java/code/src/com/redhat/rhn/frontend/action/kickstart/KickstartHelper.java#L258-L282

GUI diff

No difference.

  • DONE

Documentation

  • No documentation needed: only internal and user invisible changes

  • DONE

Test coverage

  • No tests: add explanation

  • No tests: already covered

  • Unit tests were added

  • Cucumber tests were added

  • DONE

Links

Tracks https://github.com/SUSE/spacewalk/issues/22528

  • DONE

Changelogs

Make sure the changelogs entries you are adding are compliant with https://github.com/uyuni-project/uyuni/wiki/Contributing#changelogs and https://github.com/uyuni-project/uyuni/wiki/Contributing#uyuni-projectuyuni-repository

If you don't need a changelog check, please mark this checkbox:

  • No changelog needed

If you uncheck the checkbox after the PR is created, you will need to re-run changelog_test (see below)

Re-run a test

If you need to re-run a test, please mark the related checkbox, it will be unchecked automatically once it has re-run:

  • Re-run test "changelog_test"
  • Re-run test "backend_unittests_pgsql"
  • Re-run test "java_pgsql_tests"
  • Re-run test "schema_migration_test_pgsql"
  • Re-run test "susemanager_unittests"
  • Re-run test "javascript_lint"
  • Re-run test "spacecmd_unittests"

@github-actions
Copy link
Contributor

Suggested tests to cover this Pull Request
  • minssh_salt_install_package
  • srv_power_management
  • min_bootstrap_api
  • srv_sync_products
  • min_bootstrap_reactivation
  • srv_sync_channels
  • proxy_cobbler_pxeboot
  • srv_distro_cobbler
  • min_rhlike_salt_install_package_and_patch
  • minkvm_guests
  • srv_handle_config_channels_with_ISS_v2
  • srv_rename_hostname
  • srv_enable_sync_products
  • srv_cobbler_profile
  • srv_monitoring
  • min_deblike_salt_install_with_staging
  • min_cve_audit
  • min_ansible_control_node
  • srv_power_management_redfish
  • min_retracted_patches
  • srv_user_configuration_salt_states
  • min_activationkey
  • allcli_action_chain
  • min_salt_pkgset_beacon
  • proxy_retail_pxeboot_and_mass_import
  • proxy_branch_network
  • min_bootstrap_script
  • srv_virtual_host_manager
  • min_cve_id_new_syntax
  • proxy_register_as_minion_with_script
  • min_deblike_salt_install_package
  • min_salt_install_package
  • buildhost_docker_build_image
  • min_salt_migration
  • srv_menu
  • proxy_as_pod_basic_tests
  • min_monitoring
  • minssh_bootstrap_api
  • srv_advanced_search
  • srv_cobbler_distro
  • srv_scc_user_credentials
  • min_action_chain
  • srv_first_settings
  • minssh_action_chain
  • srv_wait_for_reposync
  • min_check_patches_install
  • srv_maintenance_windows
  • srv_cobbler_sync
  • min_move_from_and_to_proxy
  • min_salt_install_with_staging
  • srv_cobbler_buildiso
  • min_project_lotus
  • min_ssh_tunnel
  • min_salt_software_states
  • min_config_state_channel_subscriptions
  • minssh_move_from_and_to_proxy
  • min_deblike_monitoring
  • min_salt_mgrcompat_state
  • allcli_software_channels_dependencies
  • allcli_system_group
  • srv_docker_cve_audit
  • min_empty_system_profiles
  • srv_reportdb
  • allcli_reboot
  • min_bootstrap_ssh_key
  • min_rhlike_salt
  • min_salt_formulas_advanced
  • min_recurring_action
  • min_salt_minion_details
  • min_salt_lock_packages
  • min_deblike_openscap_audit
  • min_rhlike_ssh
  • min_virthost
  • min_salt_openscap_audit
  • allcli_config_channel
  • min_timezone
  • min_rhlike_monitoring
  • min_salt_user_states
  • minssh_ansible_control_node
  • min_deblike_salt
  • buildhost_osimage_build_image
  • buildhost_bootstrap
  • min_rhlike_openscap_audit
  • allcli_sanity
  • min_deblike_ssh
  • min_config_state_channel
  • min_salt_minions_page
  • min_change_software_channel
  • sle_ssh_minion
  • min_salt_formulas
  • allcli_overview_systems_details
  • min_custom_pkg_download_endpoint
  • allcli_software_channels
  • sle_minion

@github-actions
Copy link
Contributor

👋 Hello! Thanks for contributing to our project 😄
☕ Acceptance tests will take same time (aprox. 1h)
👀 Once tests finish, you can check the cucumber report.
See the troubleshooting guide if you need any help.
⚠️ You should not merge if acceptance tests fail to pass
Happy hacking

Copy link
Contributor

@wweellddeerr wweellddeerr left a comment

Choose a reason for hiding this comment

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

Changes LGTM.

@meaksh meaksh merged commit 1219fb4 into master Oct 25, 2023
17 checks passed
@meaksh meaksh deleted the master-fix-xmlrpc-provision-server-endpoint branch October 25, 2023 15:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants