Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions .changelog/2770.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
```release-note:deprecation
**Data Sources**
- `kubernetes_config_map` → use `kubernetes_config_map_v1`
- `kubernetes_namespace` → use `kubernetes_namespace_v1`
- `kubernetes_secret` → use `kubernetes_secret_v1`
- `kubernetes_service` → use `kubernetes_service_v1`
- `kubernetes_pod` → use `kubernetes_pod_v1`
- `kubernetes_service_account` → use `kubernetes_service_account_v1`
- `kubernetes_persistent_volume_claim` → use `kubernetes_persistent_volume_claim_v1`
- `kubernetes_storage_class` → use `kubernetes_storage_class_v1`
- `kubernetes_ingress` → use `kubernetes_ingress_v1`

**Resources**
- `kubernetes_namespace` → use `kubernetes_namespace_v1`
- `kubernetes_service` → use `kubernetes_service_v1`
- `kubernetes_service_account` → use `kubernetes_service_account_v1`
- `kubernetes_default_service_account` → use `kubernetes_default_service_account_v1`
- `kubernetes_config_map` → use `kubernetes_config_map_v1`
- `kubernetes_secret` → use `kubernetes_secret_v1`
- `kubernetes_pod` → use `kubernetes_pod_v1`
- `kubernetes_endpoints` → use `kubernetes_endpoints_v1`
- `kubernetes_limit_range` → use `kubernetes_limit_range_v1`
- `kubernetes_persistent_volume` → use `kubernetes_persistent_volume_v1`
- `kubernetes_persistent_volume_claim` → use `kubernetes_persistent_volume_claim_v1`
- `kubernetes_replication_controller` → use `kubernetes_replication_controller_v1`
- `kubernetes_resource_quota` → use `kubernetes_resource_quota_v1`
- `kubernetes_api_service` → use `kubernetes_api_service_v1`
- `kubernetes_deployment` → use `kubernetes_deployment_v1`
- `kubernetes_daemonset` → use `kubernetes_daemon_set_v1`
- `kubernetes_stateful_set` → use `kubernetes_stateful_set_v1`
- `kubernetes_job` → use `kubernetes_job_v1`
- `kubernetes_cron_job` → use `kubernetes_cron_job_v1`
- `kubernetes_horizontal_pod_autoscaler` → use `kubernetes_horizontal_pod_autoscaler_v1` or `kubernetes_horizontal_pod_autoscaler_v2`
- `kubernetes_certificate_signing_request` → use `kubernetes_certificate_signing_request_v1`
- `kubernetes_role` → use `kubernetes_role_v1`
- `kubernetes_role_binding` → use `kubernetes_role_binding_v1`
- `kubernetes_cluster_role` → use `kubernetes_cluster_role_v1`
- `kubernetes_cluster_role_binding` → use `kubernetes_cluster_role_binding_v1`
- `kubernetes_ingress` → use `kubernetes_ingress_v1`
- `kubernetes_ingress_class` → use `kubernetes_ingress_class_v1`
- `kubernetes_network_policy` → use `kubernetes_network_policy_v1`
- `kubernetes_pod_disruption_budget` → use `kubernetes_pod_disruption_budget_v1`
- `kubernetes_pod_security_policy` → removed upstream; use Pod Security Admission instead
- `kubernetes_priority_class` → use `kubernetes_priority_class_v1`
- `kubernetes_validating_webhook_configuration` → use `kubernetes_validating_webhook_configuration_v1`
- `kubernetes_mutating_webhook_configuration` → use `kubernetes_mutating_webhook_configuration_v1`
- `kubernetes_storage_class` → use `kubernetes_storage_class_v1`
- `kubernetes_csi_driver` → use `kubernetes_csi_driver_v1`
```
7 changes: 4 additions & 3 deletions kubernetes/data_source_kubernetes_config_map_v1.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,11 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

func dataSourceKubernetesConfigMapV1() *schema.Resource {
func dataSourceKubernetesConfigMapV1(deprecationMessage string) *schema.Resource {
return &schema.Resource{
Description: "Config Maps are key-value pairs containing configuration data. The Config Map data source provides a mechanism for extracting these key-value pairs.",
ReadContext: dataSourceKubernetesConfigMapV1Read,
Description: "Config Maps are key-value pairs containing configuration data. The Config Map data source provides a mechanism for extracting these key-value pairs.",
ReadContext: dataSourceKubernetesConfigMapV1Read,
DeprecationMessage: deprecationMessage,

Schema: map[string]*schema.Schema{
"metadata": namespacedMetadataSchema("config_map", false),
Expand Down
5 changes: 3 additions & 2 deletions kubernetes/data_source_kubernetes_ingress.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@ func dataSourceKubernetesIngress() *schema.Resource {
docIngressSpec := networking.IngressSpec{}.SwaggerDoc()

return &schema.Resource{
Description: "Ingress is a collection of rules that allow inbound connections to reach the endpoints defined by a backend. An Ingress can be configured to give services externally-reachable urls, load balance traffic, terminate SSL, offer name based virtual hosting etc. This data source allows you to pull data about such ingress.",
ReadContext: dataSourceKubernetesIngressRead,
DeprecationMessage: "Deprecated: this data source will be removed in the next major version of the provider. Use kubernetes_ingress_v1 instead.",
Description: "Ingress is a collection of rules that allow inbound connections to reach the endpoints defined by a backend. An Ingress can be configured to give services externally-reachable urls, load balance traffic, terminate SSL, offer name based virtual hosting etc. This data source allows you to pull data about such ingress.",
ReadContext: dataSourceKubernetesIngressRead,
Schema: map[string]*schema.Schema{
"metadata": namespacedMetadataSchema("ingress", false),
"spec": {
Expand Down
7 changes: 4 additions & 3 deletions kubernetes/data_source_kubernetes_namespace_v1.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,11 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

func dataSourceKubernetesNamespaceV1() *schema.Resource {
func dataSourceKubernetesNamespaceV1(deprecationMessage string) *schema.Resource {
return &schema.Resource{
Description: "This data source provides a mechanism to query attributes of any specific namespace within a Kubernetes cluster. In Kubernetes, namespaces provide a scope for names and are intended as a way to divide cluster resources between multiple users.",
ReadContext: dataSourceKubernetesNamespaceV1Read,
Description: "This data source provides a mechanism to query attributes of any specific namespace within a Kubernetes cluster. In Kubernetes, namespaces provide a scope for names and are intended as a way to divide cluster resources between multiple users.",
ReadContext: dataSourceKubernetesNamespaceV1Read,
DeprecationMessage: deprecationMessage,

Schema: map[string]*schema.Schema{
"metadata": metadataSchema("namespace", false),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,11 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

func dataSourceKubernetesPersistentVolumeClaimV1() *schema.Resource {
func dataSourceKubernetesPersistentVolumeClaimV1(deprecationMessage string) *schema.Resource {
return &schema.Resource{
Description: "A PersistentVolumeClaim (PVC) is a request for storage by a user. This data source retrieves information about the specified PVC.",
ReadContext: dataSourceKubernetesPersistentVolumeClaimV1Read,
Description: "A PersistentVolumeClaim (PVC) is a request for storage by a user. This data source retrieves information about the specified PVC.",
ReadContext: dataSourceKubernetesPersistentVolumeClaimV1Read,
DeprecationMessage: deprecationMessage,

Schema: map[string]*schema.Schema{
"metadata": namespacedMetadataSchema("persistent volume claim", true),
Expand Down
7 changes: 4 additions & 3 deletions kubernetes/data_source_kubernetes_pod_v1.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,15 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

func dataSourceKubernetesPodV1() *schema.Resource {
func dataSourceKubernetesPodV1(deprecationMessage string) *schema.Resource {
podSpecFields := podSpecFields(false, false)
// Setting this default to false prevents a perpetual diff caused by volume_mounts
// being mutated on the server side as Kubernetes automatically adds a mount
// for the service account token
return &schema.Resource{
Description: "A pod is a group of one or more containers, the shared storage for those containers, and options about how to run the containers. Pods are always co-located and co-scheduled, and run in a shared context. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod/.",
ReadContext: dataSourceKubernetesPodV1Read,
Description: "A pod is a group of one or more containers, the shared storage for those containers, and options about how to run the containers. Pods are always co-located and co-scheduled, and run in a shared context. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod/.",
ReadContext: dataSourceKubernetesPodV1Read,
DeprecationMessage: deprecationMessage,

Schema: map[string]*schema.Schema{
"metadata": namespacedMetadataSchema("pod", true),
Expand Down
7 changes: 4 additions & 3 deletions kubernetes/data_source_kubernetes_secret_v1.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,11 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

func dataSourceKubernetesSecretV1() *schema.Resource {
func dataSourceKubernetesSecretV1(deprecationMessage string) *schema.Resource {
return &schema.Resource{
Description: "The resource provides mechanisms to inject containers with sensitive information, such as passwords, while keeping containers agnostic of Kubernetes. Secrets can be used to store sensitive information either as individual properties or coarse-grained entries like entire files or JSON blobs. The resource will by default create a secret which is available to any pod in the specified (or default) namespace.",
ReadContext: dataSourceKubernetesSecretV1Read,
Description: "The resource provides mechanisms to inject containers with sensitive information, such as passwords, while keeping containers agnostic of Kubernetes. Secrets can be used to store sensitive information either as individual properties or coarse-grained entries like entire files or JSON blobs. The resource will by default create a secret which is available to any pod in the specified (or default) namespace.",
ReadContext: dataSourceKubernetesSecretV1Read,
DeprecationMessage: deprecationMessage,

Schema: map[string]*schema.Schema{
"metadata": namespacedMetadataSchema("secret", true),
Expand Down
7 changes: 4 additions & 3 deletions kubernetes/data_source_kubernetes_service_account_v1.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,11 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

func dataSourceKubernetesServiceAccountV1() *schema.Resource {
func dataSourceKubernetesServiceAccountV1(deprecationMessage string) *schema.Resource {
return &schema.Resource{
Description: "A service account provides an identity for processes that run in a Pod. This data source reads the service account and makes specific attributes available to Terraform. More info: https://kubernetes.io/docs/reference/access-authn-authz/service-accounts-admin/.",
ReadContext: dataSourceKubernetesServiceAccountV1Read,
Description: "A service account provides an identity for processes that run in a Pod. This data source reads the service account and makes specific attributes available to Terraform. More info: https://kubernetes.io/docs/reference/access-authn-authz/service-accounts-admin/.",
ReadContext: dataSourceKubernetesServiceAccountV1Read,
DeprecationMessage: deprecationMessage,

Schema: map[string]*schema.Schema{
"metadata": namespacedMetadataSchema("service account", false),
Expand Down
8 changes: 5 additions & 3 deletions kubernetes/data_source_kubernetes_service_v1.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,12 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

func dataSourceKubernetesServiceV1() *schema.Resource {
func dataSourceKubernetesServiceV1(deprecationMessage string) *schema.Resource {
return &schema.Resource{
Description: "A Service is an abstraction which defines a logical set of pods and a policy by which to access them - sometimes called a micro-service. This data source allows you to pull data about such service.",
ReadContext: dataSourceKubernetesServiceV1Read,
Description: "A Service is an abstraction which defines a logical set of pods and a policy by which to access them - sometimes called a micro-service. This data source allows you to pull data about such service.",
ReadContext: dataSourceKubernetesServiceV1Read,
DeprecationMessage: deprecationMessage,

Schema: map[string]*schema.Schema{
"metadata": namespacedMetadataSchema("service", false),
"spec": {
Expand Down
8 changes: 5 additions & 3 deletions kubernetes/data_source_kubernetes_storage_class_v1.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,12 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

func dataSourceKubernetesStorageClassV1() *schema.Resource {
func dataSourceKubernetesStorageClassV1(deprecationMessage string) *schema.Resource {
return &schema.Resource{
Description: "Storage class is the foundation of dynamic provisioning, allowing cluster administrators to define abstractions for the underlying storage platform.Read more at https://kubernetes.io/blog/2017/03/dynamic-provisioning-and-storage-classes-kubernetes/",
ReadContext: dataSourceKubernetesStorageClassV1Read,
Description: "Storage class is the foundation of dynamic provisioning, allowing cluster administrators to define abstractions for the underlying storage platform.Read more at https://kubernetes.io/blog/2017/03/dynamic-provisioning-and-storage-classes-kubernetes/",
ReadContext: dataSourceKubernetesStorageClassV1Read,
DeprecationMessage: deprecationMessage,

Schema: map[string]*schema.Schema{
"metadata": metadataSchema("storage class", false),
"parameters": {
Expand Down
Loading
Loading