Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ generate: build # Generate CLI docs and samples
go run ./hack/generate/samples/generate_testdata.go

.PHONY: bindata
OLM_VERSIONS = 0.16.1 0.15.1
OLM_VERSIONS = 0.16.1 0.15.1 0.17.0
bindata: ## Update project bindata
./hack/generate/olm_bindata.sh $(OLM_VERSIONS)

Expand Down
16 changes: 16 additions & 0 deletions changelog/fragments/add-0.17.0-olm-bindata.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# entries is a list of entries to include in
# release notes and/or the migration guide
entries:
- description: >
Add OLM bindata for the 0.17.0 release version.

# kind is one of:
# - addition
# - change
# - deprecation
# - removal
# - bugfix
kind: "addition"

# Is this a breaking change?
breaking: false
15 changes: 13 additions & 2 deletions hack/generate/olm_bindata.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,20 @@
#!/usr/bin/env bash

base_version=0.16.1

function version_gt() {
test "$(printf '%s\n' "$@" | sort -V | head -n 1)" != "$1";
}

function get_olm_manifests() {
echo "downloading olm manifests for version ${1}"
curl -L -o olm-manifests/$1-olm.yaml "https://github.com/operator-framework/operator-lifecycle-manager/releases/download/${1}/olm.yaml"
curl -L -o olm-manifests/$1-crds.yaml "https://github.com/operator-framework/operator-lifecycle-manager/releases/download/${1}/crds.yaml"
tag=$1
if version_gt ${1} $base_version; then
tag="v"$1
fi
echo "using the olm tag ${tag}"
curl -L -o olm-manifests/$1-olm.yaml "https://github.com/operator-framework/operator-lifecycle-manager/releases/download/${tag}/olm.yaml"
curl -L -o olm-manifests/$1-crds.yaml "https://github.com/operator-framework/operator-lifecycle-manager/releases/download/${tag}/crds.yaml"
}

function remove_olm_manifests {
Expand Down
4 changes: 2 additions & 2 deletions hack/tests/integration.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ popd
# Install OLM on the cluster if not installed.
olm_latest_exists=0
if ! operator-sdk olm status > /dev/null 2>&1; then
operator-sdk olm install --version=0.15.1
operator-sdk olm install --version=0.17.0
olm_latest_exists=1
fi

Expand All @@ -40,5 +40,5 @@ header_text "Integration tests succeeded"

# Uninstall OLM if it was installed for test purposes.
if eval "(( $olm_latest_exists ))"; then
operator-sdk olm uninstall --version=0.15.1
operator-sdk olm uninstall --version=0.17.0
fi
2 changes: 1 addition & 1 deletion hack/tests/subcommand-olm-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@ test_version() {
}

test_version "latest"
test_version "0.15.1" # Check installation of OLM for locally stored version of binaries
test_version "0.17.0" # Check installation of OLM for locally stored version of binaries
54 changes: 50 additions & 4 deletions internal/bindata/olm/manifests.go

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions internal/bindata/olm/versions.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ package olm
var availableVersions = map[string]struct{}{
"0.16.1": {},
"0.15.1": {},
"0.17.0": {},
}

// HasVersion returns whether version maps to released OLM manifests as bindata.
Expand Down
8 changes: 4 additions & 4 deletions internal/olm/installer/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ func (c Client) GetStatus(ctx context.Context, namespace, version string) (*olmr
func (c Client) getResources(ctx context.Context, version string) ([]unstructured.Unstructured, error) {
log.Infof("Fetching CRDs for version %q", version)

version = formatVersion(version)
resolvedVersion := formatVersion(version)

var crdResources, olmResources []unstructured.Unstructured
var err error
Expand All @@ -196,13 +196,13 @@ func (c Client) getResources(ctx context.Context, version string) ([]unstructure
return nil, err
}
} else {
log.Infof("Fetching resources for resolved version %q", version)
crdResources, err = c.getCRDs(ctx, version)
log.Infof("Fetching resources for resolved version %q", resolvedVersion)
crdResources, err = c.getCRDs(ctx, resolvedVersion)
if err != nil {
return nil, fmt.Errorf("failed to fetch CRDs: %v", err)
}

olmResources, err = c.getOLM(ctx, version)
olmResources, err = c.getOLM(ctx, resolvedVersion)
if err != nil {
return nil, fmt.Errorf("failed to fetch resources: %v", err)
}
Expand Down
2 changes: 1 addition & 1 deletion internal/testutils/olm.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (
)

const (
OlmVersionForTestSuite = "0.15.1"
OlmVersionForTestSuite = "0.17.0"
)

var makefilePackagemanifestsFragment = `
Expand Down