-
Notifications
You must be signed in to change notification settings - Fork 122
[WIP] CNTRLPLANE-3234: health reporter writer (with typed client) #929
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| package kmshealthwriter | ||
|
|
||
| import ( | ||
| "context" | ||
|
|
||
| applyoperatorv1 "github.com/openshift/client-go/operator/applyconfigurations/operator/v1" | ||
| operatorclient "github.com/openshift/client-go/operator/clientset/versioned" | ||
| "github.com/openshift/library-go/pkg/operator/encryption/kms/health" | ||
| metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
| "k8s.io/client-go/rest" | ||
| ) | ||
|
|
||
| // NewEncryptionStatusWriter satisfies health.NewEncryptionStatusWriterFunc. | ||
| // Only the operator itself knows where to apply the KMSEncryptionStatus. | ||
| func NewEncryptionStatusWriter(restConfig *rest.Config, fieldManager string) (health.EncryptionStatusWriter, error) { | ||
| client, err := operatorclient.NewForConfig(restConfig) | ||
| if err != nil { | ||
| return nil, err | ||
| } | ||
|
|
||
| return func(ctx context.Context, status *applyoperatorv1.KMSEncryptionStatusApplyConfiguration) error { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This mechanism sounds like a good idea to me |
||
| _, err := client.OperatorV1().Authentications().ApplyStatus( | ||
| ctx, | ||
| applyoperatorv1.Authentication("cluster"). | ||
| WithStatus(applyoperatorv1.AuthenticationStatus().WithOAuthAPIServer( | ||
| applyoperatorv1.OAuthAPIServerStatus().WithEncryptionStatus(status), | ||
| )), | ||
| metav1.ApplyOptions{FieldManager: fieldManager, Force: true}, | ||
| ) | ||
| return err | ||
| }, nil | ||
| } | ||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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.
🩺 Stability & Availability | 🔴 Critical
🧩 Analysis chain
🏁 Script executed:
Repository: openshift/cluster-authentication-operator
Length of output: 340
Remove the machine-local
replacedirective before merge.Line 137 pins
github.com/openshift/library-goto an absolute workstation path (/home/ibihim/...), which breaks builds on other machines and CI systems lacking that exact path. This violates supply chain security requirements for reproducible dependency resolution.Suggested fix
-replace github.com/openshift/library-go => /home/ibihim/go/src/github.com/openshift/library-go-worktrees/CNTRLPLANE-3234-health-reporter-writerIf local development requires this replace, move it to
go.workinstead.📝 Committable suggestion
🤖 Prompt for AI Agents
Source: Path instructions