Skip to content

Commit

Permalink
Merge branch 'main' into sheidkamp/cherry-pick-helm-doc-gen
Browse files Browse the repository at this point in the history
  • Loading branch information
nfuden authored Nov 15, 2024
2 parents 1bb7756 + 8a38144 commit 9dcfad9
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 12 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/pr-unit-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ name: Unit Tests
#
# Our historical unit tests are run via CloudBuild
# Overtime, it would be valuable to consolidate these approaches
env:
VERSION: '1.0.0-ci1'
GITHUB_TOKEN: ${{ github.token }}

on:
pull_request:
Expand Down
4 changes: 4 additions & 0 deletions changelog/v1.18.0-beta35/crdcheck.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
changelog:
- type: NON_USER_FACING
description: >-
Fix CRD check to allow the group/kind to be missing.
3 changes: 2 additions & 1 deletion pkg/schemes/extended_scheme.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"fmt"

"github.com/solo-io/gloo/projects/gateway2/wellknown"
"k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/api/meta"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/client-go/discovery"
Expand Down Expand Up @@ -38,7 +39,7 @@ func CRDExists(restConfig *rest.Config, group, version, kind string) (bool, erro
groupVersion := fmt.Sprintf("%s/%s", group, version)
apiResourceList, err := discoveryClient.ServerResourcesForGroupVersion(groupVersion)
if err != nil {
if discovery.IsGroupDiscoveryFailedError(err) || meta.IsNoMatchError(err) {
if errors.IsNotFound(err) || discovery.IsGroupDiscoveryFailedError(err) || meta.IsNoMatchError(err) {
return false, nil
}
return false, err
Expand Down
4 changes: 3 additions & 1 deletion projects/gateway2/controller/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,8 @@ func NewControllerBuilder(ctx context.Context, cfg StartConfig) (*ControllerBuil
krt.WithName("AuthConfig"))

inputChannels := proxy_syncer.NewGatewayInputChannels()

setupLog.Info("initializing k8sgateway extensions")
k8sGwExtensions, err := cfg.ExtensionsFactory(ctx, ext.K8sGatewayExtensionsFactoryParameters{
Mgr: mgr,
IstioClient: cfg.Client,
Expand All @@ -169,6 +171,7 @@ func NewControllerBuilder(ctx context.Context, cfg StartConfig) (*ControllerBuil
}

// Create the proxy syncer for the Gateway API resources
setupLog.Info("initializing proxy syncer")
proxySyncer := proxy_syncer.NewProxySyncer(
ctx,
cfg.InitialSettings,
Expand All @@ -188,7 +191,6 @@ func NewControllerBuilder(ctx context.Context, cfg StartConfig) (*ControllerBuil
cfg.SetupOpts.ProxyReconcileQueue,
)
proxySyncer.Init(ctx, cfg.Debugger)

if err := mgr.Add(proxySyncer); err != nil {
setupLog.Error(err, "unable to add proxySyncer runnable")
return nil, err
Expand Down
13 changes: 5 additions & 8 deletions projects/gateway2/setup/ggv2setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@ package setup

import (
"context"
"errors"
"fmt"
"sort"
"strings"

"errors"

"github.com/solo-io/gloo/pkg/utils/envutils"
"github.com/solo-io/gloo/pkg/utils/setuputils"
gloostatusutils "github.com/solo-io/gloo/pkg/utils/statusutils"
Expand Down Expand Up @@ -43,9 +42,7 @@ import (
ctrl "sigs.k8s.io/controller-runtime"
)

var (
settingsGVR = glookubev1.SchemeGroupVersion.WithResource("settings")
)
var settingsGVR = glookubev1.SchemeGroupVersion.WithResource("settings")

func createKubeClient(restConfig *rest.Config) (istiokube.Client, error) {
restCfg := istiokube.NewClientConfigForRestConfig(restConfig)
Expand Down Expand Up @@ -77,15 +74,14 @@ func getInitialSettings(ctx context.Context, c istiokube.Client, nns types.Names
return nil
}
return out

}

func StartGGv2(ctx context.Context,
setupOpts *bootstrap.SetupOpts,
uccBuilder krtcollections.UniquelyConnectedClientsBulider,
extensionsFactory extensions.K8sGatewayExtensionsFactory,
pluginRegistryFactory func(opts registry.PluginOpts) plugins.PluginRegistryFactory) error {

pluginRegistryFactory func(opts registry.PluginOpts) plugins.PluginRegistryFactory,
) error {
restConfig := ctrl.GetConfigOrDie()

return StartGGv2WithConfig(ctx, setupOpts, restConfig, uccBuilder, extensionsFactory, pluginRegistryFactory, setuputils.SetupNamespaceName())
Expand Down Expand Up @@ -164,6 +160,7 @@ func StartGGv2WithConfig(ctx context.Context,
Debugger: setupOpts.KrtDebugger,
})
if err != nil {
logger.Error("failed initializing controller: ", err)
return err
}
/// no collections after this point
Expand Down
4 changes: 2 additions & 2 deletions test/kubernetes/testutils/helper/util_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ func TestReturnsLatestPatchForMinor(t *testing.T) {
ctx := context.Background()
// this is fine because this is a public repo
client := githubutils.GetClientWithOrWithoutToken(ctx)
minor, err := getLatestReleasedPatchVersion(ctx, client, "gloo", 1, 8)
minor, err := getLatestReleasedPatchVersion(ctx, client, "gloo", 1, 9)
require.NoError(t, err)

assert.Equal(t, "v1.8.37", minor.String())
assert.Equal(t, "v1.9.30", minor.String())
}

0 comments on commit 9dcfad9

Please sign in to comment.