mirror of
https://github.com/zalando/postgres-operator.git
synced 2026-10-07 00:51:45 +02:00
Merge branch 'experiment/crd_configuration' of github.com:zalando-incubator/postgres-operator into experiment/crd_configuration
This commit is contained in:
@@ -169,7 +169,7 @@ func (c *Controller) initController() {
|
||||
if err := c.createOperatorCRD(); err != nil {
|
||||
c.logger.Fatalf("could not register Operator Configuration CustomResourceDefinition: %v", err)
|
||||
}
|
||||
if cfg, err := c.readOperatorConfigurationFromCRD(configObjectName); err != nil {
|
||||
if cfg, err := c.readOperatorConfigurationFromCRD(spec.GetOperatorNamespace(), configObjectName); err != nil {
|
||||
c.logger.Fatalf("unable to read operator configuration: %v", err)
|
||||
} else {
|
||||
c.opConfig = c.importConfigurationFromCRD(&cfg.Configuration)
|
||||
|
||||
@@ -9,14 +9,14 @@ import (
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
)
|
||||
|
||||
func (c *Controller) readOperatorConfigurationFromCRD(configObjectName string) (*config.OperatorConfiguration, error) {
|
||||
func (c *Controller) readOperatorConfigurationFromCRD(configObjectNamespace, configObjectName string) (*config.OperatorConfiguration, error) {
|
||||
var (
|
||||
config config.OperatorConfiguration
|
||||
)
|
||||
|
||||
req := c.KubeClient.CRDREST.Get().
|
||||
Name(configObjectName).
|
||||
Namespace(c.opConfig.WatchedNamespace).
|
||||
Namespace(configObjectNamespace).
|
||||
Resource(constants.OperatorConfigCRDResource).
|
||||
VersionedParams(&metav1.ListOptions{ResourceVersion: "0"}, metav1.ParameterCodec)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user