Skip to content

Instantly share code, notes, and snippets.

@charith-elastic
Created April 15, 2020 07:11
Show Gist options
  • Save charith-elastic/324bec1b07d927e2bcf39f359938deba to your computer and use it in GitHub Desktop.
Save charith-elastic/324bec1b07d927e2bcf39f359938deba to your computer and use it in GitHub Desktop.
Only in .: assets
diff '--exclude=.git' -r -u ../gld/dependency/dependency.go ./dependency/dependency.go
--- ../gld/dependency/dependency.go 2020-04-14 11:51:22.745018794 +0100
+++ ./dependency/dependency.go 2020-04-14 13:10:00.829636828 +0100
@@ -1,6 +1,19 @@
-// Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
-// or more contributor license agreements. Licensed under the Elastic License;
-// you may not use this file except in compliance with the Elastic License.
+// Licensed to Elasticsearch B.V. under one or more contributor
+// license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright
+// ownership. Elasticsearch B.V. licenses this file to you under
+// the Apache License, Version 2.0 (the "License"); you may
+// not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
package dependency
diff '--exclude=.git' -r -u ../gld/dependency/dependency_test.go ./dependency/dependency_test.go
--- ../gld/dependency/dependency_test.go 2020-04-14 11:51:22.745018794 +0100
+++ ./dependency/dependency_test.go 2020-04-14 13:10:00.829636828 +0100
@@ -1,6 +1,19 @@
-// Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
-// or more contributor license agreements. Licensed under the Elastic License;
-// you may not use this file except in compliance with the Elastic License.
+// Licensed to Elasticsearch B.V. under one or more contributor
+// license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright
+// ownership. Elasticsearch B.V. licenses this file to you under
+// the Apache License, Version 2.0 (the "License"); you may
+// not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
package dependency
diff '--exclude=.git' -r -u ../gld/detector/detector.go ./detector/detector.go
--- ../gld/detector/detector.go 2020-04-14 11:51:22.745018794 +0100
+++ ./detector/detector.go 2020-04-14 14:21:25.259851358 +0100
@@ -1,6 +1,21 @@
-// Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
-// or more contributor license agreements. Licensed under the Elastic License;
-// you may not use this file except in compliance with the Elastic License.
+// Licensed to Elasticsearch B.V. under one or more contributor
+// license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright
+// ownership. Elasticsearch B.V. licenses this file to you under
+// the Apache License, Version 2.0 (the "License"); you may
+// not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+//go:generate pkger -include=github.com/elastic/go-licence-detector:/assets/licence.db -o=detector
package detector
@@ -15,13 +30,17 @@
"strings"
"time"
- "github.com/elastic/cloud-on-k8s/hack/licence-detector/dependency"
+ "github.com/elastic/go-licence-detector/dependency"
"github.com/google/licenseclassifier"
"github.com/karrick/godirwalk"
+ "github.com/markbates/pkger"
)
-// detectionThreshold is the minimum confidence score required from the licence classifier.
-const detectionThreshold = 0.85
+const (
+ assetsPath = "github.com/elastic/go-licence-detector:/assets/licence.db"
+ // detectionThreshold is the minimum confidence score required from the licence classifier.
+ detectionThreshold = 0.85
+)
var errLicenceNotFound = errors.New("failed to detect licence")
@@ -42,6 +61,10 @@
// NewClassifier creates a new instance of the licence classifier.
func NewClassifier(dataPath string) (*licenseclassifier.License, error) {
+ if dataPath == "" {
+ return newClassiferFromEmbeddedDB()
+ }
+
absPath, err := filepath.Abs(dataPath)
if err != nil {
return nil, fmt.Errorf("failed to determine absolute path of licence data file: %w", err)
@@ -50,6 +73,22 @@
return licenseclassifier.New(detectionThreshold, licenseclassifier.Archive(absPath))
}
+func newClassiferFromEmbeddedDB() (*licenseclassifier.License, error) {
+ f, err := pkger.Open(assetsPath)
+ if err != nil {
+ return nil, fmt.Errorf("failed to open bundled licence database: %w", err)
+ }
+
+ defer f.Close()
+
+ dbBytes, err := ioutil.ReadAll(f)
+ if err != nil {
+ return nil, fmt.Errorf("failed to read bundled licence database: %w", err)
+ }
+
+ return licenseclassifier.New(detectionThreshold, licenseclassifier.ArchiveBytes(dbBytes))
+}
+
// Detect searches the dependencies on disk and detects licences.
func Detect(data io.Reader, classifier *licenseclassifier.License, overrides dependency.Overrides, includeIndirect bool) (*dependency.List, error) {
// parse the output of go mod list
diff '--exclude=.git' -r -u ../gld/detector/detector_test.go ./detector/detector_test.go
--- ../gld/detector/detector_test.go 2020-04-14 11:51:22.745018794 +0100
+++ ./detector/detector_test.go 2020-04-14 13:10:00.830636832 +0100
@@ -1,6 +1,19 @@
-// Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
-// or more contributor license agreements. Licensed under the Elastic License;
-// you may not use this file except in compliance with the Elastic License.
+// Licensed to Elasticsearch B.V. under one or more contributor
+// license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright
+// ownership. Elasticsearch B.V. licenses this file to you under
+// the Apache License, Version 2.0 (the "License"); you may
+// not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
package detector
@@ -8,7 +21,7 @@
"os"
"testing"
- "github.com/elastic/cloud-on-k8s/hack/licence-detector/dependency"
+ "github.com/elastic/go-licence-detector/dependency"
"github.com/stretchr/testify/require"
)
@@ -91,7 +104,7 @@
}
// create classifier
- classifier, err := NewClassifier("testdata/licence.db")
+ classifier, err := NewClassifier("")
require.NoError(t, err)
for _, tc := range testCases {
Only in ./detector: pkged.go
Only in ../gld/detector/testdata: licence.db
Only in .: example
Only in ../gld: generate-image-deps.sh
Only in ../gld: generate-notice.sh
Only in .: .github
diff '--exclude=.git' -r -u ../gld/.gitignore ./.gitignore
--- ../gld/.gitignore 2020-04-14 11:51:22.744018790 +0100
+++ ./.gitignore 2020-04-14 14:31:54.144250472 +0100
@@ -1,2 +1,3 @@
-notice.txt
-licence-detector
+go-licence-detector
+out/
+bin/
diff '--exclude=.git' -r -u ../gld/go.mod ./go.mod
--- ../gld/go.mod 2020-04-14 11:51:22.769018884 +0100
+++ ./go.mod 2020-04-14 13:10:00.833636843 +0100
@@ -1,4 +1,4 @@
-module github.com/elastic/cloud-on-k8s/hack/licence-detector
+module github.com/elastic/go-licence-detector
go 1.13
@@ -6,9 +6,9 @@
github.com/cyphar/filepath-securejoin v0.2.2
github.com/google/licenseclassifier v0.0.0-20200108231022-9dfa8d8474eb
github.com/karrick/godirwalk v1.10.12
+ github.com/markbates/pkger v0.15.1
github.com/pkg/errors v0.8.1 // indirect
github.com/sergi/go-diff v1.1.0 // indirect
github.com/stretchr/testify v1.4.0
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e
- gopkg.in/yaml.v2 v2.2.5 // indirect
)
diff '--exclude=.git' -r -u ../gld/go.sum ./go.sum
--- ../gld/go.sum 2020-04-14 11:51:22.769018884 +0100
+++ ./go.sum 2020-04-14 13:10:00.833636843 +0100
@@ -4,6 +4,8 @@
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/gobuffalo/here v0.6.0 h1:hYrd0a6gDmWxBM4TnrGw8mQg24iSVoIkHEk7FodQcBI=
+github.com/gobuffalo/here v0.6.0/go.mod h1:wAG085dHOYqUpf+Ap+WOdrPTp5IYcDAs/x7PLa8Y5fM=
github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
github.com/google/licenseclassifier v0.0.0-20200108231022-9dfa8d8474eb h1:/3Y/s7OuY55tCvoMktoMkIWaZFoMBhgOq4FEHQT+gR8=
github.com/google/licenseclassifier v0.0.0-20200108231022-9dfa8d8474eb/go.mod h1:qsqn2hxC+vURpyBRygGUuinTO42MFRLcsmQ/P8v94+M=
@@ -14,6 +16,8 @@
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
+github.com/markbates/pkger v0.15.1 h1:3MPelV53RnGSW07izx5xGxl4e/sdRD6zqseIk0rMASY=
+github.com/markbates/pkger v0.15.1/go.mod h1:0JoVlrol20BSywW79rN3kdFFsE5xYM+rSCQDXbLhiuI=
github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I=
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
@@ -30,11 +34,12 @@
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
+gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo=
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.4 h1:/eiJrUcujPVeJ3xlSWaiNi3uSVmDGBK1pDHUHAnao1I=
gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
-gopkg.in/yaml.v2 v2.2.5 h1:ymVxjfMaHvXD8RqPRmzHHsB3VvucivSkIAvJFDI5O3c=
-gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
+gopkg.in/yaml.v2 v2.2.7 h1:VUgggvou5XRW9mHwD/yXxIYSMtY0zoKQf/v226p2nyo=
+gopkg.in/yaml.v2 v2.2.7/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
Only in ../gld: licence.db
Only in .: LICENSE
diff '--exclude=.git' -r -u ../gld/main.go ./main.go
--- ../gld/main.go 2020-04-14 11:51:22.790018963 +0100
+++ ./main.go 2020-04-14 13:10:00.833636843 +0100
@@ -1,6 +1,19 @@
-// Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
-// or more contributor license agreements. Licensed under the Elastic License;
-// you may not use this file except in compliance with the Elastic License.
+// Licensed to Elasticsearch B.V. under one or more contributor
+// license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright
+// ownership. Elasticsearch B.V. licenses this file to you under
+// the Apache License, Version 2.0 (the "License"); you may
+// not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
package main
@@ -11,22 +24,22 @@
"log"
"os"
- "github.com/elastic/cloud-on-k8s/hack/licence-detector/dependency"
- "github.com/elastic/cloud-on-k8s/hack/licence-detector/detector"
- "github.com/elastic/cloud-on-k8s/hack/licence-detector/render"
- "github.com/elastic/cloud-on-k8s/hack/licence-detector/validate"
+ "github.com/elastic/go-licence-detector/dependency"
+ "github.com/elastic/go-licence-detector/detector"
+ "github.com/elastic/go-licence-detector/render"
+ "github.com/elastic/go-licence-detector/validate"
)
var (
- depsTemplateFlag = flag.String("depsTemplate", "templates/dependencies.asciidoc.tmpl", "Path to the dependency list template file")
- depsOutFlag = flag.String("depsOut", "dependencies.asciidoc", "Path to output the dependency list")
- inFlag = flag.String("in", "-", "Dependency list (output from go list -m -json all)")
- includeIndirectFlag = flag.Bool("includeIndirect", false, "Include indirect dependencies")
- licenceDataFlag = flag.String("licenceData", "licence.db", "Path to the licence database")
- noticeTemplateFlag = flag.String("noticeTemplate", "templates/NOTICE.txt.tmpl", "Path to the NOTICE template file")
- noticeOutFlag = flag.String("noticeOut", "NOTICE.txt", "Path to output the notice")
- overridesFlag = flag.String("overrides", "", "Path to the file containing override directives")
- validateFlag = flag.Bool("validate", false, "Validate results (slow)")
+ depsTemplateFlag = flag.String("depsTemplate", "example/templates/dependencies.asciidoc.tmpl", "Path to the dependency list template file.")
+ depsOutFlag = flag.String("depsOut", "", "Path to output the dependency list.")
+ inFlag = flag.String("in", "-", "Dependency list (output from go list -m -json all).")
+ includeIndirectFlag = flag.Bool("includeIndirect", false, "Include indirect dependencies.")
+ licenceDataFlag = flag.String("licenceData", "", "Path to the licence database. Uses embedded database if empty.")
+ noticeTemplateFlag = flag.String("noticeTemplate", "example/templates/NOTICE.txt.tmpl", "Path to the NOTICE template file.")
+ noticeOutFlag = flag.String("noticeOut", "", "Path to output the notice.")
+ overridesFlag = flag.String("overrides", "", "Path to the file containing override directives.")
+ validateFlag = flag.Bool("validate", false, "Validate results (slow).")
)
func main() {
@@ -62,12 +75,18 @@
}
}
- if err := render.Template(dependencies, *noticeTemplateFlag, *noticeOutFlag); err != nil {
- log.Fatalf("Failed to render notice: %v", err)
+ // only generate notice file if the output path is provided
+ if *noticeOutFlag != "" {
+ if err := render.Template(dependencies, *noticeTemplateFlag, *noticeOutFlag); err != nil {
+ log.Fatalf("Failed to render notice: %v", err)
+ }
}
- if err := render.Template(dependencies, *depsTemplateFlag, *depsOutFlag); err != nil {
- log.Fatalf("Failed to render dependency list: %v", err)
+ // only generate dependency listing if the output path is provided
+ if *depsOutFlag != "" {
+ if err := render.Template(dependencies, *depsTemplateFlag, *depsOutFlag); err != nil {
+ log.Fatalf("Failed to render dependency list: %v", err)
+ }
}
}
Only in .: Makefile
Only in .: NOTICE
Only in ../gld: overrides
diff '--exclude=.git' -r -u ../gld/README.md ./README.md
--- ../gld/README.md 2020-04-14 11:51:22.745018794 +0100
+++ ./README.md 2020-04-14 13:10:00.801636723 +0100
@@ -1,46 +1,40 @@
-Licence Detector
-================
+Go Licence Detector
+===================
-This directory contains the scripts to generate licence notice and dependency information documentation.
+Parses the output of `go list -m -json all` to produce a notice file and a dependency listing.
-- `generate-notice.sh`: Invoked by `make generate-notice-file` to automatically generate `NOTICE.txt` and `docs/dependencies.asciidoc`.
-- `generate-image-deps.sh`: Manually invoked script to update the container image dependency information in `docs/container-image-dependencies.csv`.
-
-
-generate-notice.sh
--------------------
-
-This script invokes the `licence-detector` application which parses the output of `go list -m -json all` to produce the notice and dependency list.
-
-### Usage
+## Usage
```
-licence-detector [FLAGS]
+go-licence-detector [FLAGS]
Flags:
-depsOut string
- Path to output the dependency list (default "dependencies.asciidoc")
+ Path to output the dependency list.
-depsTemplate string
- Path to the dependency list template file (default "templates/dependencies.asciidoc.tmpl")
+ Path to the dependency list template file. (default "example/templates/dependencies.asciidoc.tmpl")
-in string
- Dependency list (output from go list -m -json all) (default "-")
+ Dependency list (output from go list -m -json all). (default "-")
-includeIndirect
- Include indirect dependencies
+ Include indirect dependencies.
-licenceData string
- Path to the licence database (default "licence.db")
+ Path to the licence database. Uses embedded database if empty.
-noticeOut string
- Path to output the notice (default "NOTICE.txt")
+ Path to output the notice.
-noticeTemplate string
- Path to the NOTICE template file (default "templates/NOTICE.txt.tmpl")
+ Path to the NOTICE template file. (default "example/templates/NOTICE.txt.tmpl")
-overrides string
- Path to the file containing override directives
+ Path to the file containing override directives.
-validate
- Validate results (slow)
+ Validate results (slow).
+
+Example:
+ $ go list -m -json all | go-licence-detector -includeIndirect -depsOut=dependencies.asciidoc -noticeOut=NOTICE.txt
```
-### Adding Overrides
+## Adding Overrides
-In some cases, the licence-detector will not be able to detect the licence type or infer the correct URL for a dependency. When there are issues with licences (no licence file or unknown licence type), the application will fail with an error message instructing the user to add an override to continue. The overrides file is a file containing newline-delimited JSON where each line contains a JSON object bearing the following format:
+In some cases, the application will not be able to detect the licence type or infer the correct URL for a dependency. When there are issues with licences (no licence file or unknown licence type), the application will fail with an error message instructing the user to add an override to continue. The overrides file is a file containing newline-delimited JSON where each line contains a JSON object bearing the following format:
- `name`: Required. Module name to apply the override to.
- `licenceType`: Optional. Type of licence (Apache-2.0, ISC etc.). Provide a [SPDX](https://spdx.org/licenses/) identifier.
@@ -55,24 +49,6 @@
{"name": "github.com/russross/blackfriday/v2", "url": "https://gopkg.in/russross/blackfriday.v2"}
```
-Current overrides file can be found in the `overrides` directory. Follow the existing directory layout (`licences/<domain>/<pkg>/LICENCE`) when adding new licence text overrides.
-
-### Updating the licence database
+## Updating the licence database
The licence database file `licence.db` contains all the currently known licence types found in https://github.com/google/licenseclassifier/tree/master/licenses. In the rare case that entirely new licence types have been introduced to the codebase, follow the instructions at https://github.com/google/licenseclassifier to execute the `license_serializer` tool.
-
-
-generate-image-deps.sh
------------------------
-
-This script generates licence information for the contents of the ECK container base image. As the container base image is rarely ever changed and the tool used ([Tern](https://github.com/vmware/tern)) is slow to run, this script is not invoked automatically by the build process.
-
-To generate the dependency list (`docs/container-image-dependencies.csv`) for a particular image tag, invoke the script as follows:
-
-```shell
-IMAGE_TAG=1.0.1 ./generate-image-deps.sh
-```
-
-Note that Tern requires sudo access to mount the procfs file system and inspect the container layers. The script will prompt for the sudo password when needed.
-
-This script requires Docker, Python, and jq to be installed on the machine.
diff '--exclude=.git' -r -u ../gld/render/render.go ./render/render.go
--- ../gld/render/render.go 2020-04-14 11:51:22.790018963 +0100
+++ ./render/render.go 2020-04-14 13:10:00.833636843 +0100
@@ -1,6 +1,19 @@
-// Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
-// or more contributor license agreements. Licensed under the Elastic License;
-// you may not use this file except in compliance with the Elastic License.
+// Licensed to Elasticsearch B.V. under one or more contributor
+// license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright
+// ownership. Elasticsearch B.V. licenses this file to you under
+// the Apache License, Version 2.0 (the "License"); you may
+// not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
package render
@@ -17,7 +30,7 @@
"text/template"
"time"
- "github.com/elastic/cloud-on-k8s/hack/licence-detector/dependency"
+ "github.com/elastic/go-licence-detector/dependency"
)
var goModCache = filepath.Join(build.Default.GOPATH, "pkg", "mod")
Only in ../gld: templates
diff '--exclude=.git' -r -u ../gld/validate/validate.go ./validate/validate.go
--- ../gld/validate/validate.go 2020-04-14 11:51:22.791018966 +0100
+++ ./validate/validate.go 2020-04-14 13:10:00.833636843 +0100
@@ -1,6 +1,19 @@
-// Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
-// or more contributor license agreements. Licensed under the Elastic License;
-// you may not use this file except in compliance with the Elastic License.
+// Licensed to Elasticsearch B.V. under one or more contributor
+// license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright
+// ownership. Elasticsearch B.V. licenses this file to you under
+// the Apache License, Version 2.0 (the "License"); you may
+// not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
package validate
@@ -16,7 +29,7 @@
"sync/atomic"
"time"
- "github.com/elastic/cloud-on-k8s/hack/licence-detector/dependency"
+ "github.com/elastic/go-licence-detector/dependency"
"golang.org/x/sync/errgroup"
)
diff '--exclude=.git' -r -u ../gld/validate/validate_test.go ./validate/validate_test.go
--- ../gld/validate/validate_test.go 2020-04-14 11:51:22.791018966 +0100
+++ ./validate/validate_test.go 2020-04-14 13:10:00.833636843 +0100
@@ -1,6 +1,19 @@
-// Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
-// or more contributor license agreements. Licensed under the Elastic License;
-// you may not use this file except in compliance with the Elastic License.
+// Licensed to Elasticsearch B.V. under one or more contributor
+// license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright
+// ownership. Elasticsearch B.V. licenses this file to you under
+// the Apache License, Version 2.0 (the "License"); you may
+// not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
package validate
@@ -12,7 +25,7 @@
"net/http/httptest"
"testing"
- "github.com/elastic/cloud-on-k8s/hack/licence-detector/dependency"
+ "github.com/elastic/go-licence-detector/dependency"
"github.com/stretchr/testify/require"
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment