Skip to content

Commit 7b4c9bd

Browse files
authored
[SDK] Add PipedID and ApplicationName fields to GetLivestateRequest (#5670)
* Add PipedID and ApplicationName fields to GetLivestateRequest Signed-off-by: Shinnosuke Sawada-Dazai <[email protected]> * Refactor GetLivestateRequest to use getter methods for PipedID, ApplicationID, and ApplicationName Signed-off-by: Shinnosuke Sawada-Dazai <[email protected]> --------- Signed-off-by: Shinnosuke Sawada-Dazai <[email protected]>
1 parent 5ce218d commit 7b4c9bd

File tree

2 files changed

+15
-5
lines changed

2 files changed

+15
-5
lines changed

pkg/plugin/sdk/livestate.go

+7-1
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,9 @@ func (s *LivestatePluginServer[Config, DeployTargetConfig]) GetLivestate(ctx con
132132

133133
response, err := s.base.GetLivestate(ctx, &s.config, deployTargets, &GetLivestateInput{
134134
Request: GetLivestateRequest{
135-
ApplicationID: request.ApplicationId,
135+
PipedID: request.GetPipedId(),
136+
ApplicationID: request.GetApplicationId(),
137+
ApplicationName: request.GetApplicationName(),
136138
DeploymentSource: newDeploymentSource(request.GetDeploySource()),
137139
},
138140
Client: client,
@@ -157,8 +159,12 @@ type GetLivestateInput struct {
157159

158160
// GetLivestateRequest is the request for the GetLivestate method.
159161
type GetLivestateRequest struct {
162+
// PipedID is the ID of the piped.
163+
PipedID string
160164
// ApplicationID is the ID of the application.
161165
ApplicationID string
166+
// ApplicationName is the name of the application.
167+
ApplicationName string
162168
// DeploymentSource is the source of the deployment.
163169
DeploymentSource DeploymentSource
164170
}

pkg/plugin/sdk/livestate_test.go

+8-4
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,10 @@ func TestLivestatePluginServer_GetLivestate(t *testing.T) {
8181
{
8282
name: "success",
8383
request: &livestate.GetLivestateRequest{
84-
ApplicationId: "app1",
85-
DeployTargets: []string{"target1"},
84+
PipedId: "piped1",
85+
ApplicationId: "app1",
86+
ApplicationName: "app1",
87+
DeployTargets: []string{"target1"},
8688
},
8789
result: &GetLivestateResponse{
8890
LiveState: ApplicationLiveState{
@@ -103,8 +105,10 @@ func TestLivestatePluginServer_GetLivestate(t *testing.T) {
103105
{
104106
name: "failure when deploy target not found",
105107
request: &livestate.GetLivestateRequest{
106-
ApplicationId: "app1",
107-
DeployTargets: []string{"target2"},
108+
PipedId: "piped1",
109+
ApplicationId: "app1",
110+
ApplicationName: "app1",
111+
DeployTargets: []string{"target2"},
108112
},
109113
result: &GetLivestateResponse{},
110114
expectErr: true,

0 commit comments

Comments
 (0)