Commit 7cafea4e authored by Lluis Gifre Renom's avatar Lluis Gifre Renom
Browse files

Pre-merge code cleanup

parent 6c702c96
Loading
Loading
Loading
Loading
+7 −9
Original line number Diff line number Diff line
@@ -25,17 +25,15 @@ metadata:
  name: policyservice
spec:
  ports:
    - name: http
      port: 8080
    - name: metrics
      port: 9192
      targetPort: 8080
      nodePort: 31180
    - name: grpc
      port: 6060
      targetPort: 6060
      nodePort: 30060
  selector:
    app.kubernetes.io/name: policyservice
  type: NodePort
  type: ClusterIP
---
apiVersion: apps/v1
kind: Deployment
@@ -87,11 +85,11 @@ spec:
            timeoutSeconds: 10
          name: policyservice
          ports:
            - containerPort: 6060
              name: grpc
              protocol: TCP
            - containerPort: 8080
              name: http
              name: metrics
              protocol: TCP
            - containerPort: 6060
              name: grpc-server
              protocol: TCP
          readinessProbe:
            failureThreshold: 3
+4 −4
Original line number Diff line number Diff line
@@ -23,10 +23,10 @@ export TFS_REGISTRY_IMAGES="http://localhost:32000/tfs/"
export TFS_COMPONENTS="context device pathcomp service slice compute webui load_generator"

# Uncoment to activate Monitoring
export TFS_COMPONENTS="${TFS_COMPONENTS} monitoring"
#export TFS_COMPONENTS="${TFS_COMPONENTS} monitoring"

# Uncoment to activate Automation and Policy Manager
export TFS_COMPONENTS="${TFS_COMPONENTS} automation policy"
#export TFS_COMPONENTS="${TFS_COMPONENTS} automation policy"

# Uncoment to activate Optical CyberSecurity
#export TFS_COMPONENTS="${TFS_COMPONENTS} dbscanserving opticalattackmitigator opticalattackdetector opticalattackmanager"
@@ -78,10 +78,10 @@ export CRDB_DATABASE="tfs"
export CRDB_DEPLOY_MODE="single"

# Disable flag for dropping database, if it exists.
export CRDB_DROP_DATABASE_IF_EXISTS="YES"
export CRDB_DROP_DATABASE_IF_EXISTS=""

# Disable flag for re-deploying CockroachDB from scratch.
export CRDB_REDEPLOY="YES"
export CRDB_REDEPLOY=""


# ----- NATS -------------------------------------------------------------------
+16 −0
Original line number Diff line number Diff line
/*
* Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*      http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package eu.teraflow.policy.common;

import java.util.List;
+4 −16
Original line number Diff line number Diff line
@@ -28,13 +28,10 @@ import io.quarkus.grpc.GrpcClient;
import io.smallrye.mutiny.Uni;
import javax.enterprise.context.ApplicationScoped;
import javax.inject.Inject;
import org.jboss.logging.Logger;

@ApplicationScoped
public class ContextGatewayImpl implements ContextGateway {

    private static final Logger LOGGER = Logger.getLogger(ContextGatewayImpl.class);

    @GrpcClient("context")
    MutinyContextServiceStub streamingDelegateContext;

@@ -55,8 +52,6 @@ public class ContextGatewayImpl implements ContextGateway {

        final var serializedServiceId = serializer.serialize(serviceId);

        LOGGER.infof("getService = %s", serializedServiceId);

        return streamingDelegateContext
                .getService(serializedServiceId)
                .onItem()
@@ -98,17 +93,10 @@ public class ContextGatewayImpl implements ContextGateway {
        // return Uni.createFrom().item("571eabc1-0f59-48da-b608-c45876c3fa8a");
        final var serializedPolicyRuleBasic = serializer.serialize(policyRule);

        var ret =
                streamingDelegateContextPolicy
        return streamingDelegateContextPolicy
                .setPolicyRule(serializedPolicyRuleBasic)
                .onItem()
                .transform(serializer::deserialize);
        ret.subscribe()
                .with(
                        x -> {
                            LOGGER.infof(x);
                        });
        return ret;
    }

    @Override
+2 −1
Original line number Diff line number Diff line
@@ -23,5 +23,6 @@ public enum DeviceDriverEnum {
    P4,
    IETF_NETWORK_TOPOLOGY,
    ONF_TR_352,
    XR
    XR,
    IETF_L2VPN
}
Loading