diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 3bfcaa80..b9777f07 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -20,7 +20,13 @@ jobs: build: name: Build & Test runs-on: ubuntu-latest + outputs: + registry: ${{ steps.registry.outputs.registry }} # workaround since env is not available outside of steps, i.e. in calling external workflows like we later do in e2e-test + steps: + - id: registry + run: echo "registry=${{ env.REGISTRY }}" >> "$GITHUB_OUTPUT" + - name: Check out the code uses: actions/checkout@v2 with: @@ -59,6 +65,15 @@ jobs: build-args: | "VERSION=0.0.${{ github.run_id }}" + helm-e2e-test: + uses: otterize/helm-charts/.github/workflows/e2e-test.yaml@main + name: Trigger e2e tests from helm charts repo + secrets: inherit + with: + gcr-registry: ${{ needs.build.outputs.registry }} + credentials-operator-tag: ${{ github.sha }} + needs: + - build tag-latest: name: Tag latest diff --git a/src/operator/controllers/poduserpassword/db_credentials_pod_reconciler.go b/src/operator/controllers/poduserpassword/db_credentials_pod_reconciler.go index a2dd66e5..8c626567 100644 --- a/src/operator/controllers/poduserpassword/db_credentials_pod_reconciler.go +++ b/src/operator/controllers/poduserpassword/db_credentials_pod_reconciler.go @@ -341,17 +341,86 @@ func (e *Reconciler) runAlterPasswordForSecrets(ctx context.Context, secrets []v return nil } +func (e *Reconciler) extractDBCredentials(ctx context.Context, namespace string, credentialsSpec otterizev1alpha3.DatabaseCredentials) (databaseconfigurator.DatabaseCredentials, error) { + creds := databaseconfigurator.DatabaseCredentials{} + if credentialsSpec.Username != "" { + creds.Username = credentialsSpec.Username + } + if credentialsSpec.Password != "" { + creds.Password = credentialsSpec.Password + } + if credentialsSpec.SecretRef != nil { + secret := v1.Secret{} + name := credentialsSpec.SecretRef.Name + if credentialsSpec.SecretRef.Namespace != "" { + namespace = credentialsSpec.SecretRef.Namespace + } + err := e.client.Get(ctx, client.ObjectKey{Name: name, Namespace: namespace}, &secret) + if err != nil { + return creds, errors.Wrap(err) + } + if username, ok := secret.Data[credentialsSpec.SecretRef.UsernameKey]; ok { + creds.Username = string(username) + } + if password, ok := secret.Data[credentialsSpec.SecretRef.PasswordKey]; ok { + creds.Password = string(password) + } + } + + if creds.Username == "" || creds.Password == "" { + return creds, errors.New("credentials missing either username or password") + } + + return creds, nil +} + +func (e *Reconciler) createPostgresDBConfigurator(ctx context.Context, pgServerConfig otterizev1alpha3.PostgreSQLServerConfig) (databaseconfigurator.DatabaseConfigurator, error) { + credentials, err := e.extractDBCredentials(ctx, pgServerConfig.Namespace, pgServerConfig.Spec.Credentials) + if err != nil { + return nil, errors.Wrap(err) + } + + dbInfo := postgres.PostgresDatabaseInfo{ + Credentials: credentials, + Address: pgServerConfig.Spec.Address, + } + + dbconfigurator, err := postgres.NewPostgresConfigurator(ctx, dbInfo) + if err != nil { + return nil, errors.Wrap(err) + } + return dbconfigurator, nil +} + +func (e *Reconciler) createMySQLDBConfigurator(ctx context.Context, mySQLServerConfig otterizev1alpha3.MySQLServerConfig) (databaseconfigurator.DatabaseConfigurator, error) { + credentials, err := e.extractDBCredentials(ctx, mySQLServerConfig.Namespace, mySQLServerConfig.Spec.Credentials) + if err != nil { + return nil, errors.Wrap(err) + } + + dbInfo := mysql.MySQLDatabaseInfo{ + Credentials: credentials, + Address: mySQLServerConfig.Spec.Address, + } + + dbconfigurator, err := mysql.NewMySQLConfigurator(ctx, dbInfo) + if err != nil { + return nil, errors.Wrap(err) + } + return dbconfigurator, nil +} + func (e *Reconciler) createDBConfigurator( ctx context.Context, database string, mysqlServerConfigs []otterizev1alpha3.MySQLServerConfig, pgServerConfigs []otterizev1alpha3.PostgreSQLServerConfig) (databaseconfigurator.DatabaseConfigurator, bool, error) { - mysqlConf, found := lo.Find(mysqlServerConfigs, func(config otterizev1alpha3.MySQLServerConfig) bool { + mysqlServerConf, found := lo.Find(mysqlServerConfigs, func(config otterizev1alpha3.MySQLServerConfig) bool { return config.Name == database }) if found { - dbconfigurator, err := mysql.NewMySQLConfigurator(ctx, mysqlConf.Spec) + dbconfigurator, err := e.createMySQLDBConfigurator(ctx, mysqlServerConf) if err != nil { return nil, false, errors.Wrap(err) } @@ -362,7 +431,7 @@ func (e *Reconciler) createDBConfigurator( return config.Name == database }) if found { - dbconfigurator, err := postgres.NewPostgresConfigurator(ctx, pgServerConf.Spec) + dbconfigurator, err := e.createPostgresDBConfigurator(ctx, pgServerConf) if err != nil { return nil, false, errors.Wrap(err) } @@ -405,7 +474,7 @@ func closeAllConnections(ctx context.Context, allConfigurators []databaseconfigu func (e *Reconciler) GetAllDBConfigurators(ctx context.Context, mysqlServerConfigs []otterizev1alpha3.MySQLServerConfig, pgServerConfigs []otterizev1alpha3.PostgreSQLServerConfig) []databaseconfigurator.DatabaseConfigurator { configurators := make([]databaseconfigurator.DatabaseConfigurator, 0) for _, mysqlServerConfig := range mysqlServerConfigs { - dbconfigurator, err := mysql.NewMySQLConfigurator(ctx, mysqlServerConfig.Spec) + dbconfigurator, err := e.createMySQLDBConfigurator(ctx, mysqlServerConfig) if err != nil { logrus.WithError(err).Errorf("Failed to create configurator for MySQL server config: %s", mysqlServerConfig.Name) continue @@ -414,7 +483,7 @@ func (e *Reconciler) GetAllDBConfigurators(ctx context.Context, mysqlServerConfi } for _, pgServerConfig := range pgServerConfigs { - dbconfigurator, err := postgres.NewPostgresConfigurator(ctx, pgServerConfig.Spec) + dbconfigurator, err := e.createPostgresDBConfigurator(ctx, pgServerConfig) if err != nil { logrus.WithError(err).Errorf("Failed to create configurator for PostgreSQL server config: %s", pgServerConfig.Name) continue diff --git a/src/operator/go.mod b/src/operator/go.mod index f7b67746..d2d960f0 100644 --- a/src/operator/go.mod +++ b/src/operator/go.mod @@ -11,6 +11,7 @@ require ( github.com/aws/aws-sdk-go-v2/service/rolesanywhere v1.9.0 github.com/bombsimon/logrusr/v3 v3.0.0 github.com/cert-manager/cert-manager v1.12.3 + github.com/otterize/intents-operator/src v0.0.0-20240623163818-27d9ebb4f4eb github.com/pavlo-v-chernykh/keystore-go/v4 v4.4.1 github.com/samber/lo v1.33.0 github.com/sirupsen/logrus v1.9.0 @@ -49,10 +50,7 @@ require ( github.com/AzureAD/microsoft-authentication-library-for-go v1.2.1 // indirect github.com/DataDog/datadog-go v3.2.0+incompatible // indirect github.com/Microsoft/go-winio v0.6.1 // indirect - github.com/agnivade/levenshtein v1.1.1 // indirect github.com/aidarkhanov/nanoid v1.0.8 // indirect - github.com/alexflint/go-arg v1.4.2 // indirect - github.com/alexflint/go-scalar v1.0.0 // indirect github.com/armon/go-metrics v0.4.1 // indirect github.com/aws/aws-sdk-go v1.51.21 // indirect github.com/aws/aws-sdk-go-v2 v1.26.0 // indirect @@ -74,7 +72,6 @@ require ( github.com/beorn7/perks v1.0.1 // indirect github.com/blang/semver/v4 v4.0.0 // indirect github.com/bugsnag/bugsnag-go/v2 v2.2.0 // indirect - github.com/bugsnag/panicwrap v1.3.4 // indirect github.com/cespare/xxhash/v2 v2.2.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/emicklei/go-restful/v3 v3.11.0 // indirect @@ -108,7 +105,6 @@ require ( github.com/jmespath/go-jmespath v0.4.0 // indirect github.com/josharian/intern v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect - github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0 // indirect github.com/kylelemons/godebug v1.1.0 // indirect github.com/magiconair/properties v1.8.6 // indirect github.com/mailru/easyjson v0.7.7 // indirect @@ -117,7 +113,6 @@ require ( 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/otterize/intents-operator/src v0.0.0-20240623092600-0eb9a9628a9f // indirect github.com/otterize/nilable v0.0.0-20240410132629-f242bb6f056f // indirect github.com/pelletier/go-toml v1.9.5 // indirect github.com/pelletier/go-toml/v2 v2.0.8 // indirect diff --git a/src/operator/go.sum b/src/operator/go.sum index c2c13c75..4cee8efb 100644 --- a/src/operator/go.sum +++ b/src/operator/go.sum @@ -85,8 +85,6 @@ github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5 github.com/Shopify/sarama v1.34.1 h1:pVCQO7BMAK3s1jWhgi5v1W6lwZ6Veiekfc2vsgRS06Y= github.com/Shopify/sarama v1.34.1/go.mod h1:NZSNswsnStpq8TUdFaqnpXm2Do6KRzTIjdBdVlL1YRM= github.com/agnivade/levenshtein v1.0.1/go.mod h1:CURSv5d9Uaml+FovSIICkLbAUZ9S4RqaHDIsdSBg7lM= -github.com/agnivade/levenshtein v1.1.1 h1:QY8M92nrzkmr798gCo3kmMyqXFzdQVpxLlGPRBij0P8= -github.com/agnivade/levenshtein v1.1.1/go.mod h1:veldBMzWxcCG2ZvUTKD2kJNRdCk5hVbJomOvKkmgYbo= github.com/aidarkhanov/nanoid v1.0.8 h1:yxyJkgsEDFXP7+97vc6JevMcjyb03Zw+/9fqhlVXBXA= github.com/aidarkhanov/nanoid v1.0.8/go.mod h1:vadfZHT+m4uDhttg0yY4wW3GKtl2T6i4d2Age+45pYk= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= @@ -94,10 +92,6 @@ github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuy github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= -github.com/alexflint/go-arg v1.4.2 h1:lDWZAXxpAnZUq4qwb86p/3rIJJ2Li81EoMbTMujhVa0= -github.com/alexflint/go-arg v1.4.2/go.mod h1:9iRbDxne7LcR/GSvEr7ma++GLpdIU1zrghf2y2768kM= -github.com/alexflint/go-scalar v1.0.0 h1:NGupf1XV/Xb04wXskDFzS0KWOLH632W/EO4fAFi+A70= -github.com/alexflint/go-scalar v1.0.0/go.mod h1:GpHzbCOZXEKMEcygYQ5n/aa4Aq84zbxjy3MxYW0gjYw= github.com/amit7itz/goset v1.2.1 h1:usFphDJfZgwnqfbKT8zI+2juuOgsZ6O8UA7NMRUVG7s= github.com/amit7itz/goset v1.2.1/go.mod h1:i8ni2YcxUMAwLBOkHWpy3glFviYdTcWqCvFgp91EMGI= github.com/andres-erbsen/clock v0.0.0-20160526145045-9e14626cd129 h1:MzBOUgng9orim59UnfUTLRjMpd09C5uEVQ6RPGeCaVI= @@ -105,7 +99,6 @@ github.com/andres-erbsen/clock v0.0.0-20160526145045-9e14626cd129/go.mod h1:rFgp github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883 h1:bvNMNQO63//z+xNgfBlViaCIJKLlCJ6/fmUseuG0wVQ= github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= -github.com/arbovm/levenshtein v0.0.0-20160628152529-48b4e1c0c4d0/go.mod h1:t2tdKJDJF9BV14lnkjHmOQgcvEKgtqs5a1N3LNdJhGE= github.com/armon/go-metrics v0.4.1 h1:hR91U9KYmb6bLBYLQjyM+3j+rcd/UhE+G78SFnF8gJA= github.com/armon/go-metrics v0.4.1/go.mod h1:E6amYzXo6aW1tqzoZGT755KkbgrJsSdpwZ+3JqfkOG4= github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a h1:idn718Q4B6AGu/h5Sxe66HYVdqdGu2l9Iebqhi/AEoA= @@ -152,7 +145,6 @@ github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24 github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= -github.com/bitly/go-simplejson v0.5.0 h1:6IH+V8/tVMab511d5bn4M7EwGXZf9Hj6i2xSwkNEM+Y= github.com/bitly/go-simplejson v0.5.0/go.mod h1:cXHtHw4XUPsvGaxgjIAn8PhEWG9NfngEKAMDJEczWVA= github.com/blang/semver/v4 v4.0.0 h1:1PFHFE6yCCTv8C1TeyNNarDzntLi7wMI5i/pzqYIsAM= github.com/blang/semver/v4 v4.0.0/go.mod h1:IbckMUScFkM3pff0VJDNKRiT6TG/YpiHIM2yvyW5YoQ= @@ -161,7 +153,6 @@ github.com/bombsimon/logrusr/v3 v3.0.0 h1:tcAoLfuAhKP9npBxWzSdpsvKPQt1XV02nSf2lZ github.com/bombsimon/logrusr/v3 v3.0.0/go.mod h1:PksPPgSFEL2I52pla2glgCyyd2OqOHAnFF5E+g8Ixco= github.com/bugsnag/bugsnag-go/v2 v2.2.0 h1:y4JJ6xNJiK4jbmq/BLXe09MGUNRp/r1Zpye6RKcPJJ8= github.com/bugsnag/bugsnag-go/v2 v2.2.0/go.mod h1:Aoi1ax1kGbbkArShzXUQjxp6jM8gMh4qOtHLis/jY1E= -github.com/bugsnag/panicwrap v1.3.4 h1:A6sXFtDGsgU/4BLf5JT0o5uYg3EeKgGx3Sfs+/uk3pU= github.com/bugsnag/panicwrap v1.3.4/go.mod h1:D/8v3kj0zr8ZAKg1AQ6crr+5VwKN5eIywRkfhyM/+dE= github.com/cactus/go-statsd-client/statsd v0.0.0-20200423205355-cb0885a1018c/go.mod h1:l/bIBLeOl9eX+wxJAzxS4TveKRtAqlyDpHjhkfO0MEI= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= @@ -189,7 +180,6 @@ github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ3 github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/dgryski/trifles v0.0.0-20200323201526-dd97f9abfb48/go.mod h1:if7Fbed8SFyPtHLHbg49SI7NAdJiC5WIA09pe59rfAA= github.com/dnaeon/go-vcr v1.2.0 h1:zHCHvJYTMh1N7xnV7zf1m1GPBF9Ad0Jk/whtQ1663qI= github.com/dnaeon/go-vcr v1.2.0/go.mod h1:R4UdLID7HZT3taECzJs4YgbbH6PIGXB6W/sc5OLb6RQ= github.com/eapache/go-resiliency v1.2.0 h1:v7g92e/KSN71Rq7vSThKaWIq68fL4YHvWyiUKorFR1Q= @@ -388,7 +378,6 @@ github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1 github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= -github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0 h1:iQTw/8FWTuc7uiaSepXwyf3o52HaUYcV+Tu66S3F5GA= github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0/go.mod h1:1NbS8ALrpOvjt0rHPNLyCIeMtbizbir8U//inJ+zuB8= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= @@ -432,12 +421,8 @@ github.com/onsi/ginkgo/v2 v2.14.0 h1:vSmGj2Z5YPb9JwCWT6z6ihcUvDhuXLc3sJiqd3jMKAY github.com/onsi/ginkgo/v2 v2.14.0/go.mod h1:JkUdW7JkN0V6rFvsHcJ478egV3XH9NxpD27Hal/PhZw= github.com/onsi/gomega v1.30.0 h1:hvMK7xYz4D3HapigLTeGdId/NcfQx1VHMJc60ew99+8= github.com/onsi/gomega v1.30.0/go.mod h1:9sxs+SwGrKI0+PWe4Fxa9tFQQBG5xSsSbMXOI8PPpoQ= -github.com/otterize/intents-operator/src v0.0.0-20240521104220-ba00b7c59637 h1:fhtXDgHYymOrHaAdaBg7kTs8D53u35nmGXYLiDhVjtU= -github.com/otterize/intents-operator/src v0.0.0-20240521104220-ba00b7c59637/go.mod h1:7vDL6/NAo7AobUGqDGU/277xGyb0KTRQoqRjoouhh44= -github.com/otterize/intents-operator/src v0.0.0-20240623092600-0eb9a9628a9f h1:Gj2hrAncbdgXICnnxpICu4NbNd1Dc+GciNGlqClg13g= -github.com/otterize/intents-operator/src v0.0.0-20240623092600-0eb9a9628a9f/go.mod h1:7vDL6/NAo7AobUGqDGU/277xGyb0KTRQoqRjoouhh44= -github.com/otterize/intents-operator/src v0.1.15 h1:Cd0dMKLsi6iz1y3c0KKrq4dXABWVrq2Jo37aQAYcJQA= -github.com/otterize/intents-operator/src v0.1.15/go.mod h1:J3iXhY18AZzG19op3JbnduQyJtGu0OUaM44Kb/OxDuI= +github.com/otterize/intents-operator/src v0.0.0-20240623163818-27d9ebb4f4eb h1:aGBbne9jtKspb0fgvQHpIgN5t9mErIMXBNp1Y7XEx8g= +github.com/otterize/intents-operator/src v0.0.0-20240623163818-27d9ebb4f4eb/go.mod h1:7vDL6/NAo7AobUGqDGU/277xGyb0KTRQoqRjoouhh44= github.com/otterize/lox v0.0.0-20220525164329-9ca2bf91c3dd h1:7Sb95VrtAPb9m2ewtqLnX1oeKQy03dt7yr6F/hP7Htg= github.com/otterize/lox v0.0.0-20220525164329-9ca2bf91c3dd/go.mod h1:RXvgymN8MxiELFkmGHzJ23KJU2ObVsNsNSM80/HO8qQ= github.com/otterize/nilable v0.0.0-20240410132629-f242bb6f056f h1:gv92189CW53A+Y0UQ550zr6RfCBYqvYJ8oq6Jll1YqQ= diff --git a/src/operator/main.go b/src/operator/main.go index 40677b15..56be8e54 100644 --- a/src/operator/main.go +++ b/src/operator/main.go @@ -118,10 +118,6 @@ func initSpireClient(ctx context.Context, spireServerAddr string) (spireclient.S } func main() { - errorreporter.Init("credentials-operator", version.Version(), viper.GetString(operatorconfig.TelemetryErrorsAPIKeyKey)) - defer errorreporter.AutoNotify() - shared.RegisterPanicHandlers() - var secretsManager tls_pod.SecretsManager var workloadRegistry tls_pod.WorkloadRegistry @@ -132,8 +128,20 @@ func main() { TimestampFormat: time.RFC3339, }) + signalHandlerCtx := ctrl.SetupSignalHandler() + + clusterUID, err := clusterutils.GetOrCreateClusterUID(signalHandlerCtx) + if err != nil { + logrus.WithError(err).Panic("Failed obtaining cluster ID") + } + componentinfo.SetGlobalContextId(telemetrysender.Anonymize(clusterUID)) + ctrl.SetLogger(logrusr.New(logrus.StandardLogger())) + errorreporter.Init(telemetriesgql.TelemetryComponentTypeCredentialsOperator, version.Version()) + defer errorreporter.AutoNotify() + shared.RegisterPanicHandlers() + mgr, err := ctrl.NewManager(ctrl.GetConfigOrDie(), ctrl.Options{ Scheme: scheme, Metrics: server.Options{ @@ -148,7 +156,6 @@ func main() { logrus.WithError(err).Panic("unable to initialize manager") } - signalHandlerCtx := ctrl.SetupSignalHandler() podNamespace := os.Getenv("POD_NAMESPACE") if podNamespace == "" { logrus.Panic("POD_NAMESPACE environment variable is required") @@ -166,13 +173,6 @@ func main() { logrus.WithError(err).Panic("unable to ensure otterize CRDs") } - clusterUID, err := clusterutils.GetOrCreateClusterUID(signalHandlerCtx) - if err != nil { - logrus.WithError(err).Panic("Failed fetching cluster UID") - } - componentinfo.SetGlobalContextId(telemetrysender.Anonymize(clusterUID)) - componentinfo.SetGlobalVersion(version.Version()) - serviceIdResolver := serviceidresolver.NewResolver(mgr.GetClient()) eventRecorder := mgr.GetEventRecorderFor("credentials-operator")