Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Enhance Cloud Run deploy command with advanced configuration options #40

Open
wants to merge 13 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
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
Prev Previous commit
Next Next commit
feat: Improve default URL configuration for Cloud Run V2 API
- Simplify default URL handling in V2 API service deployment
- Add LaunchStage configuration for default URL settings
- Remove redundant annotation initialization
- Enhance logging for default URL configuration
- Maintain consistent behavior for enabling/disabling default URLs
  • Loading branch information
dijarvrella committed Feb 27, 2025
commit dd8ab7c5c83d08f541d317b131c57a5558db75ec
8 changes: 4 additions & 4 deletions cmd/cloud-run/pkg/deploy/deploy.go
Original file line number Diff line number Diff line change
@@ -517,10 +517,6 @@ func updateWithOptions(service *runv1.Service, opts config.DeployOptions) {
}

// Set the default URL setting
if service.Metadata.Annotations == nil {
service.Metadata.Annotations = make(map[string]string)
}

if !opts.DefaultURL {
service.Metadata.Annotations["run.googleapis.com/launch-stage"] = "BETA"
service.Metadata.Annotations["run.googleapis.com/default-url"] = "disabled"
@@ -982,9 +978,11 @@ func updateServiceWithOptionsV2(service *run.GoogleCloudRunV2Service, opts confi

// The default URL setting in V2 API
if !opts.DefaultURL {
service.LaunchStage = "BETA"
service.DefaultUriDisabled = true
log.Println("Disabling the default URL")
} else {
service.LaunchStage = ""
service.DefaultUriDisabled = false
log.Println("Enabling the default URL")
}
@@ -1160,9 +1158,11 @@ func buildServiceDefinitionV2(projectID string, opts config.DeployOptions) *run.

// The default URL setting in V2 API
if !opts.DefaultURL {
service.LaunchStage = "BETA"
service.DefaultUriDisabled = true
log.Println("Disabling the default URL")
} else {
service.LaunchStage = ""
service.DefaultUriDisabled = false
log.Println("Enabling the default URL")
}