From c5b10d155fe7a7dbbfda4475fdbe09309d881e2b Mon Sep 17 00:00:00 2001
From: Cliff Parsons <cp769u@att.com>
Date: Tue, 16 Oct 2018 13:58:12 -0500
Subject: [PATCH] Rename mandatory access control annotation func

This patch set renames the existing apparmor annotation
function to a more generic MAC (Mandatory Access Control)
name to be flexible enough to handle other MAC annotations
in the future.

Change-Id: I98a34484cebc2b420ad8f2664e4aaa84cfb9dca1
---
 ...> _kubernetes_mandatory_access_control_annotation.tpl} | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
 rename helm-toolkit/templates/snippets/{_kubernetes_apparmor_annotation.tpl => _kubernetes_mandatory_access_control_annotation.tpl} (83%)

diff --git a/helm-toolkit/templates/snippets/_kubernetes_apparmor_annotation.tpl b/helm-toolkit/templates/snippets/_kubernetes_mandatory_access_control_annotation.tpl
similarity index 83%
rename from helm-toolkit/templates/snippets/_kubernetes_apparmor_annotation.tpl
rename to helm-toolkit/templates/snippets/_kubernetes_mandatory_access_control_annotation.tpl
index 27029b5e9..8e1aec62e 100644
--- a/helm-toolkit/templates/snippets/_kubernetes_apparmor_annotation.tpl
+++ b/helm-toolkit/templates/snippets/_kubernetes_mandatory_access_control_annotation.tpl
@@ -16,7 +16,9 @@ limitations under the License.
 
 {{/*
 abstract: |
-  Renders apparmor annotations for a list of containers driven by values.yaml.
+  Renders mandatory access control annotations for a list of containers
+  driven by values.yaml. As of now, it can only generate an apparmor
+  annotation, but in the future could generate others.
 values: |
   pod:
     apparmor:
@@ -25,7 +27,7 @@ values: |
         mySecondContainerName: localhost/secondProfile # optional
         myThirdContainerName: localhost/thirdProfile # optional
 usage: |
-  {{ dict "envAll" . "podName" "myPodName" "containerNames" (list "myContainerName" "mySecondContainerName" "myThirdContainerName") | include "helm-toolkit.snippets.kubernetes_apparmor_annotation" }}
+  {{ dict "envAll" . "podName" "myPodName" "containerNames" (list "myContainerName" "mySecondContainerName" "myThirdContainerName") | include "helm-toolkit.snippets.kubernetes_mandatory_access_control_annotation" }}
 return: |
   container.apparmor.security.beta.kubernetes.io/myContainerName: localhost/myAppArmor
   container.apparmor.security.beta.kubernetes.io/mySecondContainerName: localhost/secondProfile
@@ -34,7 +36,7 @@ note: |
   The number of container underneath is a variable arguments. It loops through
   all the container names specified.
 */}}
-{{- define "helm-toolkit.snippets.kubernetes_apparmor_annotation" -}}
+{{- define "helm-toolkit.snippets.kubernetes_mandatory_access_control_annotation" -}}
 {{- $envAll := index . "envAll" -}}
 {{- $podName := index . "podName" -}}
 {{- $containerNames := index . "containerNames" -}}