Skip to content

Commit

Permalink
worker和agent支持java17和java8同步运行 TencentBlueKing#10586
Browse files Browse the repository at this point in the history
  • Loading branch information
tangruotian committed Jul 10, 2024
1 parent 4e23f68 commit f89da8f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
4 changes: 4 additions & 0 deletions src/agent/agent/src/pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,10 @@ func LoadAgentConfig() error {
if jdkDirPath == "" {
jdkDirPath = getJavaDir()
}
jdk17DirPath := conf.Section("").Key(KeyJdk17DirPath).String()
if jdk17DirPath == "" {
jdk17DirPath = systemutil.GetWorkDir() + "/jdk17"
}

// 兼容旧版本 .agent.properties 没有这个键
dockerParallelTaskCount := 4
Expand Down
4 changes: 2 additions & 2 deletions src/agent/agent/src/pkg/upgrade/upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,13 +110,13 @@ func AgentUpgrade(upgradeItem *api.UpgradeItem, hasBuild bool) {
return
}

logs.Info("agentUpgrade|download upgrade files start")
logs.Infof("agentUpgrade|download upgrade files start %+v", upgradeItem)
changeItems := downloadUpgradeFiles(upgradeItem)
if changeItems.checkNoChange() {
return
}

logs.Info("agentUpgrade|download upgrade files done")
logs.Infof("agentUpgrade|download upgrade files done %+v", changeItems)
err := DoUpgradeOperation(changeItems)
if err != nil {
logs.WithError(err).Error("agentUpgrade|do upgrade operation failed")
Expand Down
3 changes: 2 additions & 1 deletion src/agent/agent/src/third_components/jdk.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ type JdkVersionType struct {
}

func (j *JdkVersionType) IsNull() bool {
return commonutil.IsStringSliceBlank(j.version)
return commonutil.IsStringSliceBlank(j.GetVersion())
}

func (j *JdkVersionType) GetVersion() []string {
Expand Down Expand Up @@ -131,6 +131,7 @@ func (j *JdkVersionType) getJdkVersion() ([]string, error) {
case jdk17:
jdkV = trimJdk17VersionList(versionOutputString)
}
j.logs.Infof("%d getJdkVersion %+v", j.vNum, jdkVersion)
return jdkV, nil
}

Expand Down

0 comments on commit f89da8f

Please sign in to comment.