Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump ansible operator (backport to 2.5) #795

Merged
merged 6 commits into from
Mar 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,14 @@ load(
docker_toolchain_configure = "toolchain_configure",
)


load("@io_bazel_rules_docker//contrib:dockerfile_build.bzl", "dockerfile_image")

dockerfile_image(
name = "forklift-operator-image-containerfile",
dockerfile = "//operator:Containerfile",
)

docker_toolchain_configure(
name = "docker_config",
docker_flags = [
Expand Down Expand Up @@ -3424,14 +3432,6 @@ container_pull(
tag = "latest",
)

container_pull(
name = "ansible-operator-image",
# v1.22.0
digest = "sha256:e07ba82127e76f282cb61fad6cfd990ab137533e5e996686576dec088d5e7e44",
registry = "quay.io",
repository = "operator-framework/ansible-operator",
)

container_pull(
name = "opm-image",
digest = "sha256:601c62a5e3fea961665aad2ed2834f3f165a020051d355eb24af2125da8e158e",
Expand All @@ -3450,9 +3450,9 @@ http_file(
http_file(
name = "kustomize",
downloaded_file_path = "kustomize.tar.gz",
sha256 = "4a3372d7bfdffe2eaf729e77f88bc94ce37dc84de55616bfe90aac089bf6fd02",
sha256 = "3ab32f92360d752a2a53e56be073b649abc1e7351b912c0fb32b960d1def854c",
urls = [
"https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize/v3.8.7/kustomize_v3.8.7_linux_amd64.tar.gz",
"https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize/v5.3.0/kustomize_v5.3.0_linux_amd64.tar.gz",
],
)

Expand Down
28 changes: 2 additions & 26 deletions operator/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
load(
"@io_bazel_rules_docker//container:container.bzl",
"container_image",
"container_push",
)

genrule(
Expand All @@ -14,32 +13,9 @@ genrule(
# OPERATOR
# 1. Build the oprator image with ansible dependencies and with roles.

container_image(
name = "forklift-operator-requirements",
base = "@ansible-operator-image//image",
cmd = "ansible-galaxy collection install -r /opt/ansible/requirements.yml && chmod -R ug+rwx /opt/ansible/.ansible",
directory = "/opt/ansible/",
files = ["requirements.yml"],
)

container_image(
name = "forklift-operator-watches",
base = ":forklift-operator-requirements",
directory = "/opt/ansible/",
files = ["watches.yaml"],
)

container_image(
name = "forklift-operator-roles",
base = ":forklift-operator-watches",
directory = "/opt/ansible/",
files = ["roles"],
)

container_image(
name = "forklift-operator-image",
base = ":forklift-operator-roles",
user = "1001",
base = "@forklift-operator-image-containerfile//image:dockerfile_image.tar",
visibility = ["//visibility:public"],
)

Expand Down Expand Up @@ -80,7 +56,7 @@ genrule(
cmd = """
cd operator;
export DATE=$$(date +%Y-%m-%dT%H:%M:%SZ);
../$(location :kustomize_bin) build config/manifests --load_restrictor LoadRestrictionsNone | envsubst | ../$(location @operator-sdk//file) generate bundle -q --overwrite --extra-service-accounts forklift-controller,forklift-api,forklift-populator-controller --version $${VERSION} --output-dir ../$(RULEDIR)/bundle --channels=$${CHANNELS} --default-channel=$${DEFAULT_CHANNEL}
../$(location :kustomize_bin) build config/manifests --load-restrictor LoadRestrictionsNone | envsubst | ../$(location @operator-sdk//file) generate bundle -q --overwrite --extra-service-accounts forklift-controller,forklift-api,forklift-populator-controller --version $${VERSION} --output-dir ../$(RULEDIR)/bundle --channels=$${CHANNELS} --default-channel=$${DEFAULT_CHANNEL}
""",
)

Expand Down
8 changes: 8 additions & 0 deletions operator/Containerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FROM quay.io/operator-framework/ansible-operator:main

COPY requirements.yml ${HOME}/requirements.yml
COPY watches.yaml ${HOME}/watches.yaml
COPY roles ${HOME}/roles

RUN ansible-galaxy collection install -r ${HOME}/requirements.yml \
&& chmod -R ug+rwx ${HOME}/.ansible
6 changes: 2 additions & 4 deletions operator/requirements.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
---
collections:
- name: community.kubernetes
version: "2.0.1"
- name: operator_sdk.util
version: "0.4.0"
version: "0.5.0"
- name: kubernetes.core
version: "2.3.1"
version: "2.4.2"
- name: cloud.common
version: "2.1.1"
Loading