Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat crd autodiscovery #57

Merged
merged 32 commits into from
May 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
385af02
feat: crds creates both actions and blueprints
danielsinai Apr 4, 2024
7a0b983
chore: fixing modules and hiearchy of the code
danielsinai Apr 7, 2024
2ea81e3
chore: support CRD instead of both CRD and XRD
danielsinai Apr 7, 2024
02bc0ad
fix: schema improvements
danielsinai Apr 8, 2024
892517a
fix: added support for namespaced scoped and fixed multiple bugs
danielsinai Apr 9, 2024
ee860c2
fix: remove debug file
danielsinai Apr 9, 2024
d6922bd
chore: added debug file to gitignore
danielsinai Apr 9, 2024
e55b623
config: change the configuration naming
danielsinai Apr 9, 2024
0b5dd31
chore: fixed conflicts
danielsinai Apr 21, 2024
fa88bd0
chore: downgrade back to go 1.21
danielsinai Apr 21, 2024
229f83f
fix: go mod
danielsinai Apr 21, 2024
01f239f
chore: upgrade ci to go 1.22
danielsinai Apr 21, 2024
60fd54c
fix: update go toolchain
danielsinai Apr 21, 2024
ba1f2e0
chore: removed updating the list length
danielsinai May 5, 2024
19fa093
chore: make functions in private besides autodiscoverCRDsToAction
danielsinai May 5, 2024
fa3f867
chore: extract to more functions
danielsinai May 5, 2024
0ca5b75
tests: added tests for the CRD logic
danielsinai May 5, 2024
70e6e4a
conflicts: with main
danielsinai May 5, 2024
dcea7a4
tests: improved
danielsinai May 5, 2024
f899c0c
tests: added deletion of resources to defaults first test
danielsinai May 5, 2024
84079b3
tests: checking resources exsists
danielsinai May 5, 2024
e8cf5e7
fix: added the kind config to the resources
danielsinai May 5, 2024
ec21c44
fix: added the kind config to the resources at the start of the loop
danielsinai May 5, 2024
1f85b6a
fix: links to docs
danielsinai May 5, 2024
0526ec6
fix: links to docs
danielsinai May 5, 2024
eeab15c
fix: grammer
danielsinai May 6, 2024
331d8ca
fix: docs link
danielsinai May 6, 2024
a8d4f0d
conflicts: fix
danielsinai May 8, 2024
47ecc9a
tests: unite the CheckResources function to a single one
danielsinai May 8, 2024
03129cb
tests: add a test to check the jq pattern with a false
danielsinai May 8, 2024
49f7b7f
tests: reverted one tests
danielsinai May 8, 2024
c5a8d3f
tests: fix CI to use staging
danielsinai May 9, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.19
go-version: 1.22
cache: true

- name: Build
Expand All @@ -27,4 +27,4 @@ jobs:
env:
PORT_CLIENT_ID: ${{ secrets.PORT_CLIENT_ID }}
PORT_CLIENT_SECRET: ${{ secrets.PORT_CLIENT_SECRET }}

PORT_BASE_URL: https://api.stg-01.getport.io
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,9 @@ config.yaml

deployments/k8s

.env
.env

.vscode

# debug file
__debug_bin*
49 changes: 26 additions & 23 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,60 +1,63 @@
module github.com/port-labs/port-k8s-exporter

go 1.21
go 1.22.0

toolchain go1.22.2

require (
github.com/confluentinc/confluent-kafka-go/v2 v2.2.0
github.com/go-resty/resty/v2 v2.7.0
github.com/google/uuid v1.3.0
github.com/itchyny/gojq v0.12.9
github.com/joho/godotenv v1.5.1
github.com/stretchr/testify v1.8.2
github.com/stretchr/testify v1.8.4
golang.org/x/exp v0.0.0-20230224173230-c95f2b4c22f2
gopkg.in/yaml.v2 v2.4.0
gopkg.in/yaml.v3 v3.0.1
k8s.io/api v0.25.2
k8s.io/apimachinery v0.25.2
k8s.io/client-go v0.25.2
k8s.io/klog/v2 v2.80.1
k8s.io/utils v0.0.0-20220728103510-ee6ede2d64ed
k8s.io/api v0.30.0
k8s.io/apiextensions-apiserver v0.30.0
k8s.io/apimachinery v0.30.0
k8s.io/client-go v0.30.0
k8s.io/klog/v2 v2.120.1
k8s.io/utils v0.0.0-20230726121419-3b25d923346b
)

require (
github.com/PuerkitoBio/purell v1.1.1 // indirect
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/emicklei/go-restful/v3 v3.8.0 // indirect
github.com/emicklei/go-restful/v3 v3.11.0 // indirect
github.com/evanphx/json-patch v4.12.0+incompatible // indirect
github.com/go-logr/logr v1.2.3 // indirect
github.com/go-openapi/jsonpointer v0.19.5 // indirect
github.com/go-openapi/jsonreference v0.19.5 // indirect
github.com/go-openapi/swag v0.19.14 // indirect
github.com/go-logr/logr v1.4.1 // indirect
github.com/go-openapi/jsonpointer v0.19.6 // indirect
github.com/go-openapi/jsonreference v0.20.2 // indirect
github.com/go-openapi/swag v0.22.3 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/google/gnostic v0.5.7-v3refs // indirect
github.com/google/go-cmp v0.5.9 // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/google/gnostic-models v0.6.8 // indirect
github.com/google/go-cmp v0.6.0 // indirect
github.com/google/gofuzz v1.2.0 // indirect
github.com/imdario/mergo v0.3.12 // indirect
github.com/itchyny/timefmt-go v0.1.4 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/mailru/easyjson v0.7.6 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/sirupsen/logrus v1.9.3 // indirect
github.com/spf13/pflag v1.0.5 // indirect
golang.org/x/net v0.23.0 // indirect
golang.org/x/oauth2 v0.6.0 // indirect
golang.org/x/oauth2 v0.10.0 // indirect
golang.org/x/sys v0.18.0 // indirect
golang.org/x/term v0.18.0 // indirect
golang.org/x/text v0.14.0 // indirect
golang.org/x/time v0.3.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/protobuf v1.33.0 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
k8s.io/kube-openapi v0.0.0-20220803162953-67bda5d908f1 // indirect
sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2 // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect
sigs.k8s.io/yaml v1.2.0 // indirect
k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 // indirect
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect
sigs.k8s.io/yaml v1.3.0 // indirect
)
109 changes: 66 additions & 43 deletions go.sum

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package main
import (
"errors"
"fmt"

"github.com/port-labs/port-k8s-exporter/pkg/config"
"github.com/port-labs/port-k8s-exporter/pkg/defaults"
"github.com/port-labs/port-k8s-exporter/pkg/event_handler"
Expand Down
5 changes: 3 additions & 2 deletions pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@ package config
import (
"flag"
"fmt"
"os"
"strings"

"github.com/joho/godotenv"
"github.com/port-labs/port-k8s-exporter/pkg/port"
"gopkg.in/yaml.v2"
"k8s.io/klog/v2"
"os"
"strings"
)

var KafkaConfig = &KafkaConfiguration{}
Expand Down
3 changes: 2 additions & 1 deletion pkg/config/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ package config

import (
"flag"
"strings"

"github.com/port-labs/port-k8s-exporter/pkg/goutils"
"k8s.io/utils/strings/slices"
"strings"
)

var keys []string
Expand Down
Loading