Sha256: 68e5303bbbb46c876a8197a6e732a65c6de9515edf49a766a7c5a4b83f8ac07e

Contents?: true

Size: 1.22 KB

Versions: 13

Compression:

Stored size: 1.22 KB

Contents

module ThreeScaleToolbox
  module Commands
    module ServiceCommand
      module CopyCommand
        class BumpProxyVersionTask
          attr_reader :service

          def initialize(service:)
            @service = service
          end

          ##
          # bumps proxy config version to propagate proxy settings updates
          def call
            # Proxy update is the mechanism to increase version of the proxy,
            # Hence propagating (mapping rules, poicies, oidc, auth) update to
            # latest proxy config, making available to gateway.

            # Currently it is done always because mapping rules, at least, are always created
            # So they need to be propagated
            proxy_settings = {
              # Adding harmless attribute to avoid empty body
              # update_proxy cannot be done with empty body
              # and must be done to increase proxy version
              # If proxy settings have not been changed since last update,
              # this request will not have effect and proxy config version will not be bumped.
              service_id: service.id
            }

            service.update_proxy proxy_settings
          end
        end
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
3scale_toolbox-1.0.1 lib/3scale_toolbox/commands/service_command/copy_command/bump_proxy_version_task.rb
3scale_toolbox-1.0.0 lib/3scale_toolbox/commands/service_command/copy_command/bump_proxy_version_task.rb
3scale_toolbox-0.20.0 lib/3scale_toolbox/commands/service_command/copy_command/bump_proxy_version_task.rb
3scale_toolbox-0.19.3 lib/3scale_toolbox/commands/service_command/copy_command/bump_proxy_version_task.rb
3scale_toolbox-0.19.2 lib/3scale_toolbox/commands/service_command/copy_command/bump_proxy_version_task.rb
3scale_toolbox-0.19.1 lib/3scale_toolbox/commands/service_command/copy_command/bump_proxy_version_task.rb
3scale_toolbox-0.19.0 lib/3scale_toolbox/commands/service_command/copy_command/bump_proxy_version_task.rb
3scale_toolbox-0.18.3 lib/3scale_toolbox/commands/service_command/copy_command/bump_proxy_version_task.rb
3scale_toolbox-0.18.2 lib/3scale_toolbox/commands/service_command/copy_command/bump_proxy_version_task.rb
3scale_toolbox-0.18.0 lib/3scale_toolbox/commands/service_command/copy_command/bump_proxy_version_task.rb
3scale_toolbox-0.17.1 lib/3scale_toolbox/commands/service_command/copy_command/bump_proxy_version_task.rb
3scale_toolbox-0.17.0 lib/3scale_toolbox/commands/service_command/copy_command/bump_proxy_version_task.rb
3scale_toolbox-0.16.0 lib/3scale_toolbox/commands/service_command/copy_command/bump_proxy_version_task.rb