Skip to content

Commit

Permalink
restore community edition
Browse files Browse the repository at this point in the history
  • Loading branch information
jhass committed Apr 10, 2024
1 parent c0166b9 commit 2f19f0f
Show file tree
Hide file tree
Showing 691 changed files with 36 additions and 160,351 deletions.
42 changes: 0 additions & 42 deletions .github/workflows/release-tracker.yml

This file was deleted.

15 changes: 3 additions & 12 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,23 +32,14 @@ jobs:

- name: Publish to GitHub Container Registry
env:
REGISTRY: ghcr.io/stashed
DOCKER_TOKEN: ${{ secrets.LGTM_GITHUB_TOKEN }}
USERNAME: 1gtm
REGISTRY: ghcr.io/jhass
DOCKER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
USERNAME: ${{ github.actor }}
APPSCODE_ENV: prod
run: |
docker login ghcr.io --username ${USERNAME} --password ${DOCKER_TOKEN}
make release
- name: Publish to Docker Registry
env:
DOCKER_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
USERNAME: 1gtm
APPSCODE_ENV: prod
run: |
docker login --username ${USERNAME} --password ${DOCKER_TOKEN}
make release
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
Expand Down
53 changes: 0 additions & 53 deletions .github/workflows/update-docs.yml

This file was deleted.

3 changes: 0 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@ require (
github.com/spf13/cobra v1.8.0
github.com/spf13/pflag v1.0.5
go.bytebuilders.dev/audit v0.0.33
go.bytebuilders.dev/license-proxyserver v0.0.9
go.bytebuilders.dev/license-verifier v0.14.0
go.bytebuilders.dev/license-verifier/kubernetes v0.14.0
golang.org/x/text v0.14.0
gomodules.xyz/blobfs v0.1.14
gomodules.xyz/cert v1.6.0
Expand Down
8 changes: 0 additions & 8 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -862,14 +862,6 @@ github.com/zeebo/assert v1.3.0/go.mod h1:Pq9JiuJQpG8JLJdtkwrJESF0Foym2/D9XMU5ciN
github.com/zeebo/xxh3 v1.0.2 h1:xZmwmqxHZA8AI603jOQ0tMqmBr9lPeFwGg6d+xy9DC0=
github.com/zeebo/xxh3 v1.0.2/go.mod h1:5NWz9Sef7zIDm2JHfFlcQvNekmcEl9ekUZQQKCYaDcA=
github.com/zenazn/goji v0.9.0/go.mod h1:7S9M489iMyHBNxwZnk9/EHS098H4/F6TATF2mIxtB1Q=
go.bytebuilders.dev/audit v0.0.33 h1:p9cPJpRimV6asHh55RSr1IB6NhSZABvLPo0Md6QB4Nc=
go.bytebuilders.dev/audit v0.0.33/go.mod h1:RjYq4EVdUGLfzSnnm0CtS0kjBgW3zDIDrTQr0YN6SRA=
go.bytebuilders.dev/license-proxyserver v0.0.9 h1:MFArxunIZS0o3LZ+JuSwub8GwZ4bdE3kkfJ8hJfkREQ=
go.bytebuilders.dev/license-proxyserver v0.0.9/go.mod h1:mLX/7EK1gouPWXmG3qibRXF8y+dkR3H1Hgttioy6Dww=
go.bytebuilders.dev/license-verifier v0.14.0 h1:O6pXhz9vz7dPWIJATkX+JiMLhUD2ydzvKzf26c+3Jrw=
go.bytebuilders.dev/license-verifier v0.14.0/go.mod h1:GB9XTSQUcllJ4AVq29TdJI6yRjoI86HGz0XMqq9nLwY=
go.bytebuilders.dev/license-verifier/kubernetes v0.14.0 h1:eeOKHu1YgdHhsaCXf9GNo1ha3SOfaSSe40xG1gc+ArA=
go.bytebuilders.dev/license-verifier/kubernetes v0.14.0/go.mod h1:ms4GTV6vb5eg+dglr8N6EaOybGE77s+kkppFUZ3aZZQ=
go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU=
go.etcd.io/bbolt v1.3.8 h1:xs88BrvEv273UsB79e0hcVrlUWmS0a8upikMFhSyAtA=
go.etcd.io/bbolt v1.3.8/go.mod h1:N9Mkw9X8x5fupy0IKsmuqVtoGDyxsaDlbk4Rd05IAQw=
Expand Down
12 changes: 0 additions & 12 deletions hack/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,6 @@ export GOOS="${OS}"
export GO111MODULE=on
export GOFLAGS="-mod=vendor"

ENFORCE_LICENSE=${ENFORCE_LICENSE:-}
if [ ! -z "${git_tag:-}" ]; then
ENFORCE_LICENSE=true
fi
if [ "$ENFORCE_LICENSE" != "true" ]; then
ENFORCE_LICENSE=false
fi

go install \
-installsuffix "static" \
-ldflags " \
Expand All @@ -55,9 +47,5 @@ go install \
-X main.GoVersion=$(go version | cut -d " " -f 3) \
-X main.Compiler=$(go env CC) \
-X main.Platform=${OS}/${ARCH} \
-X 'go.bytebuilders.dev/license-verifier/info.EnforceLicense=${ENFORCE_LICENSE}' \
-X 'go.bytebuilders.dev/license-verifier/info.LicenseCA=$(curl -fsSL https://licenses.appscode.com/certificates/ca.crt)' \
-X 'go.bytebuilders.dev/license-verifier/info.ProductOwnerName=${PRODUCT_OWNER_NAME}' \
-X 'go.bytebuilders.dev/license-verifier/info.ProductName=${PRODUCT_NAME}' \
" \
./...
1 change: 0 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import (
_ "stash.appscode.dev/apimachinery/client/clientset/versioned/fake"
"stash.appscode.dev/stash/pkg/cmds"

_ "go.bytebuilders.dev/license-verifier/info"
"gomodules.xyz/logs"
_ "k8s.io/client-go/kubernetes/fake"
_ "k8s.io/client-go/plugin/pkg/client/auth"
Expand Down
21 changes: 0 additions & 21 deletions pkg/cmds/server/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,7 @@ import (
"stash.appscode.dev/stash/pkg/controller"

"github.com/spf13/pflag"
licenseapi "go.bytebuilders.dev/license-verifier/apis/licenses/v1alpha1"
"go.bytebuilders.dev/license-verifier/info"
license "go.bytebuilders.dev/license-verifier/kubernetes"
crd_cs "k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset"
"k8s.io/apimachinery/pkg/util/sets"
"k8s.io/client-go/kubernetes"
"kmodules.xyz/client-go/discovery"
appcatalog_cs "kmodules.xyz/custom-resources/client/clientset/versioned"
Expand All @@ -41,8 +37,6 @@ import (
)

type ExtraOptions struct {
LicenseFile string
LicenseApiService string
StashImage string
StashImageTag string
DockerRegistry string
Expand Down Expand Up @@ -81,8 +75,6 @@ func (s *ExtraOptions) AddFlags(fs *pflag.FlagSet) {
fs.StringVar(&s.StashImageTag, "image-tag", s.StashImageTag, "Image tag for sidecar, init-container, check-job and recovery-job")
fs.StringVar(&s.DockerRegistry, "docker-registry", s.DockerRegistry, "Docker image registry for sidecar, init-container, check-job, recovery-job and kubectl-job")
fs.StringSliceVar(&s.ImagePullSecrets, "image-pull-secrets", s.ImagePullSecrets, "List of image pull secrets for pulling image from private registries")
fs.StringVar(&s.LicenseFile, "license-file", s.LicenseFile, "Path to license file")
fs.StringVar(&s.LicenseApiService, "license-apiservice", s.LicenseApiService, "Name of the ApiService to use by the addons to identify the respective service and certificate for license verification request")

fs.Float64Var(&s.QPS, "qps", s.QPS, "The maximum QPS to the master from this client")
fs.IntVar(&s.Burst, "burst", s.Burst, "The maximum burst for throttle")
Expand All @@ -101,8 +93,6 @@ func (s *ExtraOptions) AddFlags(fs *pflag.FlagSet) {
func (s *ExtraOptions) ApplyTo(cfg *controller.Config) error {
var err error

cfg.LicenseFile = s.LicenseFile
cfg.LicenseApiService = s.LicenseApiService
cfg.StashImage = s.StashImage
cfg.StashImageTag = s.StashImageTag
cfg.DockerRegistry = s.DockerRegistry
Expand Down Expand Up @@ -139,17 +129,6 @@ func (s *ExtraOptions) ApplyTo(cfg *controller.Config) error {
}
}

if cfg.LicenseProvided() {
l := license.MustLicenseEnforcer(cfg.ClientConfig, cfg.LicenseFile).LoadLicense()
if l.Status != licenseapi.LicenseActive {
return fmt.Errorf("license status %s, reason: %s", l.Status, l.Reason)
}
if !sets.NewString(l.Features...).HasAny(info.Features()...) {
return fmt.Errorf("not a valid license for this product")
}
cfg.License = l
}

metrics.SetPushgatewayURL(s.PushgatewayURL)
return nil
}
Expand Down
5 changes: 0 additions & 5 deletions pkg/cmds/server/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import (
"stash.appscode.dev/stash/pkg/server"

"github.com/spf13/pflag"
licenseEnforcer "go.bytebuilders.dev/license-verifier/kubernetes"
admissionv1beta1 "k8s.io/api/admission/v1beta1"
utilerrors "k8s.io/apimachinery/pkg/util/errors"
openapinamer "k8s.io/apiserver/pkg/endpoints/openapi"
Expand Down Expand Up @@ -142,9 +141,5 @@ func (o StashOptions) Run(stopCh <-chan struct{}) error {
return err
}

// Start periodic license verification
//nolint:errcheck
go licenseEnforcer.VerifyLicensePeriodically(config.ExtraConfig.ClientConfig, o.ExtraOptions.LicenseFile, stopCh)

return s.Run(stopCh)
}
3 changes: 0 additions & 3 deletions pkg/controller/backup_configuration.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,6 @@ func (c *StashController) validateBackupConfiguration(bc *api_v1beta1.BackupConf
func (c *StashController) initBackupConfigurationWatcher() {
c.bcInformer = c.stashInformerFactory.Stash().V1beta1().BackupConfigurations().Informer()
c.bcQueue = queue.New(api_v1beta1.ResourceKindBackupConfiguration, c.MaxNumRequeues, c.NumThreads, c.runBackupConfigurationProcessor)
if c.auditor != nil {
c.auditor.ForGVK(c.bcInformer, api_v1beta1.SchemeGroupVersion.WithKind(api_v1beta1.ResourceKindBackupConfiguration))
}
_, _ = c.bcInformer.AddEventHandler(queue.NewEventHandler(c.bcQueue.GetQueue(), func(oldObj, newObj interface{}) bool {
bc := newObj.(*api_v1beta1.BackupConfiguration)
desiredPhase := invoker.CalculateBackupInvokerPhase(bc.Spec.Driver, bc.Status.Conditions)
Expand Down
39 changes: 17 additions & 22 deletions pkg/controller/backup_session.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,6 @@ func (c *StashController) NewBackupSessionWebhook() hooks.AdmissionHook {
func (c *StashController) initBackupSessionWatcher() {
c.backupSessionInformer = c.stashInformerFactory.Stash().V1beta1().BackupSessions().Informer()
c.backupSessionQueue = queue.New(api_v1beta1.ResourceKindBackupSession, c.MaxNumRequeues, c.NumThreads, c.processBackupSessionEvent)
if c.auditor != nil {
c.auditor.ForGVK(c.backupSessionInformer, api_v1beta1.SchemeGroupVersion.WithKind(api_v1beta1.ResourceKindBackupSession))
}
_, _ = c.backupSessionInformer.AddEventHandler(queue.DefaultEventHandler(c.backupSessionQueue.GetQueue(), core.NamespaceAll))
c.backupSessionLister = c.stashInformerFactory.Stash().V1beta1().BackupSessions().Lister()
}
Expand Down Expand Up @@ -400,16 +397,15 @@ func (c *StashController) newSidecarExecutor(inv invoker.BackupInvoker, w *wapi.
}

e := &executor.Sidecar{
KubeClient: c.kubeClient,
OpenshiftClient: c.ocClient,
StashClient: c.stashClient,
RBACOptions: rbacOptions,
Invoker: inv,
Index: index,
Image: c.getDockerImage(),
LicenseApiService: c.LicenseApiService,
Caller: caller,
Workload: w,
KubeClient: c.kubeClient,
OpenshiftClient: c.ocClient,
StashClient: c.stashClient,
RBACOptions: rbacOptions,
Invoker: inv,
Index: index,
Image: c.getDockerImage(),
Caller: caller,
Workload: w,
}

e.Repository, err = c.repoLister.Repositories(inv.GetRepoRef().Namespace).Get(inv.GetRepoRef().Name)
Expand Down Expand Up @@ -460,15 +456,14 @@ func (c *StashController) newBackupJob(inv invoker.BackupInvoker, session *invok
}

e := &executor.BackupJob{
KubeClient: c.kubeClient,
StashClient: c.stashClient,
CatalogClient: c.appCatalogClient,
RBACOptions: rbacOptions,
Invoker: inv,
Session: session,
Index: index,
Image: c.getDockerImage(),
LicenseApiService: c.LicenseApiService,
KubeClient: c.kubeClient,
StashClient: c.stashClient,
CatalogClient: c.appCatalogClient,
RBACOptions: rbacOptions,
Invoker: inv,
Session: session,
Index: index,
Image: c.getDockerImage(),
}

e.Repository, err = c.repoLister.Repositories(inv.GetRepoRef().Namespace).Get(inv.GetRepoRef().Name)
Expand Down
Loading

0 comments on commit 2f19f0f

Please sign in to comment.