MCPcopy Create free account
hub / github.com/NVIDIA/gpu-operator / validate

Method validate

cmd/nvidia-validator/main.go:1807–1840  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1805}
1806
1807func (c *CCManager) validate() error {
1808 // delete status file if already present
1809 err := deleteStatusFile(outputDirFlag + "/" + ccManagerStatusFile)
1810 if err != nil {
1811 return err
1812 }
1813
1814 kubeConfig, err := rest.InClusterConfig()
1815 if err != nil {
1816 return fmt.Errorf("error getting cluster config - %w", err)
1817 }
1818
1819 kubeClient, err := kubernetes.NewForConfig(kubeConfig)
1820 if err != nil {
1821 log.Errorf("Error getting k8s client - %v\n", err)
1822 return err
1823 }
1824
1825 // update k8s client for fetching node labels
1826 c.setKubeClient(kubeClient)
1827
1828 err = c.runValidation(false)
1829 if err != nil {
1830 fmt.Println("CC Manager is not ready")
1831 return err
1832 }
1833
1834 // create driver status file
1835 err = createStatusFile(outputDirFlag + "/" + ccManagerStatusFile)
1836 if err != nil {
1837 return err
1838 }
1839 return nil
1840}
1841
1842func (c *CCManager) runValidation(silent bool) error {
1843 node, err := getNode(c.ctx, c.kubeClient)

Callers 1

validateComponentFunction · 0.95

Calls 4

setKubeClientMethod · 0.95
runValidationMethod · 0.95
deleteStatusFileFunction · 0.85
createStatusFileFunction · 0.85

Tested by

no test coverage detected