Skip to content

Commit

Permalink
Linting
Browse files Browse the repository at this point in the history
  • Loading branch information
damienmulder committed Feb 19, 2025
1 parent f78d9de commit eaf3787
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 9 deletions.
3 changes: 1 addition & 2 deletions api/v3/atom_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,7 @@ type Service struct {
Subtitle string `json:"subtitle,omitempty"`
OwnerInfoRef string `json:"ownerInfoRef"`
ServiceMetadataLinks MetadataLink `json:"serviceMetadataLinks,omitempty"`
//Links []Link `json:"links,omitempty"` // Todo kan weg?
Rights string `json:"rights,omitempty"`
Rights string `json:"rights,omitempty"`
}

// Link represents a link in the service or dataset feed
Expand Down
28 changes: 23 additions & 5 deletions internal/controller/atom_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ package controller

import (
"context"

metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/types"
"k8s.io/apimachinery/pkg/util/intstr"
Expand Down Expand Up @@ -112,7 +113,10 @@ func (r *AtomReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.
ll.Error(err, "failed to get object")
return ctrl.Result{}, err
}
r.Create(ctx, deployment)
if err := r.Create(ctx, deployment); err != nil {
ll.Error(err, "failed to create Deployment")
return ctrl.Result{}, err
}
}
err := r.Update(ctx, deployment)
if err != nil {
Expand Down Expand Up @@ -144,9 +148,16 @@ func (r *AtomReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.
ll.Error(err, "failed to get object")
return ctrl.Result{}, err
}
r.Create(ctx, service)
if err := r.Create(ctx, service); err != nil {
ll.Error(err, "failed to create Service")
return ctrl.Result{}, err
}
}

if err := r.Update(ctx, service); err != nil {
ll.Error(err, "failed to update Service")
return ctrl.Result{}, err
}
r.Update(ctx, service)

// Define the IngressRoute for Traefik
ingressRoute := &traefikiov1alpha1.IngressRoute{
Expand Down Expand Up @@ -186,9 +197,16 @@ func (r *AtomReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.
ll.Error(err, "failed to get object: %v")
return ctrl.Result{}, err
}
r.Create(ctx, ingressRoute)

if err := r.Create(ctx, ingressRoute); err != nil {
ll.Error(err, "failed to create IngressRoute")
return ctrl.Result{}, err
}
}
if err := r.Update(ctx, ingressRoute); err != nil {
ll.Error(err, "failed to update IngressRoute")
return ctrl.Result{}, err
}
r.Update(ctx, ingressRoute)

return ctrl.Result{}, nil
}
Expand Down
5 changes: 3 additions & 2 deletions internal/controller/atom_generator/mapping.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package atom_generator

import (
pdoknlv3 "github.com/pdok/atom-operator/api/v3"
"time"

pdoknlv3 "github.com/pdok/atom-operator/api/v3"
)

func MapAtomV3ToAtomGeneratorConfig(atom pdoknlv3.Atom) (atomGeneratorConfig AtomGeneratorConfig, err error) {
Expand Down Expand Up @@ -121,5 +122,5 @@ func MapAtomV3ToAtomGeneratorConfig(atom pdoknlv3.Atom) (atomGeneratorConfig Ato
},
}

return
return atomGeneratorConfig, err
}

0 comments on commit eaf3787

Please sign in to comment.