Stratio modifications on top of projectcapsule/capsule main#35
Open
forselli-stratio wants to merge 5 commits into
Open
Stratio modifications on top of projectcapsule/capsule main#35forselli-stratio wants to merge 5 commits into
forselli-stratio wants to merge 5 commits into
Conversation
Adapted from a00c7b4: updated Dockerfile for upstream restructuring (cmd/controller/, internal/, ldflags now reference internal/version pkg). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Remove 'v' prefix prepended to AppVersion in the default image tag so the chart version and app image tag remain independent. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Ports two Stratio-specific features from the old master branch onto the new upstream-aligned base (origin/stratio/upstream-sync): 1. Capsule user should be treated as a tenant owner (from commit 4f8ad39): The capsule controller service account is automatically treated as a tenant owner in IsTenantOwnerByStatus and IsCommonOwner, using the existing configuration.IsControllerServiceAccount() helper. This replaces the old approach of passing capsuleUserName through every handler (the new code already reads SERVICE_ACCOUNT env in _pod.tpl and provides IsControllerServiceAccount). 2. Add option to exclude groups from capsule (from commit 65dfdc8): Adds ExcludeUserGroups to CapsuleConfigurationSpec. Users in these groups are excluded before any other capsule-user check in IsCapsuleUser, regardless of other group memberships. Wired through the Configuration interface, client, CRD YAML, chart values, and configuration template. Note: [EOS-10241] Avoid namespace-tenant auto-assignment (from commit 708706b) is already incorporated in the upstream's revised validateNamespacePrefix, which correctly checks cfg.ForceTenantPrefix() as the global default before tenant-level overrides. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
go.mod requires go 1.26.4; Docker builder and Jenkins buildtool image were still on golang:1.24, causing `go mod download` to fail with GOTOOLCHAIN=local. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
This PR contains all Stratio-specific modifications on top of the unmodified
projectcapsule/capsulemain branch (0c22ce88).The base branch
main-upstreamis a direct mirror ofprojectcapsule/capsulemain - no changes, no merges with old Stratio history. This makes the diff here the authoritative view of what Stratio adds.Commits in this PR
1.
Stratio CICD integrationAdds the Stratio build and publish pipeline:
Jenkinsfile- Jenkins pipeline wired to Stratio'slibpipelineslibraryDockerfile- multi-stage build (Go builder + Alpine runtime) for the controller imageVERSION/VERSION_HISTORY.md- version tracking filesbin/change-version.sh/bin/chart.sh- release helper scripts2.
[EOS-5809] Refactor chart tag default value to ensure chart uncouplingChanges the Helm chart's default image tag from the chart version to an empty string, so the Docker image version and Helm chart version can be bumped independently.
3.
Add Docker/Helm push steps, semantic versioning, and bump version to 0.8.0-SNAPSHOTdoPushDockerECRanddoPushHelmECRstages to the Jenkins pipeline to publish to Stratio's AWS ECRsemver0.8.0-SNAPSHOT4.
[Stratio] Port Stratio features onto upstream capsule syncTwo functional features added on top of upstream:
a) Capsule controller SA treated as tenant owner
The Capsule controller service account is automatically treated as a tenant owner, without needing to be listed in any tenant's
.spec.owners.Why: The controller needs to reconcile namespace-level resources on behalf of tenants. Without this, it would be denied by its own admission webhooks when acting inside a tenant namespace.
How: Uses the existing
configuration.IsControllerServiceAccount(name, namespace)helper (reads theSERVICE_ACCOUNTenv var already injected incharts/capsule/templates/_pod.tpl) in two places:pkg/users/is_tenant_owner.go:IsTenantOwnerByStatus- fast-path status-based checkpkg/users/is_tenant_owner.go:IsCommonOwner- full ownership resolution checkFiles changed:
pkg/users/is_tenant_owner.gob)
ExcludeUserGroups- exclude groups from Capsule entirelyAdds a new
excludeUserGroupsfield toCapsuleConfigurationSpec. Users whose groups match any entry are never treated as Capsule users, regardless of other group memberships. This is an early exit before any group or user matching.Difference from
ignoreUserWithGroups:ignoreUserWithGroupsonly fires when a user is already matched as a Capsule user via a group.excludeUserGroupsfires first and prevents the user from being a Capsule user at all.Use case: You have a broad group (e.g.
system:authenticated) configured as a Capsule user group, but you want certain admin groups to bypass Capsule entirely.Files changed:
api/v1beta2/capsuleconfiguration_types.go- new fieldapi/v1beta2/zz_generated.deepcopy.go- deepcopy for new fieldcharts/capsule/crds/capsule.clastix.io_capsuleconfigurations.yaml- CRD schemacharts/capsule/templates/configuration.yaml- Helm templatecharts/capsule/values.yaml- newcapsuleExcludeUserGroups: []valuepkg/runtime/configuration/configuration.go- interface methodpkg/runtime/configuration/client.go- implementationpkg/users/is_capsule_user.go- early-exit check5.
[BUILD] Bump Go toolchain to 1.26.4 to match go.mod requirementgo.modrequiresgo 1.26.4. The Dockerfile builder image and JenkinsfileBUILDTOOL_IMAGEwere ongolang:1.24, causinggo mod downloadto fail withGOTOOLCHAIN=local. Updated both togolang:1.26.4.What is NOT changed from upstream
Everything else - the entire
internal/,pkg/(except the two files above),api/,config/tree - is unmodified upstream code. No patches, no conflict resolutions, no backports.Notes for future upstream syncs
To sync this branch forward when
projectcapsule/capsulereleases a new version:git fetch projectcapsule git checkout main-upstream git reset --hard projectcapsule/main git push upstream main-upstream --force-with-lease git checkout stratio/features git rebase main-upstream # resolve any conflicts - only the 5 commits above need re-checking git push origin stratio/features --force-with-leaseThe Stratio diff is small enough (22 lines of Go across 2 files + build config) that rebases are low-friction.