Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
8f53598
WIP: Use 1.2.3-release-x.y as tag when a tag is on a branch
mbaldessari Oct 26, 2026
f24e7a6
expect 1.2.3-release-4.19 kind of tags
mbaldessari Oct 27, 2026
5ca70f3
testworkflow
mbaldessari Oct 27, 2026
b10ca90
Update a bunch of packages
mbaldessari Oct 8, 2026
335010b
Large argo and k8s package upgrade
mbaldessari Oct 8, 2026
8acf671
Update code to generics and other pkg changes
mbaldessari Oct 8, 2026
665b0bf
Fix tests and linter
mbaldessari Oct 8, 2026
04dd9a2
Update go in dockerfile as well
mbaldessari Oct 26, 2026
05b1565
chore(deps): bump postcss-selector-parser in /console
dependabot[bot] Oct 28, 2026
ea223f5
More package upgrades
mbaldessari Oct 28, 2026
9ed3829
chore(deps): update github.com/azure/go-ansiterm digest to 51075c6
red-hat-konflux[bot] Oct 29, 2026
e289ae5
fix(deps): update k8s.io/utils digest to ca04ba5
red-hat-konflux[bot] Oct 29, 2026
dc57a7b
chore(deps): bump zizmorcore/zizmor-action from 0.7.1 to 0.8.0
dependabot[bot] Oct 30, 2026
60e6cb0
chore(deps): bump brace-expansion from 1.1.12 to 1.1.21 in /console
dependabot[bot] Oct 30, 2026
02033fb
chore(deps): update azure-sdk-for-go monorepo
red-hat-konflux[bot] Oct 30, 2026
333682b
chore(deps): update github.com/google/pprof digest to dbd0ed3
red-hat-konflux[bot] Oct 30, 2026
41285d5
chore(deps): update dependency @types/sanitize-html to v2.16.2
red-hat-konflux[bot] Oct 31, 2026
14e8bdb
chore(deps): update dependency concurrently to v10.0.6
red-hat-konflux[bot] Oct 31, 2026
aae83df
chore(deps): bump follow-redirects from 1.16.1 to 1.16.2 in /console
dependabot[bot] Oct 31, 2026
a239ab3
chore(deps): update dependency webpack-dev-server to v5.2.7
red-hat-konflux[bot] Nov 1, 2026
718fa9d
chore(deps): update module github.com/bmatcuk/doublestar/v4 to v4.10.4
red-hat-konflux[bot] Oct 28, 2026
da02a12
chore(deps): update module github.com/mattn/go-colorable to v0.1.16
red-hat-konflux[bot] Oct 29, 2026
7d1244f
chore(deps): bump zizmorcore/zizmor-action from 0.8.0 to 0.8.1
dependabot[bot] Nov 9, 2026
eed9fd0
chore(deps): update module github.com/microsoft/go-winio to v0.6.4
red-hat-konflux[bot] Oct 29, 2026
4ebcab8
chore(deps): update module github.com/skeema/knownhosts to v1.3.3
red-hat-konflux[bot] Oct 29, 2026
87531d1
chore(deps): update github.com/google/pprof digest to 4bf881d
red-hat-konflux[bot] Nov 8, 2026
ec931cb
feat: change bundle target to not use envsubst
darkdoc Oct 15, 2026
b4a3bae
chore(deps): update dependency concurrently to v10.0.7
red-hat-konflux[bot] Nov 11, 2026
32abab2
chore(deps): bump sigstore/cosign-installer from 4.1.2 to 4.1.3
dependabot[bot] Nov 11, 2026
9361cf1
chore(deps): update module go.yaml.in/yaml/v2 to v2.4.5
red-hat-konflux[bot] Nov 6, 2026
ae5c932
fix(deps): update module github.com/operator-framework/operator-lifec…
red-hat-konflux[bot] Nov 2, 2026
6416a47
fix(deps): update module golang.org/x/crypto to v0.59.0 [security]
red-hat-konflux[bot] Nov 12, 2026
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
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
76 changes: 62 additions & 14 deletions .github/workflows/build-push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Build (amd64 and arm64) and push to quay registries
on:
push:
branches: ["main"]
tags: ['[0-9]+.[0-9]+.[0-9]+']
tags: ['[0-9]+.[0-9]+.[0-9]+', '[0-9]+.[0-9]+.[0-9]+-release-*']
pull_request:
branches: ["main"]

Expand All @@ -18,7 +18,55 @@ env:
TAG: ${{ github.event_name == 'pull_request' && format('pr-{0}', github.event.pull_request.number) || (github.ref_name == 'main' && 'latest' || github.ref_name) }}

jobs:
compute-tag:
runs-on: ubuntu-latest
outputs:
image_tag: ${{ steps.compute.outputs.image_tag }}
permissions:
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
persist-credentials: false

- name: Validate tag matches branch
if: startsWith(github.ref, 'refs/tags/')
env:
REF_NAME: ${{ github.ref_name }}
run: |
BRANCHES=$(git branch -r --contains HEAD | grep -v '\->' | sed 's|^ *origin/||')
if [[ "${REF_NAME}" =~ ^[0-9]+\.[0-9]+\.[0-9]+-release-(.+)$ ]]; then
EXPECTED_BRANCH="release-${BASH_REMATCH[1]}"
if ! echo "${BRANCHES}" | grep -qx "${EXPECTED_BRANCH}"; then
echo "::error::Tag ${REF_NAME} can only be set on branch ${EXPECTED_BRANCH}, but commit is on: $(echo ${BRANCHES} | tr '\n' ' ')"
exit 1
fi
elif [[ "${REF_NAME}" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
if ! echo "${BRANCHES}" | grep -qx 'main'; then
echo "::error::Plain version tag ${REF_NAME} can only be set on the main branch, but commit is on: $(echo ${BRANCHES} | tr '\n' ' ')"
exit 1
fi
fi

- name: Compute image tag
id: compute
env:
EVENT_NAME: ${{ github.event_name }}
REF_NAME: ${{ github.ref_name }}
PR_NUMBER: ${{ github.event.pull_request.number }}
run: |
if [ "${EVENT_NAME}" = "pull_request" ]; then
echo "image_tag=pr-${PR_NUMBER}" >> "$GITHUB_OUTPUT"
elif [ "${REF_NAME}" = "main" ]; then
echo "image_tag=latest" >> "$GITHUB_OUTPUT"
else
echo "image_tag=${REF_NAME}" >> "$GITHUB_OUTPUT"
fi

build-container:
needs: [compute-tag]
strategy:
matrix:
include:
Expand All @@ -39,7 +87,7 @@ jobs:
- name: Build container and save tarball
env:
TARGETARCH: ${{ matrix.targetarch }}
OPERATOR_IMG: ${{ env.NAME }}:${{ env.TAG }}
OPERATOR_IMG: ${{ env.NAME }}:${{ needs.compute-tag.outputs.image_tag }}
KEY: ${{ secrets.API_KEY }}
run: |
export APIFILE="internal/controller/apikey.txt"
Expand All @@ -63,6 +111,7 @@ jobs:
retention-days: 1

build-console:
needs: [compute-tag]
strategy:
matrix:
include:
Expand All @@ -83,7 +132,7 @@ jobs:
- name: Build console container image and save tarball
env:
TARGETARCH: ${{ matrix.targetarch }}
CONSOLE_PLUGIN_IMAGE_BASE: ${{ env.CONSOLE_NAME }}:${{ env.TAG }}
CONSOLE_PLUGIN_IMAGE_BASE: ${{ env.CONSOLE_NAME }}:${{ needs.compute-tag.outputs.image_tag }}
run: |
make "console-build-${TARGETARCH}"
buildah push "${CONSOLE_PLUGIN_IMAGE_BASE}-${TARGETARCH}" "docker-archive:/tmp/console-image-${TARGETARCH}.tar:${CONSOLE_PLUGIN_IMAGE_BASE}-${TARGETARCH}"
Expand All @@ -109,21 +158,20 @@ jobs:
- name: Check that tag version corresponds to metadata version
run: |-
VERSION=$(yq -r '.spec.version' bundle/manifests/patterns-operator.clusterserviceversion.yaml)
if [ "${VERSION}" != "${TAG}" ]; then
echo "Version in metadata ${VERSION} whereas tag is different: ${TAG}"
BASE_TAG="${TAG%%-release-*}"
if [ "${VERSION}" != "${BASE_TAG}" ]; then
echo "Version in metadata ${VERSION} whereas tag is different: ${BASE_TAG} (full tag: ${TAG})"
exit 1
fi

push-multiarch-manifest:
needs: [pre-push-check]
needs: [pre-push-check, compute-tag]
if: github.event_name != 'pull_request'
strategy:
matrix:
include:
- upload_registry: quay.io/validatedpatterns
- upload_registry: quay.io/rhn_support_mbaldess
legacy: false
- upload_registry: quay.io/hybridcloudpatterns
legacy: true
runs-on: ubuntu-latest
permissions:
contents: read
Expand Down Expand Up @@ -181,8 +229,8 @@ jobs:
id: manifest-push
env:
UPLOADREGISTRY: ${{ matrix.upload_registry }}
OPERATOR_IMG: ${{ env.NAME }}:${{ env.TAG }}
CONSOLE_PLUGIN_IMAGE_BASE: ${{ env.CONSOLE_NAME }}:${{ env.TAG }}
OPERATOR_IMG: ${{ env.NAME }}:${{ needs.compute-tag.outputs.image_tag }}
CONSOLE_PLUGIN_IMAGE_BASE: ${{ env.CONSOLE_NAME }}:${{ needs.compute-tag.outputs.image_tag }}
run: |
make buildah-manifest
buildah manifest add --arch=amd64 "${REGISTRY}/${OPERATOR_IMG}" "${REGISTRY}/${OPERATOR_IMG}-amd64"
Expand All @@ -198,7 +246,7 @@ jobs:
echo "console_digest=$CONSOLE_DIGEST" >> "$GITHUB_OUTPUT"

- name: Install cosign
uses: sigstore/cosign-installer@6f9f17788090df1f26f669e9d70d6ae9567deba6 # v4.1.2
uses: sigstore/cosign-installer@756fe2d284c7292c4e9b62c8a28f1e5629c59532 # v4.1.3
with:
cosign-release: "v2.2.4"

Expand All @@ -209,8 +257,8 @@ jobs:
DIGEST: ${{ steps.manifest-push.outputs.digest }}
CONSOLE_DIGEST: ${{ steps.manifest-push.outputs.console_digest }}
UPLOADREGISTRY: ${{ matrix.upload_registry }}
OPERATOR_IMG: ${{ env.NAME }}:${{ env.TAG }}
CONSOLE_PLUGIN_IMAGE_BASE: ${{ env.CONSOLE_NAME }}:${{ env.TAG }}
OPERATOR_IMG: ${{ env.NAME }}:${{ needs.compute-tag.outputs.image_tag }}
CONSOLE_PLUGIN_IMAGE_BASE: ${{ env.CONSOLE_NAME }}:${{ needs.compute-tag.outputs.image_tag }}
run: |
cat "${XDG_RUNTIME_DIR}/containers/auth.json" > ~/.docker/config.json
cosign sign --yes "${UPLOADREGISTRY}/${OPERATOR_IMG}@${DIGEST}"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/zizmor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@ jobs:
persist-credentials: false

- name: Run zizmor
uses: zizmorcore/zizmor-action@85b2b9fb8e3325e7a23d7d0a9d7ba5ae0f999e3e # v0.7.1
uses: zizmorcore/zizmor-action@45d7276c9ca790aabd705e31ca99c6185c3e76dd # v0.8.1
with:
sarif-upload: true
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG GO_VERSION=1.25.7
ARG GO_VERSION=1.26.5
FROM registry.access.redhat.com/ubi9/go-toolset:${GO_VERSION} AS builder
ARG GOARCH=amd64

Expand Down
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,9 @@ endef
.PHONY: bundle
bundle: manifests kustomize operator-sdk ## Generate bundle manifests and metadata, then validate generated files.
$(OPERATOR_SDK) generate kustomize manifests -q
$(KUSTOMIZE) build config/manifests | envsubst | $(OPERATOR_SDK) generate bundle $(BUNDLE_GEN_FLAGS)
(cd config/manager && $(KUSTOMIZE) edit set image \\\$${IMG}=${IMG})
(cd config/console-plugin && $(KUSTOMIZE) edit set image \\\$${CONSOLE_PLUGIN_IMAGE}=${CONSOLE_PLUGIN_IMAGE})
$(KUSTOMIZE) build config/manifests | $(OPERATOR_SDK) generate bundle $(BUNDLE_GEN_FLAGS)
$(MAKE) bundle-fixes bundle-date
./hack/set_openshift_minimum_version.sh
$(OPERATOR_SDK) bundle validate ./bundle
Expand Down
14 changes: 12 additions & 2 deletions api/v1alpha1/groupversion_info.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,27 @@ limitations under the License.
package v1alpha1

import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"
"sigs.k8s.io/controller-runtime/pkg/scheme"
)

var (
// GroupVersion is group version used to register these objects
GroupVersion = schema.GroupVersion{Group: "gitops.hybrid-cloud-patterns.io", Version: "v1alpha1"}

// SchemeBuilder is used to add go types to the GroupVersionKind scheme
SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion}
SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes)

// AddToScheme adds the types in this group-version to the given scheme.
AddToScheme = SchemeBuilder.AddToScheme
)

func addKnownTypes(s *runtime.Scheme) error {
s.AddKnownTypes(GroupVersion,
&Pattern{},
&PatternList{},
)
metav1.AddToGroupVersion(s, GroupVersion)
return nil
}
4 changes: 0 additions & 4 deletions api/v1alpha1/pattern_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,3 @@ const (
DeleteHubChildApps PatternDeletionPhase = "DeleteHubChildApps"
DeleteHub PatternDeletionPhase = "DeleteHub"
)

func init() {
SchemeBuilder.Register(&Pattern{}, &PatternList{})
}
35 changes: 6 additions & 29 deletions api/v1alpha1/pattern_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,9 @@ import (
"fmt"
"strings"

"k8s.io/apimachinery/pkg/runtime"
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/client"
logf "sigs.k8s.io/controller-runtime/pkg/log"
"sigs.k8s.io/controller-runtime/pkg/webhook"
"sigs.k8s.io/controller-runtime/pkg/webhook/admission"
)

Expand All @@ -42,23 +40,18 @@ type PatternValidator struct {
//nolint:lll
// +kubebuilder:webhook:verbs=create;update;delete,path=/validate-gitops-hybrid-cloud-patterns-io-v1alpha1-pattern,mutating=false,failurePolicy=fail,groups=gitops.hybrid-cloud-patterns.io,resources=patterns,versions=v1alpha1,name=vpattern.gitops.hybrid-cloud-patterns.io,admissionReviewVersions=v1,sideEffects=none

var _ webhook.CustomValidator = &PatternValidator{}
var _ admission.Validator[*Pattern] = &PatternValidator{}

// SetupWebhookWithManager will setup the manager to manage the webhooks
func (r *PatternValidator) SetupWebhookWithManager(mgr ctrl.Manager) error {
r.Client = mgr.GetClient()
return ctrl.NewWebhookManagedBy(mgr).
For(&Pattern{}).
return ctrl.NewWebhookManagedBy(mgr, &Pattern{}).
WithValidator(r).
Complete()
}

// ValidateCreate implements webhook.CustomValidator so a webhook will be registered for the type
func (r *PatternValidator) ValidateCreate(ctx context.Context, obj runtime.Object) (admission.Warnings, error) {
p, err := convertToPattern(obj)
if err != nil {
return nil, err
}
func (r *PatternValidator) ValidateCreate(ctx context.Context, p *Pattern) (admission.Warnings, error) {
patternlog.Info("validate create", "name", p.Name)

if err := validateVariantAlias(p); err != nil {
Expand All @@ -67,7 +60,7 @@ func (r *PatternValidator) ValidateCreate(ctx context.Context, obj runtime.Objec
}

var patterns PatternList
if err = r.Client.List(ctx, &patterns); err != nil {
if err := r.Client.List(ctx, &patterns); err != nil {
return nil, fmt.Errorf("failed to list Pattern resources: %v", err)
}
if len(patterns.Items) > 0 {
Expand All @@ -78,11 +71,7 @@ func (r *PatternValidator) ValidateCreate(ctx context.Context, obj runtime.Objec
}

// ValidateUpdate implements webhook.CustomValidator so a webhook will be registered for the type
func (r *PatternValidator) ValidateUpdate(_ context.Context, _, newObj runtime.Object) (admission.Warnings, error) {
p, err := convertToPattern(newObj)
if err != nil {
return nil, err
}
func (r *PatternValidator) ValidateUpdate(_ context.Context, _, p *Pattern) (admission.Warnings, error) {
patternlog.Info("validate update", "name", p.Name)

if err := validateVariantAlias(p); err != nil {
Expand All @@ -94,11 +83,7 @@ func (r *PatternValidator) ValidateUpdate(_ context.Context, _, newObj runtime.O
}

// ValidateDelete implements webhook.CustomValidator so a webhook will be registered for the type
func (r *PatternValidator) ValidateDelete(_ context.Context, obj runtime.Object) (admission.Warnings, error) {
p, err := convertToPattern(obj)
if err != nil {
return nil, err
}
func (r *PatternValidator) ValidateDelete(_ context.Context, p *Pattern) (admission.Warnings, error) {
patternlog.Info("validate delete", "name", p.Name)

if !strings.EqualFold(p.Annotations[PruneAnnotation], "true") {
Expand All @@ -109,14 +94,6 @@ func (r *PatternValidator) ValidateDelete(_ context.Context, obj runtime.Object)
return nil, nil
}

func convertToPattern(obj runtime.Object) (*Pattern, error) {
p, ok := obj.(*Pattern)
if !ok {
return nil, fmt.Errorf("expected a Pattern object but got %T", obj)
}
return p, nil
}

func validateVariantAlias(p *Pattern) error {
if p.Spec.ClusterGroupName == "" && p.Spec.Variant == "" {
return fmt.Errorf("one of spec.variant or spec.clusterGroupName must be set")
Expand Down
17 changes: 0 additions & 17 deletions api/v1alpha1/pattern_webhook_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -222,23 +222,6 @@ func TestValidateUpdate_AllowsBothSet(t *testing.T) {
}
}

func TestValidateCreate_RejectsNonPatternObject(t *testing.T) {
scheme := runtime.NewScheme()
if err := AddToScheme(scheme); err != nil {
t.Fatalf("failed to add scheme: %v", err)
}

fakeClient := fake.NewClientBuilder().WithScheme(scheme).Build()
validator := &PatternValidator{Client: fakeClient}

notAPattern := &PatternList{}

_, err := validator.ValidateCreate(context.Background(), notAPattern)
if err == nil {
t.Error("expected error for non-Pattern object, got nil")
}
}

func TestValidateUpdate_Allows(t *testing.T) {
scheme := runtime.NewScheme()
if err := AddToScheme(scheme); err != nil {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.16.4
controller-gen.kubebuilder.io/version: v0.23.0
name: patterns.gitops.hybrid-cloud-patterns.io
spec:
group: gitops.hybrid-cloud-patterns.io
Expand Down
Loading
Loading