Problem
When the Designate service user is scoped to a project that does not own the DNS zones (e.g. scoped to project-a but zones live in project-b), the webhook returns 0 zones and cannot manage any records.
This is a common OpenStack setup where DNS zones are owned by a dedicated admin project, while service users authenticate against a different project.
Expected Behaviour
The webhook should support an --all-projects flag that sets the X-Auth-All-Projects: true header on all Designate API requests, allowing the service user to see and manage zones across all projects.
Proposed Implementation
In internal/designate/client/client.go, add the header when constructing the service client:
func NewDesignateClient(allProjects bool) (DesignateClientInterface, error) {
serviceClient, err := createDesignateServiceClient()
if err != nil {
return nil, err
}
if allProjects {
serviceClient.MoreHeaders = map[string]string{
"X-Auth-All-Projects": "true",
}
}
return &designateClient{serviceClient}, nil
}
In cmd/webhook/main.go, expose the flag:
pflag.BoolVar(&allProjects, "all-projects", false, "Manage all zones and recordsets regardless of the project the service user resides in")
Problem
When the Designate service user is scoped to a project that does not own the DNS zones (e.g. scoped to
project-abut zones live inproject-b), the webhook returns 0 zones and cannot manage any records.This is a common OpenStack setup where DNS zones are owned by a dedicated admin project, while service users authenticate against a different project.
Expected Behaviour
The webhook should support an
--all-projectsflag that sets theX-Auth-All-Projects: trueheader on all Designate API requests, allowing the service user to see and manage zones across all projects.Proposed Implementation
In
internal/designate/client/client.go, add the header when constructing the service client:In
cmd/webhook/main.go, expose the flag: