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

Filter well known labels and annotations #1253

Merged
merged 13 commits into from
May 17, 2021

Conversation

DrFaust92
Copy link
Contributor

@DrFaust92 DrFaust92 commented Apr 29, 2021

Description

Acceptance tests

  • Have you added an acceptance test for the functionality being added?
  • Have you run the acceptance tests on this branch?

Output from acceptance testing:

$ make testacc TESTARGS='-run=TestAccKubernetesPod_'
--- PASS: TestAccKubernetesPod_with_node_affinity_with_required_during_scheduling_ignored_during_execution (54.66s)
--- PASS: TestAccKubernetesPod_with_node_affinity_with_preferred_during_scheduling_ignored_during_execution (23.56s)
--- PASS: TestAccKubernetesPod_with_pod_affinity_with_required_during_scheduling_ignored_during_execution (15.17s)
--- PASS: TestAccKubernetesPod_with_pod_affinity_with_preferred_during_scheduling_ignored_during_execution (17.85s)
--- PASS: TestAccKubernetesPod_with_pod_anti_affinity_with_required_during_scheduling_ignored_during_execution (22.30s)
--- PASS: TestAccKubernetesPod_with_pod_anti_affinity_with_preferred_during_scheduling_ignored_during_execution (22.23s)
--- PASS: TestAccKubernetesPod_minimal (15.78s)
--- PASS: TestAccKubernetesPod_basic (11.12s)
--- PASS: TestAccKubernetesPod_initContainer_updateForcesNew (113.14s)
--- PASS: TestAccKubernetesPod_updateArgsForceNew (107.65s)
--- PASS: TestAccKubernetesPod_updateEnvForceNew (41.62s)
--- PASS: TestAccKubernetesPod_with_pod_security_context (21.89s)
--- PASS: TestAccKubernetesPod_with_pod_security_context_run_as_group (13.84s)
--- PASS: TestAccKubernetesPod_with_container_liveness_probe_using_exec (45.02s)
--- PASS: TestAccKubernetesPod_with_container_liveness_probe_using_http_get (21.91s)
--- PASS: TestAccKubernetesPod_with_container_liveness_probe_using_tcp (13.83s)
--- PASS: TestAccKubernetesPod_with_container_lifecycle (10.54s)
--- PASS: TestAccKubernetesPod_with_container_security_context (22.69s)
--- PASS: TestAccKubernetesPod_with_volume_mount (22.62s)
--- PASS: TestAccKubernetesPod_with_cfg_map_volume_mount (22.88s)
--- PASS: TestAccKubernetesPod_with_projected_volume (52.74s)
--- PASS: TestAccKubernetesPod_with_resource_requirements (21.70s)
--- PASS: TestAccKubernetesPod_with_empty_dir_volume (21.61s)
--- PASS: TestAccKubernetesPod_with_empty_dir_volume_with_sizeLimit (21.81s)
--- PASS: TestAccKubernetesPod_with_secret_vol_items (13.66s)
--- PASS: TestAccKubernetesPod_config_with_automount_service_account_token (22.12s)
--- PASS: TestAccKubernetesPod_config_container_working_dir (18.70s)
--- PASS: TestAccKubernetesPod_config_container_startup_probe (21.25s)
--- PASS: TestAccKubernetesPod_termination_message_policy_default (7.58s)
--- PASS: TestAccKubernetesPod_termination_message_policy_override_as_file (21.27s)
--- PASS: TestAccKubernetesPod_termination_message_policy_override_as_fallback_to_logs_on_err (7.66s)
--- PASS: TestAccKubernetesPod_enableServiceLinks (9.27s)
--- PASS: TestAccKubernetesPod_bug961EmptyBlocks (0.54s)
--- PASS: TestAccKubernetesPod_readinessGate (50.62s)
--- PASS: TestAccKubernetesPod_topologySpreadConstraint (29.61s)
--- PASS: TestAccKubernetesPod_regression (211.75s)
--- PASS: TestAccKubernetesPod_filterAnnotations (22.22s)

Release Note

Release note for CHANGELOG:

Filter only well known annotations and labels

References

Closes #722

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

@DrFaust92
Copy link
Contributor Author

Im not sure this as exhaustive as the tolerations PR but i gave this a go.

@jrhouston jrhouston self-assigned this May 6, 2021
Copy link
Collaborator

@jrhouston jrhouston left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good @DrFaust92  – just need to do a replace all to fix the grammar in the docs.

website/docs/d/namespace.html.markdown Outdated Show resolved Hide resolved
@jrhouston
Copy link
Collaborator

@jrhouston
Copy link
Collaborator

We also need to update the unit test for the isInternalKey function.

@jrhouston
Copy link
Collaborator

I did a grep, this is all of 'em:

./rbac/v1/types.go:39:	AutoUpdateAnnotationKey = "rbac.authorization.kubernetes.io/autoupdate"
./rbac/v1beta1/types.go:39:	AutoUpdateAnnotationKey = "rbac.authorization.kubernetes.io/autoupdate"
./rbac/v1alpha1/types.go:39:	AutoUpdateAnnotationKey = "rbac.authorization.kubernetes.io/autoupdate"
./core/v1/well_known_labels.go:20:	LabelHostname = "kubernetes.io/hostname"
./core/v1/well_known_labels.go:22:	LabelTopologyZone   = "topology.kubernetes.io/zone"
./core/v1/well_known_labels.go:23:	LabelTopologyRegion = "topology.kubernetes.io/region"
./core/v1/well_known_labels.go:29:	LabelFailureDomainBetaZone   = "failure-domain.beta.kubernetes.io/zone"   // deprecated
./core/v1/well_known_labels.go:30:	LabelFailureDomainBetaRegion = "failure-domain.beta.kubernetes.io/region" // deprecated
./core/v1/well_known_labels.go:38:	LabelInstanceType       = "beta.kubernetes.io/instance-type"
./core/v1/well_known_labels.go:39:	LabelInstanceTypeStable = "node.kubernetes.io/instance-type"
./core/v1/well_known_labels.go:41:	LabelOSStable   = "kubernetes.io/os"
./core/v1/well_known_labels.go:42:	LabelArchStable = "kubernetes.io/arch"
./core/v1/well_known_labels.go:46:	LabelWindowsBuild = "node.kubernetes.io/windows-build"
./core/v1/well_known_labels.go:49:	LabelNamespaceSuffixKubelet = "kubelet.kubernetes.io"
./core/v1/well_known_labels.go:51:	LabelNamespaceSuffixNode = "node.kubernetes.io"
./core/v1/well_known_labels.go:54:	LabelNamespaceNodeRestriction = "node-restriction.kubernetes.io"
./core/v1/well_known_labels.go:60:	IsHeadlessService = "service.kubernetes.io/headless"
./core/v1/well_known_labels.go:67:	LabelNodeExcludeBalancers = "node.kubernetes.io/exclude-from-external-load-balancers"
./core/v1/well_known_labels.go:69:	LabelMetadataName = "kubernetes.io/metadata.name"
./core/v1/types.go:294:	BetaStorageClassAnnotation = "volume.beta.kubernetes.io/storage-class"
./core/v1/types.go:297:	MountOptionAnnotation = "volume.beta.kubernetes.io/mount-options"
./core/v1/types.go:4971:	ResourceDefaultNamespacePrefix = "kubernetes.io/"
./core/v1/types.go:5865:	SecretTypeServiceAccountToken SecretType = "kubernetes.io/service-account-token"
./core/v1/types.go:5868:	ServiceAccountNameKey = "kubernetes.io/service-account.name"
./core/v1/types.go:5870:	ServiceAccountUIDKey = "kubernetes.io/service-account.uid"
./core/v1/types.go:5884:	SecretTypeDockercfg SecretType = "kubernetes.io/dockercfg"
./core/v1/types.go:5893:	SecretTypeDockerConfigJson SecretType = "kubernetes.io/dockerconfigjson"
./core/v1/types.go:5903:	SecretTypeBasicAuth SecretType = "kubernetes.io/basic-auth"
./core/v1/types.go:5914:	SecretTypeSSHAuth SecretType = "kubernetes.io/ssh-auth"
./core/v1/types.go:5926:	SecretTypeTLS SecretType = "kubernetes.io/tls"
./core/v1/types.go:5935:	SecretTypeBootstrapToken SecretType = "bootstrap.kubernetes.io/token"
./core/v1/annotation_key_constants.go:27:	PodPresetOptOutAnnotationKey string = "podpreset.admission.kubernetes.io/exclude"
./core/v1/annotation_key_constants.go:30:	MirrorPodAnnotationKey string = "kubernetes.io/config.mirror"
./core/v1/annotation_key_constants.go:34:	TolerationsAnnotationKey string = "scheduler.alpha.kubernetes.io/tolerations"
./core/v1/annotation_key_constants.go:38:	TaintsAnnotationKey string = "scheduler.alpha.kubernetes.io/taints"
./core/v1/annotation_key_constants.go:43:	SeccompPodAnnotationKey string = "seccomp.security.alpha.kubernetes.io/pod"
./core/v1/annotation_key_constants.go:48:	SeccompContainerAnnotationKeyPrefix string = "container.seccomp.security.alpha.kubernetes.io/"
./core/v1/annotation_key_constants.go:61:	AppArmorBetaContainerAnnotationKeyPrefix = "container.apparmor.security.beta.kubernetes.io/"
./core/v1/annotation_key_constants.go:63:	AppArmorBetaDefaultProfileAnnotationKey = "apparmor.security.beta.kubernetes.io/defaultProfileName"
./core/v1/annotation_key_constants.go:65:	AppArmorBetaAllowedProfilesAnnotationKey = "apparmor.security.beta.kubernetes.io/allowedProfileNames"
./core/v1/annotation_key_constants.go:82:	PreferAvoidPodsAnnotationKey string = "scheduler.alpha.kubernetes.io/preferAvoidPods"
./core/v1/annotation_key_constants.go:87:	ObjectTTLAnnotationKey string = "node.alpha.kubernetes.io/ttl"
./core/v1/annotation_key_constants.go:90:	NonConvertibleAnnotationPrefix = "non-convertible.kubernetes.io"
./core/v1/annotation_key_constants.go:92:	kubectlPrefix = "kubectl.kubernetes.io/"
./core/v1/annotation_key_constants.go:105:	AnnotationLoadBalancerSourceRangesKey = "service.beta.kubernetes.io/load-balancer-source-ranges"
./core/v1/annotation_key_constants.go:124:	EndpointsLastChangeTriggerTime = "endpoints.kubernetes.io/last-change-trigger-time"
./core/v1/annotation_key_constants.go:132:	EndpointsOverCapacity = "endpoints.kubernetes.io/over-capacity"
./core/v1/annotation_key_constants.go:138:	MigratedPluginsAnnotationKey = "storage.alpha.kubernetes.io/migrated-plugins"
./core/v1/annotation_key_constants.go:148:	PodDeletionCost = "controller.kubernetes.io/pod-deletion-cost"
./core/v1/annotation_key_constants.go:153:	AnnotationTopologyAwareHints = "service.kubernetes.io/topology-aware-hints"
./core/v1/well_known_taints.go:22:	TaintNodeNotReady = "node.kubernetes.io/not-ready"
./core/v1/well_known_taints.go:27:	TaintNodeUnreachable = "node.kubernetes.io/unreachable"
./core/v1/well_known_taints.go:31:	TaintNodeUnschedulable = "node.kubernetes.io/unschedulable"
./core/v1/well_known_taints.go:35:	TaintNodeMemoryPressure = "node.kubernetes.io/memory-pressure"
./core/v1/well_known_taints.go:39:	TaintNodeDiskPressure = "node.kubernetes.io/disk-pressure"
./core/v1/well_known_taints.go:43:	TaintNodeNetworkUnavailable = "node.kubernetes.io/network-unavailable"
./core/v1/well_known_taints.go:47:	TaintNodePIDPressure = "node.kubernetes.io/pid-pressure"
./networking/v1beta1/well_known_annotations.go:24:	AnnotationIsDefaultIngressClass = "ingressclass.kubernetes.io/is-default-class"
./networking/v1beta1/well_known_annotations.go:31:	AnnotationIngressClass = "kubernetes.io/ingress.class"
./discovery/v1/well_known_labels.go:21:	LabelServiceName = "kubernetes.io/service-name"
./discovery/v1/well_known_labels.go:27:	LabelManagedBy = "endpointslice.kubernetes.io/managed-by"
./discovery/v1/well_known_labels.go:31:	LabelSkipMirror = "endpointslice.kubernetes.io/skip-mirror"
./discovery/v1beta1/well_known_labels.go:21:	LabelServiceName = "kubernetes.io/service-name"
./discovery/v1beta1/well_known_labels.go:27:	LabelManagedBy = "endpointslice.kubernetes.io/managed-by"
./discovery/v1beta1/well_known_labels.go:31:	LabelSkipMirror = "endpointslice.kubernetes.io/skip-mirror"
./certificates/v1/types.go:128:	KubeAPIServerClientSignerName = "kubernetes.io/kube-apiserver-client"
./certificates/v1/types.go:133:	KubeAPIServerClientKubeletSignerName = "kubernetes.io/kube-apiserver-client-kubelet"
./certificates/v1/types.go:139:	KubeletServingSignerName = "kubernetes.io/kubelet-serving"
./certificates/v1beta1/types.go:125:	KubeAPIServerClientSignerName = "kubernetes.io/kube-apiserver-client"
./certificates/v1beta1/types.go:130:	KubeAPIServerClientKubeletSignerName = "kubernetes.io/kube-apiserver-client-kubelet"
./certificates/v1beta1/types.go:134:	KubeletServingSignerName = "kubernetes.io/kubelet-serving"
./certificates/v1beta1/types.go:138:	LegacyUnknownSignerName = "kubernetes.io/legacy-unknown"
./batch/v1/types.go:24:const JobCompletionIndexAnnotationAlpha = "batch.kubernetes.io/job-completion-index"
./apps/v1/types.go:31:	StatefulSetPodNameLabel        = "statefulset.kubernetes.io/pod-name"
./apps/v1beta2/types.go:31:	StatefulSetPodNameLabel        = "statefulset.kubernetes.io/pod-name"
./apps/v1beta1/types.go:29:	StatefulSetPodNameLabel        = "statefulset.kubernetes.io/pod-name"

@DrFaust92 DrFaust92 force-pushed the filter-well-known-labels branch from cf5458e to cc96fd5 Compare May 14, 2021 21:03
@DrFaust92 DrFaust92 requested a review from jrhouston May 14, 2021 21:37
Copy link
Collaborator

@jrhouston jrhouston left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @DrFaust92!

api.TaintNodeNetworkUnavailable: "",
api.TaintNodePIDPressure: "",

// Secrete Types
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually I don't think we need these, because they go in the type field for Secret.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed

@DrFaust92 DrFaust92 requested a review from jrhouston May 16, 2021 08:40
@DrFaust92 DrFaust92 force-pushed the filter-well-known-labels branch from 019607b to a3e4bd6 Compare May 16, 2021 15:55
@jrhouston jrhouston merged commit e5b56a9 into hashicorp:main May 17, 2021
@DrFaust92 DrFaust92 deleted the filter-well-known-labels branch May 17, 2021 18:06
dak1n1 pushed a commit that referenced this pull request Jun 2, 2021
Fix perpetual diffs introduced in PR #1253
jrhouston added a commit that referenced this pull request Jun 4, 2021
dak1n1 pushed a commit that referenced this pull request Jun 9, 2021
* Revert "Filter well known labels and annotations (#1253)"

This reverts commit e5b56a9.

* Allow app.kubernetes.io to be user specified
@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 17, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Labels/annotations not being imported through terraform import
2 participants