Skip to content
Open
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
12 changes: 6 additions & 6 deletions pkg/shp/flags/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,22 @@ func BuildSpecFromFlags(flags *pflag.FlagSet) (*buildv1beta1.BuildSpec, *string,
pruneOption := buildv1beta1.PruneNever
spec := &buildv1beta1.BuildSpec{
Source: &buildv1beta1.Source{
ContextDir: ptr.To(""),
ContextDir: new(string),
Git: &buildv1beta1.Git{
Revision: ptr.To(""),
CloneSecret: ptr.To(""),
Revision: new(string),
CloneSecret: new(string),
},
OCIArtifact: &buildv1beta1.OCIArtifact{
Prune: &pruneOption,
PullSecret: ptr.To(""),
PullSecret: new(string),
},
},
Strategy: buildv1beta1.Strategy{
Kind: &clusterBuildStrategyKind,
},
Output: buildv1beta1.Image{
Insecure: ptr.To(false),
PushSecret: ptr.To(""),
PushSecret: new(string),
Labels: map[string]string{},
Annotations: map[string]string{},
},
Expand All @@ -45,7 +45,7 @@ func BuildSpecFromFlags(flags *pflag.FlagSet) (*buildv1beta1.BuildSpec, *string,
TTLAfterSucceeded: &metav1.Duration{},
},
NodeSelector: map[string]string{},
SchedulerName: ptr.To(""),
SchedulerName: new(string),
}

sourceFlags(flags, spec.Source)
Expand Down
4 changes: 2 additions & 2 deletions pkg/shp/flags/build_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ func TestSanitizeBuildSpec(t *testing.T) {
name: "should clean-up `.spec.source.credentials`",
in: buildv1beta1.BuildSpec{Source: &buildv1beta1.Source{
Git: &buildv1beta1.Git{
CloneSecret: ptr.To(""),
CloneSecret: new(string),
},
}},
out: buildv1beta1.BuildSpec{},
Expand Down Expand Up @@ -237,7 +237,7 @@ func TestSanitizeBuildSpec(t *testing.T) {
name: "should clean-up an empty source contextDir",
in: buildv1beta1.BuildSpec{
Source: &buildv1beta1.Source{
ContextDir: ptr.To(""),
ContextDir: new(string),
},
},
out: buildv1beta1.BuildSpec{},
Expand Down
8 changes: 4 additions & 4 deletions pkg/shp/flags/buildrun.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ import (
func BuildRunSpecFromFlags(flags *pflag.FlagSet) *buildv1beta1.BuildRunSpec {
spec := &buildv1beta1.BuildRunSpec{
Build: buildv1beta1.ReferencedBuild{
Name: ptr.To(""),
Name: new(string),
},
ServiceAccount: ptr.To(""),
ServiceAccount: new(string),
Timeout: &metav1.Duration{},
Output: &buildv1beta1.Image{
PushSecret: ptr.To(""),
PushSecret: new(string),
Insecure: ptr.To(false),
Labels: map[string]string{},
Annotations: map[string]string{},
Expand All @@ -29,7 +29,7 @@ func BuildRunSpecFromFlags(flags *pflag.FlagSet) *buildv1beta1.BuildRunSpec {
TTLAfterSucceeded: &metav1.Duration{},
},
NodeSelector: map[string]string{},
SchedulerName: ptr.To(""),
SchedulerName: new(string),
}

buildRefFlags(flags, &spec.Build)
Expand Down
2 changes: 1 addition & 1 deletion pkg/shp/flags/buildrun_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ func TestSanitizeBuildRunSpec(t *testing.T) {
out: buildv1beta1.BuildRunSpec{},
}, {
name: "should clean-up service-account",
in: buildv1beta1.BuildRunSpec{ServiceAccount: ptr.To("")},
in: buildv1beta1.BuildRunSpec{ServiceAccount: new(string)},
out: buildv1beta1.BuildRunSpec{},
}, {
name: "should clean-up output",
Expand Down