Merge "[COMMON] Fix more array bashisms"
authorSylvain Desbureaux <sylvain.desbureaux@orange.com>
Mon, 3 Jan 2022 08:08:32 +0000 (08:08 +0000)
committerGerrit Code Review <gerrit@onap.org>
Mon, 3 Jan 2022 08:08:32 +0000 (08:08 +0000)
34 files changed:
.ci/check-bashisms.sh
.ci/check-cla-for-multiple-commits.sh [new file with mode: 0755]
.ci/check-for-staging-images.sh [moved from kubernetes/contrib/tools/check-for-staging-images.sh with 96% similarity]
.ci/common.sh [new file with mode: 0755]
.ci/find-tabs.sh [new file with mode: 0755]
.ci/find-trailing-whitespaces.sh [new file with mode: 0755]
.gitlab-ci.yml [new file with mode: 0644]
.gitlab/merge_request_templates/Default.md [new file with mode: 0644]
.pylintrc [new file with mode: 0644]
CODEOWNERS [new file with mode: 0644]
CONTRIBUTING.md [new file with mode: 0644]
README.md [new file with mode: 0644]
kubernetes/Makefile
kubernetes/common/certInitializer/templates/_certInitializer.yaml
kubernetes/common/common/templates/_utils.tpl
kubernetes/common/readinessCheck/templates/_readinessCheck.tpl
kubernetes/common/repositoryGenerator/values.yaml
kubernetes/dcaegen2-services/components/dcae-restconf-collector/values.yaml
kubernetes/dcaegen2-services/components/dcae-ves-collector/values.yaml
kubernetes/dcaegen2-services/components/dcae-ves-mapper/values.yaml
kubernetes/dmaap/components/message-router/components/message-router-kafka/templates/statefulset.yaml
kubernetes/dmaap/components/message-router/components/message-router-kafka/values.yaml
kubernetes/onap/values.yaml
kubernetes/policy/components/policy-api/values.yaml
kubernetes/policy/components/policy-clamp-be/resources/config/application.properties
kubernetes/policy/components/policy-clamp-cl-pf-ppnt/values.yaml
kubernetes/policy/components/policy-distribution/values.yaml
kubernetes/policy/components/policy-drools-pdp/values.yaml
kubernetes/policy/components/policy-pap/values.yaml
kubernetes/policy/components/policy-xacml-pdp/values.yaml
kubernetes/policy/values.yaml
kubernetes/sdnc/components/dmaap-listener/templates/deployment.yaml
kubernetes/sdnc/components/ueb-listener/templates/deployment.yaml
kubernetes/sdnc/templates/statefulset.yaml

index 0dae225..0915725 100755 (executable)
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
+set -eu
+
 if ! which checkbashisms >/dev/null && ! sudo yum install devscripts-minimal && ! sudo apt-get install devscripts
 then
     printf "checkbashisms command not found - please install it \n\
             (e.g. sudo apt-get install devscripts | yum install devscripts-minimal )\n" >&2
     exit 2
 fi
+
 find . -not -path '*/.*' -name '*.sh' -exec checkbashisms {} + || exit 3
 find . -not -path '*/.*' -name '*.failover' -exec checkbashisms -f \{\} + || exit 4
 ! find . -not -path '*/.*' -name '*.sh' -exec grep 'local .*=' {} + || exit 5
 ! find . -not -path '*/.*' -name '*.failover' -exec grep 'local .*=' {} + || exit 6
+
 exit 0
diff --git a/.ci/check-cla-for-multiple-commits.sh b/.ci/check-cla-for-multiple-commits.sh
new file mode 100755 (executable)
index 0000000..13927d9
--- /dev/null
@@ -0,0 +1,25 @@
+#!/bin/sh
+
+# Copyright © 2021 Orange
+#
+# 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.
+
+set -eu
+
+git fetch origin
+
+echo "<------------- AUTHORS LIST ------------->"
+# We are always running on a merge request
+COMMON_ANCESTOR=$(git merge-base HEAD origin/master)
+git log --format=%ae "$COMMON_ANCESTOR..HEAD" | sort | uniq
+echo "<---------------------------------------->"
similarity index 96%
rename from kubernetes/contrib/tools/check-for-staging-images.sh
rename to .ci/check-for-staging-images.sh
index 9705ee6..ae183b6 100755 (executable)
@@ -1,6 +1,7 @@
 #!/bin/sh
 
 # Copyright © 2020 Samsung Electronics
+# Modification copyright © 2021 Orange
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
 
 BASE_URL="https://nexus3.onap.org/repository/docker.release"
 
-if [ "$GERRIT_BRANCH" = "staging" ]; then
-    exit 0
-fi
-
 USED_IMAGES=$(grep -r -E -o -h ':\s*onap/.*:.*' | sed -e 's/^: //' -e 's/^ //' | sort | uniq)
 REPO_IMAGES=$(curl -s $BASE_URL/v2/_catalog | jq -r '.repositories[]')
 NOT_AVAILABLE_IMAGES=$(echo "$USED_IMAGES" | grep -vE  "$(echo "$REPO_IMAGES" | tr "\n" "|" | sed 's/|$//')")
diff --git a/.ci/common.sh b/.ci/common.sh
new file mode 100755 (executable)
index 0000000..2a21f29
--- /dev/null
@@ -0,0 +1,50 @@
+#!/bin/sh
+
+# Copyright © 2021 Orange
+#
+# 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.
+
+RED="\033[31m"
+YELLOW="\033[33m"
+BLUE="\033[94m"
+GREEN="\033[32m"
+NO_COLOR="\033[0m"
+
+title(){
+    MSG="$BLUE$1$NO_COLOR"
+    printf "%s" "$MSG"
+}
+
+subtitle() {
+    MSG="$YELLOW$1$NO_COLOR"
+    printf "%s" "$MSG"
+}
+
+
+# Utility method that prints SUCCESS if a test was succesful, or FAIL together with the test output
+handle_test_result(){
+    EXIT_CODE=$1
+    RESULT="$2"
+    # Change color to red or green depending on SUCCESS
+    if [ "$EXIT_CODE" -eq "0" ]; then
+        printf "%sSUCCESS" "${GREEN}"
+    else
+        printf "%sFAIL" "${RED}"
+    fi
+    # Print RESULT if not empty
+    if [ -n "$RESULT" ] ; then
+        printf "\n%s" "$RESULT"
+    fi
+    # Reset color
+    printf "%s" "${NO_COLOR}"
+}
diff --git a/.ci/find-tabs.sh b/.ci/find-tabs.sh
new file mode 100755 (executable)
index 0000000..9527445
--- /dev/null
@@ -0,0 +1,38 @@
+#!/bin/sh
+
+# Copyright © 2021 Orange
+#
+# 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.
+
+set -e
+
+tabs_lines=""  # Lines containing tabs
+
+for file in $(git grep --cached -Il '' | sed -e 's/^/.\//')
+do
+  lines=$(grep -ErnIH "\t" "$file" | grep -v Makefile | cut -f-2 -d ":")
+  if [ -n "$lines" ]; then
+    tabs_lines=$([ -z "$tabs_lines" ] && echo "$lines" || printf "%s\n%s" "$tabs_lines" "$lines")
+  fi
+done
+
+exit_code=0
+
+# If tabs_lines is not empty, change the exit code to 1 to fail the CI.
+if [ -n "$tabs_lines" ]; then
+  printf "\n***** Lines containing tabs *****\n\n"
+  echo "${tabs_lines}"
+  exit_code=1
+fi
+
+exit $exit_code
diff --git a/.ci/find-trailing-whitespaces.sh b/.ci/find-trailing-whitespaces.sh
new file mode 100755 (executable)
index 0000000..d01984b
--- /dev/null
@@ -0,0 +1,39 @@
+#!/bin/sh
+
+# Copyright © 2021 Orange
+#
+# 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.
+
+set -e
+
+tw_lines=""  # Lines containing trailing whitespaces.
+
+for file in $(git grep --cached -Il '' | sed -e 's/^/.\//')
+do
+  lines=$(grep -ErnIH " +$" $file | cut -f-2 -d ":")
+  if [ -n "$lines" ]; then
+    tw_lines=$([ -z "$tw_lines" ] && echo "$lines" || printf "%s\n%s" "$tw_lines" "$lines")
+  fi
+done
+
+exit_code=0
+
+
+# If tw_lines is not empty, change the exit code to 1 to fail the CI.
+if [ -n "$tw_lines" ]; then
+  printf "\n***** Lines containing trailing whitespace *****\n\n"
+  echo "${tw_lines}"
+  exit_code=1
+fi
+
+exit $exit_code
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
new file mode 100644 (file)
index 0000000..4b15de0
--- /dev/null
@@ -0,0 +1,269 @@
+---
+# Copyright © 2021 Orange
+#
+# 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.
+stages:
+  - linting
+  - build
+  - test
+
+cla_authors:
+  stage: linting
+  image: bitnami/git:2
+  script:
+    - . .ci/common.sh
+    - title "Running cla authors retrieval..."
+    - exit_code=0
+    - RESULT=$(.ci/check-cla-for-multiple-commits.sh 2>&1) || exit_code=$?
+    - handle_test_result $exit_code "$RESULT"
+    - exit $exit_code
+  needs: []
+  rules:
+    - if: $CI_MERGE_REQUEST_ID
+
+
+pylint:
+  stage: linting
+  image: cytopia/pylint
+  script:
+    - . .ci/common.sh
+    - title "Running pylint check..."
+    - exit_code=0
+    - RESULT=$(find kubernetes/ TOSCA/ docs/ -name '*.py' -print0 | xargs -0 pylint 2>&1) || exit_code=$?
+    - handle_test_result $exit_code "$RESULT"
+    - exit $exit_code
+  needs: []
+  rules:
+    - if: $CI_MERGE_REQUEST_ID
+      changes:
+        - .ci/*
+        - .gitlab-ci.yml
+        - '**/*.py'
+
+commit-message:
+  stage: linting
+  image: jorisroovers/gitlint:0.16.0
+  script:
+    - . .ci/common.sh
+    - title "*** Running gitlint..."
+    - exit_code=0
+    - RESULT=$(gitlint 2>&1) || exit_code=$?
+    - handle_test_result $exit_code "$RESULT"
+    - exit $exit_code
+  needs: []
+  rules:
+    - if: $CI_MERGE_REQUEST_ID
+
+
+trailing-whitespaces:
+  stage: linting
+  image: alpine/git:v2.24.1
+  script:
+    - . .ci/common.sh
+    - title "Running trailing whitespaces check..."
+    - exit_code=0
+    - RESULT=$(.ci/find-trailing-whitespaces.sh 2>&1) || exit_code=$?
+    - handle_test_result $exit_code "$RESULT"
+    - exit $exit_code
+  needs: []
+  rules:
+    - if: $CI_MERGE_REQUEST_ID
+
+tabs:
+  stage: linting
+  image: alpine/git:v2.24.1
+  script:
+    - . .ci/common.sh
+    - title "Running tabs check..."
+    - exit_code=0
+    - RESULT=$(.ci/find-tabs.sh 2>&1) || exit_code=$?
+    - handle_test_result $exit_code "$RESULT"
+    - exit $exit_code
+  needs: []
+  rules:
+    - if: $CI_MERGE_REQUEST_ID
+
+documentation:doc8:
+  stage: linting
+  image: testthedocs/ttd-doc8
+  script:
+    - . .ci/common.sh
+    - title "Running doc8 check..."
+    - exit_code=0
+    - RESULT=$(doc8 docs 2>&1) || exit_code=$?
+    - handle_test_result $exit_code "$RESULT"
+    - exit $exit_code
+  rules:
+    - if: $CI_MERGE_REQUEST_ID
+      changes:
+        - .ci/*
+        - .gitlab-ci.yml
+        - docs/**/*
+  needs: []
+
+documentation:link-check:
+  stage: linting
+  image: python:3.7
+  script:
+    - . .ci/common.sh
+    - pip install -r requirements.txt
+      -chttps://git.onap.org/doc/plain/etc/upper-constraints.os.txt
+      -chttps://git.onap.org/doc/plain/etc/upper-constraints.onap.txt
+    - title "Running documentation links check..."
+    - exit_code=0
+    - RESULT=$(sphinx-build -W -b linkcheck -d /tmp/doctrees ./docs/ ./docs/_build/linkcheck 2>&1) || exit_code=$?
+    - handle_test_result $exit_code "$RESULT"
+    - exit $exit_code
+  rules:
+    - if: $CI_MERGE_REQUEST_ID
+      changes:
+        - .ci/*
+        - .gitlab-ci.yml
+        - docs/**/*
+  needs: []
+
+documentation:spelling:
+  stage: linting
+  image: python:3.7
+  script:
+    - . .ci/common.sh
+    - apt-get update
+    - apt-get install -qq --yes curl libenchant-2-2
+    - curl -LO https://git.onap.org/doc/plain/docs/spelling_wordlist.txt
+    - pip install -r requirements.txt
+      -chttps://git.onap.org/doc/plain/etc/upper-constraints.os.txt
+      -chttps://git.onap.org/doc/plain/etc/upper-constraints.onap.txt
+    - title "Running documentation spelling check..."
+    - exit_code=0
+    - RESULT=$(sphinx-build -b spelling -d /tmp/doctrees ./docs/ ./docs/_build/spelling 2>&1) || exit_code=$?
+    - handle_test_result $exit_code "$RESULT"
+    - exit $exit_code
+  rules:
+    - if: $CI_MERGE_REQUEST_ID
+      changes:
+        - .ci/*
+        - .gitlab-ci.yml
+        - docs/**/*
+  needs: []
+
+bashisms:
+  stage: linting
+  image: manabu/checkbashisms-docker
+  script:
+    - . .ci/common.sh
+    - title "Running bashisms check..."
+    - exit_code=0
+    - RESULT=$(.ci/check-bashisms 2>&1) || exit_code=$?
+    - handle_test_result $exit_code "$RESULT"
+    - exit $exit_code
+  rules:
+    - if: $CI_MERGE_REQUEST_ID
+  needs: []
+
+helm:fast:
+  stage: linting
+  services:
+    - name: bitnami/chartmuseum:latest
+      alias: chartmuseum
+  image: alpine/helm:3.6.3
+  variables:
+    SKIP_LINT: "TRUE"
+  script:
+    - . .ci/common.sh
+    - apk add --no-cache make
+    - helm repo add local http://chartmuseum:8080/
+    - helm plugin install --version v0.9.0 https://github.com/chartmuseum/helm-push.git
+    - title "Running helm fast check..."
+    - cd kubernetes
+    - exit_code=0
+    - make all || exit_code=$?
+    - handle_test_result $exit_code ""
+    - exit $exit_code
+  needs: []
+  rules:
+    - if: $CI_MERGE_REQUEST_ID
+      changes:
+        - .ci/*
+        - .gitlab-ci.yml
+        - kubernetes/**/*
+
+helm:full:
+  stage: build
+  services:
+    - name: bitnami/chartmuseum:latest
+      alias: chartmuseum
+  image: alpine/helm:3.6.3
+  script:
+    - . .ci/common.sh
+    - apk add --no-cache make
+    - helm repo add local http://chartmuseum:8080/
+    - helm plugin install --version v0.9.0 https://github.com/chartmuseum/helm-push.git
+    - title "Running full helm check..."
+    - cd kubernetes
+    - exit_code=0
+    - make all || exit_code=$?
+    - handle_test_result $exit_code ""
+    - exit $exit_code
+  needs:
+    - helm:fast
+  timeout: 6h
+  rules:
+    - if: $CI_MERGE_REQUEST_ID
+      changes:
+        - .ci/*
+        - .gitlab-ci.yml
+        - kubernetes/**/*
+
+documentation:
+  stage: build
+  image: python:3.7
+  script:
+    - . .ci/common.sh
+    - apt-get update
+    - apt-get install --yes graphviz plantuml
+    - pip install -r requirements.txt
+      -chttps://git.onap.org/doc/plain/etc/upper-constraints.os.txt
+      -chttps://git.onap.org/doc/plain/etc/upper-constraints.onap.txt
+    - title "Running documentation build..."
+    - exit_code=0
+    - RESULT=$(sphinx-build -q -W -b html -d /tmp/doctrees ./docs/ ./docs/_build/html 2>&1) || exit_code=$?
+    - handle_test_result $exit_code "$RESULT"
+    - exit $exit_code
+  rules:
+    - if: $CI_MERGE_REQUEST_ID
+      changes:
+        - .ci/*
+        - .gitlab-ci.yml
+        - docs/*
+  needs:
+    - documentation:spelling
+    - documentation:link-check
+    - documentation:doc8
+
+gating:launch:
+  stage: test
+  image: busybox
+  script:
+    - . .ci/common.sh
+    - title "Launching request for a gate"
+  needs:
+    - bashisms
+    - helm:fast
+    - tabs
+    - trailing-whitespaces
+  rules:
+    - if: $CI_MERGE_REQUEST_ID
+      changes:
+        - .ci/*
+        - .gitlab-ci.yml
+        - kubernetes/**/*
diff --git a/.gitlab/merge_request_templates/Default.md b/.gitlab/merge_request_templates/Default.md
new file mode 100644 (file)
index 0000000..73c9e68
--- /dev/null
@@ -0,0 +1,41 @@
+## What does this MR do?
+
+<!-- Briefly describe what this MR is about. -->
+
+## Related issues
+
+<!-- Link related issues below. In form of:
+Issue-ID: PROJECT-1234 (PROJECT-1234 being the isue in ONAP jira)
+
+MR can have several Issue-Id
+-->
+
+## Author's checklist
+
+- [ ] The title of the MR is in form of `[IMPACTED] A title`
+  - `IMPACTED` being an ONAP component (`SO`, `AAI`, ...) or `OOM` component (
+  `DOC`, `COMMON`, `GENERAL`, `CI`, ...)
+- [ ] You have filled `What does thirs MR do?`
+- [ ] You have filled `Related issues`
+- [ ] Your last commit message follows the rule:
+
+    ```bash
+    [IMPACTED] A title
+
+    One or several sentences describing the isssue and the way it's solved
+
+    Issue-ID: PROJECT-1234
+    Signed-off-by: Your Name <your.email@company.com>
+    ```
+
+- [ ] Your CLA is submitted in LF
+
+## Maintener's checklist
+
+- [ ] Title is OK
+- [ ] Commit Message is OK
+- [ ] Administrative checks are green
+- [ ] Linting checks are green
+- [ ] Gate is OK
+
+/assign @maintainers
diff --git a/.pylintrc b/.pylintrc
new file mode 100644 (file)
index 0000000..e76164c
--- /dev/null
+++ b/.pylintrc
@@ -0,0 +1,66 @@
+# Copyright © 2021 Orange
+#
+# 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.
+
+
+[MASTER]
+# Specify a score threshold to be exceeded before program exits with error.
+fail-under=3.43
+
+[MESSAGES CONTROL]
+# Disable the message, report, category or checker with the given id(s). You
+# can either give multiple identifiers separated by comma (,) or put this
+# option multiple times (only on the command line, not in the configuration
+# file where it should appear only once). You can also use "--disable=all" to
+# disable everything first and then reenable specific checks. For example, if
+# you want to run only the similarities checker, you can use "--disable=all
+# --enable=similarities". If you want to run only the classes checker, but have
+# no Warning level messages displayed, use "--disable=all --enable=classes
+# --disable=W".
+disable=raw-checker-failed,
+        bad-inline-option,
+        locally-disabled,
+        file-ignored,
+        suppressed-message,
+        useless-suppression,
+        deprecated-pragma,
+        use-symbolic-message-instead,
+        missing-docstring
+
+
+[REPORTS]
+# Set the output format. Available formats are text, parseable, colorized, json
+# and msvs (visual studio). You can also give a reporter class, e.g.
+# mypackage.mymodule.MyReporterClass.
+output-format=colorized
+
+# Tells whether to display a full report or only the messages.
+reports=yes
+
+# Activate the evaluation score.
+score=yes
+
+[FORMAT]
+# Maximum number of characters on a single line.
+max-line-length=120
+
+[BASIC]
+
+# Regular expression matching correct method names. Overrides method-naming-
+# style.
+method-rgx="(([a-z_][a-zA-Z0-9_]{2,})|(_[a-z0-9_]*)|(__[a-zA-Z][a-zA-Z0-9_]+__))$"
+
+# Regular expression matching correct variable names. Overrides variable-
+# naming-style.
+variable-rgx="[a-zA-Z_][a-zA-Z0-9_]{1,30}$"
+
diff --git a/CODEOWNERS b/CODEOWNERS
new file mode 100644 (file)
index 0000000..c255f42
--- /dev/null
@@ -0,0 +1,17 @@
+# Copyright © 2021 Orange
+#
+# 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.
+
+# Translation of INFO.yaml into standard file.
+# Mike and Borislav are not set here yet but will be when username is found.
+* @kopasiak @sylvainOL
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
new file mode 100644 (file)
index 0000000..a932d65
--- /dev/null
@@ -0,0 +1,88 @@
+<!---
+Copyright © 2021 Orange
+
+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.
+-->
+
+# Contributing to OOM
+
+Thanks for taking the time to contribute to OOM!
+Please see a few informations on how to dot it.
+
+## How to become a contributor and submit your own code
+
+### Environment setup
+
+In order to be able to check on your side before submitting, you'll need to
+install some binaries:
+
+* helm (satisfying the targeted version as seen in [setup guide](
+docs/oom_cloud_setup_guide.rst#software-requirements).
+* chartmuseum (in order to push dependency charts)
+* helm push (version 0.9.0 as of today)
+* make
+
+### Linting and testing
+
+OOM use helm linting in order to check that the templates rendering is correct
+with default values.
+
+first step is to start chartmuseum:
+
+```shell
+nohup chartmuseum --storage="local" --storage-local-rootdir="/tmp/chartstorage" \
+  --port 6464 &
+```
+
+then you add `local` repository to helm:
+
+```shell
+helm repo remove local && helm repo add local http://localhost:6464
+```
+
+As full rendering may be extremely long (~9h), you can only lint the common
+part and the component you're working on.
+Here's an example with AAI:
+
+```shell
+cd kubernetes
+make common && make aai
+```
+
+If you work on non default path, it's strongly advised to also render the
+template of your component / subcomponent to be sure it's as expected.
+
+Here's an example enabling service mesh on aai graphadmin:
+
+```shell
+cd aai/components/
+helm template --release-name onap --debug \
+  --set global.ingress.virtualhost.baseurl=toto \
+  --set global.ingress.enabled=true --set global.masterPassword="toto" \
+  --set global.serviceMesh.enabled=true --set global.serviceMesh.tls=true \
+  aai-graphadmin
+```
+
+All the output will be the rendered YAML if it's OK or you may see an error.
+Usually the errors comes from bad indentation or unknown value.
+
+### Contributing A Patch
+
+1. Fork the desired repo, develop and test your code changes.
+2. Sign the LFN CLA (<https://www.onap.org/cla>)
+3. Submit a pull request.
+4. Work with the reviewers on their suggestions.
+5. Ensure to rebase to the HEAD of your target branch and squash un-necessary
+   commits (
+   <https://blog.carbonfive.com/always-squash-and-rebase-your-git-commits/>)
+   before final merger of your contribution.
diff --git a/README.md b/README.md
new file mode 100644 (file)
index 0000000..cb4923d
--- /dev/null
+++ b/README.md
@@ -0,0 +1,46 @@
+<!---
+Copyright © 2021 Orange
+
+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.
+-->
+
+# ONAP Operations Manager
+
+## Description
+
+The ONAP Operations Manager (OOM) is responsible for life-cycle management of
+the ONAP platform itself; components such as SO, SDNC, etc.
+
+It is not responsible for the management of services, VNFs or infrastructure
+instantiated by ONAP or used by ONAP to host such services or VNFs.
+
+OOM uses the open-source Kubernetes container management system as a means to
+manage the containers that compose ONAP where the containers are hosted either
+directly on bare-metal servers or on VMs hosted by a 3rd party management
+system.
+
+OOM ensures that ONAP is easily deployable and maintainable throughout its life
+cycle while using hardware resources efficiently.
+
+Full documentation is available in ONAP documentation in [operations and
+administration guides](
+https://docs.onap.org/en/latest/guides/onap-operator/index.html).
+
+## Contributing
+
+Please see [contributing](./CONTRIBUTING.md) file to learn on how to contribute
+
+## Issues
+
+All issues should be filled in [ONAP Jira](https://jira.onap.org).
+
index f96a32a..1b24a79 100644 (file)
@@ -88,7 +88,7 @@ plugins:
        @cp -R helm $(PACKAGE_DIR)/
 
 check-for-staging-images:
-       $(ROOT_DIR)/contrib/tools/check-for-staging-images.sh
+       $(ROOT_DIR)/../.ci/check-for-staging-images.sh
 
 helm-repo-update:
        @$(HELM_BIN) repo update
index 32bba45..b1e85c0 100644 (file)
   env:
     - name: APP_FQI
       value: "{{ $initRoot.fqi }}"
+  {{- if $initRoot.aaf_namespace }}
     - name: aaf_locate_url
-      value: "https://aaf-locate.{{ $dot.Release.Namespace}}:8095"
-    - name: aaf_locator_container
-      value: "oom"
+      value: "https://aaf-locate.{{ $initRoot.aaf_namespace }}:8095"
+    - name: aaf_locator_container_ns
+      value: "{{ $initRoot.aaf_namespace }}"
+  {{- else }}
+    - name: aaf_locate_url
+      value: "https://aaf-locate.{{ $dot.Release.Namespace }}:8095"
     - name: aaf_locator_container_ns
       value: "{{ $dot.Release.Namespace }}"
+  {{- end }}
+    - name: aaf_locator_container
+      value: "oom"
     - name: aaf_locator_fqdn
       value: "{{ $initRoot.fqdn }}"
     - name: aaf_locator_app_ns
 {{- define "common.certInitializer._volumes" -}}
 {{-   $dot := default . .dot -}}
 {{-   $initRoot := default $dot.Values.certInitializer .initRoot -}}
-{{- $subchartDot := mergeOverwrite (deepCopy (omit $dot "Values")) (dict "Chart" (set (fromJson (toJson $dot.Chart)) "Name" $initRoot.nameOverride) "Values" (mergeOverwrite (deepCopy $initRoot) (dict "global" $dot.Values.global))) }}
+{{- $subchartDot := fromJson (include "common.subChartDot" (dict "dot" $dot "initRoot" $initRoot))}}
 - name: {{ include "common.certInitializer._aafConfigVolumeName" $dot }}
   emptyDir:
     medium: Memory
index ece786f..52826c2 100644 (file)
@@ -36,6 +36,5 @@ Usage:
 {{- define "common.subChartDot" }}
 {{- $initRoot := .initRoot }}
 {{- $dot := .dot }}
-{{/* Our version of helm doesn't support deepCopy so we need this nasty trick */}}
-{{ mergeOverwrite (deepCopy (omit $dot "Values")) (dict "Chart" (set (fromJson (toJson $dot.Chart)) "Name" $initRoot.nameOverride) "Values" (mergeOverwrite (deepCopy $initRoot) (dict "global" $dot.Values.global))) | toJson }}
+{{ mergeOverwrite (deepCopy (omit $dot "Values" "Chart")) (dict "Chart" (set (set (fromJson (toJson $dot.Chart)) "Name" $initRoot.nameOverride) "Version" $dot.Chart.Version) "Values" (mergeOverwrite (deepCopy $initRoot) (dict "global" $dot.Values.global))) | toJson }}
 {{- end -}}
index 71201a1..90c278e 100644 (file)
   {{- end }}
   env:
   - name: NAMESPACE
+  {{- if $subchartDot.Values.namespace }}
+    value: {{ $subchartDot.Values.namespace }}
+  {{- else }}
     valueFrom:
       fieldRef:
         apiVersion: v1
         fieldPath: metadata.namespace
+  {{- end }}
   resources:
     limits:
       cpu: {{ $subchartDot.Values.limits.cpu }}
index ee56577..e36ad49 100644 (file)
@@ -24,12 +24,12 @@ global:
 
   # common global images
   busyboxImage: busybox:1.32
-  curlImage: curlimages/curl:7.69.1
+  curlImage: curlimages/curl:7.80.0
   envsubstImage: dibi/envsubst:1
   # there's only latest image for htpasswd
   htpasswdImage: xmartlabs/htpasswd:latest
   jettyImage: jetty:9-jdk11-slim
-  jreImage: onap/integration-java11:7.1.0
+  jreImage: onap/integration-java11:10.0.0
   kubectlImage: bitnami/kubectl:1.19
   loggingImage: beats/filebeat:5.5.0
   mariadbImage: bitnami/mariadb:10.6.5
index ad29e33..66c781c 100644 (file)
@@ -107,6 +107,10 @@ credentials:
   uid: *controllerCredsUID
   key: password
 
+# application environments
+applicationEnv:
+  LOG4J_FORMAT_MSG_NO_LOOKUPS: 'true'
+
 # Initial Application Configuration
 applicationConfig:
   collector.rcc.appDescription: DCAE RestConf Collector Application
index f863ff8..31007f2 100644 (file)
@@ -107,6 +107,7 @@ service:
 # application environments
 applicationEnv:
   CBS_CLIENT_CONFIG_PATH: '/app-config-input/application_config.yaml'
+  LOG4J_FORMAT_MSG_NO_LOOKUPS: 'true'
 
 # initial application configuration
 applicationConfig:
index a7186a4..93214d3 100644 (file)
@@ -70,6 +70,9 @@ service:
       port: 80
       port_protocol: http
 
+# application environments
+applicationEnv:
+  LOG4J_FORMAT_MSG_NO_LOOKUPS: 'true'
 
 # Initial Application Configuration
 applicationConfig:
index 7cedbf8..ebb5f7e 100644 (file)
@@ -169,6 +169,12 @@ spec:
           value: "{{ include "common.kafkaNodes" (dict "dot" . "replicaCount" .Values.zookeeper.replicaCount "componentName" .Values.zookeeper.name "port" .Values.zookeeper.port ) }}"
         - name: KAFKA_CONFLUENT_SUPPORT_METRICS_ENABLE
           value: "{{ .Values.kafka.enableSupport }}"
+        - name: KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR
+          value: "{{ .Values.config.offsets_topic_replication_factor | default .Values.replicaCount }}"
+        - name: KAFKA_NUM_PARTITIONS
+          value: "{{ .Values.config.num_partition | default .Values.replicaCount }}"
+        - name:  KAFKA_DEFAULT_REPLICATION_FACTOR
+          value: "{{ .Values.config.default_replication_factor | default .Values.replicaCount }}"
         {{- if  .Values.global.aafEnabled }}
         - name: KAFKA_OPTS
           value: "{{ .Values.kafka.jaasOptionsAaf }}"
index 16a4c0f..be0de96 100644 (file)
@@ -77,17 +77,18 @@ kafka:
   interBrokerListernerAaf: INTERNAL_SASL_PLAINTEXT
   interBrokerListerner: INTERNAL_PLAINTEXT
 
+config: {}
+  # offsets_topic_replication_factor:
+  # num_partition:
+  # default_replication_factor:
 
 configurationOverrides:
-  "offsets.topic.replication.factor": "3"
   "log.dirs": "/var/lib/kafka/data"
   "log.retention.hours": "168"
-  "num.partitions": "3"
   "transaction.state.log.replication.factor": "1"
   "transaction.state.log.min.isr": "1"
   "num.recovery.threads.per.data.dir": "5"
   "zookeeper.connection.timeout.ms": "6000"
-  "default.replication.factor": "3"
   "zookeeper.set.acl": "true"
 
 jmx:
index aecac0f..1b6099a 100755 (executable)
@@ -81,7 +81,7 @@ global:
   busyboxImage: busybox:1.32
 
   # curl image
-  curlImage: curlimages/curl:7.69.1
+  curlImage: curlimages/curl:7.80.0
 
   # env substitution image
   envsubstImage: dibi/envsubst:1
@@ -112,7 +112,7 @@ global:
   pullPolicy: Always
 
   # default java image
-  jreImage: onap/integration-java11:7.2.0
+  jreImage: onap/integration-java11:10.0.0
 
   # default clusterName
   # {{ template "common.fullname" . }}.{{ template "common.namespace" . }}.svc.{{ .Values.global.clusterName }}
index 26ed0a7..43ec1d7 100755 (executable)
@@ -93,7 +93,7 @@ db:
     internalPort: 3306
 
 restServer:
-  user: healthcheck
+  user: policyadmin
   password: none
 
 # default number of instances
index aa9870a..cd6c6fa 100644 (file)
@@ -53,10 +53,10 @@ clamp.config.files.sdcController=file:/opt/policy/clamp/sdc-controllers-config-p
 #
 # Configuration Settings for Policy Engine Components
 clamp.config.policy.api.url=https://policy-api.{{ include "common.namespace" . }}:6969
-clamp.config.policy.api.userName=healthcheck
+clamp.config.policy.api.userName=policyadmin
 clamp.config.policy.api.password=zb!XztG34
 clamp.config.policy.pap.url=https://policy-pap.{{ include "common.namespace" . }}:6969
-clamp.config.policy.pap.userName=healthcheck
+clamp.config.policy.pap.userName=policyadmin
 clamp.config.policy.pap.password=zb!XztG34
 
 #DCAE Inventory Url Properties
index 791b785..a831da8 100644 (file)
@@ -89,10 +89,10 @@ replicaCount: 1
 # application configuration
 restServer:
   api:
-    user: healthcheck
+    user: policyadmin
     password: none
   pap:
-    user: healthcheck
+    user: policyadmin
     password: none
 
 nodeSelector: {}
index 2d80fbb..ef676bb 100755 (executable)
@@ -79,10 +79,10 @@ restServer:
   user: healthcheck
   password: zb!XztG34
 apiParameters:
-  user: healthcheck
+  user: policyadmin
   password: zb!XztG34
 papParameters:
-  user: healthcheck
+  user: policyadmin
   password: zb!XztG34
 sdcBe:
   user: policy
index fa0fda8..4d7c0f2 100755 (executable)
@@ -124,7 +124,7 @@ db:
   password: policy_user
 
 pap:
-  user: healthcheck
+  user: policyadmin
   password: zb!XztG34
 
 pdp:
index d713552..e7db99e 100755 (executable)
@@ -108,12 +108,12 @@ db:
     internalPort: 3306
 
 restServer:
-  user: healthcheck
+  user: policyadmin
   password: none
 
 healthCheckRestClient:
   api:
-    user: healthcheck
+    user: policyadmin
     password: none
   distribution:
     user: healthcheck
index 7c2d1b1..2007ab2 100755 (executable)
@@ -103,7 +103,7 @@ restServer:
   password: zb!XztG34
 
 apiServer:
-  user: healthcheck
+  user: policyadmin
   password: zb!XztG34
 
 # default number of instances
index 5204aa7..851c895 100755 (executable)
@@ -183,9 +183,9 @@ mariadb-galera:
     nameOverride: *policy-mariadb
 
 restServer:
-  policyPapUserName: healthcheck
+  policyPapUserName: policyadmin
   policyPapUserPassword: zb!XztG34
-  policyApiUserName: healthcheck
+  policyApiUserName: policyadmin
   policyApiUserPassword: zb!XztG34
 
 # Resource Limit flavor -By Default using small
index 69b0fd3..b788a36 100644 (file)
@@ -79,6 +79,8 @@ spec:
           value: "{{ .Values.config.configDir }}"
         - name: SDNC_CONFIG_DIR
           value: "{{ .Values.config.configDir }}"
+        - name: LOG4J_FORMAT_MSG_NO_LOOKUPS
+          value: "true"
         volumeMounts:
         - mountPath: /etc/localtime
           name: localtime
index 603f3a3..a23a6af 100644 (file)
@@ -84,6 +84,8 @@ spec:
           value: "{{ .Values.config.configDir }}"
         - name: SDNC_CONFIG_DIR
           value: "{{ .Values.config.configDir }}"
+        - name: LOG4J_FORMAT_MSG_NO_LOOKUPS
+          value: "true"
         volumeMounts:
         - mountPath: /etc/localtime
           name: localtime
index f53c41c..d252c9a 100644 (file)
@@ -285,6 +285,8 @@ spec:
             value: "{{ .Values.config.javaHome}}"
           - name: JAVA_OPTS
             value: "-Xms{{.Values.config.odl.javaOptions.minMemory}} -Xmx{{.Values.config.odl.javaOptions.maxMemory}}"
+          - name: LOG4J_FORMAT_MSG_NO_LOOKUPS
+            value: "true"
           - name: KARAF_CONSOLE_LOG_LEVEL
             value: "{{ include "common.log.level" . }}"
           - name: SDNRWT