Skip to content

Commit d21ed64

Browse files
authored
(refactor): switch the ansible plugin to use github.com/operator-framework/ansible-operator-plugins, remove ansible code (#6583)
* swap to ansible-operator-plugins for the ansible plugin Signed-off-by: Bryce Palmer <bpalmer@redhat.com> * remove ansible logic from the SDK repo Signed-off-by: Bryce Palmer <bpalmer@redhat.com> * more ansible reference removals Signed-off-by: Bryce Palmer <bpalmer@redhat.com> * go mod tidy Signed-off-by: Bryce Palmer <bpalmer@redhat.com> * remove ansible specific steps from release guide Signed-off-by: Bryce Palmer <bpalmer@redhat.com> --------- Signed-off-by: Bryce Palmer <bpalmer@redhat.com>
1 parent 8f24aa5 commit d21ed64

File tree

228 files changed

+18
-19513
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

228 files changed

+18
-19513
lines changed

.github/dependabot.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
version: 2
22
updates:
3-
- package-ecosystem: docker
4-
directory: "/images/ansible-operator"
5-
schedule:
6-
interval: daily
73
- package-ecosystem: docker
84
directory: "/images/custom-scorecard-tests"
95
schedule:

.github/workflows/deploy-manual.yml

Lines changed: 0 additions & 81 deletions
This file was deleted.

.github/workflows/deploy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ jobs:
7373
environment: deploy
7474
strategy:
7575
matrix:
76-
id: ["operator-sdk", "helm-operator", "scorecard-test", "ansible-operator"]
76+
id: ["operator-sdk", "helm-operator", "scorecard-test"]
7777
steps:
7878

7979
- name: set up qemu

.github/workflows/freshen-images.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
strategy:
3333
matrix:
3434
# TODO(estroz): support scorecard-test-kuttl rebuilds.
35-
id: ["operator-sdk", "ansible-operator", "helm-operator", "scorecard-test"]
35+
id: ["operator-sdk", "helm-operator", "scorecard-test"]
3636
steps:
3737
- name: set up qemu
3838
uses: docker/setup-qemu-action@v2

.github/workflows/freshen-images/build.sh

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ IMAGE_DO=--load
2222
# Space-separated list of git tags.
2323
# The --tags arg can be comma-separated.
2424
TAGS=
25-
# ID of the image, ex. operator-sdk, ansible-operator.
25+
# ID of the image, ex. operator-sdk.
2626
IMAGE_ID=
2727
# Update all images.
2828
FORCE=0
@@ -78,20 +78,6 @@ git clone https://github.com/operator-framework/operator-sdk.git $tmp
7878
trap "rm -rf $tmp" EXIT
7979
pushd $tmp
8080

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

9682
# Build the image defined by IMAGE_ID for each tag for a set of platforms.
9783
for i in ${!TAGS[*]}; do

.github/workflows/freshen-images/lib.sh

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -48,38 +48,6 @@ function is_dockerfile_fresh() {
4848
done
4949
}
5050

51-
# Build an image at path ./images/ansible-operator/base.Dockerfile checked out at git tag $1
52-
# for all platforms in $2. Semantics are otherwise the same as build_generic.
53-
function build_ansible_base() {
54-
local tag=$1
55-
local platforms=$2
56-
local buildlatest=$3
57-
local dockerfile=./images/ansible-operator/base.Dockerfile
58-
59-
60-
git checkout refs/tags/$tag
61-
local ansible_base_image_tag=$(grep -oP 'FROM \K(quay\.io/operator-framework/ansible-operator-base:.+)' ./images/ansible-operator/Dockerfile)
62-
# Attempt to get the git ref that built this image from the git_commit image label,
63-
# falling back to parsing it from the image tag, which typically contains a git ref
64-
# as the last hyphen-delimit element.
65-
local ansible_base_git_ref=$(docker inspect --format '{{ index .Config.Labels "git_commit" }}' $ansible_base_image_tag)
66-
if [[ $ansible_base_git_ref == "devel" || $ansible_base_git_ref == "" ]]; then
67-
ansible_base_git_ref=$(echo $ansible_base_image_tag | sed -E 's|.+:.+-(.+)|\1|')
68-
fi
69-
git checkout $ansible_base_git_ref
70-
if is_dockerfile_fresh "$dockerfile"; then
71-
echo "Skipping build of $dockerfile, it is FRESH!"
72-
else
73-
# dockerfile is not fresh, rebuildng image
74-
if $buildlatest; then
75-
echo "Rebuilding image [$ansible_base_image_tag] and latest for [$platforms]"
76-
_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
77-
else
78-
echo "Rebuilding image [$ansible_base_image_tag] for [$platforms]"
79-
_buildx --tag $ansible_base_image_tag --platform "$platforms" --file "$dockerfile" $IMAGE_DO --build-arg GIT_COMMIT=$ansible_base_git_ref ./images/ansible-operator
80-
fi
81-
fi
82-
}
8351

8452
# Build an image at path ./images/$2/Dockerfile checked out at git tag $1
8553
# for all platforms in $3. Tag is assumed to be "v"+semver; the image is tagged

.github/workflows/test-ansible.yml

Lines changed: 0 additions & 59 deletions
This file was deleted.

.goreleaser.yml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -36,16 +36,6 @@ builds:
3636
- linux_ppc64le
3737
- linux_s390x
3838

39-
# ansible-operator build steps
40-
- id: ansible-operator
41-
main: ./cmd/ansible-operator
42-
binary: ansible-operator
43-
mod_timestamp: "{{ .CommitTimestamp }}"
44-
asmflags: *build-asmflags
45-
gcflags: *build-gcflags
46-
ldflags: *build-ldflags
47-
targets: *build-targets
48-
4939
# helm-operator build steps
5040
- id: helm-operator
5141
main: ./cmd/helm-operator

Makefile

Lines changed: 9 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
SHELL = /bin/bash
22

3-
# IMAGE_VERSION represents the ansible-operator, helm-operator, and scorecard subproject versions.
3+
# IMAGE_VERSION represents the helm-operator, and scorecard subproject versions.
44
# This value must be updated to the release tag of the most recent release, a change that must
55
# occur in the release commit. IMAGE_VERSION will be removed once each subproject that uses this
66
# version is moved to a separate repo and release process.
@@ -71,16 +71,16 @@ clean: ## Cleanup build artifacts and tool binaries.
7171
##@ Build
7272

7373
.PHONY: install
74-
install: ## Install operator-sdk, ansible-operator, and helm-operator.
75-
go install $(GO_BUILD_ARGS) ./cmd/{operator-sdk,ansible-operator,helm-operator}
74+
install: ## Install operator-sdk and helm-operator.
75+
go install $(GO_BUILD_ARGS) ./cmd/{operator-sdk,helm-operator}
7676

7777
.PHONY: build
78-
build: ## Build operator-sdk, ansible-operator, and helm-operator.
78+
build: ## Build operator-sdk and helm-operator.
7979
@mkdir -p $(BUILD_DIR)
80-
go build $(GO_BUILD_ARGS) -o $(BUILD_DIR) ./cmd/{operator-sdk,ansible-operator,helm-operator}
80+
go build $(GO_BUILD_ARGS) -o $(BUILD_DIR) ./cmd/{operator-sdk,helm-operator}
8181

82-
.PHONY: build/operator-sdk build/ansible-operator build/helm-operator
83-
build/operator-sdk build/ansible-operator build/helm-operator:
82+
.PHONY: build/operator-sdk build/helm-operator
83+
build/operator-sdk build/helm-operator:
8484
go build $(GO_BUILD_ARGS) -o $(BUILD_DIR)/$(@F) ./cmd/$(@F)
8585

8686
# Build scorecard binaries.
@@ -92,13 +92,9 @@ build/scorecard-test build/scorecard-test-kuttl build/custom-scorecard-tests:
9292

9393
# Convenience wrapper for building all remotely hosted images.
9494
.PHONY: image-build
95-
IMAGE_TARGET_LIST = operator-sdk helm-operator ansible-operator scorecard-test scorecard-test-kuttl
95+
IMAGE_TARGET_LIST = operator-sdk helm-operator scorecard-test scorecard-test-kuttl
9696
image-build: $(foreach i,$(IMAGE_TARGET_LIST),image/$(i)) ## Build all images.
9797

98-
# Convenience wrapper for building dependency base images.
99-
.PHONY: image-build-base
100-
IMAGE_BASE_TARGET_LIST = ansible-operator
101-
image-build-base: $(foreach i,$(IMAGE_BASE_TARGET_LIST),image-base/$(i)) ## Build all images.
10298

10399
# Build an image.
104100
BUILD_IMAGE_REPO = quay.io/operator-framework
@@ -159,7 +155,7 @@ TEST_PKGS = $(shell go list ./... | grep -v -E 'github.com/operator-framework/op
159155
test-unit: ## Run unit tests
160156
go test -coverprofile=coverage.out -covermode=count -short $(TEST_PKGS)
161157

162-
e2e_tests := test-e2e-go test-e2e-ansible test-e2e-ansible-molecule test-e2e-helm test-e2e-integration
158+
e2e_tests := test-e2e-go test-e2e-helm test-e2e-integration
163159
e2e_targets := test-e2e $(e2e_tests)
164160
.PHONY: $(e2e_targets)
165161

@@ -193,12 +189,6 @@ test-e2e-sample-go:: dev-install cluster-create ## Run Memcached Operator Sample
193189
make test-e2e -C ./testdata/go/v3/memcached-operator/
194190
test-e2e-go:: image/custom-scorecard-tests ## Run Go e2e tests
195191
go test ./test/e2e/go -v -ginkgo.v
196-
test-e2e-ansible:: image/ansible-operator ## Run Ansible e2e tests
197-
go test -count=1 ./internal/ansible/proxy/...
198-
go test ./test/e2e/ansible -v -ginkgo.v
199-
test-e2e-ansible-molecule:: install dev-install image/ansible-operator ## Run molecule-based Ansible e2e tests
200-
go run ./hack/generate/samples/molecule/generate.go
201-
./hack/tests/e2e-ansible-molecule.sh
202192
test-e2e-helm:: image/helm-operator ## Run Helm e2e tests
203193
go test ./test/e2e/helm -v -ginkgo.v
204194
test-e2e-integration:: ## Run integration tests

cmd/ansible-operator/main.go

Lines changed: 0 additions & 43 deletions
This file was deleted.

0 commit comments

Comments
 (0)