Skip to content

Commit

Permalink
Branch Sync Updates
Browse files Browse the repository at this point in the history
  • Loading branch information
mikemcd3912 committed May 6, 2024
1 parent 5910986 commit 7069e3e
Show file tree
Hide file tree
Showing 31 changed files with 191 additions and 435 deletions.
17 changes: 17 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"image": "mcr.microsoft.com/vscode/devcontainers/base:ubuntu",
"features": {
"ghcr.io/devcontainers/features/docker-in-docker:2": {},
"ghcr.io/devcontainers/features/kubectl-helm-minikube:1": {},
"ghcr.io/devcontainers/features/aws-cli:1": {}
},
"postCreateCommand": ".devcontainer/postCreateCommand.sh",
"workspaceFolder": "/home/vscode/conformitron",
"workspaceMount": "source=${localWorkspaceFolder},target=/home/vscode/conformitron,type=bind",
"hostRequirements": {
"cpus": 4
},
"remoteEnv": {
"PATH": "${containerEnv:PATH}:/home/vscode/conformitron"
}
}
25 changes: 25 additions & 0 deletions .devcontainer/postCreateCommand.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/usr/bin/env bash

# Step 1 setup autocomplete for kubectl and alias k
mkdir $HOME/.kube
echo "source <(kubectl completion bash)" >> $HOME/.bashrc
echo "alias k=kubectl" >> $HOME/.bashrc
echo "complete -F __start_kubectl k" >> $HOME/.bashrc

# Step 2 - Installs Flux on your local machine.
echo "----------------------------------------------------"
echo "Downloading 'Flux' ..."
curl -O "https://toolkit.Fluxcd.io/install.sh" --silent --location
echo "Installing 'Flux' ..."
chmod +x ./install.sh
./install.sh
rm -rf ./install.sh

# Step 3 Setup Minikube
minikube start

# Step 4 - Installs Flux Controller on your Kubernetes Cluster.
flux install \
--namespace=flux-system \
--network-policy=false \
--components=source-controller,helm-controller,kustomize-controller,notification-controller
6 changes: 6 additions & 0 deletions .github/workflows/close-pull-request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ on:
pull_request_target:
branches: [main]
types: [closed]
paths-ignore:
- 'Validated_Partners/**'
- '.github/**'
- 'docs'
- '.git'

jobs:
merge-master-back-to-dev:
if: github.event.pull_request.merged == false
Expand Down
181 changes: 103 additions & 78 deletions .github/workflows/new-pull-request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ on:
pull_request_target:
branches: [main]
types: [opened, reopened, synchronize]
paths-ignore:
- 'Validated_Partners/**'
- '.github/**'
- 'docs'
- '.git'

jobs:
build:
Expand All @@ -16,91 +21,111 @@ jobs:
run:
git fetch origin pull/${{ github.event.pull_request.number }}/head:pr

- if: ${{github.event.action == 'synchronize' }}
name: Sync Pause
run: sleep 120

- name: Parse Namespace data, Create ConfigMap
id: find-namespace-yaml
run: |
# Pull files down into a filename array
files=$(curl -s "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/files" | jq -r '.[].filename')
echo $files
filearr=($files)
# Pull file information down into a JSON array
readarray -t files < <(curl -s "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/files" | jq -c '.[]')
# Find Namespace File in uploads list or in modified file subdirectory
namespace_file=$(echo "$files" | grep "namespace.yaml")
subdirectory=$(dirname ${filearr[0]})
if [ -z $namespace_file ]; then
git fetch --all
git config --local user.email "dev@null"
git config --local user.name "Conformitron Bot"
git checkout developer_branch
git pull
if [ -f "${subdirectory}/namespace.yaml" ]; then
namespace_file="${subdirectory}/namespace.yaml"
echo "namespace file = $namespace_file"
else
echo "No Namespace file found in existing subdirectory"
exit 200
fi
elif [[ -n $namespace_file ]]; then
echo "Namespace File: $namespace_file"
else
echo "No Namespace file found in commit or subdirectory"
fi
# Parse namespace data
namespace_file="${namespace_file}"
if [ -n "$namespace_file" ]; then
subdirectory=$(dirname $namespace_file)
echo "Sub Directory = $subdirectory"
# get namespace from pr
git checkout pr
namespace_name=$(grep -E '^\s*metadata:\s*$|^\s*name:\s*' "$namespace_file" | awk -F':' '{gsub(/ /, "", $2); print $2}')
git fetch --all
git config --local user.email "dev@null"
git config --local user.name "Conformitron Bot"
# fetch most recent update to dev
git checkout developer_branch
git pull
if [[ ! -z $namespace_name ]]; then
echo "$namespace_name"
namespace=$(echo $namespace_name | xargs echo -n)
echo $namespace
config_map_file="config-map-${{ github.event.pull_request.number }}.yml"
echo $config_map_file
echo "apiVersion: v1" >> $config_map_file
echo "kind: ConfigMap" >> $config_map_file
echo "metadata:" >> $config_map_file
echo " name: $namespace-configmap" >> $config_map_file
echo " namespace: $namespace" >> $config_map_file
echo " labels:" >> $config_map_file
echo " bot: conformitron" >> $config_map_file
echo "data:" >> $config_map_file
echo " Namespace: ${namespace}" >> $config_map_file
echo " prNumber: \"${{ github.event.pull_request.number }}\"" >> $config_map_file
echo " commitHash: ${{ github.event.pull_request.head.sha }}" >> $config_map_file
echo $subdirectory
echo $config_map_file
mkdir -p ./$subdirectory/
mv "$config_map_file" ./$subdirectory/
git add .
# Move updated files over to dev branch
git fetch --all
git config --local user.email "dev@null"
git config --local user.name "Conformitron Bot"
# fetch most recent update to dev
git checkout developer_branch
git pull
# Remove Deleted Files, copy over added or modified files
for item in "${files[@]}"; do
status=$(echo "$item" | jq -r '.status')
filename=$(echo "$item" | jq -r '.filename')
if [ "$status" == renamed ]; then
git checkout pr -- $filename
git add $filename
if [ -f $(echo "$item" | jq -r '.previous_filename') ]; then
git rm $(echo "$item" | jq -r '.previous_filename')
fi
echo "Renaming $filename"
elif [ "$status" != removed ]; then
git checkout pr -- $filename
git add $filename
echo "Moving $filename"
else
echo "No Namespace found"
exit 100
if [ -f $filename ]; then
echo "Deleting $filename"
git rm $filename
fi
fi
else
echo "No namespace.yaml file found"
exit 200
fi
done
# Move updated files over
for item in $files; do
git checkout pr -- $item
git add $item
echo $item
# Create ConfigMap for each file's partner folder
for item in "${files[@]}"; do
status=$(echo "$item" | jq -r '.status')
filename=$(echo "$item" | jq -r '.filename')
echo $filename
if [ "$status" != removed ] && [[ $filename != *README.md ]]; then
# Parse namespace data
subdirectory=$(dirname $filename)
namespace_file_subdirectory=$(dirname $filename)
namespace_file=$(find $namespace_file_subdirectory -name *namespace*)
namespace_name=""
# get namespace from dev branch partner directory
while [ -z "$(find $namespace_file_subdirectory -name '*namespace*')" ] && [[ -z $namespace_name ]]; do
namespace_file_subdirectory=$(dirname $namespace_file_subdirectory)
if [ $(basename $namespace_file_subdirectory) == "Testers" ]; then
namespace_name=$(yq e 'select(document_index==0).metadata.namespace' $filename)
elif [ $(basename $namespace_file_subdirectory) == "Partner" ] || [ $(basename $namespace_file_subdirectory) == "Core" ]; then
echo "No Namespace File Found in Partner Directory"
exit 200
fi
namespace_file=$(find $namespace_file_subdirectory -name "*namespace*")
done
if [[ -n $namespace_name ]]; then
namespace_file_subdirectory=$(dirname $filename)
elif [ -f $namespace_file ]; then
namespace_file_subdirectory=$(dirname $namespace_file)
namespace_name=$(grep -E '^\s*metadata:\s*$|^\s*name:\s*' "$namespace_file" | awk -F':' '{gsub(/ /, "", $2); print $2}')
else
echo "No Namespace file found"
exit 200
fi
if [[ -n $namespace_name ]]; then
namespace=$(echo $namespace_name | xargs echo -n)
config_map_file="config-map-${{ github.event.pull_request.number }}.yml"
echo "apiVersion: v1" >> $config_map_file
echo "kind: ConfigMap" >> $config_map_file
echo "metadata:" >> $config_map_file
echo " name: $namespace-configmap" >> $config_map_file
echo " namespace: $namespace" >> $config_map_file
echo " labels:" >> $config_map_file
echo " bot: conformitron" >> $config_map_file
echo "data:" >> $config_map_file
echo " Namespace: ${namespace}" >> $config_map_file
echo " prNumber: \"${{ github.event.pull_request.number }}\"" >> $config_map_file
echo " commitHash: ${{ github.event.pull_request.head.sha }}" >> $config_map_file
echo " deployed: \"$(date +%s)\"" >> $config_map_file
echo " env: $(echo $subdirectory | cut -f1 -d/ | awk -F- '{print $NF}' )" >> $config_map_file
mkdir -p ./$namespace_file_subdirectory/
mv "$config_map_file" ./$namespace_file_subdirectory/
git add ./$namespace_file_subdirectory/
else
echo "No Namespace found, Invalid namespace file"
exit 100
fi
fi
done
git commit -m "Adding new and changed files for ${namespace}_PR_${{ github.event.pull_request.number }}"
git commit -m "Adding new and changed files for PR_${{ github.event.pull_request.number }}"
git push
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ Refer the example [here](https://github.com/aws-samples/eks-anywhere-addons/blob

## Pre-requisite (Linux/MacOS)

Please use the dev container configuration in the `.devcontainer` folder with [devpod](devpod.sh) or any other dev container environment to create minikube cluster with all the required pre-requisites such as helm, kubectl and flux for local testing. You can skip over to the local testing section if you use dev container environment.

This solution requires Flux CLI locally and Flux Controller on your Kubernetes cluster. Flux requires access to a source repository via api and access to the kubernetes cluster you want to use for testing. Please follow the below steps for installing these pre-requisites.

If you do not already have access to a running kubernetes cluster you can consider setting up an [EKS Anywhere local cluster](https://anywhere.eks.amazonaws.com/docs/getting-started/local-environment/) on docker provider or a local [k3s](https://k3s.io/) cluster or you may choose a hosted service such as [AWS EKS](https://aws.amazon.com/eks/).
Expand Down
8 changes: 4 additions & 4 deletions Validated_Partners/baremetal_Partners.txt
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
Kubernetes Version : 1.27
Date of Conformance Test : 2024-03-26
Date of Conformance Test : 2024-05-02

Following ISV Partners have Validated their Conformance :

VENDOR_PRODUCT VENDOR_PRODUCT_TYPE VENDOR_PRODUCT_VERSION
aqua aqua-enforcer 2022.4.20
dynatrace dynatrace 0.10.1
solo.io solo-istiod 1.18.3-eks-a
komodor k8s-watcher 1.15.5
kong kong-enterprise 2.27.0
accuknox kubearmor v0.10.2
accuknox kubearmor v1.3.2
kubecost cost-analyzer 2.1.0
nirmata enterprise-kyverno 1.6.10
lacework polygraph 6.11.0
suse neuvector 2.4.1
newrelic nri-bundle 5.0.64
perfectscale perfectscale v0.0.38
pulumi pulumi-kubernetes-operator 0.3.0
solo.io solo-istiod 1.18.3-eks-a
sysdig sysdig-agent 1.6.3
tetrate.io tetrate-istio-distribution 1.18.1
hashicorp vault 0.25.0
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
Kubernetes Version : 1.28
Date of Conformance Test : 2024-03-26
Date of Conformance Test : 2024-05-02

Following ISV Partners have Validated their Conformance :

VENDOR_PRODUCT VENDOR_PRODUCT_TYPE VENDOR_PRODUCT_VERSION
aqua aqua-enforcer 2022.4.20
dynatrace dynatrace 0.10.1
solo.io solo-istiod 1.18.3-eks-a
komodor k8s-watcher 1.15.5
kong kong-enterprise 2.27.0
accuknox kubearmor v0.10.2
accuknox kubearmor v1.3.2
kubecost cost-analyzer 2.1.0
nirmata enterprise-kyverno 1.6.10
lacework polygraph 6.11.0
suse neuvector 2.4.1
newrelic nri-bundle 5.0.64
perfectscale perfectscale v0.0.38
pulumi pulumi-kubernetes-operator 0.3.0
solo.io solo-istiod 1.18.3-eks-a
sysdig sysdig-agent 1.6.3
tetrate.io tetrate-istio-distribution 1.18.1
hashicorp vault 0.25.0
8 changes: 4 additions & 4 deletions Validated_Partners/eks-local-clusters-outposts_Partners.txt
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
Kubernetes Version : 1.27
Date of Conformance Test : 2024-03-26
Date of Conformance Test : 2024-05-02

Following ISV Partners have Validated their Conformance :

VENDOR_PRODUCT VENDOR_PRODUCT_TYPE VENDOR_PRODUCT_VERSION
aqua aqua-enforcer 2022.4.20
dynatrace dynatrace 0.10.1
solo.io solo-istiod 1.18.3-eks-a
komodor k8s-watcher 1.15.5
kong kong-enterprise 2.27.0
accuknox kubearmor v0.10.2
accuknox kubearmor v1.3.2
kubecost cost-analyzer 2.1.0
nirmata enterprise-kyverno 1.6.10
lacework polygraph 6.11.0
suse neuvector 2.4.1
perfectscale perfectscale v0.0.38
pulumi pulumi-kubernetes-operator 0.3.0
solo.io solo-istiod 1.18.3-eks-a
sysdig sysdig-agent 1.6.3
tetrate.io tetrate-istio-distribution 1.18.1
hashicorp vault 0.25.0
8 changes: 4 additions & 4 deletions Validated_Partners/vsphere_Partners.txt
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
Kubernetes Version : 1.28
Date of Conformance Test : 2024-03-26
Date of Conformance Test : 2024-05-02

Following ISV Partners have Validated their Conformance :

VENDOR_PRODUCT VENDOR_PRODUCT_TYPE VENDOR_PRODUCT_VERSION
aqua aqua-enforcer 2022.4.20
dynatrace dynatrace 0.10.1
solo.io solo-istiod 1.18.3-eks-a
komodor k8s-watcher 1.15.5
kong kong-enterprise 2.27.0
accuknox kubearmor v0.10.2
accuknox kubearmor v1.3.2
kubecost cost-analyzer 2.1.0
nirmata enterprise-kyverno 1.6.10
lacework polygraph 6.11.0
suse neuvector 2.4.1
newrelic nri-bundle 5.0.64
perfectscale perfectscale v0.0.38
pulumi pulumi-kubernetes-operator 0.3.0
solo.io solo-istiod 1.18.3-eks-a
sysdig sysdig-agent 1.6.3
tetrate.io tetrate-istio-distribution 1.18.1
hashicorp vault 0.25.0
1 change: 0 additions & 1 deletion docs/index.1.md

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ spec:
kind: HelmRepository
name: newrelic-charts
namespace: flux-system
version: 5.0.74
version: 5.0.75
interval: 1m0s
targetNamespace: newrelic
values:
Expand Down
8 changes: 0 additions & 8 deletions eks-anywhere-common/Addons/Partner/Solo.1.io/namespace.yaml

This file was deleted.

Loading

0 comments on commit 7069e3e

Please sign in to comment.