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

Make --workspace configurable in obs stage/release #3271

Merged
merged 1 commit into from
Sep 14, 2023
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
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