MCPcopy
hub / github.com/kubernetes/kops / Create

Method Create

pkg/resources/spotinst/aws.go:158–169  ·  view source on GitHub ↗

Create creates a new InstanceGroup and returns its ID.

(ctx context.Context, group InstanceGroup)

Source from the content-addressed store, hash-verified

156
157// Create creates a new InstanceGroup and returns its ID.
158func (x *awsOceanService) Create(ctx context.Context, group InstanceGroup) (string, error) {
159 input := &awsoc.CreateClusterInput{
160 Cluster: group.Obj().(*awsoc.Cluster),
161 }
162
163 output, err := x.svc.CreateCluster(ctx, input)
164 if err != nil {
165 return "", err
166 }
167
168 return fi.ValueOf(output.Cluster.ID), nil
169}
170
171// Read returns an existing InstanceGroup by ID.
172func (x *awsOceanService) Read(ctx context.Context, clusterID string) (InstanceGroup, error) {

Callers

nothing calls this directly

Calls 3

ValueOfFunction · 0.92
ObjMethod · 0.65
CreateClusterMethod · 0.65

Tested by

no test coverage detected