Documentation ¶
Index ¶
- Constants
- Variables
- func CreateAndImportPfx(certFile string, pfxFile string) error
- func CreateDirectory(dir string) error
- func DeleteDirectory(dir string) error
- func DeleteFile(file string) error
- func DirectoryExists(dir string) (bool, error)
- func FileExists(file string) (bool, error)
- func FileHas(file string, content []byte) (bool, error)
- func GetFile(file string) ([]byte, error)
- func ImportCertificate(certPath string) error
- func IsMemFs() bool
- func ReadDirectory(dir string) ([]os.FileInfo, error)
- func RenameTempFile(file string) (func() error, func() error, error)
- func RunPowershell(path string) error
- func RunPowershellCommand(cmd string) error
- func RunPowershellCommandWithOutput(cmd string) ([]byte, error)
- func SetFile(file string, content []byte) error
- func SetupEnv()
- func SetupTestEnv()
- func UnimportCertificate(certPath string) error
- func ValidateNamespace(namespace string) error
Constants ¶
View Source
const ( PowershellPathEnvVar = "POWERSHELL_PATH" DefaultPowershellPath = "powershell.exe" )
View Source
const (
Windows = false
)
Variables ¶
View Source
var ( // DLLPath is where the DLL will be stored within the DLLDirectory DLLPath = "RanchergMSACredentialProvider.dll" // DLLInstallScriptPath is where DLL install script will be stored within the DLLDirectory DLLInstallScriptPath = "install-plugin.ps1" // DLLUninstallScriptPat is where the DLL uninstall script will be stored within the DLLDirectory DLLUninstallScriptPath = "uninstall-plugin.ps1" // DLLGuid is the GUID that we register the Rancher CCG Plugin DLL under // // Developer Note: // This value should never be changed unless absolutely necessary since the DLL GUID is // used to create GMSACredentialSpec resources. Changing this value would immediately render // all user-created GMSACredentialSpecs that were targeting this CCG Plugin no longer apply to // this installation of the CCG Plugin. DLLGuid = "E4781092-F116-4B79-B55E-28EB6A224E26" // CCGCOMClassKey is the Windows Registry Key which is used by CCG to invoke the DLL CCGCOMClassesKey = filepath.Join( "SYSTEM", "CurrentControlSet", "Control", "CCG", "COMClasses", fmt.Sprintf("{%s}", strings.ToLower(DLLGuid)), ) // ClassesRootKey is the Windows Registry Key which is added by regsvc upon registering the dll. It is also used to invoke the DLL CLSIDKey = filepath.Join( "CLSID", fmt.Sprintf("{%s}", DLLGuid), ) )
View Source
var ( // DLLDirectory contains resources for the CCG Plugin DLL DLLDirectory = filepath.Join("dist", "rancher-plugin-gmsa", "ccg-plugin-installer") // ProviderDirectory contains namespace directories for CCG Plugin Account Providers ProviderDirectory = filepath.Join("dist", "rancher-plugin-gmsa", "gmsa-account-provider") )
View Source
var ( DryRun bool PowershellPath string )
View Source
var (
CertStoreLocation = filepath.Join("Cert:", "LocalMachine", "Root")
)
View Source
var DeleteBackoff = wait.Backoff{ Steps: 5, Duration: 100 * time.Millisecond, Factor: 2.0, Jitter: 0.1, }
View Source
var (
IsValidNamespace = regexp.MustCompile(`^[a-z]([a-z\-0-9]{1,61}[a-z0-9])?$`).MatchString
)
Functions ¶
func CreateAndImportPfx ¶
func CreateDirectory ¶
func DeleteDirectory ¶
func DeleteFile ¶
func DirectoryExists ¶
func FileExists ¶
func ImportCertificate ¶
func IsMemFs ¶
func IsMemFs() bool
IsMemFs returns whether the default manager is using a in-memory filesystem
func RunPowershell ¶
func RunPowershellCommand ¶
func SetupEnv ¶
func SetupEnv()
SetupEnv sets up the default fs manager to use the real host (OS) filesystems
func SetupTestEnv ¶
func SetupTestEnv()
SetupTestEnv sets up the default fs manager to use in-memory filesystems Any subsequent call to SetupTestEnv or SetupEnv will wipe out the filesystems created here.
func UnimportCertificate ¶
func ValidateNamespace ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.