diff options
author | Kamil Trzciński <ayufan@ayufan.eu> | 2018-10-04 10:08:38 +0000 |
---|---|---|
committer | Kamil Trzciński <ayufan@ayufan.eu> | 2018-10-04 10:08:38 +0000 |
commit | 8ec0eda9cca95b7a8fd352e9cf38982ab177cfce (patch) | |
tree | b950dadd39c36f902867a08805cbbeefed8b4387 /app/controllers | |
parent | f3b3ee78df2331aff6e2428476f1f5af36334cb4 (diff) | |
parent | 5a60a54679ecc25c910385947811bcbd0d1b792f (diff) | |
download | gitlab-ce-8ec0eda9cca95b7a8fd352e9cf38982ab177cfce.tar.gz |
Merge branch '41922-simplify-runner-registration-token-resetting' into 'master'
Simplify runner registration token resetting
Closes #41922
See merge request gitlab-org/gitlab-ce!21658
Diffstat (limited to 'app/controllers')
-rw-r--r-- | app/controllers/admin/application_settings_controller.rb | 3 | ||||
-rw-r--r-- | app/controllers/groups/settings/ci_cd_controller.rb | 7 | ||||
-rw-r--r-- | app/controllers/projects/settings/ci_cd_controller.rb | 7 |
3 files changed, 16 insertions, 1 deletions
diff --git a/app/controllers/admin/application_settings_controller.rb b/app/controllers/admin/application_settings_controller.rb index b7c758a42ed..8040a14ef56 100644 --- a/app/controllers/admin/application_settings_controller.rb +++ b/app/controllers/admin/application_settings_controller.rb @@ -67,8 +67,9 @@ class Admin::ApplicationSettingsController < Admin::ApplicationController end end - def reset_runners_token + def reset_registration_token @application_setting.reset_runners_registration_token! + flash[:notice] = 'New runners registration token has been generated!' redirect_to admin_runners_path end diff --git a/app/controllers/groups/settings/ci_cd_controller.rb b/app/controllers/groups/settings/ci_cd_controller.rb index 6d9a225b771..93f3eb2be6d 100644 --- a/app/controllers/groups/settings/ci_cd_controller.rb +++ b/app/controllers/groups/settings/ci_cd_controller.rb @@ -10,6 +10,13 @@ module Groups define_secret_variables end + def reset_registration_token + @group.reset_runners_token! + + flash[:notice] = 'New runners registration token has been generated!' + redirect_to group_settings_ci_cd_path + end + private def define_secret_variables diff --git a/app/controllers/projects/settings/ci_cd_controller.rb b/app/controllers/projects/settings/ci_cd_controller.rb index a2d1b7866c2..3a1344651df 100644 --- a/app/controllers/projects/settings/ci_cd_controller.rb +++ b/app/controllers/projects/settings/ci_cd_controller.rb @@ -36,6 +36,13 @@ module Projects end end + def reset_registration_token + @project.reset_runners_token! + + flash[:notice] = 'New runners registration token has been generated!' + redirect_to namespace_project_settings_ci_cd_path + end + private def update_params |