Skip to content
Merged
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
7 changes: 3 additions & 4 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ run:
timeout: 5m

# Modules download mode (do not modify go.mod)
modules-download-mode: readonly
module-download-mode: readonly

# Include test files (see below to exclude certain linters)
tests: true
Expand All @@ -18,11 +18,10 @@ issues:
- dupl
- dogsled
- funlen
- gosec

output:
formats:
- format: colored-line-number
path: stdout
formats: colored-line-number
print-issued-lines: true
print-linter-name: true

Expand Down
3 changes: 2 additions & 1 deletion api/v2beta1/wfs_conversion.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,10 @@ SOFTWARE.
package v2beta1

import (
smoothoperatorutils "github.com/pdok/smooth-operator/pkg/util"
"log"

smoothoperatorutils "github.com/pdok/smooth-operator/pkg/util"

sharedModel "github.com/pdok/smooth-operator/model"

"sigs.k8s.io/controller-runtime/pkg/conversion"
Expand Down
5 changes: 3 additions & 2 deletions api/v2beta1/wms_conversion.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,13 @@ package v2beta1

import (
"errors"
smoothoperatorutils "github.com/pdok/smooth-operator/pkg/util"
"log"
"sigs.k8s.io/controller-runtime/pkg/conversion"
"strconv"
"strings"

smoothoperatorutils "github.com/pdok/smooth-operator/pkg/util"
"sigs.k8s.io/controller-runtime/pkg/conversion"

pdoknlv3 "github.com/pdok/mapserver-operator/api/v3"
sharedModel "github.com/pdok/smooth-operator/model"
)
Expand Down
3 changes: 2 additions & 1 deletion api/v2beta1/wms_conversion_test.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
package v2beta1

import (
"testing"

pdoknlv3 "github.com/pdok/mapserver-operator/api/v3"
"github.com/stretchr/testify/assert"
"sigs.k8s.io/yaml"
"testing"
)

func TestV2ToV3(t *testing.T) {
Expand Down
1 change: 1 addition & 0 deletions api/v3/wfs_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,7 @@ func (wfs *WFS) GeoPackages() []*Gpkg {
return gpkgs
}

//nolint:revive
func (wfs *WFS) GetBaseUrl() string {
return wfs.Spec.Service.URL
}
8 changes: 5 additions & 3 deletions api/v3/wms_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,13 @@ SOFTWARE.
package v3

import (
shared_model "github.com/pdok/smooth-operator/model"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"maps"
"slices"
"sort"

shared_model "github.com/pdok/smooth-operator/model"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

const (
Expand Down Expand Up @@ -582,6 +583,7 @@ func (wms *WMS) GeoPackages() []*Gpkg {
return gpkgs
}

//nolint:revive
func (wms *WMS) GetBaseUrl() string {
return wms.Spec.Service.URL
}
5 changes: 3 additions & 2 deletions api/v3/wms_types_test.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
package v3

import (
"reflect"
"testing"

"github.com/google/go-cmp/cmp"
"github.com/pdok/smooth-operator/model"
controller "github.com/pdok/smooth-operator/pkg/util"
"reflect"
"testing"
)

func TestLayer_setInheritedBoundingBoxes(t *testing.T) {
Expand Down
3 changes: 2 additions & 1 deletion api/v3/wms_validation_test.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package v3

import (
controller "github.com/pdok/smooth-operator/pkg/util"
"reflect"
"testing"

controller "github.com/pdok/smooth-operator/pkg/util"
)

func Test_getEqualChildStyleNames(t *testing.T) {
Expand Down
4 changes: 3 additions & 1 deletion cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,18 @@ import (
"crypto/tls"
"errors"
"flag"
"os"

"github.com/go-logr/zapr"
"github.com/pdok/smooth-operator/pkg/integrations/logging"
"github.com/peterbourgon/ff"
"go.uber.org/zap/zapcore"
"os"
"sigs.k8s.io/controller-runtime/pkg/log/zap"

"github.com/pdok/mapserver-operator/internal/controller/mapfilegenerator"
smoothoperator "github.com/pdok/smooth-operator/api/v1"
traefikiov1alpha1 "github.com/traefik/traefik/v3/pkg/provider/kubernetes/crd/traefikio/v1alpha1"

// Import all Kubernetes client auth plugins (e.g. Azure, GCP, OIDC, etc.)
// to ensure that exec-entrypoint and run can make use of them.
_ "k8s.io/client-go/plugin/pkg/client/auth"
Expand Down
1 change: 1 addition & 0 deletions config/crd/bases/embed.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package bases

import (
_ "embed"

"github.com/pdok/smooth-operator/pkg/validation"
v1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
"sigs.k8s.io/yaml"
Expand Down
9 changes: 5 additions & 4 deletions config/crd/update_openapi.go
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
package main

import (
"os"
"path/filepath"
"strings"

"github.com/pkg/errors"
goyaml "gopkg.in/yaml.v3"
v1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
"os"
"path/filepath"
kyaml "sigs.k8s.io/yaml"
"strings"
)

// Usage: go run ./update_layersv3_openapi.go <crd_dir_path>
Expand Down Expand Up @@ -84,7 +85,7 @@ func updateWMSV3Layers(crdDir string) {

// Remove the 'status' field from the yaml
var rawData map[string]interface{}
goyaml.Unmarshal(updatedContent, &rawData)
_ = goyaml.Unmarshal(updatedContent, &rawData)
delete(rawData, "status")

f, _ := os.OpenFile(path, os.O_TRUNC|os.O_WRONLY, 0644)
Expand Down
3 changes: 2 additions & 1 deletion internal/controller/blobdownload/blob_download.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ package blobdownload
import (
_ "embed"
"fmt"
"k8s.io/utils/strings/slices"
"regexp"
"strings"

"k8s.io/utils/strings/slices"

pdoknlv3 "github.com/pdok/mapserver-operator/api/v3"
"github.com/pdok/mapserver-operator/internal/controller/mapperutils"
"github.com/pdok/mapserver-operator/internal/controller/mapserver"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package capabilitiesgenerator

import (
"fmt"

"gopkg.in/yaml.v3"

pdoknlv3 "github.com/pdok/mapserver-operator/api/v3"
Expand Down
3 changes: 2 additions & 1 deletion internal/controller/capabilitiesgenerator/mapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ package capabilitiesgenerator

import (
"fmt"
"github.com/pdok/ogc-specifications/pkg/wms130"
"strconv"
"strings"

"github.com/pdok/ogc-specifications/pkg/wms130"

"github.com/cbroglie/mustache"
pdoknlv3 "github.com/pdok/mapserver-operator/api/v3"
"github.com/pdok/mapserver-operator/internal/controller/mapperutils"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package featureinfogenerator
import (
"encoding/json"
"fmt"

pdoknlv3 "github.com/pdok/mapserver-operator/api/v3"
"github.com/pdok/mapserver-operator/internal/controller/mapserver"
corev1 "k8s.io/api/core/v1"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package featureinfogenerator

import (
"testing"

pdoknlv3 "github.com/pdok/mapserver-operator/api/v3"
smoothoperatorutils "github.com/pdok/smooth-operator/pkg/util"
"testing"
)

const (
Expand Down
3 changes: 2 additions & 1 deletion internal/controller/legendgenerator/legend_generator_test.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
package legendgenerator

import (
"testing"

"github.com/pdok/mapserver-operator/api/v2beta1"
pdoknlv3 "github.com/pdok/mapserver-operator/api/v3"
"github.com/stretchr/testify/assert"
"sigs.k8s.io/yaml"
"testing"
)

func TestGetConfigMapDataNoLegendFix(t *testing.T) {
Expand Down
4 changes: 3 additions & 1 deletion internal/controller/legendgenerator/mapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@ package legendgenerator

import (
"fmt"

pdoknlv3 "github.com/pdok/mapserver-operator/api/v3"

_ "embed"
"sigs.k8s.io/yaml"
"strings"

"sigs.k8s.io/yaml"
)

// TODO Reuse default_mapserver.conf from static_files?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@ package mapfilegenerator

import (
"encoding/json"
"testing"

"github.com/pdok/mapserver-operator/api/v2beta1"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"sigs.k8s.io/yaml"
"testing"

pdoknlv3 "github.com/pdok/mapserver-operator/api/v3"
smoothoperatorv1 "github.com/pdok/smooth-operator/api/v1"
Expand Down
3 changes: 2 additions & 1 deletion internal/controller/mapfilegenerator/mapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ package mapfilegenerator

import (
"fmt"
"github.com/pdok/mapserver-operator/api/v2beta1"
"strconv"
"strings"

"github.com/pdok/mapserver-operator/api/v2beta1"

pdoknlv3 "github.com/pdok/mapserver-operator/api/v3"
"github.com/pdok/mapserver-operator/internal/controller/mapperutils"
smoothoperatorv1 "github.com/pdok/smooth-operator/api/v1"
Expand Down
4 changes: 2 additions & 2 deletions internal/controller/mapserver/deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (

pdoknlv3 "github.com/pdok/mapserver-operator/api/v3"
"github.com/pdok/mapserver-operator/internal/controller/mapperutils"
"github.com/pdok/mapserver-operator/internal/controller/static_files"
"github.com/pdok/mapserver-operator/internal/controller/static"
"github.com/pdok/mapserver-operator/internal/controller/types"
smoothoperatorutils "github.com/pdok/smooth-operator/pkg/util"
v1 "k8s.io/api/core/v1"
Expand Down Expand Up @@ -159,7 +159,7 @@ func GetVolumeMountsForDeployment[O pdoknlv3.WMSWFS](obj O, srvDir string) []v1.
},
}

staticFiles, _ := static_files.GetStaticFiles()
staticFiles, _ := static.GetStaticFiles()
for _, name := range staticFiles {
volumeMounts = append(volumeMounts, v1.VolumeMount{
Name: "mapserver",
Expand Down
5 changes: 3 additions & 2 deletions internal/controller/mapserver/deployment_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package mapserver

import (
"testing"

"github.com/pdok/mapserver-operator/api/v2beta1"
pdoknlv3 "github.com/pdok/mapserver-operator/api/v3"
"github.com/pdok/mapserver-operator/internal/controller/types"
Expand All @@ -9,7 +11,6 @@ import (
v1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/resource"
"sigs.k8s.io/yaml"
"testing"

_ "embed"
)
Expand Down Expand Up @@ -130,6 +131,6 @@ func getV3() *pdoknlv3.WFS {
panic(err)
}
var wfs pdoknlv3.WFS
v2wfs.ToV3(&wfs)
_ = v2wfs.ToV3(&wfs)
return &wfs
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package ogcwebserviceproxy

import (
"testing"

pdoknlv3 "github.com/pdok/mapserver-operator/api/v3"
controller "github.com/pdok/smooth-operator/pkg/util"
"testing"
)

const expectedConfig = `grouplayers:
Expand Down
11 changes: 6 additions & 5 deletions internal/controller/shared_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,24 @@ import (
"context"
"errors"
"fmt"
"strconv"
"strings"
"time"

"github.com/pdok/mapserver-operator/internal/controller/featureinfogenerator"
"github.com/pdok/mapserver-operator/internal/controller/legendgenerator"
"github.com/pdok/mapserver-operator/internal/controller/mapserver"
"github.com/pdok/mapserver-operator/internal/controller/ogcwebserviceproxy"
"github.com/pdok/mapserver-operator/internal/controller/types"
appsv1 "k8s.io/api/apps/v1"
"k8s.io/apimachinery/pkg/api/resource"
"strconv"
"strings"
"time"

pdoknlv3 "github.com/pdok/mapserver-operator/api/v3"
"github.com/pdok/mapserver-operator/internal/controller/blobdownload"
"github.com/pdok/mapserver-operator/internal/controller/capabilitiesgenerator"
"github.com/pdok/mapserver-operator/internal/controller/mapfilegenerator"
"github.com/pdok/mapserver-operator/internal/controller/mapperutils"
"github.com/pdok/mapserver-operator/internal/controller/static_files"
"github.com/pdok/mapserver-operator/internal/controller/static"
smoothoperatorv1 "github.com/pdok/smooth-operator/api/v1"
"github.com/pdok/smooth-operator/model"
smoothoperatork8s "github.com/pdok/smooth-operator/pkg/k8s"
Expand Down Expand Up @@ -886,7 +887,7 @@ func mutateConfigMap[R Reconciler, O pdoknlv3.WMSWFS](r R, obj O, configMap *cor
configMap.Immutable = smoothoperatorutils.Pointer(true)
configMap.Data = map[string]string{}

staticFileName, contents := static_files.GetStaticFiles()
staticFileName, contents := static.GetStaticFiles()
for _, name := range staticFileName {
content := contents[name]
if name == "include.conf" {
Expand Down
1 change: 1 addition & 0 deletions internal/controller/shared_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package controller
import (
"context"
"fmt"

pdoknlv3 "github.com/pdok/mapserver-operator/api/v3"
"github.com/pdok/mapserver-operator/internal/controller/mapserver"
appsv1 "k8s.io/api/apps/v1"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package static_files
package static

import (
"embed"
Expand Down
Loading
Loading