Hello community,
here is the log from the commit of package cloud-netconfig for openSUSE:Factory
checked in at 2020-11-11 20:46:16
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/cloud-netconfig (Old)
and /work/SRC/openSUSE:Factory/.cloud-netconfig.new.26437 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "cloud-netconfig"
Wed Nov 11 20:46:16 2020 rev:11 rq:847526 version:1.5
Changes:
--------
--- /work/SRC/openSUSE:Factory/cloud-netconfig/cloud-netconfig.changes
2020-02-07 15:55:29.703546094 +0100
+++
/work/SRC/openSUSE:Factory/.cloud-netconfig.new.26437/cloud-netconfig.changes
2020-11-11 20:46:20.103643109 +0100
@@ -1,0 +2,7 @@
+Thu Nov 5 16:12:48 UTC 2020 - Joachim Gleissner <[email protected]>
+
+- Update to version 1.5:
+ + Add support for GCE (bsc#1159460, bsc#1178486)
+ + Improve default gateway determination
+
+-------------------------------------------------------------------
Old:
----
cloud-netconfig-1.4.tar.bz2
New:
----
cloud-netconfig-1.5.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ cloud-netconfig.spec ++++++
--- /var/tmp/diff_new_pack.DYgbQs/_old 2020-11-11 20:46:20.911643911 +0100
+++ /var/tmp/diff_new_pack.DYgbQs/_new 2020-11-11 20:46:20.919643919 +0100
@@ -31,12 +31,17 @@
%define flavor_suffix -ec2
%define csp_string Amazon EC2
%endif
+%if "@BUILD_FLAVOR@" == "gce"
+%define flavor_suffix -gce
+%define csp_string Google Compute Engine
+%endif
Name: %{base_name}%{flavor_suffix}
-Version: 1.4
+Version: 1.5
Release: 0
Summary: Network configuration scripts for %{csp_string}
License: GPL-3.0-or-later
+Group: System/Management
URL: https://github.com/SUSE-Enceladus/cloud-netconfig
Source0: %{base_name}-%{version}.tar.bz2
BuildRoot: %{_tmppath}/%{name}-%{version}-build
++++++ _multibuild ++++++
--- /var/tmp/diff_new_pack.DYgbQs/_old 2020-11-11 20:46:20.987643986 +0100
+++ /var/tmp/diff_new_pack.DYgbQs/_new 2020-11-11 20:46:20.991643991 +0100
@@ -1,4 +1,5 @@
<multibuild>
<package>azure</package>
<package>ec2</package>
+ <package>gce</package>
</multibuild>
++++++ cloud-netconfig-1.4.tar.bz2 -> cloud-netconfig-1.5.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/cloud-netconfig-1.4/Makefile
new/cloud-netconfig-1.5/Makefile
--- old/cloud-netconfig-1.4/Makefile 2020-02-04 18:31:10.628357312 +0100
+++ new/cloud-netconfig-1.5/Makefile 2020-11-04 17:34:18.857419551 +0100
@@ -15,14 +15,10 @@
verSrc = $(shell cat VERSION)
-verSpecEC2 = $(shell rpm -q --specfile --qf '%{VERSION}'
cloud-netconfig-ec2.spec)
-verSpecAz = $(shell rpm -q --specfile --qf '%{VERSION}'
cloud-netconfig-azure.spec)
+verSpec = $(shell rpm -q --specfile --qf '%{VERSION}' cloud-netconfig.spec
2>/dev/null)
-ifneq "$(verSrc)" "$(verSpecEC2)"
-$(error "Version mismatch source and EC2 spec, aborting")
-endif
-ifneq "$(verSrc)" "$(verSpecAz)"
-$(error "Version mismatch source and Azure spec, aborting")
+ifneq "$(verSrc)" "$(verSpec)"
+$(error "Version mismatch source and spec, aborting")
endif
help:
@@ -52,6 +48,11 @@
install -m 644 ec2/51-cloud-netconfig-hotplug.rules $(DEST_UDEVRULESDIR)
install -m 755 ec2/functions.cloud-netconfig $(DEST_SCRIPTDIR)
+install-gce: common
+ install -m 644 common/75-cloud-persistent-net-generator.rules
$(DEST_UDEVRULESDIR)
+ install -m 644 gce/51-cloud-netconfig-hotplug.rules $(DEST_UDEVRULESDIR)
+ install -m 755 gce/functions.cloud-netconfig $(DEST_SCRIPTDIR)
+
tarball:
@test -n "$(verSrc)"
@ln -s . cloud-netconfig-$(verSrc)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/cloud-netconfig-1.4/VERSION
new/cloud-netconfig-1.5/VERSION
--- old/cloud-netconfig-1.4/VERSION 2020-02-03 15:32:36.238953166 +0100
+++ new/cloud-netconfig-1.5/VERSION 2020-11-04 17:33:04.660500818 +0100
@@ -1 +1 @@
-1.4
+1.5
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/cloud-netconfig-1.4/azure/functions.cloud-netconfig
new/cloud-netconfig-1.5/azure/functions.cloud-netconfig
--- old/cloud-netconfig-1.4/azure/functions.cloud-netconfig 2019-11-26
17:28:15.794079567 +0100
+++ new/cloud-netconfig-1.5/azure/functions.cloud-netconfig 2020-09-23
17:34:30.572858814 +0200
@@ -84,7 +84,6 @@
local oldopt=$(shopt -p nocasematch)
shopt -s nocasematch
- get_from_metadata | \
for idx in $(get_from_metadata) ; do
if [[ "$(get_iface_mac ${idx%/*})" == "${hwaddr//:/}" ]]; then
get_ipv4_addresses_by_index ${idx%/*}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/cloud-netconfig-1.4/cloud-netconfig-azure.spec
new/cloud-netconfig-1.5/cloud-netconfig-azure.spec
--- old/cloud-netconfig-1.4/cloud-netconfig-azure.spec 2020-02-04
18:31:10.628357312 +0100
+++ new/cloud-netconfig-1.5/cloud-netconfig-azure.spec 1970-01-01
01:00:00.000000000 +0100
@@ -1,94 +0,0 @@
-#
-# spec file for package cloud-netconfig
-#
-# Copyright (c) 2017 SUSE Linux GmbH, Nuernberg, Germany.
-#
-# All modifications and additions to the file contributed by third parties
-# remain the property of their copyright owners, unless otherwise agreed
-# upon. The license for this file, and modifications and additions to the
-# file, is the same license as for the pristine package itself (unless the
-# license for the pristine package is not an Open Source License, in which
-# case the license is the MIT License). An "Open Source License" is a
-# license that conforms to the Open Source Definition (Version 1.9)
-# published by the Open Source Initiative.
-
-# Please submit bugfixes or comments via http://bugs.opensuse.org/
-#
-
-%define base_name cloud-netconfig
-
-Name: %{base_name}-azure
-Version: 1.4
-Release: 0
-License: GPL-3.0-or-later
-Summary: Network configuration scripts for Microsoft Azure
-Url: https://github.com/SUSE/Enceladus
-Group: System/Management
-Source0: %{base_name}-%{version}.tar.bz2
-BuildRoot: %{_tmppath}/%{name}-%{version}-build
-BuildArch: noarch
-%if 0%{?suse_version} == 1110
-BuildRequires: sysconfig
-Requires: sysconfig
-%define _udevrulesdir %{_sysconfdir}/udev/rules.d
-%else
-BuildRequires: sysconfig-netconfig
-Requires: sysconfig-netconfig
-%endif
-BuildRequires: pkgconfig(udev)
-Requires: udev
-Requires: curl
-Provides: cloud-netconfig
-Conflicts: cloud-netconfig
-%{?systemd_requires}
-
-%description
-This package contains scripts for automatically configuring network interfaces
-in Microsoft Azure.
-
-%prep
-%setup -q -n %{base_name}-%{version}
-
-%build
-
-%install
-make install-azure \
- DESTDIR=%{buildroot} \
- PREFIX=%{_usr} \
- SYSCONFDIR=%{_sysconfdir} \
- UDEVRULESDIR=%{_udevrulesdir} \
- UNITDIR=%{_unitdir}
-
-# Disable persistent net generator from udev-persistent-ifnames as
-# it does not work for xen interfaces. This will likely produce a warning.
-%if 0%{?suse_version} >= 1315
-mkdir -p %{buildroot}/%{_sysconfdir}/udev/rules.d
-ln -s /dev/null
%{buildroot}/%{_sysconfdir}/udev/rules.d/75-persistent-net-generator.rules
-%endif
-
-%files
-%defattr(-,root,root)
-%config(noreplace) %{_sysconfdir}/default/cloud-netconfig
-%{_sysconfdir}/netconfig.d/cloud-netconfig
-%{_sysconfdir}/sysconfig/network/scripts/*
-%if 0%{?suse_version} >= 1315
-%{_sysconfdir}/udev/rules.d
-%endif
-%{_udevrulesdir}/61-cloud-netconfig-hotplug.rules
-%{_unitdir}/*
-%doc README.md
-%license LICENSE
-
-%pre
-%service_add_pre %{base_name}.service %{base_name}.timer
-
-%post
-%service_add_post %{base_name}.service %{base_name}.timer
-
-%preun
-%service_del_preun %{base_name}.service %{base_name}.timer
-
-%postun
-%service_del_postun %{base_name}.service %{base_name}.timer
-
-%changelog
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/cloud-netconfig-1.4/cloud-netconfig-ec2.spec
new/cloud-netconfig-1.5/cloud-netconfig-ec2.spec
--- old/cloud-netconfig-1.4/cloud-netconfig-ec2.spec 2020-02-04
18:31:10.628357312 +0100
+++ new/cloud-netconfig-1.5/cloud-netconfig-ec2.spec 1970-01-01
01:00:00.000000000 +0100
@@ -1,94 +0,0 @@
-#
-# spec file for package cloud-netconfig
-#
-# Copyright (c) 2017 SUSE Linux GmbH, Nuernberg, Germany.
-#
-# All modifications and additions to the file contributed by third parties
-# remain the property of their copyright owners, unless otherwise agreed
-# upon. The license for this file, and modifications and additions to the
-# file, is the same license as for the pristine package itself (unless the
-# license for the pristine package is not an Open Source License, in which
-# case the license is the MIT License). An "Open Source License" is a
-# license that conforms to the Open Source Definition (Version 1.9)
-# published by the Open Source Initiative.
-
-# Please submit bugfixes or comments via http://bugs.opensuse.org/
-#
-
-%define base_name cloud-netconfig
-
-Name: %{base_name}-ec2
-Version: 1.4
-Release: 0
-License: GPL-3.0-or-later
-Summary: Network configuration scripts for Amazon EC2
-Url: https://github.com/SUSE/Enceladus
-Group: System/Management
-Source0: %{base_name}-%{version}.tar.bz2
-BuildRoot: %{_tmppath}/%{name}-%{version}-build
-BuildArch: noarch
-%if 0%{?suse_version} == 1110
-BuildRequires: sysconfig
-Requires: sysconfig
-%define _udevrulesdir %{_sysconfdir}/udev/rules.d
-%else
-BuildRequires: sysconfig-netconfig
-Requires: sysconfig-netconfig
-%endif
-BuildRequires: pkgconfig(udev)
-Requires: udev
-Requires: curl
-Provides: cloud-netconfig
-Conflicts: cloud-netconfig
-%{?systemd_requires}
-
-%description
-This package contains scripts for automatically configuring network interfaces
-in Amazon EC2 with full support for hotplug.
-
-%prep
-%setup -q -n %{base_name}-%{version}
-
-%build
-
-%install
-make install-ec2 \
- DESTDIR=%{buildroot} \
- PREFIX=%{_usr} \
- SYSCONFDIR=%{_sysconfdir} \
- UDEVRULESDIR=%{_udevrulesdir} \
- UNITDIR=%{_unitdir}
-
-# Disable persistent net generator from udev-persistent-ifnames as
-# it does not work for xen interfaces. This will likely produce a warning.
-%if 0%{?suse_version} >= 1315
-mkdir -p %{buildroot}/%{_sysconfdir}/udev/rules.d
-ln -s /dev/null
%{buildroot}/%{_sysconfdir}/udev/rules.d/75-persistent-net-generator.rules
-%endif
-
-%files
-%defattr(-,root,root)
-%config(noreplace) %{_sysconfdir}/default/cloud-netconfig
-%{_sysconfdir}/netconfig.d/cloud-netconfig
-%{_sysconfdir}/sysconfig/network/scripts/*
-%if 0%{?suse_version} >= 1315
-%{_sysconfdir}/udev/rules.d
-%endif
-%{_udevrulesdir}/51-cloud-netconfig-hotplug.rules
-%{_udevrulesdir}/75-cloud-persistent-net-generator.rules
-%doc README.md
-%license LICENSE
-
-%pre
-%service_add_pre %{base_name}.service %{base_name}.timer
-
-%post
-%service_add_post %{base_name}.service %{base_name}.timer
-
-%preun
-%service_del_preun %{base_name}.service %{base_name}.timer
-
-%postun
-%service_del_postun %{base_name}.service %{base_name}.timer
-
-%changelog
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/cloud-netconfig-1.4/cloud-netconfig.spec
new/cloud-netconfig-1.5/cloud-netconfig.spec
--- old/cloud-netconfig-1.4/cloud-netconfig.spec 2020-02-04
18:31:10.628357312 +0100
+++ new/cloud-netconfig-1.5/cloud-netconfig.spec 2020-11-04
17:33:04.664500867 +0100
@@ -30,9 +30,13 @@
%define flavor_suffix -ec2
%define csp_string Amazon EC2
%endif
+%if "@BUILD_FLAVOR@" == "gce"
+%define flavor_suffix -gce
+%define csp_string Google Compute Engine
+%endif
Name: %{base_name}%{flavor_suffix}
-Version: 1.4
+Version: 1.5
Release: 0
License: GPL-3.0-or-later
Summary: Network configuration scripts for %{csp_string}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/cloud-netconfig-1.4/common/cloud-netconfig
new/cloud-netconfig-1.5/common/cloud-netconfig
--- old/cloud-netconfig-1.4/common/cloud-netconfig 2020-02-04
13:23:23.838237799 +0100
+++ new/cloud-netconfig-1.5/common/cloud-netconfig 2020-11-04
17:33:04.664500867 +0100
@@ -137,6 +137,17 @@
}
# -------------------------------------------------------------------
+# get link status for interface
+#
+get_link_status()
+{
+ local iface="$1"
+ test -z "$iface" && return 1
+
+ ip -o -br link show dev $iface | awk '{ print $2 }'
+}
+
+# -------------------------------------------------------------------
# add address to log
#
add_addr_to_log()
@@ -224,6 +235,8 @@
get_variable "NETMASK" "$cfg"
get_variable "BROADCAST" "$cfg"
get_variable "GATEWAYS" "$cfg"
+ get_variable "PREFIXLEN" "$cfg"
+ get_variable "ROUTES" "$cfg"
local HWADDR="$(cat /sys/class/net/${INTERFACE}/address)"
local RTABLE="10${INTERFACE: -1}"
@@ -289,12 +302,31 @@
if [[ -n "${GWS[0]}" ]]; then
GW="${GWS[0]}"
else
+ debug "No gateway from DHCP4, guessing"
# no default route, guess one
- # FIXME: this is not ideal; make it at least configurable
- GW="${NETWORK%.*}.1"
+ if [[ $PREFIXLEN = 32 ]]; then
+ # peer-to-peer setup but no gateway. At the time of writing
+ # that is the setup in GCE. Subnet routes and gateway get
+ # delivered by DHCP as addtional routes.
+ for r in $ROUTES ; do
+ if [[ ${r##*,} = 0.0.0.0 ]]; then
+ GW="${r%%,*}"
+ break
+ fi
+ done
+ else
+ # we assume the gateway is the first host of the network
+ local netstart=${NETWORK##*.}
+ local gw_host_part=$((netstart+1))
+ GW="${NETWORK%.*}.${gw_host_part}"
+ fi
+ fi
+ if [[ -n $GW ]]; then
+ debug "adding default route via $GW for $INTERFACE table $RTABLE"
+ ip -4 route add default via $GW dev "$INTERFACE" table "$RTABLE"
+ else
+ warn "No default route for $INTERFACE"
fi
- debug "adding default route for $INTERFACE table $RTABLE"
- ip -4 route add default via $GW dev "$INTERFACE" table "$RTABLE"
fi
# copy specific routes from the default routing table
@@ -395,6 +427,11 @@
debug "Not managing interface ${cfg##*/}"
return
fi
+ linkstatus=$(get_link_status ${cfg##*/})
+ if [[ $linkstatus != UP ]]; then
+ debug "interface ${cfg##*/} is down"
+ return
+ fi
for cfg in ${1}/* ; do
test -f $cfg || continue
get_variable "SERVICE" "$cfg"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/cloud-netconfig-1.4/gce/51-cloud-netconfig-hotplug.rules
new/cloud-netconfig-1.5/gce/51-cloud-netconfig-hotplug.rules
--- old/cloud-netconfig-1.4/gce/51-cloud-netconfig-hotplug.rules
1970-01-01 01:00:00.000000000 +0100
+++ new/cloud-netconfig-1.5/gce/51-cloud-netconfig-hotplug.rules
2020-11-04 17:33:04.668500917 +0100
@@ -0,0 +1,2 @@
+ACTION=="add", SUBSYSTEM=="net", KERNEL=="eth*", IMPORT{program}="/bin/sleep 1"
+SUBSYSTEM=="net", KERNEL=="eth*",
RUN+="/etc/sysconfig/network/scripts/cloud-netconfig-hotplug"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/cloud-netconfig-1.4/gce/functions.cloud-netconfig
new/cloud-netconfig-1.5/gce/functions.cloud-netconfig
--- old/cloud-netconfig-1.4/gce/functions.cloud-netconfig 1970-01-01
01:00:00.000000000 +0100
+++ new/cloud-netconfig-1.5/gce/functions.cloud-netconfig 2020-11-04
17:33:04.668500917 +0100
@@ -0,0 +1,45 @@
+#!/bin/bash
+
+# Copyright (c) 2020 SUSE LLC, All rights reserved.
+#
+# This file is part of cloud-netconfig.
+#
+# cloud-netconfig is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# cloud-netconfig is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+
+# -------------------------------------------------------------------
+# no metadata lookup in GCE required due to no secondary IP addresses
+# simply look up local addresses
+#
+get_ipv4_addresses_from_metadata()
+{
+ local iface status mac if_match addr hwaddr="$1"
+ test -z "$hwaddr" && return 1
+ while read -r iface status mac rest ; do
+ if [[ $mac == $hwaddr ]]; then
+ if_match=$iface
+ break
+ fi
+ done < <(ip -br -o -4 link show)
+ if [[ -n $if_match ]]; then
+ ip -br -4 -o addr show dev $if_match | awk '{ print $3 }'
+ fi
+}
+
+# -------------------------------------------------------------------
+# dummy function, metadata not used
+#
+metadata_available()
+{
+ return 0
+}
+
_______________________________________________
openSUSE Commits mailing list -- [email protected]
To unsubscribe, email [email protected]
List Netiquette: https://en.opensuse.org/openSUSE:Mailing_list_netiquette
List Archives:
https://lists.opensuse.org/archives/list/[email protected]