Skip to content

Commit 6936243

Browse files
Merge pull request #110 from gabemontero/remove-ppc
Remove ppc
2 parents 8205382 + 3dbf4cb commit 6936243

38 files changed

+528
-248
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,19 +33,19 @@ The samples resource offers the following configuration fields:
3333
- Samples Registry
3434
-- Override the registry that images are imported from
3535
- Architecture
36-
-- Place holder to choose between x86 and ppc content
36+
-- Place holder to choose an architecture type. Currently only x86 is supported.
3737
- Skipped Imagestreams
3838
-- Imagestreams that are in the operator’s inventory, but that the cluster admin wants the operator to ignore / not manage
3939
- Skipped Templates
4040
-- Templates that are in the operator’s inventory, but that the cluster admin wants the operator to ignore / not manage
4141

4242
## Config restrictions
4343

44-
The architectures are not allowed to be changed while in the 'Managed' state.
44+
When we start supporting multiple architectures, the architecture list is not allowed to be changed while in the 'Managed' state.
4545

4646
In order to change the architectures values, an administrator must:
4747
- Mark the ManagementState as 'Removed', saving the change.
48-
- In a subsequent change, switch the architecture and change the ManagementState back to Managed.
48+
- In a subsequent change, change the architecture and change the ManagementState back to Managed.
4949

5050
The operator will still process Secrets while in Removed state. You can create the secret either before switching to Removed, while in Removed state before switching to Managed state, or after switching to Managed state (though you'll see delays creating the samples until the secret event is processed if you create the secret after switching to Managed). This is done to help facilitate the changing of the registry, where the user chooses to remove all the samples before switching to insure a clean slate (removing before switching is not required).
5151

pkg/apis/samples/v1/types.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,6 @@ const (
4444
// X86Architecture is the value used to specify the x86_64 hardware architecture
4545
// in the Architectures array field.
4646
X86Architecture = "x86_64"
47-
// PPCArchitecture is the value used to specify the ppc64le hardware architecture
48-
// in the Architectures array field.
49-
PPCArchitecture = "ppc64le"
5047
// ConfigFinalizer is the text added to the Config.Finalizer field
5148
// to enable finalizer processing.
5249
ConfigFinalizer = GroupName + "/finalizer"

pkg/stub/config.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,8 @@ func (h *Handler) SpecValidation(cfg *v1.Config) error {
2929
for _, arch := range cfg.Spec.Architectures {
3030
switch arch {
3131
case v1.X86Architecture:
32-
case v1.PPCArchitecture:
3332
default:
34-
err := fmt.Errorf("architecture %s unsupported; only support %s and %s", arch, v1.X86Architecture, v1.PPCArchitecture)
33+
err := fmt.Errorf("architecture %s unsupported; only support %s", arch, v1.X86Architecture)
3534
return h.processError(cfg, v1.ConfigurationValid, corev1.ConditionFalse, err, "%v")
3635
}
3736
}

pkg/stub/files.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,6 @@ func (h *Handler) GetBaseDir(arch string, opcfg *v1.Config) (dir string) {
5656
switch arch {
5757
case v1.X86Architecture:
5858
dir = x86OCPContentRootDir
59-
case v1.PPCArchitecture:
60-
dir = ppc64OCPContentRootDir
6159
default:
6260
}
6361
return dir

pkg/stub/handler.go

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,11 @@ import (
3737
)
3838

3939
const (
40-
x86OCPContentRootDir = "/opt/openshift/operator/ocp-x86_64"
41-
ppc64OCPContentRootDir = "/opt/openshift/operator/ocp-ppc64le"
42-
installtypekey = "keyForInstallTypeField"
43-
regkey = "keyForSamplesRegistryField"
44-
skippedstreamskey = "keyForSkippedImageStreamsField"
45-
skippedtempskey = "keyForSkippedTemplatesField"
40+
x86OCPContentRootDir = "/opt/openshift/operator/ocp-x86_64"
41+
installtypekey = "keyForInstallTypeField"
42+
regkey = "keyForSamplesRegistryField"
43+
skippedstreamskey = "keyForSkippedImageStreamsField"
44+
skippedtempskey = "keyForSkippedTemplatesField"
4645
)
4746

4847
func NewSamplesOperatorHandler(kubeconfig *restclient.Config) (*Handler, error) {

pkg/stub/handler_test.go

Lines changed: 0 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -144,39 +144,6 @@ func TestWithArchDist(t *testing.T) {
144144
statuses, t)
145145
//}
146146

147-
h, cfg, event = setup()
148-
/*fakesecretclient := h.secretclientwrapper.(*fakeSecretClientWrapper)
149-
fakesecretclient.s = secret*/
150-
mimic(&h, ppc64OCPContentRootDir)
151-
cfg.Spec.Architectures = []string{
152-
v1.PPCArchitecture,
153-
}
154-
/*err := h.Handle(credEvent)
155-
statuses := []corev1.ConditionStatus{corev1.ConditionFalse, corev1.ConditionTrue, corev1.ConditionTrue, corev1.ConditionFalse, corev1.ConditionFalse, corev1.ConditionFalse, corev1.ConditionFalse}
156-
validate(true, err, "", cfg,
157-
conditions,
158-
statuses, t)*/
159-
err = h.Handle(event)
160-
//statuses := []corev1.ConditionStatus{corev1.ConditionFalse, corev1.ConditionTrue, corev1.ConditionTrue, corev1.ConditionTrue, corev1.ConditionFalse, corev1.ConditionFalse, corev1.ConditionFalse}
161-
statuses = []corev1.ConditionStatus{corev1.ConditionFalse, corev1.ConditionFalse, corev1.ConditionTrue, corev1.ConditionTrue, corev1.ConditionFalse, corev1.ConditionFalse, corev1.ConditionFalse}
162-
validate(true, err, "", cfg,
163-
conditions,
164-
statuses, t)
165-
err = h.Handle(event)
166-
//statuses = []corev1.ConditionStatus{corev1.ConditionTrue, corev1.ConditionTrue, corev1.ConditionTrue, corev1.ConditionTrue, corev1.ConditionFalse, corev1.ConditionFalse, corev1.ConditionFalse}
167-
statuses = []corev1.ConditionStatus{corev1.ConditionTrue, corev1.ConditionFalse, corev1.ConditionTrue, corev1.ConditionTrue, corev1.ConditionFalse, corev1.ConditionFalse, corev1.ConditionFalse}
168-
validate(true, err, "", cfg,
169-
conditions,
170-
statuses, t)
171-
172-
// verify cannot change arch
173-
cfg.ResourceVersion = "2"
174-
cfg.Spec.Architectures = []string{
175-
v1.X86Architecture,
176-
}
177-
mimic(&h, x86OCPContentRootDir)
178-
h.Handle(event)
179-
invalidConfig(t, "cannot change architectures from", cfg.Condition(v1.ConfigurationValid))
180147
}
181148

182149
func TestWithArch(t *testing.T) {
@@ -1052,24 +1019,6 @@ func TestBadTopLevelStatus(t *testing.T) {
10521019
validate(false, err, "badsdkupdate", cfg, conditions, statuses, t)
10531020
}
10541021

1055-
func TestUnsupportedArchChange(t *testing.T) {
1056-
h, cfg, event := setup()
1057-
cfg.Spec.Architectures = []string{v1.PPCArchitecture}
1058-
// fake out secret import as shortcut ... we test secret events elsewhere
1059-
cred := cfg.Condition(v1.ImportCredentialsExist)
1060-
cred.Status = corev1.ConditionTrue
1061-
cfg.ConditionUpdate(cred)
1062-
err := h.Handle(event)
1063-
statuses := []corev1.ConditionStatus{corev1.ConditionFalse, corev1.ConditionTrue, corev1.ConditionTrue, corev1.ConditionTrue, corev1.ConditionFalse, corev1.ConditionFalse, corev1.ConditionFalse}
1064-
validate(true, err, "", cfg, conditions, statuses, t)
1065-
1066-
cfg.Spec.Architectures = []string{v1.X86Architecture}
1067-
cfg.ResourceVersion = "2"
1068-
1069-
err = h.Handle(event)
1070-
invalidConfig(t, "cannot change architecture", cfg.Condition(v1.ConfigurationValid))
1071-
}
1072-
10731022
func invalidConfig(t *testing.T, msg string, cfgValid *v1.ConfigCondition) {
10741023
if cfgValid.Status != corev1.ConditionFalse {
10751024
t.Fatalf("config valid condition not false: %v", cfgValid)

test/e2e/cluster_samples_operator_test.go

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -845,41 +845,6 @@ func TestSpecManagementStateField(t *testing.T) {
845845
t.Logf("Config after TestSpecManagementStateField: %#v", verifyOperatorUp(t))
846846
}
847847

848-
func TestArchitectureConfigChangeValidation(t *testing.T) {
849-
err := verifyConditionsCompleteSamplesAdded(t)
850-
if err != nil {
851-
dumpPod(t)
852-
t.Fatalf("samples not stable at start of arch cfg chg test %#v", verifyOperatorUp(t))
853-
}
854-
err = retry.RetryOnConflict(retry.DefaultBackoff, func() error {
855-
cfg := verifyOperatorUp(t)
856-
cfg.Spec.Architectures[0] = samplesapi.PPCArchitecture
857-
cfg, err := crClient.Samples().Configs().Update(cfg)
858-
return err
859-
})
860-
if err != nil {
861-
dumpPod(t)
862-
t.Fatalf("error updating Config %v and %#v", err, verifyOperatorUp(t))
863-
}
864-
865-
verifyConfigurationValid(t, corev1.ConditionFalse)
866-
867-
//reset install type back
868-
err = retry.RetryOnConflict(retry.DefaultBackoff, func() error {
869-
cfg := verifyOperatorUp(t)
870-
cfg.Spec.Architectures[0] = samplesapi.X86Architecture
871-
cfg, err = crClient.Samples().Configs().Update(cfg)
872-
return err
873-
})
874-
if err != nil {
875-
dumpPod(t)
876-
t.Fatalf("error updating Config %v and %#v", err, verifyOperatorUp(t))
877-
}
878-
879-
verifyConfigurationValid(t, corev1.ConditionTrue)
880-
t.Logf("Config after TestArchitectureConfigChangeValidation: %#v", verifyOperatorUp(t))
881-
}
882-
883848
func TestSkippedProcessing(t *testing.T) {
884849
err := verifyConditionsCompleteSamplesAdded(t)
885850
if err != nil {

tmp/build/assets/operator/ocp-ppc64le/ruby/imagestreams/ruby-rhel7.json

Lines changed: 0 additions & 53 deletions
This file was deleted.

tmp/build/assets/operator/ocp-x86_64/eap-cd/imagestreams/eap-cd-openshift-rhel7.json

Lines changed: 44 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"apiVersion": "v1",
33
"kind": "ImageStream",
44
"labels": {
5-
"xpaas": "14.0"
5+
"xpaas": "15.0"
66
},
77
"metadata": {
88
"annotations": {
@@ -22,7 +22,7 @@
2222
"sampleContextDir": "kitchensink",
2323
"sampleRef": "openshift",
2424
"sampleRepo": "https://github.com/jbossas/eap-quickstarts/openshift",
25-
"supports": "eap:7.2,javaee:8,java:8",
25+
"supports": "eap:7.3,javaee:8,java:8",
2626
"tags": "builder,eap,javaee,java,jboss,hidden",
2727
"version": "latest"
2828
},
@@ -35,6 +35,27 @@
3535
"type": "Local"
3636
}
3737
},
38+
{
39+
"annotations": {
40+
"description": "JBoss EAP continuous delivery Tech Preview version 15.",
41+
"iconClass": "icon-eap",
42+
"openshift.io/display-name": "JBoss EAP continuous delivery 15 (Tech Preview)",
43+
"sampleContextDir": "kitchensink",
44+
"sampleRef": "openshift",
45+
"sampleRepo": "https://github.com/jboss-developer/jboss-eap-quickstarts.git",
46+
"supports": "eap:7.3,javaee:8,java:8",
47+
"tags": "builder,eap,javaee,java,jboss,hidden",
48+
"version": "15"
49+
},
50+
"from": {
51+
"kind": "ImageStreamTag",
52+
"name": "15.0"
53+
},
54+
"name": "15",
55+
"referencePolicy": {
56+
"type": "Local"
57+
}
58+
},
3859
{
3960
"annotations": {
4061
"description": "JBoss EAP continuous delivery Tech Preview version 14.",
@@ -160,6 +181,27 @@
160181
"referencePolicy": {
161182
"type": "Local"
162183
}
184+
},
185+
{
186+
"annotations": {
187+
"description": "JBoss EAP continuous delivery 15 Tech Preview S2I Image",
188+
"iconClass": "icon-eap",
189+
"openshift.io/display-name": "JBoss EAP continuous delivery 15 (Tech Preview)",
190+
"sampleContextDir": "kitchensink",
191+
"sampleRef": "openshift",
192+
"sampleRepo": "https://github.com/jbossas/eap-quickstarts/openshift",
193+
"supports": "eap:7.3,javaee:8,java:8",
194+
"tags": "builder,eap,javaee,java,jboss,hidden",
195+
"version": "15.0"
196+
},
197+
"from": {
198+
"kind": "DockerImage",
199+
"name": "registry.redhat.io/jboss-eap-7-tech-preview/eap-cd-openshift:15.0"
200+
},
201+
"name": "15.0",
202+
"referencePolicy": {
203+
"type": "Local"
204+
}
163205
}
164206
]
165207
}

tmp/build/assets/operator/ocp-x86_64/eap-cd/templates/eap-cd-basic-s2i.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,20 @@
33
"kind": "Template",
44
"labels": {
55
"template": "eap-cd-basic-s2i",
6-
"xpaas": "14.0"
6+
"xpaas": "15.0"
77
},
88
"message": "A new JBoss EAP CD based application has been created in your project.",
99
"metadata": {
1010
"annotations": {
1111
"description": "An example JBoss Enterprise Application Platform continuous delivery application. For more information about using this template, see https://github.com/jboss-container-images/jboss-eap-7-openshift-image/blob/eap-cd/README.adoc",
1212
"iconClass": "icon-eap",
13-
"openshift.io/display-name": "JBoss EAP CD 14",
13+
"openshift.io/display-name": "JBoss EAP CD 15",
1414
"openshift.io/provider-display-name": "Red Hat, Inc.",
1515
"tags": "eap,javaee,java,jboss",
1616
"template.openshift.io/documentation-url": "https://access.redhat.com/documentation/en/red-hat-jboss-enterprise-application-platform/",
1717
"template.openshift.io/long-description": "This template defines resources needed to develop a JBoss Enterprise Application Platform continuous delivery based application, including a build configuration, application deployment configuration and secure communication using edge TLS.",
1818
"template.openshift.io/support-url": "https://access.redhat.com",
19-
"version": "14.0"
19+
"version": "15.0"
2020
},
2121
"name": "eap-cd-basic-s2i"
2222
},
@@ -66,6 +66,7 @@
6666
"port": 8888
6767
}
6868
],
69+
"publishNotReadyAddresses": true,
6970
"selector": {
7071
"deploymentConfig": "${APPLICATION_NAME}"
7172
}
@@ -147,7 +148,7 @@
147148
"forcePull": true,
148149
"from": {
149150
"kind": "ImageStreamTag",
150-
"name": "eap-cd-openshift:14",
151+
"name": "eap-cd-openshift:15",
151152
"namespace": "${IMAGE_STREAM_NAMESPACE}"
152153
},
153154
"incremental": true

0 commit comments

Comments
 (0)