Skip to content

Commit

Permalink
POC for trying out ksa support as 3rd party idP
Browse files Browse the repository at this point in the history
  • Loading branch information
droot committed Oct 31, 2023
1 parent 3d3acff commit b1f40a5
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
3 changes: 2 additions & 1 deletion build/all/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ USER nonroot:nonroot
ENTRYPOINT ["/hydration-controller"]

# OCI-sync image
FROM gcr.io/distroless/static:latest as oci-sync
#FROM gcr.io/distroless/static:latest as oci-sync
FROM google/cloud-sdk:slim as oci-sync
# Setting HOME ensures that whatever UID this ultimately runs as can write files.
ENV HOME=/tmp
WORKDIR /
Expand Down
6 changes: 3 additions & 3 deletions pkg/reconcilermanager/controllers/reconciler_base.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,9 @@ func (r *reconcilerBase) upsertServiceAccount(
// Update annotation when Workload Identity is enabled on a GKE cluster.
// In case, Workload Identity is not enabled on a cluster and spec.git.auth: gcpserviceaccount,
// the added annotation will be a no-op.
if auth == configsync.AuthGCPServiceAccount {
core.SetAnnotation(childSA, GCPSAAnnotationKey, email)
}
// if auth == configsync.AuthGCPServiceAccount {
// core.SetAnnotation(childSA, GCPSAAnnotationKey, email)
// }
return nil
})
if err != nil {
Expand Down
12 changes: 6 additions & 6 deletions pkg/validate/raw/validate/source_spec_validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,12 +143,12 @@ func OciSpec(oci *v1beta1.Oci, rs client.Object) status.Error {
switch oci.Auth {
case configsync.AuthGCENode, configsync.AuthNone:
case configsync.AuthGCPServiceAccount:
if oci.GCPServiceAccountEmail == "" {
return MissingGCPSAEmail(rs)
}
if !validGCPServiceAccountEmail(oci.GCPServiceAccountEmail) {
return InvalidGCPSAEmail(rs)
}
// if oci.GCPServiceAccountEmail == "" {
// return MissingGCPSAEmail(rs)
// }
// if !validGCPServiceAccountEmail(oci.GCPServiceAccountEmail) {
// return InvalidGCPSAEmail(rs)
// }
default:
return InvalidOciAuthType(rs)
}
Expand Down

0 comments on commit b1f40a5

Please sign in to comment.