Package io.fabric8.jenkins.openshiftsync
Class CredentialsUtils
- java.lang.Object
-
- io.fabric8.jenkins.openshiftsync.CredentialsUtils
-
public class CredentialsUtils extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static String
KUBERNETES_SERVICE_ACCOUNT
static ConcurrentHashMap<String,String>
UID_TO_SECRET_MAP
-
Constructor Summary
Constructors Constructor Description CredentialsUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
deleteCredential(io.fabric8.kubernetes.api.model.Secret secret)
static void
deleteSourceCredentials(io.fabric8.openshift.api.model.BuildConfig buildConfig)
static String
getCurrentToken()
static io.fabric8.kubernetes.api.model.Secret
getSourceSecretForBuildConfig(io.fabric8.openshift.api.model.BuildConfig buildConfig)
static boolean
hasCredentials()
Does our configuration have credentials?static String
updateSourceCredentials(io.fabric8.openshift.api.model.BuildConfig buildConfig)
static String
upsertCredential(io.fabric8.kubernetes.api.model.Secret secret)
Inserts or creates a Jenkins Credential for the given Secret
-
-
-
Field Detail
-
KUBERNETES_SERVICE_ACCOUNT
public static final String KUBERNETES_SERVICE_ACCOUNT
- See Also:
- Constant Field Values
-
UID_TO_SECRET_MAP
public static final ConcurrentHashMap<String,String> UID_TO_SECRET_MAP
-
-
Method Detail
-
getSourceSecretForBuildConfig
public static io.fabric8.kubernetes.api.model.Secret getSourceSecretForBuildConfig(io.fabric8.openshift.api.model.BuildConfig buildConfig)
-
updateSourceCredentials
public static String updateSourceCredentials(io.fabric8.openshift.api.model.BuildConfig buildConfig) throws IOException
- Throws:
IOException
-
deleteSourceCredentials
public static void deleteSourceCredentials(io.fabric8.openshift.api.model.BuildConfig buildConfig) throws IOException
- Throws:
IOException
-
upsertCredential
public static String upsertCredential(io.fabric8.kubernetes.api.model.Secret secret) throws IOException
Inserts or creates a Jenkins Credential for the given Secret- Parameters:
secret
- the secret to insert- Returns:
- the insert secret name
- Throws:
IOException
- when the update of the secret fails
-
deleteCredential
public static void deleteCredential(io.fabric8.kubernetes.api.model.Secret secret)
-
getCurrentToken
public static String getCurrentToken()
-
hasCredentials
public static boolean hasCredentials()
Does our configuration have credentials?- Returns:
- true if found.
-
-