Skip to content

Commit b1b6989

Browse files
committed
use new k8s deploy watcher
1 parent 3317b35 commit b1b6989

File tree

3 files changed

+30
-1
lines changed

3 files changed

+30
-1
lines changed

app/container/aws-eks-service/provider.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ var Provider = app.Provider{
1919
CanDeployImmediate: false,
2020
NewPusher: ecr.NewPusher,
2121
NewDeployer: eks.NewDeployer,
22-
NewDeployWatcher: app.NewPollingDeployWatcher(eks.NewDeployStatusGetter),
22+
NewDeployWatcher: eks.NewDeployWatcher,
2323
NewStatuser: nil,
2424
NewLogStreamer: eks.NewLogStreamer,
2525
}

aws/eks/deploy_status_getter.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ type DeployStatusGetter struct {
3737
numDesired int
3838
}
3939

40+
func (d *DeployStatusGetter) Close() {}
41+
4042
func (d *DeployStatusGetter) initialize(ctx context.Context, reference string) error {
4143
return nil
4244
}

aws/eks/deploy_watcher.go

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
package eks
2+
3+
import (
4+
"context"
5+
"github.com/nullstone-io/deployment-sdk/app"
6+
"github.com/nullstone-io/deployment-sdk/k8s"
7+
"github.com/nullstone-io/deployment-sdk/logging"
8+
"github.com/nullstone-io/deployment-sdk/outputs"
9+
"k8s.io/client-go/rest"
10+
)
11+
12+
func NewDeployWatcher(ctx context.Context, osWriters logging.OsWriters, source outputs.RetrieverSource, appDetails app.Details) (app.DeployWatcher, error) {
13+
outs, err := outputs.Retrieve[Outputs](ctx, source, appDetails.Workspace, appDetails.WorkspaceConfig)
14+
if err != nil {
15+
return nil, err
16+
}
17+
18+
return &k8s.DeployWatcher{
19+
OsWriters: osWriters,
20+
Details: appDetails,
21+
AppNamespace: outs.ServiceNamespace,
22+
AppName: outs.ServiceName,
23+
NewConfigFn: func(ctx context.Context) (*rest.Config, error) {
24+
return CreateKubeConfig(ctx, outs.Region, outs.ClusterNamespace, outs.Deployer)
25+
},
26+
}, nil
27+
}

0 commit comments

Comments
 (0)