Documentation ¶
Index ¶
- Constants
- func AddNamespaceToName(projectName string) string
- func ApiDELETERequest(path string, retries int) (*req.Resp, error)
- func ApiGETRequest(path string, retries int) (*req.Resp, error)
- func ApiPOSTRequest(path string, payload interface{}, retries int) (*req.Resp, error)
- func ApiPUTRequest(path string, payload interface{}, retries int) (*req.Resp, error)
- func CheckIfWebhookSubscriptionExists(project, event string) (bool, error)
- func CompareServiceNameWithDeploymentName(serviceName string, deploymentName string) (bool, error)
- func CreateProject(projectName string, shipyardFilePath string) (string, error)
- func CreateProjectWithProxy(projectName string, shipyardFilePath string, proxyURL string) (string, error)
- func CreateProjectWithSSH(projectName string, shipyardFilePath string) (string, error)
- func CreateSubscription(t *testing.T, serviceName string, subscription models.EventSubscription) (string, error)
- func CreateTmpFile(fileNamePattern, fileContent string) (string, error)
- func CreateTmpShipyardFile(shipyardContent string) (string, error)
- func CreateWebhookProject(t *testing.T, projectName, serviceName string) (string, string)
- func DeleteFile(t *testing.T, filePath string)
- func ExecuteCommand(cmd string) (string, error)
- func ExecuteCommandf(cmd string, a ...interface{}) (string, error)
- func GetApiCredentials() (string, string, error)
- func GetDiagnostics(service string, container string) string
- func GetEventTraceForContext(keptnContext, projectName string) ([]*models.KeptnContextExtendedCE, error)
- func GetEventsOfType(keptnContext, projectName, stage, eventType string) ([]*models.KeptnContextExtendedCE, error)
- func GetFromConfigMap(namespace string, configMapName string, ...) (string, error)
- func GetGiteaToken() (string, error)
- func GetGiteaUser() string
- func GetImageOfDeploymentContainer(deploymentName, containerName string) (string, error)
- func GetIntegrationWithName(name string) (models.Integration, error)
- func GetKeptnNameSpaceFromEnv() string
- func GetLatestEventOfType(keptnContext, projectName, stage, eventType string) (*models.KeptnContextExtendedCE, error)
- func GetMongoDBCredentials() (string, string, error)
- func GetPodNamesOfDeployment(labelSelector string) ([]string, error)
- func GetPrivateKeyAndPassphrase() (string, string, error)
- func GetProject(projectName string) (*models.ExpandedProject, error)
- func GetPublicURLOfService(serviceName, projectName, stageName string) (string, error)
- func GetRepositoryBranches(project string) (*http.Response, error)
- func GetServiceExternalIP(namespace string, service string) (string, error)
- func GetState(projectName string) (*models.SequenceStates, *req.Resp, error)
- func GetStateByContext(projectName, keptnContext string) (*models.SequenceStates, *req.Resp, error)
- func ImportUploadZipToProject(urlPath, projectName, filePath string) (int, error)
- func IsEqual(t *testing.T, expected, actual interface{}, property string) bool
- func KubeCtlApplyFromURL(url string, namespace ...string) (func() error, error)
- func KubeCtlDeleteFromURL(url string, namespace ...string) error
- func KubeCtlPortForwardSvc(ctx context.Context, svcName, localPort string, remotePort string, ...) error
- func PerformResourceServiceTest(t *testing.T, projectName string, serviceName string, checkCommit bool, ...) (string, *models.KeptnContextExtendedCE)
- func PrintLogsOfPods(t *testing.T, pods []string)
- func PrintLogsWithDeploymentName(deploymentName string) (string, error)
- func PutConfigMapDataVal(namespace string, configMapName string, key string, val string) error
- func RecreateGitUpstreamRepository(project string) error
- func RecreateProjectUpstream(newProjectName string) error
- func RestartPod(deploymentName string) error
- func RestartPodsWithSelector(useInClusterConfig bool, namespace string, selector string) error
- func SetEnvVarsOfDeployment(deploymentName string, containerName string, envVars []v1.EnvVar) error
- func SetImageOfDeploymentContainer(deploymentName, containerName, image string) error
- func SetRecreateUpgradeStrategyForDeployment(deploymentName string) error
- func SetShipyardControllerEnvVar(t *testing.T, envVarName, envVarValue string) error
- func StringArr(el ...string) []string
- func TestAirgappedImagesAreSetCorrectly(t *testing.T)
- func Test_BackupRestore(t *testing.T)
- func Test_CreateProjectWithCustomBranchName(t *testing.T)
- func Test_DeliveryAssistant(t *testing.T)
- func Test_EvaluationGitCommitID(t *testing.T)
- func Test_ExecutingWebhookTargetingClusterInternalAddressesFails(t *testing.T)
- func Test_ImportCorrectManifest(t *testing.T)
- func Test_ImportCorrectManifestNonExistingProject(t *testing.T)
- func Test_ImportMalformedZipFileCorrectName(t *testing.T)
- func Test_ManageSecrets_CreateUpdateAndDeleteSecret(t *testing.T)
- func Test_ProvisioningURL(t *testing.T)
- func Test_ProvisioningURL_hiddenURL(t *testing.T)
- func Test_ProxyAuth(t *testing.T)
- func Test_QualityGates(t *testing.T)
- func Test_ResourceServiceBasic(t *testing.T)
- func Test_ResourceServiceGETCommitID(t *testing.T)
- func Test_SSHPublicKeyAuth(t *testing.T)
- func Test_SequenceQueue_TriggerMultiple(t *testing.T)
- func Test_UniformRegistration_RegistrationOfKeptnIntegration(t *testing.T)
- func Test_UniformRegistration_RegistrationOfKeptnIntegrationMultiplePods(t *testing.T)
- func Test_UniformRegistration_RegistrationOfKeptnIntegrationRemoteExecPlane(t *testing.T)
- func Test_UniformRegistration_TestAPI(t *testing.T)
- func Test_Webhook(t *testing.T)
- func Test_Webhook_Failures(t *testing.T)
- func TriggerEvaluation(projectName, stageName, serviceName string) (string, error)
- func TriggerSequence(projectName, serviceName, stageName, sequenceName string, ...) (string, error)
- func UpdateConfigMap(namespace string, configMapName string, replaceConfig func(cm *v1.ConfigMap)) error
- func UpdateMockserverConfig(t *testing.T, project string)
- func VerifyBlueGreenDeployment(serviceName, projectName, stageName, artifactImage, artifactTag string) error
- func VerifyDirectDeployment(serviceName, projectName, stageName, artifactImage, artifactTag string) error
- func VerifyMainRepositoryBranchName(project string, branchName string) (bool, error)
- func VerifySequenceEndsUpInState(t *testing.T, projectName string, context *models.EventContext, ...)
- func VerifyTaskStartedEventExists(t *testing.T, keptnContext, projectName, stage string, taskName string)
- func WaitAndCheckDeployment(deploymentName, namespace string, timeout time.Duration, ...) error
- func WaitForDeploymentInNamespace(deploymentName, namespace string) error
- func WaitForDeploymentToBeScaledDown(deploymentName string) error
- func WaitForPodOfDeployment(deploymentName string) error
- func WaitForURL(url string, timeout time.Duration) error
- type APICaller
- func (a *APICaller) Delete(path string, retries int) (*req.Resp, error)
- func (a *APICaller) Get(path string, retries int) (*req.Resp, error)
- func (a *APICaller) Post(path string, payload interface{}, retries int) (*req.Resp, error)
- func (a *APICaller) Put(path string, payload interface{}, retries int) (*req.Resp, error)
- type APIEventSender
- type BranchBody
- type HTTPOverrideForwardedRequest
- type HTTPRequest
- type Headers
- type K8SEvent
- type K8SEventArray
- type OpenTriggeredEventsResponse
- type Payload
- type RequestOverride
- type WaitForDeploymentOptions
Constants ¶
const ( KeptnSpecVersion = "0.2.0" KeptnNamespaceEnvVar = "KEPTN_NAMESPACE" DefaultKeptnNamespace = "keptn" )
Variables ¶
This section is empty.
Functions ¶
func AddNamespaceToName ¶
func ApiPOSTRequest ¶
func ApiPUTRequest ¶
func CreateProject ¶
func CreateProjectWithProxy ¶
func CreateProjectWithSSH ¶
func CreateSubscription ¶
func CreateTmpFile ¶
func CreateTmpShipyardFile ¶
func CreateWebhookProject ¶
func DeleteFile ¶
func ExecuteCommand ¶
func ExecuteCommandf ¶
func GetApiCredentials ¶
func GetDiagnostics ¶
func GetEventTraceForContext ¶
func GetEventTraceForContext(keptnContext, projectName string) ([]*models.KeptnContextExtendedCE, error)
func GetEventsOfType ¶
func GetEventsOfType(keptnContext, projectName, stage, eventType string) ([]*models.KeptnContextExtendedCE, error)
func GetFromConfigMap ¶
func GetGiteaToken ¶
GetGiteaToken checks whether the GITEA_TOKEN environment variable is set. If yes, it will return the value for that var. If not, it will try to fetch the token from the secret 'gitea-access' in the keptn namespace
func GetGiteaUser ¶
func GetGiteaUser() string
func GetIntegrationWithName ¶
func GetIntegrationWithName(name string) (models.Integration, error)
func GetKeptnNameSpaceFromEnv ¶
func GetKeptnNameSpaceFromEnv() string
func GetLatestEventOfType ¶
func GetLatestEventOfType(keptnContext, projectName, stage, eventType string) (*models.KeptnContextExtendedCE, error)
func GetMongoDBCredentials ¶
GetMongoDBCredentials retrieves the credentials of the mongodb user from the mongodb credentials secret
func GetPodNamesOfDeployment ¶
func GetProject ¶
func GetProject(projectName string) (*models.ExpandedProject, error)
func GetPublicURLOfService ¶
func GetServiceExternalIP ¶
func GetStateByContext ¶
func KubeCtlApplyFromURL ¶
KubeCtlApplyFromURL wraps the kubectl command line tool in order to perform a "kubectl apply" command with resources downloaded from the given "url". The default namespace (set via KEPTN_NAMESPACE) will be used but can be overridden using the "namespace" param. The function returns a function which can be called to apply the corresponding "kubectl delete" command to undo the "kubectl apply" command
func KubeCtlDeleteFromURL ¶
func KubeCtlPortForwardSvc ¶
func PrintLogsOfPods ¶
func PutConfigMapDataVal ¶
func RecreateGitUpstreamRepository ¶
RecreateGitUpstreamRepository creates a kubernetes job that (re)creates the upstream repo for a project on the internal gitea instance
func RecreateProjectUpstream ¶
func RestartPod ¶
func RestartPodsWithSelector ¶
RestartPodsWithSelector restarts the pods which are found in the provided namespace and selector
func SetEnvVarsOfDeployment ¶
func SetRecreateUpgradeStrategyForDeployment ¶
SetRecreateUpgradeStrategyForDeployment sets the upgrade strategy of a deployment to "Recreate". Needed for our minishift tests right now, as there are problems with the RollingUpdate strategy of the shipyard-controller Should become obsolete when we switch to testing on an OpenShift 4.x cluster instead.
func SetShipyardControllerEnvVar ¶
SetShipyardControllerEnvVar sets the provided value of the shipyard-controller deployment. This function is specific to the shipyard-controller, and eventually we should avoid setting env vars of deployments in general, as this leads to the respective pod being restarted, which increases the duration of the integration tests and prevents us from executing tests in parallel
func Test_BackupRestore ¶
func Test_DeliveryAssistant ¶
func Test_ExecutingWebhookTargetingClusterInternalAddressesFails ¶
Test_ExecutingWebhookTargetingClusterInternalAddressesFails tests whether the webhook requests targeting an internal component (e.g. shipyard-controller) is blocked
func Test_ImportCorrectManifest ¶
Test_ImportCorrectManifest uploads a valid zip manifest which creates a Keptn service, secret and webhook and validates the result
func Test_ImportCorrectManifestNonExistingProject ¶
Test_ImportCorrectManifestNonExistingProject uploads a valid manifest with a non-existing project which throws an error when uploading
func Test_ImportMalformedZipFileCorrectName ¶
Test_ImportMalformedZipFileCorrectName uploads an invalid zip with incorrect structure and mapping that throws an error while uploading
func Test_ProvisioningURL ¶
@Description: Test_ProvisioningURL tests the behaviour of the system, when no git credentials are submitted by user as * they should be provisioned by a 3rd partly REST API when AUTOMATIC_PROVISIONING_URL env variable is set. We are using * a simple mockserver to mock the responses from the 3rd partly REST API, which responses with a valid git credentials. * @Outcome Creating and deleting the project is tested using the provisoned git credentials * @Issue 7149
func Test_ProxyAuth ¶
func Test_QualityGates ¶
func Test_SSHPublicKeyAuth ¶
func Test_UniformRegistration_RegistrationOfKeptnIntegration ¶
Test_UniformRegistration_RegistrationOfKeptnIntegration tests whether a deployed Keptn Integration gets correctly registered/unregistered to/from the Keptn control plane
func Test_UniformRegistration_RegistrationOfKeptnIntegrationMultiplePods ¶
Test_UniformRegistration_RegistrationOfKeptnIntegration tests whether a deployed Keptn Integration gets correctly registered/unregistered to/from the Keptn control plane
func Test_UniformRegistration_RegistrationOfKeptnIntegrationRemoteExecPlane ¶
Test_UniformRegistration_RegistrationOfKeptnIntegration tests whether a deployed Keptn Integration gets correctly registered/unregistered to/from the Keptn control plane - in this case, the service runs in the remote execution plane
func Test_UniformRegistration_TestAPI ¶
Test_UniformRegistration_TestAPI directly tests the API for (un)registering Keptn integrations to the Keptn control plane
func Test_Webhook ¶
Test_Webhook contains a test for the "happy path". Note, that for this test we temporarily disable the restriction of only being allowed to call external targets with the webhook service
func Test_Webhook_Failures ¶
Test_Webhook_Failures contains tests for possible types of failures that can potentially happen while processing a webhook request (e.g. webhook configuration not found, ...)
func TriggerEvaluation ¶
func TriggerSequence ¶
func TriggerSequence(projectName, serviceName, stageName, sequenceName string, eventData keptncommon.EventProperties) (string, error)
func UpdateConfigMap ¶
func UpdateMockserverConfig ¶
func VerifyDirectDeployment ¶
func WaitAndCheckDeployment ¶
func WaitAndCheckDeployment(deploymentName, namespace string, timeout time.Duration, options WaitForDeploymentOptions) error
func WaitForDeploymentInNamespace ¶
WaitForDeploymentInNamespace deprecated, use WaitAndCheckDeployment
func WaitForPodOfDeployment ¶
Types ¶
type APICaller ¶
type APICaller struct {
// contains filtered or unexported fields
}
func GetInternalKeptnAPI ¶
func NewAPICaller ¶
func NewAPICallerWithBaseURL ¶
type BranchBody ¶
type BranchBody struct {
Name string `json:"name"`
}
type HTTPOverrideForwardedRequest ¶
type HTTPOverrideForwardedRequest struct {
RequestOverride RequestOverride `json:"requestOverride,omitempty"`
}
type HTTPRequest ¶
type K8SEventArray ¶
type K8SEventArray struct {
Items []K8SEvent `json:"items"`
}
func GetOOMEvents ¶
func GetOOMEvents() (K8SEventArray, error)
type OpenTriggeredEventsResponse ¶
type OpenTriggeredEventsResponse struct {
Events []*models.KeptnContextExtendedCE `json:"events"`
}
type Payload ¶
type Payload struct { HTTPRequest HTTPRequest `json:"httpRequest,omitempty"` HTTPOverrideForwardedRequest HTTPOverrideForwardedRequest `json:"httpOverrideForwardedRequest,omitempty"` }
type RequestOverride ¶
type WaitForDeploymentOptions ¶
type WaitForDeploymentOptions struct {
WithImageName string
}
Source Files ¶
- k8s_utils.go
- kubectl.go
- test_airgapped_images.go
- test_backuprestore.go
- test_custom_git_branch_name.go
- test_deliveryassistant.go
- test_gitcommitid.go
- test_importer.go
- test_provisioningURL.go
- test_proxyauth.go
- test_qualitygate.go
- test_resourceservice.go
- test_secrets.go
- test_sequencequeue.go
- test_sshpublickeyauth.go
- test_uniform.go
- test_utils.go
- test_webhook.go