From 9d93a41d5349964373f78a40fa6ff2af8a0f7f84 Mon Sep 17 00:00:00 2001 From: flbla Date: Fri, 21 Jun 2024 10:27:42 +0200 Subject: [PATCH] fixes #447 : fix if project robot Signed-off-by: flbla --- provider/resource_robot_account.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/provider/resource_robot_account.go b/provider/resource_robot_account.go index 2874d61..7b524ec 100755 --- a/provider/resource_robot_account.go +++ b/provider/resource_robot_account.go @@ -167,7 +167,11 @@ func resourceRobotAccountRead(d *schema.ResourceData, m interface{}) error { if err != nil { return fmt.Errorf("error getting system configuration %s", err) } + shortName := strings.TrimPrefix(robot.Name, systemConfig.RobotNamePrefix.Value) + if robot.Level == "project" { + shortName = strings.Split(shortName, "+")[1] + } d.Set("name", shortName) d.Set("robot_id", strconv.Itoa(robot.ID))