Skip to content

Commit 8f440ec

Browse files
Merge pull request #471 from tmshort/synchronize
NO-ISSUE: Synchronize From Upstream Repositories
2 parents 0536e0f + 659f1a9 commit 8f440ec

File tree

238 files changed

+18435
-7688
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

238 files changed

+18435
-7688
lines changed

.bingo/Variables.mk

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,12 @@ $(GORELEASER): $(BINGO_DIR)/goreleaser.mod
5353
@echo "(re)installing $(GOBIN)/goreleaser-v1.26.2"
5454
@cd $(BINGO_DIR) && GOWORK=off $(GO) build -mod=mod -modfile=goreleaser.mod -o=$(GOBIN)/goreleaser-v1.26.2 "github.com/goreleaser/goreleaser"
5555

56+
HELM := $(GOBIN)/helm-v3.18.4
57+
$(HELM): $(BINGO_DIR)/helm.mod
58+
@# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies.
59+
@echo "(re)installing $(GOBIN)/helm-v3.18.4"
60+
@cd $(BINGO_DIR) && GOWORK=off $(GO) build -mod=mod -modfile=helm.mod -o=$(GOBIN)/helm-v3.18.4 "helm.sh/helm/v3/cmd/helm"
61+
5662
KIND := $(GOBIN)/kind-v0.29.0
5763
$(KIND): $(BINGO_DIR)/kind.mod
5864
@# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies.

.bingo/helm.mod

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
module _ // Auto generated by https://github.com/bwplotka/bingo. DO NOT EDIT
2+
3+
go 1.24.3
4+
5+
require helm.sh/helm/v3 v3.18.4 // cmd/helm

.bingo/helm.sum

Lines changed: 303 additions & 0 deletions
Large diffs are not rendered by default.

.bingo/variables.env

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ GOLANGCI_LINT="${GOBIN}/golangci-lint-v2.1.6"
2020

2121
GORELEASER="${GOBIN}/goreleaser-v1.26.2"
2222

23+
HELM="${GOBIN}/helm-v3.18.4"
24+
2325
KIND="${GOBIN}/kind-v0.29.0"
2426

2527
KUSTOMIZE="${GOBIN}/kustomize-v5.6.0"

.tilt-support

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,4 +150,4 @@ def deploy_repo(data, tags="", debug=True):
150150
local_port = repo['starting_debug_port']
151151
build_binary(reponame, repo['binary'], repo['deps'], repo['image'], tags, debug)
152152
k8s_resource(repo['deployment'], port_forwards=['{}:30000'.format(local_port)])
153-
process_yaml(kustomize(data['yaml']))
153+
process_yaml(helm('helm/olmv1', name="olmv1", values=[data['yaml']]))

Makefile

Lines changed: 42 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -83,12 +83,12 @@ export EXPERIMENTAL_RELEASE_INSTALL := install-experimental.sh
8383
export RELEASE_CATALOGS := default-catalogs.yaml
8484

8585
# List of manifests that are checked in
86-
MANIFEST_HOME := ./manifests
87-
STANDARD_MANIFEST := ./manifests/standard.yaml
88-
STANDARD_E2E_MANIFEST := ./manifests/standard-e2e.yaml
89-
EXPERIMENTAL_MANIFEST := ./manifests/experimental.yaml
90-
EXPERIMENTAL_E2E_MANIFEST := ./manifests/experimental-e2e.yaml
91-
CATALOGS_MANIFEST := ./manifests/default-catalogs.yaml
86+
MANIFEST_HOME := manifests
87+
STANDARD_MANIFEST := $(MANIFEST_HOME)/standard.yaml
88+
STANDARD_E2E_MANIFEST := $(MANIFEST_HOME)/standard-e2e.yaml
89+
EXPERIMENTAL_MANIFEST := $(MANIFEST_HOME)/experimental.yaml
90+
EXPERIMENTAL_E2E_MANIFEST := $(MANIFEST_HOME)/experimental-e2e.yaml
91+
CATALOGS_MANIFEST := $(MANIFEST_HOME)/default-catalogs.yaml
9292

9393
# Disable -j flag for make
9494
.NOTPARALLEL:
@@ -123,6 +123,10 @@ help-extended: #HELP Display extended help.
123123
lint: lint-custom $(GOLANGCI_LINT) #HELP Run golangci linter.
124124
$(GOLANGCI_LINT) run --build-tags $(GO_BUILD_TAGS) $(GOLANGCI_LINT_ARGS)
125125

126+
lint-helm: $(HELM) #HELP Run helm linter
127+
helm lint helm/olmv1
128+
helm lint helm/prometheus
129+
126130
.PHONY: custom-linter-build
127131
custom-linter-build: #EXHELP Build custom linter
128132
go build -tags $(GO_BUILD_TAGS) -o ./bin/custom-linter ./hack/ci/custom-linters/cmd
@@ -139,31 +143,39 @@ k8s-pin: #EXHELP Pin k8s staging modules based on k8s.io/kubernetes version (in
139143
tidy:
140144
go mod tidy
141145

142-
.PHONY: manifests
143-
KUSTOMIZE_CATD_RBAC_DIR := config/base/catalogd/rbac
144-
KUSTOMIZE_CATD_WEBHOOKS_DIR := config/base/catalogd/webhook
145-
KUSTOMIZE_OPCON_RBAC_DIR := config/base/operator-controller/rbac
146146
# Due to https://github.com/kubernetes-sigs/controller-tools/issues/837 we can't specify individual files
147147
# So we have to generate them together and then move them into place
148-
manifests: $(CONTROLLER_GEN) $(KUSTOMIZE) #EXHELP Generate WebhookConfiguration, ClusterRole, and CustomResourceDefinition objects.
149-
# Generate CRDs via our own generator
148+
.PHONY: update-crds
149+
update-crds:
150150
hack/tools/update-crds.sh
151-
# Generate the remaining operator-controller standard manifests
152-
$(CONTROLLER_GEN) --load-build-tags=$(GO_BUILD_TAGS),standard rbac:roleName=manager-role paths="./internal/operator-controller/..." output:rbac:artifacts:config=$(KUSTOMIZE_OPCON_RBAC_DIR)/standard
153-
# Generate the remaining operator-controller experimental manifests
154-
$(CONTROLLER_GEN) --load-build-tags=$(GO_BUILD_TAGS) rbac:roleName=manager-role paths="./internal/operator-controller/..." output:rbac:artifacts:config=$(KUSTOMIZE_OPCON_RBAC_DIR)/experimental
155-
# Generate the remaining catalogd standard manifests
156-
$(CONTROLLER_GEN) --load-build-tags=$(GO_BUILD_TAGS),standard rbac:roleName=manager-role paths="./internal/catalogd/..." output:rbac:artifacts:config=$(KUSTOMIZE_CATD_RBAC_DIR)/standard
157-
$(CONTROLLER_GEN) --load-build-tags=$(GO_BUILD_TAGS),standard webhook paths="./internal/catalogd/..." output:webhook:artifacts:config=$(KUSTOMIZE_CATD_WEBHOOKS_DIR)/standard
158-
# Generate the remaining catalogd experimental manifests
159-
$(CONTROLLER_GEN) --load-build-tags=$(GO_BUILD_TAGS) rbac:roleName=manager-role paths="./internal/catalogd/..." output:rbac:artifacts:config=$(KUSTOMIZE_CATD_RBAC_DIR)/experimental
160-
$(CONTROLLER_GEN) --load-build-tags=$(GO_BUILD_TAGS) webhook paths="./internal/catalogd/..." output:webhook:artifacts:config=$(KUSTOMIZE_CATD_WEBHOOKS_DIR)/experimental
161-
# Generate manifests stored in source-control
162-
mkdir -p $(MANIFEST_HOME)
163-
$(KUSTOMIZE) build $(KUSTOMIZE_STANDARD_OVERLAY) > $(STANDARD_MANIFEST)
164-
$(KUSTOMIZE) build $(KUSTOMIZE_STANDARD_E2E_OVERLAY) > $(STANDARD_E2E_MANIFEST)
165-
$(KUSTOMIZE) build $(KUSTOMIZE_EXPERIMENTAL_OVERLAY) > $(EXPERIMENTAL_MANIFEST)
166-
$(KUSTOMIZE) build $(KUSTOMIZE_EXPERIMENTAL_E2E_OVERLAY) > $(EXPERIMENTAL_E2E_MANIFEST)
151+
152+
# The filename variables can be overridden on the command line if you want to change the set of values files:
153+
# e.g. make "manifests/standard.yaml=helm/cert-manager.yaml my-values-file.yaml" manifests
154+
#
155+
# The set of MANIFESTS to be generated can be changed; you can generate your own custom manifest
156+
# e.g. make MANIFESTS=test.yaml "test.yaml=helm/e2e.yaml" manifests
157+
#
158+
# Override HELM_SETTINGS on the command line to include additional Helm settings
159+
# e.g. make HELM_SETTINGS="options.openshift.enabled=true" manifests
160+
# e.g. make HELM_SETTINGS="operatorControllerFeatures={WebhookProviderCertManager}" manifests
161+
#
162+
MANIFESTS ?= $(STANDARD_MANIFEST) $(STANDARD_E2E_MANIFEST) $(EXPERIMENTAL_MANIFEST) $(EXPERIMENTAL_E2E_MANIFEST)
163+
$(STANDARD_MANIFEST) ?= helm/cert-manager.yaml
164+
$(STANDARD_E2E_MANIFEST) ?= helm/cert-manager.yaml helm/e2e.yaml
165+
$(EXPERIMENTAL_MANIFEST) ?= helm/cert-manager.yaml helm/experimental.yaml
166+
$(EXPERIMENTAL_E2E_MANIFEST) ?= helm/cert-manager.yaml helm/experimental.yaml helm/e2e.yaml
167+
HELM_SETTINGS ?=
168+
.PHONY: $(MANIFESTS)
169+
$(MANIFESTS): $(HELM)
170+
@mkdir -p $(MANIFEST_HOME)
171+
$(HELM) template olmv1 helm/olmv1 $(addprefix --values ,$($@)) $(addprefix --set ,$(HELM_SETTINGS)) > $@
172+
173+
# Generate manifests stored in source-control
174+
.PHONY: manifests
175+
manifests: update-crds $(MANIFESTS) $(HELM) #EXHELP Generate OLMv1 manifests
176+
# These are testing existing manifest options without saving the results
177+
$(HELM) template olmv1 helm/olmv1 --values helm/tilt.yaml $(addprefix --set ,$(HELM_SETTINGS)) > /dev/null
178+
$(HELM) template olmv1 helm/olmv1 --set "options.openshift.enabled=true" > /dev/null
167179

168180
.PHONY: generate
169181
generate: $(CONTROLLER_GEN) #EXHELP Generate code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations.
@@ -288,8 +300,8 @@ test-experimental-e2e: run-internal image-registry prometheus experimental-e2e e
288300
.PHONY: prometheus
289301
prometheus: PROMETHEUS_NAMESPACE := olmv1-system
290302
prometheus: PROMETHEUS_VERSION := v0.83.0
291-
prometheus: #EXHELP Deploy Prometheus into specified namespace
292-
./hack/test/install-prometheus.sh $(PROMETHEUS_NAMESPACE) $(PROMETHEUS_VERSION) $(KUSTOMIZE) $(VERSION)
303+
prometheus: $(KUSTOMIZE) #EXHELP Deploy Prometheus into specified namespace
304+
./hack/test/install-prometheus.sh $(PROMETHEUS_NAMESPACE) $(PROMETHEUS_VERSION) $(VERSION)
293305

294306
.PHONY: test-extension-developer-e2e
295307
test-extension-developer-e2e: SOURCE_MANIFEST := $(STANDARD_E2E_MANIFEST)

Tiltfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ olmv1 = {
1717
'starting_debug_port': 30000,
1818
},
1919
},
20-
'yaml': 'config/overlays/tilt-local-dev',
20+
'yaml': 'helm/tilt.yaml',
2121
}
2222

2323
deploy_repo(olmv1, '-tags containers_image_openpgp')

cmd/catalogd/main.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ import (
6060
"github.com/operator-framework/operator-controller/internal/catalogd/webhook"
6161
sharedcontrollers "github.com/operator-framework/operator-controller/internal/shared/controllers"
6262
fsutil "github.com/operator-framework/operator-controller/internal/shared/util/fs"
63+
httputil "github.com/operator-framework/operator-controller/internal/shared/util/http"
6364
imageutil "github.com/operator-framework/operator-controller/internal/shared/util/image"
6465
"github.com/operator-framework/operator-controller/internal/shared/util/pullsecretcache"
6566
sautil "github.com/operator-framework/operator-controller/internal/shared/util/sa"
@@ -291,6 +292,18 @@ func run(ctx context.Context) error {
291292
return err
292293
}
293294

295+
// This watches the pullCasDir and the SSL_CERT_DIR, and SSL_CERT_FILE for changes
296+
cpwPull, err := httputil.NewCertPoolWatcher(cfg.pullCasDir, ctrl.Log.WithName("pull-ca-pool"))
297+
if err != nil {
298+
setupLog.Error(err, "unable to create pull-ca-pool watcher")
299+
return err
300+
}
301+
cpwPull.Restart(os.Exit)
302+
if err = mgr.Add(cpwPull); err != nil {
303+
setupLog.Error(err, "unable to add pull-ca-pool watcher to manager")
304+
return err
305+
}
306+
294307
if cfg.systemNamespace == "" {
295308
cfg.systemNamespace = podNamespace()
296309
}

cmd/operator-controller/main.go

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ import (
7171
"github.com/operator-framework/operator-controller/internal/operator-controller/features"
7272
"github.com/operator-framework/operator-controller/internal/operator-controller/finalizers"
7373
"github.com/operator-framework/operator-controller/internal/operator-controller/resolve"
74-
"github.com/operator-framework/operator-controller/internal/operator-controller/rukpak/convert"
7574
"github.com/operator-framework/operator-controller/internal/operator-controller/rukpak/preflights/crdupgradesafety"
7675
"github.com/operator-framework/operator-controller/internal/operator-controller/rukpak/render"
7776
"github.com/operator-framework/operator-controller/internal/operator-controller/rukpak/render/certproviders"
@@ -319,9 +318,26 @@ func run() error {
319318
return err
320319
}
321320

322-
certPoolWatcher, err := httputil.NewCertPoolWatcher(cfg.catalogdCasDir, ctrl.Log.WithName("cert-pool"))
321+
cpwCatalogd, err := httputil.NewCertPoolWatcher(cfg.catalogdCasDir, ctrl.Log.WithName("catalogd-ca-pool"))
323322
if err != nil {
324-
setupLog.Error(err, "unable to create CA certificate pool")
323+
setupLog.Error(err, "unable to create catalogd-ca-pool watcher")
324+
return err
325+
}
326+
cpwCatalogd.Restart(os.Exit)
327+
if err = mgr.Add(cpwCatalogd); err != nil {
328+
setupLog.Error(err, "unable to add catalogd-ca-pool watcher to manager")
329+
return err
330+
}
331+
332+
// This watches the pullCasDir and the SSL_CERT_DIR, and SSL_CERT_FILE for changes
333+
cpwPull, err := httputil.NewCertPoolWatcher(cfg.pullCasDir, ctrl.Log.WithName("pull-ca-pool"))
334+
if err != nil {
335+
setupLog.Error(err, "unable to create pull-ca-pool watcher")
336+
return err
337+
}
338+
cpwPull.Restart(os.Exit)
339+
if err = mgr.Add(cpwPull); err != nil {
340+
setupLog.Error(err, "unable to add pull-ca-pool watcher to manager")
325341
return err
326342
}
327343

@@ -375,7 +391,7 @@ func run() error {
375391
}
376392
catalogClientBackend := cache.NewFilesystemCache(catalogsCachePath)
377393
catalogClient := catalogclient.New(catalogClientBackend, func() (*http.Client, error) {
378-
return httputil.BuildHTTPClient(certPoolWatcher)
394+
return httputil.BuildHTTPClient(cpwCatalogd)
379395
})
380396

381397
resolver := &resolve.CatalogResolver{
@@ -638,7 +654,7 @@ func setupHelm(
638654
ceReconciler.Applier = &applier.Helm{
639655
ActionClientGetter: acg,
640656
Preflights: preflights,
641-
BundleToHelmChartConverter: &convert.BundleToHelmChartConverter{
657+
HelmChartProvider: &applier.RegistryV1HelmChartProvider{
642658
BundleRenderer: registryv1.Renderer,
643659
CertificateProvider: certProvider,
644660
IsWebhookSupportEnabled: certProvider != nil,

commitchecker.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
expectedMergeBase: 68610d0184c4f36bf993f7986dd9a31f0b72b48b
1+
expectedMergeBase: e0a2e17332717dab9a16c1ff6d6ff80fd769ffe5
22
upstreamBranch: main
33
upstreamOrg: operator-framework
44
upstreamRepo: operator-controller

0 commit comments

Comments
 (0)