-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
config: add default_annotations #8829
config: add default_annotations #8829
Conversation
d042140
to
f3bc919
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #8829 +/- ##
==========================================
+ Coverage 46.95% 47.10% +0.14%
==========================================
Files 154 154
Lines 21978 22113 +135
==========================================
+ Hits 10320 10416 +96
- Misses 10599 10631 +32
- Partials 1059 1066 +7 |
ba3da90
to
fd14682
Compare
@@ -1271,6 +1272,7 @@ const templateStringCrioRuntimeRuntimesRuntimeHandler = `# The "crio.runtime.run | |||
# - no_sync_log (optional, bool): If set to true, the runtime will not sync the log file on rotate or container exit. | |||
# This option is only valid for the 'oci' runtime type. Setting this option to true can cause data loss, e.g. | |||
# when a machine crash happens. | |||
# - default_annotations (optional, map): Default annotations if not overridden by the pod spec. |
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.
You might need to add this for default_annotations.
fd14682
to
7115a46
Compare
thanks @sohankunkerkar updated |
c272dcc
to
15abbb0
Compare
/hold To allow others to review. |
/approve |
/retest |
2 similar comments
/retest |
/retest |
15abbb0
to
8e6890e
Compare
/retest |
1 similar comment
/retest |
/override ci/prow/e2e-gcp-ovn |
/test ci-fedora-kata |
@saschagrunert: Overrode contexts on behalf of saschagrunert: ci/prow/ci-fedora-critest, ci/prow/e2e-gcp-ovn In 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-sigs/prow repository. |
/override ci/prow/e2e-aws-ovn |
@saschagrunert: Overrode contexts on behalf of saschagrunert: ci/prow/e2e-aws-ovn In 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-sigs/prow repository. |
@test "run container with default annotations" { | ||
setup_crio | ||
|
||
cat << EOF > "$CRIO_CONFIG_DIR/99-ann.conf" | ||
[crio.runtime] | ||
default_runtime = "ann" | ||
[crio.runtime.runtimes.ann] | ||
runtime_path = "$RUNTIME_BINARY_PATH" | ||
default_annotations = { "hello" = "1234", "pod" = "5678" } | ||
EOF | ||
unset CONTAINER_DEFAULT_RUNTIME | ||
unset CONTAINER_RUNTIMES | ||
|
||
start_crio_no_setup | ||
|
||
ctr_id=$(crictl run "$TESTDATA"/container_sleep.json "$TESTDATA"/sandbox_config.json) | ||
annotations=$(crictl inspect "$ctr_id" | jq .info.runtimeSpec.annotations) | ||
grep hello <<< "$annotations" | ||
# pod spec should override default annotations | ||
grep -v "5678" <<< "$annotations" | ||
} |
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.
You need to exclude this test or make it work in kata:
not ok 135 run container with default annotations
# (in test file pod.bats, line 564)
# `ctr_id=$(crictl run "$TESTDATA"/container_sleep.json "$TESTDATA"/sandbox_config.json)' failed
# time="2024-12-18T10:47:50.090479464Z" level=info msg="Updating config from single file: /etc/crio/crio.conf"
# time="2024-12-18T10:47:50.090505488Z" level=info msg="Updating config from drop-in file: /etc/crio/crio.conf"
# time="2024-12-18T10:47:50.0913983Z" level=info msg="Updating config from path: /etc/crio/crio.conf.d"
# time="2024-12-18T10:47:50.091518626Z" level=info msg="Updating config from drop-in file: /etc/crio/crio.conf.d/01-ns-lifecycle.conf"
# time="2024-12-18T10:47:50.091604066Z" level=info msg="Updating config from drop-in file: /etc/crio/crio.conf.d/01-overlay.conf"
# time="2024-12-18T10:47:50.091644374Z" level=info msg="Updating config from drop-in file: /etc/crio/crio.conf.d/99-log-level.conf"
# level=info msg="Using default capabilities: CAP_CHOWN, CAP_DAC_OVERRIDE, CAP_FSETID, CAP_FOWNER, CAP_SETGID, CAP_SETUID, CAP_SETPCAP, CAP_NET_BIND_SERVICE, CAP_KILL"
# time="2024-12-18T10:47:50.129665841Z" level=info msg="Updating config from path: "
# level=info msg="Using default capabilities: CAP_CHOWN, CAP_DAC_OVERRIDE, CAP_FSETID, CAP_FOWNER, CAP_SETGID, CAP_SETUID, CAP_SETPCAP, CAP_NET_BIND_SERVICE, CAP_KILL"
# time="2024-12-18T10:47:50Z" level=fatal msg="validate service connection: validate CRI v1 runtime API for endpoint \"unix:///tmp/tmp.lvCNqQ86CV/crio.sock\": rpc error: code = Unavailable desc = connection error: desc = \"transport: Error while dialing: dial unix /tmp/tmp.lvCNqQ86CV/crio.sock: connect: no such file or directory\""
# E1218 10:47:51.470463 62497 log.go:32] "CreateContainer in sandbox from runtime service failed" err=<
# rpc error: code = Unknown desc = container create failed: flag provided but not defined: -systemd-cgroup
# Usage of /opt/kata/bin/containerd-shim-kata-v2:
# -address string
# grpc address back to main containerd
# -bundle string
# path to the bundle if not workdir
# -debug
# enable debug output in logs
# -id string
# id of the task
# -namespace string
# namespace that owns the shim
# -publish-binary string
# path to publish binary (used for publishing events), but /opt/kata/bin/containerd-shim-kata-v2 will ignore this flag, please use the TTRPC_ADDRESS env
# -socket string
# socket path to serve
# -v show the shim version and exit
# > podSandboxID="361574031e833c28e96e692b540c180d83c3c0090173c17c158de79f8fade5dc"
# time="2024-12-18T10:47:51Z" level=fatal msg="running container: creating container failed: rpc error: code = Unknown desc = container create failed: flag provided but not defined: -systemd-cgroup\nUsage of /opt/kata/bin/containerd-shim-kata-v2:\n -address string\n \tgrpc address back to main containerd\n -bundle string\n \tpath to the bundle if not workdir\n -debug\n \tenable debug output in logs\n -id string\n \tid of the task\n -namespace string\n \tnamespace that owns the shim\n -publish-binary string\n \tpath to publish binary (used for publishing events), but /opt/kata/bin/containerd-shim-kata-v2 will ignore this flag, please use the TTRPC_ADDRESS env\n -socket string\n \tsocket path to serve\n -v\tshow the shim version and exit\n"
Signed-off-by: Peter Hunt <pehunt@redhat.com>
8e6890e
to
a103688
Compare
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: haircommander, kwilczynski, saschagrunert The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/override ci/prow/e2e-aws-ovn |
@saschagrunert: Overrode contexts on behalf of saschagrunert: ci/prow/e2e-aws-ovn, ci/prow/e2e-gcp-ovn In 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-sigs/prow repository. |
/override ci/prow/e2e-gcp-ovn |
1 similar comment
/override ci/prow/e2e-gcp-ovn |
@haircommander: Overrode contexts on behalf of haircommander: ci/prow/e2e-gcp-ovn In 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-sigs/prow repository. |
/cherry-pick release-1.31 |
@haircommander: new pull request created: #8862 In 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-sigs/prow repository. |
What type of PR is this?
What this PR does / why we need it:
/kind feature
Which issue(s) this PR fixes:
Special notes for your reviewer:
Does this PR introduce a user-facing change?