fix: Check needs with context and namespace
Signed-off-by: André Arnqvist <andrearnqvist@gmail.com>
This commit is contained in:
		
							parent
							
								
									2076515c5d
								
							
						
					
					
						commit
						015508177a
					
				|  | @ -488,7 +488,7 @@ func (st *HelmState) reformat(spec *ReleaseSpec) []string { | ||||||
| 	var needs []string | 	var needs []string | ||||||
| 	releaseInstalledInfo := make(map[string]bool) | 	releaseInstalledInfo := make(map[string]bool) | ||||||
| 	for _, r := range st.OrginReleases { | 	for _, r := range st.OrginReleases { | ||||||
| 		releaseInstalledInfo[r.Name] = r.Desired() | 		releaseInstalledInfo[fmt.Sprintf("%s/%s/%s", r.KubeContext, r.Namespace, r.Name)] = r.Desired() | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 	// Since the representation differs between needs and id,
 | 	// Since the representation differs between needs and id,
 | ||||||
|  | @ -501,9 +501,6 @@ func (st *HelmState) reformat(spec *ReleaseSpec) []string { | ||||||
| 		components := strings.Split(n, "/") | 		components := strings.Split(n, "/") | ||||||
| 
 | 
 | ||||||
| 		name = components[len(components)-1] | 		name = components[len(components)-1] | ||||||
| 		if spec.Desired() && !releaseInstalledInfo[name] { |  | ||||||
| 			st.logger.Warnf("WARNING: %s", fmt.Sprintf("release %s needs %s, but %s is not installed due to installed: false. Either mark %s as installed or remove %s from %s's needs", spec.Name, name, name, name, name, spec.Name)) |  | ||||||
| 		} |  | ||||||
| 
 | 
 | ||||||
| 		if len(components) > 1 { | 		if len(components) > 1 { | ||||||
| 			ns = components[len(components)-2] | 			ns = components[len(components)-2] | ||||||
|  | @ -519,6 +516,10 @@ func (st *HelmState) reformat(spec *ReleaseSpec) []string { | ||||||
| 			kubecontext = spec.KubeContext | 			kubecontext = spec.KubeContext | ||||||
| 		} | 		} | ||||||
| 
 | 
 | ||||||
|  | 		if spec.Desired() && !releaseInstalledInfo[fmt.Sprintf("%s/%s/%s", kubecontext, ns, name)] { | ||||||
|  | 			st.logger.Warnf("WARNING: %s", fmt.Sprintf("release %s needs %s, but %s is not installed due to installed: false. Either mark %s as installed or remove %s from %s's needs", spec.Name, name, name, name, name, spec.Name)) | ||||||
|  | 		} | ||||||
|  | 
 | ||||||
| 		var componentsAfterOverride []string | 		var componentsAfterOverride []string | ||||||
| 
 | 
 | ||||||
| 		if kubecontext != "" { | 		if kubecontext != "" { | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue