high-church-15413
05/16/2022, 5:10 PMnarrow-translator-93508
06/10/2022, 5:39 PMGo
)
// EnableManagedControlPlane activates some hub functions that cannot be used because of bugs
// with the gkehub pulumi module as of today.
func (sm *ServiceMesh) EnableManagedControlPlane() error {
_, err := local.NewCommand(
sm.Context, "mesh-auto-control-plane", &local.CommandArgs{
Create: pulumi.Sprintf(
`gcloud alpha container hub mesh update \
--control-plane automatic \
--membership %s \
--project %s
`,
sm.Outputs.ClusterName.ApplyT(
func(s interface{}) string {
return s.(string)
},
).(pulumi.StringOutput),
sm.Config.Get("project"),
),
// @todo implement DELETE
},
)
if err != nil {
return fmt.Errorf(
"EnableManagedControlPlane: could not apply auto control plane for membership name %s: %w",
sm.Outputs.ClusterName.ApplyT(
func(s interface{}) string {
return s.(string)
},
),
err,
)
}
return nil
}