Skip to content

Commit a1d6612

Browse files
committed
Adding Drivenets Vendor support
1 parent 4cead11 commit a1d6612

File tree

7 files changed

+262
-214
lines changed

7 files changed

+262
-214
lines changed

deploy/deploy.go

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1147,39 +1147,39 @@ type CdnosSpec struct {
11471147
kClient kubernetes.Interface
11481148
}
11491149

1150-
func (l *CdnosSpec) SetKClient(k kubernetes.Interface) {
1151-
l.kClient = k
1150+
func (c *CdnosSpec) SetKClient(k kubernetes.Interface) {
1151+
c.kClient = k
11521152
}
11531153

1154-
func (l *CdnosSpec) Deploy(ctx context.Context) error {
1155-
if l.OperatorData != nil {
1154+
func (c *CdnosSpec) Deploy(ctx context.Context) error {
1155+
if c.OperatorData != nil {
11561156
f, err := os.CreateTemp("", "cdnos-operator-*.yaml")
11571157
if err != nil {
11581158
return err
11591159
}
11601160
defer os.Remove(f.Name())
1161-
if _, err := f.Write(l.OperatorData); err != nil {
1161+
if _, err := f.Write(c.OperatorData); err != nil {
11621162
return err
11631163
}
11641164
if err := f.Close(); err != nil {
11651165
return err
11661166
}
1167-
l.Operator = f.Name()
1167+
c.Operator = f.Name()
11681168
}
1169-
if l.Operator == "" && l.ManifestDir != "" {
1170-
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)
1171-
l.Operator = filepath.Join(l.ManifestDir, "manifest.yaml")
1169+
if c.Operator == "" && c.ManifestDir != "" {
1170+
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)
1171+
c.Operator = filepath.Join(c.ManifestDir, "manifest.yaml")
11721172
}
1173-
log.Infof("Deploying Cdnos controller from: %s", l.Operator)
1174-
if err := logCommand("kubectl", "apply", "-f", l.Operator); err != nil {
1173+
log.Infof("Deploying Cdnos controller from: %s", c.Operator)
1174+
if err := run.LogCommand("kubectl", "apply", "-f", c.Operator); err != nil {
11751175
return fmt.Errorf("failed to deploy cdnos operator: %w", err)
11761176
}
11771177
log.Infof("Cdnos controller deployed")
11781178
return nil
11791179
}
11801180

1181-
func (l *CdnosSpec) Healthy(ctx context.Context) error {
1182-
return deploymentHealthy(ctx, l.kClient, "cdnos-controller-system")
1181+
func (c *CdnosSpec) Healthy(ctx context.Context) error {
1182+
return deploymentHealthy(ctx, c.kClient, "cdnos-controller-system")
11831183
}
11841184

11851185

go.mod

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ require (
5858
github.com/docker/distribution v2.8.2+incompatible // indirect
5959
github.com/docker/go-connections v0.4.0 // indirect
6060
github.com/docker/go-units v0.4.0 // indirect
61+
github.com/drivenets/cdnos-controller v1.7.0
6162
github.com/emicklei/go-restful/v3 v3.10.2 // indirect
6263
github.com/evanphx/json-patch v5.6.0+incompatible // indirect
6364
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
@@ -883,6 +883,8 @@ github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5Xh
883883
github.com/docker/go-units v0.4.0 h1:3uh0PgVws3nIA0Q+MwDC8yjEPf9zjRfZZWXZYDct3Tw=
884884
github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk=
885885
github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE=
886+
github.com/drivenets/cdnos-controller v1.7.0 h1:mQ52+q3+1ZkzwXmg+jhZR47FMopZSfh60v5Q3+2vKZM=
887+
github.com/drivenets/cdnos-controller v1.7.0/go.mod h1:s+rGGwx3UZ8TECpeC3htXJv+3sF+VK7fFiYgesxD0vA=
886888
github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk=
887889
github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto=
888890
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)