Repository: dcos/dcos

Issue:
Remove deprecated ifconfig dependency
## High-level description

ifconfig is deprecated. This PR removes it from DC/OS.

After talking with @urbanserj yesterday we no longer need the ifconfig dependency in DC/OS. It was introduced via https://github.com/dcos/dcos/pull/2819 and used by the network/cni isolator in Mesos. That's no longer the case so we can remove it.

I also found it used in the `azure.sh` ip-detect script so removed its use in there. Also updated the `vagrant.sh` ip-detect script (the two are now identical) to properly detect the source IP in the `ip route` output. Before it was hard coded to the 7th place which depending on the network configuration could produce wrong output.

E.g.
```
lukas@bigmac:~$ ip r g 8.8.8.8 | awk '{print $7}'
proto
```



## Corresponding DC/OS tickets

These DC/OS JIRA ticket(s) must be updated (ideally closed) in the moment this PR lands:

  - [DCOS-44380](https://jira.mesosphere.com/browse/DCOS-44380) GCP Install of DC/OS 1.12.0 is missing prereq ifconfig for current Centos.





Discussion:

Resolving patch:
diff --git a/gen/build_deploy/bash.py b/gen/build_deploy/bash.py
--- a/gen/build_deploy/bash.py
+++ b/gen/build_deploy/bash.py
@@ -487,7 +487,6 @@ def validate_custom_check_bins_dir(custom_check_bins_dir):
     check unzip
     check ipset
     check systemd-notify
-    check ifconfig
 
     # $ systemctl --version ->
     # systemd nnn
diff --git a/gen/calc.py b/gen/calc.py
--- a/gen/calc.py
+++ b/gen/calc.py
@@ -828,11 +828,6 @@ def calculate_check_config(check_time):
                     'cmd': ['/opt/mesosphere/bin/dcos-checks', 'executable', 'unzip'],
                     'timeout': instant_check_timeout
                 },
-                'ifconfig': {
-                    'description': 'The ifconfig utility is available',
-                    'cmd': ['/opt/mesosphere/bin/dcos-checks', 'executable', 'ifconfig'],
-                    'timeout': instant_check_timeout
-                },
                 'ip_detect_script': {
                     'description': 'The IP detect script produces valid output',
                     'cmd': ['/opt/mesosphere/bin/dcos-checks', 'ip'],
@@ -870,7 +865,6 @@ def calculate_check_config(check_time):
                 'curl',
                 'unzip',
                 'docker',
-                'ifconfig',
                 'ip_detect_script',
                 'mesos_master_replog_synchronized',
                 'mesos_agent_registered_with_masters',


Test patch:
diff --git a/packages/dcos-integration-test/extra/test_dcos_diagnostics.py b/packages/dcos-integration-test/extra/test_dcos_diagnostics.py
--- a/packages/dcos-integration-test/extra/test_dcos_diagnostics.py
+++ b/packages/dcos-integration-test/extra/test_dcos_diagnostics.py
@@ -418,28 +418,47 @@ def _download_bundle_from_master(dcos_api_session, master_index, bundle):
     bundles = _get_bundle_list(dcos_api_session)
     assert bundle in bundles, 'not found {} in {}'.format(bundle, bundles)
 
-    expected_common_files = ['dmesg_-T-0.output.gz', 'opt/mesosphere/active.buildinfo.full.json.gz',
-                             'opt/mesosphere/etc/dcos-version.json.gz', 'opt/mesosphere/etc/expanded.config.json.gz',
-                             'opt/mesosphere/etc/user.config.yaml.gz', 'dcos-diagnostics-health.json',
-                             'var/lib/dcos/cluster-id.gz', 'ps_aux_ww_Z-4.output.gz',
-                             'proc/cmdline.gz', 'proc/cpuinfo.gz', 'proc/meminfo.gz', 'proc/self/mountinfo.gz',
-                             'optmesospherebincurl_-s_-S_http:localhost:62080v1vips-5.output.gz',
-                             'timedatectl-6.output.gz', 'binsh_-c_cat etc*-release-7.output.gz',
-                             'systemctl_list-units_dcos*-8.output.gz', "sestatus-9.output.gz",
-                             "iptables-save-10.output.gz"]
+    expected_common_files = ['dmesg_-T-0.output.gz',
+                             'ip_addr-1.output.gz',
+                             'ip_route-2.output.gz',
+                             'ps_aux_ww_Z-3.output.gz'
+                             'optmesospherebincurl_-s_-S_http:localhost:62080v1vips-4.output.gz',
+                             'timedatectl-5.output.gz',
+                             'binsh_-c_cat etc*-release-6.output.gz',
+                             'systemctl_list-units_dcos*-7.output.gz',
+                             'sestatus-8.output.gz',
+                             'iptables-save-9.output.gz',
+                             'opt/mesosphere/active.buildinfo.full.json.gz',
+                             'opt/mesosphere/etc/dcos-version.json.gz',
+                             'opt/mesosphere/etc/expanded.config.json.gz',
+                             'opt/mesosphere/etc/user.config.yaml.gz',
+                             'dcos-diagnostics-health.json',
+                             'var/lib/dcos/cluster-id.gz',
+                             'proc/cmdline.gz',
+                             'proc/cpuinfo.gz',
+                             'proc/meminfo.gz',
+                             'proc/self/mountinfo.gz'
+                             ]
 
     # these files are expected to be in archive for a master host
-    expected_master_files = ['dcos-mesos-master.service.gz', 'var/lib/dcos/exhibitor/zookeeper/snapshot/myid.gz',
-                             'var/lib/dcos/exhibitor/conf/zoo.cfg.gz', '5050-quota.json',
-                             'var/lib/dcos/mesos/log/mesos-master.log.gz',
-                             'binsh_-c_cat proc`systemctl show dcos-mesos-master.service -p MainPID'
-                             '| cut -d\'=\' -f2`environ-11.output.gz', '5050-overlay-master_state.json.gz'
-                             ] + expected_common_files
-
-    expected_agent_common_files = ['5051-containers.json', '5051-overlay-agent_overlay.json',
-                                   'var/log/mesos/mesos-agent.log.gz',
-                                   'binsh_-c_cat proc`systemctl show dcos-mesos-master.service -p MainPID'
-                                   '| cut -d\'=\' -f2`environ-12.output.gz']
+    expected_master_files = [
+        'binsh_-c_cat proc`systemctl show dcos-mesos-master.service -p MainPID'
+        '| cut -d\'=\' -f2`environ-10.output.gz',
+        '5050-quota.json',
+        '5050-overlay-master_state.json.gz'
+        'dcos-mesos-master.service.gz',
+        'var/lib/dcos/exhibitor/zookeeper/snapshot/myid.gz',
+        'var/lib/dcos/exhibitor/conf/zoo.cfg.gz',
+        'var/lib/dcos/mesos/log/mesos-master.log.gz'
+    ] + expected_common_files
+
+    expected_agent_common_files = [
+        'binsh_-c_cat proc`systemctl show dcos-mesos-master.service -p MainPID'
+        '| cut -d\'=\' -f2`environ-11.output.gz',
+        '5051-containers.json',
+        '5051-overlay-agent_overlay.json',
+        'var/log/mesos/mesos-agent.log.gz'
+    ]
 
     # for agent host
     expected_agent_files = ['dcos-mesos-slave.service.gz'