Skip to content

Commit

Permalink
Merge pull request #32 from yahoo/client-go-1.19
Browse files Browse the repository at this point in the history
Update client-go and its dependencies to 1.19
  • Loading branch information
zetaj authored Oct 26, 2021
2 parents ee773a7 + 53113dc commit dd8cc99
Show file tree
Hide file tree
Showing 14 changed files with 355 additions and 150 deletions.
7 changes: 6 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
dist: bionic
install:
- sudo apt-get update
- sudo apt-get install --reinstall ca-certificates

language: go
env:
- GO111MODULE=on

go:
- 1.12.x
- 1.15.x

script:
- go build -v -race ./...
Expand Down
18 changes: 5 additions & 13 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,18 @@ go 1.14
require (
github.com/ardielle/ardielle-go v1.5.2
github.com/cenkalti/backoff v2.2.1+incompatible
github.com/evanphx/json-patch v4.5.0+incompatible // indirect
github.com/fsnotify/fsnotify v1.4.7
github.com/gogo/protobuf v1.1.1 // indirect
github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6 // indirect
github.com/golang/protobuf v1.3.2 // indirect
github.com/google/go-cmp v0.3.0
github.com/googleapis/gnostic v0.3.0 // indirect
github.com/fsnotify/fsnotify v1.4.9
github.com/google/go-cmp v0.4.0
github.com/imdario/mergo v0.3.7 // indirect
github.com/json-iterator/go v1.1.7 // indirect
github.com/mash/go-accesslog v1.2.0
github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826
github.com/pkg/errors v0.9.1
github.com/sirupsen/logrus v1.4.2
github.com/stretchr/testify v1.5.1
github.com/tevino/abool v0.0.0-20170917061928-9b9efcf221b5
github.com/yahoo/athenz v1.9.30
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45 // indirect
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4 // indirect
gopkg.in/natefinch/lumberjack.v2 v2.0.0
k8s.io/api v0.15.10
k8s.io/apimachinery v0.15.10
k8s.io/client-go v0.15.10
k8s.io/api v0.19.15
k8s.io/apimachinery v0.19.15
k8s.io/client-go v0.19.15
)
345 changes: 273 additions & 72 deletions go.sum

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions pkg/apis/athenz/v1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,7 @@ func (in *AthenzDomainSpec) DeepCopy() *AthenzDomainSpec {

// AthenzDomainStatus stores status information about the current resource
type AthenzDomainStatus struct {
Message string `json:"message,omitempty"`
JWSDomain *zms.JWSDomain `json:"jwsdomain,omitempty"`
Message string `json:"message,omitempty"`
}

// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
Expand Down
2 changes: 1 addition & 1 deletion pkg/apis/athenz/v1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pkg/client/clientset/versioned/fake/register.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

49 changes: 25 additions & 24 deletions pkg/client/clientset/versioned/typed/athenz/v1/athenzdomain.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 6 additions & 5 deletions pkg/controller/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ limitations under the License.
package controller

import (
"context"
"errors"
"fmt"
"time"
Expand Down Expand Up @@ -229,7 +230,7 @@ func (c *Controller) sync(domain string) error {
valid := c.cron.ValidateDomain(domain)
if !valid {
log.Errorf("Domain %s is an invalid domain (not part of namespace, admin domain, system domain or trust domain)", domain)
return c.cr.RemoveAthenzDomain(domain)
return c.cr.RemoveAthenzDomain(context.TODO(), domain)
}
result, exist, err := c.zmsGetSignedDomains(domain)
if err != nil {
Expand All @@ -240,26 +241,26 @@ func (c *Controller) sync(domain string) error {
}
// if return 404 error, remove AthenzDomains CR
if rdl.Code == 404 {
return c.cr.RemoveAthenzDomain(domain)
return c.cr.RemoveAthenzDomain(context.TODO(), domain)
}
obj, exists, err := c.cr.GetCRByName(domain)
if err != nil {
return err
}
if exists {
obj.Status.Message = err.Error()
c.cr.UpdateErrorStatus(obj)
c.cr.UpdateErrorStatus(context.TODO(), obj)
}
return err
}
if !exist {
log.Errorf("Did not find DomainName: %s in ZMS.", domain)
return c.cr.RemoveAthenzDomain(domain)
return c.cr.RemoveAthenzDomain(context.TODO(), domain)
}
zmsDomainName := zms.DomainName(domain)
for _, domainData := range result.Domains {
if domainData.Domain.Name == zmsDomainName {
_, err := c.cr.CreateUpdateAthenzDomain(domain, domainData)
_, err := c.cr.CreateUpdateAthenzDomain(context.TODO(), domain, domainData)
if err != nil {
return fmt.Errorf("Error occurred when creating AthenzDomain custom resources. Error: %v", err)
}
Expand Down
Loading

0 comments on commit dd8cc99

Please sign in to comment.