Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 18 additions & 12 deletions NOTICE
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,12 @@ Version: v0.0.0-20230301143203-a9d515a09cc2
License: MIT
License URL: https://github.com/asaskevich/govalidator/blob/a9d515a09cc2/LICENSE

----------
Module: github.com/avast/retry-go/v5
Version: v5.0.0
License: MIT
License URL: https://github.com/avast/retry-go/blob/v5.0.0/LICENSE

----------
Module: github.com/beorn7/perks/quantile
Version: v1.0.1
Expand Down Expand Up @@ -185,21 +191,21 @@ License URL: https://github.com/cloudflare/circl/blob/v1.6.3/LICENSE

----------
Module: github.com/cloudnative-pg/barman-cloud/pkg/api
Version: v0.4.1-0.20260108104508-ced266c145f5
Version: v0.5.0
License: Apache-2.0
License URL: https://github.com/cloudnative-pg/barman-cloud/blob/ced266c145f5/LICENSE
License URL: https://github.com/cloudnative-pg/barman-cloud/blob/v0.5.0/LICENSE

----------
Module: github.com/cloudnative-pg/cloudnative-pg
Version: v1.28.1
Version: v1.29.0
License: Apache-2.0
License URL: https://github.com/cloudnative-pg/cloudnative-pg/blob/v1.28.1/LICENSE
License URL: https://github.com/cloudnative-pg/cloudnative-pg/blob/v1.29.0/LICENSE

----------
Module: github.com/cloudnative-pg/cnpg-i/pkg/identity
Version: v0.3.1
Version: v0.5.0
License: Apache-2.0
License URL: https://github.com/cloudnative-pg/cnpg-i/blob/v0.3.1/LICENSE
License URL: https://github.com/cloudnative-pg/cnpg-i/blob/v0.5.0/LICENSE

----------
Module: github.com/cloudnative-pg/machinery/pkg
Expand Down Expand Up @@ -1163,15 +1169,15 @@ License URL: https://github.com/gomodules/jsonpatch/blob/v2.5.0/v2/LICENSE

----------
Module: google.golang.org/api
Version: v0.273.0
Version: v0.273.1
License: BSD-3-Clause
License URL: https://github.com/googleapis/google-api-go-client/blob/v0.273.0/LICENSE
License URL: https://github.com/googleapis/google-api-go-client/blob/v0.273.1/LICENSE

----------
Module: google.golang.org/api/internal/third_party/uritemplates
Version: v0.273.0
Version: v0.273.1
License: BSD-3-Clause
License URL: https://github.com/googleapis/google-api-go-client/blob/v0.273.0/internal/third_party/uritemplates/LICENSE
License URL: https://github.com/googleapis/google-api-go-client/blob/v0.273.1/internal/third_party/uritemplates/LICENSE

----------
Module: google.golang.org/genproto/googleapis
Expand All @@ -1193,9 +1199,9 @@ License URL: https://github.com/googleapis/go-genproto/blob/d00831a3d3e7/googlea

----------
Module: google.golang.org/grpc
Version: v1.79.3
Version: v1.80.0
License: Apache-2.0
License URL: https://github.com/grpc/grpc-go/blob/v1.79.3/LICENSE
License URL: https://github.com/grpc/grpc-go/blob/v1.80.0/LICENSE

----------
Module: google.golang.org/protobuf
Expand Down
12 changes: 7 additions & 5 deletions cli/cmd/bootstrap_gcp.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,6 @@ func AddBootstrapGcpCmd(parent *cobra.Command, opts *GlobalOptions) {
flags.BoolVar(&bootstrapGcpCmd.CodesphereEnv.SpotVMs, "spot-vms", false, "Use Spot VMs for Codesphere infrastructure. Falls back to standard VMs if spot capacity unavailable. Mutually exclusive with --preemptible (default: false)")
flags.IntVar(&bootstrapGcpCmd.CodesphereEnv.DatacenterID, "datacenter-id", 1, "Datacenter ID (default: 1)")
flags.StringVar(&bootstrapGcpCmd.CodesphereEnv.CustomPgIP, "custom-pg-ip", "", "Custom PostgreSQL IP (optional)")
flags.StringVar(&bootstrapGcpCmd.CodesphereEnv.InstallConfigPath, "install-config", "config.yaml", "Path to install config file (optional)")
flags.StringVar(&bootstrapGcpCmd.CodesphereEnv.SecretsFilePath, "secrets-file", "prod.vault.yaml", "Path to secrets files (optional)")
flags.StringVar(&bootstrapGcpCmd.CodesphereEnv.Region, "region", "europe-west4", "GCP Region (default: europe-west4)")
flags.StringVar(&bootstrapGcpCmd.CodesphereEnv.Zone, "zone", "europe-west4-a", "GCP Zone (default: europe-west4-a)")
flags.StringVar(&bootstrapGcpCmd.CodesphereEnv.DNSProjectID, "dns-project-id", "", "GCP Project ID for Cloud DNS (optional)")
Expand All @@ -86,12 +84,16 @@ func AddBootstrapGcpCmd(parent *cobra.Command, opts *GlobalOptions) {
flags.StringVar(&bootstrapGcpCmd.CodesphereEnv.InstallVersion, "install-version", "", "Codesphere version to install (default: none)")
flags.StringVar(&bootstrapGcpCmd.CodesphereEnv.InstallHash, "install-hash", "", "Codesphere package hash to install (default: none)")
flags.StringArrayVarP(&bootstrapGcpCmd.CodesphereEnv.InstallSkipSteps, "install-skip-steps", "s", []string{}, "Installation steps to skip during Codesphere installation (optional)")
flags.StringVar(&bootstrapGcpCmd.InputRegistryType, "registry-type", "local-container", "Container registry type to use (options: local-container, artifact-registry) (default: artifact-registry)")
flags.BoolVar(&bootstrapGcpCmd.CodesphereEnv.WriteConfig, "write-config", true, "Write generated install config to file (default: true)")
flags.BoolVar(&bootstrapGcpCmd.SSHQuiet, "ssh-quiet", false, "Suppress SSH command output (default: false)")
flags.StringVar(&bootstrapGcpCmd.CodesphereEnv.RegistryUser, "registry-user", "", "Custom Registry username (only for GitHub registry type) (optional)")
flags.StringArrayVar(&bootstrapGcpCmd.CodesphereEnv.Experiments, "experiments", gcp.DefaultExperiments, "Experiments to enable in Codesphere installation (optional)")
flags.StringArrayVar(&bootstrapGcpCmd.CodesphereEnv.FeatureFlags, "feature-flags", []string{}, "Feature flags to enable in Codesphere installation (optional)")
flags.StringVar(&bootstrapGcpCmd.InputRegistryType, "registry-type", "local-container", "Container registry type to use (options: local-container, artifact-registry) (default: artifact-registry)")

flags.StringVar(&bootstrapGcpCmd.CodesphereEnv.InstallConfigPath, "install-config", "config.yaml", "Path to install config file (optional)")
flags.StringVar(&bootstrapGcpCmd.CodesphereEnv.SecretsFilePath, "secrets-file", "prod.vault.yaml", "Path to secrets files (optional)")
flags.BoolVar(&bootstrapGcpCmd.CodesphereEnv.WriteConfig, "write-config", true, "Write generated install config to file (default: true)")
flags.BoolVar(&bootstrapGcpCmd.CodesphereEnv.RecoverConfig, "recover-config", false, "Recover previously generated install config from the jumpbox. This will overwrite the local config! (default: false)")
flags.BoolVar(&bootstrapGcpCmd.SSHQuiet, "ssh-quiet", false, "Suppress SSH command output (default: false)")

flags.StringVar(&bootstrapGcpCmd.CodesphereEnv.OpenBaoURI, "openbao-uri", "", "URI for OpenBao (optional)")
flags.StringVar(&bootstrapGcpCmd.CodesphereEnv.OpenBaoEngine, "openbao-engine", "cs-secrets-engine", "OpenBao engine name (default: cs-secrets-engine)")
Expand Down
1 change: 1 addition & 0 deletions docs/oms_beta_bootstrap-gcp.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ oms beta bootstrap-gcp [flags]
--preemptible Use preemptible VMs for Codesphere infrastructure. Mutually exclusive with --spot-vms (default: false)
--project-name string Unique GCP Project Name (required)
--project-ttl string Time to live for the GCP project. Cleanup workflows will remove it afterwards. (default: 2 hours) (default "2h")
--recover-config Recover previously generated install config from the jumpbox. This will overwrite the local config! (default: false)
--region string GCP Region (default: europe-west4) (default "europe-west4")
--registry-type string Container registry type to use (options: local-container, artifact-registry) (default: artifact-registry) (default "local-container")
--registry-user string Custom Registry username (only for GitHub registry type) (optional)
Expand Down
19 changes: 19 additions & 0 deletions internal/bootstrap/gcp/gce.go
Original file line number Diff line number Diff line change
Expand Up @@ -379,3 +379,22 @@ func (b *GCPBootstrapper) ReadSSHKey(path string) (string, error) {
}
return key, nil
}

// GetNodeByName returns the node by the given name
// Returns an error if gce instance is not found
func (b *GCPBootstrapper) GetNodeByName(name string) (*node.Node, error) {
existingInstance, err := b.GCPClient.GetInstance(b.Env.ProjectID, b.Env.Zone, name)
if err != nil {
return nil, fmt.Errorf("failed to get instance %s: %w", name, err)
}

existingNode := &node.Node{
NodeClient: b.NodeClient,
FileIO: b.fw,
}

internalIP, externalIP := ExtractInstanceIPs(existingInstance)
existingNode.UpdateNode(name, externalIP, internalIP)

return existingNode, nil
}
Loading
Loading