-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
build: track generated CSV, and validate #8862
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
name: CSV Templates | ||
on: | ||
push: | ||
tags: | ||
- v* | ||
branches: | ||
- master | ||
- release-* | ||
pull_request: | ||
branches: | ||
- master | ||
- release-* | ||
|
||
defaults: | ||
run: | ||
# reference: https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#using-a-specific-shell | ||
shell: bash --noprofile --norc -eo pipefail -x {0} | ||
|
||
jobs: | ||
csv-templates: | ||
runs-on: ubuntu-18.04 | ||
steps: | ||
- uses: actions/setup-go@v2 | ||
with: | ||
go-version: 1.16 | ||
|
||
- name: checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: copy working directory to GOPATH | ||
run: sudo mkdir -p /home/runner/go/src/github.com && sudo cp -a /home/runner/work/rook /home/runner/go/src/github.com/ | ||
|
||
- name: run make csv-templates | ||
working-directory: /home/runner/go/src/github.com/rook/rook | ||
run: GOPATH=$(go env GOPATH) make csv-templates | ||
|
||
- name: validate csv-templates | ||
working-directory: /home/runner/go/src/github.com/rook/rook | ||
run: tests/scripts/validate_modified_files.sh csv-templates |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -115,7 +115,7 @@ do.build.platform.%: | |
|
||
do.build.parallel: $(foreach p,$(PLATFORMS), do.build.platform.$(p)) | ||
|
||
build: csv-clean build.common ## Only build for linux platform | ||
build: build.common ## Only build for linux platform | ||
@$(MAKE) go.build PLATFORM=linux_$(GOHOSTARCH) | ||
@$(MAKE) -C images PLATFORM=linux_$(GOHOSTARCH) | ||
|
||
|
@@ -153,7 +153,7 @@ codegen: ${CODE_GENERATOR} ## Run code generators. | |
mod.check: go.mod.check ## Check if any go modules changed. | ||
mod.update: go.mod.update ## Update all go modules. | ||
|
||
clean: csv-clean ## Remove all files that are created by building. | ||
clean: ## Remove all files that are created by building. | ||
@$(MAKE) go.mod.clean | ||
@$(MAKE) -C images clean | ||
@rm -fr $(OUTPUT_DIR) $(WORK_DIR) | ||
|
@@ -168,14 +168,29 @@ prune: ## Prune cached artifacts. | |
csv-ceph: export MAX_DESC_LEN=0 # sets the description length to 0 since CSV cannot be bigger than 1MB | ||
csv-ceph: export NO_OB_OBC_VOL_GEN=true | ||
csv-ceph: csv-clean crds ## Generate a CSV file for OLM. | ||
$(MAKE) -C images/ceph csv-clean | ||
$(MAKE) -C images/ceph csv | ||
|
||
csv-clean: ## Remove existing OLM files. | ||
@$(MAKE) -C images/ceph csv-clean | ||
Comment on lines
-173
to
-174
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. csv-clean in general was causing changes to tracked CSVs on build, so I just remove it. |
||
|
||
GEN_CRD_TEMP := /tmp/rook-ceph-gen-crds | ||
BUILD_CRDS_INTO_DIR ?= $(GEN_CRD_TEMP) # unless overridden, build CRDs into the temp dir | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So the intermediate steps don't interfere with tracked CSVs. |
||
crds: $(CONTROLLER_GEN) $(YQ) | ||
@echo Updating CRD manifests | ||
@build/crds/build-crds.sh $(CONTROLLER_GEN) $(YQ) | ||
@# build into a temp dir so that it doesn't interfere with CSV generation | ||
rm -rf $(GEN_CRD_TEMP) && mkdir -p $(GEN_CRD_TEMP) | ||
build/crds/build-crds.sh $(CONTROLLER_GEN) $(YQ) | ||
rm -rf $(GEN_CRD_TEMP) | ||
|
||
GEN_CSV_TEMP := /tmp/rook-ceph-gen-csv-template | ||
csv-templates: ## Generate incomplete CSV templates which are tracked in Rook source | ||
$(MAKE) -C images/ceph csv-clean | ||
rm -rf $(GEN_CSV_TEMP) && mkdir -p $(GEN_CSV_TEMP) | ||
$(MAKE) -C images/ceph \ | ||
GENERATE_ROOK_CSV_FOR_TRACKING_ONLY=true \ | ||
CSV_TEMPLATE_DIR=$(GEN_CSV_TEMP) \ | ||
generate-csv-templates | ||
cp -a $(GEN_CSV_TEMP)/cluster/olm/ceph/templates cluster/olm/ceph/. | ||
cp -a $(GEN_CSV_TEMP)/cluster/olm/ceph/deploy cluster/olm/ceph/. | ||
rm -rf $(GEN_CSV_TEMP) | ||
|
||
.PHONY: all build.common cross.build.parallel | ||
.PHONY: build build.all install test check vet fmt codegen mod.check clean distclean prune | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,151 @@ | ||
# OLM: BEGIN OPERATOR DEPLOYMENT | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why is the operator's configmap gone? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe the OLM generation is broken? I haven't touched any of that code. If it's not here, then I think it hasn't been getting generated for quite some time. |
||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: rook-ceph-operator | ||
namespace: rook-ceph # namespace:operator | ||
labels: | ||
operator: rook | ||
storage-backend: ceph | ||
spec: | ||
selector: | ||
matchLabels: | ||
app: rook-ceph-operator | ||
replicas: 1 | ||
template: | ||
metadata: | ||
labels: | ||
app: rook-ceph-operator | ||
spec: | ||
serviceAccountName: rook-ceph-system | ||
containers: | ||
- name: rook-ceph-operator | ||
image: rook/ceph:master | ||
args: ["ceph", "operator"] | ||
volumeMounts: | ||
- mountPath: /var/lib/rook | ||
name: rook-config | ||
- mountPath: /etc/ceph | ||
name: default-config-dir | ||
- mountPath: /etc/webhook | ||
name: webhook-cert | ||
ports: | ||
- containerPort: 9443 | ||
name: https-webhook | ||
protocol: TCP | ||
env: | ||
# If the operator should only watch for cluster CRDs in the same namespace, set this to "true". | ||
# If this is not set to true, the operator will watch for cluster CRDs in all namespaces. | ||
- name: ROOK_CURRENT_NAMESPACE_ONLY | ||
value: "false" | ||
# Rook Discover toleration. Will tolerate all taints with all keys. | ||
# Choose between NoSchedule, PreferNoSchedule and NoExecute: | ||
# - name: DISCOVER_TOLERATION | ||
# value: "NoSchedule" | ||
# (Optional) Rook Discover toleration key. Set this to the key of the taint you want to tolerate | ||
# - name: DISCOVER_TOLERATION_KEY | ||
# value: "<KeyOfTheTaintToTolerate>" | ||
# (Optional) Rook Discover tolerations list. Put here list of taints you want to tolerate in YAML format. | ||
# - name: DISCOVER_TOLERATIONS | ||
# value: | | ||
# - effect: NoSchedule | ||
# key: node-role.kubernetes.io/controlplane | ||
# operator: Exists | ||
# - effect: NoExecute | ||
# key: node-role.kubernetes.io/etcd | ||
# operator: Exists | ||
# (Optional) Rook Discover priority class name to set on the pod(s) | ||
# - name: DISCOVER_PRIORITY_CLASS_NAME | ||
# value: "<PriorityClassName>" | ||
# (Optional) Discover Agent NodeAffinity. | ||
# - name: DISCOVER_AGENT_NODE_AFFINITY | ||
# value: "role=storage-node; storage=rook, ceph" | ||
# (Optional) Discover Agent Pod Labels. | ||
# - name: DISCOVER_AGENT_POD_LABELS | ||
# value: "key1=value1,key2=value2" | ||
|
||
# The duration between discovering devices in the rook-discover daemonset. | ||
- name: ROOK_DISCOVER_DEVICES_INTERVAL | ||
value: "60m" | ||
|
||
# Whether to start pods as privileged that mount a host path, which includes the Ceph mon and osd pods. | ||
# Set this to true if SELinux is enabled (e.g. OpenShift) to workaround the anyuid issues. | ||
# For more details see https://github.com/rook/rook/issues/1314#issuecomment-355799641 | ||
- name: ROOK_HOSTPATH_REQUIRES_PRIVILEGED | ||
value: "false" | ||
|
||
# In some situations SELinux relabelling breaks (times out) on large filesystems, and doesn't work with cephfs ReadWriteMany volumes (last relabel wins). | ||
# Disable it here if you have similar issues. | ||
# For more details see https://github.com/rook/rook/issues/2417 | ||
- name: ROOK_ENABLE_SELINUX_RELABELING | ||
value: "true" | ||
|
||
# In large volumes it will take some time to chown all the files. Disable it here if you have performance issues. | ||
# For more details see https://github.com/rook/rook/issues/2254 | ||
- name: ROOK_ENABLE_FSGROUP | ||
value: "true" | ||
|
||
# Disable automatic orchestration when new devices are discovered | ||
- name: ROOK_DISABLE_DEVICE_HOTPLUG | ||
value: "false" | ||
|
||
# Provide customised regex as the values using comma. For eg. regex for rbd based volume, value will be like "(?i)rbd[0-9]+". | ||
# In case of more than one regex, use comma to separate between them. | ||
# Default regex will be "(?i)dm-[0-9]+,(?i)rbd[0-9]+,(?i)nbd[0-9]+" | ||
# Add regex expression after putting a comma to blacklist a disk | ||
# If value is empty, the default regex will be used. | ||
- name: DISCOVER_DAEMON_UDEV_BLACKLIST | ||
value: "(?i)dm-[0-9]+,(?i)rbd[0-9]+,(?i)nbd[0-9]+" | ||
|
||
# Time to wait until the node controller will move Rook pods to other | ||
# nodes after detecting an unreachable node. | ||
# Pods affected by this setting are: | ||
# mgr, rbd, mds, rgw, nfs, PVC based mons and osds, and ceph toolbox | ||
# The value used in this variable replaces the default value of 300 secs | ||
# added automatically by k8s as Toleration for | ||
# <node.kubernetes.io/unreachable> | ||
# The total amount of time to reschedule Rook pods in healthy nodes | ||
# before detecting a <not ready node> condition will be the sum of: | ||
# --> node-monitor-grace-period: 40 seconds (k8s kube-controller-manager flag) | ||
# --> ROOK_UNREACHABLE_NODE_TOLERATION_SECONDS: 5 seconds | ||
- name: ROOK_UNREACHABLE_NODE_TOLERATION_SECONDS | ||
value: "5" | ||
|
||
# The name of the node to pass with the downward API | ||
- name: NODE_NAME | ||
valueFrom: | ||
fieldRef: | ||
fieldPath: spec.nodeName | ||
# The pod name to pass with the downward API | ||
- name: POD_NAME | ||
valueFrom: | ||
fieldRef: | ||
fieldPath: metadata.name | ||
# The pod namespace to pass with the downward API | ||
- name: POD_NAMESPACE | ||
valueFrom: | ||
fieldRef: | ||
fieldPath: metadata.namespace | ||
# Recommended resource requests and limits, if desired | ||
#resources: | ||
# limits: | ||
# cpu: 500m | ||
# memory: 256Mi | ||
# requests: | ||
# cpu: 100m | ||
# memory: 128Mi | ||
|
||
# Uncomment it to run lib bucket provisioner in multithreaded mode | ||
#- name: LIB_BUCKET_PROVISIONER_THREADS | ||
# value: "5" | ||
|
||
# Uncomment it to run rook operator on the host network | ||
#hostNetwork: true | ||
volumes: | ||
- name: rook-config | ||
emptyDir: {} | ||
- name: default-config-dir | ||
emptyDir: {} | ||
- name: webhook-cert | ||
emptyDir: {} | ||
# OLM: END OPERATOR DEPLOYMENT |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
csv-clean here was causing changes to tracked CSVs on build.