Skip to content

NO-ISSUE: Synchronize From Upstream Repositories #411

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 49 commits into from
Jul 23, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
5f5142d
Fix webhook certificate bug (#2107)
perdasilva Jul 17, 2025
5786e67
:seedling: Add basic webhook support e2e (#2108)
perdasilva Jul 17, 2025
b5a475a
Make webhook support e2es more robust (#2111)
perdasilva Jul 21, 2025
86e4ce9
Remove assert in favor of require (#2112)
perdasilva Jul 22, 2025
8cf5bda
Remove test-operator.v2.0.0 fixture (#2093)
perdasilva Jul 22, 2025
6777b2c
Merge branch 'main' into synchronize
Jul 23, 2025
b6b6785
UPSTREAM: <carry>: Add OpenShift specific files
dtfranz Oct 26, 2023
5c5093e
UPSTREAM: <carry>: Fix catalogd.Dockerfile to use new paths
tmshort Feb 26, 2025
da0924b
UPSTREAM: <carry>: Update DOWNSTREAM_OWNERS_ALIASES
tmshort Mar 6, 2025
835b220
UPSTREAM: <carry>: Add openshift node selector annotation
oceanc80 Mar 26, 2025
9ac4541
UPSTREAM: <carry>: Add caalogd-cas-dir option to op-con
tmshort Apr 15, 2025
b6e6177
UPSTREAM: <carry>: set the SElinux type
jianzhangbjz Apr 27, 2025
9172165
UPSTREAM: <carry>: Add initial stack to run tests to validate the cat…
camilamacedo86 Apr 17, 2025
021ddd7
UPSTREAM: <carry>: Add vendor files for the catalog-sync tests
camilamacedo86 Apr 17, 2025
f23895f
UPSTREAM: <carry>: Bump catalog versions to 4.19
tmshort Apr 24, 2025
0735d53
UPSTREAM: <carry>: revert "Bump catalog versions to 4.19"
tmshort May 15, 2025
354441f
UPSTREAM: <carry>: Update HOWTO-origin-tests
tmshort May 14, 2025
daf0c57
UPSTREAM: <carry>: [DefaultCatalogTests]: Allow to pass auth path for…
camilamacedo86 May 16, 2025
66ece46
UPSTREAM: <carry>: fix: set NoLchown=true to allow image unpack on OCPci
camilamacedo86 May 19, 2025
1015de6
UPSTREAM: <carry>: [DefaultCatalogTests]: Moving parse of ENVVAR to t…
camilamacedo86 May 17, 2025
90a53ee
UPSTREAM: <carry>: [Default Catalog]: Create tmp dir to extract layer…
camilamacedo86 May 20, 2025
fbaefdc
UPSTREAM: <carry>: [Default Catalog](cleanp) Remove hack directory wh…
camilamacedo86 May 19, 2025
b8200fc
UPSTREAM: <carry>: Change code implementation to extract layers in OC…
camilamacedo86 May 21, 2025
f6cc924
UPSTREAM: <carry>: Add vendor files for change in the extract code im…
camilamacedo86 May 21, 2025
61139e5
UPSTREAM: <carry>: [Default Catalog Tests]: Final cleanups and enhanc…
camilamacedo86 May 22, 2025
105ed65
UPSTREAM: <carry>: SELinux type for operator-controller
jianzhangbjz May 22, 2025
67aea79
UPSTREAM: <carry>: Bump catalog versions to 4.19
tmshort Apr 24, 2025
0c2a267
UPSTREAM: <carry>: [Default Catalog Consistency Test] (feat) add chec…
camilamacedo86 May 28, 2025
c994d2f
UPSTREAM: <carry>: [Default Catalog Consistency Test]: fix junit outp…
camilamacedo86 Jun 2, 2025
becb181
UPSTREAM: <carry>: [Default Catalog Consistency Test] (feat) add chec…
camilamacedo86 May 29, 2025
3522271
UPSTREAM: <carry>: [Default Catalog Consistency Test]: Enable Catalog…
camilamacedo86 Jun 4, 2025
9e7d4ae
UPSTREAM: <carry>: [Default Catalog Consistency Test]: Rename Tests s…
camilamacedo86 Jun 4, 2025
68f8bc5
UPSTREAM: <carry>: Updating ose-olm-operator-controller-container ima…
Jun 18, 2025
8235657
UPSTREAM: <carry>: Updating ose-olm-catalogd-container image to be co…
Jun 18, 2025
e1a5ac8
UPSTREAM: <carry>: Update e2e registry to use 1.24/4.20
tmshort Jun 30, 2025
5569e5b
UPSTREAM: <carry>: [Catalog Default Tests]: Upgrade go version to 1.2…
camilamacedo86 Jul 1, 2025
e54223e
UPSTREAM: <carry>: Add structure to allow move the orgin tests using OTE
camilamacedo86 Jun 13, 2025
e369f43
UPSTREAM: <carry>: Add support for experimental manifests
tmshort Jul 2, 2025
bf8ed2c
UPSTREAM: <carry>: [OTE] - chore: follow up #383 – remove unreachable…
camilamacedo86 Jul 10, 2025
acd38d3
UPSTREAM: <carry>: Remove build of test image registry
tmshort Jul 9, 2025
1ebec02
UPSTREAM: <carry>: Add test-experimental-e2e target to openshift Make…
tmshort Jul 15, 2025
39952b7
UPSTREAM: <carry>: [OTE]: Add binary in the operator controller image…
camilamacedo86 Jul 11, 2025
b81ca24
UPSTREAM: <carry>: Fix experimental manifest copying
tmshort Jul 17, 2025
66512b2
UPSTREAM: <carry>: Update manifest generation for upstream rbac/webhooks
tmshort Jul 17, 2025
8099322
UPSTREAM: <carry>: [OTE] - Add tracking mechanism
camilamacedo86 Jul 17, 2025
841db79
UPSTREAM: <carry>: Update OTE dep to get fix
camilamacedo86 Jul 22, 2025
eb5c446
UPSTREAM: <drop>: go mod vendor
Jul 23, 2025
8c5ebc9
UPSTREAM: <drop>: remove upstream GitHub configuration
Jul 23, 2025
c0e231b
UPSTREAM: <drop>: configure the commit-checker
Jul 23, 2025
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 commitchecker.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
expectedMergeBase: 850e4a128012f99f95fea9b521be5c6edf1d0d86
expectedMergeBase: 8cf5bdaf21ac3a211654c60ebb8bf1d31109a94b
upstreamBranch: main
upstreamOrg: operator-framework
upstreamRepo: operator-controller
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package generators
import (
"cmp"
"fmt"
"maps"
"slices"
"strconv"
"strings"
Expand All @@ -28,15 +27,31 @@ import (
)

const (
tlsCrtPath = "tls.crt"
tlsKeyPath = "tls.key"

labelKubernetesNamespaceMetadataName = "kubernetes.io/metadata.name"
)

// volume mount name -> mount path
var certVolumeMounts = map[string]string{
"webhook-cert": "/tmp/k8s-webhook-server/serving-certs",
type certVolumeConfig struct {
Name string
Path string
TLSCertPath string
TLSKeyPath string
}

// certVolumeConfigs contain the expected configurations for certificate volume/mounts
// that the generated Deployment resources for bundle containing webhooks and/or apiservices
// should contain.
var certVolumeConfigs = []certVolumeConfig{
{
Name: "webhook-cert",
Path: "/tmp/k8s-webhook-server/serving-certs",
TLSCertPath: "tls.crt",
TLSKeyPath: "tls.key",
}, {
Name: "apiservice-cert",
Path: "/apiserver.local.config/certificates",
TLSCertPath: "apiserver.crt",
TLSKeyPath: "apiserver.key",
},
}

// BundleCSVDeploymentGenerator generates all deployments defined in rv1's cluster service version (CSV). The generated
Expand Down Expand Up @@ -80,7 +95,7 @@ func BundleCSVDeploymentGenerator(rv1 *bundle.RegistryV1, opts render.Options) (

secretInfo := render.CertProvisionerFor(depSpec.Name, opts).GetCertSecretInfo()
if webhookDeployments.Has(depSpec.Name) && secretInfo != nil {
addCertVolumesToDeployment(deploymentResource, *secretInfo)
ensureCorrectDeploymentCertVolumes(deploymentResource, *secretInfo)
}

objs = append(objs, deploymentResource)
Expand Down Expand Up @@ -488,60 +503,67 @@ func getWebhookServicePort(wh v1alpha1.WebhookDescription) corev1.ServicePort {
}
}

func addCertVolumesToDeployment(dep *appsv1.Deployment, certSecretInfo render.CertSecretInfo) {
volumeMountsToReplace := sets.New(slices.Collect(maps.Keys(certVolumeMounts))...)
certVolumeMountPaths := sets.New(slices.Collect(maps.Values(certVolumeMounts))...)
// ensureCorrectDeploymentCertVolumes ensures the deployment has the correct certificate volume mounts by
// - removing all existing volumes with protected certificate volume names (i.e. webhook-cert and apiservice-cert)
// - removing all existing volumes that point to the protected certificate paths (e.g. /tmp/k8s-webhook-server/serving-certs)
// - adding the correct certificate volumes with the correct configuration
// - applying the same changes to all container volume mounts
func ensureCorrectDeploymentCertVolumes(dep *appsv1.Deployment, certSecretInfo render.CertSecretInfo) {
// collect volumes and paths to replace
volumesToRemove := sets.New[string]()
protectedVolumePaths := sets.New[string]()
certVolumes := make([]corev1.Volume, 0, len(certVolumeConfigs))
certVolumeMounts := make([]corev1.VolumeMount, 0, len(certVolumeConfigs))
for _, cfg := range certVolumeConfigs {
volumesToRemove.Insert(cfg.Name)
protectedVolumePaths.Insert(cfg.Path)
certVolumes = append(certVolumes, corev1.Volume{
Name: cfg.Name,
VolumeSource: corev1.VolumeSource{
Secret: &corev1.SecretVolumeSource{
SecretName: certSecretInfo.SecretName,
Items: []corev1.KeyToPath{
{
Key: certSecretInfo.CertificateKey,
Path: cfg.TLSCertPath,
},
{
Key: certSecretInfo.PrivateKeyKey,
Path: cfg.TLSKeyPath,
},
},
},
},
})
certVolumeMounts = append(certVolumeMounts, corev1.VolumeMount{
Name: cfg.Name,
MountPath: cfg.Path,
})
}

for _, c := range dep.Spec.Template.Spec.Containers {
for _, containerVolumeMount := range c.VolumeMounts {
if certVolumeMountPaths.Has(containerVolumeMount.MountPath) {
volumeMountsToReplace.Insert(containerVolumeMount.Name)
if protectedVolumePaths.Has(containerVolumeMount.MountPath) {
volumesToRemove.Insert(containerVolumeMount.Name)
}
}
}

// update pod volumes
dep.Spec.Template.Spec.Volumes = slices.Concat(
slices.DeleteFunc(dep.Spec.Template.Spec.Volumes, func(v corev1.Volume) bool {
return volumeMountsToReplace.Has(v.Name)
return volumesToRemove.Has(v.Name)
}),
[]corev1.Volume{
{
Name: "webhook-cert",
VolumeSource: corev1.VolumeSource{
Secret: &corev1.SecretVolumeSource{
SecretName: certSecretInfo.SecretName,
Items: []corev1.KeyToPath{
{
Key: certSecretInfo.CertificateKey,
Path: tlsCrtPath,
},
{
Key: certSecretInfo.PrivateKeyKey,
Path: tlsKeyPath,
},
},
},
},
},
},
certVolumes,
)

// update container volume mounts
for i := range dep.Spec.Template.Spec.Containers {
dep.Spec.Template.Spec.Containers[i].VolumeMounts = slices.Concat(
slices.DeleteFunc(dep.Spec.Template.Spec.Containers[i].VolumeMounts, func(v corev1.VolumeMount) bool {
return volumeMountsToReplace.Has(v.Name)
return volumesToRemove.Has(v.Name)
}),
func() []corev1.VolumeMount {
volumeMounts := make([]corev1.VolumeMount, 0, len(certVolumeMounts))
for _, name := range slices.Sorted(maps.Keys(certVolumeMounts)) {
volumeMounts = append(volumeMounts, corev1.VolumeMount{
Name: name,
MountPath: certVolumeMounts[name],
})
}
return volumeMounts
}(),
certVolumeMounts,
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,15 +188,29 @@ func Test_BundleCSVDeploymentGenerator_WithCertWithCertProvider_Succeeds(t *test
Template: corev1.PodTemplateSpec{
Spec: corev1.PodSpec{
Volumes: []corev1.Volume{
// volume that have neither protected names: webhook-cert and apiservice-cert,
// or target protected certificate paths should remain untouched
{
Name: "some-other-mount",
VolumeSource: corev1.VolumeSource{
EmptyDir: &corev1.EmptyDirVolumeSource{},
},
},
// this volume should be replaced by the webhook-cert volume
// because it has a volume mount targeting the protected path
// /tmp/k8s-webhook-server/serving-certs
// volume mounts with protected names will be rewritten to ensure they point to
// the right certificate path. If they do not exist, they will be created.
{
Name: "webhook-cert",
VolumeSource: corev1.VolumeSource{
EmptyDir: &corev1.EmptyDirVolumeSource{},
},
},
// volumes that point to protected paths will be removed
{
Name: "some-mount",
VolumeSource: corev1.VolumeSource{
EmptyDir: &corev1.EmptyDirVolumeSource{},
},
},
{
Name: "some-webhook-cert-mount",
VolumeSource: corev1.VolumeSource{
Expand All @@ -208,19 +222,24 @@ func Test_BundleCSVDeploymentGenerator_WithCertWithCertProvider_Succeeds(t *test
{
Name: "container-1",
VolumeMounts: []corev1.VolumeMount{
// the mount path for this volume mount will be replaced with
// /tmp/k8s-webhook-server/serving-certs
// the mount path for the following volume will be replaced
// since the volume name is protected
{
Name: "webhook-cert",
MountPath: "/webhook-cert-path",
}, {
},
// the following volume will be preserved
{
Name: "some-other-mount",
MountPath: "/some/other/mount/path",
},
// this volume mount will be removed
// these volume mount will be removed for referencing protected cert paths
{
Name: "some-webhook-cert-mount",
MountPath: "/tmp/k8s-webhook-server/serving-certs",
}, {
Name: "some-mount",
MountPath: "/apiserver.local.config/certificates",
},
},
},
Expand Down Expand Up @@ -272,6 +291,24 @@ func Test_BundleCSVDeploymentGenerator_WithCertWithCertProvider_Succeeds(t *test
},
},
},
{
Name: "apiservice-cert",
VolumeSource: corev1.VolumeSource{
Secret: &corev1.SecretVolumeSource{
SecretName: "some-secret",
Items: []corev1.KeyToPath{
{
Key: "some-cert-key",
Path: "apiserver.crt",
},
{
Key: "some-private-key-key",
Path: "apiserver.key",
},
},
},
},
},
}, deployment.Spec.Template.Spec.Volumes)
require.Equal(t, []corev1.Container{
{
Expand All @@ -285,6 +322,10 @@ func Test_BundleCSVDeploymentGenerator_WithCertWithCertProvider_Succeeds(t *test
Name: "webhook-cert",
MountPath: "/tmp/k8s-webhook-server/serving-certs",
},
{
Name: "apiservice-cert",
MountPath: "/apiserver.local.config/certificates",
},
},
},
{
Expand All @@ -294,6 +335,10 @@ func Test_BundleCSVDeploymentGenerator_WithCertWithCertProvider_Succeeds(t *test
Name: "webhook-cert",
MountPath: "/tmp/k8s-webhook-server/serving-certs",
},
{
Name: "apiservice-cert",
MountPath: "/apiserver.local.config/certificates",
},
},
},
}, deployment.Spec.Template.Spec.Containers)
Expand Down
2 changes: 0 additions & 2 deletions openshift/tests-extension/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2
github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=
github.com/onsi/gomega v1.35.1 h1:Cwbd75ZBPxFSuZ6T+rN/WCb/gOc6YgFBXLlZLhC7Ds4=
github.com/onsi/gomega v1.35.1/go.mod h1:PvZbdDc8J6XJEpDK4HCuRBm8a6Fzp9/DmhC9C7yFlog=
github.com/openshift-eng/openshift-tests-extension v0.0.0-20250522124649-4ffcd156ec7c h1:R5dI2oOF2RtS1sKtLrhW9KMg0ydzF0XM2Q//ma55nWI=
github.com/openshift-eng/openshift-tests-extension v0.0.0-20250522124649-4ffcd156ec7c/go.mod h1:6gkP5f2HL0meusT0Aim8icAspcD1cG055xxBZ9yC68M=
github.com/openshift-eng/openshift-tests-extension v0.0.0-20250722101414-8083129ab8f9 h1:4ZeSM80DVCb5WWB3Q/fyCI9jYXAl9bfrGnFvFONqzN4=
github.com/openshift-eng/openshift-tests-extension v0.0.0-20250722101414-8083129ab8f9/go.mod h1:6gkP5f2HL0meusT0Aim8icAspcD1cG055xxBZ9yC68M=
github.com/openshift/onsi-ginkgo/v2 v2.6.1-0.20241205171354-8006f302fd12 h1:AKx/w1qpS8We43bsRgf8Nll3CGlDHpr/WAXvuedTNZI=
Expand Down
Loading