diff --git a/.github/workflows/close-pull-request.yaml b/.github/workflows/close-pull-request.yaml deleted file mode 100644 index 0dc499e1..00000000 --- a/.github/workflows/close-pull-request.yaml +++ /dev/null @@ -1,32 +0,0 @@ -name: PR Closed - purging developer_branch -on: - pull_request: - branches: [main] - types: [closed] -jobs: - merge-master-back-to-dev: - if: github.event.pull_request.merged == false - timeout-minutes: 2 - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - with: - ref: developer_branch - fetch-depth: 0 - - name: Remove Updates from this PR - run: | - # Get Commits from this PR - TAG=PR_${{ github.event.pull_request.number }} - commits=$(git rev-list HEAD --grep=$TAG) - echo "commits: $commits" - - # Revert Commits or Log that no change was made - git config --local user.email "dev@null" - git config --local user.name "Conformitron Bot" - - for commit in $commits; do - echo $commit - git revert $commit --no-edit || echo "Commit $commit not reverted" - done - git push - diff --git a/.github/workflows/new-pull-request.yaml b/.github/workflows/new-pull-request.yaml deleted file mode 100644 index 60135143..00000000 --- a/.github/workflows/new-pull-request.yaml +++ /dev/null @@ -1,98 +0,0 @@ -name: PR Opened - moving new ISV addon to developer_branch for E2E testing - -on: - pull_request: - branches: [main] - types: [opened, reopened, synchronize] - -jobs: - build: - runs-on: ubuntu-latest - - steps: - - name: Checkout code - uses: actions/checkout@v2 - with: - ref: ${{ github.event.pull_request.head.ref }} - - - name: Parse Namespace data, Create ConfigMap and Copy over committed files - 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) - - # 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 - if [ -n "$namespace_file" ]; then - subdirectory=$(dirname $namespace_file) - echo "Sub Directory = $subdirectory" - 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" - 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 . - else - echo "No Namespace found" - exit 100 - fi - else - echo "No namespace.yaml file found" - exit 200 - fi - - # Move updated files over - for item in $files; do - git checkout ${{ github.event.pull_request.head.ref }} -- $item - git add $item - echo $item - done - git commit -m "Adding new and changed files for ${namespace}_PR_${{ github.event.pull_request.number }}" - git push - diff --git a/eks-anywhere-common/Addons/Core/Kube-Observer/kustomization.yaml b/eks-anywhere-common/Addons/Core/Kube-Observer/kustomization.yaml deleted file mode 100644 index 5d03241b..00000000 --- a/eks-anywhere-common/Addons/Core/Kube-Observer/kustomization.yaml +++ /dev/null @@ -1,12 +0,0 @@ -apiVersion: kustomize.config.k8s.io/v1beta1 -kind: Kustomization -metadata: - name: observer-prod -commonLabels: - app: observer-prod - -resources: - - namespace.yaml - - observer-sa.yaml - - observer-token-secret.yaml - - observer-cronjob.yaml diff --git a/eks-anywhere-common/Addons/Core/Kube-Observer/namespace.yaml b/eks-anywhere-common/Addons/Core/Kube-Observer/namespace.yaml deleted file mode 100644 index 8cbf1519..00000000 --- a/eks-anywhere-common/Addons/Core/Kube-Observer/namespace.yaml +++ /dev/null @@ -1,4 +0,0 @@ -apiVersion: v1 -kind: Namespace -metadata: - name: observer \ No newline at end of file diff --git a/eks-anywhere-common/Addons/Core/Kube-Observer/observer-cronjob.yaml b/eks-anywhere-common/Addons/Core/Kube-Observer/observer-cronjob.yaml deleted file mode 100644 index eb81ba76..00000000 --- a/eks-anywhere-common/Addons/Core/Kube-Observer/observer-cronjob.yaml +++ /dev/null @@ -1,28 +0,0 @@ -apiVersion: batch/v1 -kind: CronJob -metadata: - name: observer - namespace: observer -spec: - # Run at the top of every hour - schedule: "0 * * * *" - jobTemplate: - spec: - template: - spec: - serviceAccountName: observer-sa - containers: - - name: observer-pod - image: public.ecr.aws/n5p5f4n3/conformitron-observer-bot:latest - imagePullPolicy: Always - env: - - name: GITHUB_TOKEN - valueFrom: - secretKeyRef: - name: observer-key - key: observer-key - - name: REPO - value: eks-anywhere-addons - - name: OWNER - value: aws-samples - restartPolicy: Never diff --git a/eks-anywhere-common/Addons/Core/Kube-Observer/observer-sa.yaml b/eks-anywhere-common/Addons/Core/Kube-Observer/observer-sa.yaml deleted file mode 100644 index 52974e0c..00000000 --- a/eks-anywhere-common/Addons/Core/Kube-Observer/observer-sa.yaml +++ /dev/null @@ -1,69 +0,0 @@ -apiVersion: v1 -kind: ServiceAccount -metadata: - name: observer-sa - namespace: observer - ---- -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRole -metadata: - name: watch-pods -rules: - - apiGroups: ["*"] - resources: - - "pods" - - "namespaces" - - "replicasets" - - "deployments" - - "statefulsets" - - "daemonset" - - "jobs" - - "services" - - "configmaps" - verbs: - - "get" - - "list" ---- -apiVersion: rbac.authorization.k8s.io/v1 -kind: Role -metadata: - name: modified-configmap - namespace: observer -rules: - - apiGroups: - - "*" # Represents core api group? - resources: - - "configmaps" - verbs: - - "*" - ---- -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRoleBinding -metadata: - name: attach-observer-role-to-sa - namespace: observer -subjects: - - kind: ServiceAccount - name: observer-sa - namespace: observer -roleRef: - kind: ClusterRole - name: watch-pods - apiGroup: rbac.authorization.k8s.io - ---- -apiVersion: rbac.authorization.k8s.io/v1 -kind: RoleBinding -metadata: - name: attach-configmap-role-to-sa - namespace: observer -subjects: - - kind: ServiceAccount - name: observer-sa - namespace: observer -roleRef: - apiGroup: rbac.authorization.k8s.io - kind: Role - name: modified-configmap \ No newline at end of file diff --git a/eks-anywhere-common/Addons/Core/Kube-Observer/observer-token-secret.yaml b/eks-anywhere-common/Addons/Core/Kube-Observer/observer-token-secret.yaml deleted file mode 100644 index d0ddbf57..00000000 --- a/eks-anywhere-common/Addons/Core/Kube-Observer/observer-token-secret.yaml +++ /dev/null @@ -1,17 +0,0 @@ -apiVersion: external-secrets.io/v1beta1 -kind: ExternalSecret -metadata: - name: observer-secret - namespace: observer -spec: - refreshInterval: "1m" - secretStoreRef: - name: eksa-secret-store - kind: ClusterSecretStore - target: - name: observer-key - creationPolicy: Owner - data: - - secretKey: observer-key - remoteRef: - key: github-token