Skip to content

Commit 5c9b3db

Browse files
committed
fix-nil-issue
1 parent d6d85e5 commit 5c9b3db

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

commands/curation/curationaudit.go

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ var supportedTech = map[techutils.Technology]func(ca *CurationAuditCommand) (boo
104104
return ca.checkSupportByVersionOrEnv(techutils.Gem, MinArtiGradleGemSupport)
105105
},
106106
techutils.Docker: func(ca *CurationAuditCommand) (bool, error) {
107-
return ca.DockerImageName() != "", nil
107+
return ca.checkDockerSupport()
108108
},
109109
}
110110

@@ -132,6 +132,17 @@ func (ca *CurationAuditCommand) checkSupportByVersionOrEnv(tech techutils.Techno
132132
return true, nil
133133
}
134134

135+
func (ca *CurationAuditCommand) checkDockerSupport() (bool, error) {
136+
dockerImageName := ca.DockerImageName()
137+
if dockerImageName == "" {
138+
return false, nil
139+
}
140+
if !strings.Contains(dockerImageName, "/") {
141+
return false, errorutils.CheckErrorf("invalid docker image format: '%s'. Expected format: 'repo/image:tag' or 'repo/path/image:tag'", dockerImageName)
142+
}
143+
return true, nil
144+
}
145+
135146
func (ca *CurationAuditCommand) getRtVersion(tech techutils.Technology) (string, error) {
136147
rtManager, _, err := ca.getRtManagerAndAuth(tech)
137148
if err != nil {

0 commit comments

Comments
 (0)