mirror of https://github.com/kubernetes/kops.git
				
				
				
			Don't install weak dependencies for RLEL/CentOS 8
This commit is contained in:
		
							parent
							
								
									d0f15a8e27
								
							
						
					
					
						commit
						62da383511
					
				| 
						 | 
				
			
			@ -277,8 +277,10 @@ func (_ *Package) RenderLocal(t *local.LocalTarget, a, e, changes *Package) erro
 | 
			
		|||
			var ext string
 | 
			
		||||
			if t.HasTag(tags.TagOSFamilyDebian) {
 | 
			
		||||
				ext = ".deb"
 | 
			
		||||
			} else {
 | 
			
		||||
			} else if t.HasTag(tags.TagOSFamilyRHEL) {
 | 
			
		||||
				ext = ".rpm"
 | 
			
		||||
			} else {
 | 
			
		||||
				return fmt.Errorf("unsupported package system")
 | 
			
		||||
			}
 | 
			
		||||
 | 
			
		||||
			// Download all the debs/rpms.
 | 
			
		||||
| 
						 | 
				
			
			@ -305,14 +307,18 @@ func (_ *Package) RenderLocal(t *local.LocalTarget, a, e, changes *Package) erro
 | 
			
		|||
			if t.HasTag(tags.TagOSFamilyDebian) {
 | 
			
		||||
				// Only Debian releases newer than Jessie can install .deb via apt-get
 | 
			
		||||
				// TODO: Refactor this function when Jessie support is dropped (duplicated code)
 | 
			
		||||
				if t.HasTag("_jessie") {
 | 
			
		||||
				if t.HasTag(tags.TagOSDebianJessie) {
 | 
			
		||||
					args = []string{"dpkg", "-i"}
 | 
			
		||||
				} else {
 | 
			
		||||
					args = []string{"apt-get", "install", "--yes", "--no-install-recommends"}
 | 
			
		||||
					env = append(env, "DEBIAN_FRONTEND=noninteractive")
 | 
			
		||||
				}
 | 
			
		||||
			} else if t.HasTag(tags.TagOSFamilyRHEL) {
 | 
			
		||||
				args = []string{"/usr/bin/yum", "install", "-y"}
 | 
			
		||||
				if t.HasTag(tags.TagOSCentOS8) || t.HasTag(tags.TagOSRHEL8) {
 | 
			
		||||
					args = []string{"/usr/bin/dnf", "install", "-y", "--setopt=install_weak_deps=False"}
 | 
			
		||||
				} else {
 | 
			
		||||
					args = []string{"/usr/bin/yum", "install", "-y"}
 | 
			
		||||
				}
 | 
			
		||||
			} else {
 | 
			
		||||
				return fmt.Errorf("unsupported package system")
 | 
			
		||||
			}
 | 
			
		||||
| 
						 | 
				
			
			@ -332,7 +338,11 @@ func (_ *Package) RenderLocal(t *local.LocalTarget, a, e, changes *Package) erro
 | 
			
		|||
				args = []string{"apt-get", "install", "--yes", "--no-install-recommends", e.Name}
 | 
			
		||||
				env = append(env, "DEBIAN_FRONTEND=noninteractive")
 | 
			
		||||
			} else if t.HasTag(tags.TagOSFamilyRHEL) {
 | 
			
		||||
				args = []string{"/usr/bin/yum", "install", "-y", e.Name}
 | 
			
		||||
				if t.HasTag(tags.TagOSCentOS8) || t.HasTag(tags.TagOSRHEL8) {
 | 
			
		||||
					args = []string{"/usr/bin/dnf", "install", "-y", "--setopt=install_weak_deps=False", e.Name}
 | 
			
		||||
				} else {
 | 
			
		||||
					args = []string{"/usr/bin/yum", "install", "-y", e.Name}
 | 
			
		||||
				}
 | 
			
		||||
			} else {
 | 
			
		||||
				return fmt.Errorf("unsupported package system")
 | 
			
		||||
			}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -20,6 +20,10 @@ const (
 | 
			
		|||
	TagOSFamilyRHEL   = "_rhel_family"
 | 
			
		||||
	TagOSFamilyDebian = "_debian_family"
 | 
			
		||||
 | 
			
		||||
	TagOSDebianJessie = "_jessie"
 | 
			
		||||
	TagOSCentOS8      = "_centos8"
 | 
			
		||||
	TagOSRHEL8        = "_rhel8"
 | 
			
		||||
 | 
			
		||||
	TagSystemd = "_systemd"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue