Skip to content

fix(tools): describe the requested runtime in the diagnose scripts - #6292

Open
rida-ghreizy wants to merge 1 commit into
fluid-cloudnative:masterfrom
rida-ghreizy:fix/diagnose-runtime-name
Open

rida-ghreizy wants to merge 1 commit into
fluid-cloudnative:masterfrom
rida-ghreizy:fix/diagnose-runtime-name

Conversation

@rida-ghreizy

Copy link
Copy Markdown

Ⅰ. Describe what this PR does

kubectl_resource in tools/diagnose-fluid-{alluxio,curvine,jindo,juicefs}.sh describes the runtime with ${name}, a variable these scripts never set:

kubectl describe alluxioruntime --namespace ${runtime_namespace} ${name} >"${diagnose_dir}/alluxioruntime-${runtime_name}.yaml" 2>&1

With ${name} empty, kubectl describes every runtime of that kind in the namespace, and the archive's <kind>runtime-<name>.yaml holds all of them instead of the runtime passed with -r. This uses ${runtime_name}, like the dataset, PV and PVC lines just next to it.

Ⅱ. Does this pull request fix one issue?

NONE

Ⅲ. List the added test cases (unit test/integration test) if any, please explain if no tests are needed.

None: the scripts have no test harness. Checked by hand with a kubectl stub, below.

Ⅳ. Describe how to verify it

Put a kubectl stub that logs its arguments first on PATH, then run bash tools/diagnose-fluid-<runtime>.sh collect -r demo -n ns1 for each script:

Script Before After
alluxio kubectl describe alluxioruntime --namespace ns1 kubectl describe alluxioruntime --namespace ns1 demo
curvine kubectl describe cacheruntime --namespace ns1 kubectl describe cacheruntime --namespace ns1 demo
jindo kubectl describe jindoruntime --namespace ns1 kubectl describe jindoruntime --namespace ns1 demo
juicefs kubectl describe juicefsruntime --namespace ns1 kubectl describe juicefsruntime --namespace ns1 demo

bash -n passes for all four scripts.

Ⅴ. Special notes for reviews

#5671 also edits these scripts but does not touch this line.

kubectl_resource in the alluxio, curvine, jindo and juicefs diagnose
scripts passes ${name}, which is never set, instead of ${runtime_name}.
kubectl then describes every runtime of that kind in the namespace and
writes them all to <kind>runtime-<name>.yaml.

Signed-off-by: rida <ghreizyrida1@gmail.com>
@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant