asset-relocation-tool-for-kubernetes icon indicating copy to clipboard operation
asset-relocation-tool-for-kubernetes copied to clipboard

Support wildcard * in image pattern(image hint)

Open panpan0000 opened this issue 2 years ago • 0 comments

Most helm charts have many components / dependent charts. just like mariaDB helm chart example : https://github.com/vmware-tanzu/asset-relocation-tool-for-kubernetes/blob/main/examples/simple-chart/image-hints.yaml

If there're many components/ dependent charts under that helm chart, Then it will very troublesome to write an image hint for each component one by one . How about adding * to match all components ?

the original image hint:

- "{{ .image.registry }}/{{ .image.repository }}:{{ .image.tag }}"
- "{{ .metrics.image.registry }}/{{ .metrics.image.repository }}:{{ .metrics.image.tag }}"
- "{{ .volumePermissions.image.registry }}/{{ .volumePermissions.image.repository }}:{{ .volumePermissions.image.tag }}"

the proposed image hint will only have 2 lines : one line for 1 level depth pattern , and another for 2 level depth pattern.

- "{{ .image.registry }}/{{ .image.repository }}:{{ .image.tag }}"
- "{{ .*.image.registry }}/{{ .*.image.repository }}:{{ .*.image.tag }}"

If the 3rd level depth, just add .*.*.image.registry

More over , we can use this magical image.hint file to apply to/reuse for many many community helm charts without writing hint file for each helm chart !!!

By this way, I believe this tool will earn thousands of stars :-) Woo~

panpan0000 avatar Jul 11 '22 09:07 panpan0000

Codecov Report

Attention: Patch coverage is 36.36364% with 7 lines in your changes are missing coverage. Please review.

Project coverage is 36.89%. Comparing base (dc8ed92) to head (77867e3).

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #241   +/-   ##
=======================================
  Coverage   36.89%   36.89%           
=======================================
  Files          20       20           
  Lines        2174     2174           
=======================================
  Hits          802      802           
  Misses       1314     1314           
  Partials       58       58           
Files Coverage Δ
pkg/ako/values.go 63.33% <100.00%> (ø)
...config/akodeploymentconfig_controller_avi_phase.go 20.07% <0.00%> (ø)
...ollers/akodeploymentconfig/user/user_controller.go 0.00% <0.00%> (ø)

codecov-commenter avatar May 03 '24 21:05 codecov-commenter

Not very familiar with the tests, but do we need deleteObjects when we have ensureObjectsDeleted? Or is deleteObjects used in the BeforeEach just in case and not expected to be called?

flawedmatrix avatar May 06 '24 21:05 flawedmatrix

deleteObjects is used in the case that we expect the controller to remove the finalizer. EnsureDelete will remove the finalizer on its own

lubronzhan avatar May 06 '24 22:05 lubronzhan