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
4 changes: 2 additions & 2 deletions api/v1/postgres_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ func (p *Postgres) ToCWNP(port int) (*firewall.ClusterwideNetworkPolicy, error)

policy := &firewall.ClusterwideNetworkPolicy{}
// todo: Use the exported const.
policy.Namespace = "firewall"
policy.Namespace = firewall.ClusterwideNetworkPolicyNamespace
policy.Name = p.ToPeripheralResourceName()
policy.Spec.Ingress = []firewall.IngressRule{
{Ports: ports, From: ipblocks},
Expand Down Expand Up @@ -212,7 +212,7 @@ func (p *Postgres) ToZalandoPostgres() *ZalandoPostgres {
TypeMeta: ZalandoPostgresTypeMeta,
ObjectMeta: metav1.ObjectMeta{
Name: p.ToPeripheralResourceName(),
Namespace: projectID, // todo: Check if the projectID is too long for zalando operator.
Namespace: projectID, // todo: Check if the projectID is too long for zalando operator.
Labels: map[string]string{LabelName: string(p.UID)},
},
Spec: ZalandoPostgresSpec{
Expand Down
2 changes: 1 addition & 1 deletion controllers/postgres_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ func (r *PostgresReconciler) createOrUpdateCWNP(ctx context.Context, in *pg.Post

func (r *PostgresReconciler) deleteCWNP(ctx context.Context, in *pg.Postgres) error {
policy := &firewall.ClusterwideNetworkPolicy{}
policy.Namespace = "firewall"
policy.Namespace = firewall.ClusterwideNetworkPolicyNamespace
policy.Name = in.ToPeripheralResourceName()
if err := r.Service.Delete(ctx, policy); err != nil {
return fmt.Errorf("unable to delete CRD ClusterwideNetworkPolicy %v: %w", policy.Name, err)
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ go 1.15

require (
github.com/go-logr/logr v0.3.0
github.com/metal-stack/firewall-controller v1.0.1
github.com/metal-stack/firewall-controller v1.0.2-0.20210209073729-714a5bf22625
github.com/metal-stack/v v1.0.2
github.com/onsi/ginkgo v1.14.2
github.com/onsi/gomega v1.10.5
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -505,6 +505,8 @@ github.com/mdlayher/netlink v1.1.0/go.mod h1:H4WCitaheIsdF9yOYu8CFmCgQthAPIWZmcK
github.com/mdlayher/netlink v1.1.1/go.mod h1:WTYpFb/WTvlRJAyKhZL5/uy69TDDpHHu2VZmb2XgV7o=
github.com/metal-stack/firewall-controller v1.0.1 h1:FRUYs5USa2CklxP0KYwpJ696b7VCDCC7zy8kW4EXtuU=
github.com/metal-stack/firewall-controller v1.0.1/go.mod h1:RAAxEvW8AWyi4K9xNK5T4EqDSOJXssUrMGVDdeXEAuM=
github.com/metal-stack/firewall-controller v1.0.2-0.20210209073729-714a5bf22625 h1:5cN7Uvd0YQhviC3lgirlbqSVz4ir4rUdZb01dX2IHio=
github.com/metal-stack/firewall-controller v1.0.2-0.20210209073729-714a5bf22625/go.mod h1:RAAxEvW8AWyi4K9xNK5T4EqDSOJXssUrMGVDdeXEAuM=
github.com/metal-stack/metal-lib v0.6.6 h1:5ajMDUGHruYOmRqn3r373rbIKbTtQkfVfKLKmRatJnE=
github.com/metal-stack/metal-lib v0.6.6/go.mod h1:r8qhfX72eAzClR/pEaQvdwM//Otx9gegYoOphLPmmQ4=
github.com/metal-stack/security v0.4.0/go.mod h1:C7kSrHwRcG+47375RJjhakN1LenbEJF9uQd4I50nZlY=
Expand Down