4641 Commits

Author SHA1 Message Date
Erik Olof Gunnar Andersson
0f054b3594 Update notification handler sample
Change-Id: I82ee4da4ec2f2f1227c25d828fd61c435270e036
2023-06-04 21:57:50 -07:00
Michael Johnson
aacea51715 Re-enable test jobs
This patch re-enables some test jobs that were disabled to resolve a circular
dependency issue.

Change-Id: Ib5eb9d43bdaae31bfdd28a9d3e4d89a1c2c241e1
2023-06-01 21:56:31 -07:00
Michael Johnson
5b7ee8899d Fix zone list/show for shared zones
Previously projects that had a zone shared with them were unable to view the
shared zone. This patch corrects that issue.

Change-Id: Ia3ede57ac2249a1bcd49512aa36452b2b9ffd827
2023-05-31 20:18:30 +00:00
Zuul
d8b019942f Merge "Fix bug in update_zone with recordsets" 2023-05-31 00:28:38 +00:00
Zuul
caa56ba28f Merge "Increase minimum acceptable test coverage" 2023-05-31 00:28:36 +00:00
Zuul
af78fb1983 Merge "Improve storage unit test coverage" 2023-05-31 00:09:16 +00:00
Zuul
2f76218af4 Merge "Improve central unit test coverage" 2023-05-30 22:05:25 +00:00
Erik Olof Gunnar Andersson
b45a7b5167 Fix bug in update_zone with recordsets
When trying to write unit tests I found that when updating a zone
with recordsets there are scenarios where it would throw an sql
error. 
> sqlalchemy.exc.CompileError: Unconsumed column names: zone_name

This fixes up the code path and adds some basic test coverage.

Change-Id: Ia12b530730921db5235fd35f4cabf80b916c216f
2023-05-30 21:52:21 +00:00
Erik Olof Gunnar Andersson
a53c685adf Increase minimum acceptable test coverage
Change-Id: I3dc80fac13e60016e0611410b269bc487d93a39b
2023-05-30 21:52:16 +00:00
Erik Olof Gunnar Andersson
a7cbcc0770 Improve storage unit test coverage
- Minor cleanup to tests.
- Use assertRaisesRegex for exception testing.

Change-Id: I519d9e648e684238ca19d00df6abf9b472e3c666
2023-05-30 21:51:54 +00:00
Zuul
f3ee3cd044 Merge "Add manage cmd tests" 2023-05-30 19:13:09 +00:00
Erik Olof Gunnar Andersson
9620686529 Remove unused find_zone_share code
Change-Id: I235ac441456016c9bd9caf04637ec633812dc007
2023-05-28 20:18:55 -07:00
Erik Olof Gunnar Andersson
9ba81579ac Improve central unit test coverage
- Minor changes to fix code that wasn't unit testable.

Change-Id: I1b00300118340faecc81c33f3a77e46e151e0a1c
2023-05-28 04:42:07 +00:00
Erik Olof Gunnar Andersson
661f0dd517 Add manage cmd tests
Change-Id: Idc21c18bb7689b857f3892634e030930a68f4765
2023-05-28 04:42:03 +00:00
Michael Johnson
48826ffa96 Fix create zone export RBAC
Previously the zone export create API relied on the zone lookup to fail if the
project did not have permission to export the zone. Because of this the RBAC
test was simply if the project_id was valid.
With shared zones, administrators may not want to allow exports of a zone that
is shared with a project. This patch corrects the RBAC to check for zone
ownership before creating the zone export. This way a policy can be created to
allow zone exports for projects that have a zone share.

Change-Id: I2ef28eeb285462dc12b13de80cdab06b5cfb929b
2023-05-27 00:11:07 +00:00
Erik Olof Gunnar Andersson
b9bd8e9bad Add cmd tests
Change-Id: Ic7c4d80a8b39640a1cb37ff01e12bb63f14ca09a
2023-05-26 18:25:50 +00:00
Erik Olof Gunnar Andersson
eb809a00dd Omit hacking from cover
Change-Id: I26178446846ffd387bd966b4c532b59db80038c8
2023-05-25 20:24:49 -07:00
Erik Olof Gunnar Andersson
46e7284747 Add basic api wsgi tests
Change-Id: I91b2c2e4bcb83aea74dc531b0dc4b95842e6b4a0
2023-05-23 22:52:30 -07:00
Zuul
757aa5e5d7 Merge "Restructured SQL code" 2023-05-23 17:25:17 +00:00
Erik Olof Gunnar Andersson
0c30fc491b Restructured SQL code
We have a lot of abstraction that isn't really needed. This patch
removes some of that abstraction and reorganizes the code accordingly.

- Merged storage and sqlalchemy folders.
- Deprecated [central].storage_driver.
- Minor cleanup to SQL code.
- Cleaned up comments and unit tests.

Change-Id: I8f0508aedcc028b1a6e74c790c5d757a0d6c98d7
2023-05-11 21:28:36 -07:00
Erik Olof Gunnar Andersson
1b4281b3ab Refactor managed record logic
We have two almost identical code paths for sink and ptr
records. This patch unifies the two paths and should drastically
lower the overhead of each of these requests.

Change-Id: Iadeaefe361638ec092eab1757f3b89e3020631af
2023-05-12 01:41:41 +00:00
Zuul
590064e8d9 Merge "Remove unused test code for coordination" 2023-05-11 02:31:38 +00:00
Zuul
f46c802523 Merge "Clean up test imports" 2023-05-11 02:31:36 +00:00
Zuul
362f70b4c2 Merge "Fix shared zones missing project ID error" 2023-05-10 01:13:51 +00:00
Zuul
f70053f2aa Merge "Use monotonic time to protect from system time jumps" 2023-05-09 16:37:58 +00:00
OpenStack Proposal Bot
f194b33bd3 Imported Translations from Zanata
For more information about this automatic import see:
https://docs.openstack.org/i18n/latest/reviewing-translation-import.html

Change-Id: If6fe98647dd5564b29bae025ea3880e0d66bba1d
2023-05-09 03:40:48 +00:00
Erik Olof Gunnar Andersson
437d2d9639 Use monotonic time to protect from system time jumps
Change-Id: I44a51bef79109600a3f93844ac51a1f5738508b9
2023-05-07 18:47:39 -07:00
Erik Olof Gunnar Andersson
e7aed84431 Clean up test imports
Change-Id: I665f9d3a5bb8ceeace0bdedac2b64c9dc6205668
2023-05-07 17:34:02 -07:00
Erik Olof Gunnar Andersson
accecda404 Remove unused test code for coordination
Change-Id: I382250784be7dd9c20245cb90b4a19a9e7e313a5
2023-05-06 20:59:09 -07:00
Erik Olof Gunnar Andersson
118294ac14 Fix invalid fallback value for BaseAddressHandler
Domain no longer exists and this patch replaces domain
with the correct value zone.

Change-Id: I4cd88d30882d8966acc811ccb100aa1a1df89a3e
2023-04-30 20:32:16 -07:00
Michael Johnson
0f37baf808 Fix shared zones missing project ID error
Previously if you tried to create a zone share with a scoped token that
does not have a project ID, you would receive a 500 error. This patch
corrects that to return a proper error describing that a project ID is
required when creating zone shares.

Change-Id: Ibeb7154a4c300f59dfa25737736f59609b938bcc
2023-04-17 23:21:28 +00:00
Zuul
ae3bb0ddf3 Merge "Use ids when removing sink managed records" 2023-04-14 01:31:51 +00:00
Erik Olof Gunnar Andersson
2cb42ac9f6 Use ids when removing sink managed records
If the record status changes during the removal process,
the current implementation will fail.

Closes-Bug: 2015762
Change-Id: Iebe609e5f365d03e99f2a4580671175b4642763c
2023-04-13 23:19:20 +00:00
Zuul
99d30a00fa Merge "Use ids when removing ptr records" 2023-04-13 19:54:22 +00:00
Erik Olof Gunnar Andersson
b3161ece23 Use ids when removing ptr records
If the record status changes during the removal process,
the current implementation will fail.

Change-Id: I02b5d7499440154160c89ed63a2f70652fe72145
2023-04-09 11:50:07 -07:00
Mitya_Eremeev
964562cc65 Secondary zone loops AXFR transfer during zone creation
When we create a secondary zone, AXFR transfer loops indefinitely.
Normally, only one xfr should be performed.
Due to AXFR loop the zone changes status from active to pending all the time.

Co-Authored-By: ZhouHeng <zhouhenglc@inspur.com>
Closes-Bug: 1856442
Change-Id: I0e0d138049e6d4c31dea3cc6768cc15e59a5942c
2023-04-07 05:55:53 +00:00
Zuul
f4ce71c8f8 Merge "Move to a batch model for incrementing serial" 2023-04-06 22:51:09 +00:00
Zuul
6591b53e50 Merge "Fix sharing a zone with the zone owner" 2023-04-04 04:57:15 +00:00
Erik Olof Gunnar Andersson
fb9c2da977 Move to a batch model for incrementing serial
This patch moves the responsibility of incrementing the
serial on a zone from central to the producer. This also
means that NOTIFY is triggered by the producer after the
serial has been incremented. The advantage of this approach
is that we can now batch requests which means less work
for the DNS servers, and it removes the risk of
race-conditions when updating the serial. Finally, the
producer is sharded and is easy to scale which means that
this approach should scale well with many zones.

The disadvantage is that it may take up to 5 seconds longer
for the DNS record to be updated on the DNS server. This
can be lowered by increasing the frequency of the task
that is responsible for incrementing the serial.

Depends-On: https://review.opendev.org/#/c/871266/
Change-Id: I5e9733abaaa40c874e1d80d7b57e563df0f12cee
2023-04-04 03:48:34 +00:00
Zuul
0f6a837a23 Merge "Update designate for RBAC "direction change"" 2023-04-03 23:05:08 +00:00
Zuul
3a63b8f413 Merge "Use SDK instead of neutronclient" 2023-03-31 21:27:35 +00:00
Michael Johnson
edcd2e0998 Fix sharing a zone with the zone owner
There was a bug that allowed users to create a zone share with the zone
owner. This would then cause issues deleting the zone share as the zone
owner owns the NS and SOA recordsets in the zone.
This patch raises a BadRequest if the user attempts to create a zone
share for the zone owner.

Closes-Bug: #2011585
Change-Id: I1b56c492436821f650d1ba669614d92595d2f476
2023-03-31 21:02:24 +00:00
Michael Johnson
c2e51939b4 Update designate for RBAC "direction change"
The RBAC goal has changed[1] and system scope is no longer going to be
used. This patch updates Designate to align to this change in direction
by removing the system scope from the policies.
It also updates the functional tests to be ready for the switch to using
the new keystone roles by default.

[1] https://governance.openstack.org/tc/goals/selected/consistent-and-secure-rbac.html#direction-change

Depends-On: https://review.opendev.org/c/openstack/designate-tempest-plugin/+/879111
Change-Id: I1937e215dbd072b0a095df659c75f17a3f48c937
2023-03-31 00:38:50 +00:00
Zuul
15fcba15e8 Merge "Removed unnecessary import in sql code" 2023-03-28 01:18:15 +00:00
Erik Olof Gunnar Andersson
43fa1a8364 Removed unnecessary import in sql code
Change-Id: I62fe1cd22e17a67f3d3f95578def14880933c67b
2023-03-26 22:14:52 +00:00
elajkat
fd09a0cfc3 Use SDK instead of neutronclient
The python-neutronclient has been deprecated for the CLI since Ocata and
the python bindings "neutronclient" has been deprecated for removal as
of the 2023.1 (Antelope) release[1] in favor of using openstacksdk.
This patch migrates Designate from using the neutronclient to using the
openstacksdk for communicating with neutron.

[1] https://docs.openstack.org/releasenotes/python-neutronclient/2023.1.html

Co-Authored-By: Michael Johnson <johnsomor@gmail.com>
Change-Id: I0198f38afe3d5c32ea06d9e674ab0ff849f360e6
Related-Bug: #1999774
2023-03-25 06:06:30 +00:00
Michael Johnson
b8ec3b450b Restart neutron on grenade client update
During a grenade upgrade the Designate grenade plugin updates the
python-designateclient. This can cause the installation location to change
to under the /opt/stack/new path.
This patch makes sure we restart neutron q-svc after this update to make sure
it can still find the client.

Change-Id: I5ce96268cb39ae4a4a8d82a75ac192b2310455a1
2023-03-24 21:21:24 +00:00
Zuul
5703810a40 Merge "Update for sqlalchemy v2.x compatibility" 2023-03-20 22:57:48 +00:00
Takashi Kajinami
541395c424 [coordination] backend_url should be secret
The backend_url option can sometimes contain secrets.

For example when redis coordination backend is used and authentication
is enabled in redis, the plain redis password is put as an URL element.

[coordination]
backend_url=redis://:password@127.0.0.1:6379

Closes-Bug: #2012246
Change-Id: I0ee95fc56130e51bf5c799d252e79a469492b7db
2023-03-20 18:38:23 +09:00
Erik Olof Gunnar Andersson
05a112177d Update for sqlalchemy v2.x compatibility
This patch updates Designate to be compatible with SQLAlchemy 2.x.

Depends-On: https://review.opendev.org/c/openstack/oslo.db/+/874858
Change-Id: I5b9cfb4b86bd7c342fd50d1b50dd12dce0c8e81a
2023-03-11 03:50:19 +00:00