@@ -44,25 +44,32 @@ def run_plugin(self):
44
44
logger .error (f"Failed to build helm dependency: { cmd } " )
45
45
ret = False
46
46
else :
47
- shutil .copytree (charts_dir , self .tmp_charts_dir )
48
- shutil .rmtree (charts_dir , ignore_errors = True )
49
-
50
- ret = extract_compressed_dir (self .tmp_charts_dir , self .tmp_charts_dir , False )
51
- if not ret :
52
- logger .error (f'Fail to extract compressed dir: { self .tmp_charts_dir } ' )
53
- else :
54
- logger .warning ('Success to extract compressed dir' )
47
+ if not os .path .isdir (charts_dir ):
48
+ logger .warning (f"Cannot create { charts_dir } because of no dependencies in Chart.yaml. "
49
+ f"So you don't need to analyze dependency." )
50
+ return True
51
+ else :
52
+ shutil .copytree (charts_dir , self .tmp_charts_dir )
53
+ shutil .rmtree (charts_dir , ignore_errors = True )
54
+ if ret :
55
+ ret = extract_compressed_dir (self .tmp_charts_dir , self .tmp_charts_dir , False )
56
+ if not ret :
57
+ logger .error (f'Fail to extract compressed dir: { self .tmp_charts_dir } ' )
58
+ else :
59
+ logger .warning ('Success to extract compressed dir' )
55
60
56
61
return ret
57
62
58
63
def parse_oss_information (self , f_name ):
59
64
dep_item_list = []
60
65
sheet_list = []
66
+ _dependencies = 'dependencies'
61
67
62
68
with open (f_name , 'r' , encoding = 'utf8' ) as yaml_fp :
63
69
yaml_f = yaml .safe_load (yaml_fp )
64
- for dep in yaml_f ['dependencies' ]:
65
- dep_item_list .append (dep ['name' ])
70
+ if _dependencies in yaml_f :
71
+ for dep in yaml_f [_dependencies ]:
72
+ dep_item_list .append (dep ['name' ])
66
73
for dep in dep_item_list :
67
74
try :
68
75
f_path = os .path .join (self .tmp_charts_dir , dep , f_name )
0 commit comments