@@ -95,10 +95,23 @@ func TestValidation(t *testing.T) {
95
95
return
96
96
}
97
97
98
- prrFilename := filepath .Join (prrsDir , kep .OwningSIG , kep .Number )
98
+ var stageMilestone string
99
+ switch kep .Stage {
100
+ case "alpha" :
101
+ stageMilestone = kep .Milestone .Alpha
102
+ case "beta" :
103
+ stageMilestone = kep .Milestone .Beta
104
+ case "stable" :
105
+ stageMilestone = kep .Milestone .Stable
106
+ }
107
+
108
+ prrFilename := kep .Number + ".yaml"
109
+ prrFilename = filepath .Join (prrsDir , kep .OwningSIG , prrFilename )
99
110
prrFile , err := os .Open (prrFilename )
100
111
if os .IsNotExist (err ) {
101
- t .Errorf ("missing PRR Approval file under: %s" , prrFilename )
112
+ t .Errorf ("PRR approval is required to target milestone %v (stage %v)" , stageMilestone , kep .Stage )
113
+ t .Errorf ("For more details about PRR approval see: https://github.com/kubernetes/community/blob/master/sig-architecture/production-readiness.md" )
114
+ t .Errorf ("To get PRR approval modify appropriately file %s and have this approved by PRR team" , prrFilename )
102
115
return
103
116
}
104
117
if err != nil {
@@ -110,23 +123,21 @@ func TestValidation(t *testing.T) {
110
123
return
111
124
}
112
125
113
- var stageMilestone string
114
126
var stagePRRApprover string
115
127
switch kep .Stage {
116
128
case "alpha" :
117
- stageMilestone = kep .Milestone .Alpha
118
129
stagePRRApprover = prr .Alpha .Approver
119
130
case "beta" :
120
- stageMilestone = kep .Milestone .Beta
121
131
stagePRRApprover = prr .Beta .Approver
122
132
case "stable" :
123
- stageMilestone = kep .Milestone .Stable
124
133
stagePRRApprover = prr .Stable .Approver
125
134
}
126
135
if len (stageMilestone ) > 0 && stageMilestone >= "v1.21" {
127
136
// PRR approval is needed.
128
137
if len (stagePRRApprover ) == 0 {
129
- t .Errorf ("PRR not approved for: %s" , kep .Stage )
138
+ t .Errorf ("PRR approval is required to target milestone %v (stage %v)" , stageMilestone , kep .Stage )
139
+ t .Errorf ("For more details about PRR approval see: https://github.com/kubernetes/community/blob/master/sig-architecture/production-readiness.md" )
140
+ t .Errorf ("To get PRR approval modify appropriately file %s and have this approved by PRR team" , prrFilename )
130
141
}
131
142
}
132
143
})
0 commit comments