Skip to content

providers: add scaleway#1794

Merged
jlebon merged 2 commits intocoreos:mainfrom
tormath1:tormath1/scaleway
Feb 7, 2024
Merged

providers: add scaleway#1794
jlebon merged 2 commits intocoreos:mainfrom
tormath1:tormath1/scaleway

Conversation

@tormath1
Copy link
Copy Markdown
Contributor

Hi,

In this PR we add the support for Scaleway cloud provider. Locally tested on Flatcar + Scaleway:

./ignition --platform scaleway --stage fetch --config-cache ./config.json

While it's a regular IMDS endpoint, it has a small difference with other providers:

$ curl http://169.254.42.42/user_data/cloud-init
# For security reason, you need to query user data with a source port below 1024. For instance, with curl, run as root: # curl http://169.254.42.42/user_data/... --local-port 1-1023

I decided to go with a new FetchOption called LocalPort and to override the default DialContext.

Related to: coreos/fedora-coreos-tracker#866

When establishing a network connection random port selection from the
Kernel for local address is enough in 99.9% of the case.
For the 0.1%, let's add a way to customize the local port used.

Signed-off-by: Mathieu Tortuyaux <mtortuyaux@microsoft.com>
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Just a small nit, would it be possible to describe how scale way is fetching the data in a comment above. similar to how it was done here.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Comment added. ✔️

Copy link
Copy Markdown
Collaborator

@prestist prestist left a comment

Choose a reason for hiding this comment

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

Thank you for putting this together. Just a super small nit, but otherwise LGTM!

Signed-off-by: Mathieu Tortuyaux <mtortuyaux@microsoft.com>
Copy link
Copy Markdown
Member

@jlebon jlebon left a comment

Choose a reason for hiding this comment

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

Some comments, but LGTM as is too. We can always tweak those things in a follow-ups.

Thanks for the patch!

@jlebon
Copy link
Copy Markdown
Member

jlebon commented Feb 7, 2024

Right gotcha. I misread the code here and thought we were retrying the same port in a loop. But we're clearly generating a new port number each time.

@jlebon jlebon merged commit c700fcf into coreos:main Feb 7, 2024
@tormath1 tormath1 deleted the tormath1/scaleway branch February 7, 2024 15:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants