Skip to content

Commit

Permalink
update controller-gen to v0.2.4
Browse files Browse the repository at this point in the history
This upgrade adds structural information to the generated CRDs for
the IntOrString fields.
The addition of the 'x-kubernetes-int-or-string: true' field to
the CRD causes some additional validation to take place which in
turn requires the godoc comment on the ObjectMeta field to be
removed to prevent validation errors.

See related controller-tools issue for more details:
kubernetes-sigs/controller-tools#373
  • Loading branch information
pgier committed Dec 9, 2019
1 parent 9f08ca1 commit bb109f8
Show file tree
Hide file tree
Showing 23 changed files with 630 additions and 300 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ require (
k8s.io/client-go v12.0.0+incompatible
k8s.io/code-generator v0.0.0-20190912054826-cd179ad6a269
k8s.io/klog v0.4.0
sigs.k8s.io/controller-tools v0.2.2
sigs.k8s.io/controller-tools v0.2.4
)

replace (
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -626,6 +626,8 @@ modernc.org/xc v1.0.0/go.mod h1:mRNCo0bvLjGhHO9WsyuKVU4q0ceiDDDoEeWDJHrNx8I=
rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8=
sigs.k8s.io/controller-tools v0.2.2 h1:tOXKme2gR7KoM6+7Y+nzjwjbXDgqLfTuX5r7+4dvlig=
sigs.k8s.io/controller-tools v0.2.2/go.mod h1:8SNGuj163x/sMwydREj7ld5mIMJu1cDanIfnx6xsU70=
sigs.k8s.io/controller-tools v0.2.4 h1:la1h46EzElvWefWLqfsXrnsO3lZjpkI0asTpX6h8PLA=
sigs.k8s.io/controller-tools v0.2.4/go.mod h1:m/ztfQNocGYBgTTCmFdnK94uVvgxeZeE3LtJvd/jIzA=
sigs.k8s.io/structured-merge-diff v0.0.0-20190817042607-6149e4549fca/go.mod h1:IIgPezJWb76P0hotTxzDbWsMYB8APh18qZnxkomBpxA=
sigs.k8s.io/yaml v1.1.0 h1:4A07+ZFc2wgJwo8YNlQpr1rVlgUDlxXHhPJciaPY5gs=
sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o=
24 changes: 5 additions & 19 deletions pkg/apis/monitoring/v1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,7 @@ const (
// +genclient
// +k8s:openapi-gen=true
type Prometheus struct {
metav1.TypeMeta `json:",inline"`
// Standard object’s metadata. More info:
// https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata
// +k8s:openapi-gen=false
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
// Specification of the desired behavior of the Prometheus cluster. More info:
// https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
Expand Down Expand Up @@ -536,10 +533,7 @@ type AlertmanagerEndpoints struct {
// +genclient
// +k8s:openapi-gen=true
type ServiceMonitor struct {
metav1.TypeMeta `json:",inline"`
// Standard object’s metadata. More info:
// https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata
// +k8s:openapi-gen=false
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
// Specification of desired Service selection for target discovery by
// Prometheus.
Expand Down Expand Up @@ -610,10 +604,7 @@ type Endpoint struct {
// +genclient
// +k8s:openapi-gen=true
type PodMonitor struct {
metav1.TypeMeta `json:",inline"`
// Standard object’s metadata. More info:
// https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata
// +k8s:openapi-gen=false
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
// Specification of desired Pod selection for target discovery by Prometheus.
Spec PodMonitorSpec `json:"spec"`
Expand Down Expand Up @@ -805,9 +796,7 @@ type PrometheusRuleList struct {
// +genclient
// +k8s:openapi-gen=true
type PrometheusRule struct {
metav1.TypeMeta `json:",inline"`
// Standard object’s metadata. More info:
// https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
// Specification of desired alerting rule definitions for Prometheus.
Spec PrometheusRuleSpec `json:"spec"`
Expand Down Expand Up @@ -846,10 +835,7 @@ type Rule struct {
// +genclient
// +k8s:openapi-gen=true
type Alertmanager struct {
metav1.TypeMeta `json:",inline"`
// Standard object’s metadata. More info:
// https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata
// +k8s:openapi-gen=false
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
// Specification of the desired behavior of the Alertmanager cluster. More info:
// https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
Expand Down
2 changes: 1 addition & 1 deletion vendor/modules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ k8s.io/utils/pointer
k8s.io/utils/buffer
k8s.io/utils/trace
k8s.io/utils/integer
# sigs.k8s.io/controller-tools v0.2.2
# sigs.k8s.io/controller-tools v0.2.4
sigs.k8s.io/controller-tools/cmd/controller-gen
sigs.k8s.io/controller-tools/pkg/crd
sigs.k8s.io/controller-tools/pkg/deepcopy
Expand Down
122 changes: 122 additions & 0 deletions vendor/sigs.k8s.io/controller-tools/pkg/crd/conv.go

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

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

2 changes: 1 addition & 1 deletion vendor/sigs.k8s.io/controller-tools/pkg/crd/flatten.go

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

86 changes: 75 additions & 11 deletions vendor/sigs.k8s.io/controller-tools/pkg/crd/gen.go

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

11 changes: 9 additions & 2 deletions vendor/sigs.k8s.io/controller-tools/pkg/crd/known_types.go

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

Loading

0 comments on commit bb109f8

Please sign in to comment.