Class OpenShifts


  • public class OpenShifts
    extends Object
    • Constructor Detail

      • OpenShifts

        public OpenShifts()
    • Method Detail

      • getBinaryPath

        public static String getBinaryPath()
      • saveOcOnCache

        @Deprecated
        public static void saveOcOnCache​(String version,
                                         String ocUrl,
                                         File ocTarFile)
                                  throws IOException
        Deprecated.
        this should have never been made public, can be removed in future versions. It is not used internally by XTF
        Save oc binary in a folder to use as cache to avoid to download it again. The folder path depends on the OCP version and the download url. The file can be accessed using getOcFromCache(String, String, File). It works only if OpenShiftConfig.isBinaryCacheEnabled().
        Parameters:
        version - String, OCP cluster version.
        ocUrl - String, download URL.
        ocTarFile - String, workdir file.
        Throws:
        IOException
      • getOcFromCache

        @Deprecated
        public static File getOcFromCache​(String version,
                                          String ocUrl,
                                          File ocTarFile)
                                   throws IOException
        Deprecated.
        this should have never been made public, can be removed in future versions. It is not used internally by XTF
        Retrieve the file from the folder populated by saveOcOnCache(String, String, File).
        Parameters:
        version - String, OCP cluster version.
        ocUrl - String, download URL.
        ocTarFile - String, workdir file.
        Returns:
        File, reference to the file, if the cache is not populated, the file is not null, but it doesn't exist.
        Throws:
        IOException
      • getVersion

        public static String getVersion()
        Returns OpenShiftConfig.version(). If not available then access OpenShift endpoint for a version. Be aware that this operation requires admin role for OpenShift 4 unlike to OpenShift 3.
        Returns:
        Openshift cluster version if configured or detected from cluster, null otherwise
      • getMasterToken

        public static String getMasterToken()
      • getAdminToken

        public static String getAdminToken()