diff --git a/apis/bases/core.openstack.org_openstackcontrolplanes.yaml b/apis/bases/core.openstack.org_openstackcontrolplanes.yaml index f2cfd8597..c10294eef 100644 --- a/apis/bases/core.openstack.org_openstackcontrolplanes.yaml +++ b/apis/bases/core.openstack.org_openstackcontrolplanes.yaml @@ -9130,7 +9130,8 @@ spec: apacheContainerImage: type: string apiTimeout: - type: string + default: 120 + type: integer customServiceConfig: default: '# add your customization here' type: string @@ -9171,6 +9172,8 @@ spec: type: object octaviaAPI: properties: + apiTimeout: + type: integer customServiceConfig: default: '# add your customization here' type: string @@ -9889,6 +9892,7 @@ spec: type: string required: - apacheContainerImage + - apiTimeout - databaseInstance - octaviaAPI - octaviaNetworkAttachment diff --git a/apis/core/v1beta1/openstackcontrolplane_webhook.go b/apis/core/v1beta1/openstackcontrolplane_webhook.go index da2db86c8..b76b615de 100644 --- a/apis/core/v1beta1/openstackcontrolplane_webhook.go +++ b/apis/core/v1beta1/openstackcontrolplane_webhook.go @@ -896,6 +896,8 @@ func (r *OpenStackControlPlane) DefaultServices() { } r.Spec.Octavia.Template.Default() + initializeOverrideSpec(&r.Spec.Octavia.APIOverride.Route, true) + r.Spec.Octavia.Template.SetDefaultRouteAnnotations(r.Spec.Octavia.APIOverride.Route.Annotations) } // Barbican diff --git a/apis/go.mod b/apis/go.mod index 02e5e8bd2..7ae003256 100644 --- a/apis/go.mod +++ b/apis/go.mod @@ -115,3 +115,5 @@ replace github.com/openshift/api => github.com/openshift/api v0.0.0-202408300231 // custom RabbitmqClusterSpecCore for OpenStackControlplane (v2.9.0_patches_tag) replace github.com/rabbitmq/cluster-operator/v2 => github.com/openstack-k8s-operators/rabbitmq-cluster-operator/v2 v2.6.1-0.20241017142550-a3524acedd49 //allow-merging + +replace github.com/openstack-k8s-operators/octavia-operator/api => github.com/fernandoroyosanchez/octavia-operator/api v0.0.0-20241107131007-1c6bb990d622 diff --git a/apis/go.sum b/apis/go.sum index 77928d4ef..b9fd70986 100644 --- a/apis/go.sum +++ b/apis/go.sum @@ -14,6 +14,8 @@ github.com/evanphx/json-patch v5.7.0+incompatible h1:vgGkfT/9f8zE6tvSCe74nfpAVDQ github.com/evanphx/json-patch v5.7.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/evanphx/json-patch/v5 v5.9.0 h1:kcBlZQbplgElYIlo/n1hJbls2z/1awpXxpRi0/FOJfg= github.com/evanphx/json-patch/v5 v5.9.0/go.mod h1:VNkHZ/282BpEyt/tObQO8s5CMPmYYq14uClGH4abBuQ= +github.com/fernandoroyosanchez/octavia-operator/api v0.0.0-20241107131007-1c6bb990d622 h1:Bn5/Nxwgec5Fqy9o5drUss8qqYUsZgMGhKRPbceVSmI= +github.com/fernandoroyosanchez/octavia-operator/api v0.0.0-20241107131007-1c6bb990d622/go.mod h1:O8z7OV48TD59UGoOg9FgOjpuNU5brIwGwQ3ObGTIdXg= github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= github.com/gabriel-vasile/mimetype v1.4.3 h1:in2uUcidCuFcDKtdcBxlR0rJ1+fsokWf+uqxgUFjbI0= @@ -126,8 +128,6 @@ github.com/openstack-k8s-operators/neutron-operator/api v0.5.1-0.20241106150939- github.com/openstack-k8s-operators/neutron-operator/api v0.5.1-0.20241106150939-8108068a452f/go.mod h1:LFsG8CyB7La/55IFsa/TGK+LxJ3PrfgLv77FM9xiGOY= github.com/openstack-k8s-operators/nova-operator/api v0.5.1-0.20241105105110-d4bfa598cee7 h1:ztIBhZAChwMSBQfzUgWE1zoPvxVcLuJQanTeS9z43yw= github.com/openstack-k8s-operators/nova-operator/api v0.5.1-0.20241105105110-d4bfa598cee7/go.mod h1:lfMDfS0ROyH3mGnPhfdn2zus1wbhqYDIWN2tXYnnWAQ= -github.com/openstack-k8s-operators/octavia-operator/api v0.5.1-0.20241105111556-f9cd9b8eefed h1:mpi0WpWIzFVS8nWaCpN6XHMSQ6yohzXZ4f4SAUVWrlM= -github.com/openstack-k8s-operators/octavia-operator/api v0.5.1-0.20241105111556-f9cd9b8eefed/go.mod h1:O8z7OV48TD59UGoOg9FgOjpuNU5brIwGwQ3ObGTIdXg= github.com/openstack-k8s-operators/openstack-baremetal-operator/api v0.5.1-0.20241030042838-d69076bd6a9d h1:CZUNDTMnekjZ6YqT7gvUF2tixo13VCOGpvKaWk0qQpM= github.com/openstack-k8s-operators/openstack-baremetal-operator/api v0.5.1-0.20241030042838-d69076bd6a9d/go.mod h1:G9nampuSFs/9i2Ldx3OasU6oehWchwYuhBu1qMWktMg= github.com/openstack-k8s-operators/ovn-operator/api v0.5.1-0.20241104080525-a1bccc740d33 h1:GDLf1LwguOnUXhHIZupxiJJeOBQTUOUo1IpUWHNI8Rs= diff --git a/config/crd/bases/core.openstack.org_openstackcontrolplanes.yaml b/config/crd/bases/core.openstack.org_openstackcontrolplanes.yaml index f2cfd8597..c10294eef 100644 --- a/config/crd/bases/core.openstack.org_openstackcontrolplanes.yaml +++ b/config/crd/bases/core.openstack.org_openstackcontrolplanes.yaml @@ -9130,7 +9130,8 @@ spec: apacheContainerImage: type: string apiTimeout: - type: string + default: 120 + type: integer customServiceConfig: default: '# add your customization here' type: string @@ -9171,6 +9172,8 @@ spec: type: object octaviaAPI: properties: + apiTimeout: + type: integer customServiceConfig: default: '# add your customization here' type: string @@ -9889,6 +9892,7 @@ spec: type: string required: - apacheContainerImage + - apiTimeout - databaseInstance - octaviaAPI - octaviaNetworkAttachment diff --git a/go.mod b/go.mod index 5ec6a5547..77a64bb73 100644 --- a/go.mod +++ b/go.mod @@ -126,3 +126,5 @@ replace github.com/openshift/api => github.com/openshift/api v0.0.0-202408300231 // custom RabbitmqClusterSpecCore for OpenStackControlplane (v2.9.0_patches_tag) replace github.com/rabbitmq/cluster-operator/v2 => github.com/openstack-k8s-operators/rabbitmq-cluster-operator/v2 v2.6.1-0.20241017142550-a3524acedd49 //allow-merging + +replace github.com/openstack-k8s-operators/octavia-operator/api => github.com/fernandoroyosanchez/octavia-operator/api v0.0.0-20241107131007-1c6bb990d622 diff --git a/go.sum b/go.sum index 7dd6979a6..3b0a656d6 100644 --- a/go.sum +++ b/go.sum @@ -14,6 +14,8 @@ github.com/evanphx/json-patch v5.7.0+incompatible h1:vgGkfT/9f8zE6tvSCe74nfpAVDQ github.com/evanphx/json-patch v5.7.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/evanphx/json-patch/v5 v5.9.0 h1:kcBlZQbplgElYIlo/n1hJbls2z/1awpXxpRi0/FOJfg= github.com/evanphx/json-patch/v5 v5.9.0/go.mod h1:VNkHZ/282BpEyt/tObQO8s5CMPmYYq14uClGH4abBuQ= +github.com/fernandoroyosanchez/octavia-operator/api v0.0.0-20241107131007-1c6bb990d622 h1:Bn5/Nxwgec5Fqy9o5drUss8qqYUsZgMGhKRPbceVSmI= +github.com/fernandoroyosanchez/octavia-operator/api v0.0.0-20241107131007-1c6bb990d622/go.mod h1:O8z7OV48TD59UGoOg9FgOjpuNU5brIwGwQ3ObGTIdXg= github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= github.com/gabriel-vasile/mimetype v1.4.3 h1:in2uUcidCuFcDKtdcBxlR0rJ1+fsokWf+uqxgUFjbI0= @@ -138,8 +140,6 @@ github.com/openstack-k8s-operators/neutron-operator/api v0.5.1-0.20241106150939- github.com/openstack-k8s-operators/neutron-operator/api v0.5.1-0.20241106150939-8108068a452f/go.mod h1:LFsG8CyB7La/55IFsa/TGK+LxJ3PrfgLv77FM9xiGOY= github.com/openstack-k8s-operators/nova-operator/api v0.5.1-0.20241105105110-d4bfa598cee7 h1:ztIBhZAChwMSBQfzUgWE1zoPvxVcLuJQanTeS9z43yw= github.com/openstack-k8s-operators/nova-operator/api v0.5.1-0.20241105105110-d4bfa598cee7/go.mod h1:lfMDfS0ROyH3mGnPhfdn2zus1wbhqYDIWN2tXYnnWAQ= -github.com/openstack-k8s-operators/octavia-operator/api v0.5.1-0.20241105111556-f9cd9b8eefed h1:mpi0WpWIzFVS8nWaCpN6XHMSQ6yohzXZ4f4SAUVWrlM= -github.com/openstack-k8s-operators/octavia-operator/api v0.5.1-0.20241105111556-f9cd9b8eefed/go.mod h1:O8z7OV48TD59UGoOg9FgOjpuNU5brIwGwQ3ObGTIdXg= github.com/openstack-k8s-operators/openstack-baremetal-operator/api v0.5.1-0.20241030042838-d69076bd6a9d h1:CZUNDTMnekjZ6YqT7gvUF2tixo13VCOGpvKaWk0qQpM= github.com/openstack-k8s-operators/openstack-baremetal-operator/api v0.5.1-0.20241030042838-d69076bd6a9d/go.mod h1:G9nampuSFs/9i2Ldx3OasU6oehWchwYuhBu1qMWktMg= github.com/openstack-k8s-operators/ovn-operator/api v0.5.1-0.20241104080525-a1bccc740d33 h1:GDLf1LwguOnUXhHIZupxiJJeOBQTUOUo1IpUWHNI8Rs= diff --git a/hack/pin-bundle-images.sh b/hack/pin-bundle-images.sh index 57b35d707..83ace1cc1 100755 --- a/hack/pin-bundle-images.sh +++ b/hack/pin-bundle-images.sh @@ -18,13 +18,16 @@ fi #loop over each openstack-k8s-operators go.mod entry MOD_PATHS=$(go list -mod=readonly -m -json all | jq -r '. | select(.Path | contains("openstack")) | .Replace // . |.Path' | grep -v openstack-operator | grep -v lib-common) +echo "$MOD_PATHS\n" for MOD_PATH in ${MOD_PATHS}; do if [[ "$MOD_PATH" == "./apis" ]]; then continue fi MOD_VERSION=$(go list -mod=readonly -m -json all | jq -r ". | select(.Path | contains(\"openstack\")) | .Replace // . | select( .Path == \"$MOD_PATH\") | .Version") + echo "$MOD_VERSION\n" BASE=$(echo $MOD_PATH | sed -e 's|github.com/.*/\(.*\)-operator/.*|\1|') + echo "$BASE\n" GIT_REPO=${MOD_PATH%"/apis"} GIT_REPO=${GIT_REPO%"/api"} @@ -38,6 +41,7 @@ for MOD_PATH in ${MOD_PATHS}; do REF=$(git ls-remote https://${GIT_REPO} | grep ${REF} | awk 'NR==1{print $1}') fi fi + echo "$REF\n" GITHUB_USER=$(echo $MOD_PATH | sed -e 's|github.com/\(.*\)/.*-operator/.*$|\1|') CURL_REGISTRY="quay.io" @@ -62,17 +66,24 @@ for MOD_PATH in ${MOD_PATHS}; do REPO_URL="${CURL_REGISTRY}/${GITHUB_USER}" fi fi + echo "$REPO_URL\n" if [[ ${LOCAL_REGISTRY} -eq 1 && ( "$GITHUB_USER" != "openstack-k8s-operators" || "$BASE" == "$IMAGEBASE" ) ]]; then + echo "SHA1\n" SHA=$(curl -s ${REPO_CURL_URL}/$BASE-operator-bundle/tags/list | jq -r .tags[] | sort -u | grep $REF) elif [[ "${CURL_REGISTRY}" == "docker.io" ]]; then + echo "SHA2 ${REPO_CURL_URL}/$BASE-operator-bundle/tags/?page_size=100\n" SHA=$(curl -s ${REPO_CURL_URL}/$BASE-operator-bundle/tags/?page_size=100 | jq -r .results[].name | sort -u | grep $REF) elif [[ "${CURL_REGISTRY}" != "quay.io" ]]; then + echo "SHA3 ${REPO_CURL_URL}/$BASE-operator-bundle/tag/?onlyActiveTags=true?limit=100\n" # quay.rdoproject.io doesn't support filter_tag_name, so increase limit to 100 SHA=$(curl -s ${REPO_CURL_URL}/$BASE-operator-bundle/tag/?onlyActiveTags=true?limit=100 | jq -r .tags[].name | sort -u | grep $REF) else + echo "SHA4 ${REPO_CURL_URL}/$BASE-operator-bundle/tag/?onlyActiveTags=true\&filter_tag_name=like:$REF \n" + echo "$(curl -s ${REPO_CURL_URL}/$BASE-operator-bundle/tag/?onlyActiveTags=true\&filter_tag_name=like:$REF)" SHA=$(curl -s ${REPO_CURL_URL}/$BASE-operator-bundle/tag/?onlyActiveTags=true\&filter_tag_name=like:$REF | jq -r .tags[].name) fi + echo "$SHA\n" if [ -z "$SHA" ]; then echo ",EMPTY_SHA:$REF:$REPO_CURL_URL" diff --git a/tests/functional/ctlplane/openstackoperator_controller_test.go b/tests/functional/ctlplane/openstackoperator_controller_test.go index ddcf8853e..2c58391ef 100644 --- a/tests/functional/ctlplane/openstackoperator_controller_test.go +++ b/tests/functional/ctlplane/openstackoperator_controller_test.go @@ -583,6 +583,10 @@ var _ = Describe("OpenStackOperator controller", func() { Expect(OSCtlplane.Spec.Manila.APIOverride.Route).Should(Not(BeNil())) Expect(OSCtlplane.Spec.Manila.APIOverride.Route.Annotations).Should(HaveKeyWithValue("haproxy.router.openshift.io/timeout", "60s")) Expect(OSCtlplane.Spec.Manila.APIOverride.Route.Annotations).Should(HaveKeyWithValue("api.manila.openstack.org/timeout", "60s")) + //TODO (froyo) Enable these tests when Octavia would be enabled on FTs + //Expect(OSCtlplane.Spec.Octavia.APIOverride.Route).Should(Not(BeNil())) + //Expect(OSCtlplane.Spec.Octavia.APIOverride.Route.Annotations).Should(HaveKeyWithValue("haproxy.router.openshift.io/timeout", "120s")) + //Expect(OSCtlplane.Spec.Octavia.APIOverride.Route.Annotations).Should(HaveKeyWithValue("api.octavia.openstack.org/timeout", "120s")) }) It("should create selfsigned issuer and public+internal CA and issuer", func() {