diff --git a/CHANGELOG.md b/CHANGELOG.md index c5926c2..caba766 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,10 +1,13 @@ ## Unreleased +## 1.0.0 (January 25th, 2022) + CHANGES: * `-write-secrets` flag removed. All secrets are now written to the filesystem by the CSI secrets store driver. [[GH-133](https://github.com/hashicorp/vault-csi-provider/pull/133)] * **NOTE:** CSI secrets store driver v0.0.21+ is required. * `-health_addr` flag removed, use `-health-addr` instead. [[GH-133](https://github.com/hashicorp/vault-csi-provider/pull/133)] +* Warning logs are no longer printed when deprecated SecretProviderClass fields `kubernetesServiceAccountPath` and `vaultCAPem` are used. [[GH-134](https://github.com/hashicorp/vault-csi-provider/pull/134)] ## 0.4.0 (January 12th, 2022) diff --git a/deployment/vault-csi-provider.yaml b/deployment/vault-csi-provider.yaml index 012f352..da821d0 100644 --- a/deployment/vault-csi-provider.yaml +++ b/deployment/vault-csi-provider.yaml @@ -51,7 +51,7 @@ spec: tolerations: containers: - name: provider-vault-installer - image: hashicorp/vault-csi-provider:0.4.0 + image: hashicorp/vault-csi-provider:1.0.0 imagePullPolicy: Always args: - -endpoint=/provider/vault.sock diff --git a/internal/config/config.go b/internal/config/config.go index 5530d2a..ec4f2f3 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -6,7 +6,6 @@ import ( "os" "strconv" - "github.com/hashicorp/go-hclog" "gopkg.in/yaml.v3" "k8s.io/apimachinery/pkg/types" ) @@ -64,13 +63,13 @@ type Secret struct { SecretArgs map[string]interface{} `yaml:"secretArgs,omitempty"` } -func Parse(logger hclog.Logger, parametersStr, targetPath, permissionStr string, defaultVaultAddr string, defaultVaultKubernetesMountPath string) (Config, error) { +func Parse(parametersStr, targetPath, permissionStr string, defaultVaultAddr string, defaultVaultKubernetesMountPath string) (Config, error) { config := Config{ TargetPath: targetPath, } var err error - config.Parameters, err = parseParameters(logger, parametersStr, defaultVaultAddr, defaultVaultKubernetesMountPath) + config.Parameters, err = parseParameters(parametersStr, defaultVaultAddr, defaultVaultKubernetesMountPath) if err != nil { return Config{}, err } @@ -88,7 +87,7 @@ func Parse(logger hclog.Logger, parametersStr, targetPath, permissionStr string, return config, nil } -func parseParameters(logger hclog.Logger, parametersStr string, defaultVaultAddress string, defaultVaultKubernetesMountPath string) (Parameters, error) { +func parseParameters(parametersStr string, defaultVaultAddress string, defaultVaultKubernetesMountPath string) (Parameters, error) { var params map[string]string err := json.Unmarshal([]byte(parametersStr), ¶ms) if err != nil { @@ -132,12 +131,6 @@ func parseParameters(logger hclog.Logger, parametersStr string, defaultVaultAddr if parameters.VaultKubernetesMountPath == "" { parameters.VaultKubernetesMountPath = defaultVaultKubernetesMountPath } - if _, exists := params["kubernetesServiceAccountPath"]; exists { - logger.Warn("kubernetesServiceAccountPath set but will be ignored", "PodInfo", parameters.PodInfo) - } - if _, exists := params["vaultCAPem"]; exists { - logger.Warn("vaultCAPem set but will be ignored", "PodInfo", parameters.PodInfo) - } return parameters, nil } diff --git a/internal/config/config_test.go b/internal/config/config_test.go index 733f5eb..4d6dc6a 100644 --- a/internal/config/config_test.go +++ b/internal/config/config_test.go @@ -6,7 +6,6 @@ import ( "path/filepath" "testing" - "github.com/hashicorp/go-hclog" "github.com/stretchr/testify/require" "gopkg.in/yaml.v3" ) @@ -53,7 +52,7 @@ func TestParseParametersFromYaml(t *testing.T) { require.NoError(t, err) // This is now the form the provider receives the data in. - params, err := parseParameters(hclog.NewNullLogger(), string(paramsBytes), defaultVaultAddress, defaultVaultKubernetesMountPath) + params, err := parseParameters(string(paramsBytes), defaultVaultAddress, defaultVaultKubernetesMountPath) require.NoError(t, err) require.Equal(t, Parameters{ @@ -87,7 +86,7 @@ func TestParseParameters(t *testing.T) { // This file's contents are copied directly from a driver mount request. parametersStr, err := ioutil.ReadFile(filepath.Join("testdata", "example-parameters-string.txt")) require.NoError(t, err) - actual, err := parseParameters(hclog.NewNullLogger(), string(parametersStr), defaultVaultAddress, defaultVaultKubernetesMountPath) + actual, err := parseParameters(string(parametersStr), defaultVaultAddress, defaultVaultKubernetesMountPath) require.NoError(t, err) expected := Parameters{ VaultRoleName: "example-role", @@ -178,7 +177,7 @@ func TestParseConfig(t *testing.T) { } { parametersStr, err := json.Marshal(tc.parameters) require.NoError(t, err) - cfg, err := Parse(hclog.NewNullLogger(), string(parametersStr), tc.targetPath, "420", defaultVaultAddress, defaultVaultKubernetesMountPath) + cfg, err := Parse(string(parametersStr), tc.targetPath, "420", defaultVaultAddress, defaultVaultKubernetesMountPath) require.NoError(t, err, tc.name) require.Equal(t, tc.expected, cfg) } @@ -208,7 +207,7 @@ func TestParseConfig_Errors(t *testing.T) { } { parametersStr, err := json.Marshal(tc.parameters) require.NoError(t, err) - _, err = Parse(hclog.NewNullLogger(), string(parametersStr), "/some/path", "420", defaultVaultAddress, defaultVaultKubernetesMountPath) + _, err = Parse(string(parametersStr), "/some/path", "420", defaultVaultAddress, defaultVaultKubernetesMountPath) require.Error(t, err, tc.name) } } diff --git a/internal/server/server.go b/internal/server/server.go index 29415a0..a61f827 100644 --- a/internal/server/server.go +++ b/internal/server/server.go @@ -31,7 +31,7 @@ func (p *Server) Version(context.Context, *pb.VersionRequest) (*pb.VersionRespon } func (p *Server) Mount(ctx context.Context, req *pb.MountRequest) (*pb.MountResponse, error) { - cfg, err := config.Parse(p.Logger.Named("config"), req.Attributes, req.TargetPath, req.Permission, p.VaultAddr, p.VaultMount) + cfg, err := config.Parse(req.Attributes, req.TargetPath, req.Permission, p.VaultAddr, p.VaultMount) if err != nil { return nil, err } diff --git a/manifest_staging/deployment/vault-csi-provider.yaml b/manifest_staging/deployment/vault-csi-provider.yaml index 012f352..da821d0 100644 --- a/manifest_staging/deployment/vault-csi-provider.yaml +++ b/manifest_staging/deployment/vault-csi-provider.yaml @@ -51,7 +51,7 @@ spec: tolerations: containers: - name: provider-vault-installer - image: hashicorp/vault-csi-provider:0.4.0 + image: hashicorp/vault-csi-provider:1.0.0 imagePullPolicy: Always args: - -endpoint=/provider/vault.sock