Skip to content

Commit

Permalink
Update deps
Browse files Browse the repository at this point in the history
Signed-off-by: Tamal Saha <[email protected]>
  • Loading branch information
tamalsaha committed Aug 16, 2024
1 parent 1dbfbb9 commit ac043a4
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 6 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ require (
k8s.io/klog/v2 v2.120.1
k8s.io/kube-openapi v0.0.0-20240430033511-f0e62f92d13f
kmodules.xyz/apiversion v0.2.0
kmodules.xyz/client-go v0.30.9
kmodules.xyz/client-go v0.30.11
kmodules.xyz/crd-schema-fuzz v0.29.1
kmodules.xyz/go-containerregistry v0.0.12
kmodules.xyz/resource-metrics v0.30.2-0.20240809125122-4c04e13dfc80
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -340,8 +340,8 @@ k8s.io/utils v0.0.0-20240102154912-e7106e64919e h1:eQ/4ljkx21sObifjzXwlPKpdGLrCf
k8s.io/utils v0.0.0-20240102154912-e7106e64919e/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
kmodules.xyz/apiversion v0.2.0 h1:vAQYqZFm4xu4pbB1cAdHbFEPES6EQkcR4wc06xdTOWk=
kmodules.xyz/apiversion v0.2.0/go.mod h1:oPX8g8LvlPdPX3Yc5YvCzJHQnw3YF/X4/jdW0b1am80=
kmodules.xyz/client-go v0.30.9 h1:wiLivFlqVZOitAqLFEa1n53GkbYYOmiR8upjIHPHrYk=
kmodules.xyz/client-go v0.30.9/go.mod h1:XL3PDQIXG4s3xNRL2SSxIvi8b2WyMGpn26dFnOBz0j4=
kmodules.xyz/client-go v0.30.11 h1:2UFIu18O5xwKyKbmAn+vs8CIcnfogu0IACurgR2HAmU=
kmodules.xyz/client-go v0.30.11/go.mod h1:XL3PDQIXG4s3xNRL2SSxIvi8b2WyMGpn26dFnOBz0j4=
kmodules.xyz/crd-schema-fuzz v0.29.1 h1:zJTlWYOrT5dsVVHW8HGcnR/vaWfxQfNh11QwTtkYpcs=
kmodules.xyz/crd-schema-fuzz v0.29.1/go.mod h1:n708z9YQqLMP2KNLQVgBcRJw1QpSWLvpNCEi+KJDOYE=
kmodules.xyz/go-containerregistry v0.0.12 h1:Tl32QGmSqRVm9PUEb/f3dgDeu9zW5fVzt3qmAFIE37I=
Expand Down
15 changes: 14 additions & 1 deletion vendor/kmodules.xyz/client-go/api/v1/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,13 @@ limitations under the License.

package v1

import "strings"
import (
"crypto/hmac"
"crypto/sha256"
"encoding/base64"
"fmt"
"strings"
)

// +kubebuilder:validation:Enum=Aws;Azure;DigitalOcean;GoogleCloud;Linode;Packet;Scaleway;Vultr;BareMetal;KIND;Generic;Private
type HostingProvider string
Expand Down Expand Up @@ -56,6 +62,13 @@ type ClusterMetadata struct {
CABundle string `json:"caBundle,omitempty"`
}

func (md ClusterMetadata) State() string {
hasher := hmac.New(sha256.New, []byte(md.UID))
state := fmt.Sprintf("%s,%s", md.APIEndpoint, md.OwnerID)
hasher.Write([]byte(state))
return base64.URLEncoding.EncodeToString(hasher.Sum(nil))
}

/*
ENUM(
Expand Down
2 changes: 1 addition & 1 deletion vendor/kmodules.xyz/client-go/cluster/lib.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ func ClusterMetadataFromConfigMap(cm *core.ConfigMap, clusterUIDVerifier string)
hasher.Write(data)
messageMAC := hasher.Sum(nil)
expectedMAC := cm.BinaryData["mac"]
if hmac.Equal(messageMAC, expectedMAC) {
if !hmac.Equal(messageMAC, expectedMAC) {
return nil, fmt.Errorf("configmap %s/%s fails validation", cm.Namespace, cm.Name)
}

Expand Down
2 changes: 1 addition & 1 deletion vendor/modules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -716,7 +716,7 @@ k8s.io/utils/trace
# kmodules.xyz/apiversion v0.2.0
## explicit; go 1.14
kmodules.xyz/apiversion
# kmodules.xyz/client-go v0.30.9
# kmodules.xyz/client-go v0.30.11
## explicit; go 1.22.0
kmodules.xyz/client-go
kmodules.xyz/client-go/api/v1
Expand Down

0 comments on commit ac043a4

Please sign in to comment.