Cannot start function container when container user does not exist within crossplane-xfn container
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 35/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- docker, go
- 領域
- devops, infrastructure
調査の方向性
まず、issue に示されている Dockerfile と labelizer.sh を使い、設定されたユーザーが /etc/passwd に存在しない function image で障害を再現します。次に、OCI コンテナを呼び出してそのユーザーを解決する Go のエントリーポイントを追跡します。設定されたユーザーが crossplane-xfn イメージに存在しない場合でも、任意の高い UID やランダムな UID を含めて function コンテナが正常に起動すれば完了です。
索引モデルが issue の本文から書いたものです。
説明
What happened?
Working on https://github.com/crossplane/crossplane/pull/4261 required creating a custom, but simple function image that labels all managed resources with a given label. My first idea was to use yq for that and the initial Dockerfile was just:
FROM mikefarah/yq:4.34.1
COPY labelizer.sh /bin
ENTRYPOINT ["/bin/labelizer.sh"]
with /bin/labelizer.sh being just:
#!/usr/bin/env sh
yq '(.desired.resources[] | .resource.metadata.labels) |= {"labelizer.xfn.crossplane.io/processed": "true"} + .'
Unfortunately, adding this function to a composition resulted with the following error in crossplane-xfn logs:
cannot compose resources: cannot run Composition Function pipeline: cannot run function "labelizer":
cannot run container: rpc error: code = Unknown desc = exit status 1: xfn: error: spark.Command.Run():
cannot create OCI runtime bundle: cannot write OCI runtime spec: cannot create new spec:
cannot apply spec option: cannot resolve user specified by OCI image config:
cannot resolve UID of user "yq" that doesn't exist in container's /etc/passwd
Modifying the image to use root to run the script resolved the issue.
How can we reproduce it?
- deploy crossplane with enabled composition functions
- build and publish the function image using files stated above
- create a composition referring that function
What environment did it happen in?
The issue is spotted on the latest master, but I am pretty sure that versions containing composition function feature suffer from the same issue.
Expectations
Function containers should be successfully invoked independently if container user exists within crossplane-xfn container/image. We should even encourage function authors to use some arbitrary high/random UID for function.
- 主要言語
- Go
- スター
- 6
- フォーク
- 2
- PR マージ指標
- 30日以内にマージされた PR はありません
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
crossplane/function-runtime-oci のほかの issue
-
enhancement
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
crossplane/function-runtime-oci#42 · コメント 2 件 · リアクション 1 件 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 30/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
-
Dependency Dashboard オープン
難易度 4/5 3〜5日 初心者へのやさしさ 15/100
-
enhancement
crossplane/function-runtime-oci#35 · コメント 11 件 · リアクション 12 件 · 担当者 1 名 ·
crossplane/function-runtime-oci の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
-
bug group: validation priority: low
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
codecheckers/chekhov#51 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100