mirror of
https://github.com/jenkinsci/kubernetes-operator.git
synced 2026-10-21 04:23:25 +02:00
Resolve some FIXME
This commit is contained in:
@@ -68,4 +68,4 @@ func TestDeployHelmChart(t *testing.T) {
|
||||
waitForJenkinsBaseConfigurationToComplete(t, jenkins)
|
||||
waitForJenkinsUserConfigurationToComplete(t, jenkins)
|
||||
}
|
||||
/*
|
||||
*/
|
||||
|
||||
@@ -102,4 +102,4 @@ func updateJenkinsCR(t *testing.T, jenkins *v1alpha2.Jenkins) {
|
||||
jenkins.Spec.Master.Plugins = jenkins.Spec.Master.Plugins[0:3] // remove devoptics plugin
|
||||
}
|
||||
}
|
||||
*/
|
||||
*/
|
||||
|
||||
@@ -90,9 +90,9 @@ jenkins.save()
|
||||
func checkIfAuthorizationStrategyUnsecuredIsSet(t *testing.T, jenkinsClient jenkinsclient.Jenkins) {
|
||||
logs, err := jenkinsClient.ExecuteScript(`
|
||||
import hudson.security.*
|
||||
|
||||
|
||||
def jenkins = jenkins.model.Jenkins.getInstance()
|
||||
|
||||
|
||||
if (!(jenkins.getAuthorizationStrategy() instanceof AuthorizationStrategy.Unsecured)) {
|
||||
throw new Exception('AuthorizationStrategy.Unsecured is not set')
|
||||
}
|
||||
@@ -111,4 +111,4 @@ func checkBaseConfigurationCompleteTimeIsNotSet(t *testing.T, jenkins *v1alpha2.
|
||||
t.Fatalf("Status.BaseConfigurationCompletedTime is set after pod restart, status %+v", jenkinsStatus.Status)
|
||||
}
|
||||
}
|
||||
*/
|
||||
*/
|
||||
|
||||
@@ -216,4 +216,4 @@ func resetJenkinsStatus(t *testing.T, jenkins *v1alpha2.Jenkins) {
|
||||
err := framework.Global.Client.Update(context.TODO(), jenkins)
|
||||
require.NoError(t, err)
|
||||
}
|
||||
*/
|
||||
*/
|
||||
|
||||
+14
-2
@@ -2,6 +2,7 @@ package e2e
|
||||
|
||||
import (
|
||||
"context"
|
||||
"flag"
|
||||
"fmt"
|
||||
"path/filepath"
|
||||
"testing"
|
||||
@@ -35,8 +36,18 @@ var (
|
||||
cfg *rest.Config
|
||||
k8sClient client.Client
|
||||
testEnv *envtest.Environment
|
||||
|
||||
hostname *string
|
||||
port *int
|
||||
useNodePort *bool
|
||||
)
|
||||
|
||||
func init() {
|
||||
hostname = flag.String("jenkins-api-hostname", "", "Hostname or IP of Jenkins API. It can be service name, node IP or localhost.")
|
||||
port = flag.Int("jenkins-api-port", 0, "The port on which Jenkins API is running. Note: If you want to use nodePort don't set this setting and --jenkins-api-use-nodeport must be true.")
|
||||
useNodePort = flag.Bool("jenkins-api-use-nodeport", false, "Connect to Jenkins API using the service nodePort instead of service port. If you want to set this as true - don't set --jenkins-api-port.")
|
||||
}
|
||||
|
||||
func TestAPIs(t *testing.T) {
|
||||
RegisterFailHandler(Fail)
|
||||
|
||||
@@ -83,8 +94,9 @@ var _ = BeforeSuite(func(done Done) {
|
||||
go notifications.Listen(notificationEvents, events, k8sClient)
|
||||
|
||||
jenkinsAPIConnectionSettings := jenkinsClient.JenkinsAPIConnectionSettings{
|
||||
Hostname: "192.168.99.100", // FIXME minikube ip
|
||||
UseNodePort: true,
|
||||
Hostname: *hostname,
|
||||
UseNodePort: *useNodePort,
|
||||
Port: *port,
|
||||
}
|
||||
|
||||
err = (&controllers.JenkinsReconciler{
|
||||
|
||||
Reference in New Issue
Block a user