Skip to content

Commit

Permalink
Adding Drivenets Vendor support
Browse files Browse the repository at this point in the history
  • Loading branch information
davnerson-dn committed Feb 29, 2024
1 parent c1ca53c commit 30f3fdf
Show file tree
Hide file tree
Showing 7 changed files with 262 additions and 214 deletions.
26 changes: 13 additions & 13 deletions deploy/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -1168,39 +1168,39 @@ type CdnosSpec struct {
kClient kubernetes.Interface
}

func (l *CdnosSpec) SetKClient(k kubernetes.Interface) {
l.kClient = k
func (c *CdnosSpec) SetKClient(k kubernetes.Interface) {
c.kClient = k
}

func (l *CdnosSpec) Deploy(ctx context.Context) error {
if l.OperatorData != nil {
func (c *CdnosSpec) Deploy(ctx context.Context) error {
if c.OperatorData != nil {
f, err := os.CreateTemp("", "cdnos-operator-*.yaml")
if err != nil {
return err
}
defer os.Remove(f.Name())
if _, err := f.Write(l.OperatorData); err != nil {
if _, err := f.Write(c.OperatorData); err != nil {
return err
}
if err := f.Close(); err != nil {
return err
}
l.Operator = f.Name()
c.Operator = f.Name()
}
if l.Operator == "" && l.ManifestDir != "" {
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)
l.Operator = filepath.Join(l.ManifestDir, "manifest.yaml")
if c.Operator == "" && c.ManifestDir != "" {
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)
c.Operator = filepath.Join(c.ManifestDir, "manifest.yaml")
}
log.Infof("Deploying Cdnos controller from: %s", l.Operator)
if err := logCommand("kubectl", "apply", "-f", l.Operator); err != nil {
log.Infof("Deploying Cdnos controller from: %s", c.Operator)
if err := run.LogCommand("kubectl", "apply", "-f", c.Operator); err != nil {
return fmt.Errorf("failed to deploy cdnos operator: %w", err)
}
log.Infof("Cdnos controller deployed")
return nil
}

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


Expand Down
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ require (
github.com/docker/distribution v2.8.2+incompatible // indirect
github.com/docker/go-connections v0.4.0 // indirect
github.com/docker/go-units v0.4.0 // indirect
github.com/drivenets/cdnos-controller v1.7.0
github.com/emicklei/go-restful/v3 v3.10.2 // indirect
github.com/evanphx/json-patch v5.6.0+incompatible // indirect
github.com/evanphx/json-patch/v5 v5.6.0 // indirect
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -807,6 +807,8 @@ github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5Xh
github.com/docker/go-units v0.4.0 h1:3uh0PgVws3nIA0Q+MwDC8yjEPf9zjRfZZWXZYDct3Tw=
github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk=
github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE=
github.com/drivenets/cdnos-controller v1.7.0 h1:mQ52+q3+1ZkzwXmg+jhZR47FMopZSfh60v5Q3+2vKZM=
github.com/drivenets/cdnos-controller v1.7.0/go.mod h1:s+rGGwx3UZ8TECpeC3htXJv+3sF+VK7fFiYgesxD0vA=
github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk=
github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto=
github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153 h1:yUdfgN0XgIJw7foRItutHYUIhlcKzcSf5vDpdhQAKTc=
Expand Down
2 changes: 1 addition & 1 deletion manifests/controllers/cdnos/manifest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,7 @@ spec:
- --leader-elect
command:
- /manager
image: public.ecr.aws/dn/cdnos-controller:1.4
image: public.ecr.aws/dn/cdnos-controller:1.7.3
livenessProbe:
httpGet:
path: /healthz
Expand Down
Loading

0 comments on commit 30f3fdf

Please sign in to comment.