Skip to content

Commit

Permalink
Merge pull request #348 from damdo/resourcebuilder-configv1-infrastru…
Browse files Browse the repository at this point in the history
…cture-more-fields

NO-JIRA: resourcebuilder: configv1/infrastructure: allow setting more status fields
  • Loading branch information
openshift-merge-bot[bot] authored Dec 4, 2024
2 parents 9dd3dcb + 6b5afaa commit 84b1711
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions testutils/resourcebuilder/config/v1/infrastructure.go
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,17 @@ func (i InfrastructureBuilder) WithGenerateName(generateName string) Infrastruct
return i
}

// WithInfrastructureName sets the infrastructureName in the status for the infrastructure builder.
func (i InfrastructureBuilder) WithInfrastructureName(infraName string) InfrastructureBuilder {
if i.status == nil {
i.status = &configv1.InfrastructureStatus{}
}

i.status.InfrastructureName = infraName

return i
}

// WithLabel sets the labels for the infrastructure builder.
func (i InfrastructureBuilder) WithLabel(key, value string) InfrastructureBuilder {
if i.labels == nil {
Expand Down Expand Up @@ -405,3 +416,20 @@ func (i InfrastructureBuilder) WithNamespace(namespace string) InfrastructureBui
i.namespace = namespace
return i
}

// WithPlatformStatus sets the platformStatus for the infrastructure builder.
func (i InfrastructureBuilder) WithPlatformStatus(ps configv1.PlatformStatus) InfrastructureBuilder {
if i.status == nil {
i.status = &configv1.InfrastructureStatus{}
}

i.status.PlatformStatus = &ps

return i
}

// WithStatus sets the status for the infrastructure builder.
func (i InfrastructureBuilder) WithStatus(status configv1.InfrastructureStatus) InfrastructureBuilder {
i.status = &status
return i
}

0 comments on commit 84b1711

Please sign in to comment.