mirror of
				https://github.com/optim-enterprises-bv/kubernetes.git
				synced 2025-11-04 04:08:16 +00:00 
			
		
		
		
	genericapiserver: turn APIContainer.SecretRoutes into a real ServeMux
This commit is contained in:
		@@ -29,8 +29,12 @@ import (
 | 
				
			|||||||
// handlers that do not show up in swagger or in /
 | 
					// handlers that do not show up in swagger or in /
 | 
				
			||||||
type APIContainer struct {
 | 
					type APIContainer struct {
 | 
				
			||||||
	*restful.Container
 | 
						*restful.Container
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						// NonSwaggerRoutes are recorded and are visible at /, but do not show up in Swagger.
 | 
				
			||||||
	NonSwaggerRoutes PathRecorderMux
 | 
						NonSwaggerRoutes PathRecorderMux
 | 
				
			||||||
	SecretRoutes     Mux
 | 
					
 | 
				
			||||||
 | 
						// SecretRoutes are not recorded, are not visible at / and do not show up in Swagger.
 | 
				
			||||||
 | 
						SecretRoutes *http.ServeMux
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// NewAPIContainer constructs a new container for APIs
 | 
					// NewAPIContainer constructs a new container for APIs
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -26,7 +26,7 @@ import (
 | 
				
			|||||||
func TestNewAPIContainer(t *testing.T) {
 | 
					func TestNewAPIContainer(t *testing.T) {
 | 
				
			||||||
	mux := http.NewServeMux()
 | 
						mux := http.NewServeMux()
 | 
				
			||||||
	c := NewAPIContainer(mux, nil)
 | 
						c := NewAPIContainer(mux, nil)
 | 
				
			||||||
	assert.Equal(t, mux, c.SecretRoutes.(*http.ServeMux), "SecretRoutes ServeMux's do not match")
 | 
						assert.Equal(t, mux, c.SecretRoutes, "SecretRoutes ServeMux's do not match")
 | 
				
			||||||
	assert.Equal(t, mux, c.Container.ServeMux, "Container ServeMux's do not match")
 | 
						assert.Equal(t, mux, c.Container.ServeMux, "Container ServeMux's do not match")
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user