Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
282bb6e
.github/workflows: Fix the release quickstart.yaml GH action
timflannagan Jul 8, 2021
2b68727
Expose errors generated while retrieving catalog content.
benluddy Jul 26, 2021
a2c7df0
v0.18.3 OLM release
timflannagan Jul 8, 2021
e9be950
Update containerd dependency to fix vulnerabilities (#719)
Jul 28, 2021
327f6b7
doc/design: Update the changelog release documentation (#2298)
timflannagan Jul 28, 2021
999506f
.github/workflows: Avoid running the e2e-tests workflow on doc-only p…
timflannagan Jul 29, 2021
9e31252
don't return an error if the singleton rbac doesn't exist (#2309)
ecordell Jul 31, 2021
f405a8e
let net.Listen pick a port for grpc servers generated in tests (#2310)
ecordell Jul 31, 2021
c553dde
internal/declcfg: Avoid processing the .indexignore file when walking…
timflannagan Aug 3, 2021
84c6607
setup multi-arch builds with goreleaser
joelanford Jul 15, 2021
efbfe04
Move operator caching from resolver into a new package. (#2316)
benluddy Aug 5, 2021
ef66141
add further console customization types
dmesser Aug 5, 2021
761b51f
.github/workflows: Replace the e2e-kind job name with e2e in the test…
timflannagan Aug 5, 2021
7cff329
feat: support removing the default channel head in deprecatetrunace (…
exdx Aug 11, 2021
4e8f0d5
feat(release): X.Y, X, and latest opm image tags (#738)
Aug 11, 2021
13f3cc8
add further console customization types (#2319)
dmesser Aug 16, 2021
f8cb8db
cli doc: opm serve does not detect DC changes after startup (#750)
joelanford Aug 16, 2021
a8ad0d2
Add joelanford as an approver in OWNERS (#751)
kevinrizza Aug 16, 2021
da994b7
Prune API of the resolver package. (#2330)
benluddy Aug 18, 2021
42dc86b
Add vu dinh to OLM approvers (#2332)
kevinrizza Aug 18, 2021
1fca926
Use of/gini instead of inifrance/gini (#2331)
kevinrizza Aug 18, 2021
0b77115
Fix upstream-opm-builder (#758)
kevinrizza Aug 19, 2021
b5953c9
feat(opm): configure diff to not include dependency bundles with --sk…
Aug 19, 2021
baf84fa
move internal to alpha to make subpackages available for importing fr…
joelanford Aug 19, 2021
2eda531
fix broken URL in unit.yaml GH action (#2335)
josefkarasek Aug 24, 2021
54a82e9
bump gini (#2336)
ecordell Aug 26, 2021
1b1751a
(fix) : Fix check to verify OCP label versions when it is =v4.x (#148)
camilamacedo86 Aug 27, 2021
44b39b1
Fix 2327: Detecting OLM existence before start to install (#2334)
morningspace Aug 31, 2021
c98b23d
update default scaffolded opm base image (#762)
joelanford Aug 31, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,8 @@ github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeME
github.com/gliderlabs/ssh v0.2.2/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0=
github.com/globalsign/mgo v0.0.0-20180905125535-1ca0a4f7cbcb/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q=
github.com/globalsign/mgo v0.0.0-20181015135952-eeefdecb41b8/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q=
github.com/go-air/gini v1.0.4 h1:lteMAxHKNOAjIqazL/klOJJmxq6YxxSuJ17MnMXny+s=
github.com/go-air/gini v1.0.4/go.mod h1:dd8RvT1xcv6N1da33okvBd8DhMh1/A4siGy6ErjTljs=
github.com/go-bindata/go-bindata/v3 v3.1.3 h1:F0nVttLC3ws0ojc7p60veTurcOm//D4QBODNM7EGrCI=
github.com/go-bindata/go-bindata/v3 v3.1.3/go.mod h1:1/zrpXsLD8YDIbhZRqXzm1Ghc7NhEvIN9+Z6R5/xH4I=
github.com/go-errors/errors v1.0.1 h1:LUHzmkK3GUKUrL/1gfBUxAHzcev3apQlezX/+O7ma6w=
Expand Down Expand Up @@ -612,8 +614,6 @@ github.com/imdario/mergo v0.3.12/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH
github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM=
github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8=
github.com/influxdata/influxdb1-client v0.0.0-20191209144304-8bf82d3c094d/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo=
github.com/irifrance/gini v1.0.1 h1:oTABiARLoRsnTmda0uY2u2e5kfm8e6meBZB19lf5xhE=
github.com/irifrance/gini v1.0.1/go.mod h1:swH5OTtiG/X/YrU06r288qZwq6I1agpbuXQOB55xqGU=
github.com/itchyny/astgen-go v0.0.0-20200519013840-cf3ea398f645 h1:3gyXljUyTWWTv/NMFPvwgxJSdE9Mamg2r3x8HMBl+Uo=
github.com/itchyny/astgen-go v0.0.0-20200519013840-cf3ea398f645/go.mod h1:296z3W7Xsrp2mlIY88ruDKscuvrkL6zXCNRtaYVshzw=
github.com/itchyny/go-flags v1.5.0/go.mod h1:lenkYuCobuxLBAd/HGFE4LRoW8D3B6iXRQfWYJ+MNbA=
Expand Down
139 changes: 73 additions & 66 deletions staging/api/pkg/validation/internal/community.go
Original file line number Diff line number Diff line change
Expand Up @@ -239,75 +239,71 @@ func validateImageFile(checks CommunityOperatorChecks, deprecatedAPImsg string)
}

value := strings.Split(line[i], "=")
indexRange := value[1]
doubleCote := "\""
singleCote := "'"
indexRange = strings.ReplaceAll(indexRange, singleCote, "")
indexRange = strings.ReplaceAll(indexRange, doubleCote, "")
// It means that the OCP label is =OCP version
if len(value) > 2 && len(value[2]) > 0 {
version := cleanStringToGetTheVersionToParse(value[2])
verParsed, err := semver.ParseTolerant(version)
if err != nil {
checks.errs = append(checks.errs, fmt.Errorf("unable to parse the value (%s) on (%s)",
version, ocpLabelindex))
return checks
}

if verParsed.GE(semVerOCPV1beta1Unsupported) {
checks.errs = append(checks.errs, fmt.Errorf("this bundle is using APIs which were "+
"deprecated and removed in v1.22. "+
"More info: https://kubernetes.io/docs/reference/using-api/deprecation-guide/#v1-22. "+
"Migrate the API(s) for "+
"%s or provide compatible version(s) by using the %s annotation in "+
"`metadata/annotations.yaml` to ensure that the index image will be geneared "+
"with its label. (e.g. LABEL %s='4.6-4.8')",
deprecatedAPImsg,
ocpLabelindex,
ocpLabelindex))
return checks
}
return checks
}
indexRange := cleanStringToGetTheVersionToParse(value[1])
if len(indexRange) > 1 {
// if has the = then, the value needs to be < 4.9
if strings.Contains(indexRange, "=") {
version := strings.Split(indexRange, "=")[1]
verParsed, err := semver.ParseTolerant(version)
if err != nil {
checks.errs = append(checks.errs, fmt.Errorf("unable to parse the value (%s) on (%s)",
version, ocpLabelindex))
return checks
}

if verParsed.GE(semVerOCPV1beta1Unsupported) {
checks.errs = append(checks.errs, fmt.Errorf("this bundle is using APIs which were "+
"deprecated and removed in v1.22. "+
"More info: https://kubernetes.io/docs/reference/using-api/deprecation-guide/#v1-22. "+
"Migrate the API(s) for "+
"%s or provide compatible version(s) by using the %s annotation in "+
"`metadata/annotations.yaml` to ensure that the index image will be geneared "+
"with its label. (e.g. LABEL %s='4.6-4.8')",
deprecatedAPImsg,
ocpLabelindex,
ocpLabelindex))
return checks
}
} else {
// if not has not the = then the value needs contains - value less < 4.9
if !strings.Contains(indexRange, "-") {
checks.errs = append(checks.errs, fmt.Errorf("this bundle is using APIs which were "+
"deprecated and removed in v1.22. "+
"More info: https://kubernetes.io/docs/reference/using-api/deprecation-guide/#v1-22 "+
"The %s allows to distribute it on >= %s. Migrate the API(s) for "+
"%s or provide compatible version(s) by using the %s annotation in "+
"`metadata/annotations.yaml` to ensure that the index image will be generated "+
"with its label. (e.g. LABEL %s='4.6-4.8')",
indexRange,
ocpVerV1beta1Unsupported,
deprecatedAPImsg,
ocpLabelindex,
ocpLabelindex))
return checks
}

version := strings.Split(indexRange, "-")[1]
verParsed, err := semver.ParseTolerant(version)
if err != nil {
checks.errs = append(checks.errs, fmt.Errorf("unable to parse the value (%s) on (%s)",
version, ocpLabelindex))
return checks
}

if verParsed.GE(semVerOCPV1beta1Unsupported) {
checks.errs = append(checks.errs, fmt.Errorf("this bundle is using APIs which were "+
"deprecated and removed in v1.22. "+
"More info: https://kubernetes.io/docs/reference/using-api/deprecation-guide/#v1-22. "+
"Upgrade the APIs from "+
"for %s or provide compatible distribution version(s) by using the %s "+
"annotation in `metadata/annotations.yaml` to ensure that the index image will "+
"be generated with its label. (e.g. LABEL %s='4.6-4.8')",
deprecatedAPImsg,
ocpLabelindex,
ocpLabelindex))
return checks
}
// if not has not the = then the value needs contains - value less < 4.9
if !strings.Contains(indexRange, "-") {
checks.errs = append(checks.errs, fmt.Errorf("this bundle is using APIs which were "+
"deprecated and removed in v1.22. "+
"More info: https://kubernetes.io/docs/reference/using-api/deprecation-guide/#v1-22 "+
"The %s allows to distribute it on >= %s. Migrate the API(s) for "+
"%s or provide compatible version(s) by using the %s annotation in "+
"`metadata/annotations.yaml` to ensure that the index image will be generated "+
"with its label. (e.g. LABEL %s='4.6-4.8')",
indexRange,
ocpVerV1beta1Unsupported,
deprecatedAPImsg,
ocpLabelindex,
ocpLabelindex))
return checks
}

version := strings.Split(indexRange, "-")[1]
verParsed, err := semver.ParseTolerant(version)
if err != nil {
checks.errs = append(checks.errs, fmt.Errorf("unable to parse the value (%s) on (%s)",
version, ocpLabelindex))
return checks
}

if verParsed.GE(semVerOCPV1beta1Unsupported) {
checks.errs = append(checks.errs, fmt.Errorf("this bundle is using APIs which were "+
"deprecated and removed in v1.22. "+
"More info: https://kubernetes.io/docs/reference/using-api/deprecation-guide/#v1-22. "+
"Upgrade the APIs from "+
"for %s or provide compatible distribution version(s) by using the %s "+
"annotation in `metadata/annotations.yaml` to ensure that the index image will "+
"be generated with its label. (e.g. LABEL %s='4.6-4.8')",
deprecatedAPImsg,
ocpLabelindex,
ocpLabelindex))
return checks
}
} else {
checks.errs = append(checks.errs, fmt.Errorf("unable to get the range informed on %s",
Expand All @@ -328,3 +324,14 @@ func validateImageFile(checks CommunityOperatorChecks, deprecatedAPImsg string)
}
return checks
}

// cleanStringToGetTheVersionToParse will remove the expected characters for
// we are able to parse the version informed.
func cleanStringToGetTheVersionToParse(value string) string {
doubleQuote := "\""
singleQuote := "'"
value = strings.ReplaceAll(value, singleQuote, "")
value = strings.ReplaceAll(value, doubleQuote, "")
value = strings.ReplaceAll(value, "v", "")
return value
}
12 changes: 12 additions & 0 deletions staging/api/pkg/validation/internal/community_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,18 @@ func Test_communityValidator(t *testing.T) {
},
},
},
{
name: "should pass when the olm annotation and index label are set with a " +
"value =v4.8 and has deprecated apis",
wantError: false,
args: args{
bundleDir: "./testdata/valid_bundle_v1beta1",
imageIndexPath: "./testdata/dockerfile/valid_bundle_4_8.Dockerfile",
annotations: map[string]string{
"olm.properties": fmt.Sprintf(`[{"type": "olm.maxOpenShiftVersion", "value": "4.8"}]`),
},
},
},
}

for _, tt := range tests {
Expand Down
6 changes: 3 additions & 3 deletions staging/api/pkg/validation/internal/operatorhub_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -397,8 +397,8 @@ func TestValidateHubDeprecatedAPIS(t *testing.T) {
minKubeVersion: "",
directory: "./testdata/valid_bundle_v1beta1",
},
wantError: true,
errStrings: []string{"this bundle is using APIs which were deprecated and removed in v1.22. " +
wantError: true,
errStrings: []string{"this bundle is using APIs which were deprecated and removed in v1.22. " +
"More info: https://kubernetes.io/docs/reference/using-api/deprecation-guide/#v1-22. " +
"Migrate the API(s) for CRD: ([\"etcdbackups.etcd.database.coreos.com\"" +
" \"etcdclusters.etcd.database.coreos.com\" \"etcdrestores.etcd.database.coreos.com\"])"},
Expand All @@ -423,7 +423,7 @@ func TestValidateHubDeprecatedAPIS(t *testing.T) {
},
wantError: true,
wantWarning: true,
errStrings: []string{"unable to use csv.Spec.MinKubeVersion to verify the CRD/Webhook apis because it " +
errStrings: []string{"unable to use csv.Spec.MinKubeVersion to verify the CRD/Webhook apis because it " +
"has an invalid value: invalid"},
warnStrings: []string{"this bundle is using APIs which were deprecated and removed in v1.22. " +
"More info: https://kubernetes.io/docs/reference/using-api/deprecation-guide/#v1-22. " +
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
FROM scratch

# Core bundle labels.
LABEL operators.operatorframework.io.bundle.mediatype.v1=registry+v1
LABEL operators.operatorframework.io.bundle.manifests.v1=manifests/
LABEL operators.operatorframework.io.bundle.metadata.v1=metadata/
LABEL operators.operatorframework.io.bundle.package.v1=memcached-operator
LABEL operators.operatorframework.io.bundle.channels.v1=alpha
LABEL com.redhat.openshift.versions="=v4.8"

# Labels for testing.
LABEL operators.operatorframework.io.test.mediatype.v1=scorecard+v1
LABEL operators.operatorframework.io.test.config.v1=tests/scorecard/

# Copy files to locations specified by labels.
COPY bundle/manifests /manifests/
COPY bundle/metadata /metadata/
COPY bundle/tests/scorecard /tests/scorecard/
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ on:
branches:
- master
pull_request:
paths:
- '**'
- '!doc/**'
jobs:
run-e2e-tests:
runs-on: ubuntu-latest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,24 @@ jobs:
kubectl apply -f deploy/upstream/quickstart/crds.yaml
kubectl wait --timeout=5m --for=condition=Established crd $(kubectl get crd --output=jsonpath='{.items[*].metadata.name}')
kubectl apply -f deploy/upstream/quickstart/olm.yaml
kubectl wait --timeout=5m --for=condition=Available -n olm deploy olm-operator catalog-operator packageserver

# Note(tflannag): `kubectl wait` does not support waiting for resource creation: https://github.com/kubernetes/kubernetes/pull/87399.
wait_for_deployment() {
local deployment_name=$1
timeout=60
i=1
echo "Checking if the ${deployment_name} deployment is ready"
until kubectl -n olm get deployment ${deployment_name} -o jsonpath='{.status.conditions[?(@.status=="True")].type}' | grep "Available" 2>/dev/null; do
((i++))
if [[ ${i} -gt ${timeout} ]]; then
echo "the ${deployment_name} deployment has not become ready before the timeout period"
exit 1
fi
echo "waiting for ${deployment_name} deployment to report a ready status"
sleep 5
done
echo "The ${deployment_name} deployment is ready"
}
wait_for_deployment catalog-operator
wait_for_deployment olm-operator
wait_for_deployment packageserver
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
run: |
os=$(go env GOOS)
arch=$(go env GOARCH)
curl -L https://go.kubebuilder.io/dl/2.3.1/${os}/${arch} | tar -xz -C /tmp/
curl -L https://github.com/kubernetes-sigs/kubebuilder/releases/download/v2.3.1/kubebuilder_2.3.1_${os}_${arch}.tar.gz | tar -xz -C /tmp/
sudo mv /tmp/kubebuilder_2.3.1_${os}_${arch} /usr/local/kubebuilder
- name: Run unit tests
run: make unit
1 change: 1 addition & 0 deletions staging/operator-lifecycle-manager/OWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ approvers:
- kevinrizza
- benluddy
- awgreene
- dinhxuanvu
# review == this code is good /lgtm
reviewers:
- ecordell
Expand Down
Loading