Merge pull request #122438 from kannon92/splitfs-tests
[KEP - 4191]: Use Cadvisor labels rather than hard coding them into kubelet
This commit is contained in:
		@@ -68,7 +68,7 @@ func TestContainerFsInfoLabel(t *testing.T) {
 | 
				
			|||||||
	}{{
 | 
						}{{
 | 
				
			||||||
		description:     "LabelCrioWriteableImages should be returned",
 | 
							description:     "LabelCrioWriteableImages should be returned",
 | 
				
			||||||
		runtimeEndpoint: crio.CrioSocket,
 | 
							runtimeEndpoint: crio.CrioSocket,
 | 
				
			||||||
		expectedLabel:   LabelCrioContainers,
 | 
							expectedLabel:   cadvisorfs.LabelCrioContainers,
 | 
				
			||||||
		expectedError:   nil,
 | 
							expectedError:   nil,
 | 
				
			||||||
	}, {
 | 
						}, {
 | 
				
			||||||
		description:     "Cannot find valid imagefs label",
 | 
							description:     "Cannot find valid imagefs label",
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -26,11 +26,6 @@ import (
 | 
				
			|||||||
	cadvisorfs "github.com/google/cadvisor/fs"
 | 
						cadvisorfs "github.com/google/cadvisor/fs"
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// LabelCrioContainers is a label to allow for cadvisor to track writeable layers
 | 
					 | 
				
			||||||
// separately from read-only layers.
 | 
					 | 
				
			||||||
// Once CAdvisor upstream changes are merged, we should remove this constant
 | 
					 | 
				
			||||||
const LabelCrioContainers string = "crio-containers"
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
// imageFsInfoProvider knows how to translate the configured runtime
 | 
					// imageFsInfoProvider knows how to translate the configured runtime
 | 
				
			||||||
// to its file system label for images.
 | 
					// to its file system label for images.
 | 
				
			||||||
type imageFsInfoProvider struct {
 | 
					type imageFsInfoProvider struct {
 | 
				
			||||||
@@ -50,7 +45,7 @@ func (i *imageFsInfoProvider) ImageFsInfoLabel() (string, error) {
 | 
				
			|||||||
// For remote runtimes, it handles addition runtimes natively understood by cAdvisor.
 | 
					// For remote runtimes, it handles addition runtimes natively understood by cAdvisor.
 | 
				
			||||||
func (i *imageFsInfoProvider) ContainerFsInfoLabel() (string, error) {
 | 
					func (i *imageFsInfoProvider) ContainerFsInfoLabel() (string, error) {
 | 
				
			||||||
	if detectCrioWorkaround(i) {
 | 
						if detectCrioWorkaround(i) {
 | 
				
			||||||
		return LabelCrioContainers, nil
 | 
							return cadvisorfs.LabelCrioContainers, nil
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	return "", fmt.Errorf("no containerfs label for configured runtime")
 | 
						return "", fmt.Errorf("no containerfs label for configured runtime")
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user