Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mw/add make copyright #3614

Merged
merged 3 commits into from
Feb 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
18 changes: 18 additions & 0 deletions .copywrite.hcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
schema_version = 1

project {
license = "MPL-2.0"
copyright_year = 2018

# (OPTIONAL) A list of globs that should not have copyright/license headers.
# Supports doublestar glob patterns for more flexibility in defining which
# files or folders should be ignored
header_ignore = [

# ignoring charts templates as adding copyright headers breaks all tests
"charts/consul/templates/**",
# we don't own these and the tool that adds copyright headers breaks them
"control-plane/config/crd/external/**",

]
}
3 changes: 3 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0

blank_issues_enabled: false
contact_links:
- name: Consul Community Support
Expand Down
3 changes: 3 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0

linters:
# enables all defaults + the below, `golangci-lint linters` to see the list of active linters.
enable:
Expand Down
3 changes: 3 additions & 0 deletions .release/ci.hcl
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0

schema = "1"

project "consul-k8s" {
Expand Down
3 changes: 3 additions & 0 deletions .release/release-metadata.hcl
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0

url_docker_registry_dockerhub = "https://hub.docker.com/r/hashicorp/consul-k8s-control-plane"
url_license = "https://github.com/hashicorp/consul-k8s/blob/main/LICENSE"
url_project_website = "https://www.consul.io/docs/k8s"
Expand Down
3 changes: 3 additions & 0 deletions .release/security-scan.hcl
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0

container {
dependencies = true
alpine_secdb = true
Expand Down
9 changes: 9 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ lint: cni-plugin-lint ## Run linter in the control-plane, cli, and acceptance di
ctrl-manifests: get-controller-gen ## Generate CRD manifests.
cd control-plane; $(CONTROLLER_GEN) $(CRD_OPTIONS) rbac:roleName=manager-role webhook paths="./..." output:crd:artifacts:config=config/crd/bases
make copy-crds-to-chart
make add-copyright-header

.PHONY: get-controller-gen
get-controller-gen: ## Download controller-gen program needed for operator SDK.
Expand All @@ -192,6 +193,14 @@ else
CONTROLLER_GEN=$(shell which controller-gen)
endif

.PHONY: add-copyright-header
add-copyright-header: ## Add copyright header to all files in the project
ifeq (, $(shell which copywrite))
@echo "Installing copywrite"
@go install github.com/hashicorp/copywrite@latest
endif
@copywrite headers --spdx "MPL-2.0"

##@ CI Targets

.PHONY: ci.aws-acceptance-test-cleanup
Expand Down
3 changes: 3 additions & 0 deletions acceptance/framework/cli/cli.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0

package cli

import (
Expand Down
3 changes: 3 additions & 0 deletions acceptance/framework/config/config.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0

package config

import (
Expand Down
3 changes: 3 additions & 0 deletions acceptance/framework/config/config_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0

package config

import (
Expand Down
3 changes: 3 additions & 0 deletions acceptance/framework/consul/cli_cluster.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0

package consul

import (
Expand Down
3 changes: 3 additions & 0 deletions acceptance/framework/consul/cluster.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0

package consul

import (
Expand Down
3 changes: 3 additions & 0 deletions acceptance/framework/consul/helm_cluster.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0

package consul

import (
Expand Down
3 changes: 3 additions & 0 deletions acceptance/framework/consul/helm_cluster_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0

package consul

import (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0

# This section includes base Calico installation configuration.
# For more information, see: https://projectcalico.docs.tigera.io/master/reference/installation/api#operator.tigera.io/v1.Installation
apiVersion: operator.tigera.io/v1
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0

apiVersion: v1
kind: Namespace
metadata:
Expand Down
3 changes: 3 additions & 0 deletions acceptance/framework/environment/environment.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0

package environment

import (
Expand Down
3 changes: 3 additions & 0 deletions acceptance/framework/flags/flags_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0

package flags

import (
Expand Down
3 changes: 3 additions & 0 deletions acceptance/framework/helpers/helpers.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0

package helpers

import (
Expand Down
3 changes: 3 additions & 0 deletions acceptance/framework/helpers/helpers_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0

package helpers

import (
Expand Down
3 changes: 3 additions & 0 deletions acceptance/framework/k8s/debug.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0

package k8s

import (
Expand Down
3 changes: 3 additions & 0 deletions acceptance/framework/k8s/deploy.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0

package k8s

import (
Expand Down
3 changes: 3 additions & 0 deletions acceptance/framework/k8s/helpers.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0

package k8s

import (
Expand Down
3 changes: 3 additions & 0 deletions acceptance/framework/k8s/kubectl.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0

package k8s

import (
Expand Down
3 changes: 3 additions & 0 deletions acceptance/framework/logger/logger.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0

package logger

import (
Expand Down
3 changes: 3 additions & 0 deletions acceptance/framework/portforward/port_forward.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0

package portforward

import (
Expand Down
3 changes: 3 additions & 0 deletions acceptance/framework/suite/suite.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0

package suite

import (
Expand Down
3 changes: 3 additions & 0 deletions acceptance/framework/vault/helpers.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0

package vault

import (
Expand Down
3 changes: 3 additions & 0 deletions acceptance/framework/vault/vault_cluster.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0

package vault

import (
Expand Down
3 changes: 3 additions & 0 deletions acceptance/tests/basic/basic_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0

package basic

import (
Expand Down
3 changes: 3 additions & 0 deletions acceptance/tests/basic/main_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0

package basic

import (
Expand Down
3 changes: 3 additions & 0 deletions acceptance/tests/cli/cli_install_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0

package cli

import (
Expand Down
3 changes: 3 additions & 0 deletions acceptance/tests/cli/cli_upgrade_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0

package cli

import (
Expand Down
3 changes: 3 additions & 0 deletions acceptance/tests/cli/main_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0

package cli

import (
Expand Down
3 changes: 3 additions & 0 deletions acceptance/tests/cloud/fakeserver_client.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0

package cloud

import (
Expand Down
3 changes: 3 additions & 0 deletions acceptance/tests/cloud/metrics_validation.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0

package cloud

import (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0

package config_entries

import (
Expand Down
3 changes: 3 additions & 0 deletions acceptance/tests/config-entries/config_entries_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0

package config_entries

import (
Expand Down
3 changes: 3 additions & 0 deletions acceptance/tests/config-entries/main_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0

package config_entries

import (
Expand Down
3 changes: 3 additions & 0 deletions acceptance/tests/connect/connect_external_servers_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0

package connect

import (
Expand Down
3 changes: 3 additions & 0 deletions acceptance/tests/connect/connect_inject_namespaces_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0

package connect

import (
Expand Down
3 changes: 3 additions & 0 deletions acceptance/tests/connect/connect_inject_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0

package connect

import (
Expand Down
3 changes: 3 additions & 0 deletions acceptance/tests/connect/main_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0

package connect

import (
Expand Down
3 changes: 3 additions & 0 deletions acceptance/tests/consul-dns/consul_dns_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0

package consuldns

import (
Expand Down
3 changes: 3 additions & 0 deletions acceptance/tests/consul-dns/main_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0

package consuldns

import (
Expand Down
3 changes: 3 additions & 0 deletions acceptance/tests/example/example_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0

// Rename package to your test package.
package example

Expand Down
3 changes: 3 additions & 0 deletions acceptance/tests/example/main_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0

// Rename package to your test package.
package example

Expand Down
3 changes: 3 additions & 0 deletions acceptance/tests/fixtures/bases/crds-oss/ingressgateway.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0

apiVersion: consul.hashicorp.com/v1alpha1
kind: IngressGateway
metadata:
Expand Down
3 changes: 3 additions & 0 deletions acceptance/tests/fixtures/bases/crds-oss/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0

resources:
- ingressgateway.yaml
- mesh.yaml
Expand Down
3 changes: 3 additions & 0 deletions acceptance/tests/fixtures/bases/crds-oss/mesh.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0

apiVersion: consul.hashicorp.com/v1alpha1
kind: Mesh
metadata:
Expand Down
3 changes: 3 additions & 0 deletions acceptance/tests/fixtures/bases/crds-oss/proxydefaults.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0

apiVersion: consul.hashicorp.com/v1alpha1
kind: ProxyDefaults
metadata:
Expand Down
3 changes: 3 additions & 0 deletions acceptance/tests/fixtures/bases/crds-oss/servicedefaults.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0

apiVersion: consul.hashicorp.com/v1alpha1
kind: ServiceDefaults
metadata:
Expand Down
3 changes: 3 additions & 0 deletions acceptance/tests/fixtures/bases/crds-oss/serviceexports.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0

apiVersion: consul.hashicorp.com/v1alpha1
kind: ServiceExports
metadata:
Expand Down
Loading
Loading