Skip to content

Commit

Permalink
Merge pull request #3271 from saschagrunert/workspace
Browse files Browse the repository at this point in the history
Make `--workspace` configurable in `obs stage/release`
  • Loading branch information
k8s-ci-robot authored Sep 14, 2023
2 parents b91a0f6 + fa3973d commit 2633f4f
Show file tree
Hide file tree
Showing 8 changed files with 133 additions and 85 deletions.
8 changes: 8 additions & 0 deletions cmd/krel/cmd/obs_release.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,14 @@ submit a Google Cloud Build (GCB) job which does:
var obsReleaseOptions = obs.DefaultReleaseOptions()

func init() {
obsReleaseCmd.PersistentFlags().
StringVar(
&obsReleaseOptions.Workspace,
"workspace",
obsReleaseOptions.Workspace,
"Workspace directory for running krel obs",
)

obsReleaseCmd.PersistentFlags().
StringVar(
&obsReleaseOptions.ReleaseType,
Expand Down
8 changes: 8 additions & 0 deletions cmd/krel/cmd/obs_stage.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,14 @@ const (
)

func init() {
obsStageCmd.PersistentFlags().
StringVar(
&obsStageOptions.Workspace,
"workspace",
obsStageOptions.Workspace,
"Workspace directory for running krel obs",
)

obsStageCmd.PersistentFlags().
StringVar(
&obsStageOptions.ReleaseType,
Expand Down
10 changes: 7 additions & 3 deletions pkg/obs/obs.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,15 @@ const (

// workspaceDir is the global directory where the stage and release process
// happens.
workspaceDir = "/workspace"
defaultWorkspaceDir = "/workspace"

// defaultSpecTemplatePath is path inside Google Cloud Build where package
// specs for kubeadm, kubectl, and kubelet are located.
defaultSpecTemplatePath = workspaceDir + "/go/src/k8s.io/release/" + consts.DefaultSpecTemplatePath
defaultSpecTemplatePath = defaultWorkspaceDir + "/go/src/k8s.io/release/" + consts.DefaultSpecTemplatePath

// obsRoot is path inside Google Cloud Build where OBS project and packages
// are checked out.
obsRoot = workspaceDir + "/src/obs"
obsRoot = "/src/obs"

// obsAPIURL is the URL of openSUSE's OpenBuildService instance.
obsAPIURL = "https://api.opensuse.org"
Expand All @@ -78,6 +78,9 @@ const (
// Options are settings which will be used by `StageOptions` as well as
// `ReleaseOptions`.
type Options struct {
// Workspace is the root workspace.
Workspace string

// Run the whole process in non-mocked mode. Which means that it doesn't
// push specs and artifacts to OpenBuildService.
NoMock bool
Expand Down Expand Up @@ -150,6 +153,7 @@ func DefaultOptions() *Options {
consts.ArchitectureS390X,
},
SpecTemplatePath: defaultSpecTemplatePath,
Workspace: defaultWorkspaceDir,
}
}

Expand Down
57 changes: 35 additions & 22 deletions pkg/obs/obsfakes/fake_release_impl.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 2633f4f

Please sign in to comment.