Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix Profile Plugins functionality (kubeflow#6624)
Browse files Browse the repository at this point in the history
* fix profile plugin loading

* add proper sample

* add GH action for unit tests

* rename GH job name
surajkota authored and harshad16 committed Oct 5, 2023
1 parent 0e3dac5 commit 52ce67f
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion components/profile-controller/README.md
Original file line number Diff line number Diff line change
@@ -130,7 +130,7 @@ In order for the custom Notebook Controller to be functional from your local mac

1. Set the number of replicas to zero:
```sh
kubectl edit deployment profiles-controller-deployment -n=kubeflow
kubectl edit deployment profiles-deployment -n=kubeflow
```

2. Start the manager locally:
6 changes: 4 additions & 2 deletions components/profile-controller/config/samples/_v1_profile.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
apiVersion: kubeflow.org/v1
kind: Profile
metadata:
name: profile-sample
name: test-user-profile
spec:
# TODO(user): Add fields here
owner:
kind: User
name: test-user@kubeflow.org
6 changes: 2 additions & 4 deletions components/profile-controller/controllers/plugin_iam.go
Original file line number Diff line number Diff line change
@@ -38,9 +38,8 @@ func (aws *AwsIAMForServiceAccount) ApplyPlugin(r *ProfileReconciler, profile *p
if err := aws.patchAnnotation(r, profile.Name, DEFAULT_SERVICE_ACCOUNT, addIAMRoleAnnotation, logger); err != nil {
return err
}

logger.Info("Setting up iam roles and policy for service account.", "ServiceAccount", DEFAULT_SERVICE_ACCOUNT, "Role", aws.AwsIAMRole)
return aws.updateIAMForServiceAccount(profile.Name, DEFAULT_SERVICE_ACCOUNT, addServiceAccountInAssumeRolePolicy, logger)
return aws.updateIAMForServiceAccount(profile.Name, DEFAULT_SERVICE_ACCOUNT, addServiceAccountInAssumeRolePolicy)
}

// RevokePlugin remove role in service account annotation and delete service account record in IAM trust relationship.
@@ -49,9 +48,8 @@ func (aws *AwsIAMForServiceAccount) RevokePlugin(r *ProfileReconciler, profile *
if err := aws.patchAnnotation(r, profile.Name, DEFAULT_SERVICE_ACCOUNT, removeIAMRoleAnnotation, logger); err != nil {
return err
}

logger.Info("Clean up AWS IAM Role for Service Account.", "ServiceAccount", DEFAULT_SERVICE_ACCOUNT, "Role", aws.AwsIAMRole)
return aws.updateIAMForServiceAccount(profile.Name, DEFAULT_SERVICE_ACCOUNT, removeServiceAccountInAssumeRolePolicy, logger)
return aws.updateIAMForServiceAccount(profile.Name, DEFAULT_SERVICE_ACCOUNT, removeServiceAccountInAssumeRolePolicy)
}

// patchAnnotation will patch annotation to k8s service account in order to pair up with GCP identity

0 comments on commit 52ce67f

Please sign in to comment.