mirror of
				https://github.com/optim-enterprises-bv/kubernetes.git
				synced 2025-11-03 19:58:17 +00:00 
			
		
		
		
	Make one of the go2idl unit tests pass in a sandbox.
This commit is contained in:
		@@ -26,10 +26,7 @@ go_test(
 | 
				
			|||||||
    name = "go_default_test",
 | 
					    name = "go_default_test",
 | 
				
			||||||
    srcs = ["openapi_test.go"],
 | 
					    srcs = ["openapi_test.go"],
 | 
				
			||||||
    library = "go_default_library",
 | 
					    library = "go_default_library",
 | 
				
			||||||
    tags = [
 | 
					    tags = ["automanaged"],
 | 
				
			||||||
        "automanaged",
 | 
					 | 
				
			||||||
        "skip",
 | 
					 | 
				
			||||||
    ],
 | 
					 | 
				
			||||||
    deps = [
 | 
					    deps = [
 | 
				
			||||||
        "//vendor:github.com/stretchr/testify/assert",
 | 
					        "//vendor:github.com/stretchr/testify/assert",
 | 
				
			||||||
        "//vendor:k8s.io/gengo/generator",
 | 
					        "//vendor:k8s.io/gengo/generator",
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -70,11 +70,6 @@ func TestSimple(t *testing.T) {
 | 
				
			|||||||
	err, assert, buffer := testOpenAPITypeWritter(t, `
 | 
						err, assert, buffer := testOpenAPITypeWritter(t, `
 | 
				
			||||||
package foo
 | 
					package foo
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import (
 | 
					 | 
				
			||||||
	"time"
 | 
					 | 
				
			||||||
	"k8s.io/kubernetes/pkg/util/intstr"
 | 
					 | 
				
			||||||
)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
// Blah is a test.
 | 
					// Blah is a test.
 | 
				
			||||||
// +k8s:openapi=true
 | 
					// +k8s:openapi=true
 | 
				
			||||||
type Blah struct {
 | 
					type Blah struct {
 | 
				
			||||||
@@ -110,12 +105,8 @@ type Blah struct {
 | 
				
			|||||||
	Float64 float64
 | 
						Float64 float64
 | 
				
			||||||
	// A simple float32
 | 
						// A simple float32
 | 
				
			||||||
	Float32 float32
 | 
						Float32 float32
 | 
				
			||||||
	// A simple time
 | 
					 | 
				
			||||||
	Time time.Time
 | 
					 | 
				
			||||||
	// a base64 encoded characters
 | 
						// a base64 encoded characters
 | 
				
			||||||
	ByteArray []byte
 | 
						ByteArray []byte
 | 
				
			||||||
	// an int or string type
 | 
					 | 
				
			||||||
	IntOrString intstr.IntOrString
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
		`)
 | 
							`)
 | 
				
			||||||
	if err != nil {
 | 
						if err != nil {
 | 
				
			||||||
@@ -224,13 +215,6 @@ Type: []string{"number"},
 | 
				
			|||||||
Format: "float",
 | 
					Format: "float",
 | 
				
			||||||
},
 | 
					},
 | 
				
			||||||
},
 | 
					},
 | 
				
			||||||
"Time": {
 | 
					 | 
				
			||||||
SchemaProps: spec.SchemaProps{
 | 
					 | 
				
			||||||
Description: "A simple time",
 | 
					 | 
				
			||||||
Type: []string{"string"},
 | 
					 | 
				
			||||||
Format: "date-time",
 | 
					 | 
				
			||||||
},
 | 
					 | 
				
			||||||
},
 | 
					 | 
				
			||||||
"ByteArray": {
 | 
					"ByteArray": {
 | 
				
			||||||
SchemaProps: spec.SchemaProps{
 | 
					SchemaProps: spec.SchemaProps{
 | 
				
			||||||
Description: "a base64 encoded characters",
 | 
					Description: "a base64 encoded characters",
 | 
				
			||||||
@@ -238,18 +222,12 @@ Type: []string{"string"},
 | 
				
			|||||||
Format: "byte",
 | 
					Format: "byte",
 | 
				
			||||||
},
 | 
					},
 | 
				
			||||||
},
 | 
					},
 | 
				
			||||||
"IntOrString": {
 | 
					 | 
				
			||||||
SchemaProps: spec.SchemaProps{
 | 
					 | 
				
			||||||
Description: "an int or string type",
 | 
					 | 
				
			||||||
Ref: spec.MustCreateRef("#/definitions/intstr.IntOrString"),
 | 
					 | 
				
			||||||
},
 | 
					},
 | 
				
			||||||
},
 | 
					Required: []string{"String","Int64","Int32","Int16","Int8","Uint","Uint64","Uint32","Uint16","Uint8","Byte","Bool","Float64","Float32","ByteArray"},
 | 
				
			||||||
},
 | 
					 | 
				
			||||||
Required: []string{"String","Int64","Int32","Int16","Int8","Uint","Uint64","Uint32","Uint16","Uint8","Byte","Bool","Float64","Float32","Time","ByteArray","IntOrString"},
 | 
					 | 
				
			||||||
},
 | 
					},
 | 
				
			||||||
},
 | 
					},
 | 
				
			||||||
Dependencies: []string{
 | 
					Dependencies: []string{
 | 
				
			||||||
"intstr.IntOrString",},
 | 
					},
 | 
				
			||||||
},
 | 
					},
 | 
				
			||||||
`, buffer.String())
 | 
					`, buffer.String())
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user