supabase-operator/internal/controller/object_meta.go
Peter Kurfer 647f602c79
Some checks failed
Lint / Run on Ubuntu (push) Failing after 2m58s
E2E Tests / Run on Ubuntu (push) Failing after 4m18s
Tests / Run on Ubuntu (push) Failing after 2m39s
feat: basic functionality implemented
- added Core CRD to manage DB migrations & configuration, PostgREST and
  GoTrue (auth)
- added APIGateway CRD to manage Envoy proxy
- added Dashboard CRD to manage (so far) pg-meta and (soon) studio
  deployments
- implemented basic Envoy control plane based on K8s watcher
2025-01-04 17:07:49 +01:00

41 lines
917 B
Go

package controller
import (
"maps"
"sigs.k8s.io/controller-runtime/pkg/client"
"code.icb4dc0.de/prskr/supabase-operator/internal/meta"
)
func selectorLabels(
object client.Object,
name string,
) map[string]string {
return map[string]string{
meta.WellKnownLabel.Name: name,
meta.WellKnownLabel.Instance: object.GetName(),
meta.WellKnownLabel.PartOf: "supabase",
}
}
func objectLabels(
object client.Object,
name,
component,
version string,
) map[string]string {
labels := maps.Clone(object.GetLabels())
if labels == nil {
labels = make(map[string]string, 6)
}
labels[meta.WellKnownLabel.Name] = name
labels[meta.WellKnownLabel.Instance] = object.GetName()
labels[meta.WellKnownLabel.Version] = version
labels[meta.WellKnownLabel.Component] = component
labels[meta.WellKnownLabel.PartOf] = "supabase"
labels[meta.WellKnownLabel.ManagedBy] = "supabase-operator"
return labels
}