diff --git a/CODE-OF-CONDUCT.md b/CODE-OF-CONDUCT.md index d276fa06..edd2505f 100644 --- a/CODE-OF-CONDUCT.md +++ b/CODE-OF-CONDUCT.md @@ -1,3 +1,3 @@ # Community Code of Conduct -CNI follows the [CNCF Code of Conduct](https://github.com/cncf/foundation/blob/master/code-of-conduct.md). +CNI follows the [CNCF Code of Conduct](https://github.com/cncf/foundation/blob/main/code-of-conduct.md). diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a8dd09f4..2072e192 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -34,7 +34,7 @@ are very busy and read the mailing lists. This is a rough outline of how to prepare a contribution: -- Create a topic branch from where you want to base your work (usually branched from master). +- Create a topic branch from where you want to base your work (usually branched from main). - Make commits of logical units. - Make sure your commit messages are in the proper format (see below). - Push your changes to a topic branch in your fork of the repository. diff --git a/CONVENTIONS.md b/CONVENTIONS.md index 41451f24..7f6b4acb 100644 --- a/CONVENTIONS.md +++ b/CONVENTIONS.md @@ -20,7 +20,7 @@ Establishing these conventions allows plugins to work across multiple runtimes. Additional conventions can be created by creating PRs which modify this document. ## Dynamic Plugin specific fields (Capabilities / Runtime Configuration) -[Plugin specific fields](https://github.com/containernetworking/cni/blob/master/SPEC.md#network-configuration) formed part of the original CNI spec and have been present since the initial release. +[Plugin specific fields](SPEC.md#network-configuration) formed part of the original CNI spec and have been present since the initial release. > Plugins may define additional fields that they accept and may generate an error if called with unknown fields. The exception to this is the args field may be used to pass arbitrary data which may be ignored by plugins. A plugin can define any additional fields it needs to work properly. It should return an error if it can't act on fields that were expected or where the field values were malformed. @@ -32,7 +32,7 @@ This method of passing information to a plugin is recommended when the following Dynamic information (i.e. data that a runtime fills out) should be placed in a `runtimeConfig` section. Plugins can request that the runtime insert this dynamic configuration by explicitly listing their `capabilities` in the network configuration. -For example, the configuration for a port mapping plugin might look like this to an operator (it should be included as part of a [network configuration list](https://github.com/containernetworking/cni/blob/master/SPEC.md#network-configuration-lists). +For example, the configuration for a port mapping plugin might look like this to an operator (it should be included as part of a [network configuration list](SPEC.md#network-configuration-lists). ```json { "name" : "ExamplePlugin", @@ -69,7 +69,7 @@ But the runtime would fill in the mappings so the plugin itself would receive so | cgroup path | Provide the cgroup path for pod as requested by CNI plugins. | `cgroupPath` | `cgroupPath` (string entry).
"/kubelet.slice/kubelet-kubepods.slice/kubelet-kubepods-burstable.slice/kubelet-kubepods-burstable-pod28ce45bc_63f8_48a3_a99b_cfb9e63c856c.slice" 
| none | CNI `host-local` plugin | ## "args" in network config -`args` in [network config](https://github.com/containernetworking/cni/blob/master/SPEC.md#network-configuration) were reserved as a field in the `0.2.0` release of the CNI spec. +`args` in [network config](SPEC.md#network-configuration) were reserved as a field in the `0.2.0` release of the CNI spec. > args (dictionary): Optional additional arguments provided by the container runtime. For example a dictionary of labels could be passed to CNI plugins by adding them to a labels field under args. `args` provide a way of providing more structured data than the flat strings that CNI_ARGS can support. diff --git a/Documentation/spec-upgrades.md b/Documentation/spec-upgrades.md index ad5c7707..64e2c4c9 100644 --- a/Documentation/spec-upgrades.md +++ b/Documentation/spec-upgrades.md @@ -64,12 +64,12 @@ ensure that the configuration files specify a `cniVersion` field and that the version there is supported by your container runtime and CNI plugins. Configuration files without a version field should be given version 0.2.0. The CNI spec includes example configuration files for -[single plugins](https://github.com/containernetworking/cni/blob/master/SPEC.md#example-configurations) -and for [lists of chained plugins](https://github.com/containernetworking/cni/blob/master/SPEC.md#example-configurations). +[single plugins](SPEC.md#example-configurations) +and for [lists of chained plugins](SPEC.md#example-configurations). Consult the documentation for your runtime and plugins to determine what CNI spec versions they support. Test any plugin upgrades before deploying to -production. You may find [cnitool](https://github.com/containernetworking/cni/tree/master/cnitool) +production. You may find [cnitool](https://github.com/containernetworking/cni/tree/main/cnitool) useful. Specifically, your configuration version should be the lowest common version supported by your plugins. @@ -94,7 +94,7 @@ command with the following JSON data: ``` Second, for the `ADD` command, a plugin must respect the `cniVersion` field -provided in the [network configuration JSON](https://github.com/containernetworking/cni/blob/master/SPEC.md#network-configuration). +provided in the [network configuration JSON](SPEC.md#network-configuration). That field is a request for the plugin to return results of a particular format: - If the `cniVersion` field is not present, then spec v0.2.0 should be assumed @@ -102,11 +102,11 @@ That field is a request for the plugin to return results of a particular format: - If the plugin doesn't support the version, the plugin must error. -- Otherwise, the plugin must return a [CNI Result](https://github.com/containernetworking/cni/blob/master/SPEC.md#result) +- Otherwise, the plugin must return a [CNI Result](SPEC.md#result) in the format requested. Result formats for older CNI spec versions are available in the -[git history for SPEC.md](https://github.com/containernetworking/cni/commits/master/SPEC.md). +[git history for SPEC.md](https://github.com/containernetworking/cni/commits/main/SPEC.md). For example, suppose a plugin, via its `VERSION` response, advertises CNI specification support for v0.2.0 and v0.3.0. When it receives `cniVersion` key of `0.2.0`, @@ -182,7 +182,7 @@ result, err := current.NewResultFromResult(ipamResult) ``` Other examples of spec v0.3.0-compatible plugins are the -[main plugins in this repo](https://github.com/containernetworking/plugins/tree/master/plugins) +[main plugins in this repo](https://github.com/containernetworking/plugins/) ## For Runtime Authors @@ -203,15 +203,15 @@ call both new and legacy plugins, and handle the results from either. When calling a plugin, the runtime must request that the plugin respond in a particular format by specifying the `cniVersion` field in the -[Network Configuration](https://github.com/containernetworking/cni/blob/master/SPEC.md#network-configuration) +[Network Configuration](SPEC.md#network-configuration) JSON block. The plugin will then respond with -a [Result](https://github.com/containernetworking/cni/blob/master/SPEC.md#result) +a [Result](SPEC.md#result) in the format defined by that CNI spec version, and the runtime must parse and handle this result. #### Handle errors due to version incompatibility Plugins may respond with error indicating that they don't support the requested -CNI version (see [Well-known Error Codes](https://github.com/containernetworking/cni/blob/master/SPEC.md#well-known-error-codes)), +CNI version (see [Well-known Error Codes](SPEC.md#well-known-error-codes)), e.g. ```json { diff --git a/RELEASING.md b/RELEASING.md index 739d7f0d..51c2f33b 100644 --- a/RELEASING.md +++ b/RELEASING.md @@ -21,7 +21,7 @@ Creating a new release produces the following artifacts: ## Creating the release artifacts -1. Make sure you are on the master branch and don't have any local uncommitted changes. +1. Make sure you are on the main branch and don't have any local uncommitted changes. 1. Create a signed tag for the release `git tag -s $VERSION` (Ensure that GPG keys are created and added to GitHub) 1. Run the release script from the root of the repository diff --git a/libcni/api.go b/libcni/api.go index f6b86c1d..e004aa94 100644 --- a/libcni/api.go +++ b/libcni/api.go @@ -15,7 +15,7 @@ package libcni // Note this is the actual implementation of the CNI specification, which -// is reflected in the https://github.com/containernetworking/cni/blob/master/SPEC.md file +// is reflected in the SPEC.md file. // it is typically bundled into runtime providers (i.e. containerd or cri-o would use this // before calling runc or hcsshim). It is also bundled into CNI providers as well, for example, // to add an IP to a container, to parse the configuration of the CNI and so on. diff --git a/pkg/skel/skel_test.go b/pkg/skel/skel_test.go index 3c4f864f..52795240 100644 --- a/pkg/skel/skel_test.go +++ b/pkg/skel/skel_test.go @@ -277,7 +277,7 @@ var _ = Describe("dispatching to the correct callback", func() { It("immediately returns a useful error", func() { err := dispatch.pluginMain(funcs, versionInfo, "") - Expect(err.Code).To(Equal(types.ErrIncompatibleCNIVersion)) // see https://github.com/containernetworking/cni/blob/master/SPEC.md#well-known-error-codes + Expect(err.Code).To(Equal(types.ErrIncompatibleCNIVersion)) // see https://github.com/containernetworking/cni/blob/main/SPEC.md#well-known-error-codes Expect(err.Msg).To(Equal("incompatible CNI versions")) Expect(err.Details).To(Equal(`config is "0.1.0", plugin supports ["4.3.2"]`)) }) @@ -347,7 +347,7 @@ var _ = Describe("dispatching to the correct callback", func() { It("immediately returns a useful error", func() { dispatch.Stdin = strings.NewReader(`{ "name": "skel-test", "cniVersion": "0.3.0", "some": "config" }`) err := dispatch.pluginMain(funcs, versionInfo, "") - Expect(err.Code).To(Equal(types.ErrIncompatibleCNIVersion)) // see https://github.com/containernetworking/cni/blob/master/SPEC.md#well-known-error-codes + Expect(err.Code).To(Equal(types.ErrIncompatibleCNIVersion)) // see https://github.com/containernetworking/cni/blob/main/SPEC.md#well-known-error-codes Expect(err.Msg).To(Equal("config version does not allow CHECK")) Expect(cmdAdd.CallCount).To(Equal(0)) Expect(cmdCheck.CallCount).To(Equal(0)) @@ -360,7 +360,7 @@ var _ = Describe("dispatching to the correct callback", func() { dispatch.Stdin = strings.NewReader(`{ "name": "skel-test", "cniVersion": "0.4.0", "some": "config" }`) versionInfo = version.PluginSupports("0.1.0", "0.2.0", "0.3.0") err := dispatch.pluginMain(funcs, versionInfo, "") - Expect(err.Code).To(Equal(types.ErrIncompatibleCNIVersion)) // see https://github.com/containernetworking/cni/blob/master/SPEC.md#well-known-error-codes + Expect(err.Code).To(Equal(types.ErrIncompatibleCNIVersion)) // see https://github.com/containernetworking/cni/blob/main/SPEC.md#well-known-error-codes Expect(err.Msg).To(Equal("plugin version does not allow CHECK")) Expect(cmdAdd.CallCount).To(Equal(0)) Expect(cmdCheck.CallCount).To(Equal(0)) @@ -476,7 +476,7 @@ var _ = Describe("dispatching to the correct callback", func() { It("immediately returns a useful error", func() { dispatch.Stdin = strings.NewReader(`{ "name": "skel-test", "cniVersion": "0.3.0", "some": "config" }`) err := dispatch.pluginMain(funcs, versionInfo, "") - Expect(err.Code).To(Equal(types.ErrIncompatibleCNIVersion)) // see https://github.com/containernetworking/cni/blob/master/SPEC.md#well-known-error-codes + Expect(err.Code).To(Equal(types.ErrIncompatibleCNIVersion)) // see https://github.com/containernetworking/cni/blob/main/SPEC.md#well-known-error-codes Expect(err.Msg).To(Equal("config version does not allow GC")) Expect(cmdGC.CallCount).To(Equal(0)) }) @@ -487,7 +487,7 @@ var _ = Describe("dispatching to the correct callback", func() { dispatch.Stdin = strings.NewReader(`{ "name": "skel-test", "cniVersion": "1.1.0", "some": "config" }`) versionInfo = version.PluginSupports("0.1.0", "0.2.0", "0.3.0") err := dispatch.pluginMain(funcs, versionInfo, "") - Expect(err.Code).To(Equal(types.ErrIncompatibleCNIVersion)) // see https://github.com/containernetworking/cni/blob/master/SPEC.md#well-known-error-codes + Expect(err.Code).To(Equal(types.ErrIncompatibleCNIVersion)) // see https://github.com/containernetworking/cni/blob/main/SPEC.md#well-known-error-codes Expect(err.Msg).To(Equal("plugin version does not allow GC")) Expect(cmdGC.CallCount).To(Equal(0)) }) diff --git a/pkg/types/types.go b/pkg/types/types.go index 62ee7481..0e92e271 100644 --- a/pkg/types/types.go +++ b/pkg/types/types.go @@ -149,7 +149,7 @@ func (r *Route) Copy() *Route { } // Well known error codes -// see https://github.com/containernetworking/cni/blob/master/SPEC.md#well-known-error-codes +// see https://github.com/containernetworking/cni/blob/main/SPEC.md#well-known-error-codes const ( ErrUnknown uint = iota // 0 ErrIncompatibleCNIVersion // 1