Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update flux 2.3.0 #7847

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ type NamespacedResourceWatcherCacheConfig struct {
OnResyncFunc ResyncFunc

// These funcs are needed to manipulate API-specific objects, such as flux's
// sourcev1beta2.HelmRepository, in a generic fashion
// sourcev1.HelmRepository, in a generic fashion
NewObjFunc NewObjectFunc
NewListFunc NewObjectListFunc
ListItemsFunc GetListItemsFunc
Expand Down
6 changes: 3 additions & 3 deletions cmd/kubeapps-apis/plugins/fluxv2/packages/v1alpha1/chart.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"strings"

"github.com/bufbuild/connect-go"
sourcev1beta2 "github.com/fluxcd/source-controller/api/v1beta2"
sourcev1 "github.com/fluxcd/source-controller/api/v1"
corev1 "github.com/vmware-tanzu/kubeapps/cmd/kubeapps-apis/gen/core/packages/v1alpha1"
"github.com/vmware-tanzu/kubeapps/cmd/kubeapps-apis/plugins/fluxv2/packages/v1alpha1/cache"
"github.com/vmware-tanzu/kubeapps/cmd/kubeapps-apis/plugins/fluxv2/packages/v1alpha1/common"
Expand All @@ -27,12 +27,12 @@ import (
"sigs.k8s.io/yaml"
)

func (s *Server) getChartInCluster(ctx context.Context, headers http.Header, key types.NamespacedName) (*sourcev1beta2.HelmChart, error) {
func (s *Server) getChartInCluster(ctx context.Context, headers http.Header, key types.NamespacedName) (*sourcev1.HelmChart, error) {
client, err := s.getClient(headers, key.Namespace)
if err != nil {
return nil, err
}
var chartObj sourcev1beta2.HelmChart
var chartObj sourcev1.HelmChart
if err = client.Get(ctx, key, &chartObj); err != nil {
return nil, connecterror.FromK8sError("get", "HelmChart", key.String(), err)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"testing"
"time"

sourcev1beta2 "github.com/fluxcd/source-controller/api/v1beta2"
sourcev1 "github.com/fluxcd/source-controller/api/v1"
grpc_retry "github.com/grpc-ecosystem/go-grpc-middleware/retry"
corev1 "github.com/vmware-tanzu/kubeapps/cmd/kubeapps-apis/gen/core/packages/v1alpha1"
fluxplugin "github.com/vmware-tanzu/kubeapps/cmd/kubeapps-apis/gen/plugins/fluxv2/packages/v1alpha1"
Expand Down Expand Up @@ -329,12 +329,12 @@ func TestKindClusterRepoAndChartRBAC(t *testing.T) {
rules := map[string][]rbacv1.PolicyRule{
names[1].Namespace: {
{
APIGroups: []string{sourcev1beta2.GroupVersion.Group},
APIGroups: []string{sourcev1.GroupVersion.Group},
Resources: []string{fluxHelmRepositories},
Verbs: []string{"get", "list"},
},
{
APIGroups: []string{sourcev1beta2.GroupVersion.Group},
APIGroups: []string{sourcev1.GroupVersion.Group},
Resources: []string{"helmcharts"},
Verbs: []string{"get", "list"},
},
Expand Down
24 changes: 12 additions & 12 deletions cmd/kubeapps-apis/plugins/fluxv2/packages/v1alpha1/chart_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@

"github.com/bufbuild/connect-go"
fluxmeta "github.com/fluxcd/pkg/apis/meta"
sourcev1 "github.com/fluxcd/source-controller/api/v1"

Check failure on line 18 in cmd/kubeapps-apis/plugins/fluxv2/packages/v1alpha1/chart_test.go

View workflow job for this annotation

GitHub Actions / CI / linters / golang-linter

other declaration of sourcev1

Check failure on line 18 in cmd/kubeapps-apis/plugins/fluxv2/packages/v1alpha1/chart_test.go

View workflow job for this annotation

GitHub Actions / CI / test_go

other declaration of sourcev1
sourcev1beta2 "github.com/fluxcd/source-controller/api/v1beta2"
sourcev1 "github.com/fluxcd/source-controller/api/v1"

Check failure on line 19 in cmd/kubeapps-apis/plugins/fluxv2/packages/v1alpha1/chart_test.go

View workflow job for this annotation

GitHub Actions / CI / linters / golang-linter

sourcev1 redeclared in this block

Check failure on line 19 in cmd/kubeapps-apis/plugins/fluxv2/packages/v1alpha1/chart_test.go

View workflow job for this annotation

GitHub Actions / CI / test_go

sourcev1 redeclared in this block
"github.com/go-redis/redismock/v8"
corev1 "github.com/vmware-tanzu/kubeapps/cmd/kubeapps-apis/gen/core/packages/v1alpha1"
"github.com/vmware-tanzu/kubeapps/cmd/kubeapps-apis/plugins/fluxv2/packages/v1alpha1/cache"
Expand Down Expand Up @@ -187,7 +187,7 @@
}
defer ts2.Close()

s, mock, err := newServerWithRepos(t, []sourcev1beta2.HelmRepository{*repo}, charts, secretObjs)
s, mock, err := newServerWithRepos(t, []sourcev1.HelmRepository{*repo}, charts, secretObjs)
if err != nil {
t.Fatalf("%+v", err)
}
Expand Down Expand Up @@ -291,7 +291,7 @@
}
defer ts2.Close()

s, mock, err := newServerWithRepos(t, []sourcev1beta2.HelmRepository{*repo}, charts, nil)
s, mock, err := newServerWithRepos(t, []sourcev1.HelmRepository{*repo}, charts, nil)
if err != nil {
t.Fatalf("%+v", err)
}
Expand Down Expand Up @@ -468,7 +468,7 @@
}
defer ts2.Close()

s, mock, err := newServerWithRepos(t, []sourcev1beta2.HelmRepository{*repo}, charts, nil)
s, mock, err := newServerWithRepos(t, []sourcev1.HelmRepository{*repo}, charts, nil)
if err != nil {
t.Fatalf("%+v", err)
}
Expand Down Expand Up @@ -649,7 +649,7 @@
}
defer ts.Close()

s, mock, err := newServerWithRepos(t, []sourcev1beta2.HelmRepository{*repo}, charts, nil)
s, mock, err := newServerWithRepos(t, []sourcev1.HelmRepository{*repo}, charts, nil)
if err != nil {
t.Fatalf("%+v", err)
}
Expand Down Expand Up @@ -736,7 +736,7 @@
t.Fatal(err)
}

s, mock, err := newServerWithRepos(t, []sourcev1beta2.HelmRepository{*repo}, tc.charts, nil)
s, mock, err := newServerWithRepos(t, []sourcev1.HelmRepository{*repo}, tc.charts, nil)
if err != nil {
t.Fatalf("%+v", err)
}
Expand Down Expand Up @@ -979,12 +979,12 @@
}
}))

repoSpec := &sourcev1beta2.HelmRepositorySpec{
repoSpec := &sourcev1.HelmRepositorySpec{
URL: ts.URL,
Interval: metav1.Duration{Duration: 1 * time.Minute},
}

repoStatus := &sourcev1beta2.HelmRepositoryStatus{
repoStatus := &sourcev1.HelmRepositoryStatus{
Artifact: &sourcev1.Artifact{
Digest: "651f952130ea96823711d08345b85e82be011dc6",
LastUpdateTime: metav1.Time{Time: lastUpdateTime},
Expand All @@ -1003,7 +1003,7 @@
defer ts.Close()

s, mock, err := newServerWithRepos(t,
[]sourcev1beta2.HelmRepository{repo},
[]sourcev1.HelmRepository{repo},
[]testSpecChartWithUrl{
{
chartID: fmt.Sprintf("%s/airflow", repoName),
Expand Down Expand Up @@ -1073,7 +1073,7 @@
t.Fatal(err)
}

s, mock, err := newServerWithRepos(t, []sourcev1beta2.HelmRepository{*repo}, tc.charts, nil)
s, mock, err := newServerWithRepos(t, []sourcev1.HelmRepository{*repo}, tc.charts, nil)
if err != nil {
t.Fatalf("%+v", err)
}
Expand Down Expand Up @@ -1129,8 +1129,8 @@
}
}

func newChart(name, namespace string, spec *sourcev1beta2.HelmChartSpec, status *sourcev1beta2.HelmChartStatus) sourcev1beta2.HelmChart {
helmChart := sourcev1beta2.HelmChart{
func newChart(name, namespace string, spec *sourcev1.HelmChartSpec, status *sourcev1.HelmChartStatus) sourcev1.HelmChart {
helmChart := sourcev1.HelmChart{
ObjectMeta: metav1.ObjectMeta{
Name: name,
Generation: int64(1),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ import (
"github.com/bufbuild/connect-go"
"github.com/docker/cli/cli/config"
"github.com/docker/cli/cli/config/credentials"
helmv2beta2 "github.com/fluxcd/helm-controller/api/v2beta2"
sourcev1beta2 "github.com/fluxcd/source-controller/api/v1beta2"
helmv2 "github.com/fluxcd/helm-controller/api/v2"
sourcev1 "github.com/fluxcd/source-controller/api/v1"
"github.com/go-redis/redis/v8"
"github.com/google/go-containerregistry/pkg/authn"
plugins "github.com/vmware-tanzu/kubeapps/cmd/kubeapps-apis/gen/core/plugins/v1alpha1"
Expand Down Expand Up @@ -68,20 +68,20 @@ func init() {
}

repositoriesGvr = schema.GroupVersionResource{
Group: sourcev1beta2.GroupVersion.Group,
Version: sourcev1beta2.GroupVersion.Version,
Group: sourcev1.GroupVersion.Group,
Version: sourcev1.GroupVersion.Version,
Resource: "helmrepositories",
}

chartsGvr = schema.GroupVersionResource{
Group: sourcev1beta2.GroupVersion.Group,
Version: sourcev1beta2.GroupVersion.Version,
Group: sourcev1.GroupVersion.Group,
Version: sourcev1.GroupVersion.Version,
Resource: "helmcharts",
}

releasesGvr = schema.GroupVersionResource{
Group: helmv2beta2.GroupVersion.Group,
Version: helmv2beta2.GroupVersion.Version,
Group: helmv2.GroupVersion.Group,
Version: helmv2.GroupVersion.Version,
Resource: "helmreleases",
}
}
Expand Down
Loading
Loading