Add secret names
[ZITADOPER-1]
This commit is contained in:
@@ -49,7 +49,6 @@ type MachineUserStatus struct {
|
||||
UserId string `json:"userId"`
|
||||
// +kubebuilder:default=""
|
||||
KeyId string `json:"keyId"`
|
||||
|
||||
// +kubebuilder:default=""
|
||||
PATId string `json:"patId"`
|
||||
}
|
||||
@@ -97,6 +96,14 @@ func (d *MachineUser) ZitadelClusterRef(ctx context.Context, refresolver *RefRes
|
||||
return ref, nil
|
||||
}
|
||||
|
||||
func (d *MachineUser) PatSecretName() string {
|
||||
return d.Name + "-pat-secret"
|
||||
}
|
||||
|
||||
func (d *MachineUser) JWTSecretName() string {
|
||||
return d.Name + "-machinekey-secret"
|
||||
}
|
||||
|
||||
//+kubebuilder:object:root=true
|
||||
|
||||
// MachineUserList contains a list of MachineUser
|
||||
|
||||
@@ -191,7 +191,7 @@ func (wr *wrappedMachineUserReconciler) reconcilePAT(ctx context.Context, ztdCli
|
||||
return fmt.Errorf("Error adding PAT: %v", err)
|
||||
}
|
||||
key := types.NamespacedName{
|
||||
Name: wr.MachineUser.Name + "-pat-secret",
|
||||
Name: wr.MachineUser.PatSecretName(),
|
||||
Namespace: wr.MachineUser.Namespace,
|
||||
}
|
||||
patSecret, err := wr.Builder.BuildSecret(builder.SecretOpts{
|
||||
@@ -240,7 +240,7 @@ func (wr *wrappedMachineUserReconciler) reconcileJWT(ctx context.Context, ztdCli
|
||||
return fmt.Errorf("Error adding JWT: %v", err)
|
||||
}
|
||||
key := types.NamespacedName{
|
||||
Name: wr.MachineUser.Name + "-machinekey-secret",
|
||||
Name: wr.MachineUser.JWTSecretName(),
|
||||
Namespace: wr.MachineUser.Namespace,
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user