Skip to content

Commit

Permalink
Reorganize golang code and clean up old code (kyma-project#8970)
Browse files Browse the repository at this point in the history
* Reorganize golang code and clean up old code

/kind cleanup
/area ci

1st part of directory reorganization and cleanup - go code

* Reorganize golang code and clean up old code

/kind cleanup
/area ci

1st part of directory reorganization and cleanup - go code
  • Loading branch information
Ressetkk authored Oct 3, 2023
1 parent b127784 commit 5a37509
Show file tree
Hide file tree
Showing 165 changed files with 246 additions and 834 deletions.
8 changes: 4 additions & 4 deletions .ko.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
baseImageOverrides:
github.com/kyma-project/test-infra/development/tools/cmd/pjtester: europe-docker.pkg.dev/kyma-project/prod/testimages/alpine-git:v20230913-3d41bb28
github.com/kyma-project/test-infra/development/markdown-index: europe-docker.pkg.dev/kyma-project/prod/testimages/alpine-git:v20230913-3d41bb28
github.com/kyma-project/test-infra/development/image-detector: europe-docker.pkg.dev/kyma-project/prod/testimages/alpine-git:v20230913-3d41bb28
github.com/kyma-project/test-infra/development/external-plugins/needs-tws: europe-docker.pkg.dev/kyma-project/prod/testimages/alpine-git:v20230913-3d41bb28
github.com/kyma-project/test-infra/development/external-plugins/automerge-notification: europe-docker.pkg.dev/kyma-project/prod/testimages/alpine-git:v20230913-3d41bb28
github.com/kyma-project/test-infra/cmd/markdown-index: europe-docker.pkg.dev/kyma-project/prod/testimages/alpine-git:v20230913-3d41bb28
github.com/kyma-project/test-infra/cmd/image-detector: europe-docker.pkg.dev/kyma-project/prod/testimages/alpine-git:v20230913-3d41bb28
github.com/kyma-project/test-infra/cmd/external-plugins/needs-tws: europe-docker.pkg.dev/kyma-project/prod/testimages/alpine-git:v20230913-3d41bb28
github.com/kyma-project/test-infra/cmd/external-plugins/automerge-notification: europe-docker.pkg.dev/kyma-project/prod/testimages/alpine-git:v20230913-3d41bb28
defaultPlatforms:
- linux/arm64
- linux/amd64
32 changes: 16 additions & 16 deletions .koapps.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
apps:
- ko://github.com/kyma-project/test-infra/development/tools/cmd/pjtester
- ko://github.com/kyma-project/test-infra/development/image-syncer
- ko://github.com/kyma-project/test-infra/development/image-detector
- ko://github.com/kyma-project/test-infra/development/image-url-helper
- ko://github.com/kyma-project/test-infra/development/markdown-index
- ko://github.com/kyma-project/test-infra/cmd/image-syncer
- ko://github.com/kyma-project/test-infra/cmd/image-detector
- ko://github.com/kyma-project/test-infra/cmd/image-url-helper
- ko://github.com/kyma-project/test-infra/cmd/markdown-index
- ko://github.com/kyma-project/test-infra/development/tools/cmd/usersmapchecker
- ko://github.com/kyma-project/test-infra/development/tools/cmd/gcscleaner
- ko://github.com/kyma-project/test-infra/development/tools/cmd/diskscollector
Expand All @@ -15,15 +15,15 @@ apps:
- ko://github.com/kyma-project/test-infra/development/tools/cmd/gcrcleaner
- ko://github.com/kyma-project/test-infra/development/tools/cmd/githubissues
- ko://github.com/kyma-project/test-infra/development/tools/cmd/externalsecretschecker
- ko://github.com/kyma-project/test-infra/development/gardener-rotate
- ko://github.com/kyma-project/test-infra/development/gcp/cloud-run/gardener-sa-rotate
- ko://github.com/kyma-project/test-infra/development/gcp/cloud-run/kms-rotate
- ko://github.com/kyma-project/test-infra/development/gcp/cloud-run/create-github-issue
- ko://github.com/kyma-project/test-infra/development/gcp/cloud-run/move-gcs-bucket
- ko://github.com/kyma-project/test-infra/development/gcp/cloud-run/scan-logs-for-secrets
- ko://github.com/kyma-project/test-infra/development/gcp/cloud-run/search-github-issue
- ko://github.com/kyma-project/test-infra/development/gcp/cloud-run/github-webhook-gateway
- ko://github.com/kyma-project/test-infra/development/gcp/cloud-run/cors-proxy
- ko://github.com/kyma-project/test-infra/development/external-plugins/needs-tws
- ko://github.com/kyma-project/test-infra/development/external-plugins/cla-assistant
- ko://github.com/kyma-project/test-infra/development/external-plugins/automerge-notification
- ko://github.com/kyma-project/test-infra/cmd/gardener-rotate
- ko://github.com/kyma-project/test-infra/cmd/cloud-run/gardener-sa-rotate
- ko://github.com/kyma-project/test-infra/cmd/cloud-run/kms-rotate
- ko://github.com/kyma-project/test-infra/cmd/cloud-run/create-github-issue
- ko://github.com/kyma-project/test-infra/cmd/cloud-run/move-gcs-bucket
- ko://github.com/kyma-project/test-infra/cmd/cloud-run/scan-logs-for-secrets
- ko://github.com/kyma-project/test-infra/cmd/cloud-run/search-github-issue
- ko://github.com/kyma-project/test-infra/cmd/cloud-run/github-webhook-gateway
- ko://github.com/kyma-project/test-infra/cmd/cloud-run/cors-proxy
- ko://github.com/kyma-project/test-infra/cmd/external-plugins/needs-tws
- ko://github.com/kyma-project/test-infra/cmd/external-plugins/cla-assistant
- ko://github.com/kyma-project/test-infra/cmd/external-plugins/automerge-notification
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,14 @@ package main

import (
"fmt"
"github.com/kyma-project/test-infra/pkg/gcp/cloudfunctions"
crhttp "github.com/kyma-project/test-infra/pkg/gcp/http"
"io"
"net"
"net/http"
"net/url"
"os"
"strings"

"github.com/kyma-project/test-infra/development/gcp/pkg/cloudfunctions"
crhttp "github.com/kyma-project/test-infra/development/gcp/pkg/http"
)

var (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,21 @@ import (
"encoding/base64"
"encoding/json"
"fmt"
"github.com/kyma-project/test-infra/pkg/gcp/cloudfunctions"
crhttp "github.com/kyma-project/test-infra/pkg/gcp/http"
"github.com/kyma-project/test-infra/pkg/gcp/pubsub"
gcptypes "github.com/kyma-project/test-infra/pkg/gcp/types"
kgithubv1 "github.com/kyma-project/test-infra/pkg/github/client"
"github.com/kyma-project/test-infra/pkg/github/templates"
githubtypes "github.com/kyma-project/test-infra/pkg/github/types"
"github.com/kyma-project/test-infra/pkg/types"
"net/http"
"net/http/httputil"
"os"
"strings"

cloudevents "github.com/cloudevents/sdk-go/v2"
"github.com/google/go-github/v48/github"
"github.com/kyma-project/test-infra/development/gcp/pkg/cloudfunctions"
crhttp "github.com/kyma-project/test-infra/development/gcp/pkg/http"
"github.com/kyma-project/test-infra/development/gcp/pkg/pubsub"
gcptypes "github.com/kyma-project/test-infra/development/gcp/pkg/types"
kgithubv1 "github.com/kyma-project/test-infra/development/github/pkg/client"
"github.com/kyma-project/test-infra/development/github/pkg/templates"
githubtypes "github.com/kyma-project/test-infra/development/github/pkg/types"
"github.com/kyma-project/test-infra/development/types"
"golang.org/x/net/context"
)

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ package main
import (
"context"
"encoding/json"
"github.com/kyma-project/test-infra/pkg/gcp/iam"
"github.com/kyma-project/test-infra/pkg/gcp/pubsub"
"github.com/kyma-project/test-infra/pkg/gcp/secretmanager"
"io"
"log"
"net/http"
"os"

"cloud.google.com/go/compute/metadata"
"github.com/kyma-project/test-infra/development/gcp/pkg/iam"
"github.com/kyma-project/test-infra/development/gcp/pkg/pubsub"
"github.com/kyma-project/test-infra/development/gcp/pkg/secretmanager"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/client-go/kubernetes"
"k8s.io/client-go/tools/clientcmd"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ import (
"encoding/json"
"errors"
"fmt"
"github.com/kyma-project/test-infra/pkg/gcp/iam"
"github.com/kyma-project/test-infra/pkg/gcp/pubsub"
"github.com/kyma-project/test-infra/pkg/gcp/secretmanager"
"io"
"net/http"
"net/http/httptest"
Expand All @@ -17,9 +20,6 @@ import (
"testing"

gpubsub "cloud.google.com/go/pubsub"
"github.com/kyma-project/test-infra/development/gcp/pkg/iam"
"github.com/kyma-project/test-infra/development/gcp/pkg/pubsub"
"github.com/kyma-project/test-infra/development/gcp/pkg/secretmanager"
gcpiam "google.golang.org/api/iam/v1"
"google.golang.org/api/option"
gcpsecretmanager "google.golang.org/api/secretmanager/v1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ import (
"context"
"encoding/json"
"fmt"
"github.com/kyma-project/test-infra/pkg/gcp/cloudfunctions"
crhttp "github.com/kyma-project/test-infra/pkg/gcp/http"
"github.com/kyma-project/test-infra/pkg/gcp/pubsub"
toolsclient "github.com/kyma-project/test-infra/pkg/github/client"
"github.com/kyma-project/test-infra/pkg/types"
"net/http"
"os"

"github.com/google/go-github/v48/github"
"github.com/kyma-project/test-infra/development/gcp/pkg/cloudfunctions"
crhttp "github.com/kyma-project/test-infra/development/gcp/pkg/http"
"github.com/kyma-project/test-infra/development/gcp/pkg/pubsub"
toolsclient "github.com/kyma-project/test-infra/development/github/pkg/client"
"github.com/kyma-project/test-infra/development/types"
)

var (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
package main

import (
"github.com/kyma-project/test-infra/pkg/types"
"testing"

"github.com/kyma-project/test-infra/development/types"
)

const (
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ import (
"context"
"encoding/json"
"fmt"
"github.com/kyma-project/test-infra/pkg/gcp/cloudfunctions"
crhttp "github.com/kyma-project/test-infra/pkg/gcp/http"
"github.com/kyma-project/test-infra/pkg/gcp/pubsub"
gcptypes "github.com/kyma-project/test-infra/pkg/gcp/types"
githubtypes "github.com/kyma-project/test-infra/pkg/github/types"
"github.com/kyma-project/test-infra/pkg/types"
"net/http"
"net/http/httputil"
"os"
Expand All @@ -12,12 +18,6 @@ import (
"cloud.google.com/go/storage"
cloudevents "github.com/cloudevents/sdk-go/v2"
"github.com/google/go-github/v48/github"
"github.com/kyma-project/test-infra/development/gcp/pkg/cloudfunctions"
crhttp "github.com/kyma-project/test-infra/development/gcp/pkg/http"
"github.com/kyma-project/test-infra/development/gcp/pkg/pubsub"
gcptypes "github.com/kyma-project/test-infra/development/gcp/pkg/types"
githubtypes "github.com/kyma-project/test-infra/development/github/pkg/types"
"github.com/kyma-project/test-infra/development/types"
"google.golang.org/api/iterator"
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ RotateServiceAccount creates a new key for a GCP service account and updates the

## Cloud Run deployment

RotateServiceAccount is deployed to Cloud Run applying Terraform config stored in [`./terraform` directory](../../../../configs/terraform). `terraform apply` is executed automatically on every PR changing Terraform `.tf` files belonging to the application.
RotateServiceAccount is deployed to Cloud Run applying Terraform config stored
in [`./terraform` directory](../../../configs/terraform). `terraform apply` is executed automatically on every PR
changing Terraform `.tf` files belonging to the application.

## RotateServiceAccount usage

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@ import (
"encoding/base64"
"encoding/json"
"fmt"
"github.com/kyma-project/test-infra/pkg/gcp/cloudfunctions"
crhttp "github.com/kyma-project/test-infra/pkg/gcp/http"
"github.com/kyma-project/test-infra/pkg/gcp/pubsub"
"github.com/kyma-project/test-infra/pkg/gcp/secretmanager"
"net/http"
"net/http/httputil"
"os"
"strings"

"cloud.google.com/go/compute/metadata"
"github.com/kyma-project/test-infra/development/gcp/pkg/cloudfunctions"
crhttp "github.com/kyma-project/test-infra/development/gcp/pkg/http"
"github.com/kyma-project/test-infra/development/gcp/pkg/pubsub"
"github.com/kyma-project/test-infra/development/gcp/pkg/secretmanager"
"google.golang.org/api/iam/v1"
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ package main
import (
"encoding/json"
"fmt"
"github.com/kyma-project/test-infra/pkg/gcp/cloudfunctions"
crhttp "github.com/kyma-project/test-infra/pkg/gcp/http"
"github.com/kyma-project/test-infra/pkg/gcp/pubsub"
gcptypes "github.com/kyma-project/test-infra/pkg/gcp/types"
"github.com/kyma-project/test-infra/pkg/types"
"net/http/httputil"
"regexp"

Expand All @@ -14,11 +19,6 @@ import (
cloudevents "github.com/cloudevents/sdk-go/v2"
"github.com/go-playground/validator/v10"
"github.com/google/go-github/v48/github"
"github.com/kyma-project/test-infra/development/gcp/pkg/cloudfunctions"
crhttp "github.com/kyma-project/test-infra/development/gcp/pkg/http"
"github.com/kyma-project/test-infra/development/gcp/pkg/pubsub"
gcptypes "github.com/kyma-project/test-infra/development/gcp/pkg/types"
"github.com/kyma-project/test-infra/development/types"
"github.com/spf13/viper"
"github.com/zricethezav/gitleaks/v8/config"
"github.com/zricethezav/gitleaks/v8/detect"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ import (
"encoding/base64"
"encoding/json"
"fmt"
"github.com/kyma-project/test-infra/pkg/gcp/cloudfunctions"
crhttp "github.com/kyma-project/test-infra/pkg/gcp/http"
"github.com/kyma-project/test-infra/pkg/gcp/pubsub"
gcptypes "github.com/kyma-project/test-infra/pkg/gcp/types"
kgithubv1 "github.com/kyma-project/test-infra/pkg/github/client"
githubtypes "github.com/kyma-project/test-infra/pkg/github/types"
"github.com/kyma-project/test-infra/pkg/types"
"net/http"
"net/http/httputil"
"os"
Expand All @@ -13,13 +20,6 @@ import (
"cloud.google.com/go/storage"
cloudevents "github.com/cloudevents/sdk-go/v2"
"github.com/google/go-github/v48/github"
"github.com/kyma-project/test-infra/development/gcp/pkg/cloudfunctions"
crhttp "github.com/kyma-project/test-infra/development/gcp/pkg/http"
"github.com/kyma-project/test-infra/development/gcp/pkg/pubsub"
gcptypes "github.com/kyma-project/test-infra/development/gcp/pkg/types"
kgithubv1 "github.com/kyma-project/test-infra/development/github/pkg/client"
githubtypes "github.com/kyma-project/test-infra/development/github/pkg/types"
"github.com/kyma-project/test-infra/development/types"
"golang.org/x/net/context"
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ The Cloud Run service deletes old keys for a GCP service account and updates the

## Cloud Run service deployment

ServiceAccountKeysCleaner is deployed to Cloud Run applying Terraform config stored in [`./terraform` directory](../../../../configs/terraform). `terraform apply` runs automatically on every PR changing Terraform `.tf` files belonging to the application.
ServiceAccountKeysCleaner is deployed to Cloud Run applying Terraform config stored
in [`./terraform` directory](../../../configs/terraform). `terraform apply` runs automatically on every PR changing
Terraform `.tf` files belonging to the application.

1. Create the `service-${PROJECT_NUMBER}@gcp-sa-secretmanager.iam.gserviceaccount.com` service account with the `roles/pubsub.publisher` role if it does not exist.
2. Merge your changes to test-infra main branch to trigger Terraform execution.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@ import (
"context"
"encoding/json"
"fmt"
"github.com/kyma-project/test-infra/pkg/gcp/cloudfunctions"
crhttp "github.com/kyma-project/test-infra/pkg/gcp/http"
"github.com/kyma-project/test-infra/pkg/gcp/iam"
"github.com/kyma-project/test-infra/pkg/gcp/secretmanager"
"net/http"
"os"
"strconv"
"strings"
"time"

"cloud.google.com/go/compute/metadata"
"github.com/kyma-project/test-infra/development/gcp/pkg/cloudfunctions"
crhttp "github.com/kyma-project/test-infra/development/gcp/pkg/http"
"github.com/kyma-project/test-infra/development/gcp/pkg/iam"
"github.com/kyma-project/test-infra/development/gcp/pkg/secretmanager"
gcpiam "google.golang.org/api/iam/v1"
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import (
"encoding/json"
"errors"
"fmt"
"github.com/kyma-project/test-infra/pkg/gcp/iam"
"github.com/kyma-project/test-infra/pkg/gcp/secretmanager"
"net/http"
"net/http/httptest"
"reflect"
Expand All @@ -15,8 +17,6 @@ import (
"testing"
"time"

"github.com/kyma-project/test-infra/development/gcp/pkg/iam"
"github.com/kyma-project/test-infra/development/gcp/pkg/secretmanager"
gcpiam "google.golang.org/api/iam/v1"
"google.golang.org/api/option"
gcpsecretmanager "google.golang.org/api/secretmanager/v1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@ package main

import (
"context"
"github.com/kyma-project/test-infra/pkg/gcp/dnsclient"
flag "github.com/spf13/pflag"
"log"
"os"

"github.com/kyma-project/test-infra/development/gcp/pkg/dnsclient"
)

var (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@ import (
"encoding/json"
"flag"
"fmt"
"github.com/kyma-project/test-infra/pkg/gcp/pubsub"
toolsclient "github.com/kyma-project/test-infra/pkg/github/client"
"github.com/kyma-project/test-infra/pkg/github/client/v2"
"github.com/kyma-project/test-infra/pkg/github/git"
"github.com/kyma-project/test-infra/pkg/github/repoowners"
"github.com/kyma-project/test-infra/pkg/prow/externalplugin"
"sort"

gogithub "github.com/google/go-github/v48/github"
"github.com/kyma-project/test-infra/development/gcp/pkg/pubsub"
toolsclient "github.com/kyma-project/test-infra/development/github/pkg/client"
"github.com/kyma-project/test-infra/development/github/pkg/client/v2"
"github.com/kyma-project/test-infra/development/github/pkg/git"
"github.com/kyma-project/test-infra/development/github/pkg/repoowners"
consolelog "github.com/kyma-project/test-infra/development/logging"
"github.com/kyma-project/test-infra/development/prow/externalplugin"
consolelog "github.com/kyma-project/test-infra/pkg/logging"
"golang.org/x/net/context"
"google.golang.org/api/option"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ import (
"encoding/json"
"flag"
"fmt"
"github.com/kyma-project/test-infra/pkg/prow/externalplugin"
"net/http"
"os"
"regexp"
"time"

"github.com/kyma-project/test-infra/development/prow/externalplugin"
"go.uber.org/zap"
"k8s.io/test-infra/prow/config"
"k8s.io/test-infra/prow/github"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package main

import (
"fmt"
"github.com/kyma-project/test-infra/development/prow/externalplugin"
"github.com/kyma-project/test-infra/pkg/prow/externalplugin"
"k8s.io/test-infra/prow/config"
"k8s.io/test-infra/prow/github"
"net/http"
Expand Down
Loading

0 comments on commit 5a37509

Please sign in to comment.