fix service fqdn generation
This commit is contained in:
		
							parent
							
								
									d71d105986
								
							
						
					
					
						commit
						dd2560e2b2
					
				|  | @ -41,7 +41,7 @@ func GetJenkinsServiceName(jenkins *v1alpha2.Jenkins, serviceType string) string | ||||||
| func GetJenkinsServiceFQDN(jenkins *v1alpha2.Jenkins, serviceType string) string { | func GetJenkinsServiceFQDN(jenkins *v1alpha2.Jenkins, serviceType string) string { | ||||||
| 	clusterDomain := getClusterDomain() | 	clusterDomain := getClusterDomain() | ||||||
| 
 | 
 | ||||||
| 	return fmt.Sprintf("%s-%s-%s.%s", constants.OperatorName, serviceType, jenkins.ObjectMeta.Name, clusterDomain) | 	return fmt.Sprintf("%s-%s-%s.%s.svc.%s", constants.OperatorName, serviceType, jenkins.ObjectMeta.Name, jenkins.ObjectMeta.Namespace, clusterDomain) | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| // GetClusterDomain returns Kubernetes cluster domain, default to "cluster.local"
 | // GetClusterDomain returns Kubernetes cluster domain, default to "cluster.local"
 | ||||||
|  | @ -55,7 +55,7 @@ func getClusterDomain() string { | ||||||
| 		return clusterDomain | 		return clusterDomain | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 	clusterDomain = strings.TrimPrefix(cname, "kubernetes") | 	clusterDomain = strings.TrimPrefix(cname, "kubernetes.default.svc") | ||||||
| 	clusterDomain = strings.TrimPrefix(clusterDomain, ".") | 	clusterDomain = strings.TrimPrefix(clusterDomain, ".") | ||||||
| 	clusterDomain = strings.TrimSuffix(clusterDomain, ".") | 	clusterDomain = strings.TrimSuffix(clusterDomain, ".") | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue