From bf5c86e7305103697602c60739a71d6bd581bac8 Mon Sep 17 00:00:00 2001 From: Yong Zhang Date: Wed, 16 Jun 2021 16:30:23 +0800 Subject: [PATCH 1/5] Mount the backup and restore conigmap as environment --- *Motivation* Mount backup and restore configmap as environment so user can use configData to inject the extra environment variable. --- .../templates/zookeeper/zookeeper-backup-statefulset.yaml | 3 +++ charts/pulsar/templates/zookeeper/zookeeper-statefulset.yaml | 3 +++ 2 files changed, 6 insertions(+) diff --git a/charts/pulsar/templates/zookeeper/zookeeper-backup-statefulset.yaml b/charts/pulsar/templates/zookeeper/zookeeper-backup-statefulset.yaml index 2aabf3a6c..e195a85fd 100644 --- a/charts/pulsar/templates/zookeeper/zookeeper-backup-statefulset.yaml +++ b/charts/pulsar/templates/zookeeper/zookeeper-backup-statefulset.yaml @@ -149,6 +149,9 @@ spec: {{- end }} - name: METADATA_TOOL_CONF value: "/pulsar-metadata-tool/conf/pulsar-metadata-tool/pulsar-metadata-tool.properties" + envFrom: + - configMapRef: + name: "{{ template "pulsar.fullname" . }}-{{ .Values.zookeeper.customTools.backup.component }}" ports: - name: metrics containerPort: {{ .Values.zookeeper.customTools.backup.webServerPort }} diff --git a/charts/pulsar/templates/zookeeper/zookeeper-statefulset.yaml b/charts/pulsar/templates/zookeeper/zookeeper-statefulset.yaml index b0a25cbc5..9d1119231 100644 --- a/charts/pulsar/templates/zookeeper/zookeeper-statefulset.yaml +++ b/charts/pulsar/templates/zookeeper/zookeeper-statefulset.yaml @@ -138,6 +138,9 @@ spec: {{- end }} - name: METADATA_TOOL_CONF value: "/pulsar-metadata-tool/conf/pulsar-metadata-tool/pulsar-metadata-tool.properties" + envFrom: + - configMapRef: + name: "{{ template "pulsar.fullname" . }}-{{ .Values.zookeeper.customTools.restore.component }}" volumeMounts: {{- include "pulsar.zookeeper.data.volumeMounts" . | nindent 8 }} {{- include "pulsar.zookeeper.log.volumeMounts" . | nindent 8 }} From c769474accf9ed90697e2a77d8fb3ac5ec74a388 Mon Sep 17 00:00:00 2001 From: Yong Zhang Date: Thu, 17 Jun 2021 09:31:07 +0800 Subject: [PATCH 2/5] Fix the ci error --- charts/sn-pulsar/values.yaml | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/charts/sn-pulsar/values.yaml b/charts/sn-pulsar/values.yaml index 4b204b08a..990a31c59 100644 --- a/charts/sn-pulsar/values.yaml +++ b/charts/sn-pulsar/values.yaml @@ -1638,7 +1638,7 @@ streamnative_console: data: name: data size: 10Gi - #local_storage: true + # local_storage: true # storageClassName: "" ## If the storage class is left undefined when using persistence ## the default storage class for the cluster will be used. @@ -1680,12 +1680,9 @@ streamnative_console: WEB_SERVICE_URL: "" KOP_SERVICE_URL: "" - - ## Components Stack: pulsar operators rbac ## templates/pulsar-operators-rbac.yaml ## - rbac: enable: true roleName: pulsar-operator @@ -1857,8 +1854,8 @@ vault: config: {} resources: limits: - memory: "512Mi" - cpu: "200m" + memory: "512Mi" + cpu: "200m" requests: memory: "256Mi" cpu: "100m" From e372e37c4c02fe92c9b639ed125c43e7d7799a12 Mon Sep 17 00:00:00 2001 From: Yong Zhang Date: Thu, 17 Jun 2021 09:46:44 +0800 Subject: [PATCH 3/5] Add license --- charts/pulsar-operator/Chart.yaml | 19 ++++++++++++++++++- ...treamnative.io_bookkeeperclusters_crd.yaml | 18 +++++++++++++++++- .../bookkeeper-operator/operator.yaml | 18 +++++++++++++++++- .../templates/bookkeeper-operator/rbac.yaml | 19 ++++++++++++++++++- .../pulsar-operator/templates/namespace.yaml | 18 +++++++++++++++++- .../templates/pulsar-operator/operator.yaml | 18 +++++++++++++++++- ...sar.streamnative.io_pulsarbrokers_crd.yaml | 18 +++++++++++++++++- ...sar.streamnative.io_pulsarproxies_crd.yaml | 18 +++++++++++++++++- .../pulsar_broker_clusterrole.yaml | 19 ++++++++++++++++++- .../templates/pulsar-operator/rbac.yaml | 19 ++++++++++++++++++- .../zookeeper-operator/operator.yaml | 19 ++++++++++++++++++- .../templates/zookeeper-operator/rbac.yaml | 18 +++++++++++++++++- ...streamnative.io_zookeeperclusters_crd.yaml | 18 +++++++++++++++++- charts/pulsar-operator/values.yaml | 19 ++++++++++++++++++- 14 files changed, 244 insertions(+), 14 deletions(-) diff --git a/charts/pulsar-operator/Chart.yaml b/charts/pulsar-operator/Chart.yaml index 8d71bdcba..44b1bbe6e 100644 --- a/charts/pulsar-operator/Chart.yaml +++ b/charts/pulsar-operator/Chart.yaml @@ -1,4 +1,21 @@ -# Copyright (c) 2020 StreamNative, Inc.. All Rights Reserved. +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you 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. +# apiVersion: v1 appVersion: "0.7.0" diff --git a/charts/pulsar-operator/templates/bookkeeper-operator/bookkeeper.streamnative.io_bookkeeperclusters_crd.yaml b/charts/pulsar-operator/templates/bookkeeper-operator/bookkeeper.streamnative.io_bookkeeperclusters_crd.yaml index 85285a6d9..9980272ba 100644 --- a/charts/pulsar-operator/templates/bookkeeper-operator/bookkeeper.streamnative.io_bookkeeperclusters_crd.yaml +++ b/charts/pulsar-operator/templates/bookkeeper-operator/bookkeeper.streamnative.io_bookkeeperclusters_crd.yaml @@ -1,4 +1,20 @@ -# Copyright (c) 2020 StreamNative, Inc.. All Rights Reserved. +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you 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. # {{- if and .Values.components.bookkeeper .Values.bookkeeper.crd.create }} {{ include "bookkeeper.crd" . }} diff --git a/charts/pulsar-operator/templates/bookkeeper-operator/operator.yaml b/charts/pulsar-operator/templates/bookkeeper-operator/operator.yaml index 89ccf44bc..b9fb93096 100644 --- a/charts/pulsar-operator/templates/bookkeeper-operator/operator.yaml +++ b/charts/pulsar-operator/templates/bookkeeper-operator/operator.yaml @@ -1,4 +1,20 @@ -# Copyright (c) 2020 StreamNative, Inc.. All Rights Reserved. +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you 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. # --- {{- if and .Values.components.bookkeeper }} diff --git a/charts/pulsar-operator/templates/bookkeeper-operator/rbac.yaml b/charts/pulsar-operator/templates/bookkeeper-operator/rbac.yaml index 355899564..b7913c81e 100644 --- a/charts/pulsar-operator/templates/bookkeeper-operator/rbac.yaml +++ b/charts/pulsar-operator/templates/bookkeeper-operator/rbac.yaml @@ -1,4 +1,21 @@ -# Copyright (c) 2020 StreamNative, Inc.. All Rights Reserved. +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you 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. +# --- {{- if and .Values.components.bookkeeper .Values.bookkeeper.serviceAccount.create }} kind: ServiceAccount diff --git a/charts/pulsar-operator/templates/namespace.yaml b/charts/pulsar-operator/templates/namespace.yaml index b2b09f8d6..0f8d17b3f 100644 --- a/charts/pulsar-operator/templates/namespace.yaml +++ b/charts/pulsar-operator/templates/namespace.yaml @@ -1,4 +1,20 @@ -# Copyright (c) 2020 StreamNative, Inc.. All Rights Reserved. +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you 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. # {{- if .Values.namespaceCreate }} apiVersion: v1 diff --git a/charts/pulsar-operator/templates/pulsar-operator/operator.yaml b/charts/pulsar-operator/templates/pulsar-operator/operator.yaml index f5f4c9e9c..e7548df26 100644 --- a/charts/pulsar-operator/templates/pulsar-operator/operator.yaml +++ b/charts/pulsar-operator/templates/pulsar-operator/operator.yaml @@ -1,4 +1,20 @@ -# Copyright (c) 2020 StreamNative, Inc.. All Rights Reserved. +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you 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. # {{- if and .Values.components.pulsar }} apiVersion: apps/v1 diff --git a/charts/pulsar-operator/templates/pulsar-operator/pulsar.streamnative.io_pulsarbrokers_crd.yaml b/charts/pulsar-operator/templates/pulsar-operator/pulsar.streamnative.io_pulsarbrokers_crd.yaml index 28f8b3066..8e0842823 100644 --- a/charts/pulsar-operator/templates/pulsar-operator/pulsar.streamnative.io_pulsarbrokers_crd.yaml +++ b/charts/pulsar-operator/templates/pulsar-operator/pulsar.streamnative.io_pulsarbrokers_crd.yaml @@ -1,4 +1,20 @@ -# Copyright (c) 2020 StreamNative, Inc.. All Rights Reserved. +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you 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. # {{- if and .Values.components.pulsar .Values.pulsar.crd.create }} {{ include "broker.crd" . }} diff --git a/charts/pulsar-operator/templates/pulsar-operator/pulsar.streamnative.io_pulsarproxies_crd.yaml b/charts/pulsar-operator/templates/pulsar-operator/pulsar.streamnative.io_pulsarproxies_crd.yaml index f2addfcdf..2e6f2217c 100644 --- a/charts/pulsar-operator/templates/pulsar-operator/pulsar.streamnative.io_pulsarproxies_crd.yaml +++ b/charts/pulsar-operator/templates/pulsar-operator/pulsar.streamnative.io_pulsarproxies_crd.yaml @@ -1,4 +1,20 @@ -# Copyright (c) 2020 StreamNative, Inc.. All Rights Reserved. +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you 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. # {{- if and .Values.components.pulsar .Values.pulsar.crd.create }} {{ include "proxy.crd" . }} diff --git a/charts/pulsar-operator/templates/pulsar-operator/pulsar_broker_clusterrole.yaml b/charts/pulsar-operator/templates/pulsar-operator/pulsar_broker_clusterrole.yaml index a9711467f..8819e9892 100644 --- a/charts/pulsar-operator/templates/pulsar-operator/pulsar_broker_clusterrole.yaml +++ b/charts/pulsar-operator/templates/pulsar-operator/pulsar_broker_clusterrole.yaml @@ -1,4 +1,21 @@ -# Copyright (c) 2020 StreamNative, Inc.. All Rights Reserved. +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you 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. +# {{- if and .Values.components.pulsar }} apiVersion: rbac.authorization.k8s.io/v1 diff --git a/charts/pulsar-operator/templates/pulsar-operator/rbac.yaml b/charts/pulsar-operator/templates/pulsar-operator/rbac.yaml index 498f09c5a..487a8dbe2 100644 --- a/charts/pulsar-operator/templates/pulsar-operator/rbac.yaml +++ b/charts/pulsar-operator/templates/pulsar-operator/rbac.yaml @@ -1,4 +1,21 @@ -# Copyright (c) 2020 StreamNative, Inc.. All Rights Reserved. +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you 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. +# --- {{- if and .Values.components.pulsar .Values.pulsar.serviceAccount.create }} kind: ServiceAccount diff --git a/charts/pulsar-operator/templates/zookeeper-operator/operator.yaml b/charts/pulsar-operator/templates/zookeeper-operator/operator.yaml index f2c4bc623..4d27c04eb 100644 --- a/charts/pulsar-operator/templates/zookeeper-operator/operator.yaml +++ b/charts/pulsar-operator/templates/zookeeper-operator/operator.yaml @@ -1,5 +1,22 @@ -# Copyright (c) 2020 StreamNative, Inc.. All Rights Reserved. # +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you 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. +# + {{- if and .Values.components.zookeeper }} apiVersion: apps/v1 kind: Deployment diff --git a/charts/pulsar-operator/templates/zookeeper-operator/rbac.yaml b/charts/pulsar-operator/templates/zookeeper-operator/rbac.yaml index c2aaef4f6..24e89f009 100644 --- a/charts/pulsar-operator/templates/zookeeper-operator/rbac.yaml +++ b/charts/pulsar-operator/templates/zookeeper-operator/rbac.yaml @@ -1,4 +1,20 @@ -# Copyright (c) 2020 StreamNative, Inc.. All Rights Reserved. +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you 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. # {{- if and .Values.components.zookeeper .Values.zookeeper.serviceAccount.create }} kind: ServiceAccount diff --git a/charts/pulsar-operator/templates/zookeeper-operator/zookeeper.streamnative.io_zookeeperclusters_crd.yaml b/charts/pulsar-operator/templates/zookeeper-operator/zookeeper.streamnative.io_zookeeperclusters_crd.yaml index 96669546b..95a5a5b8d 100644 --- a/charts/pulsar-operator/templates/zookeeper-operator/zookeeper.streamnative.io_zookeeperclusters_crd.yaml +++ b/charts/pulsar-operator/templates/zookeeper-operator/zookeeper.streamnative.io_zookeeperclusters_crd.yaml @@ -1,4 +1,20 @@ -# Copyright (c) 2020 StreamNative, Inc.. All Rights Reserved. +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you 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. # {{- if and .Values.components.zookeeper .Values.zookeeper.crd.create }} {{ include "zookeeper.crd" . }} diff --git a/charts/pulsar-operator/values.yaml b/charts/pulsar-operator/values.yaml index f7b7b4473..ae5038538 100644 --- a/charts/pulsar-operator/values.yaml +++ b/charts/pulsar-operator/values.yaml @@ -1,4 +1,21 @@ -# Copyright (c) 2020 StreamNative, Inc.. All Rights Reserved. +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you 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. +# ## Namespace to deploy operator # NOTE: Make the default namespace as empty. So it will fallback to use the namespace used for installing the helm From 7bb27b11b9bd3770acfe0ef59d83e1b06aa21f9a Mon Sep 17 00:00:00 2001 From: Yong Zhang Date: Thu, 17 Jun 2021 09:54:11 +0800 Subject: [PATCH 4/5] Add license and skip check for crd files --- charts/function-mesh-operator/Chart.yaml | 19 +++++++++++++++++++ .../controller-manager-deployment.yaml | 19 +++++++++++++++++++ .../templates/controller-manager-rbac.yaml | 19 +++++++++++++++++++ charts/function-mesh-operator/values.yaml | 19 +++++++++++++++++++ license_test.go | 5 ++++- 5 files changed, 80 insertions(+), 1 deletion(-) diff --git a/charts/function-mesh-operator/Chart.yaml b/charts/function-mesh-operator/Chart.yaml index c6e6261b1..d2f468a09 100644 --- a/charts/function-mesh-operator/Chart.yaml +++ b/charts/function-mesh-operator/Chart.yaml @@ -1,3 +1,22 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you 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. +# + apiVersion: v2 name: function-mesh-operator description: function mesh operator Helm chart for Kubernetes diff --git a/charts/function-mesh-operator/templates/controller-manager-deployment.yaml b/charts/function-mesh-operator/templates/controller-manager-deployment.yaml index 716cbfef3..fe76c681d 100644 --- a/charts/function-mesh-operator/templates/controller-manager-deployment.yaml +++ b/charts/function-mesh-operator/templates/controller-manager-deployment.yaml @@ -1,3 +1,22 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you 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. +# + apiVersion: apps/v1 kind: Deployment metadata: diff --git a/charts/function-mesh-operator/templates/controller-manager-rbac.yaml b/charts/function-mesh-operator/templates/controller-manager-rbac.yaml index b2381c740..c48a049d2 100644 --- a/charts/function-mesh-operator/templates/controller-manager-rbac.yaml +++ b/charts/function-mesh-operator/templates/controller-manager-rbac.yaml @@ -1,3 +1,22 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you 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. +# + {{- if and .Values.rbac.create (hasKey .Values.controllerManager "create" | ternary .Values.controllerManager.create true) }} kind: ServiceAccount apiVersion: v1 diff --git a/charts/function-mesh-operator/values.yaml b/charts/function-mesh-operator/values.yaml index dfb8ec5d5..40eae346e 100644 --- a/charts/function-mesh-operator/values.yaml +++ b/charts/function-mesh-operator/values.yaml @@ -1,3 +1,22 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you 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. +# + # Default values for function-mesh-operator. # This is a YAML-formatted file. # Declare variables to be passed into your templates. diff --git a/license_test.go b/license_test.go index 54ae12867..915a85b55 100644 --- a/license_test.go +++ b/license_test.go @@ -64,7 +64,10 @@ var otherCheck = regexp.MustCompile(`# # `) -var skip = map[string]bool{} +var skip = map[string]bool{ + "charts/function-mesh-operator/crds": true, + "charts/pulsar-operator/crds": true, +} func TestLicense(t *testing.T) { err := filepath.Walk(".", func(path string, fi os.FileInfo, err error) error { From 83b4bff731036af0ac2a46105827de334fe21c5a Mon Sep 17 00:00:00 2001 From: Yong Zhang Date: Thu, 17 Jun 2021 10:18:03 +0800 Subject: [PATCH 5/5] Skip crds license check --- license_test.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/license_test.go b/license_test.go index 915a85b55..7900fb9a4 100644 --- a/license_test.go +++ b/license_test.go @@ -22,6 +22,7 @@ import ( "os" "path/filepath" "regexp" + "strings" "testing" ) @@ -71,6 +72,13 @@ var skip = map[string]bool{ func TestLicense(t *testing.T) { err := filepath.Walk(".", func(path string, fi os.FileInfo, err error) error { + + for k, _ := range skip { + if strings.Contains(path, k) { + return nil + } + } + if skip[path] { return nil }