...

Source file src/k8s.io/kubernetes/pkg/kubelet/apis/config/helpers.go

Documentation: k8s.io/kubernetes/pkg/kubelet/apis/config

     1  /*
     2  Copyright 2017 The Kubernetes Authors.
     3  
     4  Licensed under the Apache License, Version 2.0 (the "License");
     5  you may not use this file except in compliance with the License.
     6  You may obtain a copy of the License at
     7  
     8      http://www.apache.org/licenses/LICENSE-2.0
     9  
    10  Unless required by applicable law or agreed to in writing, software
    11  distributed under the License is distributed on an "AS IS" BASIS,
    12  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    13  See the License for the specific language governing permissions and
    14  limitations under the License.
    15  */
    16  
    17  package config
    18  
    19  // KubeletConfigurationPathRefs returns pointers to all of the KubeletConfiguration fields that contain filepaths.
    20  // You might use this, for example, to resolve all relative paths against some common root before
    21  // passing the configuration to the application. This method must be kept up to date as new fields are added.
    22  func KubeletConfigurationPathRefs(kc *KubeletConfiguration) []*string {
    23  	paths := []*string{}
    24  	paths = append(paths, &kc.StaticPodPath)
    25  	paths = append(paths, &kc.Authentication.X509.ClientCAFile)
    26  	paths = append(paths, &kc.TLSCertFile)
    27  	paths = append(paths, &kc.TLSPrivateKeyFile)
    28  	paths = append(paths, &kc.ResolverConfig)
    29  	paths = append(paths, &kc.VolumePluginDir)
    30  	paths = append(paths, &kc.PodLogsDir)
    31  	return paths
    32  }
    33  

View as plain text