ClusterTeamName -> ClusterName. Add a TODO item.
This commit is contained in:
parent
814f75f7c1
commit
31d7426327
|
|
@ -88,7 +88,8 @@ func (c *Cluster) ClusterName() spec.ClusterName {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *Cluster) ClusterTeamName() string {
|
func (c *Cluster) TeamName() string {
|
||||||
|
// TODO: check Teams API for the actual name (in case the user passes an integer Id).
|
||||||
return c.Spec.TeamId
|
return c.Spec.TeamId
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -203,7 +204,7 @@ func (c *Cluster) Update(newSpec *spec.Postgresql) error {
|
||||||
|
|
||||||
newStatefulSet := getStatefulSet(c.ClusterName(), newSpec.Spec, c.etcdHost, c.dockerImage)
|
newStatefulSet := getStatefulSet(c.ClusterName(), newSpec.Spec, c.etcdHost, c.dockerImage)
|
||||||
|
|
||||||
newService := resources.Service(c.ClusterName(), c.ClusterTeamName(), newSpec.Spec.AllowedSourceRanges)
|
newService := resources.Service(c.ClusterName(), c.TeamName(), newSpec.Spec.AllowedSourceRanges)
|
||||||
if !servicesEqual(newService, c.Service) {
|
if !servicesEqual(newService, c.Service) {
|
||||||
c.logger.Infof("Service needs to be upated")
|
c.logger.Infof("Service needs to be upated")
|
||||||
if err := c.updateService(newService); err != nil {
|
if err := c.updateService(newService); err != nil {
|
||||||
|
|
|
||||||
|
|
@ -148,7 +148,7 @@ func (c *Cluster) createService() (*v1.Service, error) {
|
||||||
if c.Service != nil {
|
if c.Service != nil {
|
||||||
return nil, fmt.Errorf("Service already exists in the cluster")
|
return nil, fmt.Errorf("Service already exists in the cluster")
|
||||||
}
|
}
|
||||||
serviceSpec := resources.Service(c.ClusterName(), c.ClusterTeamName(), c.Spec.AllowedSourceRanges)
|
serviceSpec := resources.Service(c.ClusterName(), c.TeamName(), c.Spec.AllowedSourceRanges)
|
||||||
|
|
||||||
service, err := c.config.KubeClient.Services(serviceSpec.Namespace).Create(serviceSpec)
|
service, err := c.config.KubeClient.Services(serviceSpec.Namespace).Create(serviceSpec)
|
||||||
if k8sutil.ResourceAlreadyExists(err) {
|
if k8sutil.ResourceAlreadyExists(err) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue