Skip to content

Commit

Permalink
remove ansible logic from the SDK repo
Browse files Browse the repository at this point in the history
Signed-off-by: Bryce Palmer <[email protected]>
  • Loading branch information
everettraven committed Sep 26, 2023
1 parent 9f40883 commit fc3c809
Show file tree
Hide file tree
Showing 145 changed files with 3 additions and 16,396 deletions.
4 changes: 0 additions & 4 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
version: 2
updates:
- package-ecosystem: docker
directory: "/images/ansible-operator"
schedule:
interval: daily
- package-ecosystem: docker
directory: "/images/custom-scorecard-tests"
schedule:
Expand Down
81 changes: 0 additions & 81 deletions .github/workflows/deploy-manual.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ jobs:
environment: deploy
strategy:
matrix:
id: ["operator-sdk", "helm-operator", "scorecard-test", "ansible-operator"]
id: ["operator-sdk", "helm-operator", "scorecard-test"]
steps:

- name: set up qemu
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/freshen-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
strategy:
matrix:
# TODO(estroz): support scorecard-test-kuttl rebuilds.
id: ["operator-sdk", "ansible-operator", "helm-operator", "scorecard-test"]
id: ["operator-sdk", "helm-operator", "scorecard-test"]
steps:
- name: set up qemu
uses: docker/setup-qemu-action@v2
Expand Down
16 changes: 1 addition & 15 deletions .github/workflows/freshen-images/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ IMAGE_DO=--load
# Space-separated list of git tags.
# The --tags arg can be comma-separated.
TAGS=
# ID of the image, ex. operator-sdk, ansible-operator.
# ID of the image, ex. operator-sdk.
IMAGE_ID=
# Update all images.
FORCE=0
Expand Down Expand Up @@ -78,20 +78,6 @@ git clone https://github.com/operator-framework/operator-sdk.git $tmp
trap "rm -rf $tmp" EXIT
pushd $tmp

case $IMAGE_ID in
ansible-operator)
# ansible-operator has a base image that must be rebuilt in advance if necessary.
# This script will detect that the base is fresh when inspecting ansible-operator's
# Dockerfile and build it.
for i in ${!TAGS[*]}; do
if (($i=0)); then
build_ansible_base ${TAGS[$i]} "$PLATFORMS" true
else
build_ansible_base ${TAGS[$i]} "$PLATFORMS" false
fi
done
;;
esac

# Build the image defined by IMAGE_ID for each tag for a set of platforms.
for i in ${!TAGS[*]}; do
Expand Down
32 changes: 0 additions & 32 deletions .github/workflows/freshen-images/lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,38 +48,6 @@ function is_dockerfile_fresh() {
done
}

# Build an image at path ./images/ansible-operator/base.Dockerfile checked out at git tag $1
# for all platforms in $2. Semantics are otherwise the same as build_generic.
function build_ansible_base() {
local tag=$1
local platforms=$2
local buildlatest=$3
local dockerfile=./images/ansible-operator/base.Dockerfile


git checkout refs/tags/$tag
local ansible_base_image_tag=$(grep -oP 'FROM \K(quay\.io/operator-framework/ansible-operator-base:.+)' ./images/ansible-operator/Dockerfile)
# Attempt to get the git ref that built this image from the git_commit image label,
# falling back to parsing it from the image tag, which typically contains a git ref
# as the last hyphen-delimit element.
local ansible_base_git_ref=$(docker inspect --format '{{ index .Config.Labels "git_commit" }}' $ansible_base_image_tag)
if [[ $ansible_base_git_ref == "devel" || $ansible_base_git_ref == "" ]]; then
ansible_base_git_ref=$(echo $ansible_base_image_tag | sed -E 's|.+:.+-(.+)|\1|')
fi
git checkout $ansible_base_git_ref
if is_dockerfile_fresh "$dockerfile"; then
echo "Skipping build of $dockerfile, it is FRESH!"
else
# dockerfile is not fresh, rebuildng image
if $buildlatest; then
echo "Rebuilding image [$ansible_base_image_tag] and latest for [$platforms]"
_buildx --tag $ansible_base_image_tag --tag quay.io/operator-framework/ansible-operator-base:latest --platform "$platforms" --file "$dockerfile" $IMAGE_DO --build-arg GIT_COMMIT=$ansible_base_git_ref ./images/ansible-operator
else
echo "Rebuilding image [$ansible_base_image_tag] for [$platforms]"
_buildx --tag $ansible_base_image_tag --platform "$platforms" --file "$dockerfile" $IMAGE_DO --build-arg GIT_COMMIT=$ansible_base_git_ref ./images/ansible-operator
fi
fi
}

# Build an image at path ./images/$2/Dockerfile checked out at git tag $1
# for all platforms in $3. Tag is assumed to be "v"+semver; the image is tagged
Expand Down
59 changes: 0 additions & 59 deletions .github/workflows/test-ansible.yml

This file was deleted.

43 changes: 0 additions & 43 deletions cmd/ansible-operator/main.go

This file was deleted.

4 changes: 0 additions & 4 deletions hack/generate/samples/generate_testdata.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import (
"os"
"path/filepath"

"github.com/operator-framework/operator-sdk/hack/generate/samples/internal/ansible"
"github.com/operator-framework/operator-sdk/hack/generate/samples/internal/helm"

log "github.com/sirupsen/logrus"
Expand Down Expand Up @@ -57,9 +56,6 @@ func main() {
log.Infof("creating Helm Memcached Sample")
helm.GenerateMemcachedSamples(binaryPath, samplesPath)

log.Infof("creating Ansible Memcached Sample")
ansible.GenerateMemcachedSamples(binaryPath, samplesPath)

log.Infof("creating Go Memcached Sample with Webhooks")
golang.GenerateMemcachedSamples(binaryPath, samplesPath)
}
Loading

0 comments on commit fc3c809

Please sign in to comment.