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

krel/ff: add an option to define a gcp project to use instead of the default one #2414

Merged
merged 1 commit into from
Feb 9, 2022
Merged
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
2 changes: 2 additions & 0 deletions cmd/krel/cmd/ff.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import (
"github.com/spf13/cobra"

"k8s.io/release/pkg/fastforward"
"k8s.io/release/pkg/release"
kgit "sigs.k8s.io/release-sdk/git"
)

Expand Down Expand Up @@ -72,6 +73,7 @@ func init() {
ffCmd.PersistentFlags().StringVar(&ffOpts.RepoPath, "repo", filepath.Join(os.TempDir(), "k8s"), "the local path to the repository to be used")
ffCmd.PersistentFlags().StringVar(&ffOpts.Branch, "branch", "", "branch")
ffCmd.PersistentFlags().StringVar(&ffOpts.MainRef, "ref", kgit.Remotify(kgit.DefaultBranch), "ref on the main branch")
ffCmd.PersistentFlags().StringVar(&ffOpts.GCPProjectID, "project-id", release.DefaultRelengStagingTestProject, "Google Cloud Porject to use to submit the job")
ffCmd.PersistentFlags().BoolVar(&ffOpts.Cleanup, "cleanup", false, "cleanup the repository after the run")
ffCmd.PersistentFlags().BoolVar(&ffOpts.NonInteractive, "non-interactive", false, "do not require any user interaction")
ffCmd.PersistentFlags().BoolVar(&ffOpts.Submit, "submit", false, "run inside of Google Cloud Build by submitting a new job")
Expand Down
6 changes: 5 additions & 1 deletion pkg/fastforward/fastforward.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,11 @@ type Options struct {
// Cleanup the repository after the run if set to true.
Cleanup bool

// RepoPa is the local path to the repository to be used.
// RepoPath is the local path to the repository to be used.
RepoPath string

// GCPProjectID is the GCP project to use to submit the job.
GCPProjectID string
}

// FastForward is the main structure of this package.
Expand Down Expand Up @@ -82,6 +85,7 @@ func (f *FastForward) Run() (err error) {
options.FastForward = true
options.NoMock = f.options.NoMock
options.Stream = true
options.Project = f.options.GCPProjectID
return f.Submit(options)
}

Expand Down
1 change: 1 addition & 0 deletions pkg/release/release.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ const (

// TODO(vdf): Need to reference K8s Infra project here
DefaultKubernetesStagingProject = "kubernetes-release-test"
DefaultRelengStagingTestProject = "k8s-staging-releng-test"
DefaultRelengStagingProject = "k8s-staging-releng"
DefaultDiskSize = "500"
BucketPrefix = "kubernetes-release-"
Expand Down