regenerate patches for "1001-cloud-setup-IMDSv2-rh2151987.patch"

Fix the patch index and `git cherry-pick -x` the last patch from nm-1-40
branch.

Related: #2181466
This commit is contained in:
Thomas Haller 2023-04-13 14:20:22 +02:00 committed by Beniamino Galvani
parent 5a0595e5b9
commit 126ae109e9

View File

@ -1,7 +1,7 @@
From 89a6ce575d52bbaa1b928275c39517a071449da7 Mon Sep 17 00:00:00 2001 From 89a6ce575d52bbaa1b928275c39517a071449da7 Mon Sep 17 00:00:00 2001
From: Thomas Haller <thaller@redhat.com> From: Thomas Haller <thaller@redhat.com>
Date: Mon, 27 Feb 2023 09:14:10 +0100 Date: Mon, 27 Feb 2023 09:14:10 +0100
Subject: [PATCH 1/6] cloud-setup: use nm_strv_dup_packed() in Subject: [PATCH 1/7] cloud-setup: use nm_strv_dup_packed() in
nm_http_client_poll_get() nm_http_client_poll_get()
No need to do a deep clone. The strv array is not ever modified and we No need to do a deep clone. The strv array is not ever modified and we
@ -50,7 +50,7 @@ index a0964e2165..98ede1e403 100644
From 36d417af60a2a09863e00cae869899883265ee8c Mon Sep 17 00:00:00 2001 From 36d417af60a2a09863e00cae869899883265ee8c Mon Sep 17 00:00:00 2001
From: Lubomir Rintel <lkundrak@v3.sk> From: Lubomir Rintel <lkundrak@v3.sk>
Date: Mon, 27 Feb 2023 00:09:13 +0100 Date: Mon, 27 Feb 2023 00:09:13 +0100
Subject: [PATCH 2/6] cloud_setup: unexport nm_http_client_get() Subject: [PATCH 2/7] cloud_setup: unexport nm_http_client_get()
It's not used anywhere. It's not used anywhere.
@ -117,7 +117,7 @@ index 0a7052ae25..6cc08ba97c 100644
From 20cd11ee4974bb1690d523d5700492ad9c618688 Mon Sep 17 00:00:00 2001 From 20cd11ee4974bb1690d523d5700492ad9c618688 Mon Sep 17 00:00:00 2001
From: Lubomir Rintel <lkundrak@v3.sk> From: Lubomir Rintel <lkundrak@v3.sk>
Date: Mon, 27 Feb 2023 00:09:40 +0100 Date: Mon, 27 Feb 2023 00:09:40 +0100
Subject: [PATCH 3/6] cloud-setup: rename get/Get identifiers to req and Req Subject: [PATCH 3/7] cloud-setup: rename get/Get identifiers to req and Req
We're going to extend those to issue methods other than GET. We're going to extend those to issue methods other than GET.
Also, "request" would've been too long, "req" looks nicer. Also, "request" would've been too long, "req" looks nicer.
@ -897,7 +897,7 @@ index a325f31a17..571c0fb826 100644
From aaf66e9174eb04d2df1f45530ebdca16e77a6ec5 Mon Sep 17 00:00:00 2001 From aaf66e9174eb04d2df1f45530ebdca16e77a6ec5 Mon Sep 17 00:00:00 2001
From: Lubomir Rintel <lkundrak@v3.sk> From: Lubomir Rintel <lkundrak@v3.sk>
Date: Mon, 27 Feb 2023 00:13:31 +0100 Date: Mon, 27 Feb 2023 00:13:31 +0100
Subject: [PATCH 4/6] cloud-setup: make nm_http_client_req() accept a method Subject: [PATCH 4/7] cloud-setup: make nm_http_client_req() accept a method
argument argument
We'll need to be able to issue PUT calls. We'll need to be able to issue PUT calls.
@ -1179,7 +1179,7 @@ index 571c0fb826..ca354865dd 100644
From 06fc0ef35dc7e5e6295ab9beecba6071e556d55e Mon Sep 17 00:00:00 2001 From 06fc0ef35dc7e5e6295ab9beecba6071e556d55e Mon Sep 17 00:00:00 2001
From: Lubomir Rintel <lkundrak@v3.sk> From: Lubomir Rintel <lkundrak@v3.sk>
Date: Tue, 7 Mar 2023 13:51:57 +0100 Date: Tue, 7 Mar 2023 13:51:57 +0100
Subject: [PATCH 5/6] cloud-setup: document detect() and get_config() methods Subject: [PATCH 5/7] cloud-setup: document detect() and get_config() methods
Clarify that detect() needs to succeed before get_config(). Clarify that detect() needs to succeed before get_config().
@ -1241,7 +1241,7 @@ index 502f1d0323..3662fbe391 100644
From e3ac982b32361105708d489a73eaed2bc4dc5f9f Mon Sep 17 00:00:00 2001 From e3ac982b32361105708d489a73eaed2bc4dc5f9f Mon Sep 17 00:00:00 2001
From: Lubomir Rintel <lkundrak@v3.sk> From: Lubomir Rintel <lkundrak@v3.sk>
Date: Mon, 27 Feb 2023 00:15:11 +0100 Date: Mon, 27 Feb 2023 00:15:11 +0100
Subject: [PATCH 6/6] cloud-setup/ec2: start with requesting a IMDSv2 token Subject: [PATCH 6/7] cloud-setup/ec2: start with requesting a IMDSv2 token
The present version of the EC2 metadata API (IMDSv2) requires a header The present version of the EC2 metadata API (IMDSv2) requires a header
with a token to be present in all requests. The token is essentially a with a token to be present in all requests. The token is essentially a
@ -1445,18 +1445,21 @@ index c3c527cfd4..3a27a30e68 100644
-- --
2.39.2 2.39.2
From 6abbdaaa64bad00acb65ba7049dcea6bb7ae1084 Mon Sep 17 00:00:00 2001 From 6abbdaaa64bad00acb65ba7049dcea6bb7ae1084 Mon Sep 17 00:00:00 2001
From: Lubomir Rintel <lkundrak@v3.sk> From: Lubomir Rintel <lkundrak@v3.sk>
Date: Tue, 21 Mar 2023 22:47:27 +0100 Date: Tue, 21 Mar 2023 22:47:27 +0100
Subject: [PATCH] cloud-setup: actually pass the HTTP method in Subject: [PATCH 7/7] cloud-setup: actually pass the HTTP method in
nm_http_client_poll_req() nm_http_client_poll_req()
https://bugzilla.redhat.com/show_bug.cgi?id=2179718 https://bugzilla.redhat.com/show_bug.cgi?id=2179718
https://bugzilla.redhat.com/show_bug.cgi?id=2181466
Fixes: 8b7e12c2d631 ('cloud-setup/ec2: start with requesting a IMDSv2 token') Fixes: 8b7e12c2d631 ('cloud-setup/ec2: start with requesting a IMDSv2 token')
Fixes: cd74d7500278 ('cloud-setup: make nm_http_client_req() accept a method argument') Fixes: cd74d7500278 ('cloud-setup: make nm_http_client_req() accept a method argument')
(cherry picked from commit f07da04cd9f16ac9e90d3d57d970ac935ad87b4d) (cherry picked from commit f07da04cd9f16ac9e90d3d57d970ac935ad87b4d)
(cherry picked from commit d787c0c59dce57dfacc6602a4f1d5f8d8ed3b193) (cherry picked from commit d787c0c59dce57dfacc6602a4f1d5f8d8ed3b193)
(cherry picked from commit 6abbdaaa64bad00acb65ba7049dcea6bb7ae1084)
--- ---
src/nm-cloud-setup/nm-http-client.c | 3 ++- src/nm-cloud-setup/nm-http-client.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-) 1 file changed, 2 insertions(+), 1 deletion(-)
@ -1483,5 +1486,5 @@ index b3db93e058..db123f1033 100644
if (http_headers) { if (http_headers) {
-- --
2.40.0 2.39.2