Skip to content

Commit

Permalink
krel/ff: add an option to define a gcp project to use instead of the …
Browse files Browse the repository at this point in the history
…default one

Signed-off-by: Carlos Panato <[email protected]>
  • Loading branch information
cpanato committed Feb 8, 2022
1 parent 16a6acc commit becad20
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
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

0 comments on commit becad20

Please sign in to comment.