Move hacks to hack (match k8s pattern).
@@ -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)
|
||||
|
||||
@@ -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 {
|
||||
@@ -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"
|
||||
)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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 (
|
||||
@@ -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
|
||||
@@ -9,8 +9,6 @@ import (
|
||||
const (
|
||||
perPageArg = "per_page"
|
||||
accessTokenArg = "access_token"
|
||||
|
||||
githubMaxPageSize = 100
|
||||
)
|
||||
|
||||
// Implementation detail, not important to external API.
|
||||
@@ -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
|
||||
@@ -1,4 +1,4 @@
|
||||
module sigs.k8s.io/kustomize/hacks/crawl
|
||||
module sigs.k8s.io/kustomize/hack/crawl
|
||||
|
||||
go 1.13
|
||||
|
||||
@@ -9,7 +9,7 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"sigs.k8s.io/kustomize/hacks/crawl/doc"
|
||||
"sigs.k8s.io/kustomize/hack/crawl/doc"
|
||||
)
|
||||
|
||||
const (
|
||||
|
Before Width: | Height: | Size: 53 KiB After Width: | Height: | Size: 53 KiB |
|
Before Width: | Height: | Size: 44 KiB After Width: | Height: | Size: 44 KiB |
|
Before Width: | Height: | Size: 32 KiB After Width: | Height: | Size: 32 KiB |
|
Before Width: | Height: | Size: 5.3 KiB After Width: | Height: | Size: 5.3 KiB |
@@ -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
|
||||