Skip to content

Commit

Permalink
additional feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
Craig O'Donnell committed Oct 13, 2023
1 parent 0fba0f9 commit 416a459
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 31 deletions.
23 changes: 3 additions & 20 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ jobs:
helm install test-chart oci://registry.replicated.com/$APP_SLUG/$CHANNEL_SLUG/test-chart --set replicated.integration.enabled=false -f test-values.yaml --wait --timeout 2m
COUNTER=1
while ! kubectl logs deploy/replicated | grep -qv 'Generated informers from Helm release'; do
while ! kubectl logs deploy/replicated | grep -qv 'Generating status informers from Helm release'; do
((COUNTER += 1))
if [ $COUNTER -gt 60 ]; then
echo "Did not receive empty status informers"
Expand All @@ -408,7 +408,7 @@ jobs:
helm upgrade test-chart oci://registry.replicated.com/$APP_SLUG/$CHANNEL_SLUG/test-chart --set replicated.integration.enabled=false --wait --timeout 2m
COUNTER=1
while ! kubectl logs deploy/replicated | grep -q 'Generated informers from Helm release'; do
while ! kubectl logs deploy/replicated | grep -q 'Generating status informers from Helm release'; do
((COUNTER += 1))
if [ $COUNTER -gt 60 ]; then
echo "Did not receive default status informers"
Expand All @@ -428,7 +428,7 @@ jobs:
kubectl rollout status deployment replicated --timeout=2m
COUNTER=1
while ! kubectl logs deploy/replicated | grep -qv 'Generated informers from Helm release'; do
while ! kubectl logs deploy/replicated | grep -qv 'Generating status informers from Helm release'; do
((COUNTER += 1))
if [ $COUNTER -gt 60 ]; then
echo "Did not receive empty status informers"
Expand All @@ -438,23 +438,6 @@ jobs:
sleep 1
done
- name: Upgrade via kubectl as subchart in production mode to use default status informers
run: |
helm template test-chart oci://registry.replicated.com/$APP_SLUG/$CHANNEL_SLUG/test-chart --set replicated.integration.enabled=false | kubectl apply -f -
kubectl rollout status deployment test-chart --timeout=2m
kubectl rollout status deployment replicated --timeout=2m
COUNTER=1
while ! kubectl logs deploy/replicated | grep -qv 'Generated informers from Helm release'; do
((COUNTER += 1))
if [ $COUNTER -gt 60 ]; then
echo "Did not receive default status informers"
kubectl logs deploy/replicated
exit 1
fi
sleep 1
done
- name: Uninstall test-chart via kubectl
run: |
helm template test-chart oci://registry.replicated.com/$APP_SLUG/$CHANNEL_SLUG/test-chart --set replicated.integration.enabled=false -f test-values.yaml | kubectl delete -f -
Expand Down
18 changes: 7 additions & 11 deletions pkg/apiserver/bootstrap.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,17 +132,13 @@ func bootstrap(params APIServerParams) error {

// if no status informers are provided, generate them from the helm release
informers := params.StatusInformers
if informers == nil {
informers = []appstatetypes.StatusInformerString{}
if helm.IsHelmManaged() {
helmRelease, err := helm.GetRelease(helm.GetReleaseName())
if err != nil {
return errors.Wrap(err, "failed to get helm release")
}
if helmRelease != nil {
informers = appstate.GenerateStatusInformersForManifest(helmRelease.Manifest)
logger.Infof("Generated informers from Helm release: %v", informers)
}
if informers == nil && helm.IsHelmManaged() {
helmRelease, err := helm.GetRelease(helm.GetReleaseName())
if err != nil {
return errors.Wrap(err, "failed to get helm release")
}
if helmRelease != nil {
informers = appstate.GenerateStatusInformersForManifest(helmRelease.Manifest)
}
}

Expand Down
2 changes: 2 additions & 0 deletions pkg/appstate/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,5 +99,7 @@ func GenerateStatusInformersForManifest(manifest string) []types.StatusInformerS
}
}

logger.Infof("Generating status informers from Helm release: %v", informers)

return informers
}

0 comments on commit 416a459

Please sign in to comment.