Skip to content

Commit 461620f

Browse files
committed
Added fallback for metadata id calculation
1 parent f505ce7 commit 461620f

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

api/v2beta1/wms_conversion.go

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -111,15 +111,16 @@ func V3HubFromV2(src *WMS, target *pdoknlv3.WMS) {
111111
}
112112
}
113113

114-
// Also used by non-inspire services
115-
service.Inspire = &pdoknlv3.Inspire{
116-
ServiceMetadataURL: pdoknlv3.MetadataURL{
117-
CSW: &pdoknlv3.Metadata{
118-
MetadataIdentifier: src.Spec.Service.MetadataIdentifier,
114+
if src.Spec.Service.Inspire {
115+
service.Inspire = &pdoknlv3.Inspire{
116+
ServiceMetadataURL: pdoknlv3.MetadataURL{
117+
CSW: &pdoknlv3.Metadata{
118+
MetadataIdentifier: src.Spec.Service.MetadataIdentifier,
119+
},
119120
},
120-
},
121-
SpatialDatasetIdentifier: *src.Spec.Service.Layers[0].SourceMetadataIdentifier,
122-
Language: "dut",
121+
SpatialDatasetIdentifier: *src.Spec.Service.Layers[0].SourceMetadataIdentifier,
122+
Language: "dut",
123+
}
123124
}
124125

125126
if src.Spec.Service.StylingAssets != nil {

internal/controller/mapfilegenerator/mapper.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package mapfilegenerator
22

33
import (
44
"fmt"
5+
"github.com/pdok/mapserver-operator/api/v2beta1"
56
"strconv"
67
"strings"
78

@@ -127,6 +128,8 @@ func MapWMSToMapfileGeneratorInput(wms *pdoknlv3.WMS, ownerInfo *smoothoperatorv
127128
metadataId := ""
128129
if service.Inspire != nil {
129130
metadataId = service.Inspire.ServiceMetadataURL.CSW.MetadataIdentifier
131+
} else {
132+
metadataId = wms.ObjectMeta.Annotations[v2beta1.SERVICE_METADATA_IDENTIFIER_ANNOTATION]
130133
}
131134

132135
var fonts *string

0 commit comments

Comments
 (0)