Skip to content
Closed
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
19 changes: 0 additions & 19 deletions .github/workflows/catalogd-crd-diff.yaml

This file was deleted.

7 changes: 5 additions & 2 deletions .github/workflows/crd-diff.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,8 @@ jobs:
go-version-file: go.mod

- name: Run make verify-crd-compatibility
run: make verify-crd-compatibility CRD_DIFF_ORIGINAL_REF=${{ github.event.pull_request.base.sha }} CRD_DIFF_UPDATED_SOURCE="git://${{ github.event.pull_request.head.sha }}?path=config/base/crd/bases/olm.operatorframework.io_clusterextensions.yaml"

run: |
make verify-crd-compatibility \
CRD_DIFF_ORIGINAL_REF=${{ github.event.pull_request.base.sha }} \
CRD_DIFF_UPDATED_SOURCE="git://${{ github.event.pull_request.head.sha }}?path=config/base/crd/bases/olm.operatorframework.io_clusterextensions.yaml" \
CATALOGD_CRD_DIFF_UPDATED_SOURCE="git://${{ github.event.pull_request.head.sha }}?path=catalogd/config/base/crd/bases/olm.operatorframework.io_clustercatalogs.yaml"
1 change: 1 addition & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ release:
disable: '{{ ne .Env.ENABLE_RELEASE_PIPELINE "true" }}'
extra_files:
- glob: 'operator-controller.yaml'
- glob: './catalogd/config/base/default/clustercatalogs/default-catalogs.yaml'
- glob: 'install.sh'
header: |
## Installation
Expand Down
10 changes: 8 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,13 @@ bingo-upgrade: $(BINGO) #EXHELP Upgrade tools
.PHONY: verify-crd-compatibility
CRD_DIFF_ORIGINAL_REF := main
CRD_DIFF_UPDATED_SOURCE := file://config/base/crd/bases/olm.operatorframework.io_clusterextensions.yaml
CATALOGD_CRD_DIFF_UPDATED_SOURCE := file://catalogd/config/base/crd/bases/olm.operatorframework.io_clustercatalogs.yaml
CRD_DIFF_CONFIG := crd-diff-config.yaml

verify-crd-compatibility: $(CRD_DIFF) manifests
$(CRD_DIFF) --config="${CRD_DIFF_CONFIG}" "git://${CRD_DIFF_ORIGINAL_REF}?path=config/base/crd/bases/olm.operatorframework.io_clusterextensions.yaml" ${CRD_DIFF_UPDATED_SOURCE}
$(CRD_DIFF) --config="${CRD_DIFF_CONFIG}" "git://${CRD_DIFF_ORIGINAL_REF}?path=catalogd/config/base/crd/bases/olm.operatorframework.io_clustercatalogs.yaml" ${CATALOGD_CRD_DIFF_UPDATED_SOURCE}


.PHONY: test
test: manifests generate fmt vet test-unit test-e2e #HELP Run all tests.
Expand Down Expand Up @@ -244,9 +248,10 @@ kind-load: $(KIND) #EXHELP Loads the currently constructed images into the KIND

.PHONY: kind-deploy
kind-deploy: export MANIFEST := ./operator-controller.yaml
kind-deploy: export DEFAULT_CATALOG := ./catalogd/config/base/default/clustercatalogs/default-catalogs.yaml
kind-deploy: manifests $(KUSTOMIZE)
($(KUSTOMIZE) build $(KUSTOMIZE_BUILD_DIR) && echo "---" && $(KUSTOMIZE) build catalogd/config/overlays/cert-manager | sed "s/cert-git-version/cert-$(VERSION)/g") > $(MANIFEST)
envsubst '$$CERT_MGR_VERSION,$$INSTALL_DEFAULT_CATALOGS,$$MANIFEST' < scripts/install.tpl.sh | bash -s
envsubst '$$DEFAULT_CATALOG,$$CERT_MGR_VERSION,$$INSTALL_DEFAULT_CATALOGS,$$MANIFEST' < scripts/install.tpl.sh | bash -s


.PHONY: kind-cluster
Expand Down Expand Up @@ -325,9 +330,10 @@ release: $(GORELEASER) #EXHELP Runs goreleaser for the operator-controller. By d

.PHONY: quickstart
quickstart: export MANIFEST := https://github.com/operator-framework/operator-controller/releases/download/$(VERSION)/operator-controller.yaml
quickstart: export DEFAULT_CATALOG := "https://github.com/operator-framework/operator-controller/releases/download/$(VERSION)/default-catalogs.yaml"
quickstart: $(KUSTOMIZE) manifests #EXHELP Generate the unified installation release manifests and scripts.
($(KUSTOMIZE) build $(KUSTOMIZE_BUILD_DIR) && echo "---" && $(KUSTOMIZE) build catalogd/config/overlays/cert-manager) | sed "s/cert-git-version/cert-$(VERSION)/g" | sed "s/:devel/:$(VERSION)/g" > operator-controller.yaml
envsubst '$$CERT_MGR_VERSION,$$INSTALL_DEFAULT_CATALOGS,$$MANIFEST' < scripts/install.tpl.sh > install.sh
envsubst '$$DEFAULT_CATALOG,$$CERT_MGR_VERSION,$$INSTALL_DEFAULT_CATALOGS,$$MANIFEST' < scripts/install.tpl.sh > install.sh

##@ Docs

Expand Down
17 changes: 13 additions & 4 deletions RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,25 @@ Note that throughout this guide, the `upstream` remote refers to the `operator-f
The release process differs slightly based on whether a patch or major/minor release is being made.

### Patch Release
#### Step 1
In this example we will be creating a new patch release from version `v1.2.3`, on the branch `release-v1.2`.
First ensure that the release branch has been updated on remote with the changes from the patch, then perform the following:

In this example, we will be creating a new patch release from version `v1.2.3` on the branch `release-v1.2`.

#### Step 1
First, make sure the `release-v1.2` branch is updated with the latest changes from upstream:
```bash
git fetch upstream release-v1.2
git pull release-v1.2
git checkout release-v1.2
git reset --hard upstream/release-v1.2
```

#### Step 2
Run the following command to confirm that your local branch has the latest expected commit:
```bash
git log --oneline -n 5
```
Check that the most recent commit matches the latest commit in the upstream `release-v1.2` branch.

#### Step 3
Create a new tag, incrementing the patch number from the previous version. In this case, we'll be incrementing from `v1.2.3` to `v1.2.4`:
```bash
## Previous version was v1.2.3, so we bump the patch number up by one
Expand Down
15 changes: 1 addition & 14 deletions catalogd/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -88,19 +88,6 @@ e2e: run image-registry test-e2e kind-cluster-cleanup ## Run e2e test suite on l
image-registry: ## Setup in-cluster image registry
./test/tools/imageregistry/registry.sh $(ISSUER_KIND) $(ISSUER_NAME)

.PHONY: verify-crd-compatibility
CRD_DIFF_ORIGINAL_REF := main
CRD_DIFF_UPDATED_SOURCE := file://config/base/crd/bases/olm.operatorframework.io_clustercatalogs.yaml
CRD_DIFF_CONFIG := crd-diff-config.yaml
verify-crd-compatibility: $(CRD_DIFF)
@if git show ${CRD_DIFF_ORIGINAL_REF}:config/base/crd/bases/olm.operatorframework.io_clustercatalogs.yaml > /dev/null 2>&1; then \
echo "Running CRD diff..."; \
$(CRD_DIFF) --config="${CRD_DIFF_CONFIG}" "git://${CRD_DIFF_ORIGINAL_REF}?path=config/base/crd/bases/olm.operatorframework.io_clustercatalogs.yaml" ${CRD_DIFF_UPDATED_SOURCE}; \
else \
echo "Skipping CRD diff: CRD does not exist in ${CRD_DIFF_ORIGINAL_REF}"; \
fi


## image-registry target has to come after run-latest-release,
## because the image-registry depends on the olm-ca issuer.
.PHONY: test-upgrade-e2e
Expand All @@ -115,7 +102,7 @@ pre-upgrade-setup:

.PHONY: run-latest-release
run-latest-release:
curl -L -s https://github.com/operator-framework/operator-controller/releases/latest/download/install.sh | bash -s
cd ..; curl -L -s https://github.com/operator-framework/operator-controller/releases/latest/download/install.sh | bash -s

.PHONY: post-upgrade-checks
post-upgrade-checks: $(GINKGO)
Expand Down
24 changes: 16 additions & 8 deletions catalogd/cmd/catalogd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ import (
_ "k8s.io/client-go/plugin/pkg/client/auth"
"k8s.io/klog/v2"
"k8s.io/klog/v2/textlogger"
"k8s.io/utils/ptr"
ctrl "sigs.k8s.io/controller-runtime"
crcache "sigs.k8s.io/controller-runtime/pkg/cache"
"sigs.k8s.io/controller-runtime/pkg/certwatcher"
Expand All @@ -62,6 +63,7 @@ import (
"github.com/operator-framework/operator-controller/catalogd/internal/storage"
"github.com/operator-framework/operator-controller/catalogd/internal/version"
"github.com/operator-framework/operator-controller/catalogd/internal/webhook"
"github.com/operator-framework/operator-controller/internal/util"
)

var (
Expand Down Expand Up @@ -96,7 +98,7 @@ func main() {
certFile string
keyFile string
webhookPort int
caCertDir string
pullCasDir string
globalPullSecret string
)
flag.StringVar(&metricsAddr, "metrics-bind-address", "", "The address for the metrics endpoint. Requires tls-cert and tls-key. (Default: ':7443')")
Expand All @@ -114,7 +116,7 @@ func main() {
flag.StringVar(&certFile, "tls-cert", "", "The certificate file used for serving catalog and metrics. Required to enable the metrics server. Requires tls-key.")
flag.StringVar(&keyFile, "tls-key", "", "The key file used for serving catalog contents and metrics. Required to enable the metrics server. Requires tls-cert.")
flag.IntVar(&webhookPort, "webhook-server-port", 9443, "The port that the mutating webhook server serves at.")
flag.StringVar(&caCertDir, "ca-certs-dir", "", "The directory of CA certificate to use for verifying HTTPS connections to image registries.")
flag.StringVar(&pullCasDir, "pull-cas-dir", "", "The directory of TLS certificate authoritiess to use for verifying HTTPS connections to image registries.")
flag.StringVar(&globalPullSecret, "global-pull-secret", "", "The <namespace>/<name> of the global pull secret that is going to be used to pull bundle images.")

klog.InitFlags(flag.CommandLine)
Expand Down Expand Up @@ -231,8 +233,14 @@ func main() {
HealthProbeBindAddress: probeAddr,
LeaderElection: enableLeaderElection,
LeaderElectionID: "catalogd-operator-lock",
WebhookServer: webhookServer,
Cache: cacheOptions,
// Recommended Leader Election values
// https://github.com/openshift/enhancements/blob/61581dcd985130357d6e4b0e72b87ee35394bf6e/CONVENTIONS.md#handling-kube-apiserver-disruption
LeaseDuration: ptr.To(137 * time.Second),
RenewDeadline: ptr.To(107 * time.Second),
RetryPeriod: ptr.To(26 * time.Second),

WebhookServer: webhookServer,
Cache: cacheOptions,
})
if err != nil {
setupLog.Error(err, "unable to create manager")
Expand All @@ -250,8 +258,8 @@ func main() {
systemNamespace = podNamespace()
}

if err := os.MkdirAll(cacheDir, 0700); err != nil {
setupLog.Error(err, "unable to create cache directory")
if err := util.EnsureEmptyDirectory(cacheDir, 0700); err != nil {
setupLog.Error(err, "unable to ensure empty cache directory")
os.Exit(1)
}

Expand All @@ -264,8 +272,8 @@ func main() {
BaseCachePath: unpackCacheBasePath,
SourceContextFunc: func(logger logr.Logger) (*types.SystemContext, error) {
srcContext := &types.SystemContext{
DockerCertPath: caCertDir,
OCICertPath: caCertDir,
DockerCertPath: pullCasDir,
OCICertPath: pullCasDir,
}
if _, err := os.Stat(authFilePath); err == nil && globalPullSecretKey != nil {
logger.Info("using available authentication information for pulling image")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
value: {"name":"olmv1-certificate", "readOnly": true, "mountPath":"/var/ca-certs/"}
- op: add
path: /spec/template/spec/containers/0/args/-
value: "--ca-certs-dir=/var/ca-certs"
value: "--pull-cas-dir=/var/ca-certs"
109 changes: 0 additions & 109 deletions catalogd/crd-diff-config.yaml

This file was deleted.

Loading
Loading