Skip to content

Commit

Permalink
adding copyright header, need to test before merging
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanweatherly committed Feb 20, 2021
1 parent 617a374 commit 87f4401
Show file tree
Hide file tree
Showing 110 changed files with 291 additions and 18 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Copyright Contributors to the Open Cluster Management project


# Binaries for programs and plugins
*.exe
Expand Down Expand Up @@ -34,4 +36,4 @@ build-harness-extensions
!vbh/build-harness-extensions

# Functional test results
integration_tests/results
integration_tests/results
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Copyright Contributors to the Open Cluster Management project

#
# Sample .travis.yml using the mvp-helloworld image (a helmoperator)
#
Expand Down
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Copyright Contributors to the Open Cluster Management project

# Build the manager binary
FROM golang:1.15 as builder

Expand Down
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Copyright Contributors to the Open Cluster Management project

# GITHUB_USER containing '@' char must be escaped with '%40'
GITHUB_USER := $(shell echo $(GITHUB_USER) | sed 's/@/%40/g')
GITHUB_TOKEN ?=
Expand Down Expand Up @@ -179,3 +181,6 @@ annotate:
# Remove mock server annotation
unannotate:
oc annotate discoveryconfig discoveryconfig ocmBaseURL-

set-copyright:
@bash ./cicd-scripts/set-copyright.sh
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
[comment]: # ( Copyright Contributors to the Open Cluster Management project )

# WORK IN PROGRESS

We are in the process of enabling this repo for community contribution. See wiki [here](https://open-cluster-management.io/concepts/architecture/).
Expand Down
2 changes: 2 additions & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
[comment]: # ( Copyright Contributors to the Open Cluster Management project )

If a security issue is found you can disclose it confidentially by contacting Red Hat's Product Security team. Details at https://access.redhat.com/security/team/contact
2 changes: 2 additions & 0 deletions api/v1/discoveredcluster_types.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright Contributors to the Open Cluster Management project

/*
Expand Down
2 changes: 2 additions & 0 deletions api/v1/discoveredclusterrefresh_types.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright Contributors to the Open Cluster Management project

/*
Expand Down
2 changes: 2 additions & 0 deletions api/v1/discoveryconfig_types.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright Contributors to the Open Cluster Management project

/*
Expand Down
2 changes: 2 additions & 0 deletions api/v1/groupversion_info.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright Contributors to the Open Cluster Management project

/*
Expand Down
2 changes: 2 additions & 0 deletions api/v1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions bundle.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Copyright Contributors to the Open Cluster Management project

FROM scratch

LABEL operators.operatorframework.io.bundle.mediatype.v1=registry+v1
Expand Down
2 changes: 2 additions & 0 deletions bundle/manifests/discovery.clusterserviceversion.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Copyright Contributors to the Open Cluster Management project

apiVersion: operators.coreos.com/v1alpha1
kind: ClusterServiceVersion
metadata:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Copyright Contributors to the Open Cluster Management project

apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Copyright Contributors to the Open Cluster Management project

apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Copyright Contributors to the Open Cluster Management project

apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
Expand Down
2 changes: 2 additions & 0 deletions bundle/metadata/annotations.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Copyright Contributors to the Open Cluster Management project

annotations:
operators.operatorframework.io.bundle.channels.v1: alpha
operators.operatorframework.io.bundle.manifests.v1: manifests/
Expand Down
2 changes: 2 additions & 0 deletions bundle/tests/scorecard/config.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Copyright Contributors to the Open Cluster Management project

apiVersion: scorecard.operatorframework.io/v1alpha3
kind: Configuration
metadata:
Expand Down
2 changes: 2 additions & 0 deletions cicd-scripts/build-test-image.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Copyright Contributors to the Open Cluster Management project

#!/bin/bash
# Copyright (c) 2020 Red Hat, Inc.

Expand Down
4 changes: 3 additions & 1 deletion cicd-scripts/build.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Copyright Contributors to the Open Cluster Management project

#!/bin/bash
# Copyright (c) 2020 Red Hat, Inc.

echo "<repo>/<component>:<tag> : $1"

docker build . -t $1
docker build . -t $1
1 change: 1 addition & 0 deletions cicd-scripts/copyright-header.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Copyright Contributors to the Open Cluster Management project
4 changes: 3 additions & 1 deletion cicd-scripts/deploy-to-cluster.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Copyright Contributors to the Open Cluster Management project

# Copyright (c) 2020 Red Hat, Inc.

echo "DEPLOY TO CLUSTER GOES HERE! IT SHOULD DO NOTHING RIGHT NOW!"
echo "DEPLOY TO CLUSTER GOES HERE! IT SHOULD DO NOTHING RIGHT NOW!"
4 changes: 3 additions & 1 deletion cicd-scripts/e2e-test.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Copyright Contributors to the Open Cluster Management project

#!/bin/bash
# Copyright (c) 2020 Red Hat, Inc.

echo "E2E TESTS GO HERE!"

echo "<repo>/<component>:<tag> : $1"
echo "<repo>/<component>:<tag> : $1"
2 changes: 2 additions & 0 deletions cicd-scripts/install-dependencies.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Copyright Contributors to the Open Cluster Management project

#!/bin/bash
# Copyright (c) 2020 Red Hat, Inc.

Expand Down
4 changes: 3 additions & 1 deletion cicd-scripts/push.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Copyright Contributors to the Open Cluster Management project

#!/bin/bash
# Copyright (c) 2020 Red Hat, Inc.

FULL_IMAGE_NAME=$1
docker login "$FULL_IMAGE_NAME" -u "$DOCKER_USER" -p "$DOCKER_PASS"
docker push "$FULL_IMAGE_NAME"
docker push "$FULL_IMAGE_NAME"
47 changes: 47 additions & 0 deletions cicd-scripts/set-copyright.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Copyright Contributors to the Open Cluster Management project

#!/bin/bash

ALL_FILES=$(find . -name "*")

COPY_HEADER_FILE="$PWD/cicd-scripts/copyright-header.txt"

COPY_HEADER_STRING=$(cat $COPY_HEADER_FILE)
NEWLINES="\n\n"

for FILE in $ALL_FILES
do
COMMENT_START="# "
COMMENT_END=""
if [[ $FILE == *".go" ]]; then
COMMENT_START="// "
fi
if [[ $FILE == *".md" ]]; then
COMMENT_START="[comment]: # ( "
COMMENT_END=" )"
fi

if [[ $FILE == *".go" \
|| $FILE == *".yaml" \
|| $FILE == *".yml" \
|| $FILE == *".sh" \
|| $FILE == *"Dockerfile" \
|| $FILE == *"Makefile" \
|| $FILE == *".gitignore" \
|| $FILE == *".md" \
|| $FILE == *".sum" \
|| $FILE == *".mod" ]]; then

FILE_STRING=$(cat $FILE)
HEADER_WITH_COMMENT="$COMMENT_START$COPY_HEADER_STRING$COMMENT_END"

if [[ $FILE_STRING == "$HEADER_WITH_COMMENT"* ]]; then
echo "$FILE : Header already exists! Skipping!"
else
echo -e "$COMMENT_START$COPY_HEADER_STRING$COMMENT_END$NEWLINES$FILE_STRING" > $FILE
echo "$FILE : Adding copyright header to file!"
fi
else
echo "$FILE : DO NOTHING!"
fi
done
2 changes: 2 additions & 0 deletions cicd-scripts/unit-test.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Copyright Contributors to the Open Cluster Management project

#!/bin/bash
# Copyright (c) 2020 Red Hat, Inc.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Copyright Contributors to the Open Cluster Management project


---
apiVersion: apiextensions.k8s.io/v1
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Copyright Contributors to the Open Cluster Management project


---
apiVersion: apiextensions.k8s.io/v1
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Copyright Contributors to the Open Cluster Management project


---
apiVersion: apiextensions.k8s.io/v1
Expand Down
2 changes: 2 additions & 0 deletions config/crd/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Copyright Contributors to the Open Cluster Management project

# This kustomization.yaml is not intended to be run by itself,
# since it depends on service name and namespace that are out of this kustomize package.
# It should be run by config/default
Expand Down
2 changes: 2 additions & 0 deletions config/crd/kustomizeconfig.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Copyright Contributors to the Open Cluster Management project

# This file is for teaching kustomize how to substitute name and namespace reference in CRD
nameReference:
- kind: Service
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Copyright Contributors to the Open Cluster Management project

# The following patch adds a directive for certmanager to inject CA into the CRD
# CRD conversion requires k8s 1.13 or later.
apiVersion: apiextensions.k8s.io/v1beta1
Expand Down
2 changes: 2 additions & 0 deletions config/crd/patches/cainjection_in_discoveredclusters.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Copyright Contributors to the Open Cluster Management project

# The following patch adds a directive for certmanager to inject CA into the CRD
# CRD conversion requires k8s 1.13 or later.
apiVersion: apiextensions.k8s.io/v1beta1
Expand Down
2 changes: 2 additions & 0 deletions config/crd/patches/cainjection_in_discoveryconfigs.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Copyright Contributors to the Open Cluster Management project

# The following patch adds a directive for certmanager to inject CA into the CRD
# CRD conversion requires k8s 1.13 or later.
apiVersion: apiextensions.k8s.io/v1beta1
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Copyright Contributors to the Open Cluster Management project

# The following patch enables conversion webhook for CRD
# CRD conversion requires k8s 1.13 or later.
apiVersion: apiextensions.k8s.io/v1beta1
Expand All @@ -8,7 +10,8 @@ spec:
conversion:
strategy: Webhook
webhookClientConfig:
# this is "\n" used as a placeholder, otherwise it will be rejected by the apiserver for being blank,
# this is "
" used as a placeholder, otherwise it will be rejected by the apiserver for being blank,
# but we're going to set it later using the cert-manager (or potentially a patch if not using cert-manager)
caBundle: Cg==
service:
Expand Down
5 changes: 4 additions & 1 deletion config/crd/patches/webhook_in_discoveredclusters.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Copyright Contributors to the Open Cluster Management project

# The following patch enables conversion webhook for CRD
# CRD conversion requires k8s 1.13 or later.
apiVersion: apiextensions.k8s.io/v1beta1
Expand All @@ -8,7 +10,8 @@ spec:
conversion:
strategy: Webhook
webhookClientConfig:
# this is "\n" used as a placeholder, otherwise it will be rejected by the apiserver for being blank,
# this is "
" used as a placeholder, otherwise it will be rejected by the apiserver for being blank,
# but we're going to set it later using the cert-manager (or potentially a patch if not using cert-manager)
caBundle: Cg==
service:
Expand Down
5 changes: 4 additions & 1 deletion config/crd/patches/webhook_in_discoveryconfigs.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Copyright Contributors to the Open Cluster Management project

# The following patch enables conversion webhook for CRD
# CRD conversion requires k8s 1.13 or later.
apiVersion: apiextensions.k8s.io/v1beta1
Expand All @@ -8,7 +10,8 @@ spec:
conversion:
strategy: Webhook
webhookClientConfig:
# this is "\n" used as a placeholder, otherwise it will be rejected by the apiserver for being blank,
# this is "
" used as a placeholder, otherwise it will be rejected by the apiserver for being blank,
# but we're going to set it later using the cert-manager (or potentially a patch if not using cert-manager)
caBundle: Cg==
service:
Expand Down
2 changes: 2 additions & 0 deletions config/default/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Copyright Contributors to the Open Cluster Management project

# Adds namespace to all resources.
namespace: open-cluster-management

Expand Down
2 changes: 2 additions & 0 deletions config/default/manager_auth_proxy_patch.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Copyright Contributors to the Open Cluster Management project

# This patch inject a sidecar container which is a HTTP proxy for the
# controller manager, it performs RBAC authorization against the Kubernetes API using SubjectAccessReviews.
apiVersion: apps/v1
Expand Down
2 changes: 2 additions & 0 deletions config/default/manager_webhook_patch.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Copyright Contributors to the Open Cluster Management project

apiVersion: apps/v1
kind: Deployment
metadata:
Expand Down
2 changes: 2 additions & 0 deletions config/default/webhookcainjection_patch.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Copyright Contributors to the Open Cluster Management project

# This patch add annotation to admission webhook config and
# the variables $(CERTIFICATE_NAMESPACE) and $(CERTIFICATE_NAME) will be substituted by kustomize.
apiVersion: admissionregistration.k8s.io/v1beta1
Expand Down
2 changes: 2 additions & 0 deletions config/manager/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Copyright Contributors to the Open Cluster Management project

resources:
- manager.yaml
apiVersion: kustomize.config.k8s.io/v1beta1
Expand Down
2 changes: 2 additions & 0 deletions config/manager/manager.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Copyright Contributors to the Open Cluster Management project

apiVersion: v1
kind: Namespace
metadata:
Expand Down
2 changes: 2 additions & 0 deletions config/manifests/bases/discovery.clusterserviceversion.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Copyright Contributors to the Open Cluster Management project

apiVersion: operators.coreos.com/v1alpha1
kind: ClusterServiceVersion
metadata:
Expand Down
2 changes: 2 additions & 0 deletions config/manifests/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Copyright Contributors to the Open Cluster Management project

resources:
- ../default
- ../samples
Expand Down
2 changes: 2 additions & 0 deletions config/rbac/auth_proxy_client_clusterrole.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Copyright Contributors to the Open Cluster Management project

apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRole
metadata:
Expand Down
2 changes: 2 additions & 0 deletions config/rbac/auth_proxy_role.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Copyright Contributors to the Open Cluster Management project

apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
Expand Down
2 changes: 2 additions & 0 deletions config/rbac/auth_proxy_role_binding.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Copyright Contributors to the Open Cluster Management project

apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
Expand Down
2 changes: 2 additions & 0 deletions config/rbac/auth_proxy_service.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Copyright Contributors to the Open Cluster Management project

apiVersion: v1
kind: Service
metadata:
Expand Down
Loading

0 comments on commit 87f4401

Please sign in to comment.