Skip to content

Commit

Permalink
Merge pull request #612 from spolti/RHPAM-3494-7.10.x
Browse files Browse the repository at this point in the history
[RHPAM-3494] - Make pulling of dependencies and kjar validation skipp…
  • Loading branch information
openshift-merge-robot authored Mar 8, 2021
2 parents 8a8453e + 521bd0b commit 979001c
Show file tree
Hide file tree
Showing 12 changed files with 199 additions and 13 deletions.
4 changes: 4 additions & 0 deletions config/7.10.1/common.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -690,6 +690,10 @@ servers:
value: "[[.KieName]]-ping"
- name: OPENSHIFT_DNS_PING_SERVICE_PORT
value: "8888"
- name: KIE_SERVER_DISABLE_KC_PULL_DEPS
value: "[[.Build.DisablePullDeps]]"
- name: KIE_SERVER_DISABLE_KC_VERIFICATION
value: "[[.Build.DisableKCVerification]]"
# Auth config BEGIN
## SSO config BEGIN
#[[if $.Auth.SSO.URL]]
Expand Down
20 changes: 20 additions & 0 deletions deploy/crds/kieapp.crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1180,6 +1180,16 @@ spec:
will be copied into the deployment folder. If unspecified,
all archives in /target will be copied.
type: string
disableKCVerification:
description: Disable Maven KIE Jar verification. It
is recommended to test the kjar manually before disabling
this verification.
type: boolean
disablePullDeps:
description: Disable Maven pull dependencies for immutable
KIE Server configurations for S2I and pre built kjars.
Useful for pre-compiled kjar.
type: boolean
env:
description: Env set environment variables for BuildConfigs
items:
Expand Down Expand Up @@ -3290,6 +3300,16 @@ spec:
will be copied into the deployment folder. If
unspecified, all archives in /target will be copied.
type: string
disableKCVerification:
description: Disable Maven KIE Jar verification.
It is recommended to test the kjar manually before
disabling this verification.
type: boolean
disablePullDeps:
description: Disable Maven pull dependencies for
immutable KIE Server configurations for S2I and
pre built kjars. Useful for pre-compiled kjar.
type: boolean
env:
description: Env set environment variables for BuildConfigs
items:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ metadata:
categories: Integration & Delivery
certified: "false"
containerImage: quay.io/kiegroup/kie-cloud-operator:7.10.1
createdAt: "2021-02-18 13:10:33"
createdAt: "2021-03-08 16:16:40"
description: Deploys and manages Red Hat Process Automation Manager and Red Hat Decision Manager environments.
operators.openshift.io/infrastructure-features: '["Disconnected"]'
repository: https://github.com/kiegroup/kie-cloud-operator
Expand All @@ -17,7 +17,7 @@ metadata:
operator-businessautomation: "true"
operatorframework.io/arch.amd64: supported
operatorframework.io/os.linux: supported
name: businessautomation-operator.7.10.1-1-dev-mljjh9zfk6
name: businessautomation-operator.7.10.1-1-dev-96psq2wrq6
namespace: placeholder
spec:
apiservicedefinitions: {}
Expand Down Expand Up @@ -441,7 +441,7 @@ spec:
- operator
labels:
alm-owner-businessautomation: businessautomation-operator
operated-by: businessautomation-operator.7.10.1-1-dev-mljjh9zfk6
operated-by: businessautomation-operator.7.10.1-1-dev-96psq2wrq6
links:
- name: Product Page
url: https://access.redhat.com/products/red-hat-process-automation-manager
Expand All @@ -457,5 +457,5 @@ spec:
selector:
matchLabels:
alm-owner-businessautomation: businessautomation-operator
operated-by: businessautomation-operator.7.10.1-1-dev-mljjh9zfk6
version: 7.10.1-1+mljjh9zfk6
operated-by: businessautomation-operator.7.10.1-1-dev-96psq2wrq6
version: 7.10.1-1+96psq2wrq6
20 changes: 20 additions & 0 deletions deploy/olm-catalog/dev/7.10.1-1/manifests/kieapp.crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1180,6 +1180,16 @@ spec:
will be copied into the deployment folder. If unspecified,
all archives in /target will be copied.
type: string
disableKCVerification:
description: Disable Maven KIE Jar verification. It
is recommended to test the kjar manually before disabling
this verification.
type: boolean
disablePullDeps:
description: Disable Maven pull dependencies for immutable
KIE Server configurations for S2I and pre built kjars.
Useful for pre-compiled kjar.
type: boolean
env:
description: Env set environment variables for BuildConfigs
items:
Expand Down Expand Up @@ -3290,6 +3300,16 @@ spec:
will be copied into the deployment folder. If
unspecified, all archives in /target will be copied.
type: string
disableKCVerification:
description: Disable Maven KIE Jar verification.
It is recommended to test the kjar manually before
disabling this verification.
type: boolean
disablePullDeps:
description: Disable Maven pull dependencies for
immutable KIE Server configurations for S2I and
pre built kjars. Useful for pre-compiled kjar.
type: boolean
env:
description: Env set environment variables for BuildConfigs
items:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ metadata:
categories: Integration & Delivery
certified: "true"
containerImage: registry.stage.redhat.io/rhpam-7/rhpam-rhel8-operator:7.10.1
createdAt: "2021-02-18 13:10:33"
createdAt: "2021-03-08 16:16:40"
description: Deploys and manages Red Hat Process Automation Manager and Red Hat Decision Manager environments.
operators.openshift.io/infrastructure-features: '["Disconnected"]'
repository: https://github.com/kiegroup/kie-cloud-operator
Expand Down
20 changes: 20 additions & 0 deletions deploy/olm-catalog/prod/7.10.1-1/manifests/kieapp.crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1180,6 +1180,16 @@ spec:
will be copied into the deployment folder. If unspecified,
all archives in /target will be copied.
type: string
disableKCVerification:
description: Disable Maven KIE Jar verification. It
is recommended to test the kjar manually before disabling
this verification.
type: boolean
disablePullDeps:
description: Disable Maven pull dependencies for immutable
KIE Server configurations for S2I and pre built kjars.
Useful for pre-compiled kjar.
type: boolean
env:
description: Env set environment variables for BuildConfigs
items:
Expand Down Expand Up @@ -3290,6 +3300,16 @@ spec:
will be copied into the deployment folder. If
unspecified, all archives in /target will be copied.
type: string
disableKCVerification:
description: Disable Maven KIE Jar verification.
It is recommended to test the kjar manually before
disabling this verification.
type: boolean
disablePullDeps:
description: Disable Maven pull dependencies for
immutable KIE Server configurations for S2I and
pre built kjars. Useful for pre-compiled kjar.
type: boolean
env:
description: Env set environment variables for BuildConfigs
items:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ metadata:
categories: Integration & Delivery
certified: "true"
containerImage: registry-proxy.engineering.redhat.com/rh-osbs/rhpam-7-rhpam-rhel8-operator:7.10.1
createdAt: "2021-02-18 13:10:33"
createdAt: "2021-03-08 16:16:40"
description: Deploys and manages Red Hat Process Automation Manager and Red Hat Decision Manager environments.
operators.openshift.io/infrastructure-features: '["Disconnected"]'
repository: https://github.com/kiegroup/kie-cloud-operator
Expand All @@ -17,7 +17,7 @@ metadata:
operator-businessautomation: "true"
operatorframework.io/arch.amd64: supported
operatorframework.io/os.linux: supported
name: businessautomation-operator.7.10.1-1-dev-kvtw4nr2d9
name: businessautomation-operator.7.10.1-1-dev-mlq4w5dgks
namespace: placeholder
spec:
apiservicedefinitions: {}
Expand Down Expand Up @@ -441,7 +441,7 @@ spec:
- operator
labels:
alm-owner-businessautomation: businessautomation-operator
operated-by: businessautomation-operator.7.10.1-1-dev-kvtw4nr2d9
operated-by: businessautomation-operator.7.10.1-1-dev-mlq4w5dgks
links:
- name: Product Page
url: https://access.redhat.com/products/red-hat-process-automation-manager
Expand All @@ -457,5 +457,5 @@ spec:
selector:
matchLabels:
alm-owner-businessautomation: businessautomation-operator
operated-by: businessautomation-operator.7.10.1-1-dev-kvtw4nr2d9
version: 7.10.1-1+kvtw4nr2d9
operated-by: businessautomation-operator.7.10.1-1-dev-mlq4w5dgks
version: 7.10.1-1+mlq4w5dgks
20 changes: 20 additions & 0 deletions deploy/olm-catalog/test/7.10.1-1/manifests/kieapp.crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1180,6 +1180,16 @@ spec:
will be copied into the deployment folder. If unspecified,
all archives in /target will be copied.
type: string
disableKCVerification:
description: Disable Maven KIE Jar verification. It
is recommended to test the kjar manually before disabling
this verification.
type: boolean
disablePullDeps:
description: Disable Maven pull dependencies for immutable
KIE Server configurations for S2I and pre built kjars.
Useful for pre-compiled kjar.
type: boolean
env:
description: Env set environment variables for BuildConfigs
items:
Expand Down Expand Up @@ -3290,6 +3300,16 @@ spec:
will be copied into the deployment folder. If
unspecified, all archives in /target will be copied.
type: string
disableKCVerification:
description: Disable Maven KIE Jar verification.
It is recommended to test the kjar manually before
disabling this verification.
type: boolean
disablePullDeps:
description: Disable Maven pull dependencies for
immutable KIE Server configurations for S2I and
pre built kjars. Useful for pre-compiled kjar.
type: boolean
env:
description: Env set environment variables for BuildConfigs
items:
Expand Down
16 changes: 16 additions & 0 deletions deploy/ui/form.json
Original file line number Diff line number Diff line change
Expand Up @@ -906,6 +906,22 @@
"description": "KIE packages to deploy to the KIE Server.",
"default": "rhpam-kieserver-library=org.openshift.quickstarts:rhpam-kieserver-library:1.5.0-SNAPSHOT"
},
{
"label": "Disable KIE Jar Pull Dependencies",
"type": "checkbox",
"required": false,
"description": "Disable Maven pull dependencies for immutable KIE Server configurations for S2I and pre built kjars.",
"jsonPath": "$.spec.objects.servers[*].build.disablePullDeps",
"originalJsonPath": "$.spec.objects.servers[*].build.disablePullDeps"
},
{
"label": "Disable KIE Jar Verification",
"type": "checkbox",
"required": false,
"description": "Disable Maven KIE Jar verification. It is recommended to test the kjar manually before disabling this verification.",
"jsonPath": "$.spec.objects.servers[*].build.disableKCVerification",
"originalJsonPath": "$.spec.objects.servers[*].build.disableKCVerification"
},
{
"label": "Maven mirror URL",
"type": "text",
Expand Down
10 changes: 8 additions & 2 deletions pkg/apis/app/v2/kieapp_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -259,8 +259,12 @@ type KieAppBuildObject struct {
// Env set environment variables for BuildConfigs
Env []corev1.EnvVar `json:"env,omitempty"`
// The Maven GAV to deploy, e.g., rhpam-kieserver-library=org.openshift.quickstarts:rhpam-kieserver-library:1.5.0-SNAPSHOT
KieServerContainerDeployment string `json:"kieServerContainerDeployment,omitempty"`
GitSource GitSource `json:"gitSource,omitempty"`
KieServerContainerDeployment string `json:"kieServerContainerDeployment,omitempty"`
// Disable Maven pull dependencies for immutable KIE Server configurations for S2I and pre built kjars. Useful for pre-compiled kjar.
DisablePullDeps bool `json:"disablePullDeps,omitempty"`
// Disable Maven KIE Jar verification. It is recommended to test the kjar manually before disabling this verification.
DisableKCVerification bool `json:"disableKCVerification,omitempty"`
GitSource GitSource `json:"gitSource,omitempty"`
// Maven mirror to use for S2I builds
MavenMirrorURL string `json:"mavenMirrorURL,omitempty"`
// List of directories from which archives will be copied into the deployment folder. If unspecified, all archives in /target will be copied.
Expand Down Expand Up @@ -787,6 +791,8 @@ type BuildTemplate struct {
GitHubWebhookSecret string `json:"githubWebhookSecret,omitempty"`
GenericWebhookSecret string `json:"genericWebhookSecret,omitempty"`
KieServerContainerDeployment string `json:"kieServerContainerDeployment,omitempty"`
DisablePullDeps bool `json:"disablePullDeps,omitempty"`
DisableKCVerification bool `json:"disableKCVerification,omitempty"`
MavenMirrorURL string `json:"mavenMirrorURL,omitempty"`
ArtifactDir string `json:"artifactDir,omitempty"`
// Extension image configuration which provides custom jdbc drivers to be used
Expand Down
2 changes: 2 additions & 0 deletions pkg/controller/kieapp/defaults/defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -877,6 +877,8 @@ func getBuildConfig(product string, cr *api.KieApp, serverSet *api.KieServerSet)
GitHubWebhookSecret: getWebhookSecret(api.GitHubWebhook, serverSet.Build.Webhooks),
GenericWebhookSecret: getWebhookSecret(api.GenericWebhook, serverSet.Build.Webhooks),
KieServerContainerDeployment: serverSet.Build.KieServerContainerDeployment,
DisablePullDeps: serverSet.Build.DisablePullDeps,
DisableKCVerification: serverSet.Build.DisableKCVerification,
MavenMirrorURL: serverSet.Build.MavenMirrorURL,
ArtifactDir: serverSet.Build.ArtifactDir,
}
Expand Down
78 changes: 78 additions & 0 deletions pkg/controller/kieapp/defaults/defaults_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -554,6 +554,84 @@ func TestRhdmProdImmutableEnvironment(t *testing.T) {
assert.Nil(t, cr.Status.Applied.Objects.Console, "Console should be nil")
}

func TestRhpamProdImmutableEnvironmentDisableKCVerification(t *testing.T) {
cr := &api.KieApp{
ObjectMeta: metav1.ObjectMeta{
Name: "test",
},
Spec: api.KieAppSpec{
Environment: api.RhpamProductionImmutable,
Objects: api.KieAppObjects{
Servers: []api.KieServerSet{
{
Build: &api.KieAppBuildObject{
KieServerContainerDeployment: "",
DisableKCVerification: true,
},
},
},
},
},
}
env, err := GetEnvironment(cr, test.MockService())
assert.Nil(t, err, "Error getting prod environment")

assert.Equal(t, "true", getEnvVariable(env.Servers[0].DeploymentConfigs[0].Spec.Template.Spec.Containers[0], "KIE_SERVER_DISABLE_KC_VERIFICATION"), "Variable should exist and be true")
assert.Equal(t, "false", getEnvVariable(env.Servers[0].DeploymentConfigs[0].Spec.Template.Spec.Containers[0], "KIE_SERVER_DISABLE_KC_PULL_DEPS"), "Variable should exist and be false")
}

func TestRhdmProdImmutableEnvironmentDisableKCVerificationAndPull(t *testing.T) {
cr := &api.KieApp{
ObjectMeta: metav1.ObjectMeta{
Name: "test",
},
Spec: api.KieAppSpec{
Environment: api.RhdmProductionImmutable,
Objects: api.KieAppObjects{
Servers: []api.KieServerSet{
{
Build: &api.KieAppBuildObject{
KieServerContainerDeployment: "",
DisableKCVerification: true,
DisablePullDeps: true,
},
},
},
},
},
}
env, err := GetEnvironment(cr, test.MockService())
assert.Nil(t, err, "Error getting prod environment")

assert.Equal(t, "true", getEnvVariable(env.Servers[0].DeploymentConfigs[0].Spec.Template.Spec.Containers[0], "KIE_SERVER_DISABLE_KC_VERIFICATION"), "Variable should exist and be true")
assert.Equal(t, "true", getEnvVariable(env.Servers[0].DeploymentConfigs[0].Spec.Template.Spec.Containers[0], "KIE_SERVER_DISABLE_KC_PULL_DEPS"), "Variable should exist and be true")
}

func TestRhpamProdImmutableEnvironmentEnableKCVerification(t *testing.T) {
cr := &api.KieApp{
ObjectMeta: metav1.ObjectMeta{
Name: "test",
},
Spec: api.KieAppSpec{
Environment: api.RhpamProductionImmutable,
Objects: api.KieAppObjects{
Servers: []api.KieServerSet{
{
Build: &api.KieAppBuildObject{
KieServerContainerDeployment: "",
},
},
},
},
},
}
env, err := GetEnvironment(cr, test.MockService())
assert.Nil(t, err, "Error getting prod environment")

assert.Equal(t, "false", getEnvVariable(env.Servers[0].DeploymentConfigs[0].Spec.Template.Spec.Containers[0], "KIE_SERVER_DISABLE_KC_VERIFICATION"), "Variable should exist and be false")
assert.Equal(t, "false", getEnvVariable(env.Servers[0].DeploymentConfigs[0].Spec.Template.Spec.Containers[0], "KIE_SERVER_DISABLE_KC_PULL_DEPS"), "Variable should exist and be false")
}

func TestRhpamProdWithSmartRouter(t *testing.T) {
cr := &api.KieApp{
ObjectMeta: metav1.ObjectMeta{
Expand Down

0 comments on commit 979001c

Please sign in to comment.