Move hacks to hack (match k8s pattern).

This commit is contained in:
jregan
2019-10-27 05:05:23 -07:00
parent ff59e9b52f
commit cd50bf4e1e
96 changed files with 17 additions and 25 deletions

View File

@@ -150,7 +150,7 @@ func (l *Loader) loadPlugin(resId resid.ResId) (resmap.Configurable, error) {
if err == nil {
return p, nil
}
if err != nil && !os.IsNotExist(err) {
if !os.IsNotExist(err) {
return nil, err
}
c, err := l.loadGoPlugin(resId)

View File

@@ -13,7 +13,7 @@ import (
"github.com/gorilla/mux"
"github.com/rs/cors"
"sigs.k8s.io/kustomize/hacks/crawl/index"
"sigs.k8s.io/kustomize/hack/crawl/index"
)
type kustomizeSearch struct {

View File

@@ -4,7 +4,7 @@ import (
"context"
"log"
"os"
server "sigs.k8s.io/kustomize/hacks/crawl/backend"
server "sigs.k8s.io/kustomize/hack/crawl/backend"
"strconv"
)

View File

@@ -12,7 +12,7 @@ import (
_ "github.com/gomodule/redigo/redis"
"sigs.k8s.io/kustomize/hacks/crawl/doc"
"sigs.k8s.io/kustomize/hack/crawl/doc"
)
var (
@@ -208,8 +208,8 @@ func CRunner(ctx context.Context,
// the main output channel.
go func(docs <-chan CrawledDocument) {
defer wg.Done()
for doc := range docs {
output <- doc
for d := range docs {
output <- d
}
}(docs)

View File

@@ -12,7 +12,7 @@ import (
"time"
"sigs.k8s.io/kustomize/api/pgmconfig"
"sigs.k8s.io/kustomize/hacks/crawl/doc"
"sigs.k8s.io/kustomize/hack/crawl/doc"
)
const (

View File

@@ -18,9 +18,9 @@ import (
"sigs.k8s.io/kustomize/api/git"
"sigs.k8s.io/kustomize/api/pgmconfig"
"sigs.k8s.io/kustomize/hacks/crawl/crawler"
"sigs.k8s.io/kustomize/hacks/crawl/doc"
"sigs.k8s.io/kustomize/hacks/crawl/httpclient"
"sigs.k8s.io/kustomize/hack/crawl/crawler"
"sigs.k8s.io/kustomize/hack/crawl/doc"
"sigs.k8s.io/kustomize/hack/crawl/httpclient"
)
var logger = log.New(os.Stdout, "Github Crawler: ",
@@ -208,11 +208,6 @@ func kustomizationResultAdapter(gcl GhClient, k GhFileSpec) (
return nil, err
}
if err != nil {
logger.Printf(
"(error: %v) initializing to current time.\n", err)
}
url := gcl.ReposRequest(k.Repository.FullName)
defaultBranch, err := gcl.GetDefaultBranch(url)
if err != nil {
@@ -221,7 +216,7 @@ func kustomizationResultAdapter(gcl GhClient, k GhFileSpec) (
defaultBranch = "master"
}
doc := doc.KustomizationDocument{
d := doc.KustomizationDocument{
Document: doc.Document{
DocumentData: string(data),
FilePath: k.Path,
@@ -230,7 +225,7 @@ func kustomizationResultAdapter(gcl GhClient, k GhFileSpec) (
},
}
return &doc, nil
return &d, nil
}
// ForwardPaginatedQuery follows the links to the next pages and performs all of

View File

@@ -9,8 +9,6 @@ import (
const (
perPageArg = "per_page"
accessTokenArg = "access_token"
githubMaxPageSize = 100
)
// Implementation detail, not important to external API.

View File

@@ -4,14 +4,13 @@ import (
"fmt"
"strings"
"sigs.k8s.io/kustomize/api/ifc"
"sigs.k8s.io/kustomize/api/k8sdeps/kunstruct"
"sigs.k8s.io/kustomize/api/pgmconfig"
"sigs.k8s.io/kustomize/api/types"
"sigs.k8s.io/yaml"
)
var fileReader ifc.KunstructuredFactory = kunstruct.NewKunstructuredFactoryImpl()
var fileReader = kunstruct.NewKunstructuredFactoryImpl()
// This document is meant to be used at the elasticsearch document type.
// Fields are serialized as-is to elasticsearch, where indices are built

View File

@@ -1,4 +1,4 @@
module sigs.k8s.io/kustomize/hacks/crawl
module sigs.k8s.io/kustomize/hack/crawl
go 1.13

View File

@@ -9,7 +9,7 @@ import (
"strings"
"time"
"sigs.k8s.io/kustomize/hacks/crawl/doc"
"sigs.k8s.io/kustomize/hack/crawl/doc"
)
const (

View File

Before

Width:  |  Height:  |  Size: 53 KiB

After

Width:  |  Height:  |  Size: 53 KiB

View File

Before

Width:  |  Height:  |  Size: 44 KiB

After

Width:  |  Height:  |  Size: 44 KiB

View File

Before

Width:  |  Height:  |  Size: 32 KiB

After

Width:  |  Height:  |  Size: 32 KiB

View File

Before

Width:  |  Height:  |  Size: 5.3 KiB

After

Width:  |  Height:  |  Size: 5.3 KiB

View File

@@ -1,6 +1,6 @@
# Usage: From repo root:
# ./hacks/doGoMod.sh tidy
# ./hacks/doGoMod.sh verify
# ./hack/doGoMod.sh tidy
# ./hack/doGoMod.sh verify
operation=$1
for f in $(find ./ -name 'go.mod'); do