-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1783 from flatcar/kai/proxmox-support
OEM: Provide Proxmox images
- Loading branch information
Showing
13 changed files
with
162 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
- Added Proxmox Virtual Environment images ([scripts#1783](https://github.com/flatcar/scripts/pull/1783)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,6 +35,7 @@ COMMON_OEMIDS=( | |
hetzner | ||
openstack | ||
packet | ||
proxmoxve | ||
qemu | ||
scaleway | ||
kubevirt | ||
|
1 change: 1 addition & 0 deletions
1
...src/third_party/coreos-overlay/coreos-base/common-oem-files/files/proxmoxve/grub.cfg.frag
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
set linux_append="flatcar.autologin" |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
sdk_container/src/third_party/coreos-overlay/coreos-base/oem-proxmoxve/metadata.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> | ||
<pkgmetadata> | ||
</pkgmetadata> |
15 changes: 15 additions & 0 deletions
15
...container/src/third_party/coreos-overlay/coreos-base/oem-proxmoxve/oem-proxmoxve-0.ebuild
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Copyright (c) 2013 CoreOS, Inc.. All rights reserved. | ||
# Distributed under the terms of the GNU General Public License v2 | ||
|
||
EAPI=8 | ||
|
||
DESCRIPTION="OEM suite for Proxmox VE" | ||
HOMEPAGE="https://www.proxmox.com/en/proxmox-virtual-environment/" | ||
SRC_URI="" | ||
|
||
LICENSE="GPL-2" | ||
SLOT="0" | ||
KEYWORDS="amd64 arm64" | ||
IUSE="" | ||
|
||
OEM_NAME="Proxmox VE" |
126 changes: 126 additions & 0 deletions
126
...ird_party/coreos-overlay/coreos/user-patches/coreos-base/afterburn/tormath1-proxmox.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,126 @@ | ||
From e6824a223057ca1379d3890ec58773f7549f6ec2 Mon Sep 17 00:00:00 2001 | ||
From: Mathieu Tortuyaux <mtortuyaux@microsoft.com> | ||
Date: Wed, 6 Nov 2024 14:51:42 +0100 | ||
Subject: [PATCH 1/2] add noop provider | ||
|
||
Signed-off-by: Mathieu Tortuyaux <mtortuyaux@microsoft.com> | ||
--- | ||
src/providers/noop/mod.rs | 28 ++++++++++++++++++++++++++++ | ||
1 file changed, 28 insertions(+) | ||
create mode 100644 src/providers/noop/mod.rs | ||
|
||
diff --git a/src/providers/noop/mod.rs b/src/providers/noop/mod.rs | ||
new file mode 100644 | ||
index 0000000..c722297 | ||
--- /dev/null | ||
+++ b/src/providers/noop/mod.rs | ||
@@ -0,0 +1,28 @@ | ||
+// Copyright 2023 CoreOS, Inc. | ||
+// | ||
+// Licensed under the Apache License, Version 2.0 (the "License"); | ||
+// you may not use this file except in compliance with the License. | ||
+// You may obtain a copy of the License at | ||
+// | ||
+// http://www.apache.org/licenses/LICENSE-2.0 | ||
+// | ||
+// Unless required by applicable law or agreed to in writing, software | ||
+// distributed under the License is distributed on an "AS IS" BASIS, | ||
+// 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. | ||
+ | ||
+use anyhow::Result; | ||
+ | ||
+use crate::providers::MetadataProvider; | ||
+ | ||
+/// Noop provider | ||
+pub struct NoopProvider {} | ||
+ | ||
+impl NoopProvider { | ||
+ pub fn try_new() -> Result<NoopProvider> { | ||
+ Ok(Self { }) | ||
+ } | ||
+} | ||
+ | ||
+impl MetadataProvider for NoopProvider {} | ||
-- | ||
2.44.2 | ||
|
||
From fce6d962436fad9c0700174c7fab99ba35d653fd Mon Sep 17 00:00:00 2001 | ||
From: Mathieu Tortuyaux <mtortuyaux@microsoft.com> | ||
Date: Wed, 6 Nov 2024 15:14:26 +0100 | ||
Subject: [PATCH 2/2] proxmox: use noop provider if no configdrive | ||
|
||
Signed-off-by: Mathieu Tortuyaux <mtortuyaux@microsoft.com> | ||
--- | ||
src/metadata.rs | 4 ++-- | ||
src/providers/mod.rs | 1 + | ||
src/providers/proxmoxve/mod.rs | 14 ++++++++++++++ | ||
3 files changed, 17 insertions(+), 2 deletions(-) | ||
|
||
diff --git a/src/metadata.rs b/src/metadata.rs | ||
index 94f9238..bd311f7 100644 | ||
--- a/src/metadata.rs | ||
+++ b/src/metadata.rs | ||
@@ -33,7 +33,7 @@ use crate::providers::openstack; | ||
use crate::providers::openstack::network::OpenstackProviderNetwork; | ||
use crate::providers::packet::PacketProvider; | ||
use crate::providers::powervs::PowerVSProvider; | ||
-use crate::providers::proxmoxve::ProxmoxVEConfigDrive; | ||
+use crate::providers::proxmoxve; | ||
use crate::providers::scaleway::ScalewayProvider; | ||
use crate::providers::vmware::VmwareProvider; | ||
use crate::providers::vultr::VultrProvider; | ||
@@ -71,7 +71,7 @@ pub fn fetch_metadata(provider: &str) -> Result<Box<dyn providers::MetadataProvi | ||
"openstack-metadata" => box_result!(OpenstackProviderNetwork::try_new()?), | ||
"packet" => box_result!(PacketProvider::try_new()?), | ||
"powervs" => box_result!(PowerVSProvider::try_new()?), | ||
- "proxmoxve" => box_result!(ProxmoxVEConfigDrive::try_new()?), | ||
+ "proxmoxve" => proxmoxve::try_config_drive_else_leave(), | ||
"scaleway" => box_result!(ScalewayProvider::try_new()?), | ||
"vmware" => box_result!(VmwareProvider::try_new()?), | ||
"vultr" => box_result!(VultrProvider::try_new()?), | ||
diff --git a/src/providers/mod.rs b/src/providers/mod.rs | ||
index e17d551..dab07e1 100644 | ||
--- a/src/providers/mod.rs | ||
+++ b/src/providers/mod.rs | ||
@@ -35,6 +35,7 @@ pub mod ibmcloud; | ||
pub mod ibmcloud_classic; | ||
pub mod kubevirt; | ||
pub mod microsoft; | ||
+pub mod noop; | ||
pub mod openstack; | ||
pub mod packet; | ||
pub mod powervs; | ||
diff --git a/src/providers/proxmoxve/mod.rs b/src/providers/proxmoxve/mod.rs | ||
index 14146b0..a965162 100644 | ||
--- a/src/providers/proxmoxve/mod.rs | ||
+++ b/src/providers/proxmoxve/mod.rs | ||
@@ -12,6 +12,11 @@ | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
+use anyhow::Result; | ||
+use crate::providers; | ||
+use crate::providers::noop::NoopProvider; | ||
+use slog_scope::warn; | ||
+ | ||
mod configdrive; | ||
pub use configdrive::*; | ||
|
||
@@ -20,3 +25,12 @@ pub use cloudconfig::*; | ||
|
||
#[cfg(test)] | ||
mod tests; | ||
+ | ||
+pub fn try_config_drive_else_leave() -> Result<Box<dyn providers::MetadataProvider>> { | ||
+ if let Ok(config_drive) = ProxmoxVEConfigDrive::try_new() { | ||
+ Ok(Box::new(config_drive)) | ||
+ } else { | ||
+ warn!("failed to locate config-drive - aborting ProxmoxVE provider"); | ||
+ Ok(Box::new(NoopProvider::try_new()?)) | ||
+ } | ||
+} | ||
-- | ||
2.44.2 | ||
|
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters