// Execute executes the resources phase
Execute executes the resources phase
// Execute executes the resources phase
func (p *userResourcesExecutor) Execute(ctx context.Context) error {
	const filename = "resources.yaml"
	p.Progress.NextStep("Creating user-supplied Kubernetes resources")
	stateDir, err := state.GetStateDir()
	if err != nil {
		return trace.Wrap(err)
	}
	err = ioutil.WriteFile(filepath.Join(state.ShareDir(stateDir), filename),
		p.resources, defaults.SharedReadMask)
	if err != nil {
		return trace.Wrap(err, "failed to write user resources on disk")
	}
	out, err := utils.RunInPlanetCommand(
		ctx,
		p.FieldLogger,
		defaults.KubectlBin,
		"--kubeconfig",
		constants.PrivilegedKubeconfig,
		"apply",
		"-f",
		filepath.Join(defaults.PlanetShareDir, filename),
	)
	if err != nil {
		return trace.Wrap(err, "failed to create user resources: %s", out)
	}
	p.Info("Created user-supplied Kubernetes resources.")
	return nil
}
func ( p * userResourcesExecutor ) Execute ( ctx context . Context ) error { const filename = " " p . Progress . NextStep ( " " ) stateDir , err := state . GetStateDir ( ) if err != nil { return trace . Wrap ( err ) } err = ioutil . WriteFile ( filepath . Join ( state . ShareDir ( stateDir ) , filename ) , p . resources , defaults . SharedReadMask ) if err != nil { return trace . Wrap ( err , " " ) } out , err := utils . RunInPlanetCommand ( ctx , p . FieldLogger , defaults . KubectlBin , " " , constants . PrivilegedKubeconfig , " " , " " , filepath . Join ( defaults . PlanetShareDir , filename ) , ) if err != nil { return trace . Wrap ( err , " " , out ) } p . Info ( " " ) return nil }
Execute executes the resources phase
Execute executes the resources phase