-
Notifications
You must be signed in to change notification settings - Fork 8
[Refactor] DCR Monitor Refactoring (2/N) #19
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
Conversation
| hlog.Infof("[KanikoJobMonitor]job name: %v, job status: %v", k8sJob.Name, k8sJob.Status.Conditions[0].Type) | ||
|
|
||
| if k8sJob.Status.Conditions[0].Type == batchv1.JobComplete { | ||
| image, digest, err := b.getImageDigestAndDeleteJob(k8sJob.Name) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about devide the getImageDigestAndDeleteJob function into two functions. Something like getImageDigest and deleteJob
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
| OIDC OIDC `json:"oidc"` | ||
| } | ||
|
|
||
| // FIXME: duplicated from pkg/cloud |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it mean we should remove the duplicated struct in the pkg/cloud
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have completely deduplicated it by removing PrepareResourcesForUser.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks your work!
| return req | ||
| } | ||
|
|
||
| func (c *TEEProviderGCPConfidentialSpace) createWorkloadIdentityPoolProvider(name string, digest string) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
workload identity pool is used for allowing the confidential space instance to use the kms key. Since the kms key has been totally removed, we should think whether the workload identity is required any more.
2/3 PR for a major refactoring of DCR Monitor. See #15. 1/3: #16 2/3: #19 This pretty much concludes the major refactoring, resolving #15 # Changes * Added `Created` job status, because the reconciler needs to handle newly created jobs. * Move KanikoService functionality into the monitor (=reconciler) * Remove unused config `Cluster.PodServiceAccount` * Clean up ARG/ENV of TEE dockerfile * In-memory Dockerfile injection in API. See `addDockerfileToTarGz`. This resolves #3. Also Kaniko can just refer to the remote object path. * Removed most of shallow functions in `Config` * Completely removed `CloudProvider` * Removed shallow / no-longer used modules in `pkg`: `pkg/utils/constant.go`, `pkg/utils/file.go`, and `pkg/utils/k8s.go`. # Testing Manual end-to-end testing.
2/N PR for a major refactoring of DCR Monitor. See #15.
1/N: #16
Changes
imagebuilderinterface, which currently has one image builder implementation which is KanikoRunJoblogic into the reconciler. Now TEE is launched by the reconciler viaLaunchInstancemethod inTEEProvider.Config. Removed bunch of unnecessary global configs, and made them local.PrepareResourcesForUser. Any logic needed for TEE should go toTEEProvider.project_numberfrom config, because it is not needed anymore.Caveat
Testing
Added unit tests, and also did manual end-to-end testing.