Skip to content

Commit

Permalink
Add licenses (#23)
Browse files Browse the repository at this point in the history
* adding license scripts

* adding license to missing files
  • Loading branch information
Charly Fontaine committed Sep 25, 2019
1 parent d9ee715 commit 1c6229a
Show file tree
Hide file tree
Showing 35 changed files with 694 additions and 7 deletions.
4 changes: 4 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// Unless explicitly stated otherwise all files in this repository are licensed
// under the Apache License Version 2.0.
// This product includes software developed at Datadog (https://www.datadoghq.com/).
// Copyright 2016-2019 Datadog, Inc.
479 changes: 479 additions & 0 deletions LICENSE-3rdparty.csv

Large diffs are not rendered by default.

11 changes: 10 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,15 @@ tidy:

build: ${ARTIFACT}

bin/wwhrd:
./hack/install-wwhrd.sh

license: bin/wwhrd
./hack/license.sh

verify-license:
./hack/verify-license.sh

${ARTIFACT}: ${SOURCES}
CGO_ENABLED=0 go build ${GOARGS} -i -installsuffix cgo ${LDFLAGS} -o ${ARTIFACT} ./cmd/manager/main.go

Expand Down Expand Up @@ -78,4 +87,4 @@ install-tools:
./hack/golangci-lint.sh v1.18.0
./hack/install-operator-sdk.sh

.PHONY: vendor build push clean test e2e validate local-load install-tools list
.PHONY: vendor build push clean test e2e validate local-load install-tools verify-license list
5 changes: 5 additions & 0 deletions cmd/manager/main.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
// Unless explicitly stated otherwise all files in this repository are licensed
// under the Apache License Version 2.0.
// This product includes software developed at Datadog (https://www.datadoghq.com/).
// Copyright 2016-2019 Datadog, Inc.

package main

import (
Expand Down
6 changes: 0 additions & 6 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,12 @@ module github.com/DataDog/watermarkpodautoscaler
require (
github.com/Azure/go-autorest/autorest v0.9.1 // indirect
github.com/Azure/go-autorest/autorest/adal v0.6.0 // indirect
github.com/NYTimes/gziphandler v1.0.1 // indirect
github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f // indirect
github.com/go-logr/logr v0.1.0
github.com/gorilla/websocket v1.4.0 // indirect
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 // indirect
github.com/jonboulle/clockwork v0.1.0 // indirect
github.com/magiconair/properties v1.8.0

github.com/operator-framework/operator-sdk v0.8.2-0.20190522220659-031d71ef8154
github.com/prometheus/client_golang v0.9.3
github.com/prometheus/common v0.4.0
github.com/soheilhy/cmux v0.1.4 // indirect
github.com/spf13/pflag v1.0.3
github.com/stretchr/testify v1.3.0
k8s.io/api v0.0.0-20190831074750-7364b6bdad65
Expand Down
20 changes: 20 additions & 0 deletions hack/install-wwhrd.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/usr/bin/env bash
set -e

set -o errexit
set -o nounset
set -o pipefail

ROOT=$(git rev-parse --show-toplevel)
WORK_DIR=`mktemp -d`
cleanup() {
rm -rf "$WORK_DIR"
}
trap "cleanup" EXIT SIGINT

export GOPATH=$WORK_DIR
export GO111MODULE="off"
go get github.com/frapposelli/wwhrd

mkdir -p $ROOT/bin
mv $GOPATH/bin/wwhrd $ROOT/bin/wwhrd
14 changes: 14 additions & 0 deletions hack/license.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/usr/bin/env bash

set -exo pipefail

export LC_ALL=C

cd $(dirname $0)/..

wwhrd list

echo Component,Origin,License > LICENSE-3rdparty.csv
echo 'core,"github.com/frapposelli/wwhrd",MIT' >> LICENSE-3rdparty.csv

wwhrd list |& grep "Found License" | awk '{print $5,$4}' | sed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[mGK]//g" | sed s/" license="/,/ | sed s/package=/core,/ | sort >> LICENSE-3rdparty.csv
27 changes: 27 additions & 0 deletions hack/verify-license.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/bin/bash

set -o errexit
set -o nounset
set -o pipefail
set -e

cd $(dirname $0)/..

make license

DIFF=$(git --no-pager diff LICENSE-3rdparty.csv)
if [[ "${DIFF}x" != "x" ]]
then
echo "License outdated:" >&2
git --no-pager diff LICENSE-3rdparty.csv >&2
exit 2
fi

DIFF=$(git ls-files docs/ --exclude-standard --others)
if [[ "${DIFF}x" != "x" ]]
then
echo "License removed:" >&2
echo ${DIFF} >&2
exit 2
fi
exit 0
5 changes: 5 additions & 0 deletions pkg/apis/addtoscheme_datadoghq_v1alpha1.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
// Unless explicitly stated otherwise all files in this repository are licensed
// under the Apache License Version 2.0.
// This product includes software developed at Datadog (https://www.datadoghq.com/).
// Copyright 2016-2019 Datadog, Inc.

package apis

import (
Expand Down
5 changes: 5 additions & 0 deletions pkg/apis/apis.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
// Unless explicitly stated otherwise all files in this repository are licensed
// under the Apache License Version 2.0.
// This product includes software developed at Datadog (https://www.datadoghq.com/).
// Copyright 2016-2019 Datadog, Inc.

package apis

import (
Expand Down
5 changes: 5 additions & 0 deletions pkg/apis/datadoghq/register.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
// Unless explicitly stated otherwise all files in this repository are licensed
// under the Apache License Version 2.0.
// This product includes software developed at Datadog (https://www.datadoghq.com/).
// Copyright 2016-2019 Datadog, Inc.

package datadoghq

// GroupName is the group name used in this package
Expand Down
5 changes: 5 additions & 0 deletions pkg/apis/datadoghq/v1alpha1/const.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
// Unless explicitly stated otherwise all files in this repository are licensed
// under the Apache License Version 2.0.
// This product includes software developed at Datadog (https://www.datadoghq.com/).
// Copyright 2016-2019 Datadog, Inc.

package v1alpha1

const (
Expand Down
5 changes: 5 additions & 0 deletions pkg/apis/datadoghq/v1alpha1/doc.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
// Unless explicitly stated otherwise all files in this repository are licensed
// under the Apache License Version 2.0.
// This product includes software developed at Datadog (https://www.datadoghq.com/).
// Copyright 2016-2019 Datadog, Inc.

// Package v1alpha1 contains API Schema definitions for the datadoghq v1alpha1 API group
// +k8s:deepcopy-gen=package,register
// +groupName=datadoghq.com
Expand Down
5 changes: 5 additions & 0 deletions pkg/apis/datadoghq/v1alpha1/new.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
// Unless explicitly stated otherwise all files in this repository are licensed
// under the Apache License Version 2.0.
// This product includes software developed at Datadog (https://www.datadoghq.com/).
// Copyright 2016-2019 Datadog, Inc.

package v1alpha1

// NewInt32 return a pointer to an int32.
Expand Down
5 changes: 5 additions & 0 deletions pkg/apis/datadoghq/v1alpha1/register.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
// Unless explicitly stated otherwise all files in this repository are licensed
// under the Apache License Version 2.0.
// This product includes software developed at Datadog (https://www.datadoghq.com/).
// Copyright 2016-2019 Datadog, Inc.

// Package v1alpha1 contains API Schema definitions for the datadoghq v1alpha1 API group
// +k8s:deepcopy-gen=package,register
// +groupName=datadoghq.com
Expand Down
5 changes: 5 additions & 0 deletions pkg/apis/datadoghq/v1alpha1/test/new.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
// Unless explicitly stated otherwise all files in this repository are licensed
// under the Apache License Version 2.0.
// This product includes software developed at Datadog (https://www.datadoghq.com/).
// Copyright 2016-2019 Datadog, Inc.

package test

import (
Expand Down
5 changes: 5 additions & 0 deletions pkg/apis/datadoghq/v1alpha1/watermarkpodautoscaler_default.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
// Unless explicitly stated otherwise all files in this repository are licensed
// under the Apache License Version 2.0.
// This product includes software developed at Datadog (https://www.datadoghq.com/).
// Copyright 2016-2019 Datadog, Inc.

package v1alpha1

import "fmt"
Expand Down
5 changes: 5 additions & 0 deletions pkg/apis/datadoghq/v1alpha1/watermarkpodautoscaler_types.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
// Unless explicitly stated otherwise all files in this repository are licensed
// under the Apache License Version 2.0.
// This product includes software developed at Datadog (https://www.datadoghq.com/).
// Copyright 2016-2019 Datadog, Inc.

package v1alpha1

import (
Expand Down
5 changes: 5 additions & 0 deletions pkg/controller/add_watermarkpodautoscaler.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
// Unless explicitly stated otherwise all files in this repository are licensed
// under the Apache License Version 2.0.
// This product includes software developed at Datadog (https://www.datadoghq.com/).
// Copyright 2016-2019 Datadog, Inc.

package controller

import (
Expand Down
5 changes: 5 additions & 0 deletions pkg/controller/controller.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
// Unless explicitly stated otherwise all files in this repository are licensed
// under the Apache License Version 2.0.
// This product includes software developed at Datadog (https://www.datadoghq.com/).
// Copyright 2016-2019 Datadog, Inc.

package controller

import (
Expand Down
5 changes: 5 additions & 0 deletions pkg/controller/watermarkpodautoscaler/replica_calculator.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
// Unless explicitly stated otherwise all files in this repository are licensed
// under the Apache License Version 2.0.
// This product includes software developed at Datadog (https://www.datadoghq.com/).
// Copyright 2016-2019 Datadog, Inc.

package watermarkpodautoscaler

import (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
// Unless explicitly stated otherwise all files in this repository are licensed
// under the Apache License Version 2.0.
// This product includes software developed at Datadog (https://www.datadoghq.com/).
// Copyright 2016-2019 Datadog, Inc.

package watermarkpodautoscaler

import (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
// Unless explicitly stated otherwise all files in this repository are licensed
// under the Apache License Version 2.0.
// This product includes software developed at Datadog (https://www.datadoghq.com/).
// Copyright 2016-2019 Datadog, Inc.

package watermarkpodautoscaler

import (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
// Unless explicitly stated otherwise all files in this repository are licensed
// under the Apache License Version 2.0.
// This product includes software developed at Datadog (https://www.datadoghq.com/).
// Copyright 2016-2019 Datadog, Inc.

package watermarkpodautoscaler

import (
Expand Down
5 changes: 5 additions & 0 deletions pkg/util/fake_metrics.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
// Unless explicitly stated otherwise all files in this repository are licensed
// under the Apache License Version 2.0.
// This product includes software developed at Datadog (https://www.datadoghq.com/).
// Copyright 2016-2019 Datadog, Inc.

package util

import "encoding/json"
Expand Down
5 changes: 5 additions & 0 deletions pkg/util/fake_metrics_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
// Unless explicitly stated otherwise all files in this repository are licensed
// under the Apache License Version 2.0.
// This product includes software developed at Datadog (https://www.datadoghq.com/).
// Copyright 2016-2019 Datadog, Inc.

package util

import "testing"
Expand Down
5 changes: 5 additions & 0 deletions test/e2e/common.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
// Unless explicitly stated otherwise all files in this repository are licensed
// under the Apache License Version 2.0.
// This product includes software developed at Datadog (https://www.datadoghq.com/).
// Copyright 2016-2019 Datadog, Inc.

package e2e

import (
Expand Down
5 changes: 5 additions & 0 deletions test/e2e/main_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
// Unless explicitly stated otherwise all files in this repository are licensed
// under the Apache License Version 2.0.
// This product includes software developed at Datadog (https://www.datadoghq.com/).
// Copyright 2016-2019 Datadog, Inc.

package e2e

import (
Expand Down
5 changes: 5 additions & 0 deletions test/e2e/metricsserver/metricsserver.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
// Unless explicitly stated otherwise all files in this repository are licensed
// under the Apache License Version 2.0.
// This product includes software developed at Datadog (https://www.datadoghq.com/).
// Copyright 2016-2019 Datadog, Inc.

package metricsserver

import (
Expand Down
5 changes: 5 additions & 0 deletions test/e2e/utils/clusterrole.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
// Unless explicitly stated otherwise all files in this repository are licensed
// under the Apache License Version 2.0.
// This product includes software developed at Datadog (https://www.datadoghq.com/).
// Copyright 2016-2019 Datadog, Inc.

package utils

import (
Expand Down
5 changes: 5 additions & 0 deletions test/e2e/utils/fakeapp.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
// Unless explicitly stated otherwise all files in this repository are licensed
// under the Apache License Version 2.0.
// This product includes software developed at Datadog (https://www.datadoghq.com/).
// Copyright 2016-2019 Datadog, Inc.

package utils

import (
Expand Down
5 changes: 5 additions & 0 deletions test/e2e/utils/fakehpa.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
// Unless explicitly stated otherwise all files in this repository are licensed
// under the Apache License Version 2.0.
// This product includes software developed at Datadog (https://www.datadoghq.com/).
// Copyright 2016-2019 Datadog, Inc.

package utils

import (
Expand Down
5 changes: 5 additions & 0 deletions test/e2e/utils/wait.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
// Unless explicitly stated otherwise all files in this repository are licensed
// under the Apache License Version 2.0.
// This product includes software developed at Datadog (https://www.datadoghq.com/).
// Copyright 2016-2019 Datadog, Inc.

package utils

import (
Expand Down
5 changes: 5 additions & 0 deletions test/e2e/wpa_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
// Unless explicitly stated otherwise all files in this repository are licensed
// under the Apache License Version 2.0.
// This product includes software developed at Datadog (https://www.datadoghq.com/).
// Copyright 2016-2019 Datadog, Inc.

package e2e

import (
Expand Down
5 changes: 5 additions & 0 deletions version/version.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
// Unless explicitly stated otherwise all files in this repository are licensed
// under the Apache License Version 2.0.
// This product includes software developed at Datadog (https://www.datadoghq.com/).
// Copyright 2016-2019 Datadog, Inc.

package version

import (
Expand Down

0 comments on commit 1c6229a

Please sign in to comment.