Skip to content

Commit ac4ecef

Browse files
VAULT-36773 Fixed and add deprecation messages
1 parent 1fea9d8 commit ac4ecef

4 files changed

Lines changed: 33 additions & 15 deletions

File tree

config/manifests/bases/vault-secrets-operator.clusterserviceversion.yaml

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -83,18 +83,22 @@ spec:
8383
apiservicedefinitions: {}
8484
customresourcedefinitions:
8585
owned:
86-
- description: "HCPAuth is the Schema for the hcpauths API \n Deprecated: HCPAuth
87-
and HCP Vault Secrets support are deprecated and will be removed in a future
88-
release of the Vault Secrets Operator. Migrate off HCP Vault Secrets before
89-
upgrading to the removal release."
86+
- description: |-
87+
HCPAuth is the Schema for the hcpauths API
88+
89+
Deprecated: HCPAuth and HCP Vault Secrets support are deprecated and will be
90+
removed in a future release of the Vault Secrets Operator. Migrate off HCP
91+
Vault Secrets before upgrading to the removal release.
9092
displayName: HCPAuth
9193
kind: HCPAuth
9294
name: hcpauths.secrets.hashicorp.com
9395
version: v1beta1
94-
- description: "HCPVaultSecretsApp is the Schema for the hcpvaultsecretsapps API
95-
\n Deprecated: HCPVaultSecretsApp and HCP Vault Secrets support are deprecated
96+
- description: |-
97+
HCPVaultSecretsApp is the Schema for the hcpvaultsecretsapps API
98+
99+
Deprecated: HCPVaultSecretsApp and HCP Vault Secrets support are deprecated
96100
and will be removed in a future release of the Vault Secrets Operator. Migrate
97-
off HCP Vault Secrets before upgrading to the removal release."
101+
off HCP Vault Secrets before upgrading to the removal release.
98102
displayName: HCPVault Secrets App
99103
kind: HCPVaultSecretsApp
100104
name: hcpvaultsecretsapps.secrets.hashicorp.com

controllers/hcpauth_controller.go

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -69,12 +69,10 @@ func (r *HCPAuthReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ct
6969
logger.Info("HCPAuth is deprecated and will be removed in a future release of " +
7070
"the Vault Secrets Operator; migrate off HCP Vault Secrets before upgrading " +
7171
"to the removal release")
72-
if r.Recorder != nil {
73-
r.Recorder.Event(o, corev1.EventTypeWarning, consts.ReasonDeprecated,
74-
"HCPAuth is deprecated and will be removed in a future release of the "+
75-
"Vault Secrets Operator; migrate off HCP Vault Secrets before upgrading "+
76-
"to the removal release")
77-
}
72+
r.Recorder.Event(o, corev1.EventTypeWarning, consts.ReasonDeprecated,
73+
"HCPAuth is deprecated and will be removed in a future release of the "+
74+
"Vault Secrets Operator; migrate off HCP Vault Secrets before upgrading "+
75+
"to the removal release")
7876

7977
// perform a rudimentary health check on the HCP host on port 443.
8078
conn, err := net.DialTimeout("tcp",

helpers/rollout_restart.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ import (
2525
const AnnotationRestartedAt = "vso.secrets.hashicorp.com/restartedAt"
2626

2727
// HandleRolloutRestarts for all v1beta1.RolloutRestartTarget(s) configured for obj.
28-
// Supported objs are: v1beta1.VaultDynamicSecret, v1beta1.VaultStaticSecret, v1beta1.VaultPKISecret
28+
// Supported objs are: v1beta1.VaultDynamicSecret, v1beta1.VaultStaticSecret,
29+
// v1beta1.VaultPKISecret, v1beta1.HCPVaultSecretsApp (deprecated)
2930
// Please note the following:
3031
// - a rollout-restart will be triggered for each configured v1beta1.RolloutRestartTarget
3132
// - the rollout-restart action has no support for roll-back

helpers/secrets.go

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,13 @@ import (
3030
)
3131

3232
const (
33-
SecretDataKeyRaw = "_raw"
33+
SecretDataKeyRaw = "_raw"
34+
35+
// HVSSecretTypeKV, HVSSecretTypeRotating, and HVSSecretTypeDynamic are the
36+
// HVS secret type identifiers.
37+
//
38+
// Deprecated: HCP Vault Secrets support is deprecated and will be removed in
39+
// a future release of the Vault Secrets Operator.
3440
HVSSecretTypeKV = "kv"
3541
HVSSecretTypeRotating = "rotating"
3642
HVSSecretTypeDynamic = "dynamic"
@@ -535,6 +541,9 @@ func marshalJSON(value any) ([]byte, error) {
535541

536542
// WithHVSAppSecrets returns the K8s Secret data from HCP Vault Secrets App. This
537543
// method must always return a non-nil data map to avoid HMAC calculation issues.
544+
//
545+
// Deprecated: HCP Vault Secrets support is deprecated and will be removed in a
546+
// future release of the Vault Secrets Operator.
538547
func (s *SecretDataBuilder) WithHVSAppSecrets(resp *hvsclient.OpenAppSecretsOK, opt *SecretTransformationOption) (map[string][]byte, error) {
539548
if opt == nil {
540549
opt = &SecretTransformationOption{}
@@ -711,6 +720,9 @@ func NewSecretsDataBuilder() *SecretDataBuilder {
711720

712721
// MakeHVSShadowSecretData converts a list of HVS OpenSecrets to k8s secret
713722
// data. Only dynamic secrets are included.
723+
//
724+
// Deprecated: HCP Vault Secrets support is deprecated and will be removed in a
725+
// future release of the Vault Secrets Operator.
714726
func MakeHVSShadowSecretData(secrets []*models.Secrets20231128OpenSecret) (map[string][]byte, error) {
715727
data := make(map[string][]byte)
716728
for _, v := range secrets {
@@ -728,6 +740,9 @@ func MakeHVSShadowSecretData(secrets []*models.Secrets20231128OpenSecret) (map[s
728740
}
729741

730742
// FromHVSShadowSecret converts a k8s secret data entry to an HVS OpenSecret.
743+
//
744+
// Deprecated: HCP Vault Secrets support is deprecated and will be removed in a
745+
// future release of the Vault Secrets Operator.
731746
func FromHVSShadowSecret(data []byte) (*models.Secrets20231128OpenSecret, error) {
732747
secret := &models.Secrets20231128OpenSecret{}
733748
if err := secret.UnmarshalBinary(data); err != nil {

0 commit comments

Comments
 (0)