Skip to content

Commit 1776eed

Browse files
committed
[RFC-007] Flux cmd support for GitHub provider: This commit includes the following changes -
- Add flux create secret githubapp command that accepts and validates the inputs to create a github app secret with options to export the secret yaml or create the secret directly in the Kubernetes cluster - Add tests for flux create secret githubapp command - Add flux create source git command that accepts and validates the inputs to create a gitrepository source with for github provider with options to export the source yaml or create the github gitrepository source directly in the Kubernetes cluster. - Add tests for flux create source git command for github provider. Signed-off-by: Dipti Pai <[email protected]>
1 parent 13b1d19 commit 1776eed

13 files changed

+356
-5
lines changed

cmd/flux/create_secret_github_app.go

+128
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
/*
2+
Copyright 2024 The Flux authors
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
17+
package main
18+
19+
import (
20+
"context"
21+
"fmt"
22+
"os"
23+
24+
"github.com/fluxcd/flux2/v2/internal/utils"
25+
"github.com/fluxcd/flux2/v2/pkg/manifestgen/sourcesecret"
26+
"github.com/spf13/cobra"
27+
corev1 "k8s.io/api/core/v1"
28+
"sigs.k8s.io/yaml"
29+
)
30+
31+
var createSecretGitHubAppCmd = &cobra.Command{
32+
Use: "githubapp [name]",
33+
Short: "Create or update a github app secret",
34+
Long: withPreviewNote(`The create secret githubapp command generates a Kubernetes secret that can be used for GitRepository authentication with github app`),
35+
Example: ` # Create a githubapp authentication secret on disk and encrypt it with Mozilla SOPS
36+
flux create secret githubapp podinfo-auth \
37+
--app-id="1" \
38+
--app-installation-id="2" \
39+
--app-private-key=./private-key-file.pem \
40+
--export > githubapp-auth.yaml
41+
42+
sops --encrypt --encrypted-regex '^(data|stringData)$' \
43+
--in-place githubapp-auth.yaml
44+
`,
45+
RunE: createSecretGitHubAppCmdRun,
46+
}
47+
48+
type secretGitHubAppFlags struct {
49+
appID string
50+
appInstallationID string
51+
privateKeyFile string
52+
baseURL string
53+
}
54+
55+
var secretGitHubAppArgs = secretGitHubAppFlags{}
56+
57+
func init() {
58+
createSecretGitHubAppCmd.Flags().StringVar(&secretGitHubAppArgs.appID, "app-id", "", "github app ID")
59+
createSecretGitHubAppCmd.Flags().StringVar(&secretGitHubAppArgs.appInstallationID, "app-installation-id", "", "github app installation ID")
60+
createSecretGitHubAppCmd.Flags().StringVar(&secretGitHubAppArgs.privateKeyFile, "app-private-key", "", "github app private key file path")
61+
createSecretGitHubAppCmd.Flags().StringVar(&secretGitHubAppArgs.baseURL, "app-base-url", "", "github app base URL")
62+
63+
createSecretCmd.AddCommand(createSecretGitHubAppCmd)
64+
}
65+
66+
func createSecretGitHubAppCmdRun(cmd *cobra.Command, args []string) error {
67+
if len(args) < 1 {
68+
return fmt.Errorf("name is required")
69+
}
70+
71+
secretName := args[0]
72+
73+
if secretGitHubAppArgs.appID == "" {
74+
return fmt.Errorf("--app-id is required")
75+
}
76+
77+
if secretGitHubAppArgs.appInstallationID == "" {
78+
return fmt.Errorf("--app-installation-id is required")
79+
}
80+
81+
if secretGitHubAppArgs.privateKeyFile == "" {
82+
return fmt.Errorf("--app-private-key is required")
83+
}
84+
85+
privateKey, err := os.ReadFile(secretGitHubAppArgs.privateKeyFile)
86+
if err != nil {
87+
return fmt.Errorf("unable to read private key file: %w", err)
88+
}
89+
90+
opts := sourcesecret.Options{
91+
Name: secretName,
92+
Namespace: *kubeconfigArgs.Namespace,
93+
GitHubAppID: secretGitHubAppArgs.appID,
94+
GitHubAppInstallationID: secretGitHubAppArgs.appInstallationID,
95+
GitHubAppPrivateKey: string(privateKey),
96+
}
97+
98+
if secretGitHubAppArgs.baseURL != "" {
99+
opts.GitHubAppBaseURL = secretGitHubAppArgs.baseURL
100+
}
101+
102+
secret, err := sourcesecret.Generate(opts)
103+
if err != nil {
104+
return err
105+
}
106+
107+
if createArgs.export {
108+
rootCmd.Println(secret.Content)
109+
return nil
110+
}
111+
112+
ctx, cancel := context.WithTimeout(context.Background(), rootArgs.timeout)
113+
defer cancel()
114+
kubeClient, err := utils.KubeClient(kubeconfigArgs, kubeclientOptions)
115+
if err != nil {
116+
return err
117+
}
118+
var s corev1.Secret
119+
if err := yaml.Unmarshal([]byte(secret.Content), &s); err != nil {
120+
return err
121+
}
122+
if err := upsertSecret(ctx, kubeClient, s); err != nil {
123+
return err
124+
}
125+
126+
logger.Actionf("githubapp secret '%s' created in '%s' namespace", secretName, *kubeconfigArgs.Namespace)
127+
return nil
128+
}
+74
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
/*
2+
Copyright 2022 The Flux authors
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
17+
package main
18+
19+
import (
20+
"testing"
21+
)
22+
23+
func TestCreateSecretGitHubApp(t *testing.T) {
24+
tests := []struct {
25+
name string
26+
args string
27+
assert assertFunc
28+
}{
29+
{
30+
name: "create githubapp secret with missing name",
31+
args: "create secret githubapp",
32+
assert: assertError("name is required"),
33+
},
34+
{
35+
name: "create githubapp secret with missing app-id",
36+
args: "create secret githubapp appinfo",
37+
assert: assertError("--app-id is required"),
38+
},
39+
{
40+
name: "create githubapp secret with missing appInstallationID",
41+
args: "create secret githubapp appinfo --app-id 1",
42+
assert: assertError("--app-installation-id is required"),
43+
},
44+
{
45+
name: "create githubapp secret with missing private key file",
46+
args: "create secret githubapp appinfo --app-id 1 --app-installation-id 2",
47+
assert: assertError("--app-private-key is required"),
48+
},
49+
{
50+
name: "create githubapp secret with private key file that does not exist",
51+
args: "create secret githubapp appinfo --app-id 1 --app-installation-id 2 --app-private-key pk.pem",
52+
assert: assertError("unable to read private key file: open pk.pem: no such file or directory"),
53+
},
54+
{
55+
name: "create githubapp secret with app info",
56+
args: "create secret githubapp appinfo --namespace my-namespace --app-id 1 --app-installation-id 2 --app-private-key ./testdata/create_secret/githubapp/test-private-key.pem --export",
57+
assert: assertGoldenFile("testdata/create_secret/githubapp/secret.yaml"),
58+
},
59+
{
60+
name: "create githubapp secret with appinfo and base url",
61+
args: "create secret githubapp appinfo --namespace my-namespace --app-id 1 --app-installation-id 2 --app-private-key ./testdata/create_secret/githubapp/test-private-key.pem --app-base-url www.example.com/api/v3 --export",
62+
assert: assertGoldenFile("testdata/create_secret/githubapp/secret-with-baseurl.yaml"),
63+
},
64+
}
65+
for _, tt := range tests {
66+
t.Run(tt.name, func(t *testing.T) {
67+
cmd := cmdTestCase{
68+
args: tt.args,
69+
assert: tt.assert,
70+
}
71+
cmd.runTestCmd(t)
72+
})
73+
}
74+
}

cmd/flux/create_source_git.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ func init() {
145145
createSourceGitCmd.Flags().Var(&sourceGitArgs.keyAlgorithm, "ssh-key-algorithm", sourceGitArgs.keyAlgorithm.Description())
146146
createSourceGitCmd.Flags().Var(&sourceGitArgs.keyRSABits, "ssh-rsa-bits", sourceGitArgs.keyRSABits.Description())
147147
createSourceGitCmd.Flags().Var(&sourceGitArgs.keyECDSACurve, "ssh-ecdsa-curve", sourceGitArgs.keyECDSACurve.Description())
148-
createSourceGitCmd.Flags().StringVar(&sourceGitArgs.secretRef, "secret-ref", "", "the name of an existing secret containing SSH or basic credentials")
148+
createSourceGitCmd.Flags().StringVar(&sourceGitArgs.secretRef, "secret-ref", "", "the name of an existing secret containing SSH or basic credentials or github app authentication")
149149
createSourceGitCmd.Flags().StringVar(&sourceGitArgs.proxySecretRef, "proxy-secret-ref", "", "the name of an existing secret containing the proxy address and credentials")
150150
createSourceGitCmd.Flags().Var(&sourceGitArgs.provider, "provider", sourceGitArgs.provider.Description())
151151
createSourceGitCmd.Flags().StringVar(&sourceGitArgs.caFile, "ca-file", "", "path to TLS CA file used for validating self-signed certificates")

cmd/flux/create_source_git_test.go

+6-1
Original file line numberDiff line numberDiff line change
@@ -144,10 +144,15 @@ func TestCreateSourceGitExport(t *testing.T) {
144144
args: "create source git podinfo --namespace=flux-system --url=https://dev.azure.com/foo/bar/_git/podinfo --provider azure --branch=test --interval=1m0s --export",
145145
assert: assertGoldenFile("testdata/create_source_git/source-git-provider-azure.yaml"),
146146
},
147+
{
148+
name: "source with github provider",
149+
args: "create source git podinfo --namespace=flux-system --url=https://github.com/stefanprodan/podinfo --provider github --branch=test --interval=1m0s --secret-ref appinfo --export",
150+
assert: assertGoldenFile("testdata/create_source_git/source-git-provider-github.yaml"),
151+
},
147152
{
148153
name: "source with invalid provider",
149154
args: "create source git podinfo --namespace=flux-system --url=https://dev.azure.com/foo/bar/_git/podinfo --provider dummy --branch=test --interval=1m0s --export",
150-
assert: assertError("invalid argument \"dummy\" for \"--provider\" flag: source Git provider 'dummy' is not supported, must be one of: generic|azure"),
155+
assert: assertError("invalid argument \"dummy\" for \"--provider\" flag: source Git provider 'dummy' is not supported, must be one of: generic|azure|github"),
151156
},
152157
{
153158
name: "source with empty provider",
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
---
2+
apiVersion: v1
3+
kind: Secret
4+
metadata:
5+
name: appinfo
6+
namespace: my-namespace
7+
stringData:
8+
githubAppBaseURL: www.example.com/api/v3
9+
githubAppID: "1"
10+
githubAppInstallationID: "2"
11+
githubAppPrivateKey: |-
12+
-----BEGIN RSA PRIVATE KEY-----
13+
YcE2CgWILk+uiVNseHnOU2frG7k2RJZtdDo8GNI6pQWFlwU/NsQoJBrtEDyYVkap
14+
PLv7VoJ2pr6l5IEwH++naL2Mcu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gE1/SjwfgEjm8kJ/cj/wEjq8PaK4FMhAScf46p5blpJoei6zucQL8U9n
31+
lbD102oXw9lUefVI0McyQIN9J58ewDC79AG7gU/fTSt6F75OeFLOJmoedQo33Y+s
32+
dNhf6gsKwQD3x4aluKSn6QKBgD8HbvBAKV6P4vIiFzS0QvWtpeKam2EDHI+h+WsP
33+
nD77QoG/EPvpjJS9/KWgZRPz6U+0M5V0y73MZVzkbbVT/uwfgF2G91lXAr4Kfuh5
34+
w1LWDm09+8WSIk9KgYMoBceAqH+b9DU7hrMFrKkO/cr0Mijr1somv6B3MG83WUcB
35+
qCEDAoGACl8ClvMJR2uNWdaWnCz9tyPdHYgEusJ0OIP+WUY2ToYQWSlA0zNpc21Y
36+
lbD102oXw9lUefVI0McyQIN9J58ewDC79AG7gU/fTSt6F75OeFLOJmoedQo33Y+s
37+
bUytJtOhHbLRNxwgalhjBUNWICrDktqJmumNOEOOPBqVz7RGwUg=
38+
-----END RSA PRIVATE KEY-----
39+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
apiVersion: v1
3+
kind: Secret
4+
metadata:
5+
name: appinfo
6+
namespace: my-namespace
7+
stringData:
8+
githubAppID: "1"
9+
githubAppInstallationID: "2"
10+
githubAppPrivateKey: |-
11+
-----BEGIN RSA PRIVATE KEY-----
12+
YcE2CgWILk+uiVNseHnOU2frG7k2RJZtdDo8GNI6pQWFlwU/NsQoJBrtEDyYVkap
13+
PLv7VoJ2pr6l5IEwH++naL2McuCcwhW/CeaVb/IuSCFFMwb40zRrlqp6IB5VkMhm
14+
zSde2KD/ilB1YUhaAv0qaBHLTGBvVgxut1eIyvqVC+ArWoqJ7rQTst+Arp3UAiIm
15+
LsXqL2iZvVvCH0FiDwBIfxAMhl6fnPzuQsZBiRLPdD67jubPseN1P5JBRw3WTton
16+
Fa2RLLByuyge7bWh2o1hjEx2w2ZpIhosQRyDs1sPXP5TI92RzOcx1CZaTZ6V5E+T
17+
MROFeZmxBHYon1Y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WDm09+8WSIk9KgYMoBceAqH+b9DU7hrMFrKkO/cr0Mijr1somv6B3MG83WUcB
34+
qCEDAoGACl8ClvMJR2uNWdaWnCz9tyPdHYgEusJ0OIP+WUY2ToYQWSlA0zNpc21Y
35+
lbD102oXw9lUefVI0McyQIN9J58ewDC79AG7gU/fTSt6F75OeFLOJmoedQo33Y+s
36+
bUytJtOhHbLRNxwgalhjBUNWICrDktqJmumNOEOOPBqVz7RGwUg=
37+
-----END RSA PRIVATE KEY-----
38+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
-----BEGIN RSA PRIVATE KEY-----
2+
YcE2CgWILk+uiVNseHnOU2frG7k2RJZtdDo8GNI6pQWFlwU/NsQoJBrtEDyYVkap
3+
PLv7VoJ2pr6l5IEwH++naL2McuCcwhW/CeaVb/IuSCFFMwb40zRrlqp6IB5VkMhm
4+
zSde2KD/ilB1YUhaAv0qaBHLTGBvVgxut1eIyvqVC+ArWoqJ7rQTst+Arp3UAiIm
5+
LsXqL2iZvVvCH0FiDwBIfxAMhl6fnPzuQsZBiRLPdD67jubPseN1P5JBRw3WTton
6+
Fa2RLLByuyge7bWh2o1hjEx2w2ZpIhosQRyDs1sPXP5TI92RzOcx1CZaTZ6V5E+T
7+
MROFeZmxBHYon1Y4Rw+jCSXovNyHbMBpMI67nwIDAQABAoIBAC4UrkusU8r7ilFu
8+
w1LWDm09+8WSIk9KgYMoBceAqH+b9DU7hrMFrKkO/cr0Mijr1somv6B3MG83WUcB
9+
FkhEBrwXKnh499iiO/SUo+7kaq0WLQ7mQ2Q9wpMmkkjnr0tgydAno/uNNITSaqmk
10+
YcE2CgWILk+uiVNseHnOU2frG7k2RJZtdDo8GNI6pQWFlwU/NsQoJBrtEDyYVkap
11+
Fa2RLLByuyge7bWh2o1hjEx2w2ZpIhosQRyDs1sPXP5TI92RzOcx1CZaTZ6V5E+T
12+
zSde2KD/ilB1YUhaAv0qaBHLTGBvVgxut1eIyvqVC+ArWoqJ7rQTst+Arp3UAiIm
13+
ihlXNkECgYEA3abZJZuVarHPlAqRYkprs0O+DrP6sPlmVQp+nq8y3Qg00U+N7AuP
14+
Y1riLo3gWq7LajkGTygWLmru2mhWsETxt+R4BtnREUq8kDEoCfEwPlHfqfphvBZL
15+
j5eL60QTKAqSOVqMgIzqJyxa5FGgPGqWpLDLopyVeoyNdZwcuCQzFgkCgYEA25dm
16+
PLv7VoJ2pr6l5IEwH++naL2McuCcwhW/CeaVb/IuSCFFMwb40zRrlqp6IB5VkMhm
17+
MkvaCGIAH+lfJrtTSujFaOIGFy+0ZwP+LNqHUKih14y8Qv9dEP0kaXkAD3fO3Y97
18+
Nj+Q2c06JpojgBKBMwVvT7M53w9KEoNKpoKBbmcCgYBelHyiRJJsdbVKyXuiAnmU
19+
g/qMkZYOgE1/SjwfgEjm8kJ/cj/wEjq8PaK4FMhAScf46p5blpJoei6zucQL8U9n
20+
lbD102oXw9lUefVI0McyQIN9J58ewDC79AG7gU/fTSt6F75OeFLOJmoedQo33Y+s
21+
dNhf6gsKwQD3x4aluKSn6QKBgD8HbvBAKV6P4vIiFzS0QvWtpeKam2EDHI+h+WsP
22+
nD77QoG/EPvpjJS9/KWgZRPz6U+0M5V0y73MZVzkbbVT/uwfgF2G91lXAr4Kfuh5
23+
w1LWDm09+8WSIk9KgYMoBceAqH+b9DU7hrMFrKkO/cr0Mijr1somv6B3MG83WUcB
24+
qCEDAoGACl8ClvMJR2uNWdaWnCz9tyPdHYgEusJ0OIP+WUY2ToYQWSlA0zNpc21Y
25+
lbD102oXw9lUefVI0McyQIN9J58ewDC79AG7gU/fTSt6F75OeFLOJmoedQo33Y+s
26+
bUytJtOhHbLRNxwgalhjBUNWICrDktqJmumNOEOOPBqVz7RGwUg=
27+
-----END RSA PRIVATE KEY-----
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
apiVersion: source.toolkit.fluxcd.io/v1
3+
kind: GitRepository
4+
metadata:
5+
name: podinfo
6+
namespace: flux-system
7+
spec:
8+
interval: 1m0s
9+
provider: github
10+
ref:
11+
branch: test
12+
secretRef:
13+
name: appinfo
14+
url: https://github.com/stefanprodan/podinfo

go.mod

+3-1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ require (
1919
github.com/fluxcd/notification-controller/api v1.4.0
2020
github.com/fluxcd/pkg/apis/event v0.16.0
2121
github.com/fluxcd/pkg/apis/meta v1.10.0
22+
github.com/fluxcd/pkg/auth v0.3.0
2223
github.com/fluxcd/pkg/chartutil v1.2.0
2324
github.com/fluxcd/pkg/envsubst v1.3.0
2425
github.com/fluxcd/pkg/git v0.24.0
@@ -119,7 +120,6 @@ require (
119120
github.com/felixge/httpsnoop v1.0.4 // indirect
120121
github.com/fluxcd/pkg/apis/acl v0.6.0 // indirect
121122
github.com/fluxcd/pkg/apis/kustomize v1.9.0 // indirect
122-
github.com/fluxcd/pkg/auth v0.3.0 // indirect
123123
github.com/fsnotify/fsnotify v1.8.0 // indirect
124124
github.com/fxamacker/cbor/v2 v2.7.0 // indirect
125125
github.com/go-asn1-ber/asn1-ber v1.5.7 // indirect
@@ -262,3 +262,5 @@ require (
262262
sigs.k8s.io/json v0.0.0-20241014173422-cfa47c3a1cc8 // indirect
263263
sigs.k8s.io/structured-merge-diff/v4 v4.5.0 // indirect
264264
)
265+
266+
replace github.com/fluxcd/source-controller/api => github.com/dipti-pai/source-controller/api v0.0.0-20241206221000-1c2538935aba

go.sum

+2-2
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,8 @@ github.com/davidmz/go-pageant v1.0.2 h1:bPblRCh5jGU+Uptpz6LgMZGD5hJoOt7otgT454Wv
120120
github.com/davidmz/go-pageant v1.0.2/go.mod h1:P2EDDnMqIwG5Rrp05dTRITj9z2zpGcD9efWSkTNKLIE=
121121
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78=
122122
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc=
123+
github.com/dipti-pai/source-controller/api v0.0.0-20241206221000-1c2538935aba h1:GlNoJn0a0DcLBFcZr8mC75+09lZrTEBjKSQNmcjmtuk=
124+
github.com/dipti-pai/source-controller/api v0.0.0-20241206221000-1c2538935aba/go.mod h1:0lo5XmaerQ3tncMQKSqWwNOJo75AeXqaBCL1Qx55gX4=
123125
github.com/distribution/distribution/v3 v3.0.0-rc.2 h1:tTrzntanYMbd20SyvdeR83Ya1l/aBwDcA3NCIpmwemc=
124126
github.com/distribution/distribution/v3 v3.0.0-rc.2/go.mod h1:H2zIRRXS20ylnv2HTuKILAWuANjuA60GB7MLOsQag7Y=
125127
github.com/distribution/reference v0.6.0 h1:0IXCQ5g4/QMHHkarYzh5l+u8T3t73zM5QvfrDyIgxBk=
@@ -202,8 +204,6 @@ github.com/fluxcd/pkg/tar v0.11.0 h1:pjf/rzr6HNAPiuxT59mtba9tfBtdNiSQ/UqduG8vZ2I
202204
github.com/fluxcd/pkg/tar v0.11.0/go.mod h1:+kiP25NqibWMpFWgizyPEMqnMJIux7bCgEy+4pfxyI4=
203205
github.com/fluxcd/pkg/version v0.6.0 h1:tYRWpV7RvBOO5ahD525TiDhWXmhnvBM0RAIY1MCRe9s=
204206
github.com/fluxcd/pkg/version v0.6.0/go.mod h1:ZCl5BkIvXmMm3C4q4fz4aMi5LQHvcXNSEaL2puXIZo8=
205-
github.com/fluxcd/source-controller/api v1.4.1 h1:zV01D7xzHOXWbYXr36lXHWWYS7POARsjLt61Nbh3kVY=
206-
github.com/fluxcd/source-controller/api v1.4.1/go.mod h1:gSjg57T+IG66SsBR0aquv+DFrm4YyBNpKIJVDnu3Ya8=
207207
github.com/fsnotify/fsnotify v1.8.0 h1:dAwr6QBTBZIkG8roQaJjGof0pp0EeF+tNV7YBP3F/8M=
208208
github.com/fsnotify/fsnotify v1.8.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0=
209209
github.com/fxamacker/cbor/v2 v2.7.0 h1:iM5WgngdRBanHcxugY4JySA0nk1wZorNOpTgCMedv5E=

0 commit comments

Comments
 (0)