VOL-5160 - Repo triage build for release branching.

Makefile
makefiles
---------
  o Copy in library makefiles from repo:onf-make.
  o Selectively enable constants and library logic.
  o Cleanup and refactoring effort is needed to enable bulk docker and lint
    targets but that effort is deferred to a separate jira ticket.

VERSION
-------
  o Change *-dev branch to a release version to exercise all pipeline
    job steps (including task publish if any).

build/package/Dockerfile
cmd/bbsim-sadis-server.go
deployments/bbsim-sadis-server.yaml
internal/core/common.go
internal/core/sadis_if.go
internal/core/server.go
internal/core/store.go
internal/core/store_test.go
internal/core/watcher.go
internal/utils/config.go
internal/utils/utils.go
-----------------------
  o Update copyright notice.

Change-Id: I86c89354cb62eda41971bc2c00603d1894977d5c
diff --git a/makefiles/lint/helm/branch-detect.mk b/makefiles/lint/helm/branch-detect.mk
new file mode 100644
index 0000000..0f7d6c4
--- /dev/null
+++ b/makefiles/lint/helm/branch-detect.mk
@@ -0,0 +1,64 @@
+# -*- makefile -*-
+# -----------------------------------------------------------------------
+# Copyright 2022-2023 Open Networking Foundation (ONF) and the ONF Contributors
+#
+# 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.
+# -----------------------------------------------------------------------
+# Intent: Define for includers
+#    o get-git-branch
+#    - lint-helm-branch   -- clean this up, generic set by USE_LEGACY=undef
+# -----------------------------------------------------------------------
+
+## -------------------------------------------------------------------
+## NOTE: This uglyness can go away with proper command line switch use
+## -------------------------------------------------------------------
+##   o USE_LEGACY= (default)
+##       - bridge logic: support existing behavior.
+##       - helmlint.sh contains hardcoded branch='origin/opencord'
+##   o TODO:
+##       - infer values from repository checkout on disk.
+##       - parameterize helmlint.sh
+##       - use simple flags to toggle behavior:
+##           MASTER_BRANCH=1  || --branch master (default)
+##           LOCAL_BRANCH=1   || --branch local)
+##           MY_BRANCH=1      || --branch local
+##       - Better yet: when branch name is known simply pass it:
+##           % make lint-helm BRANCH=alt-branch-name
+## -----------------------------------------------------------------------
+# USE_LEGACY = 1
+ifdef USE_LEGACY
+  $(if $(DEBUG),$(info ifdef USE_LEGACY))
+
+  lint-helm-branch ?= $(shell cat .gitreview | grep branch | cut -d '=' -f2)
+
+else
+  $(if $(DEBUG),$(info not USE_LEGACY))
+
+  ifdef LOCAL_BRANCH
+     get-git-branch ?= $(shell $(GIT) branch --show-current)# empty if detached
+     get-git-branch ?= $(shell awk -F '/branch/ {print $$2}' .gitreview)
+     get-git-branch ?= $(error Detected detached head)
+
+  else # master
+     # refs/remotes/origin/HEAD => origin/master
+     get-git-branch ?= $(shell $(GIT) symbolic-ref --short refs/remotes/origin/HEAD)
+  endif
+
+  lint-helm-branch ?= $(COMPARISON_BRANCH)
+  lint-helm-branch ?= $(get-git-branch)
+
+  $(if $(DEBUG),$(info get-git-branch = $(get-git-branch)))
+  $(if $(DEBUG),$(info lint-branch=$(lint-branch)))
+endif
+
+# [EOF]
diff --git a/makefiles/lint/helm/chart.mk b/makefiles/lint/helm/chart.mk
new file mode 100644
index 0000000..ea05706
--- /dev/null
+++ b/makefiles/lint/helm/chart.mk
@@ -0,0 +1,44 @@
+# -*- makefile -*-
+# -----------------------------------------------------------------------
+# Copyright 2022-2023 Open Networking Foundation (ONF) and the ONF Contributors
+#
+# 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.
+# -----------------------------------------------------------------------
+
+##-------------------##
+##---]  GLOBALS  [---##
+##-------------------##
+# include $(MAKEDIR)/lint/helm/tools.mk
+# include $(MAKEDIR)/lint/helm/branch-detect.mk
+
+##-------------------##
+##---]  TARGETS  [---##
+##-------------------##
+.PHONY: lint-chart
+
+ifndef NO-LINT-CHART
+  lint : lint-chart
+endif
+
+## -----------------------------------------------------------------------
+## -----------------------------------------------------------------------
+lint-chart: $(chartcheck-sh)
+	COMPARISON_BRANCH="$(get-git-branch)" $(chartcheck-sh)
+#	COMPARISON_BRANCH="$(lint-helm-branch)" $(chartcheck-sh)
+
+## -----------------------------------------------------------------------
+## -----------------------------------------------------------------------
+clean::
+	$(RM) -r $(TOP)/helm-repo-tools
+
+# [EOF]
diff --git a/makefiles/lint/helm/helm.mk b/makefiles/lint/helm/helm.mk
new file mode 100644
index 0000000..ecb2f7c
--- /dev/null
+++ b/makefiles/lint/helm/helm.mk
@@ -0,0 +1,38 @@
+# -*- makefile -*-
+# -----------------------------------------------------------------------
+# Copyright 2022-2023 Open Networking Foundation (ONF) and the ONF Contributors
+#
+# 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.
+# -----------------------------------------------------------------------
+
+##-------------------##
+##---]  GLOBALS  [---##
+##-------------------##
+# include $(MAKEDIR)/lint/helm/tools.mk
+# include $(MAKEDIR)/lint/helm/branch-detect.mk
+
+##-------------------##
+##---]  TARGETS  [---##
+##-------------------##
+.PHONY: lint-helm
+
+ifndef NO-LINT-HELM
+  lint : lint-helm
+endif
+
+## -----------------------------------------------------------------------
+## -----------------------------------------------------------------------
+lint-helm: $(helmlint-sh)
+	$(helmlint-sh)
+
+# [EOF]
diff --git a/makefiles/lint/helm/helmrepo.mk b/makefiles/lint/helm/helmrepo.mk
new file mode 100644
index 0000000..b26046f
--- /dev/null
+++ b/makefiles/lint/helm/helmrepo.mk
@@ -0,0 +1,52 @@
+# -*- makefile -*-
+# -----------------------------------------------------------------------
+# Copyright 2023 Open Networking Foundation (ONF) and the ONF Contributors
+#
+# 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.
+# -----------------------------------------------------------------------
+
+##-------------------##
+##---]  GLOBALS  [---##
+##-------------------##
+
+##-------------------##
+##---]  TARGETS  [---##
+##-------------------##
+.PHONY: lint-helmrepo
+
+ifndef NO-LINT-HELMREPO
+  lint : lint-helmrepo
+endif
+
+## -----------------------------------------------------------------------
+## Intent: Jenkins hook test
+## -----------------------------------------------------------------------
+lint-helmrepo-deps += cord-charts-repo
+lint-helmrepo-deps += lint-helm
+lint-helmrepo: $(lint-helmrepo-deps)
+	$(HIDE) $(MAKE) helm-repo-tools
+	helm-repo-tools/helmrepo.sh
+
+## -----------------------------------------------------------------------
+## Intent: Dependency for lint-helmrepo
+## -----------------------------------------------------------------------
+cord-charts-repo:
+	git clone ssh://gerrit.opencord.org:29418/cord-charts-repo.git
+
+## -----------------------------------------------------------------------
+## Intent: Checkout lint tools
+## -----------------------------------------------------------------------
+helm-repo-tools:
+	git clone "https://gerrit.opencord.org/helm-repo-tools"
+
+# [EOF]
diff --git a/makefiles/lint/helm/include.mk b/makefiles/lint/helm/include.mk
new file mode 100644
index 0000000..fbad52b
--- /dev/null
+++ b/makefiles/lint/helm/include.mk
@@ -0,0 +1,79 @@
+# -*- makefile -*-
+# -----------------------------------------------------------------------
+# Copyright 2022-2023 Open Networking Foundation (ONF) and the ONF Contributors (ONF) and the ONF Contributors
+#
+# 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.
+#
+# SPDX-FileCopyrightText: 2022 Open Networking Foundation (ONF) and the ONF Contributors
+# SPDX-License-Identifier: Apache-2.0
+# -----------------------------------------------------------------------
+
+GIT ?= /usr/bin/git
+
+##--------------------##
+##---]  INCLUDES  [---##
+##--------------------##
+include $(MAKEDIR)/lint/helm/tools.mk
+include $(MAKEDIR)/lint/helm/branch-detect.mk
+include $(MAKEDIR)/lint/helm/chart.mk
+include $(MAKEDIR)/lint/helm/helm.mk
+include $(MAKEDIR)/lint/helm/helmrepo.mk
+
+##-------------------##
+##---]  TARGETS  [---##
+##-------------------##
+
+## -----------------------------------------------------------------------
+## [TODO] Extract hardcoded values from lint.sh:
+##    o pass as args
+##    o pass through configs:
+##    o consumer/makefile should prep then invoke htmllint:
+##        + arbitrary repository commit hooks can match build behavior.
+## -----------------------------------------------------------------------
+lint-helm-deps:
+	helm repo add stable https://charts.helm.sh/stable
+	helm repo add rook-release https://charts.rook.io/release
+	helm repo add cord https://charts.opencord.org
+
+## -----------------------------------------------------------------------
+## Intent: Display target help with context
+##   % make help
+##   % make help VERBOSE=1
+## -----------------------------------------------------------------------
+help ::
+	@echo
+	@echo '[LINT: helm]'
+	@echo '  lint-chart                    chart_version_check.sh'
+
+	@echo '  lint-helm                     Syntax check helm configs'
+	@echo '  lint-helmrepo                 Validate index and packages'
+ifdef VERBOSE
+	@echo '    COMPARISON_BRANCH="origin/master" make lint-chart'
+endif
+
+	@echo '  lint-helm-deps                Configure dependent helm charts'
+
+## -----------------------------------------------------------------------
+## Intent: Future enhancement list
+## -----------------------------------------------------------------------
+todo ::
+	@ehco "[TODO: makefiles/helm/include.mk]"
+	@echo " o Generalize script logic, remove hardcoded values,"
+	@echo " o Update gerrit/jenkins/makefiles/interactive:"
+	@echo "     Lint behavior should be consistent everywhere."
+	@echo " o Fix COMPARSION_BRANCH logic:"
+	@echo "     helm-repo-tools/chart_version_check contains 'opencord/master'"
+	@echo " o Refactor 2 jenkins jobs and lint-helm-deps"
+	@echo "     use everywhere: % make lint-helm"
+
+# [EOF]
diff --git a/makefiles/lint/helm/tools.mk b/makefiles/lint/helm/tools.mk
new file mode 100644
index 0000000..66929bc
--- /dev/null
+++ b/makefiles/lint/helm/tools.mk
@@ -0,0 +1,47 @@
+# -*- makefile -*-
+# -----------------------------------------------------------------------
+# Copyright 2022-2023 Open Networking Foundation (ONF) and the ONF Contributors
+#
+# 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.
+# -----------------------------------------------------------------------
+
+##-------------------##
+##---]  GLOBALS  [---##
+##-------------------##
+helmlint-sh   := $(TOP)/helm-repo-tools/helmlint.sh
+chartcheck-sh := $(TOP)/helm-repo-tools/chart_version_check.sh
+
+##-------------------##
+##---]  TARGETS  [---##
+##-------------------##
+
+## -----------------------------------------------------------------------
+## Intent: repo:helm-repo-tools
+##   o Use script as a dependency for on-demand cloning.
+##   o Use of repo name (r-h-t) as a dependency is problematic.
+## -----------------------------------------------------------------------
+$(helmlint-sh) $(chartcheck-sh):
+	git clone "https://gerrit.opencord.org/helm-repo-tools"
+
+## -----------------------------------------------------------------------
+## Intent: Remove generated targets
+## -----------------------------------------------------------------------
+clean ::
+	$(chartcheck-sh) clean
+
+## -----------------------------------------------------------------------
+## -----------------------------------------------------------------------
+sterile::
+	$(RM) -r $(TOP)/helm-repo-tools
+
+# [EOF]