mirror of
https://gitee.com/rainbond/Rainbond.git
synced 2024-11-30 02:38:17 +08:00
Use the first one when there is no default Maven configuration
This commit is contained in:
parent
52263be06b
commit
290f8965c1
@ -249,12 +249,21 @@ func (c *controller) GetDefaultLanguageBuildSetting(ctx context.Context, lang co
|
||||
LabelSelector: "default=true",
|
||||
})
|
||||
if err != nil {
|
||||
logrus.Errorf("get default maven setting configmap failure %s", err.Error())
|
||||
}
|
||||
if config != nil {
|
||||
for _, c := range config.Items {
|
||||
return c.Name
|
||||
logrus.Errorf("get default maven setting configmap failure %s", err.Error())
|
||||
allConfig, err := c.KubeClient.CoreV1().ConfigMaps(c.namespace).List(ctx, metav1.ListOptions{
|
||||
LabelSelector: "configtype=mavensetting",
|
||||
})
|
||||
if err != nil {
|
||||
logrus.Errorf("get all maven setting configmap failure %s", err.Error())
|
||||
return ""
|
||||
}
|
||||
for _, ac := range allConfig.Items {
|
||||
return ac.Name
|
||||
}
|
||||
return ""
|
||||
}
|
||||
for _, c := range config.Items {
|
||||
return c.Name
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user