Skip to content

Commit 02b5194

Browse files
committed
Adding Drivenets Vendor support
1 parent 655ccee commit 02b5194

File tree

6 files changed

+298
-122
lines changed

6 files changed

+298
-122
lines changed

deploy/deploy.go

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1168,39 +1168,39 @@ type CdnosSpec struct {
11681168
kClient kubernetes.Interface
11691169
}
11701170

1171-
func (l *CdnosSpec) SetKClient(k kubernetes.Interface) {
1172-
l.kClient = k
1171+
func (c *CdnosSpec) SetKClient(k kubernetes.Interface) {
1172+
c.kClient = k
11731173
}
11741174

1175-
func (l *CdnosSpec) Deploy(ctx context.Context) error {
1176-
if l.OperatorData != nil {
1175+
func (c *CdnosSpec) Deploy(ctx context.Context) error {
1176+
if c.OperatorData != nil {
11771177
f, err := os.CreateTemp("", "cdnos-operator-*.yaml")
11781178
if err != nil {
11791179
return err
11801180
}
11811181
defer os.Remove(f.Name())
1182-
if _, err := f.Write(l.OperatorData); err != nil {
1182+
if _, err := f.Write(c.OperatorData); err != nil {
11831183
return err
11841184
}
11851185
if err := f.Close(); err != nil {
11861186
return err
11871187
}
1188-
l.Operator = f.Name()
1188+
c.Operator = f.Name()
11891189
}
1190-
if l.Operator == "" && l.ManifestDir != "" {
1191-
log.Errorf("Deploying Cdnos controller using the directory 'manifests' field (%v) is deprecated, instead provide the filepath of the operator file directly using the 'operator' field going forward", l.ManifestDir)
1192-
l.Operator = filepath.Join(l.ManifestDir, "manifest.yaml")
1190+
if c.Operator == "" && c.ManifestDir != "" {
1191+
log.Errorf("Deploying Cdnos controller using the directory 'manifests' field (%v) is deprecated, instead provide the filepath of the operator file directly using the 'operator' field going forward", c.ManifestDir)
1192+
c.Operator = filepath.Join(c.ManifestDir, "manifest.yaml")
11931193
}
1194-
log.Infof("Deploying Cdnos controller from: %s", l.Operator)
1195-
if err := logCommand("kubectl", "apply", "-f", l.Operator); err != nil {
1194+
log.Infof("Deploying Cdnos controller from: %s", c.Operator)
1195+
if err := run.LogCommand("kubectl", "apply", "-f", c.Operator); err != nil {
11961196
return fmt.Errorf("failed to deploy cdnos operator: %w", err)
11971197
}
11981198
log.Infof("Cdnos controller deployed")
11991199
return nil
12001200
}
12011201

1202-
func (l *CdnosSpec) Healthy(ctx context.Context) error {
1203-
return deploymentHealthy(ctx, l.kClient, "cdnos-controller-system")
1202+
func (c *CdnosSpec) Healthy(ctx context.Context) error {
1203+
return deploymentHealthy(ctx, c.kClient, "cdnos-controller-system")
12041204
}
12051205

12061206

go.mod

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ require (
5959
github.com/docker/distribution v2.8.2+incompatible // indirect
6060
github.com/docker/go-connections v0.4.0 // indirect
6161
github.com/docker/go-units v0.4.0 // indirect
62+
github.com/drivenets/cdnos-controller v1.7.0
6263
github.com/emicklei/go-restful/v3 v3.10.2 // indirect
6364
github.com/evanphx/json-patch v5.6.0+incompatible // indirect
6465
github.com/evanphx/json-patch/v5 v5.6.0 // indirect

go.sum

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -807,6 +807,8 @@ github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5Xh
807807
github.com/docker/go-units v0.4.0 h1:3uh0PgVws3nIA0Q+MwDC8yjEPf9zjRfZZWXZYDct3Tw=
808808
github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk=
809809
github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE=
810+
github.com/drivenets/cdnos-controller v1.7.0 h1:mQ52+q3+1ZkzwXmg+jhZR47FMopZSfh60v5Q3+2vKZM=
811+
github.com/drivenets/cdnos-controller v1.7.0/go.mod h1:s+rGGwx3UZ8TECpeC3htXJv+3sF+VK7fFiYgesxD0vA=
810812
github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk=
811813
github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto=
812814
github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153 h1:yUdfgN0XgIJw7foRItutHYUIhlcKzcSf5vDpdhQAKTc=

manifests/controllers/cdnos/manifest.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -576,7 +576,7 @@ spec:
576576
- --leader-elect
577577
command:
578578
- /manager
579-
image: public.ecr.aws/dn/cdnos-controller:1.4
579+
image: public.ecr.aws/dn/cdnos-controller:1.7.3
580580
livenessProbe:
581581
httpGet:
582582
path: /healthz

0 commit comments

Comments
 (0)