Skip to content

Commit

Permalink
Merge pull request #687 from ImJasonH/unify
Browse files Browse the repository at this point in the history
Unify Go struct field names with YAML/JSON field names
  • Loading branch information
openshift-merge-robot authored Mar 24, 2021
2 parents 023e050 + ca44420 commit 6fb0218
Show file tree
Hide file tree
Showing 29 changed files with 345 additions and 369 deletions.
69 changes: 35 additions & 34 deletions deploy/crds/shipwright.io_buildruns.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,17 +74,16 @@ spec:
spec
properties:
credentials:
description: SecretRef is a reference to the Secret containing
the credentials to push the image to the registry
description: Credentials references a Secret that contains credentials
to access the image registry.
properties:
name:
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
TODO: Add other useful fields. apiVersion, kind, uid?'
type: string
type: object
image:
description: ImageURL is the URL where the image will be pushed
to.
description: Image is the reference of the image.
type: string
required:
- image
Expand Down Expand Up @@ -115,21 +114,20 @@ spec:
description: BuildSpec is the Build Spec of this BuildRun.
properties:
builder:
description: BuilderImage refers to the image containing the build
description: Builder refers to the image containing the build
tools inside which the source code would be built.
properties:
credentials:
description: SecretRef is a reference to the Secret containing
the credentials to push the image to the registry
description: Credentials references a Secret that contains
credentials to access the image registry.
properties:
name:
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
TODO: Add other useful fields. apiVersion, kind, uid?'
type: string
type: object
image:
description: ImageURL is the URL where the image will be pushed
to.
description: Image is the reference of the image.
type: string
required:
- image
Expand All @@ -140,21 +138,20 @@ spec:
an image.
type: string
output:
description: Output refers to the location where the generated
image would be pushed to.
description: Output refers to the location where the built image
would be pushed.
properties:
credentials:
description: SecretRef is a reference to the Secret containing
the credentials to push the image to the registry
description: Credentials references a Secret that contains
credentials to access the image registry.
properties:
name:
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
TODO: Add other useful fields. apiVersion, kind, uid?'
type: string
type: object
image:
description: ImageURL is the URL where the image will be pushed
to.
description: Image is the reference of the image.
type: string
required:
- image
Expand All @@ -177,14 +174,14 @@ spec:
type: object
type: array
runtime:
description: Runtime represents the runtime-image
description: Runtime represents the runtime-image.
properties:
base:
description: Base runtime base image.
properties:
credentials:
description: SecretRef is a reference to the Secret containing
the credentials to push the image to the registry
description: Credentials references a Secret that contains
credentials to access the image registry.
properties:
name:
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
Expand All @@ -193,8 +190,7 @@ spec:
type: string
type: object
image:
description: ImageURL is the URL where the image will
be pushed to.
description: Image is the reference of the image.
type: string
required:
- image
Expand Down Expand Up @@ -253,28 +249,28 @@ spec:
Optional.
type: string
credentials:
description: SecretRef refers to the secret that contains
credentials to access the git repo. Optional.
description: Credentials references a Secret that contains
credentials to access the repository.
properties:
name:
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
TODO: Add other useful fields. apiVersion, kind, uid?'
type: string
type: object
revision:
description: Ref is a git reference. Optional. If not defined,
it will fallback to the git repository default branch.
description: "Revision describes the Git revision (e.g., branch,
tag, commit SHA, etc.) to fetch. \n If not defined, it will
fallback to the repository's default branch."
type: string
url:
description: URL of the git repo
description: URL describes the URL of the Git repository.
type: string
required:
- url
type: object
strategy:
description: StrategyRef refers to the BuildStrategy to be used
to build the container image. There are namespaced scope and
cluster scope BuildStrategy
description: Strategy references the BuildStrategy to use to build
the container image.
properties:
apiVersion:
description: API version of the referent
Expand All @@ -290,7 +286,8 @@ spec:
- name
type: object
timeout:
description: Timeout defines the maximum run time of a build run.
description: Timeout defines the maximum amount of time the Build
should take to execute.
format: duration
type: string
required:
Expand All @@ -303,7 +300,8 @@ spec:
format: date-time
type: string
conditions:
description: Conditions
description: Conditions holds the latest available observations of
a resource's current state.
items:
description: Condition defines the required fields for populating
Build controllers Conditions
Expand Down Expand Up @@ -340,18 +338,21 @@ spec:
type: string
type: object
latestTaskRunRef:
description: PodName is the name of the pod responsible for executing
this task's steps.
description: "LatestTaskRunRef is the name of the TaskRun responsible
for executing this BuildRun. \n TODO: This should be called something
like \"TaskRunName\""
type: string
reason:
description: The Succeeded reason of the TaskRun
description: "The Succeeded reason of the TaskRun \n Deprecated: Use
Conditions instead. This will be removed in a future release."
type: string
startTime:
description: StartTime is the time the build is actually started.
format: date-time
type: string
succeeded:
description: The Succeeded status of the TaskRun
description: "The Succeeded status of the TaskRun \n Deprecated: Use
Conditions instead. This will be removed in a future release."
type: string
type: object
type: object
Expand Down
50 changes: 24 additions & 26 deletions deploy/crds/shipwright.io_builds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,21 +59,20 @@ spec:
description: BuildSpec defines the desired state of Build
properties:
builder:
description: BuilderImage refers to the image containing the build
tools inside which the source code would be built.
description: Builder refers to the image containing the build tools
inside which the source code would be built.
properties:
credentials:
description: SecretRef is a reference to the Secret containing
the credentials to push the image to the registry
description: Credentials references a Secret that contains credentials
to access the image registry.
properties:
name:
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
TODO: Add other useful fields. apiVersion, kind, uid?'
type: string
type: object
image:
description: ImageURL is the URL where the image will be pushed
to.
description: Image is the reference of the image.
type: string
required:
- image
Expand All @@ -83,21 +82,20 @@ spec:
build strategies which bank on the Dockerfile for building an image.
type: string
output:
description: Output refers to the location where the generated image
would be pushed to.
description: Output refers to the location where the built image would
be pushed.
properties:
credentials:
description: SecretRef is a reference to the Secret containing
the credentials to push the image to the registry
description: Credentials references a Secret that contains credentials
to access the image registry.
properties:
name:
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
TODO: Add other useful fields. apiVersion, kind, uid?'
type: string
type: object
image:
description: ImageURL is the URL where the image will be pushed
to.
description: Image is the reference of the image.
type: string
required:
- image
Expand All @@ -120,23 +118,22 @@ spec:
type: object
type: array
runtime:
description: Runtime represents the runtime-image
description: Runtime represents the runtime-image.
properties:
base:
description: Base runtime base image.
properties:
credentials:
description: SecretRef is a reference to the Secret containing
the credentials to push the image to the registry
description: Credentials references a Secret that contains
credentials to access the image registry.
properties:
name:
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
TODO: Add other useful fields. apiVersion, kind, uid?'
type: string
type: object
image:
description: ImageURL is the URL where the image will be pushed
to.
description: Image is the reference of the image.
type: string
required:
- image
Expand Down Expand Up @@ -194,28 +191,28 @@ spec:
description: ContextDir is a path to subfolder in the repo. Optional.
type: string
credentials:
description: SecretRef refers to the secret that contains credentials
to access the git repo. Optional.
description: Credentials references a Secret that contains credentials
to access the repository.
properties:
name:
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
TODO: Add other useful fields. apiVersion, kind, uid?'
type: string
type: object
revision:
description: Ref is a git reference. Optional. If not defined,
it will fallback to the git repository default branch.
description: "Revision describes the Git revision (e.g., branch,
tag, commit SHA, etc.) to fetch. \n If not defined, it will
fallback to the repository's default branch."
type: string
url:
description: URL of the git repo
description: URL describes the URL of the Git repository.
type: string
required:
- url
type: object
strategy:
description: StrategyRef refers to the BuildStrategy to be used to
build the container image. There are namespaced scope and cluster
scope BuildStrategy
description: Strategy references the BuildStrategy to use to build
the container image.
properties:
apiVersion:
description: API version of the referent
Expand All @@ -231,7 +228,8 @@ spec:
- name
type: object
timeout:
description: Timeout defines the maximum run time of a build run.
description: Timeout defines the maximum amount of time the Build
should take to execute.
format: duration
type: string
required:
Expand Down
38 changes: 21 additions & 17 deletions pkg/apis/build/v1alpha1/build_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,52 +65,56 @@ const (
type BuildSpec struct {
// Source refers to the Git repository containing the
// source code to be built.
Source GitSource `json:"source"`
Source Source `json:"source"`

// StrategyRef refers to the BuildStrategy to be used to
// build the container image.
// There are namespaced scope and cluster scope BuildStrategy
StrategyRef *StrategyRef `json:"strategy"`
// Strategy references the BuildStrategy to use to build the container
// image.
Strategy *Strategy `json:"strategy"`

// BuilderImage refers to the image containing the build tools
// inside which the source code would be built.
// Builder refers to the image containing the build tools inside which
// the source code would be built.
//
// +optional
BuilderImage *Image `json:"builder,omitempty"`
Builder *Image `json:"builder,omitempty"`

// Dockerfile is the path to the Dockerfile to be used for
// build strategies which bank on the Dockerfile for building
// an image.
//
// +optional
Dockerfile *string `json:"dockerfile,omitempty"`

// Parameters contains name-value that could be used to loosely
// type parameters in the BuildStrategy.
//
// +optional
Parameters *[]Parameter `json:"parameters,omitempty"`

// Runtime represents the runtime-image
// Runtime represents the runtime-image.
//
// +optional
Runtime *Runtime `json:"runtime,omitempty"`

// Output refers to the location where the generated
// image would be pushed to.
// Output refers to the location where the built image would be pushed.
Output Image `json:"output"`

// Timeout defines the maximum run time of a build run.
// Timeout defines the maximum amount of time the Build should take to execute.
//
// +optional
// +kubebuilder:validation:Format=duration
Timeout *metav1.Duration `json:"timeout,omitempty"`
}

// Image refers to an container image with credentials
type Image struct {
// ImageURL is the URL where the image will be pushed to.
ImageURL string `json:"image"`
// Image is the reference of the image.
Image string `json:"image"`

// SecretRef is a reference to the Secret containing the
// credentials to push the image to the registry
// Credentials references a Secret that contains credentials to access
// the image registry.
//
// +optional
SecretRef *corev1.LocalObjectReference `json:"credentials,omitempty"`
Credentials *corev1.LocalObjectReference `json:"credentials,omitempty"`
}

// Runtime represents the runtime-image, created using parts of builder-image, and a different
Expand Down
1 change: 0 additions & 1 deletion pkg/apis/build/v1alpha1/buildrun_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ const (

// BuildRunSpec defines the desired state of BuildRun
type BuildRunSpec struct {

// BuildRef refers to the Build
BuildRef *BuildRef `json:"buildRef"`

Expand Down
Loading

0 comments on commit 6fb0218

Please sign in to comment.