diff --git a/.copywrite.hcl b/.copywrite.hcl new file mode 100644 index 00000000..20a87216 --- /dev/null +++ b/.copywrite.hcl @@ -0,0 +1,13 @@ +schema_version = 1 + +project { + license = "MPL-2.0" + copyright_year = 2022 + header_ignore = [ + ".github/**", + # All files within the config directory are generated automatically by the operator-sdk CLI tool + # Some files were scaffolded during the first run of the operator-sdk CLI tool and never changed + # The dev team is not working with these files they all serve a supporting role + "config/**", + ] +} diff --git a/.github/workflows/hc-copywrite.yml b/.github/workflows/hc-copywrite.yml new file mode 100644 index 00000000..9da05eb6 --- /dev/null +++ b/.github/workflows/hc-copywrite.yml @@ -0,0 +1,25 @@ +name: "HashiCorp Copywrite" + +on: + schedule: + - cron: '30 2 * * *' + pull_request: + branches: + - main + push: + branches: + - main + workflow_dispatch: + +jobs: + copywrite: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 + + - name: Install copywrite + uses: hashicorp/setup-copywrite@3ace06ad72e6ec679ea8572457b17dbc3960b8ce # v1.0.0 + + - name: Validate Header Compliance + run: copywrite headers --plan diff --git a/.github/workflows/pr-labeler.yml b/.github/workflows/pr-labeler.yml index 89377076..fcbd3824 100644 --- a/.github/workflows/pr-labeler.yml +++ b/.github/workflows/pr-labeler.yml @@ -1,4 +1,5 @@ name: "PR Labeler" + on: pull_request_target: branches: diff --git a/Dockerfile b/Dockerfile index 8f9cca18..3b1f1456 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,3 +1,6 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + # Build the manager binary FROM golang:1.19 as builder ARG TARGETOS diff --git a/api/v1alpha2/agentpool_helpers.go b/api/v1alpha2/agentpool_helpers.go index 484c946b..de7d3ecb 100644 --- a/api/v1alpha2/agentpool_helpers.go +++ b/api/v1alpha2/agentpool_helpers.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package v1alpha2 import ( diff --git a/api/v1alpha2/agentpool_types.go b/api/v1alpha2/agentpool_types.go index ca6d725a..1b05bbfc 100644 --- a/api/v1alpha2/agentpool_types.go +++ b/api/v1alpha2/agentpool_types.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package v1alpha2 import ( diff --git a/api/v1alpha2/groupversion_info.go b/api/v1alpha2/groupversion_info.go index b52f9d82..cb98fe49 100644 --- a/api/v1alpha2/groupversion_info.go +++ b/api/v1alpha2/groupversion_info.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + // Package v1alpha2 contains API Schema definitions for the app v1alpha2 API group // +kubebuilder:object:generate=true // +groupName=app.terraform.io diff --git a/api/v1alpha2/module_helpers.go b/api/v1alpha2/module_helpers.go index dec973b5..9ba0cf5c 100644 --- a/api/v1alpha2/module_helpers.go +++ b/api/v1alpha2/module_helpers.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package v1alpha2 import ( diff --git a/api/v1alpha2/module_types.go b/api/v1alpha2/module_types.go index 509f794d..98b79321 100644 --- a/api/v1alpha2/module_types.go +++ b/api/v1alpha2/module_types.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package v1alpha2 import ( diff --git a/api/v1alpha2/workspace_helpers.go b/api/v1alpha2/workspace_helpers.go index f3c97414..0679845d 100644 --- a/api/v1alpha2/workspace_helpers.go +++ b/api/v1alpha2/workspace_helpers.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package v1alpha2 import ( diff --git a/api/v1alpha2/workspace_types.go b/api/v1alpha2/workspace_types.go index 14980e82..8d1619e8 100644 --- a/api/v1alpha2/workspace_types.go +++ b/api/v1alpha2/workspace_types.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package v1alpha2 import ( diff --git a/charts/terraform-cloud-operator/Chart.yaml b/charts/terraform-cloud-operator/Chart.yaml index 923b6a6e..9b5cf2a8 100644 --- a/charts/terraform-cloud-operator/Chart.yaml +++ b/charts/terraform-cloud-operator/Chart.yaml @@ -1,3 +1,6 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + apiVersion: v2 name: terraform-cloud-operator description: A Helm chart for HashiCorp Terraform Cloud Kubernetes Operator. diff --git a/charts/terraform-cloud-operator/crds/app.terraform.io_agentpools.yaml b/charts/terraform-cloud-operator/crds/app.terraform.io_agentpools.yaml index 337a37d2..d570007f 100644 --- a/charts/terraform-cloud-operator/crds/app.terraform.io_agentpools.yaml +++ b/charts/terraform-cloud-operator/crds/app.terraform.io_agentpools.yaml @@ -1,3 +1,6 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + --- apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition diff --git a/charts/terraform-cloud-operator/crds/app.terraform.io_modules.yaml b/charts/terraform-cloud-operator/crds/app.terraform.io_modules.yaml index 9d095ed0..fb9a3e81 100644 --- a/charts/terraform-cloud-operator/crds/app.terraform.io_modules.yaml +++ b/charts/terraform-cloud-operator/crds/app.terraform.io_modules.yaml @@ -1,3 +1,6 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + --- apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition diff --git a/charts/terraform-cloud-operator/crds/app.terraform.io_workspaces.yaml b/charts/terraform-cloud-operator/crds/app.terraform.io_workspaces.yaml index f3a77045..bb179e1c 100644 --- a/charts/terraform-cloud-operator/crds/app.terraform.io_workspaces.yaml +++ b/charts/terraform-cloud-operator/crds/app.terraform.io_workspaces.yaml @@ -1,3 +1,6 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + --- apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition diff --git a/charts/terraform-cloud-operator/templates/clusterrole.yaml b/charts/terraform-cloud-operator/templates/clusterrole.yaml index b2ec9b22..4c428557 100644 --- a/charts/terraform-cloud-operator/templates/clusterrole.yaml +++ b/charts/terraform-cloud-operator/templates/clusterrole.yaml @@ -1,3 +1,6 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: diff --git a/charts/terraform-cloud-operator/templates/clusterrolebinding.yaml b/charts/terraform-cloud-operator/templates/clusterrolebinding.yaml index 6e54a428..84c4ff00 100644 --- a/charts/terraform-cloud-operator/templates/clusterrolebinding.yaml +++ b/charts/terraform-cloud-operator/templates/clusterrolebinding.yaml @@ -1,3 +1,6 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: diff --git a/charts/terraform-cloud-operator/templates/configmap.yaml b/charts/terraform-cloud-operator/templates/configmap.yaml index 19b14bad..1e9e2f4e 100644 --- a/charts/terraform-cloud-operator/templates/configmap.yaml +++ b/charts/terraform-cloud-operator/templates/configmap.yaml @@ -1,3 +1,6 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + apiVersion: v1 data: controller_manager_config.yaml: | diff --git a/charts/terraform-cloud-operator/templates/deployment.yaml b/charts/terraform-cloud-operator/templates/deployment.yaml index 9956493b..cd8f2cd4 100644 --- a/charts/terraform-cloud-operator/templates/deployment.yaml +++ b/charts/terraform-cloud-operator/templates/deployment.yaml @@ -1,3 +1,6 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + apiVersion: apps/v1 kind: Deployment metadata: diff --git a/charts/terraform-cloud-operator/templates/role.yaml b/charts/terraform-cloud-operator/templates/role.yaml index 67a85721..f36f3151 100644 --- a/charts/terraform-cloud-operator/templates/role.yaml +++ b/charts/terraform-cloud-operator/templates/role.yaml @@ -1,3 +1,6 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + apiVersion: rbac.authorization.k8s.io/v1 kind: Role metadata: diff --git a/charts/terraform-cloud-operator/templates/rolebinding.yaml b/charts/terraform-cloud-operator/templates/rolebinding.yaml index d9d77338..391c5221 100644 --- a/charts/terraform-cloud-operator/templates/rolebinding.yaml +++ b/charts/terraform-cloud-operator/templates/rolebinding.yaml @@ -1,3 +1,6 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + apiVersion: rbac.authorization.k8s.io/v1 kind: RoleBinding metadata: diff --git a/charts/terraform-cloud-operator/templates/service.yaml b/charts/terraform-cloud-operator/templates/service.yaml index b9e5ca5e..470b5005 100644 --- a/charts/terraform-cloud-operator/templates/service.yaml +++ b/charts/terraform-cloud-operator/templates/service.yaml @@ -1,3 +1,6 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + apiVersion: v1 kind: Service metadata: diff --git a/charts/terraform-cloud-operator/templates/serviceaccount.yaml b/charts/terraform-cloud-operator/templates/serviceaccount.yaml index 9221d90a..369124e2 100644 --- a/charts/terraform-cloud-operator/templates/serviceaccount.yaml +++ b/charts/terraform-cloud-operator/templates/serviceaccount.yaml @@ -1,3 +1,6 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + apiVersion: v1 kind: ServiceAccount metadata: diff --git a/charts/terraform-cloud-operator/values.yaml b/charts/terraform-cloud-operator/values.yaml index 7f819ecf..ff90afa9 100644 --- a/charts/terraform-cloud-operator/values.yaml +++ b/charts/terraform-cloud-operator/values.yaml @@ -1,3 +1,6 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + replicaCount: 2 operator: diff --git a/controllers/agentpool_controller.go b/controllers/agentpool_controller.go index 9bb0d148..9740802a 100644 --- a/controllers/agentpool_controller.go +++ b/controllers/agentpool_controller.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package controllers import ( diff --git a/controllers/agentpool_controller_test.go b/controllers/agentpool_controller_test.go index 42703e50..0b194602 100644 --- a/controllers/agentpool_controller_test.go +++ b/controllers/agentpool_controller_test.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package controllers import ( diff --git a/controllers/agentpool_controller_tokens.go b/controllers/agentpool_controller_tokens.go index 3657d333..9a1a2ff3 100644 --- a/controllers/agentpool_controller_tokens.go +++ b/controllers/agentpool_controller_tokens.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package controllers import ( diff --git a/controllers/consts.go b/controllers/consts.go index eda13d96..e4c8a49b 100644 --- a/controllers/consts.go +++ b/controllers/consts.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package controllers import "time" diff --git a/controllers/helpers.go b/controllers/helpers.go index d7a1aef6..771754cc 100644 --- a/controllers/helpers.go +++ b/controllers/helpers.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package controllers import ( diff --git a/controllers/helpers_test.go b/controllers/helpers_test.go index 056a8437..85fd202a 100644 --- a/controllers/helpers_test.go +++ b/controllers/helpers_test.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package controllers import ( diff --git a/controllers/module_controller.go b/controllers/module_controller.go index 6fb49a35..b5c30652 100644 --- a/controllers/module_controller.go +++ b/controllers/module_controller.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package controllers import ( diff --git a/controllers/module_controller_outputs.go b/controllers/module_controller_outputs.go index d0082f9a..665d7b9e 100644 --- a/controllers/module_controller_outputs.go +++ b/controllers/module_controller_outputs.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package controllers import ( diff --git a/controllers/module_controller_test.go b/controllers/module_controller_test.go index 1ad28df1..a656b7b2 100644 --- a/controllers/module_controller_test.go +++ b/controllers/module_controller_test.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package controllers import ( diff --git a/controllers/module_controller_workspace.go b/controllers/module_controller_workspace.go index 182d2a62..863f4915 100644 --- a/controllers/module_controller_workspace.go +++ b/controllers/module_controller_workspace.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package controllers import ( diff --git a/controllers/suite_test.go b/controllers/suite_test.go index d6000ec7..287b3eee 100644 --- a/controllers/suite_test.go +++ b/controllers/suite_test.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package controllers import ( diff --git a/controllers/workspace_controller.go b/controllers/workspace_controller.go index 8d555af7..6cd38446 100644 --- a/controllers/workspace_controller.go +++ b/controllers/workspace_controller.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package controllers import ( diff --git a/controllers/workspace_controller_agents.go b/controllers/workspace_controller_agents.go index 13030577..c865b45a 100644 --- a/controllers/workspace_controller_agents.go +++ b/controllers/workspace_controller_agents.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package controllers import ( diff --git a/controllers/workspace_controller_agents_test.go b/controllers/workspace_controller_agents_test.go index 02ea33b5..7091dd53 100644 --- a/controllers/workspace_controller_agents_test.go +++ b/controllers/workspace_controller_agents_test.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package controllers import ( diff --git a/controllers/workspace_controller_outputs.go b/controllers/workspace_controller_outputs.go index f7205ffe..e4fa6050 100644 --- a/controllers/workspace_controller_outputs.go +++ b/controllers/workspace_controller_outputs.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package controllers import ( diff --git a/controllers/workspace_controller_outputs_test.go b/controllers/workspace_controller_outputs_test.go index 4e8dd81b..4d7d7a92 100644 --- a/controllers/workspace_controller_outputs_test.go +++ b/controllers/workspace_controller_outputs_test.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package controllers import ( diff --git a/controllers/workspace_controller_remote_state_sharing.go b/controllers/workspace_controller_remote_state_sharing.go index 1f803272..694fd218 100644 --- a/controllers/workspace_controller_remote_state_sharing.go +++ b/controllers/workspace_controller_remote_state_sharing.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package controllers import ( diff --git a/controllers/workspace_controller_remote_state_sharing_test.go b/controllers/workspace_controller_remote_state_sharing_test.go index f537ec84..0c345a32 100644 --- a/controllers/workspace_controller_remote_state_sharing_test.go +++ b/controllers/workspace_controller_remote_state_sharing_test.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package controllers import ( diff --git a/controllers/workspace_controller_run_triggers.go b/controllers/workspace_controller_run_triggers.go index 7e1d4cd6..c88968ef 100644 --- a/controllers/workspace_controller_run_triggers.go +++ b/controllers/workspace_controller_run_triggers.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package controllers import ( diff --git a/controllers/workspace_controller_run_triggers_test.go b/controllers/workspace_controller_run_triggers_test.go index ca55bb4b..8f1c2a26 100644 --- a/controllers/workspace_controller_run_triggers_test.go +++ b/controllers/workspace_controller_run_triggers_test.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package controllers import ( diff --git a/controllers/workspace_controller_sshkey.go b/controllers/workspace_controller_sshkey.go index 3c20809c..75bde06b 100644 --- a/controllers/workspace_controller_sshkey.go +++ b/controllers/workspace_controller_sshkey.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package controllers import ( diff --git a/controllers/workspace_controller_sshkey_test.go b/controllers/workspace_controller_sshkey_test.go index 68480375..cdff32ca 100644 --- a/controllers/workspace_controller_sshkey_test.go +++ b/controllers/workspace_controller_sshkey_test.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package controllers import ( diff --git a/controllers/workspace_controller_tags.go b/controllers/workspace_controller_tags.go index dca819b8..e698ba1c 100644 --- a/controllers/workspace_controller_tags.go +++ b/controllers/workspace_controller_tags.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package controllers import ( diff --git a/controllers/workspace_controller_tags_test.go b/controllers/workspace_controller_tags_test.go index c6ea1c8f..fc9f3bc5 100644 --- a/controllers/workspace_controller_tags_test.go +++ b/controllers/workspace_controller_tags_test.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package controllers import ( diff --git a/controllers/workspace_controller_team_access.go b/controllers/workspace_controller_team_access.go index 504f10df..d72f05c9 100644 --- a/controllers/workspace_controller_team_access.go +++ b/controllers/workspace_controller_team_access.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package controllers import ( diff --git a/controllers/workspace_controller_team_access_test.go b/controllers/workspace_controller_team_access_test.go index 1cbe11b8..b69cddb4 100644 --- a/controllers/workspace_controller_team_access_test.go +++ b/controllers/workspace_controller_team_access_test.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package controllers import ( diff --git a/controllers/workspace_controller_test.go b/controllers/workspace_controller_test.go index c3b927c7..9cfddf9e 100644 --- a/controllers/workspace_controller_test.go +++ b/controllers/workspace_controller_test.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package controllers import ( diff --git a/controllers/workspace_controller_variables.go b/controllers/workspace_controller_variables.go index 7dd450b7..53d0c026 100644 --- a/controllers/workspace_controller_variables.go +++ b/controllers/workspace_controller_variables.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package controllers import ( diff --git a/controllers/workspace_controller_variables_test.go b/controllers/workspace_controller_variables_test.go index 7ae85bc6..0403fcc0 100644 --- a/controllers/workspace_controller_variables_test.go +++ b/controllers/workspace_controller_variables_test.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package controllers import ( diff --git a/controllers/workspace_controller_vcs_test.go b/controllers/workspace_controller_vcs_test.go index 53376816..c54f2937 100644 --- a/controllers/workspace_controller_vcs_test.go +++ b/controllers/workspace_controller_vcs_test.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package controllers import ( diff --git a/docs/config.yaml b/docs/config.yaml index fac50cbc..0084cc79 100644 --- a/docs/config.yaml +++ b/docs/config.yaml @@ -1,3 +1,6 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + # Configuration file for CRD Reference Documentation Generator: https://github.com/elastic/crd-ref-docs processor: ignoreTypes: diff --git a/main.go b/main.go index 6e7aa158..bb0f4022 100644 --- a/main.go +++ b/main.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package main import (