Skip to content
This repository has been archived by the owner on Nov 28, 2024. It is now read-only.

Commit

Permalink
update license boilerplate and mpas-project prefix to generated RBAC
Browse files Browse the repository at this point in the history
  • Loading branch information
jmickey committed Apr 18, 2023
1 parent b7deed6 commit 592c3a0
Show file tree
Hide file tree
Showing 17 changed files with 40 additions and 189 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ help: ## Display this help.

.PHONY: manifests
manifests: controller-gen ## Generate WebhookConfiguration, ClusterRole and CustomResourceDefinition objects.
$(CONTROLLER_GEN) rbac:roleName=manager-role crd webhook paths="./..." output:crd:artifacts:config=config/crd/bases
$(CONTROLLER_GEN) rbac:roleName=mpas-project-manager-role crd webhook paths="./..." output:crd:artifacts:config=config/crd/bases

.PHONY: generate
generate: controller-gen ## Generate code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations.
Expand Down
18 changes: 3 additions & 15 deletions api/v1alpha1/groupversion_info.go
Original file line number Diff line number Diff line change
@@ -1,18 +1,6 @@
/*
Copyright 2023.
Licensed 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.
*/
// SPDX-FileCopyrightText: 2022 SAP SE or an SAP affiliate company and Open Component Model contributors.
//
// SPDX-License-Identifier: Apache-2.0

// Package v1alpha1 contains API Schema definitions for the mpas v1alpha1 API group
// +kubebuilder:object:generate=true
Expand Down
18 changes: 3 additions & 15 deletions api/v1alpha1/project_types.go
Original file line number Diff line number Diff line change
@@ -1,18 +1,6 @@
/*
Copyright 2023.
Licensed 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.
*/
// SPDX-FileCopyrightText: 2022 SAP SE or an SAP affiliate company and Open Component Model contributors.
//
// SPDX-License-Identifier: Apache-2.0

package v1alpha1

Expand Down
18 changes: 3 additions & 15 deletions api/v1alpha1/target_types.go
Original file line number Diff line number Diff line change
@@ -1,18 +1,6 @@
/*
Copyright 2023.
Licensed 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.
*/
// SPDX-FileCopyrightText: 2022 SAP SE or an SAP affiliate company and Open Component Model contributors.
//
// SPDX-License-Identifier: Apache-2.0

package v1alpha1

Expand Down
18 changes: 3 additions & 15 deletions api/v1alpha1/zz_generated.deepcopy.go

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

10 changes: 0 additions & 10 deletions config/default/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,3 @@
# Adds namespace to all resources.
namespace: mpas-project-controller-system

# Value of this field is prepended to the
# names of all resources, e.g. a deployment named
# "wordpress" becomes "alices-wordpress".
# Note that it should also match with the prefix (text before '-') of the namespace
# field above.
namePrefix: mpas-project-controller-

# Labels to add to all resources and selectors.
#commonLabels:
# someName: someValue
Expand Down
43 changes: 8 additions & 35 deletions config/manager/manager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v1
kind: Namespace
metadata:
labels:
control-plane: controller-manager
control-plane: mpas-project-controller-manager
app.kubernetes.io/name: namespace
app.kubernetes.io/instance: system
app.kubernetes.io/component: manager
Expand All @@ -14,63 +14,36 @@ metadata:
apiVersion: apps/v1
kind: Deployment
metadata:
name: controller-manager
name: mpas-project-controller-manager
namespace: system
labels:
control-plane: controller-manager
control-plane: mpas-project-controller-manager
app.kubernetes.io/name: deployment
app.kubernetes.io/instance: controller-manager
app.kubernetes.io/instance: mpas-project-controller-manager
app.kubernetes.io/component: manager
app.kubernetes.io/created-by: mpas-project-controller
app.kubernetes.io/part-of: mpas-project-controller
app.kubernetes.io/managed-by: kustomize
spec:
selector:
matchLabels:
control-plane: controller-manager
app: mpas-project-controller-manager
replicas: 1
template:
metadata:
annotations:
kubectl.kubernetes.io/default-container: manager
labels:
control-plane: controller-manager
app: mpas-project-controller-manager
spec:
# TODO(user): Uncomment the following code to configure the nodeAffinity expression
# according to the platforms which are supported by your solution.
# It is considered best practice to support multiple architectures. You can
# build your manager image using the makefile target docker-buildx.
# affinity:
# nodeAffinity:
# requiredDuringSchedulingIgnoredDuringExecution:
# nodeSelectorTerms:
# - matchExpressions:
# - key: kubernetes.io/arch
# operator: In
# values:
# - amd64
# - arm64
# - ppc64le
# - s390x
# - key: kubernetes.io/os
# operator: In
# values:
# - linux
securityContext:
runAsNonRoot: true
# TODO(user): For common cases that do not require escalating privileges
# it is recommended to ensure that all your Pods/Containers are restrictive.
# More info: https://kubernetes.io/docs/concepts/security/pod-security-standards/#restricted
# Please uncomment the following code if your project does NOT have to work on old Kubernetes
# versions < 1.19 or on vendors versions which do NOT support this field by default (i.e. Openshift < 4.11 ).
# seccompProfile:
# type: RuntimeDefault
containers:
- command:
- /manager
args:
- --leader-elect
image: controller:latest
image: open-component-model/mpas-project-controller
name: manager
securityContext:
allowPrivilegeEscalation: false
Expand Down Expand Up @@ -98,5 +71,5 @@ spec:
requests:
cpu: 10m
memory: 64Mi
serviceAccountName: controller-manager
serviceAccountName: mpas-project-controller-manager
terminationGracePeriodSeconds: 10
2 changes: 0 additions & 2 deletions config/prometheus/kustomization.yaml

This file was deleted.

26 changes: 0 additions & 26 deletions config/prometheus/monitor.yaml

This file was deleted.

4 changes: 2 additions & 2 deletions config/rbac/leader_election_role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ kind: Role
metadata:
labels:
app.kubernetes.io/name: role
app.kubernetes.io/instance: leader-election-role
app.kubernetes.io/instance: mpas-project-leader-election-role
app.kubernetes.io/component: rbac
app.kubernetes.io/created-by: mpas-project-controller
app.kubernetes.io/part-of: mpas-project-controller
app.kubernetes.io/managed-by: kustomize
name: leader-election-role
name: mpas-project-leader-election-role
rules:
- apiGroups:
- ""
Expand Down
6 changes: 3 additions & 3 deletions config/rbac/leader_election_role_binding.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ kind: RoleBinding
metadata:
labels:
app.kubernetes.io/name: rolebinding
app.kubernetes.io/instance: leader-election-rolebinding
app.kubernetes.io/instance: mpas-project-leader-election-rolebinding
app.kubernetes.io/component: rbac
app.kubernetes.io/created-by: mpas-project-controller
app.kubernetes.io/part-of: mpas-project-controller
Expand All @@ -12,8 +12,8 @@ metadata:
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: leader-election-role
name: mpas-project-leader-election-role
subjects:
- kind: ServiceAccount
name: controller-manager
name: mpas-project-controller-manager
namespace: system
2 changes: 1 addition & 1 deletion config/rbac/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
creationTimestamp: null
name: manager-role
name: mpas-project-manager-role
rules:
- apiGroups:
- mpas.ocm.software
Expand Down
4 changes: 2 additions & 2 deletions config/rbac/role_binding.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ kind: ClusterRoleBinding
metadata:
labels:
app.kubernetes.io/name: clusterrolebinding
app.kubernetes.io/instance: manager-rolebinding
app.kubernetes.io/instance: mpas-project-manager-rolebinding
app.kubernetes.io/component: rbac
app.kubernetes.io/created-by: mpas-project-controller
app.kubernetes.io/part-of: mpas-project-controller
app.kubernetes.io/managed-by: kustomize
name: manager-rolebinding
name: mpas-project-manager-rolebinding
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
Expand Down
4 changes: 2 additions & 2 deletions config/rbac/service_account.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ kind: ServiceAccount
metadata:
labels:
app.kubernetes.io/name: serviceaccount
app.kubernetes.io/instance: controller-manager
app.kubernetes.io/instance: mpas-project-controller-manager
app.kubernetes.io/component: rbac
app.kubernetes.io/created-by: mpas-project-controller
app.kubernetes.io/part-of: mpas-project-controller
app.kubernetes.io/managed-by: kustomize
name: controller-manager
name: mpas-project-controller-manager
namespace: system
18 changes: 3 additions & 15 deletions controllers/project_controller.go
Original file line number Diff line number Diff line change
@@ -1,18 +1,6 @@
/*
Copyright 2023.
Licensed 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.
*/
// SPDX-FileCopyrightText: 2022 SAP SE or an SAP affiliate company and Open Component Model contributors.
//
// SPDX-License-Identifier: Apache-2.0

package controllers

Expand Down
18 changes: 3 additions & 15 deletions controllers/suite_test.go
Original file line number Diff line number Diff line change
@@ -1,18 +1,6 @@
/*
Copyright 2023.
Licensed 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.
*/
// SPDX-FileCopyrightText: 2022 SAP SE or an SAP affiliate company and Open Component Model contributors.
//
// SPDX-License-Identifier: Apache-2.0

package controllers

Expand Down
18 changes: 3 additions & 15 deletions hack/boilerplate.go.txt
Original file line number Diff line number Diff line change
@@ -1,15 +1,3 @@
/*
Copyright 2023.

Licensed 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.
*/
// SPDX-FileCopyrightText: 2022 SAP SE or an SAP affiliate company and Open Component Model contributors.
//
// SPDX-License-Identifier: Apache-2.0

0 comments on commit 592c3a0

Please sign in to comment.