@underpostnet/underpost 2.97.0 → 2.97.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -487,8 +487,8 @@ EOF
487
487
  shellExec(`sudo sed -i 's/^SELINUX=enforcing$/SELINUX=permissive/' /etc/selinux/config`);
488
488
 
489
489
  // Enable and start Docker and Kubelet services
490
- shellExec(`sudo systemctl enable --now docker || true`); // Docker might not be needed for K3s
491
- shellExec(`sudo systemctl enable --now kubelet || true`); // Kubelet might not be needed for K3s (K3s uses its own agent)
490
+ shellExec(`sudo systemctl enable --now docker`); // Docker might not be needed for K3s
491
+ shellExec(`sudo systemctl enable --now kubelet`); // Kubelet might not be needed for K3s (K3s uses its own agent)
492
492
 
493
493
  // Configure containerd for SystemdCgroup and explicitly disable SELinux
494
494
  // This is crucial for kubelet/k3s to interact correctly with containerd
@@ -496,9 +496,9 @@ EOF
496
496
  shellExec(`sudo sed -i -e "s/SystemdCgroup = false/SystemdCgroup = true/g" /etc/containerd/config.toml`);
497
497
  // Add a new line to disable SELinux for the runc runtime
498
498
  // shellExec(
499
- // `sudo sed -i '/SystemdCgroup = true/a selinux_disabled = true' /etc/containerd/config.toml || true`,
499
+ // `sudo sed -i '/SystemdCgroup = true/a selinux_disabled = true' /etc/containerd/config.toml`,
500
500
  // );
501
- shellExec(`sudo service docker restart || true`); // Restart docker after containerd config changes
501
+ shellExec(`sudo service docker restart`); // Restart docker after containerd config changes
502
502
  shellExec(`sudo systemctl enable --now containerd.service`);
503
503
  shellExec(`sudo systemctl restart containerd`); // Restart containerd to apply changes
504
504
 
@@ -533,8 +533,8 @@ net.ipv4.ip_forward = 1' | sudo tee ${iptableConfPath}`,
533
533
  shellExec(`${underpostRoot}/scripts/nat-iptables.sh`, { silent: true });
534
534
 
535
535
  // Disable firewalld (common cause of network issues in Kubernetes)
536
- shellExec(`sudo systemctl stop firewalld || true`); // Stop if running
537
- shellExec(`sudo systemctl disable firewalld || true`); // Disable from starting on boot
536
+ shellExec(`sudo systemctl stop firewalld`); // Stop if running
537
+ shellExec(`sudo systemctl disable firewalld`); // Disable from starting on boot
538
538
  },
539
539
 
540
540
  /**
@@ -563,7 +563,7 @@ net.ipv4.ip_forward = 1' | sudo tee ${iptableConfPath}`,
563
563
  } else if (clusterType === 'kind') {
564
564
  // For Kind, the kubeconfig is usually merged automatically or can be explicitly exported
565
565
  // This command ensures it's merged into the default kubeconfig
566
- shellExec(`kind get kubeconfig > ~/.kube/config || true`);
566
+ shellExec(`kind get kubeconfig > ~/.kube/config`);
567
567
  shellExec(`sudo -E chown $(id -u):$(id -g) ~/.kube/config`);
568
568
  } else {
569
569
  logger.warn('No specific kubeconfig path defined for this cluster type, or it is managed automatically.');
@@ -622,7 +622,7 @@ net.ipv4.ip_forward = 1' | sudo tee ${iptableConfPath}`,
622
622
  if (pv.spec.hostPath && pv.spec.hostPath.path) {
623
623
  const hostPath = pv.spec.hostPath.path;
624
624
  logger.info(`Removing data from host path for PV '${pv.metadata.name}': ${hostPath}`);
625
- shellExec(`sudo rm -rf ${hostPath}/* || true`);
625
+ shellExec(`sudo rm -rf ${hostPath}/*`);
626
626
  }
627
627
  }
628
628
  } else {
@@ -637,52 +637,52 @@ net.ipv4.ip_forward = 1' | sudo tee ${iptableConfPath}`,
637
637
  // Enable SELinux permissive mode and restore file contexts.
638
638
  logger.info('Phase 2/7: Stopping services and fixing SELinux...');
639
639
  logger.info(' -> Ensuring SELinux is in permissive mode...');
640
- shellExec(`sudo setenforce 0 || true`);
641
- shellExec(`sudo sed -i 's/^SELINUX=enforcing$/SELINUX=permissive/' /etc/selinux/config || true`);
640
+ shellExec(`sudo setenforce 0`);
641
+ shellExec(`sudo sed -i 's/^SELINUX=enforcing$/SELINUX=permissive/' /etc/selinux/config`);
642
642
  logger.info(' -> Restoring SELinux contexts for container data directories...');
643
643
  // The 'restorecon' command corrects file system security contexts.
644
- shellExec(`sudo restorecon -Rv /var/lib/containerd || true`);
645
- shellExec(`sudo restorecon -Rv /var/lib/kubelet || true`);
644
+ shellExec(`sudo restorecon -Rv /var/lib/containerd`);
645
+ shellExec(`sudo restorecon -Rv /var/lib/kubelet`);
646
646
 
647
647
  logger.info(' -> Stopping kubelet, docker, and podman services...');
648
- shellExec('sudo systemctl stop kubelet || true');
649
- shellExec('sudo systemctl stop docker || true');
650
- shellExec('sudo systemctl stop podman || true');
648
+ shellExec('sudo systemctl stop kubelet');
649
+ shellExec('sudo systemctl stop docker');
650
+ shellExec('sudo systemctl stop podman');
651
651
  // Safely unmount pod filesystems to avoid errors.
652
- shellExec('sudo umount -f /var/lib/kubelet/pods/*/* || true');
652
+ shellExec('sudo umount -f /var/lib/kubelet/pods/*/*');
653
653
 
654
654
  // Phase 3: Execute official uninstallation commands
655
655
  logger.info('Phase 3/7: Executing official reset and uninstallation commands...');
656
656
  logger.info(' -> Executing kubeadm reset...');
657
- shellExec('sudo kubeadm reset --force || true');
657
+ shellExec('sudo kubeadm reset --force');
658
658
  logger.info(' -> Executing K3s uninstallation script if it exists...');
659
- shellExec('sudo /usr/local/bin/k3s-uninstall.sh || true');
659
+ shellExec('sudo /usr/local/bin/k3s-uninstall.sh');
660
660
  logger.info(' -> Deleting Kind clusters...');
661
- shellExec('kind get clusters | xargs -r -t -n1 kind delete cluster || true');
661
+ shellExec('kind get clusters | xargs -r -t -n1 kind delete cluster');
662
662
 
663
663
  // Phase 4: File system cleanup
664
664
  logger.info('Phase 4/7: Cleaning up remaining file system artifacts...');
665
665
  // Remove any leftover configurations and data.
666
- shellExec('sudo rm -rf /etc/kubernetes/* || true');
667
- shellExec('sudo rm -rf /etc/cni/net.d/* || true');
668
- shellExec('sudo rm -rf /var/lib/kubelet/* || true');
669
- shellExec('sudo rm -rf /var/lib/cni/* || true');
670
- shellExec('sudo rm -rf /var/lib/docker/* || true');
671
- shellExec('sudo rm -rf /var/lib/containerd/* || true');
672
- shellExec('sudo rm -rf /var/lib/containers/storage/* || true');
666
+ shellExec('sudo rm -rf /etc/kubernetes/*');
667
+ shellExec('sudo rm -rf /etc/cni/net.d/*');
668
+ shellExec('sudo rm -rf /var/lib/kubelet/*');
669
+ shellExec('sudo rm -rf /var/lib/cni/*');
670
+ shellExec('sudo rm -rf /var/lib/docker/*');
671
+ shellExec('sudo rm -rf /var/lib/containerd/*');
672
+ shellExec('sudo rm -rf /var/lib/containers/storage/*');
673
673
  // Clean up the current user's kubeconfig.
674
- shellExec('rm -rf $HOME/.kube || true');
674
+ shellExec('rm -rf $HOME/.kube');
675
675
 
676
676
  // Phase 5: Host network cleanup
677
677
  logger.info('Phase 5/7: Cleaning up host network configurations...');
678
678
  // Remove iptables rules and CNI network interfaces.
679
- shellExec('sudo iptables -F || true');
680
- shellExec('sudo iptables -t nat -F || true');
679
+ shellExec('sudo iptables -F');
680
+ shellExec('sudo iptables -t nat -F');
681
681
  // Restore iptables rules
682
682
  shellExec(`chmod +x ${options.underpostRoot}/scripts/nat-iptables.sh`);
683
683
  shellExec(`${options.underpostRoot}/scripts/nat-iptables.sh`, { silent: true });
684
- shellExec('sudo ip link del cni0 || true');
685
- shellExec('sudo ip link del flannel.1 || true');
684
+ shellExec('sudo ip link del cni0');
685
+ shellExec('sudo ip link del flannel.1');
686
686
 
687
687
  logger.info('Phase 6/7: Clean up images');
688
688
  shellExec(`podman rmi $(podman images -qa) --force`);
@@ -792,51 +792,49 @@ EOF`);
792
792
 
793
793
  // Remove Kind
794
794
  console.log('Removing Kind...');
795
- shellExec(`sudo rm -f /bin/kind || true`);
795
+ shellExec(`sudo rm -f /bin/kind`);
796
796
 
797
797
  // Remove Helm
798
798
  console.log('Removing Helm...');
799
- shellExec(`sudo rm -f /usr/local/bin/helm || true`);
800
- shellExec(`sudo rm -f /usr/local/bin/helm.sh || true`); // clean up the install script if it exists
799
+ shellExec(`sudo rm -f /usr/local/bin/helm`);
800
+ shellExec(`sudo rm -f /usr/local/bin/helm.sh`); // clean up the install script if it exists
801
801
 
802
802
  // Remove Docker and its dependencies
803
803
  console.log('Removing Docker, containerd, and related packages...');
804
- shellExec(
805
- `sudo dnf -y remove docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin || true`,
806
- );
804
+ shellExec(`sudo dnf -y remove docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin`);
807
805
 
808
806
  // Remove Podman
809
807
  console.log('Removing Podman...');
810
- shellExec(`sudo dnf -y remove podman || true`);
808
+ shellExec(`sudo dnf -y remove podman`);
811
809
 
812
810
  // Remove Kubeadm, Kubelet, and Kubectl
813
811
  console.log('Removing Kubernetes tools...');
814
- shellExec(`sudo yum remove -y kubelet kubeadm kubectl || true`);
812
+ shellExec(`sudo yum remove -y kubelet kubeadm kubectl`);
815
813
 
816
814
  // Remove Kubernetes repo file
817
815
  console.log('Removing Kubernetes repository configuration...');
818
- shellExec(`sudo rm -f /etc/yum.repos.d/kubernetes.repo || true`);
816
+ shellExec(`sudo rm -f /etc/yum.repos.d/kubernetes.repo`);
819
817
 
820
818
  // Clean up Kubeadm config and data directories
821
819
  console.log('Cleaning up Kubernetes configuration directories...');
822
- shellExec(`sudo rm -rf /etc/kubernetes/pki || true`);
823
- shellExec(`sudo rm -rf ~/.kube || true`);
820
+ shellExec(`sudo rm -rf /etc/kubernetes/pki`);
821
+ shellExec(`sudo rm -rf ~/.kube`);
824
822
 
825
823
  // Stop and disable services
826
824
  console.log('Stopping and disabling services...');
827
- shellExec(`sudo systemctl stop docker.service || true`);
828
- shellExec(`sudo systemctl disable docker.service || true`);
829
- shellExec(`sudo systemctl stop containerd.service || true`);
830
- shellExec(`sudo systemctl disable containerd.service || true`);
831
- shellExec(`sudo systemctl stop kubelet.service || true`);
832
- shellExec(`sudo systemctl disable kubelet.service || true`);
825
+ shellExec(`sudo systemctl stop docker.service`);
826
+ shellExec(`sudo systemctl disable docker.service`);
827
+ shellExec(`sudo systemctl stop containerd.service`);
828
+ shellExec(`sudo systemctl disable containerd.service`);
829
+ shellExec(`sudo systemctl stop kubelet.service`);
830
+ shellExec(`sudo systemctl disable kubelet.service`);
833
831
 
834
832
  // Clean up config files
835
833
  console.log('Removing host configuration files...');
836
- shellExec(`sudo rm -f /etc/containerd/config.toml || true`);
837
- shellExec(`sudo rm -f /etc/sysctl.d/k8s.conf || true`);
838
- shellExec(`sudo rm -f /etc/sysctl.d/99-k8s-ipforward.conf || true`);
839
- shellExec(`sudo rm -f /etc/sysctl.d/99-k8s.conf || true`);
834
+ shellExec(`sudo rm -f /etc/containerd/config.toml`);
835
+ shellExec(`sudo rm -f /etc/sysctl.d/k8s.conf`);
836
+ shellExec(`sudo rm -f /etc/sysctl.d/99-k8s-ipforward.conf`);
837
+ shellExec(`sudo rm -f /etc/sysctl.d/99-k8s.conf`);
840
838
 
841
839
  // Restore SELinux to enforcing
842
840
  console.log('Restoring SELinux to enforcing mode...');
package/src/cli/deploy.js CHANGED
@@ -761,7 +761,7 @@ EOF`);
761
761
  // shellExec(`docker cp ${volume.volumeMountPath} kind-worker:${rootVolumeHostPath}`);
762
762
  shellExec(`tar -C ${volume.volumeMountPath} -c . | docker cp - kind-worker:${rootVolumeHostPath}`);
763
763
  shellExec(
764
- `docker exec -i kind-worker bash -c "chown -R 1000:1000 ${rootVolumeHostPath} || true; chmod -R 755 ${rootVolumeHostPath}"`,
764
+ `docker exec -i kind-worker bash -c "chown -R 1000:1000 ${rootVolumeHostPath}; chmod -R 755 ${rootVolumeHostPath}"`,
765
765
  );
766
766
  }
767
767
  shellExec(`kubectl delete pvc ${pvcId} -n ${namespace} --ignore-not-found`);
package/src/cli/index.js CHANGED
@@ -22,7 +22,7 @@ program.name('underpost').description(`underpost ci/cd cli ${Underpost.version}`
22
22
  program
23
23
  .command('new')
24
24
  .argument('[app-name]', 'The name of the new project.')
25
- .option('--deploy-id <deploy-id>', 'Crete deploy ID conf env files')
25
+ .option('--deploy-id <deploy-id>', 'Create deploy ID conf env files')
26
26
  .option('--sub-conf <sub-conf>', 'Create sub conf env files')
27
27
  .option('--cluster', 'Create deploy ID cluster files and sync to current cluster')
28
28
  .option('--build-repos', 'Create deploy ID repositories')
@@ -628,11 +628,14 @@ program
628
628
  .option('--nfs-build', 'Builds an NFS root filesystem for a workflow id config architecture using QEMU emulation.')
629
629
  .option('--nfs-mount', 'Mounts the NFS root filesystem for a workflow id config architecture.')
630
630
  .option('--nfs-unmount', 'Unmounts the NFS root filesystem for a workflow id config architecture.')
631
+ .option('--nfs-build-server', 'Builds the NFS server for a workflow id config architecture.')
631
632
  .option('--nfs-sh', 'Copies QEMU emulation root entrypoint shell command to the clipboard.')
632
633
  .option('--cloud-init', 'Sets the kernel parameters and sets the necessary seed users on the HTTP server.')
633
634
  .option('--cloud-init-update', 'Updates cloud init for a workflow id config architecture.')
634
635
  .option('--ubuntu-tools-build', 'Builds ubuntu tools for chroot environment.')
635
636
  .option('--ubuntu-tools-test', 'Tests ubuntu tools in chroot environment.')
637
+ .option('--rocky-tools-build', 'Builds rocky linux tools for chroot environment.')
638
+ .option('--rocky-tools-test', 'Tests rocky linux tools in chroot environment.')
636
639
  .option('--bootcmd <bootcmd-list>', 'Comma-separated list of boot commands to execute.')
637
640
  .option('--runcmd <runcmd-list>', 'Comma-separated list of run commands to execute.')
638
641
  .option('--logs <log-id>', 'Displays logs for log id: dhcp, cloud, machine, cloud-config.')
package/src/cli/lxd.js CHANGED
@@ -74,8 +74,8 @@ class UnderpostLxd {
74
74
  const npmRoot = getNpmRootPath();
75
75
  const underpostRoot = options?.dev === true ? '.' : `${npmRoot}/underpost`;
76
76
  if (options.reset === true) {
77
- shellExec(`sudo systemctl stop snap.lxd.daemon || true`);
78
- shellExec(`sudo snap remove lxd --purge || true`);
77
+ shellExec(`sudo systemctl stop snap.lxd.daemon`);
78
+ shellExec(`sudo snap remove lxd --purge`);
79
79
  }
80
80
  if (options.install === true) shellExec(`sudo snap install lxd`);
81
81
  if (options.init === true) {
@@ -213,7 +213,7 @@ ipv6.address=none`);
213
213
  for (const port of ports.split(',')) {
214
214
  for (const protocol of protocols) {
215
215
  const deviceName = `${vmName}-${protocol}-port-${port}`;
216
- shellExec(`lxc config device remove ${vmName} ${deviceName} || true`); // Use || true to prevent error if device doesn't exist
216
+ shellExec(`lxc config device remove ${vmName} ${deviceName}`); // Use to prevent error if device doesn't exist
217
217
  shellExec(
218
218
  `lxc config device add ${vmName} ${deviceName} proxy listen=${protocol}:${hostIp}:${port} connect=${protocol}:${vmIp}:${port} nat=true`,
219
219
  );
package/src/cli/run.js CHANGED
@@ -925,7 +925,7 @@ EOF
925
925
  shellExec(`docker exec -i kind-worker bash -c "mkdir -p ${volumeHostPath}"`);
926
926
  shellExec(`docker cp ${volumeHostPath}/engine kind-worker:${volumeHostPath}/engine`);
927
927
  shellExec(
928
- `docker exec -i kind-worker bash -c "chown -R 1000:1000 ${volumeHostPath} || true; chmod -R 755 ${volumeHostPath}"`,
928
+ `docker exec -i kind-worker bash -c "chown -R 1000:1000 ${volumeHostPath}; chmod -R 755 ${volumeHostPath}"`,
929
929
  );
930
930
  } else {
931
931
  shellExec(`kubectl apply -f ${options.underpostRoot}/manifests/pv-pvc-dd.yaml -n ${options.namespace}`);
@@ -865,10 +865,17 @@ const subThemeManager = {
865
865
  return html`<style>
866
866
  button:hover,
867
867
  .a-btn:hover,
868
- .main-btn-menu-active {
868
+ .main-btn-menu-active,
869
+ .top-bar-search-box-container:hover {
869
870
  color: ${this.lightColor};
870
871
  background-color: ${lightenHex(this.lightColor, 0.8)};
871
872
  }
873
+ .top-bar-search-box-container i {
874
+ color: #000;
875
+ }
876
+ .top-bar-search-box-container:hover i {
877
+ color: ${this.lightColor};
878
+ }
872
879
  .main-sub-btn-active {
873
880
  color: ${this.lightColor};
874
881
  background-color: rgba(0, 0, 0, 0.3);
@@ -887,10 +894,17 @@ const subThemeManager = {
887
894
  return html`<style>
888
895
  button:hover,
889
896
  .a-btn:hover,
890
- .main-btn-menu-active {
897
+ .main-btn-menu-active,
898
+ .top-bar-search-box-container:hover {
891
899
  color: ${lightenHex(this.darkColor, 0.8)};
892
900
  background-color: ${darkenHex(this.darkColor, 0.75)};
893
901
  }
902
+ .top-bar-search-box-container i {
903
+ color: #fff;
904
+ }
905
+ .top-bar-search-box-container:hover i {
906
+ color: ${lightenHex(this.darkColor, 0.8)};
907
+ }
894
908
  .main-sub-btn-active {
895
909
  color: ${lightenHex(this.darkColor, 0.8)};
896
910
  background-color: rgba(255, 255, 255, 0.3);