Merge pull request #1698 from monopole/mvHacksToHack

mv hacks dir to hack (match pattern in k/k repo).
This commit is contained in:
Jeff Regan
2019-10-27 05:13:30 -07:00
committed by GitHub
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 { if err == nil {
return p, nil return p, nil
} }
if err != nil && !os.IsNotExist(err) { if !os.IsNotExist(err) {
return nil, err return nil, err
} }
c, err := l.loadGoPlugin(resId) c, err := l.loadGoPlugin(resId)

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -4,14 +4,13 @@ import (
"fmt" "fmt"
"strings" "strings"
"sigs.k8s.io/kustomize/api/ifc"
"sigs.k8s.io/kustomize/api/k8sdeps/kunstruct" "sigs.k8s.io/kustomize/api/k8sdeps/kunstruct"
"sigs.k8s.io/kustomize/api/pgmconfig" "sigs.k8s.io/kustomize/api/pgmconfig"
"sigs.k8s.io/kustomize/api/types" "sigs.k8s.io/kustomize/api/types"
"sigs.k8s.io/yaml" "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. // This document is meant to be used at the elasticsearch document type.
// Fields are serialized as-is to elasticsearch, where indices are built // 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 go 1.13

View File

@@ -9,7 +9,7 @@ import (
"strings" "strings"
"time" "time"
"sigs.k8s.io/kustomize/hacks/crawl/doc" "sigs.k8s.io/kustomize/hack/crawl/doc"
) )
const ( 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: # Usage: From repo root:
# ./hacks/doGoMod.sh tidy # ./hack/doGoMod.sh tidy
# ./hacks/doGoMod.sh verify # ./hack/doGoMod.sh verify
operation=$1 operation=$1
for f in $(find ./ -name 'go.mod'); do for f in $(find ./ -name 'go.mod'); do