Documentation ¶
Overview ¶
Copyright 2020 Mirantis, Inc.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2020 Mirantis, Inc.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2020 Mirantis, Inc.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2020 Mirantis, Inc.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2020 Mirantis, Inc.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2020 Mirantis, Inc.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2020 Mirantis, Inc.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- func AllAddresses() ([]string, error)
- func CheckIfUserExists(name string) (bool, error)
- func CheckPathPermissions(path string, perm os.FileMode) error
- func FileExists(fileName string) bool
- func FirstPublicAddress() (string, error)
- func GetAllDirs(base string) ([]string, error)
- func GetExecPath(fileName string) (*string, error)
- func GetGID(name string) (int, error)
- func GetUID(name string) (int, error)
- func HomeDir() (string, error)
- func InitDirectory(path string, perm os.FileMode) error
- func IsDirectory(name string) bool
- func IsStringArrayEqual(a1 []string, a2 []string) bool
- func MachineID() (string, error)
- func MachineIDFromHostname() (string, error)
- func RandomString(length int) string
- func StringSliceContains(strSlice []string, str string) bool
- func Unique(input []string) []string
- type MappedArgs
- type TemplateWriter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AllAddresses ¶
AllAddresses returns a list of all network addresses on a node
func CheckIfUserExists ¶ added in v0.9.0
func CheckPathPermissions ¶
CheckPathPermissions checks the correct permissions are for a path (file or directory)
func FileExists ¶
FileExists checks if a file exists and is not a directory before we try using it to prevent further errors.
func FirstPublicAddress ¶
FirstPublicAddress return the first found non-local address that's not part of pod network
func GetAllDirs ¶
GetAllDirs return a list of dirs in given base path
func GetExecPath ¶ added in v0.9.0
Find the path for a given file (similar to `which`)
func InitDirectory ¶
InitDirectory creates a path if it does not exist, and verifies its permissions, if it does
func IsDirectory ¶
IsDirectory check the given path exists and is a directory
func IsStringArrayEqual ¶
IsStringArrayEqual returns true if an array of strings is equal, regardless of order
func MachineIDFromHostname ¶
MachineIDFromHostname generates a machine id hash from hostname
func RandomString ¶
RandomString generates a random string with given length
func StringSliceContains ¶
StringSliceContains check whether the given string slice contains the other string
Types ¶
type MappedArgs ¶ added in v0.10.0
MappedArgs defines map like arguments that can be "evaluated" into args=value pairs
func (MappedArgs) ToArgs ¶ added in v0.10.0
func (m MappedArgs) ToArgs() []string
ToArgs maps the data into cmd arguments like foo=bar baz=baf
type TemplateWriter ¶
TemplateWriter is a helper to write templated kube manifests
func (*TemplateWriter) Write ¶
func (p *TemplateWriter) Write() error
Write writes executes the template and writes the results on disk
func (*TemplateWriter) WriteToBuffer ¶
func (p *TemplateWriter) WriteToBuffer(w io.Writer) error
WriteToBuffer writes executed template tot he given writer