Browse Source

chore(cgroup.plugin): remove undocumented feature reading cgroups-names.sh when renaming cgroups (#12745)

Co-authored-by: Vladimir Kobal <vlad@prokk.net>
Ilya Mashchenko 2 years ago
parent
commit
005d060beb
3 changed files with 0 additions and 25 deletions
  1. 0 1
      .gitignore
  2. 0 8
      collectors/cgroups.plugin/Makefile.am
  3. 0 16
      collectors/cgroups.plugin/cgroup-name.sh

+ 0 - 1
.gitignore

@@ -134,7 +134,6 @@ daemon/get-kubernetes-labels.sh
 
 health/notifications/alarm-notify.sh
 claim/netdata-claim.sh
-collectors/cgroups.plugin/cgroup-name.sh
 collectors/tc.plugin/tc-qos-helper.sh
 collectors/charts.d.plugin/charts.d.plugin
 collectors/node.d.plugin/node.d.plugin

+ 0 - 8
collectors/cgroups.plugin/Makefile.am

@@ -3,19 +3,11 @@
 AUTOMAKE_OPTIONS = subdir-objects
 MAINTAINERCLEANFILES = $(srcdir)/Makefile.in
 
-CLEANFILES = \
-    cgroup-name.sh \
-    $(NULL)
-
-include $(top_srcdir)/build/subst.inc
-SUFFIXES = .in
-
 dist_plugins_SCRIPTS = \
     cgroup-name.sh \
     cgroup-network-helper.sh \
     $(NULL)
 
 dist_noinst_DATA = \
-    cgroup-name.sh.in \
     README.md \
     $(NULL)

+ 0 - 16
collectors/cgroups.plugin/cgroup-name.sh.in → collectors/cgroups.plugin/cgroup-name.sh

@@ -396,9 +396,6 @@ function podman_validate_id() {
 
 # -----------------------------------------------------------------------------
 
-[ -z "${NETDATA_USER_CONFIG_DIR}" ] && NETDATA_USER_CONFIG_DIR="@configdir_POST@"
-[ -z "${NETDATA_STOCK_CONFIG_DIR}" ] && NETDATA_STOCK_CONFIG_DIR="@libconfigdir_POST@"
-
 DOCKER_HOST="${DOCKER_HOST:=/var/run/docker.sock}"
 PODMAN_HOST="${PODMAN_HOST:=/run/podman/podman.sock}"
 CGROUP="${1}"
@@ -411,19 +408,6 @@ if [ -z "${CGROUP}" ]; then
   fatal "called without a cgroup name. Nothing to do."
 fi
 
-for CONFIG in "${NETDATA_USER_CONFIG_DIR}/cgroups-names.conf" "${NETDATA_STOCK_CONFIG_DIR}/cgroups-names.conf"; do
-  if [ -f "${CONFIG}" ]; then
-    NAME="$(grep "^${CGROUP} " "${CONFIG}" | sed 's/[[:space:]]\+/ /g' | cut -d ' ' -f 2)"
-    if [ -z "${NAME}" ]; then
-      info "cannot find cgroup '${CGROUP}' in '${CONFIG}'."
-    else
-      break
-    fi
-  #else
-  #   info "configuration file '${CONFIG}' is not available."
-  fi
-done
-
 if [ -z "${NAME}" ]; then
   if [[ ${CGROUP} =~ ^.*kubepods.* ]]; then
     k8s_get_name "${CGROUP}"