// Execute creates the Gravity resources from the configured list
Execute creates the Gravity resources from the configured list
// Execute creates the Gravity resources from the configured list
func (r *gravityExecutor) Execute(ctx context.Context) (err error) {
	r.progress.NextStep("Creating user-supplied cluster resources")
	cluster, err := r.operator.GetLocalSite(ctx)
	if err != nil {
		return trace.Wrap(err)
	}
	for _, resource := range r.resources {
		r.Infof("Creating resource %q", resource.Kind)
		err := r.factory.Create(ctx, resources.CreateRequest{
			SiteKey: cluster.Key(),
			Resource: teleservices.UnknownResource{
				ResourceHeader: resource.ResourceHeader,
				Raw:            resource.Raw,
			},
		})
		if err != nil {
			return trace.Wrap(err)
		}
	}
	return nil
}
func ( r * gravityExecutor ) Execute ( ctx context . Context ) ( err error ) { r . progress . NextStep ( " " ) cluster , err := r . operator . GetLocalSite ( ctx ) if err != nil { return trace . Wrap ( err ) } for _ , resource := range r . resources { r . Infof ( " " , resource . Kind ) err := r . factory . Create ( ctx , resources . CreateRequest { SiteKey : cluster . Key ( ) , Resource : teleservices . UnknownResource { ResourceHeader : resource . ResourceHeader , Raw : resource . Raw , } , } ) if err != nil { return trace . Wrap ( err ) } } return nil }
Execute creates the Gravity resources from the configured list
Execute creates the Gravity resources from the configured list