Skip to content

Commit

Permalink
Prepare for release 17.2-v2 (#1415)
Browse files Browse the repository at this point in the history
ProductLine: Stash
Release: v2025.2.10
Release-tracker: stashed/CHANGELOG#80
Signed-off-by: 1gtm <[email protected]>
  • Loading branch information
1gtm authored Feb 7, 2025
1 parent 01ebd71 commit 1dd5ba4
Show file tree
Hide file tree
Showing 19 changed files with 179 additions and 100 deletions.
10 changes: 5 additions & 5 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ toolchain go1.23.0

require (
github.com/spf13/cobra v1.8.0
go.bytebuilders.dev/license-verifier/kubernetes v0.14.4
go.bytebuilders.dev/license-verifier/kubernetes v0.14.6
gomodules.xyz/flags v0.1.3
gomodules.xyz/go-sh v0.1.0
gomodules.xyz/logs v0.0.7
Expand All @@ -18,12 +18,12 @@ require (
kmodules.xyz/client-go v0.30.44
kmodules.xyz/custom-resources v0.30.0
kmodules.xyz/offshoot-api v0.30.1
stash.appscode.dev/apimachinery v0.38.1-0.20250114050236-cca8469a4c04
stash.appscode.dev/apimachinery v0.39.0
)

require (
filippo.io/edwards25519 v1.1.0 // indirect
github.com/Masterminds/semver/v3 v3.2.1 // indirect
github.com/Masterminds/semver/v3 v3.3.0 // indirect
github.com/PuerkitoBio/purell v1.2.1 // indirect
github.com/armon/circbuf v0.0.0-20190214190532-5111143e8da2 // indirect
github.com/beorn7/perks v1.0.1 // indirect
Expand Down Expand Up @@ -77,8 +77,8 @@ require (
github.com/yudai/gojsondiff v1.0.0 // indirect
github.com/yudai/golcs v0.0.0-20170316035057-ecda9a501e82 // indirect
github.com/zeebo/xxh3 v1.0.2 // indirect
go.bytebuilders.dev/license-proxyserver v0.0.19 // indirect
go.bytebuilders.dev/license-verifier v0.14.4 // indirect
go.bytebuilders.dev/license-proxyserver v0.0.20 // indirect
go.bytebuilders.dev/license-verifier v0.14.6 // indirect
golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842 // indirect
golang.org/x/net v0.33.0 // indirect
golang.org/x/oauth2 v0.22.0 // indirect
Expand Down
20 changes: 10 additions & 10 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA=
filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
github.com/Masterminds/semver/v3 v3.2.1 h1:RN9w6+7QoMeJVGyfmbcgs28Br8cvmnucEXnY0rYXWg0=
github.com/Masterminds/semver/v3 v3.2.1/go.mod h1:qvl/7zhW3nngYb5+80sSMF+FG2BjYrf8m9wsX0PNOMQ=
github.com/Masterminds/semver/v3 v3.3.0 h1:B8LGeaivUe71a5qox1ICM/JLl0NqZSW5CHyL+hmvYS0=
github.com/Masterminds/semver/v3 v3.3.0/go.mod h1:4V+yj/TJE1HU9XfppCwVMZq3I84lprf4nC11bSS5beM=
github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU=
github.com/PuerkitoBio/purell v1.2.1 h1:QsZ4TjvwiMpat6gBCBxEQI0rcS9ehtkKtSpiUnd9N28=
github.com/PuerkitoBio/purell v1.2.1/go.mod h1:ZwHcC/82TOaovDi//J/804umJFFmbOHPngi8iYYv/Eo=
Expand Down Expand Up @@ -314,12 +314,12 @@ github.com/zeebo/assert v1.3.0 h1:g7C04CbJuIDKNPFHmsk4hwZDO5O+kntRxzaUoNXj+IQ=
github.com/zeebo/assert v1.3.0/go.mod h1:Pq9JiuJQpG8JLJdtkwrJESF0Foym2/D9XMU5ciN/wJ0=
github.com/zeebo/xxh3 v1.0.2 h1:xZmwmqxHZA8AI603jOQ0tMqmBr9lPeFwGg6d+xy9DC0=
github.com/zeebo/xxh3 v1.0.2/go.mod h1:5NWz9Sef7zIDm2JHfFlcQvNekmcEl9ekUZQQKCYaDcA=
go.bytebuilders.dev/license-proxyserver v0.0.19 h1:mY7zPDN0JCw2a1UajOuQUQKQKjjm5KBx2CbkT/+a1N8=
go.bytebuilders.dev/license-proxyserver v0.0.19/go.mod h1:B3Ig2Fo1qUollSV9GgfyFK8tXBI0RmUSpP1KFMZ2N7Q=
go.bytebuilders.dev/license-verifier v0.14.4 h1:JwTGQFew4nudwv8Pk3BdfQRts8KfgUQ5xhu138w1wt4=
go.bytebuilders.dev/license-verifier v0.14.4/go.mod h1:LqWXJKee5ofDcCYM6T5WilYlUc4NlKeZz58tHwO8GEs=
go.bytebuilders.dev/license-verifier/kubernetes v0.14.4 h1:NeHq6SuVhRIVaMW2kSXdr8DcuUOg2jVL9rsODIQp9Fc=
go.bytebuilders.dev/license-verifier/kubernetes v0.14.4/go.mod h1:1C7SaOJShC60mIXP1hXBaDWGpb0hrHQ4p4nUEvI6YQY=
go.bytebuilders.dev/license-proxyserver v0.0.20 h1:gzRSwUmX/LSwPVE6T9oy5RLIutU1EeI7hmS+QGsYBY4=
go.bytebuilders.dev/license-proxyserver v0.0.20/go.mod h1:2PJmjMCXncVyeP3fIVQ+hwZnuhmWSTmbcuEMBrFKIac=
go.bytebuilders.dev/license-verifier v0.14.6 h1:0iHYGURUbx8toiXvFKftn/qMpeHzqHbAgEnEzOCNLvo=
go.bytebuilders.dev/license-verifier v0.14.6/go.mod h1:LqWXJKee5ofDcCYM6T5WilYlUc4NlKeZz58tHwO8GEs=
go.bytebuilders.dev/license-verifier/kubernetes v0.14.6 h1:NxmASX0A3lu+ABd4zuT5Ib+I63y3j5uJxmlUFEGxqWg=
go.bytebuilders.dev/license-verifier/kubernetes v0.14.6/go.mod h1:N5QxsJF4EGLduOsTsW9gGfRuuMvN33T8pg5Y9NfKzuo=
go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU=
go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU=
go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8=
Expand Down Expand Up @@ -554,5 +554,5 @@ sigs.k8s.io/structured-merge-diff/v4 v4.4.1 h1:150L+0vs/8DA78h1u02ooW1/fFq/Lwr+s
sigs.k8s.io/structured-merge-diff/v4 v4.4.1/go.mod h1:N8hJocpFajUSSeSJ9bOZ77VzejKZaXsTtZo4/u7Io08=
sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E=
sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY=
stash.appscode.dev/apimachinery v0.38.1-0.20250114050236-cca8469a4c04 h1:NtQeear5dlS9PM6LoPVlfqRflavGvODoxa65RnI+w5Y=
stash.appscode.dev/apimachinery v0.38.1-0.20250114050236-cca8469a4c04/go.mod h1:HoMcNxSg7TUHEhbHE+JvdhICrXoEKRvfLuFBKAM40ng=
stash.appscode.dev/apimachinery v0.39.0 h1:jUYOFmpFgKhtsEbtmamlSgQTQ01boUzkv+25iAXzK5I=
stash.appscode.dev/apimachinery v0.39.0/go.mod h1:6z4oQvMMBPyybs8uajBsrgO2ZK98ulB0CKGwfeuav+4=
28 changes: 28 additions & 0 deletions vendor/github.com/Masterminds/semver/v3/CHANGELOG.md

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

3 changes: 2 additions & 1 deletion vendor/github.com/Masterminds/semver/v3/Makefile

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

28 changes: 14 additions & 14 deletions vendor/github.com/Masterminds/semver/v3/README.md

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

64 changes: 32 additions & 32 deletions vendor/github.com/Masterminds/semver/v3/version.go

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

Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@ limitations under the License.
package v1alpha1

func (l License) DisableAnalytics() bool {
return len(l.FeatureFlags) > 0 && l.FeatureFlags["DisableAnalytics"] == "true"
return len(l.FeatureFlags) > 0 && l.FeatureFlags[FeatureDisableAnalytics] == "true"
}

func (l License) EnableClientBilling() bool {
return len(l.FeatureFlags) > 0 && l.FeatureFlags[FeatureEnableClientBilling] == "true"
}

func (i *License) Less(j *License) bool {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@ limitations under the License.
package v1alpha1

import (
"fmt"

metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/util/errors"
"k8s.io/apimachinery/pkg/util/sets"
)

// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
Expand All @@ -26,20 +30,20 @@ import (
type License struct {
metav1.TypeMeta `json:",inline,omitempty"`

Data []byte `json:"-"`
Issuer string `json:"issuer,omitempty"` // byte.builders
ProductLine string `json:"productLine,omitempty"`
TierName string `json:"tierName,omitempty"`
PlanName string `json:"planName,omitempty"`
Features []string `json:"features,omitempty"`
FeatureFlags map[string]string `json:"featureFlags,omitempty"`
Clusters []string `json:"clusters,omitempty"` // cluster_id ?
User *User `json:"user,omitempty"`
NotBefore *metav1.Time `json:"notBefore,omitempty"` // start of subscription start
NotAfter *metav1.Time `json:"notAfter,omitempty"` // if set, use this
ID string `json:"id,omitempty"` // license ID
Status LicenseStatus `json:"status"`
Reason string `json:"reason"`
Data []byte `json:"-"`
Issuer string `json:"issuer,omitempty"` // byte.builders
ProductLine string `json:"productLine,omitempty"`
TierName string `json:"tierName,omitempty"`
PlanName string `json:"planName,omitempty"`
Features []string `json:"features,omitempty"`
FeatureFlags FeatureFlags `json:"featureFlags,omitempty"`
Clusters []string `json:"clusters,omitempty"` // cluster_id ?
User *User `json:"user,omitempty"`
NotBefore *metav1.Time `json:"notBefore,omitempty"` // start of subscription start
NotAfter *metav1.Time `json:"notAfter,omitempty"` // if set, use this
ID string `json:"id,omitempty"` // license ID
Status LicenseStatus `json:"status"`
Reason string `json:"reason"`
}

type User struct {
Expand All @@ -62,3 +66,36 @@ type Contract struct {
StartTimestamp metav1.Time `json:"startTimestamp"`
ExpiryTimestamp metav1.Time `json:"expiryTimestamp"`
}

type FeatureFlag string

const (
FeatureDisableAnalytics FeatureFlag = "DisableAnalytics"
FeatureRestrictions FeatureFlag = "Restrictions"
FeatureEnableClientBilling FeatureFlag = "EnableClientBilling"
)

var knownFlags = sets.New[FeatureFlag](FeatureDisableAnalytics, FeatureRestrictions, FeatureEnableClientBilling)

type FeatureFlags map[FeatureFlag]string

func (f FeatureFlags) IsValid() error {
var errs []error
for k := range f {
if !knownFlags.Has(k) {
errs = append(errs, fmt.Errorf("unknown feature flag %q", k))
}
}
return errors.NewAggregate(errs)
}

func (f FeatureFlags) ToSlice() []string {
if len(f) == 0 {
return nil
}
result := make([]string, 0, len(f))
for k, v := range f {
result = append(result, fmt.Sprintf("%s=%s", k, v))
}
return result
}
Loading

0 comments on commit 1dd5ba4

Please sign in to comment.