Skip to content

Commit 6785df4

Browse files
committed
Updated the README
Signed-off-by: jubittajohn <[email protected]>
1 parent 44f8130 commit 6785df4

File tree

4 files changed

+29
-27
lines changed

4 files changed

+29
-27
lines changed

test/operator-framework-e2e/README.md

Lines changed: 18 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
# Cross-component E2E for operator framework
22

33
This is a cross-component demo with all OLM v1 repositories. The ginkgo test does the following:
4-
- Automates the creation of `plain+v0` bundles and FBCs for a set of bundle manifest directories.
4+
- Uses operator-sdk and kustomize to build `plain+v0` bundles and create catalogs to include the bundles.
55
- Installs, upgrades and deletes a `plain+v0` operator.
66
- Uses operator-sdk to build `registry+v1` bundles and create catalogs to include the bundles.
77
- Installs, upgrades and deletes a `registry+v1` operator.
88

9+
The steps in the ginkgo test can be summarized as follows:
10+
911
1. start with an empty directory
1012
2. call operator-sdk to initialize and generate an operator
1113
3. generate a bundle directory
@@ -27,10 +29,9 @@ This is a cross-component demo with all OLM v1 repositories. The ginkgo test doe
2729

2830
- Building operator-controller, deploying it into the cluster and rest of the configuration is done in the `MakeFile` of this repo under the target `operator-developer-e2e`. This includes:
2931

30-
- Setting up a kind cluster.
32+
- Setting up a kind cluster named `operator-controller-op-dev-e2e`.
3133
- Installing the operator controller onto the cluster.
32-
- Downloading the opm tool.
33-
- Installing the operator-sdk.
34+
- Setting up `opm`, `operator-sdk` and `kustomize` using bingo.
3435
- Setting up a local registry server for building and loading images.
3536

3637
- The following structs defined are required as input for both plain+v0 and registry+v1 bundles:
@@ -47,11 +48,11 @@ This is a cross-component demo with all OLM v1 repositories. The ginkgo test doe
4748
imageRef string
4849
}
4950
```
50-
- `baseFolderPath` - Base path of the folder for the specific bundle type input data.
51+
- `baseFolderPath` - Base/root path of the folder for the specific bundle type input data.[path to plain-v0 or registry-v1 bundles testdata]
5152
- `bundles` - Stores the data relevant to different versions of the bundle.
5253
- `bInputDir` - The input directory containing the specific version of the bundle data.
5354
- `bundleVersion` - The specific version of the bundle data.
54-
- `imageRef` - This is formed. Stores the bundle image reference which will be of the format `localhost:5000/<operator_name>-bundle:v.<bundleVersion>`
55+
- `imageRef` - This is formed. Stores the bundle image reference which will be of the format `localhost:5001/<operator_name>-bundle:v.<bundleVersion>`
5556
- For getting catalog related inputs:
5657
```
5758
type CatalogDInfo struct {
@@ -63,11 +64,11 @@ This is a cross-component demo with all OLM v1 repositories. The ginkgo test doe
6364
fbcFileName string
6465
}
6566
```
66-
- `baseFolderPath` - Base path of the folder for the catalogs.
67+
- `baseFolderPath` - Base/root path of the folder for the catalogs.
6768
- `operatorName` - Name of the operator to be installed from the bundles.
6869
- `desiredChannelName` - Desired channel name for the operator.
6970
- `catalogDir` - This is formed. The directory to store the FBC. The formed value will be of the format: `<operator-name>-catalog`
70-
- `imageRef` - This is formed. Stores the FBC image reference which will be of the format: `localhost:5000/<username>/<catalogDir>:test`
71+
- `imageRef` - This is formed. Stores the FBC image reference which will be of the format: `localhost:5001/<username>/<catalogDir>:test`
7172
- `fbcFileName` - Name of the FBC file. This is hard-coded as `catalog.yaml`.
7273
- For getting information related to the install/upgrade action for operators:
7374
```
@@ -80,20 +81,17 @@ This is a cross-component demo with all OLM v1 repositories. The ginkgo test doe
8081
- `upgradeVersion` - Version of the operator to be upgraded on the cluster.
8182
8283
### Plain bundles
83-
- Plain bundle manifests are taken as input.
84-
85-
- The plain bundle manifest directory taken as input should follow the below directory structure:
84+
- The plain+v0 bundles are formed using `operator-sdk` and `kustomize`.
85+
- The below input is used to form the bundle using operator-sdk.
8686
```
87-
bundles/
88-
└── plain-v0/
89-
├── plain.v<version>/
90-
│ ├── manifests
91-
│ └── Dockerfile
92-
└── plain.v<version>/
93-
├── manifests
94-
└── Dockerfile
87+
type SdkProjectInfo struct {
88+
projectName string
89+
domainName string
90+
group string
91+
version string
92+
kind string
93+
}
9594
```
96-
- The bundles should be present in the testdata folder.
9795
9896
- After the bundle image is created and loaded, the FBC is formed by a custom routine by using the operatorName, desiredChannelName, bundle imageRefs and bundleVersions.
9997

test/operator-framework-e2e/operator_framework_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ var _ = BeforeSuite(func() {
106106

107107
})
108108

109-
var _ = Describe("Operator Framework E2E for plain bundles", func() {
109+
var _ = Describe("Operator Framework E2E for plain+v0 bundles", func() {
110110
var (
111111
sdkInfo *SdkProjectInfo
112112
bundleInfo *BundleInfo
@@ -399,7 +399,7 @@ func sdkInitialize(sdkInfo *SdkProjectInfo) error {
399399
return nil
400400
}
401401

402-
// Creates new API and controller
402+
// Creates new API and controller for the given project with the name sdkInfo.projectName
403403
func sdkNewAPIAndController(sdkInfo *SdkProjectInfo) error {
404404
operatorSdkProjectAbsPath, _ := filepath.Abs(sdkInfo.projectName)
405405
operatorSdkProjectPath := "OPERATOR_SDK_PROJECT_PATH=" + operatorSdkProjectAbsPath

test/operator-framework-e2e/read_manifests.go

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package operatore2e
22

33
import (
4+
"bytes"
45
"fmt"
56
"os"
67
"path/filepath"
@@ -45,11 +46,14 @@ func collectKubernetesObjects(bundlePath, packageName, version string) ([]runtim
4546
}
4647

4748
decoder := codecs.UniversalDecoder(scheme.PrioritizedVersionsAllGroups()...)
48-
object, _, err := decoder.Decode(fileContent, nil, nil)
49-
if err != nil {
50-
return fmt.Errorf("failed to decode file %s: %w", filePath, err)
49+
yamlObjects := bytes.Split(fileContent, []byte("\n---\n"))
50+
for _, yamlObject := range yamlObjects {
51+
object, _, err := decoder.Decode(yamlObject, nil, nil)
52+
if err != nil {
53+
return fmt.Errorf("failed to decode file %s: %w", filePath, err)
54+
}
55+
objects = append(objects, object)
5156
}
52-
objects = append(objects, object)
5357
return nil
5458
})
5559

testdata/bundles/plain-v0/plain.v0.1.0/manifests/configmap.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ data:
1616
user-interface.properties: |
1717
color.good=purple
1818
color.bad=yellow
19-
allow.textmode=true
19+
allow.textmode=true

0 commit comments

Comments
 (0)