Skip to content
Open
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
12 changes: 0 additions & 12 deletions internal/designate/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,18 +53,6 @@ const (
DesignateDatabaseName = "designate"
)

// GetScriptConfigMapName returns the name of the ConfigMap used for the
// config merger and the service init scripts
func GetScriptConfigMapName(crName string) string {
return fmt.Sprintf("%s-scripts", crName)
}

// GetServiceConfigConfigMapName returns the name of the ConfigMap used to
// store the service configuration files
func GetServiceConfigConfigMapName(crName string) string {
return fmt.Sprintf("%s-config-data", crName)
}

// DatabaseStatus -
type DatabaseStatus int

Expand Down
38 changes: 0 additions & 38 deletions internal/designate/zones.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import (
"errors"
"fmt"

"github.com/gophercloud/gophercloud/v2"
"github.com/gophercloud/gophercloud/v2/openstack/dns/v2/zones"
"github.com/openstack-k8s-operators/lib-common/modules/openstack"
)
Expand Down Expand Up @@ -83,40 +82,3 @@ func HasZonesInPool(

return len(zoneList) > 0, nil
}

// CountZonesInPool returns the number of zones in a specific pool
func CountZonesInPool(
ctx context.Context,
osclient *openstack.OpenStack,
poolID string,
) (int, error) {
zoneList, err := ListZonesInPool(ctx, osclient, poolID)
if err != nil {
return 0, err
}

return len(zoneList), nil
}

// GetZone retrieves a specific zone by ID
func GetZone(
ctx context.Context,
osclient *openstack.OpenStack,
zoneID string,
) (*zones.Zone, error) {
dnsClient, err := GetDNSClient(osclient)
if err != nil {
return nil, fmt.Errorf("failed to get DNS client: %w", err)
}

zone, err := zones.Get(ctx, dnsClient, zoneID).Extract()
if err != nil {
// Check if it's a 404 error
if gophercloud.ResponseCodeIs(err, 404) {
return nil, fmt.Errorf("%w: %s", ErrZoneNotFound, zoneID)
}
return nil, fmt.Errorf("failed to get zone %s: %w", zoneID, err)
}

return zone, nil
}