-
Notifications
You must be signed in to change notification settings - Fork 213
pkg/payload: Log manifest exclusion #712
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
pkg/payload: Log manifest exclusion #712
Conversation
We have a number of different annotations all working together now, so logging exclusions with our reasoning will help folks who are debugging "why is my manifest not being reconciled?". And while this will create a number of logs for some profiles, we we already log each reconciled manifest with every sync cycle, so the volume increase isn't huge compared to our existing log rate. This is primarily a dev-time issue, which argues against log spew for production clusters, but since 72599d3 (Exclude featuregate.release.openshift/tech-preview=true manifests, 2021-04-13, openshift#694), there's been the dynamic tech-preview business, so there is now more utility in production logging around this than there was before.
| } | ||
|
|
||
| featureGateAnnotationValue, featureGateAnnotationExists := annotations["release.openshift.io/feature-gate"] | ||
| featureGateAnnotation := "release.openshift.io/feature-gate" |
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.
Move it to const?
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.
This is our one occurrence of this string outside of comments and tests. Did you want the tests to consume the constant, once we have it? They are hard-coding TechPreviewNoUpgrade today too:
$ git grep release.openshift.io/feature-gate | cat
...
pkg/payload/payload_test.go: "release.openshift.io/feature-gate": "TechPreviewNoUpgrade",
...and there's already an openshift/api constant for that, so I expected the test-suite to prefer string literals to catch thing like "we typo'ed the constant value". And if we expect external consumers, I'd rather create the constant in openshift/api, or openshift/library-go instead of asking external consumers to import the CVO's pkg/payload. Thoughts?
| featureGateAnnotationValue, featureGateAnnotationExists := annotations["release.openshift.io/feature-gate"] | ||
| featureGateAnnotation := "release.openshift.io/feature-gate" | ||
| featureGateAnnotationValue, featureGateAnnotationExists := annotations[featureGateAnnotation] | ||
| if featureGateAnnotationValue == "TechPreviewNoUpgrade" && !includeTechPreview { |
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.
Same - lets define it as a const to simplify lookup / re-import if needed
vrutkovs
left a comment
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.
Looks fine, few nits
|
Checking one of the CI runs: $ curl -s https://gcsweb-ci.apps.ci.l2s4.p1.openshiftapps.com/gcs/origin-ci-test/pr-logs/pull/openshift_cluster-version-operator/712/pull-ci-openshift-cluster-version-operator-master-e2e-agnostic/1469359661453938688/artifacts/e2e-agnostic/gather-extra/artifacts/pods/openshift-cluster-version_cluster-version-operator-86b869b467-t52jr_cluster-version-operator.log | grep payload.go
I1210 18:06:09.829117 1 payload.go:274] Loading updatepayload from "/"
I1210 18:06:09.980599 1 payload.go:191] excluding 0000_30_capi-operator_00_credentials-request.yaml group=cloudcredential.openshift.io kind=CredentialsRequest namespace=openshift-cloud-credential-operator name=openshift-cluster-api-aws: tech-preview excluded, and release.openshift.io/feature-gate=TechPreviewNoUpgrade
I1210 18:06:09.980635 1 payload.go:191] excluding 0000_30_capi-operator_00_credentials-request.yaml group=cloudcredential.openshift.io kind=CredentialsRequest namespace=openshift-cloud-credential-operator name=openshift-cluster-api-azure: tech-preview excluded, and release.openshift.io/feature-gate=TechPreviewNoUpgrade
I1210 18:06:09.980649 1 payload.go:191] excluding 0000_30_capi-operator_00_credentials-request.yaml group=cloudcredential.openshift.io kind=CredentialsRequest namespace=openshift-cloud-credential-operator name=openshift-cluster-api-gcp: tech-preview excluded, and release.openshift.io/feature-gate=TechPreviewNoUpgrade
I1210 18:06:10.039131 1 payload.go:191] excluding 0000_50_cluster-csi-snapshot-controller-operator_07_deployment-ibm-cloud-managed.yaml group=apps kind=Deployment namespace=openshift-cluster-storage-operator name=csi-snapshot-controller-operator: include.release.openshift.io/self-managed-high-availability unset
I1210 18:06:10.066572 1 payload.go:191] excluding 0000_50_cluster-image-registry-operator_07-operator-ibm-cloud-managed.yaml group=apps kind=Deployment namespace=openshift-image-registry name=cluster-image-registry-operator: include.release.openshift.io/self-managed-high-availability unset
I1210 18:06:10.085419 1 payload.go:191] excluding 0000_50_cluster-ingress-operator_00-ingress-credentials-request.yaml group=cloudcredential.openshift.io kind=CredentialsRequest namespace=openshift-cloud-credential-operator name=openshift-ingress-ibmcloud: no annotations
I1210 18:06:10.085456 1 payload.go:191] excluding 0000_50_cluster-ingress-operator_00-ingress-credentials-request.yaml group=cloudcredential.openshift.io kind=CredentialsRequest namespace=openshift-cloud-credential-operator name=openshift-ingress-powervs: no annotations
I1210 18:06:10.085466 1 payload.go:191] excluding 0000_50_cluster-ingress-operator_00-ingress-credentials-request.yaml group=cloudcredential.openshift.io kind=CredentialsRequest namespace=openshift-ingress-operator name=openshift-ingress-alibabacloud: no annotations
I1210 18:06:10.088106 1 payload.go:191] excluding 0000_50_cluster-ingress-operator_02-deployment-ibm-cloud-managed.yaml group=apps kind=Deployment namespace=openshift-ingress-operator name=ingress-operator: include.release.openshift.io/self-managed-high-availability unset
I1210 18:06:10.092278 1 payload.go:191] excluding 0000_50_cluster-kube-storage-version-migrator-operator_07_deployment-ibm-cloud-managed.yaml group=apps kind=Deployment namespace=openshift-kube-storage-version-migrator-operator name=kube-storage-version-migrator-operator: include.release.openshift.io/self-managed-high-availability unset
I1210 18:06:10.348166 1 payload.go:191] excluding 0000_50_cluster-monitoring-operator_05-deployment-ibm-cloud-managed.yaml group=apps kind=Deployment namespace=openshift-monitoring name=cluster-monitoring-operator: include.release.openshift.io/self-managed-high-availability unset
I1210 18:06:10.360846 1 payload.go:191] excluding 0000_50_cluster-node-tuning-operator_50-operator-ibm-cloud-managed.yaml group=apps kind=Deployment namespace=openshift-cluster-node-tuning-operator name=cluster-node-tuning-operator: include.release.openshift.io/self-managed-high-availability unset
I1210 18:06:10.390359 1 payload.go:191] excluding 0000_50_cluster-samples-operator_06-operator-ibm-cloud-managed.yaml group=apps kind=Deployment namespace=openshift-cluster-samples-operator name=cluster-samples-operator: include.release.openshift.io/self-managed-high-availability unset
I1210 18:06:10.428949 1 payload.go:191] excluding 0000_50_cluster-storage-operator_10_deployment-ibm-cloud-managed.yaml group=apps kind=Deployment namespace=openshift-cluster-storage-operator name=cluster-storage-operator: include.release.openshift.io/self-managed-high-availability unset
I1210 18:06:10.441400 1 payload.go:191] excluding 0000_50_console-operator_07-operator-ibm-cloud-managed.yaml group=apps kind=Deployment namespace=openshift-console-operator name=console-operator: include.release.openshift.io/self-managed-high-availability unset
I1210 18:06:10.626198 1 payload.go:191] excluding 0000_50_olm_07-olm-operator.deployment.ibm-cloud-managed.yaml group=apps kind=Deployment namespace=openshift-operator-lifecycle-manager name=olm-operator: include.release.openshift.io/self-managed-high-availability unset
I1210 18:06:10.627339 1 payload.go:191] excluding 0000_50_olm_08-catalog-operator.deployment.ibm-cloud-managed.yaml group=apps kind=Deployment namespace=openshift-operator-lifecycle-manager name=catalog-operator: include.release.openshift.io/self-managed-high-availability unset
I1210 18:06:10.631574 1 payload.go:191] excluding 0000_50_operator-marketplace_09_operator-ibm-cloud-managed.yaml group=apps kind=Deployment namespace=openshift-marketplace name=marketplace-operator: include.release.openshift.io/self-managed-high-availability unset
I1210 18:06:10.638525 1 payload.go:191] excluding 0000_50_service-ca-operator_05_deploy-ibm-cloud-managed.yaml group=apps kind=Deployment namespace=openshift-service-ca-operator name=service-ca-operator: include.release.openshift.io/self-managed-high-availability unset
I1210 18:06:10.647749 1 payload.go:191] excluding 0000_70_cluster-network-operator_03_deployment-ibm-cloud-managed.yaml group=apps kind=Deployment namespace=openshift-network-operator name=network-operator: include.release.openshift.io/self-managed-high-availability unset
I1210 18:06:10.663588 1 payload.go:191] excluding 0000_70_dns-operator_02-deployment-ibm-cloud-managed.yaml group=apps kind=Deployment namespace=openshift-dns-operator name=dns-operator: include.release.openshift.io/self-managed-high-availability unset
I1210 18:06:10.681636 1 payload.go:191] excluding 0000_90_cluster-baremetal-operator_03_servicemonitor.yaml group=monitoring.coreos.com kind=ServiceMonitor namespace=openshift-machine-api name=cluster-baremetal-operator-servicemonitor: include.release.openshift.io/self-managed-high-availability unset
I1210 18:13:03.727643 1 payload.go:274] Loading updatepayload from "/"
I1210 18:13:04.015972 1 payload.go:191] excluding 0000_30_capi-operator_00_credentials-request.yaml group=cloudcredential.openshift.io kind=CredentialsRequest namespace=openshift-cloud-credential-operator name=openshift-cluster-api-aws: tech-preview excluded, and release.openshift.io/feature-gate=TechPreviewNoUpgrade
I1210 18:13:04.016004 1 payload.go:191] excluding 0000_30_capi-operator_00_credentials-request.yaml group=cloudcredential.openshift.io kind=CredentialsRequest namespace=openshift-cloud-credential-operator name=openshift-cluster-api-azure: tech-preview excluded, and release.openshift.io/feature-gate=TechPreviewNoUpgrade
...I haven't dug into why it reloads the payload at 18:13, but the new log lines look good to me. Counting by type: $ curl -s https://gcsweb-ci.apps.ci.l2s4.p1.openshiftapps.com/gcs/origin-ci-test/pr-logs/pull/openshift_cluster-version-operator/712/pull-ci-openshift-cluster-version-operator-master-e2e-agnostic/1469359661453938688/artifacts/e2e-agnostic/gather-extra/artifacts/pods/openshift-cluster-version_cluster-version-operator-86b869b467-t52jr_cluster-version-operator.log | sed -n 's/.*payload.go.*://p' | sort | uniq -c | sort -n
2 274] Loading updatepayload from "/"
6 no annotations
6 tech-preview excluded, and release.openshift.io/feature-gate=TechPreviewNoUpgrade
32 include.release.openshift.io/self-managed-high-availability unsetI'll go follow up on those annotation-less manifests in openshift/cluster-ingress-operator#692. |
|
/lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: vrutkovs, wking The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/retest-required Please review the full test history for this PR and help us cut down flakes. |
8 similar comments
|
/retest-required Please review the full test history for this PR and help us cut down flakes. |
|
/retest-required Please review the full test history for this PR and help us cut down flakes. |
|
/retest-required Please review the full test history for this PR and help us cut down flakes. |
|
/retest-required Please review the full test history for this PR and help us cut down flakes. |
|
/retest-required Please review the full test history for this PR and help us cut down flakes. |
|
/retest-required Please review the full test history for this PR and help us cut down flakes. |
|
/retest-required Please review the full test history for this PR and help us cut down flakes. |
|
/retest-required Please review the full test history for this PR and help us cut down flakes. |
|
LB connectivity is unrelated. /override ci/prow/e2e-agnostic-upgrade |
|
@wking: Overrode contexts on behalf of wking: ci/prow/e2e-agnostic-upgrade DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
|
I am extremely confident that this logging is not going to have adverse interactions with any recently-landed, parallel pull requests. /override ci/prow/e2e-agnostic |
|
@wking: Overrode contexts on behalf of wking: ci/prow/e2e-agnostic, ci/prow/e2e-agnostic-operator DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
|
@wking: all tests passed! Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
We moved from --v=5 to --v=2 with c4a1004 (*: Use --v=2 logging to drop client-side throttling noise, 2022-01-04, openshift#721). But this V(5) logging slipped through via the parallel 5d343a5 (pkg/payload: Log manifest exclusion, 2021-12-10, openshift#712). Catch it up, to restore exclusion logging.
We have a number of different annotations all working together now, so logging exclusions with our reasoning will help folks who are debugging "why is my manifest not being reconciled?". And while this will create a number of logs for some profiles, we we already log each reconciled manifest with every sync cycle, so the volume increase isn't huge compared to our existing log rate. This is primarily a dev-time issue, which argues against log spew for production clusters, but since 72599d3 (#694), there's been the dynamic tech-preview business, so there is now more utility in production logging around this than there was before.