diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 1ec08762e..80284fbbb 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -104,7 +104,7 @@ jobs: uses: actions/setup-go@v2 with: # NOTE: Keep the version in sync with Go toolchain in WORKSPACE. - go-version: '1.19.3' + go-version: '1.20.8' # Setup the run environment and run CI test suite - name: Run test suite diff --git a/Makefile b/Makefile index cf41c4f2e..3e7b856ea 100644 --- a/Makefile +++ b/Makefile @@ -287,9 +287,13 @@ push-openstack-populator-image: build-openstack-populator-image $(CONTAINER_CMD) push $(OPENSTACK_POPULATOR_IMAGE) build-ova-provider-server-image: check_container_runtime - $(CONTAINER_CMD) build -f hack/ova-provider-server/Containerfile -t $(OVA_PROVIDER_SERVER_IMAGE) . + export CONTAINER_CMD=$(CONTAINER_CMD); \ + bazel run cmd/ova-provider-server:ova-provider-server-image \ + $(BAZEL_OPTS) \ + --action_env CONTAINER_CMD=$(CONTAINER_CMD) push-ova-provider-server-image: build-ova-provider-server-image + $(CONTAINER_CMD) tag bazel/cmd/ova-provider-server:ova-provider-server-image $(OVA_PROVIDER_SERVER_IMAGE) $(CONTAINER_CMD) push $(OVA_PROVIDER_SERVER_IMAGE) build-all-images: build-api-image \ diff --git a/WORKSPACE b/WORKSPACE index eb74f3c5d..25bbf5f81 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -2,19 +2,19 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive", "http_file" http_archive( name = "io_bazel_rules_go", - sha256 = "ae013bf35bd23234d1dea46b079f1e05ba74ac0321423830119d3e787ec73483", + sha256 = "91585017debb61982f7054c9688857a2ad1fd823fc3f9cb05048b0025c47d023", urls = [ - "https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.36.0/rules_go-v0.36.0.zip", - "https://github.com/bazelbuild/rules_go/releases/download/v0.36.0/rules_go-v0.36.0.zip", + "https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.42.0/rules_go-v0.42.0.zip", + "https://github.com/bazelbuild/rules_go/releases/download/v0.42.0/rules_go-v0.42.0.zip", ], ) http_archive( name = "bazel_gazelle", - sha256 = "448e37e0dbf61d6fa8f00aaa12d191745e14f07c31cabfa731f0c8e8a4f41b97", + sha256 = "d3fa66a39028e97d76f9e2db8f1b0c11c099e8e01bf363a923074784e451f809", urls = [ - "https://mirror.bazel.build/github.com/bazelbuild/bazel-gazelle/releases/download/v0.28.0/bazel-gazelle-v0.28.0.tar.gz", - "https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.28.0/bazel-gazelle-v0.28.0.tar.gz", + "https://mirror.bazel.build/github.com/bazelbuild/bazel-gazelle/releases/download/v0.33.0/bazel-gazelle-v0.33.0.tar.gz", + "https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.33.0/bazel-gazelle-v0.33.0.tar.gz", ], ) @@ -3383,7 +3383,7 @@ go_repository( go_rules_dependencies() # NOTE: Keep the version in sync with Go toolchain in GitHub action. -go_register_toolchains(version = "1.19.3") +go_register_toolchains(version = "1.20.8") # override rules_docker issue with this dependency # rules_docker 0.16 uses 0.1.4, bit since there the checksum changed, which is very weird, going with 0.1.4.1 to @@ -3428,15 +3428,16 @@ container_pull( container_pull( name = "ansible-operator-image", - # v1.22.0 - digest = "sha256:e07ba82127e76f282cb61fad6cfd990ab137533e5e996686576dec088d5e7e44", + # v1.32.0 + digest = "sha256:03f33441842ad666329ea536d84a4788f993f94cb3daf960cd5c38a837cb4773", registry = "quay.io", repository = "operator-framework/ansible-operator", ) container_pull( name = "opm-image", - digest = "sha256:601c62a5e3fea961665aad2ed2834f3f165a020051d355eb24af2125da8e158e", + # v1.29.0 + digest = "sha256:fcb86c656f591f362db3b313f5e1a2754981e3f511ce72ca44ca5d11c5cdd673", registry = "quay.io", repository = "operator-framework/opm", ) @@ -3445,16 +3446,16 @@ http_file( name = "opa", downloaded_file_path = "opa", executable = True, - sha256 = "a3ff21f3b16632d3868e49bdb52f6affbd97ec382d5310d1bbbe7627e8e5c8f6", - urls = ["https://openpolicyagent.org/downloads/v0.52.0/opa_linux_amd64_static"], + sha256 = "b52c1d58d9c7ffe378d5bda0ab1aeed7eb6a662a466484c92dce0af803a13986", + urls = ["https://openpolicyagent.org/downloads/v0.57.0/opa_linux_amd64_static"], ) http_file( name = "kustomize", downloaded_file_path = "kustomize.tar.gz", - sha256 = "4a3372d7bfdffe2eaf729e77f88bc94ce37dc84de55616bfe90aac089bf6fd02", + sha256 = "3b30477a7ff4fb6547fa77d8117e66d995c2bdd526de0dafbf8b7bcb9556c85d", 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.1.1/kustomize_v5.1.1_linux_amd64.tar.gz", ], ) @@ -3462,25 +3463,23 @@ http_file( name = "operator-sdk", downloaded_file_path = "operator-sdk", executable = True, - sha256 = "2fc68a50b94b7c477e804729365baa5de6d5afcfea9b7fcac9f93dd649c29e90", - urls = ["https://github.com/operator-framework/operator-sdk/releases/download/v1.22.0/operator-sdk_linux_amd64"], + sha256 = "fb4c386bca665695e31134cba192564b0b5015f9838fe34f5f2798708330df6a", + urls = ["https://github.com/operator-framework/operator-sdk/releases/download/v1.31.0/operator-sdk_linux_amd64"], ) http_file( name = "opm", downloaded_file_path = "opm", executable = True, - sha256 = "dc0d4d287fef23f165c837b2e6cb68e2506ff295dc57110b9bfe3b553359eb36", - urls = ["https://github.com/operator-framework/operator-registry/releases/download/v1.23.0/linux-amd64-opm"], + sha256 = "994d48a265ab019a27bab4fb2ffa327e34f1e8b93bd604079a0d397f641608a1", + urls = ["https://github.com/operator-framework/operator-registry/releases/download/v1.29.0/linux-amd64-opm"], ) http_archive( name = "bazeldnf", - sha256 = "404fc34e6bd3b568a7ca6fbcde70267d43830d0171d3192e3ecd83c14c320cfc", - strip_prefix = "bazeldnf-0.5.4", + sha256 = "de8ac0519db6c02bed2a976885379d97dc52f46d52b0338e03963def5c2b65fb", urls = [ - "https://github.com/rmohr/bazeldnf/archive/v0.5.4.tar.gz", - "https://storage.googleapis.com/builddeps/404fc34e6bd3b568a7ca6fbcde70267d43830d0171d3192e3ecd83c14c320cfc", + "https://github.com/rmohr/bazeldnf/releases/download/v0.5.7-rc1/bazeldnf-v0.5.7-rc1.tar.gz", ], ) @@ -3495,11 +3494,10 @@ bazeldnf_dependencies() http_archive( name = "rules_proto", - sha256 = "bc12122a5ae4b517fa423ea03a8d82ea6352d5127ea48cb54bc324e8ab78493c", - strip_prefix = "rules_proto-af6481970a34554c6942d993e194a9aed7987780", + sha256 = "dc3fb206a2cb3441b485eb1e423165b231235a1ea9b031b4433cf7bc1fa460dd", + strip_prefix = "rules_proto-5.3.0-21.7", urls = [ - "https://github.com/bazelbuild/rules_proto/archive/af6481970a34554c6942d993e194a9aed7987780.tar.gz", - "https://storage.googleapis.com/builddeps/bc12122a5ae4b517fa423ea03a8d82ea6352d5127ea48cb54bc324e8ab78493c", + "https://github.com/bazelbuild/rules_proto/archive/refs/tags/5.3.0-21.7.tar.gz", ], ) diff --git a/cmd/ova-provider-server/BUILD.bazel b/cmd/ova-provider-server/BUILD.bazel index 0452abde8..ec8e86e58 100644 --- a/cmd/ova-provider-server/BUILD.bazel +++ b/cmd/ova-provider-server/BUILD.bazel @@ -19,15 +19,18 @@ load( "container_image", ) -container_image( - name = "ova-provider-server-image", - base = "@ova-provider-server-image-dockerfile//image:dockerfile_image.tar", - visibility = ["//visibility:public"], -) - go_test( name = "ova-provider-server_test", srcs = ["nfs_test.go"], embed = [":ova-provider-server_lib"], deps = ["//vendor/github.com/onsi/gomega"], ) + +container_image( + name = "ova-provider-server-image", + base = "@ubi9-minimal//image", + directory = "/usr/local/bin/", + entrypoint = ["/usr/local/bin/ova-provider-server"], + files = [":ova-provider-server"], + visibility = ["//visibility:public"], +) diff --git a/hack/ova-provider-server/BUILD.bazel b/hack/ova-provider-server/BUILD.bazel deleted file mode 100644 index e69de29bb..000000000 diff --git a/hack/ova-provider-server/Containerfile b/hack/ova-provider-server/Containerfile deleted file mode 100644 index 52e504ff1..000000000 --- a/hack/ova-provider-server/Containerfile +++ /dev/null @@ -1,8 +0,0 @@ -FROM registry.access.redhat.com/ubi9/go-toolset:1.19.10-4 as builder -ENV GOPATH=$APP_ROOT -COPY . . -RUN CGO_ENABLED=0 go build -buildvcs=false -o ova-provider-server github.com/konveyor/forklift-controller/cmd/ova-provider-server - -FROM quay.io/centos/centos:stream9-minimal -COPY --from=builder /opt/app-root/src/ova-provider-server /usr/local/bin/ova-provider-server -ENTRYPOINT ["/usr/local/bin/ova-provider-server"] \ No newline at end of file diff --git a/hack/ovirt-populator/Containerfile b/hack/ovirt-populator/Containerfile deleted file mode 100644 index cb3dd1de7..000000000 --- a/hack/ovirt-populator/Containerfile +++ /dev/null @@ -1,18 +0,0 @@ -FROM registry.access.redhat.com/ubi8/go-toolset:1.18.9-8 as builder -ENV GOPATH=$APP_ROOT - -COPY go.mod ./ -COPY go.sum ./ -COPY cmd/ovirt-populator/ovirt-populator.go ./ -COPY vendor/ ./vendor/ -# When debugging by replacing the lib-volume-populator with a local modified copy -# COPY . ./ - -RUN CGO_ENABLED=0 go build -o ovirt-populator - -FROM quay.io/centos/centos:stream9-minimal -COPY --from=builder /opt/app-root/src/ovirt-populator /usr/local/bin -RUN microdnf install -y gcc python3-pip python3-devel libxml2-devel openssl-devel libcurl-devel qemu-img && microdnf clean all -RUN pip install ovirt-engine-sdk-python ovirt-imageio - -ENTRYPOINT ["/usr/local/bin/ovirt-populator"] diff --git a/openstack_populator_containerfile b/openstack_populator_containerfile deleted file mode 120000 index 9c39e2b0d..000000000 --- a/openstack_populator_containerfile +++ /dev/null @@ -1 +0,0 @@ -hack/openstack-populator/Containerfile \ No newline at end of file diff --git a/operator/BUILD.bazel b/operator/BUILD.bazel index 2b9f47a8d..4544d46d1 100644 --- a/operator/BUILD.bazel +++ b/operator/BUILD.bazel @@ -80,7 +80,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} """, ) @@ -129,7 +129,7 @@ container_image( # The channels need to be changed during release "operators.operatorframework.io.bundle.channels.v1": "development", "operators.operatorframework.io.bundle.channel.default.v1": "development", - "operators.operatorframework.io.metrics.builder": "operator-sdk-v1.22.0", + "operators.operatorframework.io.metrics.builder": "operator-sdk-v1.31.0", "operators.operatorframework.io.metrics.mediatype.v1": "metrics+v1", "operators.operatorframework.io.metrics.project_layout": "ansible.sdk.operatorframework.io/v1", # Labels for testing. diff --git a/ova_provider_server_containerfile b/ova_provider_server_containerfile deleted file mode 120000 index ba6f3166f..000000000 --- a/ova_provider_server_containerfile +++ /dev/null @@ -1 +0,0 @@ -hack/ova-provider-server/Containerfile \ No newline at end of file diff --git a/ovirt_populator_containerfile b/ovirt_populator_containerfile deleted file mode 120000 index ed2c43407..000000000 --- a/ovirt_populator_containerfile +++ /dev/null @@ -1 +0,0 @@ -hack/ovirt-populator/Containerfile \ No newline at end of file