Skip to content

Refactor openstack swift scaler#7232

Merged
wozniakjan merged 4 commits into
kedacore:mainfrom
dttung2905:refactor-openstack-swift-scaler
Nov 19, 2025
Merged

Refactor openstack swift scaler#7232
wozniakjan merged 4 commits into
kedacore:mainfrom
dttung2905:refactor-openstack-swift-scaler

Conversation

@dttung2905

@dttung2905 dttung2905 commented Nov 3, 2025

Copy link
Copy Markdown
Contributor

Checklist

Relates to #5797

@github-actions

github-actions Bot commented Nov 3, 2025

Copy link
Copy Markdown

Thank you for your contribution! 🙏

Please understand that we will do our best to review your PR and give you feedback as soon as possible, but please bear with us if it takes a little longer as expected.

While you are waiting, make sure to:

  • Add an entry in our changelog in alphabetical order and link related issue
  • Update the documentation, if needed
  • Add unit & e2e tests for your changes
  • GitHub checks are passing
  • Is the DCO check failing? Here is how you can fix DCO issues

Once the initial tests are successful, a KEDA member will ensure that the e2e tests are run. Once the e2e tests have been successfully completed, the PR may be merged at a later date. Please be patient.

Learn more about our contribution guide.

@keda-automation keda-automation requested review from a team November 3, 2025 23:05
@snyk-io

snyk-io Bot commented Nov 16, 2025

Copy link
Copy Markdown

Snyk checks have passed. No issues have been found so far.

Status Scanner Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@dttung2905 dttung2905 force-pushed the refactor-openstack-swift-scaler branch from dfc8e36 to 3aa2881 Compare November 16, 2025 16:51
@dttung2905 dttung2905 marked this pull request as ready for review November 16, 2025 16:51
@dttung2905

dttung2905 commented Nov 16, 2025

Copy link
Copy Markdown
Contributor Author

/run-e2e openstack_swift
Update: You can check the progress here

Comment thread pkg/scalers/openstack_swift_scaler.go Outdated
@dttung2905 dttung2905 changed the title WIP: Refactor openstack swift scaler Refactor openstack swift scaler Nov 17, 2025
Signed-off-by: dttung2905 <[email protected]>
@keda-automation keda-automation requested a review from a team November 17, 2025 18:23

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull Request Overview

This PR refactors the OpenStack Swift scaler to use KEDA's typed configuration framework, consolidating metadata parsing and validation logic while maintaining backward compatibility.

  • Consolidated openstackSwiftMetadata and openstackSwiftAuthenticationMetadata into a single struct with KEDA struct tags
  • Replaced manual parsing logic with the TypedConfig framework
  • Moved authentication validation into a dedicated Validate() method

Reviewed Changes

Copilot reviewed 2 out of 4 changed files in this pull request and generated no comments.

File Description
pkg/scalers/openstack_swift_scaler.go Refactored metadata structs to use KEDA tags; consolidated parsing functions; added validation method; simplified field access with PascalCase naming
pkg/scalers/openstack_swift_scaler_test.go Updated tests to use the unified parsing function; removed redundant authentication metadata parsing
schema/generated/scalers-schema.yaml Added OpenStack Swift scaler schema definition with all parameters
schema/generated/scalers-schema.json Added OpenStack Swift scaler schema definition in JSON format
Comments suppressed due to low confidence (1)

pkg/scalers/openstack_swift_scaler.go:108

  • Potential nil pointer dereference. If neither AppCredentialID nor UserID is set in the metadata (which passes validation), authOpts will remain nil and dereferencing it here will cause a panic. The validation method should ensure at least one authentication method is configured before reaching this point, but the code path allows authOpts to be nil.
	provider, err := openstack.AuthenticatedClient(*authOpts)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@wozniakjan wozniakjan left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

lgtm

Comment thread pkg/scalers/openstack_swift_scaler.go
@keda-automation keda-automation requested a review from a team November 18, 2025 09:05
@dttung2905

Copy link
Copy Markdown
Contributor Author

/run-e2e openstack_swift

@JorTurFer

JorTurFer commented Nov 19, 2025

Copy link
Copy Markdown
Member

/run-e2e openstack_swift
Update: You can check the progress here

@JorTurFer

Copy link
Copy Markdown
Member

/run-e2e openstack_swift

I think that yesterdays CF issues affected it, as the GH failed in the beginning

@rickbrouwer rickbrouwer added the ok-to-merge This PR can be merged label Nov 19, 2025
@wozniakjan wozniakjan merged commit 212135b into kedacore:main Nov 19, 2025
25 checks passed
alt-dima pushed a commit to alt-dima/keda that referenced this pull request Dec 13, 2025
* Refactor openstack swift scaler

Signed-off-by: dttung2905 <[email protected]>

* Add new schemas for scaler

Signed-off-by: dttung2905 <[email protected]>

* Fix from code review

Signed-off-by: dttung2905 <[email protected]>

* fix alignment in openstack swift scaler

Signed-off-by: Jan Wozniak <[email protected]>

---------

Signed-off-by: dttung2905 <[email protected]>
Signed-off-by: Jan Wozniak <[email protected]>
Co-authored-by: Jan Wozniak <[email protected]>
Signed-off-by: Dmitriy Altuhov <[email protected]>
tangobango5 pushed a commit to tangobango5/keda that referenced this pull request Dec 22, 2025
* Refactor openstack swift scaler

Signed-off-by: dttung2905 <[email protected]>

* Add new schemas for scaler

Signed-off-by: dttung2905 <[email protected]>

* Fix from code review

Signed-off-by: dttung2905 <[email protected]>

* fix alignment in openstack swift scaler

Signed-off-by: Jan Wozniak <[email protected]>

---------

Signed-off-by: dttung2905 <[email protected]>
Signed-off-by: Jan Wozniak <[email protected]>
Co-authored-by: Jan Wozniak <[email protected]>
tangobango5 pushed a commit to tangobango5/keda that referenced this pull request Feb 13, 2026
* Refactor openstack swift scaler

Signed-off-by: dttung2905 <[email protected]>

* Add new schemas for scaler

Signed-off-by: dttung2905 <[email protected]>

* Fix from code review

Signed-off-by: dttung2905 <[email protected]>

* fix alignment in openstack swift scaler

Signed-off-by: Jan Wozniak <[email protected]>

---------

Signed-off-by: dttung2905 <[email protected]>
Signed-off-by: Jan Wozniak <[email protected]>
Co-authored-by: Jan Wozniak <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ok-to-merge This PR can be merged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants