Skip to content

Commit

Permalink
Revert "Preparation for Otterize Cloud release (#61)"
Browse files Browse the repository at this point in the history
This reverts commit c36e14b.
  • Loading branch information
orishoshan committed Jan 15, 2023
1 parent c36e14b commit 475004b
Show file tree
Hide file tree
Showing 37 changed files with 200 additions and 1,273 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ on:
push:
branches:
- main
- develop

env:
REGISTRY: 353146681200.dkr.ecr.us-east-1.amazonaws.com/otterize
Expand All @@ -32,7 +31,6 @@ jobs:
uses: actions/checkout@v2
with:
submodules: recursive
token: ${{ secrets.OTTERIZEBOT_GITHUB_TOKEN }} # required for checking out submodules

- name: Set up Docker Buildx
id: buildx
Expand Down
47 changes: 0 additions & 47 deletions .github/workflows/golangci-lint.yml

This file was deleted.

3 changes: 0 additions & 3 deletions .gitmodules

This file was deleted.

1 change: 0 additions & 1 deletion src/cloudgraphql
Submodule cloudgraphql deleted from 4d044b
2 changes: 1 addition & 1 deletion src/go.mod

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 3 additions & 8 deletions src/mappergraphql/schema.graphql → src/graphql/schema.graphql
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
scalar Time # Equivalent of Go's time.Time provided by gqlgen


input CaptureResultForSrcIp {
srcIp: String!
destinations: [Destination!]!
}

input Destination {
destination: String!
lastSeen: Time!
destinations: [String!]!
}

input CaptureResults {
Expand All @@ -16,7 +11,7 @@ input CaptureResults {

input SocketScanResultForSrcIp {
srcIp: String!
destIps: [Destination!]!
destIps: [String!]!
}

input SocketScanResults {
Expand Down
2 changes: 1 addition & 1 deletion src/mapper.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM --platform=linux/amd64 golang:1.19-alpine as buildenv
FROM --platform=linux/amd64 golang:1.18-alpine as buildenv
RUN apk add --no-cache ca-certificates git protoc
RUN apk add build-base libpcap-dev
WORKDIR /src
Expand Down
15 changes: 0 additions & 15 deletions src/mapper/cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ import (
"github.com/labstack/echo/v4"
"github.com/labstack/echo/v4/middleware"
"github.com/otterize/intents-operator/src/shared/serviceidresolver"
"github.com/otterize/network-mapper/src/mapper/pkg/cloudclient"
"github.com/otterize/network-mapper/src/mapper/pkg/clouduploader"
"github.com/otterize/network-mapper/src/mapper/pkg/config"
"github.com/otterize/network-mapper/src/mapper/pkg/kubefinder"
"github.com/otterize/network-mapper/src/mapper/pkg/resolvers"
Expand All @@ -15,11 +13,9 @@ import (
"github.com/spf13/viper"
"net/http"
"os"
"os/signal"
clientconfig "sigs.k8s.io/controller-runtime/pkg/client/config"
"sigs.k8s.io/controller-runtime/pkg/manager"
"sigs.k8s.io/controller-runtime/pkg/manager/signals"
"syscall"
"time"
)

Expand Down Expand Up @@ -83,22 +79,11 @@ func main() {
logrus.Error(intentHolderCfg)
os.Exit(1)
}

cloudConfig := clouduploader.ConfigFromViper()
intentsHolder := resolvers.NewIntentsHolder(mgr.GetClient(), intentHolderCfg)
cloudClient := clouduploader.NewCloudUploader(intentsHolder, cloudConfig, cloudclient.NewClient)
resolver := resolvers.NewResolver(kubeFinder, serviceidresolver.NewResolver(mgr.GetClient()), intentsHolder)
_ = resolver.LoadStore(initCtx) // loads the store from the previous run
resolver.Register(e)

if cloudConfig.IsCloudUploadEnabled() {
go func() {
cloudClientCtx, cloudClientCancel := signal.NotifyContext(context.Background(), os.Interrupt, syscall.SIGTERM)
defer cloudClientCancel()
cloudClient.PeriodicIntentsUpload(cloudClientCtx)
}()
}

logrus.Info("Starting api server")
err = e.Start("0.0.0.0:9090")
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion src/mapper/gqlgen.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Where are all the schema files located? globs are supported eg src/**/*.graphqls
schema:
- '../mappergraphql/*.graphql'
- '../graphql/*'

# Where should the generated server code go?
exec:
Expand Down
52 changes: 0 additions & 52 deletions src/mapper/pkg/cloudclient/cloud_client.go

This file was deleted.

4 changes: 0 additions & 4 deletions src/mapper/pkg/cloudclient/generate.go

This file was deleted.

Loading

0 comments on commit 475004b

Please sign in to comment.