Commit dd9a386
authored
chore: Use oc-mirror v2 as v1 is deprecated in OCP 4.18 (#1646)
* chore: Use oc-mirror v2 as v1 is deprecated in OCP 4.18
Signed-off-by: Fortune Ndlovu <fndlovu@redhat.com>
* update: remove flags not supported in oc-mirrorv2 '--skip-missing: No equivalent in v2 (images must exist or command fails)' AND '--dest-skip-tls: Replaced with --dest-tls-verify=false' AND '--continue-on-error: No equivalent in v2 (command stops on first error)'
Signed-off-by: Fortune Ndlovu <fndlovu@redhat.com>
* fix: use existing auth file instead of yq filter that returns null
Replace complex yq filter generation that was returning null values
with direct use of existing auth file containing valid credentials.
Prevents authentication failures in oc-mirror v2 workflow.
Signed-off-by: Fortune Ndlovu <fndlovu@redhat.com>
* update: Add --workspace flag to all oc-mirror commands for proper cluster resource generation AND Add --cache-dir option for persistent caching to improve performance and enable incremental mirroring AND Fix ImageSetConfiguration channel structure to ensure proper YAML formatting
AND Add cache directory support with default location at /home/fndlovu/.oc-mirror-cache
Signed-off-by: Fortune Ndlovu <fndlovu@redhat.com>
* fix: resolve oc-mirror v2 authentication and workflow compatibility issues BY Fixing REGISTRY_AUTH_FILE parsing error by using --authfile flag instead of environment variable turns oc-mirror v2 has a bug where it tries to parse REGISTRY_AUTH_FILE path as YAML configuration instead of using it as an auth file path, causing 'StorageDriver not registered' panic. AND I ALSO Fixed disk-to-mirror workflow by adding file:// prefix to --from parameter oc-mirror v2 requires file:// prefix when using --from flag for disk-to-mirror workflow without this prefix, command fails with 'when --from is used, it must have file:// prefix' error AND I Fixe workflow conflict by removing --workspace flag from disk-to-mirror commands oc-mirror v2 doesn't allow --from and --workspace flags together for docker:// destinations --from assumes disk-to-mirror workflow, --workspace assumes mirror-to-mirror workflow
- Add proper auth file detection and fallback handling
Script now detects existing auth files and uses --authfile flag when available
Falls back gracefully when no auth file is present
These fixes ensure all three oc-mirror v2 workflows work correctly:
- Mirror-to-disk: file://destination (no --workspace needed)
- Disk-to-mirror: --from file://source docker://destination (no --workspace)
- Mirror-to-mirror: --workspace file://workspace docker://destination
Signed-off-by: Fortune Ndlovu <fndlovu@redhat.com>
* fix spellcheck
Signed-off-by: Fortune Ndlovu <fndlovu@redhat.com>
* fixup: no need to remove echo (nice-to-have) AND no need for wc -l < original worked fine.
Signed-off-by: Fortune Ndlovu <fndlovu@redhat.com>
* fixup: dont treat authfile and cache's entire sting as a single arg
Signed-off-by: Fortune Ndlovu <fndlovu@redhat.com>
* fixup: provide warning of rosa clusters or clusters hosted as control planes AND remove cache flag users can apply --oc-mirror-flags
Signed-off-by: Fortune Ndlovu <fndlovu@redhat.com>
* fixup: remove merge_regestry_auth() just use existing auth file directly
Signed-off-by: Fortune Ndlovu <fndlovu@redhat.com>
* clean up unset REGISTRY_AUTH_FILE env, as its not needed.
Signed-off-by: Fortune Ndlovu <fndlovu@redhat.com>
* update: -c and --config work the same, lets me more clear.
Signed-off-by: Fortune Ndlovu <fndlovu@redhat.com>
* fixup: add --max-nested-paths=2 as its valid in oc mirror v2
Signed-off-by: Fortune Ndlovu <fndlovu@redhat.com>
* fixup: remove empty line
Signed-off-by: Fortune Ndlovu <fndlovu@redhat.com>
* fixup: usage outline
Signed-off-by: Fortune Ndlovu <fndlovu@redhat.com>
* cleanup: no direct --cache-option, users can specify --oc-mirror-flags option
Signed-off-by: Fortune Ndlovu <fndlovu@redhat.com>
* fixup: remove redundent auth setup as oc-mirror --v2 has a default behaviour to find the auth file at /run/user/4213390/containers/auth.json
Signed-off-by: Fortune Ndlovu <fndlovu@redhat.com>
* Improve cluster resources processing logic
Signed-off-by: Fortune Ndlovu <fndlovu@redhat.com>
* switch to --config=
Signed-off-by: Fortune Ndlovu <fndlovu@redhat.com>
* attempts to create DMS/ITMS resources on HCP clusters, rather than skipping
Signed-off-by: Fortune Ndlovu <fndlovu@redhat.com>
* fix wording
Signed-off-by: Fortune Ndlovu <fndlovu@redhat.com>
* update: try to apply IDMS/ITMS => If it fails, catch error => Show warning => Continue anyway
Signed-off-by: Fortune Ndlovu <fndlovu@redhat.com>
* DRY-process both IDMS and ITMS file
Signed-off-by: Fortune Ndlovu <fndlovu@redhat.com>
---------
Signed-off-by: Fortune Ndlovu <fndlovu@redhat.com>1 parent 163bdb7 commit dd9a386
1 file changed
Lines changed: 87 additions & 96 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | | - | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
| |||
99 | 100 | | |
100 | 101 | | |
101 | 102 | | |
102 | | - | |
| 103 | + | |
103 | 104 | | |
104 | | - | |
105 | | - | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
106 | 108 | | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
107 | 113 | | |
108 | 114 | | |
109 | 115 | | |
| |||
134 | 140 | | |
135 | 141 | | |
136 | 142 | | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
137 | 155 | | |
138 | 156 | | |
139 | 157 | | |
| |||
381 | 399 | | |
382 | 400 | | |
383 | 401 | | |
384 | | - | |
385 | | - | |
386 | | - | |
387 | | - | |
388 | | - | |
389 | | - | |
390 | | - | |
391 | | - | |
392 | | - | |
393 | | - | |
394 | | - | |
395 | | - | |
396 | | - | |
397 | | - | |
398 | | - | |
399 | | - | |
400 | | - | |
401 | | - | |
402 | | - | |
403 | | - | |
404 | | - | |
405 | | - | |
406 | | - | |
407 | | - | |
408 | | - | |
409 | | - | |
410 | | - | |
411 | | - | |
412 | | - | |
413 | | - | |
414 | | - | |
415 | | - | |
416 | | - | |
417 | | - | |
418 | | - | |
419 | | - | |
420 | | - | |
421 | | - | |
422 | | - | |
423 | | - | |
424 | | - | |
425 | | - | |
426 | | - | |
427 | | - | |
428 | 402 | | |
429 | 403 | | |
430 | 404 | | |
| |||
901 | 875 | | |
902 | 876 | | |
903 | 877 | | |
904 | | - | |
905 | 878 | | |
906 | 879 | | |
907 | 880 | | |
908 | 881 | | |
909 | 882 | | |
910 | 883 | | |
911 | 884 | | |
912 | | - | |
913 | | - | |
914 | | - | |
915 | | - | |
916 | | - | |
917 | | - | |
918 | | - | |
919 | | - | |
| 885 | + | |
920 | 886 | | |
921 | 887 | | |
922 | 888 | | |
| 889 | + | |
923 | 890 | | |
924 | 891 | | |
925 | 892 | | |
926 | | - | |
| 893 | + | |
927 | 894 | | |
928 | | - | |
929 | | - | |
930 | | - | |
931 | | - | |
932 | | - | |
933 | 895 | | |
934 | 896 | | |
935 | 897 | | |
| |||
948 | 910 | | |
949 | 911 | | |
950 | 912 | | |
951 | | - | |
952 | 913 | | |
953 | 914 | | |
954 | 915 | | |
| |||
966 | 927 | | |
967 | 928 | | |
968 | 929 | | |
969 | | - | |
970 | | - | |
971 | | - | |
972 | | - | |
973 | | - | |
| 930 | + | |
| 931 | + | |
| 932 | + | |
| 933 | + | |
974 | 934 | | |
975 | 935 | | |
976 | 936 | | |
| |||
993 | 953 | | |
994 | 954 | | |
995 | 955 | | |
| 956 | + | |
996 | 957 | | |
997 | | - | |
998 | | - | |
999 | | - | |
| 958 | + | |
1000 | 959 | | |
1001 | | - | |
| 960 | + | |
| 961 | + | |
1002 | 962 | | |
1003 | 963 | | |
1004 | 964 | | |
| |||
1025 | 985 | | |
1026 | 986 | | |
1027 | 987 | | |
1028 | | - | |
| 988 | + | |
1029 | 989 | | |
1030 | | - | |
1031 | | - | |
1032 | | - | |
1033 | | - | |
| 990 | + | |
| 991 | + | |
| 992 | + | |
| 993 | + | |
1034 | 994 | | |
1035 | 995 | | |
1036 | 996 | | |
1037 | 997 | | |
1038 | | - | |
1039 | | - | |
1040 | | - | |
1041 | | - | |
1042 | | - | |
1043 | | - | |
1044 | | - | |
1045 | | - | |
1046 | | - | |
| 998 | + | |
| 999 | + | |
| 1000 | + | |
| 1001 | + | |
| 1002 | + | |
| 1003 | + | |
1047 | 1004 | | |
1048 | | - | |
1049 | | - | |
1050 | | - | |
1051 | | - | |
1052 | | - | |
1053 | | - | |
1054 | | - | |
1055 | | - | |
1056 | | - | |
| 1005 | + | |
| 1006 | + | |
| 1007 | + | |
| 1008 | + | |
| 1009 | + | |
| 1010 | + | |
| 1011 | + | |
| 1012 | + | |
| 1013 | + | |
| 1014 | + | |
| 1015 | + | |
| 1016 | + | |
| 1017 | + | |
| 1018 | + | |
| 1019 | + | |
| 1020 | + | |
| 1021 | + | |
| 1022 | + | |
| 1023 | + | |
| 1024 | + | |
| 1025 | + | |
| 1026 | + | |
| 1027 | + | |
| 1028 | + | |
| 1029 | + | |
| 1030 | + | |
| 1031 | + | |
| 1032 | + | |
| 1033 | + | |
| 1034 | + | |
| 1035 | + | |
| 1036 | + | |
| 1037 | + | |
| 1038 | + | |
| 1039 | + | |
| 1040 | + | |
| 1041 | + | |
| 1042 | + | |
| 1043 | + | |
| 1044 | + | |
| 1045 | + | |
1057 | 1046 | | |
| 1047 | + | |
| 1048 | + | |
1058 | 1049 | | |
1059 | 1050 | | |
1060 | 1051 | | |
| |||
0 commit comments