Skip to content
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

Fix deprecated null_data_source #74

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

ryanzzff
Copy link
Contributor

We can use locals instead of null_data_source.

│ Warning: Deprecated Resource
│ 
│   with module.etcd.data.null_data_source.endpoints,
│   on service/etcd/main.tf line 83, in data "null_data_source" "endpoints":
│   83: data "null_data_source" "endpoints" {
│ 
│ The null_data_source was historically used to construct intermediate values to re-use elsewhere in configuration, the same can now be achieved using locals
╵

@pstadler
Copy link
Member

pstadler commented Sep 22, 2021

is this still working correctly now that there's no depends_on in place for the output variable?

@ryanzzff
Copy link
Contributor Author

Sorry, I'm new to terraform and k8s, so I'm not sure if it is working "correctly", but I "think" it is ;)

command to get the ClusterConfig:

kubectl get cm kubeadm-config  -n kube-system -o yaml

output:

apiVersion: v1
data:
  ClusterConfiguration: |
    apiServer:
      certSANs:
      - <I_guess_I_should_hide_this>
      extraArgs:
        authorization-mode: Node,RBAC
      timeoutForControlPlane: 4m0s
    apiVersion: kubeadm.k8s.io/v1beta3
    certificatesDir: /etc/kubernetes/pki
    clusterName: kubernetes
    controllerManager: {}
    dns: {}
    etcd:
      external:
        caFile: ""
        certFile: ""
        endpoints:
        - http://10.0.1.1:2379
        - http://10.0.1.2:2379
        - http://10.0.1.3:2379
        keyFile: ""
    imageRepository: k8s.gcr.io
    kind: ClusterConfiguration
    kubernetesVersion: v1.22.2
    networking:
      dnsDomain: cluster.local
      serviceSubnet: 10.96.0.0/12
    scheduler: {}
kind: ConfigMap
metadata:
  creationTimestamp: "2021-09-19T16:01:04Z"
  managedFields:
  - apiVersion: v1
    fieldsType: FieldsV1
    fieldsV1:
      f:data:
        .: {}
        f:ClusterConfiguration: {}
    manager: kubeadm
    operation: Update
    time: "2021-09-19T16:01:04Z"
  name: kubeadm-config
  namespace: kube-system
  resourceVersion: "214"
  uid: 51ebd3b8-eb73-4787-9f53-4ede7318571b

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants