cilium / cilium

eBPF-based Networking, Security, and Observability
https://cilium.io
Apache License 2.0
19.92k stars 2.92k forks source link

CFP: Remove Deprecated Function Calls #32274

Open nathanjsweet opened 5 months ago

nathanjsweet commented 5 months ago

Running staticcheck on Cilium gives the following list:

daemon/cmd/status.go:279:29: strings.Title has been deprecated since Go 1.18 and an alternative has been available since Go 1.0: The rule Title uses for word boundaries does not handle Unicode punctuation properly. Use golang.org/x/text/cases instead.  (SA1019)
daemon/cmd/status.go:289:37: strings.Title has been deprecated since Go 1.18 and an alternative has been available since Go 1.0: The rule Title uses for word boundaries does not handle Unicode punctuation properly. Use golang.org/x/text/cases instead.  (SA1019)
operator/pkg/gateway-api/gateway_status.go:63:31: gatewayv1.GatewayReasonListenersNotReady is deprecated: Ready is reserved for future use  (SA1019)
operator/pkg/gateway-api/gateway_status.go:77:31: gatewayv1.GatewayReasonReady is deprecated: Ready is reserved for future use  (SA1019)
operator/pkg/gateway-api/gateway_status.go:86:31: gatewayv1.GatewayReasonListenersNotReady is deprecated: Ready is reserved for future use  (SA1019)
operator/pkg/model/translation/gateway-api/translator_fixture_test.go:29:2: "k8s.io/utils/pointer" is deprecated: Use functions in k8s.io/utils/ptr instead: ptr.To to obtain a pointer, ptr.Deref to dereference a pointer, ptr.Equal to compare dereferenced pointers.  (SA1019)
pkg/aws/ec2/ec2.go:91:2: cfg.EndpointResolver is deprecated: See Config.EndpointResolverWithOptions  (SA1019)
pkg/aws/ec2/ec2.go:91:25: aws.EndpointResolverFunc is deprecated: See EndpointResolverWithOptionsFunc  (SA1019)
pkg/aws/eni/limits/limits_test.go:13:2: "k8s.io/utils/pointer" is deprecated: Use functions in k8s.io/utils/ptr instead: ptr.To to obtain a pointer, ptr.Deref to dereference a pointer, ptr.Equal to compare dereferenced pointers.  (SA1019)
pkg/azure/api/api.go:15:2: "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2021-08-01/compute" is deprecated: Please note, this package has been deprecated. A replacement package is available [github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute). We strongly encourage you to upgrade to continue receiving updates. See [Migration Guide](https://aka.ms/azsdk/golang/t2/migration) for guidance on upgrading. Refer to our [deprecation policy](https://azure.github.io/azure-sdk/policies_support.html) for more details. (SA1019)
pkg/azure/api/api.go:16:2: "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network" is deprecated: Please note, this package has been deprecated. A replacement package is available [github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork). We strongly encourage you to upgrade to continue receiving updates. See [Migration Guide](https://aka.ms/azsdk/golang/t2/migration) for guidance on upgrading. Refer to our [deprecation policy](https://azure.github.io/azure-sdk/policies_support.html) for more details. (SA1019)
pkg/bgpv1/agent/controller_test.go:13:2: "k8s.io/utils/pointer" is deprecated: Use functions in k8s.io/utils/ptr instead: ptr.To to obtain a pointer, ptr.Deref to dereference a pointer, ptr.Equal to compare dereferenced pointers.  (SA1019)
pkg/bgpv1/gobgp/peer.go:111:5: n.Neighbor is deprecated: field kept for backward compatibility. (SA1019)
pkg/bgpv1/gobgp/peer.go:116:35: n.Neighbor is deprecated: field kept for backward compatibility. (SA1019)
pkg/bgpv1/gobgp/peer.go:122:22: n.Neighbor is deprecated: field kept for backward compatibility. (SA1019)
pkg/bgpv1/gobgp/peer.go:125:60: n.Neighbor is deprecated: field kept for backward compatibility. (SA1019)
pkg/bgpv1/gobgp/peer.go:130:46: n.Neighbor is deprecated: field kept for backward compatibility. (SA1019)
pkg/bgpv1/gobgp/peer.go:142:5: n.Neighbor is deprecated: field kept for backward compatibility. (SA1019)
pkg/bgpv1/gobgp/peer.go:143:41: n.Neighbor is deprecated: field kept for backward compatibility. (SA1019)
pkg/bgpv1/gobgp/peer.go:143:70: n.Neighbor is deprecated: field kept for backward compatibility. (SA1019)
pkg/bgpv1/gobgp/peer.go:147:32: n.Neighbor is deprecated: field kept for backward compatibility. (SA1019)
pkg/bgpv1/gobgp/peer.go:147:77: n.Neighbor is deprecated: field kept for backward compatibility. (SA1019)
pkg/bgpv1/gobgp/peer.go:147:114: n.Neighbor is deprecated: field kept for backward compatibility. (SA1019)
pkg/bgpv1/gobgp/peer.go:150:5: n.Neighbor is deprecated: field kept for backward compatibility. (SA1019)
pkg/bgpv1/gobgp/peer.go:150:42: n.Neighbor is deprecated: field kept for backward compatibility. (SA1019)
pkg/bgpv1/gobgp/peer.go:151:42: n.Neighbor is deprecated: field kept for backward compatibility. (SA1019)
pkg/bgpv1/gobgp/peer.go:151:90: n.Neighbor is deprecated: field kept for backward compatibility. (SA1019)
pkg/bgpv1/gobgp/peer.go:370:36: n.Neighbor is deprecated: field kept for backward compatibility. (SA1019)
pkg/bgpv1/gobgp/peer.go:383:68: n.Neighbor is deprecated: field kept for backward compatibility. (SA1019)
pkg/bgpv1/gobgp/peer.go:383:92: n.Neighbor is deprecated: field kept for backward compatibility. (SA1019)
pkg/bgpv1/gobgp/state_test.go:13:2: "k8s.io/utils/pointer" is deprecated: Use functions in k8s.io/utils/ptr instead: ptr.To to obtain a pointer, ptr.Deref to dereference a pointer, ptr.Equal to compare dereferenced pointers.  (SA1019)
pkg/bgpv1/manager/manager_test.go:13:2: "k8s.io/utils/pointer" is deprecated: Use functions in k8s.io/utils/ptr instead: ptr.To to obtain a pointer, ptr.Deref to dereference a pointer, ptr.Equal to compare dereferenced pointers.  (SA1019)
pkg/bgpv1/manager/reconciler/neighbor_test.go:13:2: "k8s.io/utils/pointer" is deprecated: Use functions in k8s.io/utils/ptr instead: ptr.To to obtain a pointer, ptr.Deref to dereference a pointer, ptr.Equal to compare dereferenced pointers.  (SA1019)
pkg/bgpv1/manager/reconciler/pod_cidr_test.go:12:2: "k8s.io/utils/pointer" is deprecated: Use functions in k8s.io/utils/ptr instead: ptr.To to obtain a pointer, ptr.Deref to dereference a pointer, ptr.Equal to compare dereferenced pointers.  (SA1019)
pkg/bgpv1/manager/reconciler/preflight_test.go:13:2: "k8s.io/utils/pointer" is deprecated: Use functions in k8s.io/utils/ptr instead: ptr.To to obtain a pointer, ptr.Deref to dereference a pointer, ptr.Equal to compare dereferenced pointers.  (SA1019)
pkg/bgpv1/manager/reconciler/route_policy_test.go:13:2: "k8s.io/utils/pointer" is deprecated: Use functions in k8s.io/utils/ptr instead: ptr.To to obtain a pointer, ptr.Deref to dereference a pointer, ptr.Equal to compare dereferenced pointers.  (SA1019)
pkg/bgpv1/manager/reconciler/service_test.go:13:2: "k8s.io/utils/pointer" is deprecated: Use functions in k8s.io/utils/ptr instead: ptr.To to obtain a pointer, ptr.Deref to dereference a pointer, ptr.Equal to compare dereferenced pointers.  (SA1019)
pkg/bgpv1/test/adverts_test.go:17:2: "k8s.io/utils/pointer" is deprecated: Use functions in k8s.io/utils/ptr instead: ptr.To to obtain a pointer, ptr.Deref to dereference a pointer, ptr.Equal to compare dereferenced pointers.  (SA1019)
pkg/bgpv1/test/fixtures.go:16:2: "k8s.io/utils/pointer" is deprecated: Use functions in k8s.io/utils/ptr instead: ptr.To to obtain a pointer, ptr.Deref to dereference a pointer, ptr.Equal to compare dereferenced pointers.  (SA1019)
pkg/bgpv1/test/neighbor_test.go:15:2: "k8s.io/utils/pointer" is deprecated: Use functions in k8s.io/utils/ptr instead: ptr.To to obtain a pointer, ptr.Deref to dereference a pointer, ptr.Equal to compare dereferenced pointers.  (SA1019)
pkg/bgpv1/types/test_fixtures.go:10:2: "k8s.io/utils/pointer" is deprecated: Use functions in k8s.io/utils/ptr instead: ptr.To to obtain a pointer, ptr.Deref to dereference a pointer, ptr.Equal to compare dereferenced pointers.  (SA1019)
pkg/crypto/certloader/client_test.go:102:18: expectedCaCertPool.Subjects has been deprecated since Go 1.18: if s was returned by [SystemCertPool], Subjects will not include the system roots.  (SA1019)
pkg/crypto/certloader/client_test.go:102:49: tlsConfig.RootCAs.Subjects has been deprecated since Go 1.18: if s was returned by [SystemCertPool], Subjects will not include the system roots.  (SA1019)
pkg/crypto/certloader/client_test.go:174:18: expectedCaCertPool.Subjects has been deprecated since Go 1.18: if s was returned by [SystemCertPool], Subjects will not include the system roots.  (SA1019)
pkg/crypto/certloader/client_test.go:174:49: tlsConfig.RootCAs.Subjects has been deprecated since Go 1.18: if s was returned by [SystemCertPool], Subjects will not include the system roots.  (SA1019)
pkg/crypto/certloader/reloader_test.go:382:21: tt.expectedCaCertPool.Subjects has been deprecated since Go 1.18: if s was returned by [SystemCertPool], Subjects will not include the system roots.  (SA1019)
pkg/crypto/certloader/reloader_test.go:382:55: caCertPool.Subjects has been deprecated since Go 1.18: if s was returned by [SystemCertPool], Subjects will not include the system roots.  (SA1019)
pkg/crypto/certloader/reloader_test.go:459:21: tt.expectedCaCertPool.Subjects has been deprecated since Go 1.18: if s was returned by [SystemCertPool], Subjects will not include the system roots.  (SA1019)
pkg/crypto/certloader/reloader_test.go:459:55: caCertPool.Subjects has been deprecated since Go 1.18: if s was returned by [SystemCertPool], Subjects will not include the system roots.  (SA1019)
pkg/crypto/certloader/reloader_test.go:479:21: tt.expectedCaCertPool.Subjects has been deprecated since Go 1.18: if s was returned by [SystemCertPool], Subjects will not include the system roots.  (SA1019)
pkg/crypto/certloader/reloader_test.go:479:55: caCertPool.Subjects has been deprecated since Go 1.18: if s was returned by [SystemCertPool], Subjects will not include the system roots.  (SA1019)
pkg/crypto/certloader/reloader_test.go:616:21: tt.expectedCaCertPool.Subjects has been deprecated since Go 1.18: if s was returned by [SystemCertPool], Subjects will not include the system roots.  (SA1019)
pkg/crypto/certloader/reloader_test.go:616:55: caCertPool.Subjects has been deprecated since Go 1.18: if s was returned by [SystemCertPool], Subjects will not include the system roots.  (SA1019)
pkg/crypto/certloader/reloader_test.go:631:21: tt.expectedCaCertPool.Subjects has been deprecated since Go 1.18: if s was returned by [SystemCertPool], Subjects will not include the system roots.  (SA1019)
pkg/crypto/certloader/reloader_test.go:631:55: caCertPool.Subjects has been deprecated since Go 1.18: if s was returned by [SystemCertPool], Subjects will not include the system roots.  (SA1019)
pkg/crypto/certloader/reloader_test.go:660:18: expectedCaCertPool.Subjects has been deprecated since Go 1.18: if s was returned by [SystemCertPool], Subjects will not include the system roots.  (SA1019)
pkg/crypto/certloader/reloader_test.go:660:49: caCertPool.Subjects has been deprecated since Go 1.18: if s was returned by [SystemCertPool], Subjects will not include the system roots.  (SA1019)
pkg/crypto/certloader/reloader_test.go:675:18: expectedCaCertPool.Subjects has been deprecated since Go 1.18: if s was returned by [SystemCertPool], Subjects will not include the system roots.  (SA1019)
pkg/crypto/certloader/reloader_test.go:675:49: caCertPool.Subjects has been deprecated since Go 1.18: if s was returned by [SystemCertPool], Subjects will not include the system roots.  (SA1019)
pkg/crypto/certloader/server_test.go:125:18: expectedCaCertPool.Subjects has been deprecated since Go 1.18: if s was returned by [SystemCertPool], Subjects will not include the system roots.  (SA1019)
pkg/crypto/certloader/server_test.go:125:49: tlsConfig.ClientCAs.Subjects has been deprecated since Go 1.18: if s was returned by [SystemCertPool], Subjects will not include the system roots.  (SA1019)
pkg/crypto/certloader/server_test.go:174:18: expectedCaCertPool.Subjects has been deprecated since Go 1.18: if s was returned by [SystemCertPool], Subjects will not include the system roots.  (SA1019)
pkg/crypto/certloader/server_test.go:174:49: tlsConfig.ClientCAs.Subjects has been deprecated since Go 1.18: if s was returned by [SystemCertPool], Subjects will not include the system roots.  (SA1019)
pkg/crypto/certloader/watcher_test.go:46:18: expectedCaCertPool.Subjects has been deprecated since Go 1.18: if s was returned by [SystemCertPool], Subjects will not include the system roots.  (SA1019)
pkg/crypto/certloader/watcher_test.go:46:49: caCertPool.Subjects has been deprecated since Go 1.18: if s was returned by [SystemCertPool], Subjects will not include the system roots.  (SA1019)
pkg/crypto/certloader/watcher_test.go:85:18: expectedCaCertPool.Subjects has been deprecated since Go 1.18: if s was returned by [SystemCertPool], Subjects will not include the system roots.  (SA1019)
pkg/crypto/certloader/watcher_test.go:85:49: caCertPool.Subjects has been deprecated since Go 1.18: if s was returned by [SystemCertPool], Subjects will not include the system roots.  (SA1019)
pkg/crypto/certloader/watcher_test.go:112:18: expectedCaCertPool.Subjects has been deprecated since Go 1.18: if s was returned by [SystemCertPool], Subjects will not include the system roots.  (SA1019)
pkg/crypto/certloader/watcher_test.go:112:49: caCertPool.Subjects has been deprecated since Go 1.18: if s was returned by [SystemCertPool], Subjects will not include the system roots.  (SA1019)
pkg/crypto/certloader/watcher_test.go:150:18: expectedCaCertPool.Subjects has been deprecated since Go 1.18: if s was returned by [SystemCertPool], Subjects will not include the system roots.  (SA1019)
pkg/crypto/certloader/watcher_test.go:150:49: caCertPool.Subjects has been deprecated since Go 1.18: if s was returned by [SystemCertPool], Subjects will not include the system roots.  (SA1019)
pkg/crypto/certloader/watcher_test.go:186:18: expectedInitialCaCertPool.Subjects has been deprecated since Go 1.18: if s was returned by [SystemCertPool], Subjects will not include the system roots.  (SA1019)
pkg/crypto/certloader/watcher_test.go:186:56: caCertPool.Subjects has been deprecated since Go 1.18: if s was returned by [SystemCertPool], Subjects will not include the system roots.  (SA1019)
pkg/crypto/certloader/watcher_test.go:214:18: expectedRotatedCaCertPool.Subjects has been deprecated since Go 1.18: if s was returned by [SystemCertPool], Subjects will not include the system roots.  (SA1019)
pkg/crypto/certloader/watcher_test.go:214:56: caCertPool.Subjects has been deprecated since Go 1.18: if s was returned by [SystemCertPool], Subjects will not include the system roots.  (SA1019)
pkg/envoy/sort.go:221:8: m1.GetExactMatch is deprecated: Do not use.  (SA1019)
pkg/envoy/sort.go:222:8: m2.GetExactMatch is deprecated: Do not use.  (SA1019)
pkg/envoy/sort.go:230:10: m1.GetSafeRegexMatch is deprecated: Do not use.  (SA1019)
pkg/envoy/sort.go:231:10: m2.GetSafeRegexMatch is deprecated: Do not use.  (SA1019)
pkg/envoy/sort.go:275:7: m1.GetPrefixMatch is deprecated: Do not use.  (SA1019)
pkg/envoy/sort.go:276:7: m2.GetPrefixMatch is deprecated: Do not use.  (SA1019)
pkg/envoy/sort.go:284:7: m1.GetSuffixMatch is deprecated: Do not use.  (SA1019)
pkg/envoy/sort.go:285:7: m2.GetSuffixMatch is deprecated: Do not use.  (SA1019)
pkg/health/client/client.go:59:3: tr.Dial has been deprecated since Go 1.7: Use DialContext instead, which allows the transport to cancel dials as soon as they are no longer needed. If both are set, DialContext takes priority.  (SA1019)
pkg/health/client/client.go:64:3: tr.Dial has been deprecated since Go 1.7: Use DialContext instead, which allows the transport to cancel dials as soon as they are no longer needed. If both are set, DialContext takes priority.  (SA1019)
pkg/hubble/observer/local_observer.go:301:8: req.Experimental.GetFieldMask is deprecated: Marked as deprecated in observer/observer.proto.  (SA1019)
pkg/hubble/observer/local_observer_test.go:311:19: out.Summary is deprecated: Marked as deprecated in flow/flow.proto.  (SA1019)
pkg/hubble/observer/local_observer_test.go:313:22: last10Input[i].Summary is deprecated: Marked as deprecated in flow/flow.proto.  (SA1019)
pkg/hubble/parser/fieldmask/fieldmask_test.go:62:17: assert.ObjectsExportedFieldsAreEqual is deprecated: Use [EqualExportedValues] instead.  (SA1019)
pkg/hubble/parser/fieldmask/fieldmask_test.go:65:17: assert.ObjectsExportedFieldsAreEqual is deprecated: Use [EqualExportedValues] instead.  (SA1019)
pkg/hubble/parser/fieldmask/fieldmask_test.go:77:17: assert.ObjectsExportedFieldsAreEqual is deprecated: Use [EqualExportedValues] instead.  (SA1019)
pkg/hubble/parser/fieldmask/fieldmask_test.go:98:17: assert.ObjectsExportedFieldsAreEqual is deprecated: Use [EqualExportedValues] instead.  (SA1019)
pkg/hubble/parser/seven/parser.go:140:2: decoded.DropReason is deprecated: Marked as deprecated in flow/flow.proto.  (SA1019)
pkg/hubble/parser/seven/parser.go:152:2: decoded.Reply is deprecated: Marked as deprecated in flow/flow.proto.  (SA1019)
pkg/hubble/parser/seven/parser.go:159:2: decoded.Summary is deprecated: Marked as deprecated in flow/flow.proto.  (SA1019)
pkg/hubble/parser/sock/parser.go:125:2: decoded.Summary is deprecated: Marked as deprecated in flow/flow.proto.  (SA1019)
pkg/hubble/parser/threefour/parser.go:205:2: decoded.DropReason is deprecated: Marked as deprecated in flow/flow.proto.  (SA1019)
pkg/hubble/parser/threefour/parser.go:206:41: decoded.DropReason is deprecated: Marked as deprecated in flow/flow.proto.  (SA1019)
pkg/hubble/parser/threefour/parser.go:217:2: decoded.Reply is deprecated: Marked as deprecated in flow/flow.proto.  (SA1019)
pkg/hubble/parser/threefour/parser.go:226:2: decoded.Summary is deprecated: Marked as deprecated in flow/flow.proto.  (SA1019)
pkg/hubble/parser/threefour/parser_test.go:496:31: f.GetDropReason is deprecated: Marked as deprecated in flow/flow.proto.  (SA1019)
pkg/hubble/parser/threefour/parser_test.go:518:34: f.GetDropReason is deprecated: Marked as deprecated in flow/flow.proto.  (SA1019)
pkg/hubble/parser/threefour/parser_test.go:789:24: f.GetReply is deprecated: Marked as deprecated in flow/flow.proto.  (SA1019)
pkg/hubble/parser/threefour/parser_test.go:799:25: f.GetReply is deprecated: Marked as deprecated in flow/flow.proto.  (SA1019)
pkg/hubble/parser/threefour/parser_test.go:809:25: f.GetReply is deprecated: Marked as deprecated in flow/flow.proto.  (SA1019)
pkg/hubble/parser/threefour/parser_test.go:820:25: f.GetReply is deprecated: Marked as deprecated in flow/flow.proto.  (SA1019)
pkg/hubble/parser/threefour/parser_test.go:831:25: f.GetReply is deprecated: Marked as deprecated in flow/flow.proto.  (SA1019)
pkg/hubble/parser/threefour/parser_test.go:842:25: f.GetReply is deprecated: Marked as deprecated in flow/flow.proto.  (SA1019)
pkg/hubble/parser/threefour/parser_test.go:853:25: f.GetReply is deprecated: Marked as deprecated in flow/flow.proto.  (SA1019)
pkg/hubble/parser/threefour/parser_test.go:864:25: f.GetReply is deprecated: Marked as deprecated in flow/flow.proto.  (SA1019)
pkg/hubble/parser/threefour/parser_test.go:874:25: f.GetReply is deprecated: Marked as deprecated in flow/flow.proto.  (SA1019)
pkg/hubble/parser/threefour/parser_test.go:883:25: f.GetReply is deprecated: Marked as deprecated in flow/flow.proto.  (SA1019)
pkg/hubble/parser/threefour/parser_test.go:891:25: f.GetReply is deprecated: Marked as deprecated in flow/flow.proto.  (SA1019)
pkg/hubble/relay/server/server_test.go:300:22: f.Summary is deprecated: Marked as deprecated in flow/flow.proto.  (SA1019)
pkg/k8s/apis/cilium.io/v2alpha1/bgpp_types.go:10:2: "k8s.io/utils/pointer" is deprecated: Use functions in k8s.io/utils/ptr instead: ptr.To to obtain a pointer, ptr.Deref to dereference a pointer, ptr.Equal to compare dereferenced pointers.  (SA1019)
pkg/k8s/apis/cilium.io/v2alpha1/bgpp_types_test.go:10:2: "k8s.io/utils/pointer" is deprecated: Use functions in k8s.io/utils/ptr instead: ptr.To to obtain a pointer, ptr.Deref to dereference a pointer, ptr.Equal to compare dereferenced pointers.  (SA1019)
pkg/k8s/apis/crdhelpers/register.go:227:9: wait.Poll is deprecated: This method does not return errors from context, use PollUntilContextTimeout. Note that the new method will no longer return ErrWaitTimeout and instead return errors defined by the context package. Will be removed in a future release.  (SA1019)
pkg/l2announcer/l2announcer_test.go:25:2: "k8s.io/utils/pointer" is deprecated: Use functions in k8s.io/utils/ptr instead: ptr.To to obtain a pointer, ptr.Deref to dereference a pointer, ptr.Equal to compare dereferenced pointers.  (SA1019)
pkg/lock/stoppable_waitgroup_test.go:157:2: rand.Seed has been deprecated since Go 1.20 and an alternative has been available since Go 1.0: As of Go 1.20 there is no reason to call Seed with a random value. Programs that call Seed with a known value to get a specific sequence of results should use New(NewSource(seed)) to obtain a local random generator.  (SA1019)
pkg/node/bootid_linux.go:7:2: "io/ioutil" has been deprecated since Go 1.19: As of Go 1.16, the same functionality is now provided by package [io] or package [os], and those implementations should be preferred in new code. See the specific function documentation for details.  (SA1019)
pkg/wireguard/agent/agent_test.go:105:2: ipCache.Upsert is deprecated: Prefer UpsertLabels() instead.  (SA1019)
pkg/wireguard/agent/agent_test.go:106:2: ipCache.Upsert is deprecated: Prefer UpsertLabels() instead.  (SA1019)
pkg/wireguard/agent/agent_test.go:107:2: ipCache.Upsert is deprecated: Prefer UpsertLabels() instead.  (SA1019)
pkg/wireguard/agent/agent_test.go:108:2: ipCache.Upsert is deprecated: Prefer UpsertLabels() instead.  (SA1019)
pkg/wireguard/agent/agent_test.go:152:3: ipCache.Upsert is deprecated: Prefer UpsertLabels() instead.  (SA1019)
pkg/wireguard/agent/agent_test.go:153:3: ipCache.Upsert is deprecated: Prefer UpsertLabels() instead.  (SA1019)
pkg/wireguard/agent/agent_test.go:155:3: ipCache.Upsert is deprecated: Prefer UpsertLabels() instead.  (SA1019)
pkg/wireguard/agent/agent_test.go:156:3: ipCache.Upsert is deprecated: Prefer UpsertLabels() instead.  (SA1019)
pkg/wireguard/agent/agent_test.go:158:3: ipCache.Delete is deprecated: Prefer RemoveLabels() or RemoveIdentity() instead.  (SA1019)
pkg/wireguard/agent/agent_test.go:159:3: ipCache.Delete is deprecated: Prefer RemoveLabels() or RemoveIdentity() instead.  (SA1019)
pkg/wireguard/agent/agent_test.go:221:2: ipCache.Upsert is deprecated: Prefer UpsertLabels() instead.  (SA1019)
pkg/wireguard/agent/agent_test.go:222:2: ipCache.Upsert is deprecated: Prefer UpsertLabels() instead.  (SA1019)

Cilium should fix these issues as well as create CI that reports deprecated calls.

nathanjsweet commented 5 months ago

Calling deprecated functions is a low-level security risk. It would be better if Cilium kept track of its deprecated function calls somehow (maybe a periodic CI job?) and periodically fixed them.

dmefs commented 5 months ago

Hi @nathanjsweet , I noticed that golangci-lint staticcheck for deprecated method is disabled in .golnagci.yaml. Would it be a good idea to enable staticcheck SA1019 ? https://github.com/cilium/cilium/blob/5cb8a54a58fe700ac41b64711d3e921e7a55d8a0/.golangci.yaml#L86

nathanjsweet commented 5 months ago

Would it be a good idea to enable staticcheck SA1019 ?

No. Even if we magically addressed every deprecated function call right now, at some point the check will break CI. It's better to think of this as a periodic health check that gets addressed. I'll assign this to myself for the time being.

yogesh1801 commented 4 months ago

Can I work on this issue, can you guide me through this, where to start from

nathanjsweet commented 4 months ago

Hey @yogesh1801 , We would love to have your help! The first thing is to create a PR that removes all of these deprecated function calls (maybe one at a time). The second would be to make a workflow for CI that either runs on a monthly schedule to publish a report or to have it be a part of pull request CI. The more I think about this problem, the more I think that we could potentially have it be a part of the pull request workflow, because pull requests will always introduce these problems (even if is a simple library upgrade). However, we need to be careful, because perhaps there are other avenues for deprecated function calls to creep in without a pull request, in which case, we would have broken CI for everyone.

yogesh1801 commented 4 months ago

@nathanjsweet i was trying to remove the depreacted calls, i tried fixing the strings.Title deprecated call using cases, can you tell me how can i test if my fixes are right or not, or should i create a PR straight away. I am planning to remove all deprecated function one by one and then create a CI pipeline for the same.

yogesh1801 commented 4 months ago

image

this is what i did for reference

davchos commented 3 months ago

Hi,

I was looking at a first task, any help needed on this issue ?

Regards

joestringer commented 3 months ago

Hi @davchos , I'm not sure whether all of the individual deprecation warnings were addressed in the codebase, but you could try pulling the latest main branch and verify that. If there are any remaining warnings, we would encourage pull requests to address those warnings.

Additionally, as far as I know, the staticcheck for deprecation warnings isn't integrated into the .github/workflows CI yet. The last part of the description requests for this check to be added into the CI. This could be a separate PR submission.

davchos commented 3 months ago

Hi @joestringer,

Some deprecation warnings are present, I will work on it.

David

davchos commented 2 months ago

Hi @joestringer,

I have some deprecated calls that will be supported throughout 1.x.x, especially for grpc. Can I remove them, when possible ?

I suppose they should be removed.

operator/auth/spire/client.go:179:15: grpc.Dial is deprecated: use NewClient instead. Will be supported throughout 1.x. (SA1019)

Thanks in advance for your help.

David

joestringer commented 2 months ago

Good question, let me cc @cilium/sig-servicemesh specifically since that codepath is related to SPIRE.

I'm not sure how much work it is to overhaul that logic to use NewClient, but if you wanted to try switching it over then you're welcome to give it a go. If you think that it seems viable to switch this code over then we can go through review for that PR to confirm it's a path we want to use. As a backup we could always add nolint tags, but that will only kick the can further down the road until we eventually do want to switch the library over. Presumably the warning is there to give us notice that 1.x will eventually be retired and then we'll need to switch the library over to continue receiving updates.

davchos commented 2 months ago

@joestringer, ok I'll try the switch.

David