knife-proxmox-ve 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2bfa352b40db68621f19322cdb1dfc060c37ac3faafa423d37b76c9ccd7d544f
4
- data.tar.gz: 1f819e5625acbb197012847d54d15e6bace8b71108d3ad867b9fbb2ee0b8944e
3
+ metadata.gz: bff2fdcc58a1aeadf186e297e838ddb91510536f7cf0169ccb25a3091c590931
4
+ data.tar.gz: 9cdc6b30bfe1a9d8da2feb3f8cf622973dbb0ab553c13c10a3a9729ea444a46a
5
5
  SHA512:
6
- metadata.gz: e185dc631d2d81abdfa6a0e5e1a3772bc66b8db9096f1fc4a358aa910b52c549f8a3c3b1bde159509b7b7dcc8decbc1433fbc10e56731428b69ce764d1162ea1
7
- data.tar.gz: 26bf397b78eb7e03f832e506ff34ca026e370c416fb5ec2f1a7c2e4428c915229f851a68e404cec34ceb801f1fd8ee9790bdaec0673480e15f53405d45661453
6
+ metadata.gz: 118d4dd196b869f226c11801b728b4d71661c9aa9756210b3857bf6f629c45515199a9b2e0b9b0f27b07bbf1cee995de81eaa1e1e8102a228d415eae7a94a460
7
+ data.tar.gz: b2b0d7b679086f772f7d844c22635c9a749110405362788ece0e7de99a23eec68a97c1e7e18ddfdad30500a5bfb606e8f8ed4b396a61faa9a32a0a1a4f2226ae
@@ -13,9 +13,11 @@ class Chef
13
13
  # cloud-init auth and plants it on the guest, but never touches the bootstrap connection.
14
14
  # The bootstrap command layers that on by overriding #apply_provision_auth!.
15
15
  module ProxmoxVmProvision
16
- # Proxmox bridge interface names: "vmbr" followed by digits (vmbr0, vmbr1, ...).
17
- # IP/gateway validation is handled separately by IPAddr in #validate_ip!/#validate_gateway!.
18
- VMBR_PATTERN = /\Avmbr\d+\z/
16
+ # A bridge is any Linux network interface: a classic bridge (vmbr0), an SDN VNet
17
+ # (arbitrary name, e.g. "mail"), an OVS bridge, a bond, etc. We only enforce what the
18
+ # kernel itself does on an interface name — 1..15 chars, no whitespace, no "/", and not
19
+ # "." or "..". IP/gateway validation is handled separately by IPAddr below.
20
+ BRIDGE_PATTERN = %r{\A(?!\.{1,2}\z)[^\s/]{1,15}\z}
19
21
 
20
22
  # A pasted PRIVATE key must never travel as an authorized public key.
21
23
  PRIVATE_KEY_MARKER = /-----BEGIN [A-Z ]*PRIVATE KEY-----/
@@ -73,8 +75,8 @@ class Chef
73
75
  # --- Networking -------------------------------------------------------
74
76
 
75
77
  option :bridge,
76
- long: "--bridge vmbrN",
77
- description: "Network bridge for net0 (e.g. vmbr0)."
78
+ long: "--bridge NAME",
79
+ description: "Network bridge for net0 (e.g. vmbr0 or an SDN VNet name)."
78
80
 
79
81
  option :vlan,
80
82
  long: "--vlan TAG",
@@ -193,9 +195,10 @@ class Chef
193
195
  def validate_bridge!
194
196
  bridge = config[:bridge]
195
197
  return if bridge.nil?
196
- return if VMBR_PATTERN.match?(bridge)
198
+ return if BRIDGE_PATTERN.match?(bridge)
197
199
 
198
- ui.fatal!("--bridge #{bridge.inspect} is not a valid bridge name (expected vmbrN, e.g. vmbr0)")
200
+ ui.fatal!("--bridge #{bridge.inspect} is not a valid interface name " \
201
+ "(1-15 chars, no whitespace or '/'; e.g. vmbr0 or an SDN VNet name)")
199
202
  end
200
203
 
201
204
  def validate_ip!
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Knife
4
4
  module Proxmox
5
- VERSION = "0.1.1"
5
+ VERSION = "0.1.2"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: knife-proxmox-ve
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Piotr Wojcieszonek