createProvider creates the appropriate cluster provider based on configuration
(ctx *pulumi.Context)
| 14 | |
| 15 | // createProvider creates the appropriate cluster provider based on configuration |
| 16 | func createProvider(ctx *pulumi.Context) (providers.ClusterProvider, error) { |
| 17 | conf := config.New(ctx, "mcp-registry") |
| 18 | providerName := conf.Get("provider") |
| 19 | if providerName == "" { |
| 20 | providerName = "local" // Default to local provider |
| 21 | } |
| 22 | |
| 23 | switch providerName { |
| 24 | case "gcp": |
| 25 | return &gcp.Provider{}, nil |
| 26 | case "local": |
| 27 | return &local.Provider{}, nil |
| 28 | default: |
| 29 | return nil, fmt.Errorf("unsupported provider: %s", providerName) |
| 30 | } |
| 31 | } |
| 32 | |
| 33 | func main() { |
| 34 | pulumi.Run(func(ctx *pulumi.Context) error { |
no outgoing calls
no test coverage detected
searching dependent graphs…