Skip to content

Commit

Permalink
Fix review comment
Browse files Browse the repository at this point in the history
  • Loading branch information
savitaashture committed Aug 13, 2019
1 parent 72eb1c3 commit f708b21
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 0 deletions.
20 changes: 20 additions & 0 deletions pkg/apis/serving/v1alpha1/configuration_validation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,26 @@ func TestConfigurationValidation(t *testing.T) {
},
want: apis.ErrInvalidValue("not a DNS 1035 label prefix: [a DNS-1035 label must consist of lower case alphanumeric characters or '-', start with an alphabetic character, and end with an alphanumeric character (e.g. 'my-name', or 'abc-123', regex used for validation is '[a-z]([-a-z0-9]*[a-z0-9])?')]",
"spec.revisionTemplate.metadata.generateName"),
}, {
name: "valid generate name for configuration spec",
c: &Configuration{
ObjectMeta: metav1.ObjectMeta{
Name: "byo-name",
},
Spec: ConfigurationSpec{
DeprecatedRevisionTemplate: &RevisionTemplateSpec{
ObjectMeta: metav1.ObjectMeta{
GenerateName: "valid-generatename",
},
Spec: RevisionSpec{
DeprecatedContainer: &corev1.Container{
Image: "hellworld",
},
},
},
},
},
want: nil,
}}

for _, test := range tests {
Expand Down
22 changes: 22 additions & 0 deletions pkg/apis/serving/v1beta1/configuration_validation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,28 @@ func TestConfigurationValidation(t *testing.T) {
},
want: apis.ErrInvalidValue("not a DNS 1035 label prefix: [a DNS-1035 label must consist of lower case alphanumeric characters or '-', start with an alphabetic character, and end with an alphanumeric character (e.g. 'my-name', or 'abc-123', regex used for validation is '[a-z]([-a-z0-9]*[a-z0-9])?')]",
"spec.template.metadata.generateName"),
}, {
name: "valid generate name for configuration spec",
c: &Configuration{
ObjectMeta: metav1.ObjectMeta{
Name: "byo-name",
},
Spec: ConfigurationSpec{
Template: RevisionTemplateSpec{
ObjectMeta: metav1.ObjectMeta{
GenerateName: "valid-generatename",
},
Spec: RevisionSpec{
PodSpec: corev1.PodSpec{
Containers: []corev1.Container{{
Image: "hellworld",
}},
},
},
},
},
},
want: nil,
}}

// TODO(dangerd): PodSpec validation failures.
Expand Down

0 comments on commit f708b21

Please sign in to comment.