Skip to content
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
5 changes: 5 additions & 0 deletions imageregistry/v1/00-crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,11 @@ spec:
type: object
additionalProperties:
type: string
rolloutStrategy:
description: rolloutStrategy defines rollout strategy for the image
registry deployment. Valid values are RollingUpdate (default) and Recreate.
type: string
pattern: ^(RollingUpdate|Recreate)$
routes:
description: routes defines additional external facing routes which
should be created for the registry.
Expand Down
5 changes: 5 additions & 0 deletions imageregistry/v1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,11 @@ type ImageRegistrySpec struct {
// tolerations defines the tolerations for the registry pod.
// +optional
Tolerations []corev1.Toleration `json:"tolerations,omitempty" protobuf:"bytes,14,rep,name=tolerations"`
// rolloutStrategy defines rollout strategy for the image registry
// deployment.
// +optional
// +kubebuilder:validation:Pattern=`^(RollingUpdate|Recreate)$`
RolloutStrategy string `json:"rolloutStrategy" protobuf:"bytes,15,opt,name=rolloutStrategy"`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sttts can we make this a appsv1.DeploymentStrategyType [1]? Would we automatically get the validation pattern we want?

If not, then the validation pattern needs to be added as a comment tag - see [2] as an example.

[1] https://github.com/kubernetes/api/blob/master/apps/v1/types.go#L335
[2] https://github.com/openshift/api/blob/master/imageregistry/v1/types.go#L239

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@adambkaplan upstream types are coded (and validated) in Go. There is no connection to these validation here and those in Go land.

}

// ImageRegistryStatus reports image registry operational status.
Expand Down
1 change: 1 addition & 0 deletions imageregistry/v1/zz_generated.swagger_doc_generated.go

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