Skip to content

Commit

Permalink
Feat: Adding hostAliases in PodTemplate spec.
Browse files Browse the repository at this point in the history
  • Loading branch information
xclud authored and Mahdi committed Apr 19, 2021
1 parent 5addfb3 commit 3bb7ec5
Show file tree
Hide file tree
Showing 6 changed files with 280 additions and 194 deletions.
5 changes: 5 additions & 0 deletions pkg/apis/pipeline/pod/template.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,11 @@ type Template struct {
// +optional
ImagePullSecrets []corev1.LocalObjectReference `json:"imagePullSecrets,omitempty"`

// HostAliases is an optional list of hosts and IPs that will be injected into the pod's hosts
// file if specified. This is only valid for non-hostNetwork pods.
// +optional
HostAliases []corev1.HostAlias `json:"hostAliases,omitempty" protobuf:"bytes,23,rep,name=hostAliases"`

// HostNetwork specifies whether the pod may use the node network namespace
// +optional
HostNetwork bool `json:"hostNetwork,omitempty"`
Expand Down
5 changes: 5 additions & 0 deletions pkg/apis/pipeline/pod/zz_generated.deepcopy.go

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

20 changes: 17 additions & 3 deletions pkg/apis/pipeline/v1beta1/openapi_generated.go

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

8 changes: 8 additions & 0 deletions pkg/apis/pipeline/v1beta1/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,14 @@
"description": "EnableServiceLinks indicates whether information about services should be injected into pod's environment variables, matching the syntax of Docker links. Optional: Defaults to true.",
"type": "boolean"
},
"hostAliases": {
"description": "HostAliases is an optional list of hosts and IPs that will be injected into the pod's hosts file if specified. This is only valid for non-hostNetwork pods.",
"type": "array",
"items": {
"default": {},
"$ref": "#/definitions/v1.HostAlias"
}
},
"hostNetwork": {
"description": "HostNetwork specifies whether the pod may use the node network namespace",
"type": "boolean"
Expand Down
1 change: 1 addition & 0 deletions pkg/pod/pod.go
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,7 @@ func (b *Builder) Build(ctx context.Context, taskRun *v1beta1.TaskRun, taskSpec
EnableServiceLinks: podTemplate.EnableServiceLinks,
PriorityClassName: priorityClassName,
ImagePullSecrets: podTemplate.ImagePullSecrets,
HostAliases: podTemplate.HostAliases,
},
}, nil
}
Expand Down
Loading

0 comments on commit 3bb7ec5

Please sign in to comment.