-
Notifications
You must be signed in to change notification settings - Fork 2
Remove GetProfiles and GetProfilesValues from enterprise #391
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
Conversation
Failure doesn't seem related:
|
999531e
to
4dd9c41
Compare
@@ -101,7 +105,10 @@ func StartServer(ctx context.Context, log logr.Logger, tempDir string) error { | |||
sourcev1beta1.AddToScheme, | |||
} | |||
schemeBuilder.AddToScheme(scheme) | |||
kubeClientConfig := config.GetConfigOrDie() | |||
kubeClientConfig, err := config.GetConfig() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added this because I run into a problem where this was erroring out, but didn't return any kind of error message at all. Because the underlying logger for config is not initialised properly, thus it was pushing the log message into the void.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice one!
The test failure is probably me somehow. Something must still be missing. Maybe the UI also needs to be rebound somewhere? I don't know, I need someone to review this who has better understanding of enterprise and the UI. |
We have seen the panic in other PRs today actually so might be something has changed somewhere |
48bbeab
to
46c90d9
Compare
46c90d9
to
e574928
Compare
wegogit "github.com/weaveworks/weave-gitops/pkg/git" | ||
"github.com/weaveworks/weave-gitops/pkg/server/middleware" | ||
"google.golang.org/genproto/googleapis/api/httpbody" | ||
"google.golang.org/grpc/codes" | ||
"google.golang.org/grpc/metadata" | ||
grpcStatus "google.golang.org/grpc/status" | ||
"gopkg.in/yaml.v2" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fuuuuuu 😡
Woooot all green 🟢 Also tested manually, it seems to be okay, but I'm getting a weird url problem when it's trying to download the profile index file?
Not yet sure what to do about this. |
Are you getting this error locally? Could be you need to set |
@foot Yep, locally. :) Ok, cool, I'll try to set that.
And indeed, this does not set SOURCE_CONTROLLER_LOCALHOST, and neither does it set RUNTIME_NAMESPACE for the record. |
f2dc912
to
de09ffd
Compare
@foot I'm still getting the same even after doing the steps in that Dev doc. In any case, I'm fairly confident that this thing is working, but I can't manually verify it on my machine. :/ |
cmd/clusters-service/app/server.go
Outdated
helmRepoName := viper.GetString("profile-helm-repository") | ||
helmRepoNamespace := os.Getenv("RUNTIME_NAMESPACE") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we need to check if either are empty and error appropriately? Although I'm guessing helmRepoName
has a default value here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We might pick a default for it somewhere but it really should be clearer. It would be nice to start the service locally without have to declare 10 env vars.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We might pick a default for it somewhere but it really should be clearer. It would be nice to start the service locally without have to declare 10 env vars.
+100 definitely. In core it uses a flag for the namespace instead of an environment variable (although a combination of both using viper is even better 😄 ). Perhaps worth migrating to that, then it just all gets passed around from the cmd
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah! 🤔 the |
cmd/clusters-service/app/server.go
Outdated
@@ -137,6 +147,7 @@ func StartServer(ctx context.Context, log logr.Logger, tempDir string) error { | |||
Namespace: os.Getenv("CAPI_TEMPLATES_NAMESPACE"), | |||
}), | |||
WithApplicationsConfig(appsConfig), | |||
WithProfilesConfig(profilesConfig), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
inline config creation maybe? And rename wego_server
to just core
or wego
? Its ugly/long atm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
¯_(ツ)_/¯ I have no opinion on this. I was following appsConfig style. I can do that too.
@@ -4,6 +4,43 @@ | |||
|
|||
A guide to making it easier to develop `weave-gitops-enterprise`. If you came here expecting but not finding an answer please make an issue to help improve these docs! | |||
|
|||
## Building the project |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice
cmd/clusters-service/app/server.go
Outdated
if err := capi_proto.RegisterClustersServiceHandlerServer(ctx, mux, server.NewClusterServer( | ||
args.Log, | ||
args.TemplateLibrary, | ||
args.GitProvider, | ||
args.KubernetesClient, | ||
args.DiscoveryClient, | ||
args.Database, | ||
args.CAPIClustersNamespace, | ||
args.ProfileHelmRepository, | ||
args.HelmRepositoryCacheDirectory, | ||
)); err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we move the NewClusterServer
out? hard to read like this IMO
Not yet 😞 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The removals/additionals LGTM, but would want a 2nd reviewer before merging 😄
corev1 "k8s.io/api/core/v1" | ||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
"k8s.io/client-go/kubernetes/scheme" | ||
|
||
capiv1 "github.com/weaveworks/weave-gitops-enterprise/cmd/clusters-service/api/v1alpha1" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! I just let vscode/gofmt take care of this. Will gofmt mess this up?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope. gofmt is a bit "dumb" it will sort anything that is in a single block. The further organisation that I'm doing is "manual". I'm following this:
- standard library
- third party
- organisational ( inside weaveworks )
- package local
I'm doing this via goland. :) Which can have these settings and autoformats. gofmt will just sort any distinctive groups.
make GITHUB_BUILD_TOKEN=${GITHUB_TOKEN} | ||
``` | ||
|
||
Further, don't forget to update your `~/.gitconfig` with: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! There is some library code duplication e.g. core/ee each have an impl. of fetchIndexFile
right now, not the end of the world at all, but nice if core exported a go api for using profiles from other endpoints too, wdyt? We can do this in another PR though.
Nice one! 🎉
@foot Definitely, I agree, including the observation made by Jake here #391 (comment) Extracting this to include |
Closes #311
Since 0.6.0 has merged the endpoints, I expect things to just work once this code is removed. What I'm not entirely sure about is the Profiles part on the frontend and the Chart values in the CreatePullRequest section. Since none of the backing code is there, I removed that. Is that okay?
Note: I'm trying to test this locally now, but it's hard to get all the infrastructure up and running.