Minor corrections

  • Corrected Quota of Compute and WebUI components.
  • Added endpoint position in Link, Service and Slice models of Context component.
  • Corrected Policy retrieval from Context
Edited by Lluis Gifre Renom

Merge request reports

Loading
+7 −4
Changes for manifests/computeservice.yaml: 7 added lines, 4 removed lines.
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@ spec:
  selector:
    matchLabels:
      app: computeservice
  replicas: 1
  template:
    metadata:
      labels:
@@ -44,16 +45,18 @@ spec:
            command: ["/bin/grpc_health_probe", "-addr=:9090"]
        resources:
          requests:
            cpu: 250m
            memory: 512Mi
            cpu: 50m
            memory: 64Mi
          limits:
            cpu: 700m
            memory: 1024Mi
            cpu: 500m
            memory: 512Mi
---
apiVersion: v1
kind: Service
metadata:
  name: computeservice
  labels:
    app: computeservice
spec:
  type: ClusterIP
  selector:
+10 −7
Changes for manifests/webuiservice.yaml: 10 added lines, 7 removed lines.
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@ spec:
  selector:
    matchLabels:
      app: webuiservice
  replicas: 1
  template:
    metadata:
      labels:
@@ -55,11 +56,11 @@ spec:
          timeoutSeconds: 1
        resources:
          requests:
            cpu: 100m
            memory: 512Mi
            cpu: 50m
            memory: 64Mi
          limits:
            cpu: 700m
            memory: 1024Mi
            cpu: 500m
            memory: 512Mi
      - name: grafana
        image: grafana/grafana:8.5.11
        imagePullPolicy: IfNotPresent
@@ -92,16 +93,18 @@ spec:
          timeoutSeconds: 1
        resources:
          requests:
            cpu: 250m
            memory: 750Mi
            cpu: 150m
            memory: 512Mi
          limits:
            cpu: 700m
            cpu: 500m
            memory: 1024Mi
---
apiVersion: v1
kind: Service
metadata:
  name: webuiservice
  labels:
    app: webuiservice
spec:
  type: ClusterIP
  selector:
+8 −2
Changes for src/context/service/database/models/LinkModel.py: 8 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -12,7 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from sqlalchemy import Column, DateTime, ForeignKey, String
import operator
from sqlalchemy import CheckConstraint, Column, DateTime, ForeignKey, Integer, String
from sqlalchemy.dialects.postgresql import UUID
from sqlalchemy.orm import relationship
from typing import Dict
@@ -38,7 +39,7 @@ class LinkModel(_Base):
            'name'             : self.link_name,
            'link_endpoint_ids': [
                link_endpoint.endpoint.dump_id()
                for link_endpoint in self.link_endpoints
                for link_endpoint in sorted(self.link_endpoints, key=operator.attrgetter('position'))
            ],
        }

@@ -47,6 +48,11 @@ class LinkEndPointModel(_Base):

    link_uuid     = Column(ForeignKey('link.link_uuid',         ondelete='CASCADE' ), primary_key=True)
    endpoint_uuid = Column(ForeignKey('endpoint.endpoint_uuid', ondelete='RESTRICT'), primary_key=True, index=True)
    position      = Column(Integer, nullable=False)

    link     = relationship('LinkModel',     back_populates='link_endpoints', lazy='joined')
    endpoint = relationship('EndPointModel', lazy='joined') # back_populates='link_endpoints'

    __table_args__ = (
        CheckConstraint(position >= 0, name='check_position_value'),
    )
+1 −1
Changes for src/context/service/database/models/PolicyRuleModel.py: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -64,7 +64,7 @@ class PolicyRuleModel(_Base):
            'deviceList': [{'device_uuid': {'uuid': pr_d.device_uuid}} for pr_d in self.policyrule_devices],
        }
        if self.policyrule_kind == PolicyRuleKindEnum.SERVICE:
            result['serviceId'] = self.policyrule_service.dump_id(),
            result['serviceId'] = self.policyrule_service.dump_id()
        return {self.policyrule_kind.value: result}

class PolicyRuleDeviceModel(_Base):
+7 −2
Changes for src/context/service/database/models/ServiceModel.py: 7 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -13,7 +13,7 @@
# limitations under the License.

import operator
from sqlalchemy import Column, DateTime, Enum, ForeignKey, String
from sqlalchemy import CheckConstraint, Column, DateTime, Enum, ForeignKey, Integer, String
from sqlalchemy.dialects.postgresql import UUID
from sqlalchemy.orm import relationship
from typing import Dict
@@ -51,7 +51,7 @@ class ServiceModel(_Base):
            'service_status'      : {'service_status': self.service_status.value},
            'service_endpoint_ids': [
                service_endpoint.endpoint.dump_id()
                for service_endpoint in self.service_endpoints
                for service_endpoint in sorted(self.service_endpoints, key=operator.attrgetter('position'))
            ],
            'service_constraints' : [
                constraint.dump()
@@ -68,6 +68,11 @@ class ServiceEndPointModel(_Base):

    service_uuid  = Column(ForeignKey('service.service_uuid',   ondelete='CASCADE' ), primary_key=True)
    endpoint_uuid = Column(ForeignKey('endpoint.endpoint_uuid', ondelete='RESTRICT'), primary_key=True, index=True)
    position      = Column(Integer, nullable=False)

    service  = relationship('ServiceModel',  back_populates='service_endpoints', lazy='joined')
    endpoint = relationship('EndPointModel', lazy='joined') # back_populates='service_endpoints'

    __table_args__ = (
        CheckConstraint(position >= 0, name='check_position_value'),
    )
Loading
Loading